From 53fab71e2cbd4de2e41ffd1b361777e48a8b77d7 Mon Sep 17 00:00:00 2001 From: EpicnessTwo Date: Mon, 9 Dec 2024 17:13:38 +0000 Subject: [PATCH] Initial API --- .gitignore | 19 + .idea/.gitignore | 8 + .idea/discord.xml | 7 + .idea/git_toolbox_blame.xml | 6 + .idea/modules.xml | 8 + .idea/php.xml | 20 + .idea/phpunit.xml | 10 + .idea/staffology-php.iml | 14 + .idea/vcs.xml | 6 + .openapi-generator-ignore | 23 + .openapi-generator/FILES | 1490 + .openapi-generator/VERSION | 1 + .php-cs-fixer.dist.php | 29 + .phplint.yml | 11 + .travis.yml | 12 + README.md | 1500 + composer.json | 47 + docs/Api/AccountApi.md | 1070 + docs/Api/AnalysisCategoryApi.md | 665 + docs/Api/AttachmentOrderApi.md | 610 + docs/Api/AuditApi.md | 80 + docs/Api/AutoEnrolmentApi.md | 994 + docs/Api/AverageHolidayPayHistoryApi.md | 450 + docs/Api/BenefitsApi.md | 338 + docs/Api/BillingApi.md | 504 + docs/Api/BureauApi.md | 384 + docs/Api/Cis300Api.md | 607 + docs/Api/CisVerificationApi.md | 607 + docs/Api/CostCentreApi.md | 527 + docs/Api/DepartmentApi.md | 527 + docs/Api/DpsApi.md | 647 + docs/Api/EmailApi.md | 526 + docs/Api/EmployeeApi.md | 1918 + docs/Api/EmployeeRoleApi.md | 1314 + docs/Api/EmployerApi.md | 1718 + docs/Api/EmployerGroupApi.md | 320 + docs/Api/EmployerTemplateApi.md | 202 + docs/Api/EngineApi.md | 354 + docs/Api/EpsApi.md | 741 + docs/Api/ExbApi.md | 672 + docs/Api/ExternalDataApi.md | 2121 + docs/Api/FpsApi.md | 678 + docs/Api/HmrcPaymentApi.md | 277 + docs/Api/HolidaySchemeApi.md | 321 + docs/Api/ImportApi.md | 737 + docs/Api/InvitationApi.md | 330 + docs/Api/JobApi.md | 328 + docs/Api/JournalTemplateApi.md | 202 + docs/Api/JournalTokenApi.md | 729 + docs/Api/LeaveApi.md | 764 + docs/Api/LoanApi.md | 543 + docs/Api/NoteApi.md | 543 + docs/Api/NvrApi.md | 607 + docs/Api/OccupationalPolicyApi.md | 331 + docs/Api/OccupationalSickLeaveHistoryApi.md | 471 + docs/Api/OpeningBalancesApi.md | 752 + docs/Api/P11HistoryApi.md | 269 + docs/Api/PayCodeApi.md | 657 + docs/Api/PayCodeSetApi.md | 331 + docs/Api/PayRunApi.md | 2371 + docs/Api/PayRunAsyncApi.md | 301 + docs/Api/PayScheduleApi.md | 774 + docs/Api/PaySpineApi.md | 2881 + docs/Api/PayeeApi.md | 331 + docs/Api/PensionApi.md | 606 + docs/Api/PensionRefundApi.md | 470 + docs/Api/PensionSchemeApi.md | 732 + docs/Api/ProcessingNoteApi.md | 496 + docs/Api/ReportPackApi.md | 331 + docs/Api/ReportTemplateApi.md | 331 + docs/Api/ReportsApi.md | 5365 ++ docs/Api/ReportsAsyncApi.md | 72 + docs/Api/TagApi.md | 527 + docs/Api/TenantApi.md | 3679 + docs/Api/TenantEmailApi.md | 397 + docs/Api/TermCalendarApi.md | 331 + docs/Api/TermCalendarYearApi.md | 341 + docs/Api/TierablePayApi.md | 70 + docs/Api/ToolsApi.md | 96 + docs/Api/WebhookApi.md | 531 + docs/Api/WorkingPatternApi.md | 331 + docs/Model/Address.md | 16 + docs/Model/AdvancedVarianceReport.md | 16 + docs/Model/AdvancedVarianceReportLine.md | 27 + .../AdvancedVarianceReportReportResponse.md | 12 + docs/Model/AeAction.md | 8 + docs/Model/AeAssessment.md | 26 + docs/Model/AeAssessmentAction.md | 16 + docs/Model/AeEmployeeState.md | 8 + docs/Model/AeExclusionCode.md | 8 + docs/Model/AeStatus.md | 8 + docs/Model/AeStatutoryLetter.md | 8 + docs/Model/AeUKWorker.md | 8 + docs/Model/AllowanceType.md | 8 + docs/Model/AnalysisCategory.md | 9 + docs/Model/AnalysisCategoryCode.md | 12 + docs/Model/AnalysisCategoryCodes.md | 12 + docs/Model/AnalysisCategoryIndex.md | 10 + docs/Model/AnalysisReport.md | 24 + docs/Model/AnalysisReportLine.md | 21 + docs/Model/AnalysisReportLineValue.md | 11 + docs/Model/AnalysisReportReportResponse.md | 12 + docs/Model/AnnualRoundingRule.md | 8 + docs/Model/AssumedPensionablePay.md | 8 + docs/Model/AttachmentOrder.md | 36 + docs/Model/AttachmentOrderPayment.md | 24 + docs/Model/AttachmentOrderReportResponse.md | 12 + docs/Model/AttachmentOrderType.md | 8 + docs/Model/AttachmentOrdersReport.md | 21 + .../AttachmentOrdersReportReportResponse.md | 12 + docs/Model/AuditEventAction.md | 8 + docs/Model/AuthScheme.md | 8 + docs/Model/AutoEnrolment.md | 18 + docs/Model/AutoEnrolmentSettings.md | 19 + docs/Model/AutoPilotFinaliseTime.md | 8 + docs/Model/AutomationSettings.md | 29 + docs/Model/AverageHolidayPayRateReport.md | 22 + docs/Model/AverageHolidayPayRateReportLine.md | 16 + ...erageHolidayPayRateReportReportResponse.md | 12 + docs/Model/AveragePayGradesReportLine.md | 17 + docs/Model/AverageWeeklyEarnings.md | 18 + docs/Model/AverageWeeklyEarningsResult.md | 8 + docs/Model/BackgroundTaskStatus.md | 8 + docs/Model/BankDetails.md | 16 + docs/Model/BankHolidayCollection.md | 8 + docs/Model/BankPaymentInstruction.md | 16 + .../BankPaymentInstructionReportResponse.md | 12 + .../Model/BankPaymentInstructionsCsvFormat.md | 8 + docs/Model/Benefit.md | 34 + docs/Model/BenefitDeclarationType.md | 8 + docs/Model/BenefitDetailsAssetType.md | 8 + docs/Model/BenefitDetailsCar.md | 33 + docs/Model/BenefitDetailsCarPowerType.md | 8 + docs/Model/BenefitDetailsClass1AType.md | 8 + docs/Model/BenefitDetailsLoan.md | 19 + docs/Model/BenefitDetailsNonClass1AType.md | 8 + docs/Model/BenefitDetailsPaymentType.md | 8 + docs/Model/BenefitDetailsUseOfAssetType.md | 8 + docs/Model/BenefitPayrolled.md | 11 + docs/Model/BenefitType.md | 8 + docs/Model/BureauSettings.md | 15 + docs/Model/CISSubContractorType.md | 8 + docs/Model/CISTaxStatus.md | 8 + docs/Model/CalendarEntry.md | 12 + docs/Model/CalendarEntryType.md | 8 + docs/Model/CalendarMonth.md | 8 + docs/Model/CarCharge.md | 17 + docs/Model/CarChargeRate.md | 11 + docs/Model/ChangeSummary.md | 28 + docs/Model/ChangeSummaryListReportResponse.md | 12 + docs/Model/Cis300.md | 21 + docs/Model/Cis300Declarations.md | 12 + docs/Model/Cis300ReportResponse.md | 12 + docs/Model/CisContractor.md | 10 + docs/Model/CisDetails.md | 18 + docs/Model/CisPartnership.md | 10 + docs/Model/CisRequest.md | 11 + docs/Model/CisReturn.md | 12 + docs/Model/CisStatement.md | 22 + docs/Model/CisStatementListReportResponse.md | 12 + docs/Model/CisSubContractor.md | 37 + docs/Model/CisSubContractorSummary.md | 19 + ...sSubContractorSummaryListReportResponse.md | 12 + docs/Model/CisVerification.md | 18 + docs/Model/CisVerificationDetails.md | 15 + docs/Model/ContractAddress.md | 16 + docs/Model/ContractAeAssessmentAction.md | 16 + docs/Model/ContractAeAssessmentRequest.md | 9 + docs/Model/ContractAeAssessmentResponse.md | 22 + docs/Model/ContractAllowanceGradesRequest.md | 12 + docs/Model/ContractAllowanceGradesResponse.md | 13 + .../ContractAllowanceGradesUpdateRequest.md | 13 + .../ContractAnalysisCategoryCodeRequest.md | 12 + .../ContractAnalysisCategoryCodeResponse.md | 13 + docs/Model/ContractAnalysisCategoryRequest.md | 9 + .../Model/ContractAnalysisCategoryResponse.md | 10 + docs/Model/ContractAutoEnrolmentRequest.md | 15 + docs/Model/ContractAutoEnrolmentResponse.md | 18 + docs/Model/ContractBankDetails.md | 16 + docs/Model/ContractCisDetailsRequest.md | 18 + docs/Model/ContractCisDetailsResponse.md | 18 + docs/Model/ContractCisPartnership.md | 10 + docs/Model/ContractCisSubContractor.md | 36 + docs/Model/ContractCisSubContractorItem.md | 12 + .../ContractCisVerificationDetailsRequest.md | 14 + .../ContractCisVerificationDetailsResponse.md | 15 + ...ntractCostCentreJournalOverridesRequest.md | 11 + ...tractCostCentreJournalOverridesResponse.md | 12 + ...tCostCentreJournalOverridesResponseItem.md | 12 + ...CostCentreJournalOverridesUpdateRequest.md | 12 + docs/Model/ContractCreateEmployeeRequest.md | 20 + ...ntractDepartmentJournalOverridesRequest.md | 11 + ...tractDepartmentJournalOverridesResponse.md | 12 + ...tDepartmentJournalOverridesResponseItem.md | 12 + ...DepartmentJournalOverridesUpdateRequest.md | 12 + docs/Model/ContractDepartmentRequest.md | 12 + docs/Model/ContractDepartmentResponse.md | 13 + docs/Model/ContractDirectorshipDetails.md | 12 + docs/Model/ContractEmployeeItem.md | 12 + docs/Model/ContractEmployeeResponse.md | 23 + ...EmployeeRoleAnalysisCategoryCodeRequest.md | 15 + ...mployeeRoleAnalysisCategoryCodeResponse.md | 16 + docs/Model/ContractEmployeeRoleItem.md | 12 + docs/Model/ContractEmployeeRoleResponse.md | 21 + ...ntractEmployeeRoleWorkingPatternRequest.md | 10 + ...tractEmployeeRoleWorkingPatternResponse.md | 13 + ...tEmployeeRoleWorkingPatternResponseItem.md | 18 + docs/Model/ContractEmployerBase.md | 10 + .../Model/ContractEmploymentDetailsRequest.md | 35 + .../ContractEmploymentDetailsResponse.md | 36 + docs/Model/ContractFpsFields.md | 13 + docs/Model/ContractGrossToNetReportRequest.md | 17 + .../ContractHolidayEntitlementRequest.md | 12 + .../ContractHolidayEntitlementResponse.md | 13 + ...ContractHolidayEntitlementUpdateRequest.md | 13 + docs/Model/ContractHolidaySchemeRequest.md | 18 + docs/Model/ContractHolidaySchemeResponse.md | 19 + docs/Model/ContractJobErrorResponse.md | 13 + docs/Model/ContractJobResponse.md | 22 + docs/Model/ContractJobResultFileResponse.md | 10 + docs/Model/ContractJobResultResponse.md | 11 + docs/Model/ContractJournalTemplateRequest.md | 11 + docs/Model/ContractJournalTemplateResponse.md | 12 + docs/Model/ContractJournalTokenRequest.md | 11 + docs/Model/ContractJournalTokenResponse.md | 12 + .../Model/ContractJournalTokenResponseItem.md | 12 + docs/Model/ContractLeaveImportRequest.md | 21 + docs/Model/ContractLeaveSettingsRequest.md | 40 + docs/Model/ContractLeaveSettingsResponse.md | 49 + docs/Model/ContractLeaverDetails.md | 15 + docs/Model/ContractLondonAllowanceRequest.md | 11 + docs/Model/ContractLondonAllowanceResponse.md | 12 + docs/Model/ContractNetOfOnCostsResponse.md | 19 + .../ContractNetOfOnCostsSimulationResponse.md | 13 + docs/Model/ContractOverseasEmployerDetails.md | 12 + docs/Model/ContractP11HistoryRequest.md | 13 + docs/Model/ContractP11HistoryResponse.md | 14 + docs/Model/ContractPartnerDetails.md | 12 + docs/Model/ContractPayHistoryRequest.md | 17 + docs/Model/ContractPayHistoryResponse.md | 18 + docs/Model/ContractPayHistoryUpdateRequest.md | 18 + docs/Model/ContractPayLineRequest.md | 45 + docs/Model/ContractPayLineResponse.md | 52 + docs/Model/ContractPayOptionsBaseResponse.md | 20 + docs/Model/ContractPayOptionsImportRequest.md | 31 + docs/Model/ContractPayOptionsRequest.md | 27 + docs/Model/ContractPayOptionsResponse.md | 28 + .../ContractPayRunStateHistoryResponse.md | 10 + docs/Model/ContractPaySpineGradeRequest.md | 14 + docs/Model/ContractPaySpineGradeResponse.md | 15 + docs/Model/ContractPaySpineRequest.md | 24 + docs/Model/ContractPaySpineResponse.md | 25 + docs/Model/ContractPaySpineUpdateRequest.md | 24 + .../ContractPaylineAnalysisCategoriesCodes.md | 12 + docs/Model/ContractPaylineRequest.md | 49 + .../ContractPayrollSquadEmployerRequest.md | 10 + .../ContractPayrollSquadEmployerResponse.md | 10 + .../ContractPayrollSquadMemberRequest.md | 11 + .../ContractPayrollSquadMemberResponse.md | 14 + docs/Model/ContractPayrollSquadRequest.md | 10 + docs/Model/ContractPayrollSquadResponse.md | 13 + .../ContractPendingLettersCountResponse.md | 10 + docs/Model/ContractPensionerPayroll.md | 12 + docs/Model/ContractPersonalDetailsRequest.md | 30 + docs/Model/ContractPersonalDetailsResponse.md | 31 + .../Model/ContractReapplyDpsNoticeResponse.md | 10 + docs/Model/ContractRightToWork.md | 13 + docs/Model/ContractRtiEmployeeAddress.md | 14 + docs/Model/ContractRtiEmployeeName.md | 12 + .../ContractShiftWorkingPatternDayRequest.md | 12 + .../ContractShiftWorkingPatternDayResponse.md | 11 + docs/Model/ContractSpinalPointRequest.md | 20 + docs/Model/ContractSpinalPointResponse.md | 21 + .../Model/ContractSpinalPointUpdateRequest.md | 21 + docs/Model/ContractSpineAllowanceRequest.md | 17 + docs/Model/ContractSpineAllowanceResponse.md | 18 + .../ContractSpineAllowanceUpdateRequest.md | 18 + docs/Model/ContractStarterDetails.md | 12 + docs/Model/ContractTaxAndNi.md | 19 + docs/Model/ContractTermCalendarRequest.md | 10 + docs/Model/ContractTermCalendarResponse.md | 11 + docs/Model/ContractTermCalendarYearRequest.md | 14 + .../Model/ContractTermCalendarYearResponse.md | 15 + docs/Model/ContractUpdateEmployeeRequest.md | 21 + docs/Model/ContractVeteranDetails.md | 10 + docs/Model/ContractWorkingPatternRequest.md | 35 + docs/Model/ContractWorkingPatternResponse.md | 30 + .../ContractYearsServiceEntitlementRequest.md | 10 + ...ContractYearsServiceEntitlementResponse.md | 11 + ...actYearsServiceEntitlementUpdateRequest.md | 11 + docs/Model/CostAnalysisReport.md | 34 + .../Model/CostAnalysisReportReportResponse.md | 12 + docs/Model/CostCentre.md | 14 + docs/Model/CostOfEmploymentReport.md | 23 + docs/Model/CostOfEmploymentReportLine.md | 17 + .../CostOfEmploymentReportReportResponse.md | 12 + docs/Model/Country.md | 8 + docs/Model/CsvFileFormat.md | 8 + docs/Model/DayOfWeek.md | 8 + .../DecimalTaxYearConfigPrimitiveValue.md | 11 + docs/Model/DeferalPeriodType.md | 8 + docs/Model/Department.md | 14 + docs/Model/DepartmentMembership.md | 14 + docs/Model/DirectDebitMandate.md | 14 + docs/Model/DirectorshipDetails.md | 12 + docs/Model/DpsDataType.md | 8 + docs/Model/DpsNotice.md | 26 + docs/Model/DpsSettings.md | 13 + docs/Model/EmailAttachment.md | 12 + docs/Model/EmpRefs.md | 14 + docs/Model/Employee.md | 24 + docs/Model/EmployeeBenefitsReport.md | 12 + .../EmployeeBenefitsReportReportResponse.md | 12 + docs/Model/EmployeeCostCentre.md | 15 + docs/Model/EmployeeLeaveReport.md | 13 + docs/Model/EmployeeLeaveReportLine.md | 38 + .../EmployeeLeaveReportReportResponse.md | 12 + docs/Model/EmployeeNiYtdValues.md | 14 + docs/Model/EmployeePayRunTotal.md | 20 + docs/Model/EmployeeRole.md | 21 + .../Model/EmployeeRoleAnalysisCategoryCode.md | 17 + docs/Model/EmployeeRolePayItem.md | 13 + docs/Model/EmployeeRolePayOptions.md | 23 + docs/Model/EmployeeSortBy.md | 8 + docs/Model/EmployeeStatus.md | 8 + docs/Model/EmployeeYtdValues.md | 13 + docs/Model/Employer.md | 60 + docs/Model/EmployerDefaults.md | 21 + docs/Model/EmployerEmail.md | 23 + docs/Model/EmployerEvcOptInHistory.md | 11 + docs/Model/EmployerGroup.md | 12 + docs/Model/EmployerGroupMembership.md | 12 + docs/Model/EmployerItem.md | 14 + docs/Model/EmployerOpeningBalances.md | 21 + docs/Model/EmployerPensionContribution.md | 12 + docs/Model/EmployerSettings.md | 23 + docs/Model/EmployerTemplate.md | 19 + docs/Model/EmployerTemplateType.md | 8 + docs/Model/EmploymentDetails.md | 36 + docs/Model/EntitlementBand.md | 13 + docs/Model/EntityType.md | 8 + docs/Model/Eps.md | 22 + docs/Model/EpsAccount.md | 12 + docs/Model/EpsApprenticeshipLevy.md | 11 + docs/Model/EpsDeMinimisStateAid.md | 12 + docs/Model/EpsFinalSubmission.md | 11 + docs/Model/Establishment.md | 12 + docs/Model/EvcSettings.md | 12 + docs/Model/Exb.md | 24 + docs/Model/ExbDeclarations.md | 10 + docs/Model/ExbEmployer.md | 9 + docs/Model/ExbP11d.md | 23 + docs/Model/ExbP11dEmployee.md | 15 + docs/Model/ExbP11db.md | 9 + docs/Model/ExbP11dbClass1A.md | 12 + docs/Model/ExbP11dbClass1AAdjustment.md | 10 + docs/Model/ExbP11dbClass1AAdjustments.md | 13 + docs/Model/ExbP11dbClass1ATotalBenefit.md | 10 + docs/Model/ExbReportResponse.md | 12 + docs/Model/ExpensesAndBenefits.md | 15 + docs/Model/ExternalDataCompany.md | 11 + docs/Model/ExternalDataProvider.md | 18 + docs/Model/ExternalDataProviderId.md | 8 + docs/Model/ExternalDataProviderType.md | 8 + docs/Model/ExternalEmployeeMapping.md | 14 + docs/Model/ExternalEmployeeMappingStatus.md | 8 + docs/Model/ExternalProviderConversation.md | 15 + docs/Model/FieldModification.md | 12 + docs/Model/FixedCode.md | 10 + docs/Model/FlexibleDrawdown.md | 8 + docs/Model/Fps.md | 23 + docs/Model/FpsBenefit.md | 9 + docs/Model/FpsCar.md | 20 + docs/Model/FpsCarFuel.md | 11 + docs/Model/FpsEmployee.md | 14 + docs/Model/FpsEmployeeDetails.md | 15 + .../Model/FpsEmployeeDetailsPartnerDetails.md | 10 + docs/Model/FpsEmployeeFigsToDate.md | 38 + docs/Model/FpsEmployeeFlexibleDrawdown.md | 13 + docs/Model/FpsEmployeeNIlettersAndValues.md | 18 + docs/Model/FpsEmployeePayment.md | 41 + docs/Model/FpsEmployeeSeconded.md | 13 + docs/Model/FpsEmployeeStarter.md | 14 + docs/Model/FpsEmployeeStarterOccPension.md | 10 + docs/Model/FpsEmployeeTaxCode.md | 11 + .../FpsEmployeeTrivialCommutationPayment.md | 10 + docs/Model/FpsEmployerPayIdChanged.md | 10 + docs/Model/FpsEmployment.md | 22 + docs/Model/FpsFields.md | 13 + docs/Model/FpsLateReason.md | 8 + docs/Model/FpsPriorVersion.md | 10 + docs/Model/FpsReportResponse.md | 12 + docs/Model/FromToDates.md | 10 + docs/Model/FullPaymentSubmission.md | 10 + docs/Model/FullSummaryOfPayReport.md | 23 + docs/Model/FullSummaryOfPayReportLine.md | 13 + .../FullSummaryOfPayReportReportResponse.md | 12 + docs/Model/FurloughCalculationBasis.md | 8 + docs/Model/FurloughReport.md | 47 + docs/Model/FurloughReportLine.md | 25 + docs/Model/FurloughReportReportResponse.md | 12 + docs/Model/Gender.md | 8 + docs/Model/GenderPayGapLine.md | 18 + docs/Model/GenderPayGapReport.md | 13 + .../Model/GenderPayGapReportReportResponse.md | 12 + docs/Model/GenderPayGapSnapShotDate.md | 8 + docs/Model/GovTalk.md | 17 + docs/Model/GovTalkError.md | 13 + docs/Model/GovTalkSubmission.md | 21 + docs/Model/GrossToNetReport.md | 24 + docs/Model/GrossToNetReportCisLine.md | 20 + docs/Model/GrossToNetReportLine.md | 27 + docs/Model/GrossToNetReportReportResponse.md | 12 + docs/Model/HmrcDetails.md | 25 + docs/Model/HmrcLiability.md | 52 + docs/Model/HmrcPayment.md | 11 + docs/Model/HolidayAccrual.md | 8 + docs/Model/HolidayAccrualDefaultRateType.md | 8 + docs/Model/HolidayReport.md | 16 + docs/Model/HolidayReportLine.md | 13 + docs/Model/HolidayReportReportResponse.md | 12 + docs/Model/HolidaySchemeDurationType.md | 8 + docs/Model/HolidayType.md | 8 + docs/Model/HourlyPayReport.md | 22 + docs/Model/HourlyPayReportLine.md | 15 + docs/Model/HourlyPayReportReportResponse.md | 12 + docs/Model/HoursNormallyWorked.md | 8 + docs/Model/HtmlEmailSettings.md | 13 + docs/Model/HtmlInsertionPoint.md | 8 + docs/Model/IncrementRule.md | 8 + docs/Model/Invitation.md | 16 + docs/Model/Item.md | 12 + docs/Model/ItemListReportResponse.md | 12 + docs/Model/JobStatus.md | 8 + docs/Model/JobType.md | 8 + docs/Model/JournalCsvFormat.md | 8 + docs/Model/JournalTemplate.md | 12 + docs/Model/JournalTokenType.md | 8 + docs/Model/Leave.md | 54 + docs/Model/LeaveAssumedPensionablePay.md | 14 + docs/Model/LeaveCalculationType.md | 8 + docs/Model/LeaveCustomPayment.md | 11 + docs/Model/LeaveCustomProRataRule.md | 10 + docs/Model/LeavePayType.md | 8 + docs/Model/LeaveProRataRule.md | 8 + docs/Model/LeaveSettings.md | 54 + docs/Model/LeaveType.md | 8 + docs/Model/LeaverDetails.md | 15 + docs/Model/LgpsCivicaCasualHours.md | 8 + docs/Model/LgpsCivicaPayrollNumber.md | 8 + docs/Model/LgpsFund.md | 8 + docs/Model/LgpsIConnectFileType.md | 8 + docs/Model/LgpsIConnectPayrollReference.md | 8 + docs/Model/LgpsIConnectSalaryType.md | 8 + docs/Model/LgpsPayCategory.md | 8 + docs/Model/LinkedPiw.md | 15 + docs/Model/LinkedPiwResult.md | 8 + docs/Model/Loan.md | 22 + docs/Model/LoanBalancesReport.md | 13 + docs/Model/LoanBalancesReportLine.md | 16 + .../Model/LoanBalancesReportReportResponse.md | 12 + docs/Model/LoanCharge.md | 10 + docs/Model/LogEntry.md | 10 + docs/Model/LondonAllowance.md | 13 + docs/Model/LondonAllowanceType.md | 8 + docs/Model/LondonAllowanceValueType.md | 8 + docs/Model/MailSettings.md | 17 + docs/Model/MaritalStatus.md | 8 + docs/Model/McrPayCategory.md | 8 + docs/Model/MileageAllowancePaymentsRate.md | 12 + docs/Model/MileageVehicleType.md | 8 + docs/Model/MonthlyMinimum.md | 13 + docs/Model/NationalInsuranceCalculation.md | 27 + .../Model/NationalInsuranceCalculationBase.md | 26 + ...ationalInsuranceCalculationPeriodValues.md | 17 + docs/Model/NationalInsuranceCode.md | 22 + docs/Model/NationalMinimumWage.md | 11 + docs/Model/NiLetterError.md | 8 + docs/Model/NiLetterValidationReport.md | 24 + docs/Model/NiLetterValidationReportLine.md | 18 + .../NiLetterValidationReportReportResponse.md | 12 + docs/Model/NiYtdReport.md | 14 + docs/Model/NiYtdReportReportResponse.md | 12 + docs/Model/NiYtdValue.md | 12 + docs/Model/NicSummary.md | 31 + docs/Model/NominalCodeMapping.md | 14 + docs/Model/Note.md | 17 + docs/Model/NoteType.md | 8 + docs/Model/Nvr.md | 17 + docs/Model/NvrEmployee.md | 12 + docs/Model/NvrEmployeeDetails.md | 13 + docs/Model/NvrEmployment.md | 9 + docs/Model/NvrRequest.md | 10 + docs/Model/OccupationalPolicy.md | 20 + docs/Model/OccupationalPolicyEntitlement.md | 8 + ...onalPolicyEntitlementRecalculationBasis.md | 8 + .../OccupationalPolicyPayCalculatedOn.md | 8 + docs/Model/OccupationalPolicySicknessYear.md | 8 + docs/Model/OccupationalPolicyType.md | 8 + docs/Model/OccupationalSickLeaveHistory.md | 16 + docs/Model/OpeningBalances.md | 32 + docs/Model/OpeningBalancesTotals.md | 32 + docs/Model/OverseasEmployerDetails.md | 12 + docs/Model/OverseasSecondmentStatus.md | 8 + docs/Model/P11.md | 24 + docs/Model/P11DAssetAvailable.md | 15 + docs/Model/P11DAssetAvailableCollection.md | 10 + docs/Model/P11DAssetTransferredCollection.md | 10 + docs/Model/P11DCar.md | 24 + docs/Model/P11DCarCollection.md | 12 + docs/Model/P11DDescOther.md | 15 + docs/Model/P11DLoan.md | 16 + docs/Model/P11DLoanCollection.md | 10 + docs/Model/P11DOther.md | 12 + docs/Model/P11DPaymentCollection.md | 11 + docs/Model/P11DSingleItem.md | 20 + docs/Model/P11Detailed.md | 31 + docs/Model/P11DetailedNiValues.md | 17 + docs/Model/P11DetailedReportResponse.md | 12 + docs/Model/P11Line.md | 22 + docs/Model/P11NiAndStatPaymentsLine.md | 21 + docs/Model/P11NiAndStatPaymentsTotalsLine.md | 20 + docs/Model/P11NiValues.md | 11 + docs/Model/P11PayeLine.md | 19 + docs/Model/P11PayeSummary.md | 14 + docs/Model/P11PayeTotalsLine.md | 14 + docs/Model/P11ReportResponse.md | 12 + docs/Model/P11dCarFreeFuelWithdrawn.md | 10 + docs/Model/P11dExpenses.md | 14 + docs/Model/P11dVans.md | 21 + docs/Model/P32.md | 16 + docs/Model/P32ReportResponse.md | 12 + docs/Model/PapdisDocument.md | 16 + docs/Model/PapdisDocumentReportResponse.md | 12 + docs/Model/PapdisEmployee.md | 29 + docs/Model/PapdisEmployeeAssessment.md | 20 + docs/Model/PapdisEmployeeContact.md | 13 + .../PapdisEmployeeContactPostalAddress.md | 14 + docs/Model/PapdisEmployeeContribution.md | 30 + docs/Model/PapdisEmployeeExit.md | 13 + docs/Model/PapdisEmployeeIdentity.md | 14 + docs/Model/PapdisEmployeeName.md | 12 + docs/Model/PapdisEmployeePay.md | 14 + docs/Model/PapdisEmployer.md | 21 + .../PapdisEmployerContactPostalAddress.md | 14 + docs/Model/PapdisMessageFunctionCode.md | 8 + docs/Model/PapdisPayrollPeriod.md | 16 + docs/Model/PapdisPensionProvider.md | 11 + docs/Model/PapdisVersion.md | 8 + docs/Model/PartnerDetails.md | 12 + docs/Model/PayBasis.md | 8 + docs/Model/PayCode.md | 33 + docs/Model/PayCodeCalculationType.md | 8 + docs/Model/PayCodeMultiplierType.md | 8 + docs/Model/PayCodeSet.md | 15 + docs/Model/PayCodeVarianceLine.md | 11 + docs/Model/PayElementReport.md | 23 + docs/Model/PayElementReportLine.md | 14 + docs/Model/PayElementReportReportResponse.md | 12 + docs/Model/PayGradesReport.md | 13 + docs/Model/PayGradesReportReportResponse.md | 12 + docs/Model/PayLine.md | 60 + docs/Model/PayMethod.md | 8 + docs/Model/PayOptions.md | 29 + docs/Model/PayOptionsImport.md | 31 + docs/Model/PayPeriodEventType.md | 8 + docs/Model/PayPeriodTypes.md | 8 + docs/Model/PayPeriods.md | 8 + docs/Model/PayRun.md | 27 + docs/Model/PayRunChanges.md | 9 + docs/Model/PayRunCsvType.md | 8 + docs/Model/PayRunEntry.md | 57 + docs/Model/PayRunEntrySortBy.md | 8 + docs/Model/PayRunEntryWarningType.md | 8 + docs/Model/PayRunJournal.md | 20 + docs/Model/PayRunPayment.md | 19 + docs/Model/PayRunState.md | 8 + docs/Model/PayRunStateChange.md | 12 + docs/Model/PayRunStateChangeReason.md | 8 + docs/Model/PayRunSummaryLine.md | 23 + ...RunSummaryLineIEnumerableReportResponse.md | 12 + docs/Model/PayRunTotals.md | 86 + docs/Model/PaySchedule.md | 32 + docs/Model/PaySchedulePeriod.md | 15 + docs/Model/PaySchedulePeriodEvent.md | 13 + docs/Model/PaySchedulePeriodEventsConfig.md | 14 + docs/Model/PaySpineReport.md | 13 + docs/Model/PaySpineReportLine.md | 25 + docs/Model/PaySpineReportReportResponse.md | 12 + .../PaySpineYearsServiceEntitlementBasis.md | 8 + docs/Model/Payee.md | 15 + docs/Model/PayeeType.md | 8 + docs/Model/PaylineCalculationData.md | 15 + docs/Model/PaymentDateRule.md | 8 + docs/Model/PaymentDateType.md | 8 + docs/Model/PaymentMethodAfterLeaving.md | 8 + docs/Model/PaymentsCsvMapping.md | 36 + docs/Model/PaymentsCsvMappingColumn.md | 16 + docs/Model/PaymentsCsvMappingType.md | 8 + .../PayrollAnalysisCostBreakdownReport.md | 24 + .../PayrollAnalysisCostBreakdownReportLine.md | 32 + ...alysisCostBreakdownReportReportResponse.md | 12 + ...PayrollAnalysisCostBreakdownReportValue.md | 11 + ...rollAnalysisEmployeeRoleBreakdownReport.md | 23 + ...AnalysisEmployeeRoleBreakdownReportLine.md | 20 + ...sisEmployeeRoleBreakdownReportLineValue.md | 11 + ...ployeeRoleBreakdownReportReportResponse.md | 12 + docs/Model/PayrollValueType.md | 8 + docs/Model/PayrunEmail.md | 29 + docs/Model/PayrunPaymentsReport.md | 26 + .../PayrunPaymentsReportReportResponse.md | 12 + docs/Model/Payslip.md | 39 + docs/Model/PayslipCustomisation.md | 23 + docs/Model/PayslipLine.md | 28 + docs/Model/PayslipLineType.md | 8 + docs/Model/PayslipReleaseType.md | 8 + docs/Model/PayslipReportResponse.md | 12 + docs/Model/PdfPaperMargins.md | 12 + docs/Model/PdfPaperOrientation.md | 8 + docs/Model/PdfPaperSize.md | 8 + docs/Model/PdfPasswordType.md | 8 + docs/Model/Pension.md | 47 + docs/Model/PensionAdministrator.md | 13 + docs/Model/PensionContributionLevelType.md | 8 + docs/Model/PensionContributionsSubmission.md | 20 + docs/Model/PensionCsvFormat.md | 8 + docs/Model/PensionEndReason.md | 8 + docs/Model/PensionJoinReason.md | 8 + docs/Model/PensionMembershipReportLine.md | 39 + docs/Model/PensionMembershipsReport.md | 22 + .../PensionMembershipsReportReportResponse.md | 12 + docs/Model/PensionOpeningBalances.md | 14 + docs/Model/PensionPayCode.md | 8 + docs/Model/PensionProvider.md | 27 + docs/Model/PensionRefund.md | 22 + docs/Model/PensionReportingType.md | 8 + docs/Model/PensionRule.md | 8 + docs/Model/PensionScheme.md | 39 + docs/Model/PensionSchemeNominalCodeMapping.md | 12 + ...PensionSchemeReportOptionsLgpsCivicaUpm.md | 17 + .../PensionSchemeReportOptionsLgpsIConnect.md | 31 + docs/Model/PensionSelection.md | 12 + docs/Model/PensionSummary.md | 58 + docs/Model/PensionSummaryCostBreakdown.md | 14 + docs/Model/PensionablePayDefinition.md | 8 + docs/Model/PensionerPayroll.md | 12 + docs/Model/PeriodValue.md | 12 + docs/Model/PeriodValuePeriodValues.md | 14 + docs/Model/PersonalDetails.md | 31 + docs/Model/PricingBand.md | 13 + docs/Model/PricingTable.md | 15 + docs/Model/ProRataRule.md | 8 + docs/Model/ProcessingNote.md | 19 + docs/Model/ProcessingNoteStatus.md | 8 + docs/Model/RecoverableAmounts.md | 21 + docs/Model/Report.md | 8 + docs/Model/ReportCustomCssOption.md | 8 + docs/Model/ReportFormat.md | 8 + docs/Model/ReportPack.md | 11 + docs/Model/ReportResponse.md | 12 + docs/Model/ReportSortBy.md | 8 + docs/Model/ReportTemplate.md | 12 + docs/Model/RightToWork.md | 13 + docs/Model/RightToWorkDocumentType.md | 8 + docs/Model/RightToWorkReport.md | 14 + docs/Model/RightToWorkReportLine.md | 12 + docs/Model/RightToWorkReportReportResponse.md | 12 + docs/Model/RoleBasis.md | 8 + docs/Model/RoleType.md | 8 + docs/Model/RtiAgent.md | 12 + docs/Model/RtiContact.md | 12 + docs/Model/RtiEmployeeAddress.md | 14 + docs/Model/RtiEmployeeName.md | 12 + docs/Model/RtiSenderType.md | 8 + docs/Model/RtiSubmissionSettings.md | 22 + docs/Model/RtiValidationWarning.md | 10 + docs/Model/RtiValidationWarningType.md | 8 + docs/Model/ServiceBand.md | 13 + docs/Model/ShiftWorkingPatternDay.md | 12 + docs/Model/SmtpEncryption.md | 8 + docs/Model/SmtpSettings.md | 13 + docs/Model/SpinePointReport.md | 13 + docs/Model/SpinePointReportLine.md | 23 + docs/Model/SpinePointReportReportResponse.md | 12 + docs/Model/StarterDeclaration.md | 8 + docs/Model/StarterDetails.md | 12 + docs/Model/StartersLeaversFilter.md | 8 + docs/Model/StatPayFrequency.md | 8 + docs/Model/StatutoryPay.md | 11 + docs/Model/StatutoryPayReport.md | 22 + docs/Model/StatutoryPayReportLine.md | 19 + .../Model/StatutoryPayReportReportResponse.md | 12 + docs/Model/StringDecimalKeyValuePair.md | 10 + docs/Model/StringStringKeyValuePair.md | 10 + docs/Model/StudentLoan.md | 8 + docs/Model/StudentLoanRecovered.md | 10 + docs/Model/SubmissionStatus.md | 8 + docs/Model/Tag.md | 11 + docs/Model/TaxAndNi.md | 19 + docs/Model/TaxBracket.md | 11 + docs/Model/TaxCodeChange.md | 10 + docs/Model/TaxCodeChangeReport.md | 13 + .../TaxCodeChangeReportReportResponse.md | 12 + docs/Model/TaxCodeChangeValues.md | 17 + docs/Model/TaxYear.md | 8 + docs/Model/TaxYearConfig.md | 54 + docs/Model/TaxYearTypes.md | 8 + docs/Model/TeachersPensionAgeWarning.md | 8 + docs/Model/TeachersPensionDetails.md | 14 + docs/Model/TeachersPensionEmploymentType.md | 8 + docs/Model/TeachersPensionEoyLineItem.md | 13 + docs/Model/TeachersPensionEoyReport.md | 30 + .../TeachersPensionEoyReportReportResponse.md | 12 + docs/Model/Tenant.md | 36 + docs/Model/TenantBillingSettings.md | 15 + docs/Model/TenantEmail.md | 23 + docs/Model/TenantHtmlInsertion.md | 10 + docs/Model/TenantItem.md | 12 + docs/Model/TieredPension.md | 11 + docs/Model/TieredPensionRate.md | 12 + docs/Model/UmbrellaPayment.md | 17 + docs/Model/UmbrellaReconciliationReport.md | 22 + .../Model/UmbrellaReconciliationReportLine.md | 26 + ...rellaReconciliationReportReportResponse.md | 12 + docs/Model/UmbrellaSettings.md | 18 + docs/Model/UsageBill.md | 24 + docs/Model/User.md | 57 + docs/Model/UserAuthorization.md | 10 + docs/Model/UserCategory.md | 8 + docs/Model/UserDisplayPreferences.md | 24 + docs/Model/UserIndustry.md | 8 + docs/Model/UserJobType.md | 8 + docs/Model/UserRole.md | 8 + docs/Model/UserstartPage.md | 8 + docs/Model/UtmInfo.md | 13 + docs/Model/ValueOverride.md | 15 + docs/Model/VarianceReport.md | 21 + docs/Model/VarianceReportReportResponse.md | 12 + docs/Model/VeteranDetails.md | 10 + docs/Model/WarningsReport.md | 10 + docs/Model/WarningsReportLine.md | 12 + docs/Model/WarningsReportReportResponse.md | 12 + docs/Model/Webhook.md | 14 + docs/Model/WebhookEvent.md | 8 + docs/Model/WebhookPayload.md | 17 + docs/Model/WorkerGroup.md | 37 + docs/Model/WorkingPattern.md | 28 + docs/Model/WorkingPatternHoursType.md | 8 + docs/Model/WorkingPatternType.md | 8 + docs/Model/YearEnd.md | 19 + docs/Model/YearEndTaxCodeChange.md | 11 + docs/Model/YtdReport.md | 14 + docs/Model/YtdReportReportResponse.md | 12 + docs/Model/YtdValue.md | 12 + docs/Model/ZeroPaidFilter.md | 8 + generate/README.md | 16 + generate/config.yaml | 9 + generate/swagger.json | 70561 ++++++++++++++++ phpunit.xml.dist | 18 + src/Api/AccountApi.php | 5412 ++ src/Api/AnalysisCategoryApi.php | 3618 + src/Api/AttachmentOrderApi.php | 3264 + src/Api/AuditApi.php | 591 + src/Api/AutoEnrolmentApi.php | 5252 ++ src/Api/AverageHolidayPayHistoryApi.php | 2274 + src/Api/BenefitsApi.php | 1851 + src/Api/BillingApi.php | 2544 + src/Api/BureauApi.php | 2112 + src/Api/Cis300Api.php | 3432 + src/Api/CisVerificationApi.php | 3432 + src/Api/CostCentreApi.php | 2797 + src/Api/DepartmentApi.php | 2797 + src/Api/DpsApi.php | 3442 + src/Api/EmailApi.php | 2861 + src/Api/EmployeeApi.php | 10277 +++ src/Api/EmployeeRoleApi.php | 7616 ++ src/Api/EmployerApi.php | 8966 ++ src/Api/EmployerGroupApi.php | 1692 + src/Api/EmployerTemplateApi.php | 1202 + src/Api/EngineApi.php | 2101 + src/Api/EpsApi.php | 4192 + src/Api/ExbApi.php | 3787 + src/Api/ExternalDataApi.php | 11157 +++ src/Api/FpsApi.php | 3852 + src/Api/HmrcPaymentApi.php | 1672 + src/Api/HolidaySchemeApi.php | 1817 + src/Api/ImportApi.php | 3957 + src/Api/InvitationApi.php | 1720 + src/Api/JobApi.php | 1770 + src/Api/JournalTemplateApi.php | 1198 + src/Api/JournalTokenApi.php | 4031 + src/Api/LeaveApi.php | 4214 + src/Api/LoanApi.php | 2884 + src/Api/NoteApi.php | 2884 + src/Api/NvrApi.php | 3432 + src/Api/OccupationalPolicyApi.php | 1817 + src/Api/OccupationalSickLeaveHistoryApi.php | 2648 + src/Api/OpeningBalancesApi.php | 4235 + src/Api/P11HistoryApi.php | 1546 + src/Api/PayCodeApi.php | 3498 + src/Api/PayCodeSetApi.php | 1817 + src/Api/PayRunApi.php | 14217 ++++ src/Api/PayRunAsyncApi.php | 1819 + src/Api/PayScheduleApi.php | 4332 + src/Api/PaySpineApi.php | 15610 ++++ src/Api/PayeeApi.php | 1817 + src/Api/PensionApi.php | 3342 + src/Api/PensionRefundApi.php | 2586 + src/Api/PensionSchemeApi.php | 4126 + src/Api/ProcessingNoteApi.php | 2911 + src/Api/ReportPackApi.php | 1817 + src/Api/ReportTemplateApi.php | 1817 + src/Api/ReportsApi.php | 31018 +++++++ src/Api/ReportsAsyncApi.php | 492 + src/Api/TagApi.php | 2797 + src/Api/TenantApi.php | 18769 ++++ src/Api/TenantEmailApi.php | 2252 + src/Api/TermCalendarApi.php | 1817 + src/Api/TermCalendarYearApi.php | 1942 + src/Api/TierablePayApi.php | 496 + src/Api/ToolsApi.php | 792 + src/Api/WebhookApi.php | 2856 + src/Api/WorkingPatternApi.php | 1817 + src/ApiException.php | 119 + src/Configuration.php | 528 + src/HeaderSelector.php | 244 + src/Model/Address.php | 751 + src/Model/AdvancedVarianceReport.php | 681 + src/Model/AdvancedVarianceReportLine.php | 1153 + .../AdvancedVarianceReportReportResponse.php | 532 + src/Model/AeAction.php | 53 + src/Model/AeAssessment.php | 1008 + src/Model/AeAssessmentAction.php | 653 + src/Model/AeEmployeeState.php | 59 + src/Model/AeExclusionCode.php | 67 + src/Model/AeStatus.php | 49 + src/Model/AeStatutoryLetter.php | 49 + src/Model/AeUKWorker.php | 47 + src/Model/AllowanceType.php | 49 + src/Model/AnalysisCategory.php | 426 + src/Model/AnalysisCategoryCode.php | 576 + src/Model/AnalysisCategoryCodes.php | 538 + src/Model/AnalysisCategoryIndex.php | 449 + src/Model/AnalysisReport.php | 953 + src/Model/AnalysisReportLine.php | 830 + src/Model/AnalysisReportLineValue.php | 490 + src/Model/AnalysisReportReportResponse.php | 532 + src/Model/AnnualRoundingRule.php | 49 + src/Model/AssumedPensionablePay.php | 47 + src/Model/AttachmentOrder.php | 1392 + src/Model/AttachmentOrderPayment.php | 926 + src/Model/AttachmentOrderReportResponse.php | 532 + src/Model/AttachmentOrderType.php | 81 + src/Model/AttachmentOrdersReport.php | 837 + .../AttachmentOrdersReportReportResponse.php | 532 + src/Model/AuditEventAction.php | 47 + src/Model/AuthScheme.php | 57 + src/Model/AutoEnrolment.php | 728 + src/Model/AutoEnrolmentSettings.php | 762 + src/Model/AutoPilotFinaliseTime.php | 53 + src/Model/AutomationSettings.php | 1112 + src/Model/AverageHolidayPayRateReport.php | 878 + src/Model/AverageHolidayPayRateReportLine.php | 681 + ...rageHolidayPayRateReportReportResponse.php | 532 + src/Model/AveragePayGradesReportLine.php | 722 + src/Model/AverageWeeklyEarnings.php | 721 + src/Model/AverageWeeklyEarningsResult.php | 49 + src/Model/BackgroundTaskStatus.php | 49 + src/Model/BankDetails.php | 782 + src/Model/BankHolidayCollection.php | 49 + src/Model/BankPaymentInstruction.php | 681 + .../BankPaymentInstructionReportResponse.php | 532 + .../BankPaymentInstructionsCsvFormat.php | 79 + src/Model/Benefit.php | 1295 + src/Model/BenefitDeclarationType.php | 45 + src/Model/BenefitDetailsAssetType.php | 51 + src/Model/BenefitDetailsCar.php | 1273 + src/Model/BenefitDetailsCarPowerType.php | 51 + src/Model/BenefitDetailsClass1AType.php | 53 + src/Model/BenefitDetailsLoan.php | 769 + src/Model/BenefitDetailsNonClass1AType.php | 53 + src/Model/BenefitDetailsPaymentType.php | 55 + src/Model/BenefitDetailsUseOfAssetType.php | 55 + src/Model/BenefitPayrolled.php | 476 + src/Model/BenefitType.php | 83 + src/Model/BureauSettings.php | 627 + src/Model/CISSubContractorType.php | 49 + src/Model/CISTaxStatus.php | 47 + src/Model/CalendarEntry.php | 517 + src/Model/CalendarEntryType.php | 53 + src/Model/CalendarMonth.php | 67 + src/Model/CarCharge.php | 709 + src/Model/CarChargeRate.php | 477 + src/Model/ChangeSummary.php | 1117 + src/Model/ChangeSummaryListReportResponse.php | 539 + src/Model/Cis300.php | 830 + src/Model/Cis300Declarations.php | 538 + src/Model/Cis300ReportResponse.php | 532 + src/Model/CisContractor.php | 457 + src/Model/CisDetails.php | 790 + src/Model/CisPartnership.php | 457 + src/Model/CisRequest.php | 490 + src/Model/CisReturn.php | 524 + src/Model/CisStatement.php | 886 + src/Model/CisStatementListReportResponse.php | 539 + src/Model/CisSubContractor.php | 1521 + src/Model/CisSubContractorSummary.php | 812 + ...SubContractorSummaryListReportResponse.php | 539 + src/Model/CisVerification.php | 743 + src/Model/CisVerificationDetails.php | 633 + src/Model/ContractAddress.php | 751 + src/Model/ContractAeAssessmentAction.php | 653 + src/Model/ContractAeAssessmentRequest.php | 409 + src/Model/ContractAeAssessmentResponse.php | 857 + src/Model/ContractAllowanceGradesRequest.php | 524 + src/Model/ContractAllowanceGradesResponse.php | 558 + .../ContractAllowanceGradesUpdateRequest.php | 558 + .../ContractAnalysisCategoryCodeRequest.php | 538 + .../ContractAnalysisCategoryCodeResponse.php | 572 + src/Model/ContractAnalysisCategoryRequest.php | 415 + .../ContractAnalysisCategoryResponse.php | 449 + src/Model/ContractAutoEnrolmentRequest.php | 612 + src/Model/ContractAutoEnrolmentResponse.php | 728 + src/Model/ContractBankDetails.php | 782 + src/Model/ContractCisDetailsRequest.php | 789 + src/Model/ContractCisDetailsResponse.php | 789 + src/Model/ContractCisPartnership.php | 457 + src/Model/ContractCisSubContractor.php | 1480 + src/Model/ContractCisSubContractorItem.php | 531 + .../ContractCisVerificationDetailsRequest.php | 592 + ...ContractCisVerificationDetailsResponse.php | 633 + ...tractCostCentreJournalOverridesRequest.php | 490 + ...ractCostCentreJournalOverridesResponse.php | 524 + ...CostCentreJournalOverridesResponseItem.php | 531 + ...ostCentreJournalOverridesUpdateRequest.php | 524 + src/Model/ContractCreateEmployeeRequest.php | 825 + ...tractDepartmentJournalOverridesRequest.php | 490 + ...ractDepartmentJournalOverridesResponse.php | 524 + ...DepartmentJournalOverridesResponseItem.php | 531 + ...epartmentJournalOverridesUpdateRequest.php | 524 + src/Model/ContractDepartmentRequest.php | 576 + src/Model/ContractDepartmentResponse.php | 610 + src/Model/ContractDirectorshipDetails.php | 524 + src/Model/ContractEmployeeItem.php | 531 + src/Model/ContractEmployeeResponse.php | 919 + ...mployeeRoleAnalysisCategoryCodeRequest.php | 640 + ...ployeeRoleAnalysisCategoryCodeResponse.php | 674 + src/Model/ContractEmployeeRoleItem.php | 531 + src/Model/ContractEmployeeRoleResponse.php | 866 + ...tractEmployeeRoleWorkingPatternRequest.php | 442 + ...ractEmployeeRoleWorkingPatternResponse.php | 544 + ...EmployeeRoleWorkingPatternResponseItem.php | 756 + src/Model/ContractEmployerBase.php | 449 + .../ContractEmploymentDetailsRequest.php | 1389 + .../ContractEmploymentDetailsResponse.php | 1423 + src/Model/ContractFpsFields.php | 544 + src/Model/ContractGrossToNetReportRequest.php | 680 + .../ContractHolidayEntitlementRequest.php | 524 + .../ContractHolidayEntitlementResponse.php | 558 + ...ontractHolidayEntitlementUpdateRequest.php | 558 + src/Model/ContractHolidaySchemeRequest.php | 740 + src/Model/ContractHolidaySchemeResponse.php | 774 + src/Model/ContractJobErrorResponse.php | 558 + src/Model/ContractJobResponse.php | 906 + src/Model/ContractJobResultFileResponse.php | 456 + src/Model/ContractJobResultResponse.php | 490 + src/Model/ContractJournalTemplateRequest.php | 490 + src/Model/ContractJournalTemplateResponse.php | 524 + src/Model/ContractJournalTokenRequest.php | 490 + src/Model/ContractJournalTokenResponse.php | 524 + .../ContractJournalTokenResponseItem.php | 531 + src/Model/ContractLeaveImportRequest.php | 858 + src/Model/ContractLeaveSettingsRequest.php | 1515 + src/Model/ContractLeaveSettingsResponse.php | 1821 + src/Model/ContractLeaverDetails.php | 619 + src/Model/ContractLondonAllowanceRequest.php | 476 + src/Model/ContractLondonAllowanceResponse.php | 510 + src/Model/ContractNetOfOnCostsResponse.php | 748 + ...ContractNetOfOnCostsSimulationResponse.php | 544 + src/Model/ContractOverseasEmployerDetails.php | 510 + src/Model/ContractP11HistoryRequest.php | 544 + src/Model/ContractP11HistoryResponse.php | 578 + src/Model/ContractPartnerDetails.php | 570 + src/Model/ContractPayHistoryRequest.php | 680 + src/Model/ContractPayHistoryResponse.php | 714 + src/Model/ContractPayHistoryUpdateRequest.php | 714 + src/Model/ContractPayLineRequest.php | 1836 + src/Model/ContractPayLineResponse.php | 2116 + src/Model/ContractPayOptionsBaseResponse.php | 803 + src/Model/ContractPayOptionsImportRequest.php | 1261 + src/Model/ContractPayOptionsRequest.php | 1048 + src/Model/ContractPayOptionsResponse.php | 1082 + .../ContractPayRunStateHistoryResponse.php | 442 + src/Model/ContractPaySpineGradeRequest.php | 585 + src/Model/ContractPaySpineGradeResponse.php | 619 + src/Model/ContractPaySpineRequest.php | 939 + src/Model/ContractPaySpineResponse.php | 973 + src/Model/ContractPaySpineUpdateRequest.php | 939 + ...ContractPaylineAnalysisCategoriesCodes.php | 538 + src/Model/ContractPaylineRequest0.php | 1985 + .../ContractPayrollSquadEmployerRequest.php | 449 + .../ContractPayrollSquadEmployerResponse.php | 442 + .../ContractPayrollSquadMemberRequest.php | 476 + .../ContractPayrollSquadMemberResponse.php | 599 + src/Model/ContractPayrollSquadRequest.php | 456 + src/Model/ContractPayrollSquadResponse.php | 565 + .../ContractPendingLettersCountResponse.php | 442 + src/Model/ContractPensionerPayroll.php | 517 + src/Model/ContractPersonalDetailsRequest.php | 1325 + src/Model/ContractPersonalDetailsResponse.php | 1359 + .../ContractReapplyDpsNoticeResponse.php | 442 + src/Model/ContractRightToWork.php | 581 + src/Model/ContractRtiEmployeeAddress.php | 620 + src/Model/ContractRtiEmployeeName.php | 538 + .../ContractShiftWorkingPatternDayRequest.php | 510 + ...ContractShiftWorkingPatternDayResponse.php | 476 + src/Model/ContractSpinalPointRequest.php | 796 + src/Model/ContractSpinalPointResponse.php | 830 + .../ContractSpinalPointUpdateRequest.php | 830 + src/Model/ContractSpineAllowanceRequest.php | 701 + src/Model/ContractSpineAllowanceResponse.php | 735 + .../ContractSpineAllowanceUpdateRequest.php | 735 + src/Model/ContractStarterDetails.php | 516 + src/Model/ContractTaxAndNi.php | 794 + src/Model/ContractTermCalendarRequest.php | 449 + src/Model/ContractTermCalendarResponse.php | 483 + src/Model/ContractTermCalendarYearRequest.php | 578 + .../ContractTermCalendarYearResponse.php | 612 + src/Model/ContractUpdateEmployeeRequest.php | 859 + src/Model/ContractVeteranDetails.php | 449 + src/Model/ContractWorkingPatternRequest.php | 1345 + src/Model/ContractWorkingPatternResponse.php | 1189 + ...ContractYearsServiceEntitlementRequest.php | 456 + ...ontractYearsServiceEntitlementResponse.php | 490 + ...ctYearsServiceEntitlementUpdateRequest.php | 490 + src/Model/CostAnalysisReport.php | 1279 + .../CostAnalysisReportReportResponse.php | 532 + src/Model/CostCentre.php | 644 + src/Model/CostOfEmploymentReport.php | 912 + src/Model/CostOfEmploymentReportLine.php | 694 + .../CostOfEmploymentReportReportResponse.php | 532 + src/Model/Country.php | 53 + src/Model/CsvFileFormat.php | 53 + src/Model/DayOfWeek.php | 55 + .../DecimalTaxYearConfigPrimitiveValue.php | 490 + src/Model/DeferalPeriodType.php | 49 + src/Model/Department.php | 644 + src/Model/DepartmentMembership.php | 605 + src/Model/DirectDebitMandate.php | 606 + src/Model/DirectorshipDetails.php | 524 + src/Model/DpsDataType.php | 61 + src/Model/DpsNotice.php | 1056 + src/Model/DpsSettings.php | 559 + src/Model/EmailAttachment.php | 534 + src/Model/EmpRefs.php | 620 + src/Model/Employee.php | 961 + src/Model/EmployeeBenefitsReport.php | 517 + .../EmployeeBenefitsReportReportResponse.php | 532 + src/Model/EmployeeCostCentre.php | 639 + src/Model/EmployeeLeaveReport.php | 558 + src/Model/EmployeeLeaveReportLine.php | 1492 + .../EmployeeLeaveReportReportResponse.php | 532 + src/Model/EmployeeNiYtdValues.php | 606 + src/Model/EmployeePayRunTotal.php | 790 + src/Model/EmployeeRole.php | 868 + .../EmployeeRoleAnalysisCategoryCode.php | 713 + src/Model/EmployeeRolePayItem.php | 544 + src/Model/EmployeeRolePayOptions.php | 912 + src/Model/EmployeeSortBy.php | 49 + src/Model/EmployeeStatus.php | 47 + src/Model/EmployeeYtdValues.php | 572 + src/Model/Employer.php | 2286 + src/Model/EmployerDefaults.php | 817 + src/Model/EmployerEmail.php | 1018 + src/Model/EmployerEvcOptInHistory.php | 483 + src/Model/EmployerGroup.php | 561 + src/Model/EmployerGroupMembership.php | 537 + src/Model/EmployerItem.php | 599 + src/Model/EmployerOpeningBalances.php | 816 + src/Model/EmployerPensionContribution.php | 517 + src/Model/EmployerSettings.php | 896 + src/Model/EmployerTemplate.php | 798 + src/Model/EmployerTemplateType.php | 75 + src/Model/EmploymentDetails.php | 1423 + src/Model/EntitlementBand.php | 544 + src/Model/EntityType.php | 91 + src/Model/Eps.php | 871 + src/Model/EpsAccount.php | 539 + src/Model/EpsApprenticeshipLevy.php | 477 + src/Model/EpsDeMinimisStateAid.php | 511 + src/Model/EpsFinalSubmission.php | 484 + src/Model/Establishment.php | 531 + src/Model/EvcSettings.php | 511 + src/Model/Exb.php | 962 + src/Model/ExbDeclarations.php | 456 + src/Model/ExbEmployer.php | 415 + src/Model/ExbP11d.php | 884 + src/Model/ExbP11dEmployee.php | 647 + src/Model/ExbP11db.php | 408 + src/Model/ExbP11dbClass1A.php | 524 + src/Model/ExbP11dbClass1AAdjustment.php | 456 + src/Model/ExbP11dbClass1AAdjustments.php | 565 + src/Model/ExbP11dbClass1ATotalBenefit.php | 456 + src/Model/ExbReportResponse.php | 532 + src/Model/ExpensesAndBenefits.php | 626 + src/Model/ExternalDataCompany.php | 498 + src/Model/ExternalDataProvider.php | 756 + src/Model/ExternalDataProviderId.php | 105 + src/Model/ExternalDataProviderType.php | 53 + src/Model/ExternalEmployeeMapping.php | 593 + src/Model/ExternalEmployeeMappingStatus.php | 49 + src/Model/ExternalProviderConversation.php | 655 + src/Model/FieldModification.php | 531 + src/Model/FixedCode.php | 450 + src/Model/FlexibleDrawdown.php | 49 + src/Model/Fps.php | 919 + src/Model/FpsBenefit.php | 415 + src/Model/FpsCar.php | 859 + src/Model/FpsCarFuel.php | 497 + src/Model/FpsEmployee.php | 585 + src/Model/FpsEmployeeDetails.php | 640 + .../FpsEmployeeDetailsPartnerDetails.php | 449 + src/Model/FpsEmployeeFigsToDate.php | 1604 + src/Model/FpsEmployeeFlexibleDrawdown.php | 579 + src/Model/FpsEmployeeNIlettersAndValues.php | 784 + src/Model/FpsEmployeePayment.php | 1692 + src/Model/FpsEmployeeSeconded.php | 579 + src/Model/FpsEmployeeStarter.php | 606 + src/Model/FpsEmployeeStarterOccPension.php | 456 + src/Model/FpsEmployeeTaxCode.php | 497 + .../FpsEmployeeTrivialCommutationPayment.php | 456 + src/Model/FpsEmployerPayIdChanged.php | 456 + src/Model/FpsEmployment.php | 920 + src/Model/FpsFields.php | 544 + src/Model/FpsLateReason.php | 59 + src/Model/FpsPriorVersion.php | 442 + src/Model/FpsReportResponse.php | 532 + src/Model/FromToDates.php | 442 + src/Model/FullPaymentSubmission.php | 456 + src/Model/FullSummaryOfPayReport.php | 919 + src/Model/FullSummaryOfPayReportLine.php | 558 + .../FullSummaryOfPayReportReportResponse.php | 532 + src/Model/FurloughCalculationBasis.php | 47 + src/Model/FurloughReport.php | 1826 + src/Model/FurloughReportLine.php | 1008 + src/Model/FurloughReportReportResponse.php | 532 + src/Model/Gender.php | 45 + src/Model/GenderPayGapLine.php | 742 + src/Model/GenderPayGapReport.php | 558 + .../GenderPayGapReportReportResponse.php | 532 + src/Model/GenderPayGapSnapShotDate.php | 45 + src/Model/GovTalk.php | 744 + src/Model/GovTalkError.php | 579 + src/Model/GovTalkSubmission.php | 902 + src/Model/GrossToNetReport.php | 953 + src/Model/GrossToNetReportCisLine.php | 803 + src/Model/GrossToNetReportLine.php | 1048 + src/Model/GrossToNetReportReportResponse.php | 532 + src/Model/HmrcDetails.php | 1049 + src/Model/HmrcLiability.php | 1898 + src/Model/HmrcPayment.php | 476 + src/Model/HolidayAccrual.php | 49 + src/Model/HolidayAccrualDefaultRateType.php | 47 + src/Model/HolidayReport.php | 660 + src/Model/HolidayReportLine.php | 565 + src/Model/HolidayReportReportResponse.php | 532 + src/Model/HolidaySchemeDurationType.php | 45 + src/Model/HolidayType.php | 49 + src/Model/HourlyPayReport.php | 878 + src/Model/HourlyPayReportLine.php | 626 + src/Model/HourlyPayReportReportResponse.php | 532 + src/Model/HoursNormallyWorked.php | 51 + src/Model/HtmlEmailSettings.php | 579 + src/Model/HtmlInsertionPoint.php | 45 + src/Model/IncrementRule.php | 49 + src/Model/Invitation.php | 679 + src/Model/Item.php | 531 + src/Model/ItemListReportResponse.php | 539 + src/Model/JobStatus.php | 51 + src/Model/JobType.php | 47 + src/Model/JournalCsvFormat.php | 47 + src/Model/JournalTemplate.php | 524 + src/Model/JournalTokenType.php | 49 + src/Model/Leave.php | 2089 + src/Model/LeaveAssumedPensionablePay.php | 592 + src/Model/LeaveCalculationType.php | 51 + src/Model/LeaveCustomPayment.php | 476 + src/Model/LeaveCustomProRataRule.php | 442 + src/Model/LeavePayType.php | 51 + src/Model/LeaveProRataRule.php | 55 + src/Model/LeaveSettings.php | 1973 + src/Model/LeaveType.php | 63 + src/Model/LeaverDetails.php | 619 + src/Model/LgpsCivicaCasualHours.php | 47 + src/Model/LgpsCivicaPayrollNumber.php | 55 + src/Model/LgpsFund.php | 213 + src/Model/LgpsIConnectFileType.php | 45 + src/Model/LgpsIConnectPayrollReference.php | 63 + src/Model/LgpsIConnectSalaryType.php | 47 + src/Model/LgpsPayCategory.php | 43 + src/Model/LinkedPiw.php | 627 + src/Model/LinkedPiwResult.php | 45 + src/Model/Loan.php | 880 + src/Model/LoanBalancesReport.php | 558 + src/Model/LoanBalancesReportLine.php | 674 + .../LoanBalancesReportReportResponse.php | 532 + src/Model/LoanCharge.php | 443 + src/Model/LogEntry.php | 449 + src/Model/LondonAllowance.php | 547 + src/Model/LondonAllowanceType.php | 47 + src/Model/LondonAllowanceValueType.php | 45 + src/Model/MailSettings.php | 723 + src/Model/MaritalStatus.php | 53 + src/Model/McrPayCategory.php | 47 + src/Model/MileageAllowancePaymentsRate.php | 518 + src/Model/MileageVehicleType.php | 47 + src/Model/ModelInterface.php | 111 + src/Model/MonthlyMinimum.php | 558 + src/Model/NationalInsuranceCalculation.php | 1042 + .../NationalInsuranceCalculationBase.php | 1001 + ...tionalInsuranceCalculationPeriodValues.php | 681 + src/Model/NationalInsuranceCode.php | 872 + src/Model/NationalMinimumWage.php | 484 + src/Model/NiLetterError.php | 89 + src/Model/NiLetterValidationReport.php | 953 + src/Model/NiLetterValidationReportLine.php | 756 + ...NiLetterValidationReportReportResponse.php | 532 + src/Model/NiYtdReport.php | 592 + src/Model/NiYtdReportReportResponse.php | 532 + src/Model/NiYtdValue.php | 517 + src/Model/NicSummary.php | 1156 + src/Model/NominalCodeMapping.php | 645 + src/Model/Note.php | 709 + src/Model/NoteType.php | 49 + src/Model/Nvr.php | 701 + src/Model/NvrEmployee.php | 510 + src/Model/NvrEmployeeDetails.php | 565 + src/Model/NvrEmployment.php | 415 + src/Model/NvrRequest.php | 456 + src/Model/OccupationalPolicy.php | 823 + src/Model/OccupationalPolicyEntitlement.php | 45 + ...nalPolicyEntitlementRecalculationBasis.php | 45 + .../OccupationalPolicyPayCalculatedOn.php | 51 + src/Model/OccupationalPolicySicknessYear.php | 47 + src/Model/OccupationalPolicyType.php | 45 + src/Model/OccupationalSickLeaveHistory.php | 679 + src/Model/OpeningBalances.php | 1197 + src/Model/OpeningBalancesTotals.php | 1197 + src/Model/OverseasEmployerDetails.php | 510 + src/Model/OverseasSecondmentStatus.php | 49 + src/Model/P11.php | 996 + src/Model/P11DAssetAvailable.php | 661 + src/Model/P11DAssetAvailableCollection.php | 456 + src/Model/P11DAssetTransferredCollection.php | 456 + src/Model/P11DCar.php | 1023 + src/Model/P11DCarCollection.php | 538 + src/Model/P11DDescOther.php | 661 + src/Model/P11DLoan.php | 702 + src/Model/P11DLoanCollection.php | 456 + src/Model/P11DOther.php | 538 + src/Model/P11DPaymentCollection.php | 497 + src/Model/P11DSingleItem.php | 866 + src/Model/P11Detailed.php | 1255 + src/Model/P11DetailedNiValues.php | 688 + src/Model/P11DetailedReportResponse.php | 532 + src/Model/P11Line.php | 865 + src/Model/P11NiAndStatPaymentsLine.php | 845 + src/Model/P11NiAndStatPaymentsTotalsLine.php | 783 + src/Model/P11NiValues.php | 484 + src/Model/P11PayeLine.php | 777 + src/Model/P11PayeSummary.php | 579 + src/Model/P11PayeTotalsLine.php | 579 + src/Model/P11ReportResponse.php | 532 + src/Model/P11dCarFreeFuelWithdrawn.php | 456 + src/Model/P11dExpenses.php | 585 + src/Model/P11dVans.php | 907 + src/Model/P32.php | 661 + src/Model/P32ReportResponse.php | 532 + src/Model/PapdisDocument.php | 654 + src/Model/PapdisDocumentReportResponse.php | 532 + src/Model/PapdisEmployee.php | 1137 + src/Model/PapdisEmployeeAssessment.php | 831 + src/Model/PapdisEmployeeContact.php | 572 + .../PapdisEmployeeContactPostalAddress.php | 620 + src/Model/PapdisEmployeeContribution.php | 1129 + src/Model/PapdisEmployeeExit.php | 579 + src/Model/PapdisEmployeeIdentity.php | 599 + src/Model/PapdisEmployeeName.php | 538 + src/Model/PapdisEmployeePay.php | 585 + src/Model/PapdisEmployer.php | 872 + .../PapdisEmployerContactPostalAddress.php | 620 + src/Model/PapdisMessageFunctionCode.php | 51 + src/Model/PapdisPayrollPeriod.php | 660 + src/Model/PapdisPensionProvider.php | 497 + src/Model/PapdisVersion.php | 45 + src/Model/PartnerDetails.php | 570 + src/Model/PayBasis.php | 47 + src/Model/PayCode.php | 1282 + src/Model/PayCodeCalculationType.php | 53 + src/Model/PayCodeMultiplierType.php | 47 + src/Model/PayCodeSet.php | 638 + src/Model/PayCodeVarianceLine.php | 497 + src/Model/PayElementReport.php | 919 + src/Model/PayElementReportLine.php | 599 + src/Model/PayElementReportReportResponse.php | 532 + src/Model/PayGradesReport.php | 558 + src/Model/PayGradesReportReportResponse.php | 532 + src/Model/PayLine.php | 2431 + src/Model/PayMethod.php | 49 + src/Model/PayOptions.php | 1124 + src/Model/PayOptionsImport.php | 1262 + src/Model/PayPeriodEventType.php | 54 + src/Model/PayPeriodTypes.php | 53 + src/Model/PayPeriods.php | 53 + src/Model/PayRun.php | 1049 + src/Model/PayRunChanges.php | 415 + src/Model/PayRunCsvType.php | 49 + src/Model/PayRunEntry.php | 2119 + src/Model/PayRunEntrySortBy.php | 63 + src/Model/PayRunEntryWarningType.php | 79 + src/Model/PayRunJournal.php | 810 + src/Model/PayRunPayment.php | 776 + src/Model/PayRunState.php | 65 + src/Model/PayRunStateChange.php | 532 + src/Model/PayRunStateChangeReason.php | 49 + src/Model/PayRunSummaryLine.php | 969 + ...unSummaryLineIEnumerableReportResponse.php | 539 + src/Model/PayRunTotals.php | 3041 + src/Model/PaySchedule.php | 1247 + src/Model/PaySchedulePeriod.php | 619 + src/Model/PaySchedulePeriodEvent.php | 552 + src/Model/PaySchedulePeriodEventsConfig.php | 579 + src/Model/PaySpineReport.php | 558 + src/Model/PaySpineReportLine.php | 980 + src/Model/PaySpineReportReportResponse.php | 532 + .../PaySpineYearsServiceEntitlementBasis.php | 49 + src/Model/Payee.php | 637 + src/Model/PayeeType.php | 51 + src/Model/PaylineCalculationData.php | 612 + src/Model/PaymentDateRule.php | 47 + src/Model/PaymentDateType.php | 61 + src/Model/PaymentMethodAfterLeaving.php | 45 + src/Model/PaymentsCsvMapping.php | 1366 + src/Model/PaymentsCsvMappingColumn.php | 678 + src/Model/PaymentsCsvMappingType.php | 45 + .../PayrollAnalysisCostBreakdownReport.php | 960 + ...PayrollAnalysisCostBreakdownReportLine.php | 1232 + ...lysisCostBreakdownReportReportResponse.php | 532 + ...ayrollAnalysisCostBreakdownReportValue.php | 490 + ...ollAnalysisEmployeeRoleBreakdownReport.php | 919 + ...nalysisEmployeeRoleBreakdownReportLine.php | 789 + ...isEmployeeRoleBreakdownReportLineValue.php | 490 + ...loyeeRoleBreakdownReportReportResponse.php | 532 + src/Model/PayrollValueType.php | 167 + src/Model/PayrunEmail.php | 1162 + src/Model/PayrunPaymentsReport.php | 1029 + .../PayrunPaymentsReportReportResponse.php | 532 + src/Model/Payslip.php | 1513 + src/Model/PayslipCustomisation.php | 915 + src/Model/PayslipLine.php | 1138 + src/Model/PayslipLineType.php | 53 + src/Model/PayslipReleaseType.php | 45 + src/Model/PayslipReportResponse.php | 532 + src/Model/PdfPaperMargins.php | 510 + src/Model/PdfPaperOrientation.php | 45 + src/Model/PdfPaperSize.php | 51 + src/Model/PdfPasswordType.php | 47 + src/Model/Pension.php | 1772 + src/Model/PensionAdministrator.php | 589 + src/Model/PensionContributionLevelType.php | 87 + src/Model/PensionContributionsSubmission.php | 804 + src/Model/PensionCsvFormat.php | 91 + src/Model/PensionEndReason.php | 47 + src/Model/PensionJoinReason.php | 51 + src/Model/PensionMembershipReportLine.php | 1589 + src/Model/PensionMembershipsReport.php | 878 + ...PensionMembershipsReportReportResponse.php | 532 + src/Model/PensionOpeningBalances.php | 590 + src/Model/PensionPayCode.php | 47 + src/Model/PensionProvider.php | 1158 + src/Model/PensionRefund.php | 908 + src/Model/PensionReportingType.php | 49 + src/Model/PensionRule.php | 47 + src/Model/PensionScheme.php | 1509 + src/Model/PensionSchemeNominalCodeMapping.php | 562 + ...ensionSchemeReportOptionsLgpsCivicaUpm.php | 680 + ...PensionSchemeReportOptionsLgpsIConnect.php | 1163 + src/Model/PensionSelection.php | 510 + src/Model/PensionSummary.php | 2180 + src/Model/PensionSummaryCostBreakdown.php | 585 + src/Model/PensionablePayDefinition.php | 51 + src/Model/PensionerPayroll.php | 517 + src/Model/PeriodValue.php | 531 + src/Model/PeriodValuePeriodValues.php | 579 + src/Model/PersonalDetails.php | 1359 + src/Model/PricingBand.php | 551 + src/Model/PricingTable.php | 664 + src/Model/ProRataRule.php | 49 + src/Model/ProcessingNote.php | 788 + src/Model/ProcessingNoteStatus.php | 45 + src/Model/RecoverableAmounts.php | 816 + src/Model/Report.php | 147 + src/Model/ReportCustomCssOption.php | 47 + src/Model/ReportFormat.php | 47 + src/Model/ReportPack.php | 502 + src/Model/ReportResponse.php | 539 + src/Model/ReportSortBy.php | 47 + src/Model/ReportTemplate.php | 529 + src/Model/RightToWork.php | 581 + src/Model/RightToWorkDocumentType.php | 53 + src/Model/RightToWorkReport.php | 592 + src/Model/RightToWorkReportLine.php | 524 + src/Model/RightToWorkReportReportResponse.php | 532 + src/Model/RoleBasis.php | 55 + src/Model/RoleType.php | 49 + src/Model/RtiAgent.php | 524 + src/Model/RtiContact.php | 570 + src/Model/RtiEmployeeAddress.php | 620 + src/Model/RtiEmployeeName.php | 538 + src/Model/RtiSenderType.php | 61 + src/Model/RtiSubmissionSettings.php | 895 + src/Model/RtiValidationWarning.php | 449 + src/Model/RtiValidationWarningType.php | 45 + src/Model/ServiceBand.php | 558 + src/Model/ShiftWorkingPatternDay.php | 510 + src/Model/SmtpEncryption.php | 47 + src/Model/SmtpSettings.php | 565 + src/Model/SpinePointReport.php | 558 + src/Model/SpinePointReportLine.php | 961 + src/Model/SpinePointReportReportResponse.php | 532 + src/Model/StarterDeclaration.php | 49 + src/Model/StarterDetails.php | 516 + src/Model/StartersLeaversFilter.php | 45 + src/Model/StatPayFrequency.php | 45 + src/Model/StatutoryPay.php | 477 + src/Model/StatutoryPayReport.php | 878 + src/Model/StatutoryPayReportLine.php | 762 + .../StatutoryPayReportReportResponse.php | 532 + src/Model/StringDecimalKeyValuePair.php | 449 + src/Model/StringStringKeyValuePair.php | 456 + src/Model/StudentLoan.php | 49 + src/Model/StudentLoanRecovered.php | 456 + src/Model/SubmissionStatus.php | 49 + src/Model/Tag.php | 527 + src/Model/TaxAndNi.php | 794 + src/Model/TaxBracket.php | 476 + src/Model/TaxCodeChange.php | 450 + src/Model/TaxCodeChangeReport.php | 558 + .../TaxCodeChangeReportReportResponse.php | 532 + src/Model/TaxCodeChangeValues.php | 722 + src/Model/TaxYear.php | 57 + src/Model/TaxYearConfig.php | 2030 + src/Model/TaxYearTypes.php | 57 + src/Model/TeachersPensionAgeWarning.php | 49 + src/Model/TeachersPensionDetails.php | 638 + src/Model/TeachersPensionEmploymentType.php | 49 + src/Model/TeachersPensionEoyLineItem.php | 544 + src/Model/TeachersPensionEoyReport.php | 1143 + ...TeachersPensionEoyReportReportResponse.php | 532 + src/Model/Tenant.php | 1495 + src/Model/TenantBillingSettings.php | 640 + src/Model/TenantEmail.php | 1018 + src/Model/TenantHtmlInsertion.php | 449 + src/Model/TenantItem.php | 532 + src/Model/TieredPension.php | 484 + src/Model/TieredPensionRate.php | 525 + src/Model/UmbrellaPayment.php | 694 + src/Model/UmbrellaReconciliationReport.php | 878 + .../UmbrellaReconciliationReportLine.php | 1007 + ...ellaReconciliationReportReportResponse.php | 532 + src/Model/UmbrellaSettings.php | 749 + src/Model/UsageBill.php | 946 + src/Model/User.php | 2298 + src/Model/UserAuthorization.php | 457 + src/Model/UserCategory.php | 57 + src/Model/UserDisplayPreferences.php | 918 + src/Model/UserIndustry.php | 105 + src/Model/UserJobType.php | 53 + src/Model/UserRole.php | 53 + src/Model/UserstartPage.php | 53 + src/Model/UtmInfo.php | 579 + src/Model/ValueOverride.php | 648 + src/Model/VarianceReport.php | 844 + src/Model/VarianceReportReportResponse.php | 532 + src/Model/VeteranDetails.php | 450 + src/Model/WarningsReport.php | 449 + src/Model/WarningsReportLine.php | 531 + src/Model/WarningsReportReportResponse.php | 532 + src/Model/Webhook.php | 596 + src/Model/WebhookEvent.php | 59 + src/Model/WebhookPayload.php | 735 + src/Model/WorkerGroup.php | 1532 + src/Model/WorkingPattern.php | 1118 + src/Model/WorkingPatternHoursType.php | 47 + src/Model/WorkingPatternType.php | 45 + src/Model/YearEnd.php | 791 + src/Model/YearEndTaxCodeChange.php | 491 + src/Model/YtdReport.php | 592 + src/Model/YtdReportReportResponse.php | 532 + src/Model/YtdValue.php | 510 + src/Model/ZeroPaidFilter.php | 47 + src/ObjectSerializer.php | 611 + 1502 files changed, 794013 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/discord.xml create mode 100644 .idea/git_toolbox_blame.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/phpunit.xml create mode 100644 .idea/staffology-php.iml create mode 100644 .idea/vcs.xml create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .php-cs-fixer.dist.php create mode 100644 .phplint.yml create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 composer.json create mode 100644 docs/Api/AccountApi.md create mode 100644 docs/Api/AnalysisCategoryApi.md create mode 100644 docs/Api/AttachmentOrderApi.md create mode 100644 docs/Api/AuditApi.md create mode 100644 docs/Api/AutoEnrolmentApi.md create mode 100644 docs/Api/AverageHolidayPayHistoryApi.md create mode 100644 docs/Api/BenefitsApi.md create mode 100644 docs/Api/BillingApi.md create mode 100644 docs/Api/BureauApi.md create mode 100644 docs/Api/Cis300Api.md create mode 100644 docs/Api/CisVerificationApi.md create mode 100644 docs/Api/CostCentreApi.md create mode 100644 docs/Api/DepartmentApi.md create mode 100644 docs/Api/DpsApi.md create mode 100644 docs/Api/EmailApi.md create mode 100644 docs/Api/EmployeeApi.md create mode 100644 docs/Api/EmployeeRoleApi.md create mode 100644 docs/Api/EmployerApi.md create mode 100644 docs/Api/EmployerGroupApi.md create mode 100644 docs/Api/EmployerTemplateApi.md create mode 100644 docs/Api/EngineApi.md create mode 100644 docs/Api/EpsApi.md create mode 100644 docs/Api/ExbApi.md create mode 100644 docs/Api/ExternalDataApi.md create mode 100644 docs/Api/FpsApi.md create mode 100644 docs/Api/HmrcPaymentApi.md create mode 100644 docs/Api/HolidaySchemeApi.md create mode 100644 docs/Api/ImportApi.md create mode 100644 docs/Api/InvitationApi.md create mode 100644 docs/Api/JobApi.md create mode 100644 docs/Api/JournalTemplateApi.md create mode 100644 docs/Api/JournalTokenApi.md create mode 100644 docs/Api/LeaveApi.md create mode 100644 docs/Api/LoanApi.md create mode 100644 docs/Api/NoteApi.md create mode 100644 docs/Api/NvrApi.md create mode 100644 docs/Api/OccupationalPolicyApi.md create mode 100644 docs/Api/OccupationalSickLeaveHistoryApi.md create mode 100644 docs/Api/OpeningBalancesApi.md create mode 100644 docs/Api/P11HistoryApi.md create mode 100644 docs/Api/PayCodeApi.md create mode 100644 docs/Api/PayCodeSetApi.md create mode 100644 docs/Api/PayRunApi.md create mode 100644 docs/Api/PayRunAsyncApi.md create mode 100644 docs/Api/PayScheduleApi.md create mode 100644 docs/Api/PaySpineApi.md create mode 100644 docs/Api/PayeeApi.md create mode 100644 docs/Api/PensionApi.md create mode 100644 docs/Api/PensionRefundApi.md create mode 100644 docs/Api/PensionSchemeApi.md create mode 100644 docs/Api/ProcessingNoteApi.md create mode 100644 docs/Api/ReportPackApi.md create mode 100644 docs/Api/ReportTemplateApi.md create mode 100644 docs/Api/ReportsApi.md create mode 100644 docs/Api/ReportsAsyncApi.md create mode 100644 docs/Api/TagApi.md create mode 100644 docs/Api/TenantApi.md create mode 100644 docs/Api/TenantEmailApi.md create mode 100644 docs/Api/TermCalendarApi.md create mode 100644 docs/Api/TermCalendarYearApi.md create mode 100644 docs/Api/TierablePayApi.md create mode 100644 docs/Api/ToolsApi.md create mode 100644 docs/Api/WebhookApi.md create mode 100644 docs/Api/WorkingPatternApi.md create mode 100644 docs/Model/Address.md create mode 100644 docs/Model/AdvancedVarianceReport.md create mode 100644 docs/Model/AdvancedVarianceReportLine.md create mode 100644 docs/Model/AdvancedVarianceReportReportResponse.md create mode 100644 docs/Model/AeAction.md create mode 100644 docs/Model/AeAssessment.md create mode 100644 docs/Model/AeAssessmentAction.md create mode 100644 docs/Model/AeEmployeeState.md create mode 100644 docs/Model/AeExclusionCode.md create mode 100644 docs/Model/AeStatus.md create mode 100644 docs/Model/AeStatutoryLetter.md create mode 100644 docs/Model/AeUKWorker.md create mode 100644 docs/Model/AllowanceType.md create mode 100644 docs/Model/AnalysisCategory.md create mode 100644 docs/Model/AnalysisCategoryCode.md create mode 100644 docs/Model/AnalysisCategoryCodes.md create mode 100644 docs/Model/AnalysisCategoryIndex.md create mode 100644 docs/Model/AnalysisReport.md create mode 100644 docs/Model/AnalysisReportLine.md create mode 100644 docs/Model/AnalysisReportLineValue.md create mode 100644 docs/Model/AnalysisReportReportResponse.md create mode 100644 docs/Model/AnnualRoundingRule.md create mode 100644 docs/Model/AssumedPensionablePay.md create mode 100644 docs/Model/AttachmentOrder.md create mode 100644 docs/Model/AttachmentOrderPayment.md create mode 100644 docs/Model/AttachmentOrderReportResponse.md create mode 100644 docs/Model/AttachmentOrderType.md create mode 100644 docs/Model/AttachmentOrdersReport.md create mode 100644 docs/Model/AttachmentOrdersReportReportResponse.md create mode 100644 docs/Model/AuditEventAction.md create mode 100644 docs/Model/AuthScheme.md create mode 100644 docs/Model/AutoEnrolment.md create mode 100644 docs/Model/AutoEnrolmentSettings.md create mode 100644 docs/Model/AutoPilotFinaliseTime.md create mode 100644 docs/Model/AutomationSettings.md create mode 100644 docs/Model/AverageHolidayPayRateReport.md create mode 100644 docs/Model/AverageHolidayPayRateReportLine.md create mode 100644 docs/Model/AverageHolidayPayRateReportReportResponse.md create mode 100644 docs/Model/AveragePayGradesReportLine.md create mode 100644 docs/Model/AverageWeeklyEarnings.md create mode 100644 docs/Model/AverageWeeklyEarningsResult.md create mode 100644 docs/Model/BackgroundTaskStatus.md create mode 100644 docs/Model/BankDetails.md create mode 100644 docs/Model/BankHolidayCollection.md create mode 100644 docs/Model/BankPaymentInstruction.md create mode 100644 docs/Model/BankPaymentInstructionReportResponse.md create mode 100644 docs/Model/BankPaymentInstructionsCsvFormat.md create mode 100644 docs/Model/Benefit.md create mode 100644 docs/Model/BenefitDeclarationType.md create mode 100644 docs/Model/BenefitDetailsAssetType.md create mode 100644 docs/Model/BenefitDetailsCar.md create mode 100644 docs/Model/BenefitDetailsCarPowerType.md create mode 100644 docs/Model/BenefitDetailsClass1AType.md create mode 100644 docs/Model/BenefitDetailsLoan.md create mode 100644 docs/Model/BenefitDetailsNonClass1AType.md create mode 100644 docs/Model/BenefitDetailsPaymentType.md create mode 100644 docs/Model/BenefitDetailsUseOfAssetType.md create mode 100644 docs/Model/BenefitPayrolled.md create mode 100644 docs/Model/BenefitType.md create mode 100644 docs/Model/BureauSettings.md create mode 100644 docs/Model/CISSubContractorType.md create mode 100644 docs/Model/CISTaxStatus.md create mode 100644 docs/Model/CalendarEntry.md create mode 100644 docs/Model/CalendarEntryType.md create mode 100644 docs/Model/CalendarMonth.md create mode 100644 docs/Model/CarCharge.md create mode 100644 docs/Model/CarChargeRate.md create mode 100644 docs/Model/ChangeSummary.md create mode 100644 docs/Model/ChangeSummaryListReportResponse.md create mode 100644 docs/Model/Cis300.md create mode 100644 docs/Model/Cis300Declarations.md create mode 100644 docs/Model/Cis300ReportResponse.md create mode 100644 docs/Model/CisContractor.md create mode 100644 docs/Model/CisDetails.md create mode 100644 docs/Model/CisPartnership.md create mode 100644 docs/Model/CisRequest.md create mode 100644 docs/Model/CisReturn.md create mode 100644 docs/Model/CisStatement.md create mode 100644 docs/Model/CisStatementListReportResponse.md create mode 100644 docs/Model/CisSubContractor.md create mode 100644 docs/Model/CisSubContractorSummary.md create mode 100644 docs/Model/CisSubContractorSummaryListReportResponse.md create mode 100644 docs/Model/CisVerification.md create mode 100644 docs/Model/CisVerificationDetails.md create mode 100644 docs/Model/ContractAddress.md create mode 100644 docs/Model/ContractAeAssessmentAction.md create mode 100644 docs/Model/ContractAeAssessmentRequest.md create mode 100644 docs/Model/ContractAeAssessmentResponse.md create mode 100644 docs/Model/ContractAllowanceGradesRequest.md create mode 100644 docs/Model/ContractAllowanceGradesResponse.md create mode 100644 docs/Model/ContractAllowanceGradesUpdateRequest.md create mode 100644 docs/Model/ContractAnalysisCategoryCodeRequest.md create mode 100644 docs/Model/ContractAnalysisCategoryCodeResponse.md create mode 100644 docs/Model/ContractAnalysisCategoryRequest.md create mode 100644 docs/Model/ContractAnalysisCategoryResponse.md create mode 100644 docs/Model/ContractAutoEnrolmentRequest.md create mode 100644 docs/Model/ContractAutoEnrolmentResponse.md create mode 100644 docs/Model/ContractBankDetails.md create mode 100644 docs/Model/ContractCisDetailsRequest.md create mode 100644 docs/Model/ContractCisDetailsResponse.md create mode 100644 docs/Model/ContractCisPartnership.md create mode 100644 docs/Model/ContractCisSubContractor.md create mode 100644 docs/Model/ContractCisSubContractorItem.md create mode 100644 docs/Model/ContractCisVerificationDetailsRequest.md create mode 100644 docs/Model/ContractCisVerificationDetailsResponse.md create mode 100644 docs/Model/ContractCostCentreJournalOverridesRequest.md create mode 100644 docs/Model/ContractCostCentreJournalOverridesResponse.md create mode 100644 docs/Model/ContractCostCentreJournalOverridesResponseItem.md create mode 100644 docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md create mode 100644 docs/Model/ContractCreateEmployeeRequest.md create mode 100644 docs/Model/ContractDepartmentJournalOverridesRequest.md create mode 100644 docs/Model/ContractDepartmentJournalOverridesResponse.md create mode 100644 docs/Model/ContractDepartmentJournalOverridesResponseItem.md create mode 100644 docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md create mode 100644 docs/Model/ContractDepartmentRequest.md create mode 100644 docs/Model/ContractDepartmentResponse.md create mode 100644 docs/Model/ContractDirectorshipDetails.md create mode 100644 docs/Model/ContractEmployeeItem.md create mode 100644 docs/Model/ContractEmployeeResponse.md create mode 100644 docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md create mode 100644 docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md create mode 100644 docs/Model/ContractEmployeeRoleItem.md create mode 100644 docs/Model/ContractEmployeeRoleResponse.md create mode 100644 docs/Model/ContractEmployeeRoleWorkingPatternRequest.md create mode 100644 docs/Model/ContractEmployeeRoleWorkingPatternResponse.md create mode 100644 docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md create mode 100644 docs/Model/ContractEmployerBase.md create mode 100644 docs/Model/ContractEmploymentDetailsRequest.md create mode 100644 docs/Model/ContractEmploymentDetailsResponse.md create mode 100644 docs/Model/ContractFpsFields.md create mode 100644 docs/Model/ContractGrossToNetReportRequest.md create mode 100644 docs/Model/ContractHolidayEntitlementRequest.md create mode 100644 docs/Model/ContractHolidayEntitlementResponse.md create mode 100644 docs/Model/ContractHolidayEntitlementUpdateRequest.md create mode 100644 docs/Model/ContractHolidaySchemeRequest.md create mode 100644 docs/Model/ContractHolidaySchemeResponse.md create mode 100644 docs/Model/ContractJobErrorResponse.md create mode 100644 docs/Model/ContractJobResponse.md create mode 100644 docs/Model/ContractJobResultFileResponse.md create mode 100644 docs/Model/ContractJobResultResponse.md create mode 100644 docs/Model/ContractJournalTemplateRequest.md create mode 100644 docs/Model/ContractJournalTemplateResponse.md create mode 100644 docs/Model/ContractJournalTokenRequest.md create mode 100644 docs/Model/ContractJournalTokenResponse.md create mode 100644 docs/Model/ContractJournalTokenResponseItem.md create mode 100644 docs/Model/ContractLeaveImportRequest.md create mode 100644 docs/Model/ContractLeaveSettingsRequest.md create mode 100644 docs/Model/ContractLeaveSettingsResponse.md create mode 100644 docs/Model/ContractLeaverDetails.md create mode 100644 docs/Model/ContractLondonAllowanceRequest.md create mode 100644 docs/Model/ContractLondonAllowanceResponse.md create mode 100644 docs/Model/ContractNetOfOnCostsResponse.md create mode 100644 docs/Model/ContractNetOfOnCostsSimulationResponse.md create mode 100644 docs/Model/ContractOverseasEmployerDetails.md create mode 100644 docs/Model/ContractP11HistoryRequest.md create mode 100644 docs/Model/ContractP11HistoryResponse.md create mode 100644 docs/Model/ContractPartnerDetails.md create mode 100644 docs/Model/ContractPayHistoryRequest.md create mode 100644 docs/Model/ContractPayHistoryResponse.md create mode 100644 docs/Model/ContractPayHistoryUpdateRequest.md create mode 100644 docs/Model/ContractPayLineRequest.md create mode 100644 docs/Model/ContractPayLineResponse.md create mode 100644 docs/Model/ContractPayOptionsBaseResponse.md create mode 100644 docs/Model/ContractPayOptionsImportRequest.md create mode 100644 docs/Model/ContractPayOptionsRequest.md create mode 100644 docs/Model/ContractPayOptionsResponse.md create mode 100644 docs/Model/ContractPayRunStateHistoryResponse.md create mode 100644 docs/Model/ContractPaySpineGradeRequest.md create mode 100644 docs/Model/ContractPaySpineGradeResponse.md create mode 100644 docs/Model/ContractPaySpineRequest.md create mode 100644 docs/Model/ContractPaySpineResponse.md create mode 100644 docs/Model/ContractPaySpineUpdateRequest.md create mode 100644 docs/Model/ContractPaylineAnalysisCategoriesCodes.md create mode 100644 docs/Model/ContractPaylineRequest.md create mode 100644 docs/Model/ContractPayrollSquadEmployerRequest.md create mode 100644 docs/Model/ContractPayrollSquadEmployerResponse.md create mode 100644 docs/Model/ContractPayrollSquadMemberRequest.md create mode 100644 docs/Model/ContractPayrollSquadMemberResponse.md create mode 100644 docs/Model/ContractPayrollSquadRequest.md create mode 100644 docs/Model/ContractPayrollSquadResponse.md create mode 100644 docs/Model/ContractPendingLettersCountResponse.md create mode 100644 docs/Model/ContractPensionerPayroll.md create mode 100644 docs/Model/ContractPersonalDetailsRequest.md create mode 100644 docs/Model/ContractPersonalDetailsResponse.md create mode 100644 docs/Model/ContractReapplyDpsNoticeResponse.md create mode 100644 docs/Model/ContractRightToWork.md create mode 100644 docs/Model/ContractRtiEmployeeAddress.md create mode 100644 docs/Model/ContractRtiEmployeeName.md create mode 100644 docs/Model/ContractShiftWorkingPatternDayRequest.md create mode 100644 docs/Model/ContractShiftWorkingPatternDayResponse.md create mode 100644 docs/Model/ContractSpinalPointRequest.md create mode 100644 docs/Model/ContractSpinalPointResponse.md create mode 100644 docs/Model/ContractSpinalPointUpdateRequest.md create mode 100644 docs/Model/ContractSpineAllowanceRequest.md create mode 100644 docs/Model/ContractSpineAllowanceResponse.md create mode 100644 docs/Model/ContractSpineAllowanceUpdateRequest.md create mode 100644 docs/Model/ContractStarterDetails.md create mode 100644 docs/Model/ContractTaxAndNi.md create mode 100644 docs/Model/ContractTermCalendarRequest.md create mode 100644 docs/Model/ContractTermCalendarResponse.md create mode 100644 docs/Model/ContractTermCalendarYearRequest.md create mode 100644 docs/Model/ContractTermCalendarYearResponse.md create mode 100644 docs/Model/ContractUpdateEmployeeRequest.md create mode 100644 docs/Model/ContractVeteranDetails.md create mode 100644 docs/Model/ContractWorkingPatternRequest.md create mode 100644 docs/Model/ContractWorkingPatternResponse.md create mode 100644 docs/Model/ContractYearsServiceEntitlementRequest.md create mode 100644 docs/Model/ContractYearsServiceEntitlementResponse.md create mode 100644 docs/Model/ContractYearsServiceEntitlementUpdateRequest.md create mode 100644 docs/Model/CostAnalysisReport.md create mode 100644 docs/Model/CostAnalysisReportReportResponse.md create mode 100644 docs/Model/CostCentre.md create mode 100644 docs/Model/CostOfEmploymentReport.md create mode 100644 docs/Model/CostOfEmploymentReportLine.md create mode 100644 docs/Model/CostOfEmploymentReportReportResponse.md create mode 100644 docs/Model/Country.md create mode 100644 docs/Model/CsvFileFormat.md create mode 100644 docs/Model/DayOfWeek.md create mode 100644 docs/Model/DecimalTaxYearConfigPrimitiveValue.md create mode 100644 docs/Model/DeferalPeriodType.md create mode 100644 docs/Model/Department.md create mode 100644 docs/Model/DepartmentMembership.md create mode 100644 docs/Model/DirectDebitMandate.md create mode 100644 docs/Model/DirectorshipDetails.md create mode 100644 docs/Model/DpsDataType.md create mode 100644 docs/Model/DpsNotice.md create mode 100644 docs/Model/DpsSettings.md create mode 100644 docs/Model/EmailAttachment.md create mode 100644 docs/Model/EmpRefs.md create mode 100644 docs/Model/Employee.md create mode 100644 docs/Model/EmployeeBenefitsReport.md create mode 100644 docs/Model/EmployeeBenefitsReportReportResponse.md create mode 100644 docs/Model/EmployeeCostCentre.md create mode 100644 docs/Model/EmployeeLeaveReport.md create mode 100644 docs/Model/EmployeeLeaveReportLine.md create mode 100644 docs/Model/EmployeeLeaveReportReportResponse.md create mode 100644 docs/Model/EmployeeNiYtdValues.md create mode 100644 docs/Model/EmployeePayRunTotal.md create mode 100644 docs/Model/EmployeeRole.md create mode 100644 docs/Model/EmployeeRoleAnalysisCategoryCode.md create mode 100644 docs/Model/EmployeeRolePayItem.md create mode 100644 docs/Model/EmployeeRolePayOptions.md create mode 100644 docs/Model/EmployeeSortBy.md create mode 100644 docs/Model/EmployeeStatus.md create mode 100644 docs/Model/EmployeeYtdValues.md create mode 100644 docs/Model/Employer.md create mode 100644 docs/Model/EmployerDefaults.md create mode 100644 docs/Model/EmployerEmail.md create mode 100644 docs/Model/EmployerEvcOptInHistory.md create mode 100644 docs/Model/EmployerGroup.md create mode 100644 docs/Model/EmployerGroupMembership.md create mode 100644 docs/Model/EmployerItem.md create mode 100644 docs/Model/EmployerOpeningBalances.md create mode 100644 docs/Model/EmployerPensionContribution.md create mode 100644 docs/Model/EmployerSettings.md create mode 100644 docs/Model/EmployerTemplate.md create mode 100644 docs/Model/EmployerTemplateType.md create mode 100644 docs/Model/EmploymentDetails.md create mode 100644 docs/Model/EntitlementBand.md create mode 100644 docs/Model/EntityType.md create mode 100644 docs/Model/Eps.md create mode 100644 docs/Model/EpsAccount.md create mode 100644 docs/Model/EpsApprenticeshipLevy.md create mode 100644 docs/Model/EpsDeMinimisStateAid.md create mode 100644 docs/Model/EpsFinalSubmission.md create mode 100644 docs/Model/Establishment.md create mode 100644 docs/Model/EvcSettings.md create mode 100644 docs/Model/Exb.md create mode 100644 docs/Model/ExbDeclarations.md create mode 100644 docs/Model/ExbEmployer.md create mode 100644 docs/Model/ExbP11d.md create mode 100644 docs/Model/ExbP11dEmployee.md create mode 100644 docs/Model/ExbP11db.md create mode 100644 docs/Model/ExbP11dbClass1A.md create mode 100644 docs/Model/ExbP11dbClass1AAdjustment.md create mode 100644 docs/Model/ExbP11dbClass1AAdjustments.md create mode 100644 docs/Model/ExbP11dbClass1ATotalBenefit.md create mode 100644 docs/Model/ExbReportResponse.md create mode 100644 docs/Model/ExpensesAndBenefits.md create mode 100644 docs/Model/ExternalDataCompany.md create mode 100644 docs/Model/ExternalDataProvider.md create mode 100644 docs/Model/ExternalDataProviderId.md create mode 100644 docs/Model/ExternalDataProviderType.md create mode 100644 docs/Model/ExternalEmployeeMapping.md create mode 100644 docs/Model/ExternalEmployeeMappingStatus.md create mode 100644 docs/Model/ExternalProviderConversation.md create mode 100644 docs/Model/FieldModification.md create mode 100644 docs/Model/FixedCode.md create mode 100644 docs/Model/FlexibleDrawdown.md create mode 100644 docs/Model/Fps.md create mode 100644 docs/Model/FpsBenefit.md create mode 100644 docs/Model/FpsCar.md create mode 100644 docs/Model/FpsCarFuel.md create mode 100644 docs/Model/FpsEmployee.md create mode 100644 docs/Model/FpsEmployeeDetails.md create mode 100644 docs/Model/FpsEmployeeDetailsPartnerDetails.md create mode 100644 docs/Model/FpsEmployeeFigsToDate.md create mode 100644 docs/Model/FpsEmployeeFlexibleDrawdown.md create mode 100644 docs/Model/FpsEmployeeNIlettersAndValues.md create mode 100644 docs/Model/FpsEmployeePayment.md create mode 100644 docs/Model/FpsEmployeeSeconded.md create mode 100644 docs/Model/FpsEmployeeStarter.md create mode 100644 docs/Model/FpsEmployeeStarterOccPension.md create mode 100644 docs/Model/FpsEmployeeTaxCode.md create mode 100644 docs/Model/FpsEmployeeTrivialCommutationPayment.md create mode 100644 docs/Model/FpsEmployerPayIdChanged.md create mode 100644 docs/Model/FpsEmployment.md create mode 100644 docs/Model/FpsFields.md create mode 100644 docs/Model/FpsLateReason.md create mode 100644 docs/Model/FpsPriorVersion.md create mode 100644 docs/Model/FpsReportResponse.md create mode 100644 docs/Model/FromToDates.md create mode 100644 docs/Model/FullPaymentSubmission.md create mode 100644 docs/Model/FullSummaryOfPayReport.md create mode 100644 docs/Model/FullSummaryOfPayReportLine.md create mode 100644 docs/Model/FullSummaryOfPayReportReportResponse.md create mode 100644 docs/Model/FurloughCalculationBasis.md create mode 100644 docs/Model/FurloughReport.md create mode 100644 docs/Model/FurloughReportLine.md create mode 100644 docs/Model/FurloughReportReportResponse.md create mode 100644 docs/Model/Gender.md create mode 100644 docs/Model/GenderPayGapLine.md create mode 100644 docs/Model/GenderPayGapReport.md create mode 100644 docs/Model/GenderPayGapReportReportResponse.md create mode 100644 docs/Model/GenderPayGapSnapShotDate.md create mode 100644 docs/Model/GovTalk.md create mode 100644 docs/Model/GovTalkError.md create mode 100644 docs/Model/GovTalkSubmission.md create mode 100644 docs/Model/GrossToNetReport.md create mode 100644 docs/Model/GrossToNetReportCisLine.md create mode 100644 docs/Model/GrossToNetReportLine.md create mode 100644 docs/Model/GrossToNetReportReportResponse.md create mode 100644 docs/Model/HmrcDetails.md create mode 100644 docs/Model/HmrcLiability.md create mode 100644 docs/Model/HmrcPayment.md create mode 100644 docs/Model/HolidayAccrual.md create mode 100644 docs/Model/HolidayAccrualDefaultRateType.md create mode 100644 docs/Model/HolidayReport.md create mode 100644 docs/Model/HolidayReportLine.md create mode 100644 docs/Model/HolidayReportReportResponse.md create mode 100644 docs/Model/HolidaySchemeDurationType.md create mode 100644 docs/Model/HolidayType.md create mode 100644 docs/Model/HourlyPayReport.md create mode 100644 docs/Model/HourlyPayReportLine.md create mode 100644 docs/Model/HourlyPayReportReportResponse.md create mode 100644 docs/Model/HoursNormallyWorked.md create mode 100644 docs/Model/HtmlEmailSettings.md create mode 100644 docs/Model/HtmlInsertionPoint.md create mode 100644 docs/Model/IncrementRule.md create mode 100644 docs/Model/Invitation.md create mode 100644 docs/Model/Item.md create mode 100644 docs/Model/ItemListReportResponse.md create mode 100644 docs/Model/JobStatus.md create mode 100644 docs/Model/JobType.md create mode 100644 docs/Model/JournalCsvFormat.md create mode 100644 docs/Model/JournalTemplate.md create mode 100644 docs/Model/JournalTokenType.md create mode 100644 docs/Model/Leave.md create mode 100644 docs/Model/LeaveAssumedPensionablePay.md create mode 100644 docs/Model/LeaveCalculationType.md create mode 100644 docs/Model/LeaveCustomPayment.md create mode 100644 docs/Model/LeaveCustomProRataRule.md create mode 100644 docs/Model/LeavePayType.md create mode 100644 docs/Model/LeaveProRataRule.md create mode 100644 docs/Model/LeaveSettings.md create mode 100644 docs/Model/LeaveType.md create mode 100644 docs/Model/LeaverDetails.md create mode 100644 docs/Model/LgpsCivicaCasualHours.md create mode 100644 docs/Model/LgpsCivicaPayrollNumber.md create mode 100644 docs/Model/LgpsFund.md create mode 100644 docs/Model/LgpsIConnectFileType.md create mode 100644 docs/Model/LgpsIConnectPayrollReference.md create mode 100644 docs/Model/LgpsIConnectSalaryType.md create mode 100644 docs/Model/LgpsPayCategory.md create mode 100644 docs/Model/LinkedPiw.md create mode 100644 docs/Model/LinkedPiwResult.md create mode 100644 docs/Model/Loan.md create mode 100644 docs/Model/LoanBalancesReport.md create mode 100644 docs/Model/LoanBalancesReportLine.md create mode 100644 docs/Model/LoanBalancesReportReportResponse.md create mode 100644 docs/Model/LoanCharge.md create mode 100644 docs/Model/LogEntry.md create mode 100644 docs/Model/LondonAllowance.md create mode 100644 docs/Model/LondonAllowanceType.md create mode 100644 docs/Model/LondonAllowanceValueType.md create mode 100644 docs/Model/MailSettings.md create mode 100644 docs/Model/MaritalStatus.md create mode 100644 docs/Model/McrPayCategory.md create mode 100644 docs/Model/MileageAllowancePaymentsRate.md create mode 100644 docs/Model/MileageVehicleType.md create mode 100644 docs/Model/MonthlyMinimum.md create mode 100644 docs/Model/NationalInsuranceCalculation.md create mode 100644 docs/Model/NationalInsuranceCalculationBase.md create mode 100644 docs/Model/NationalInsuranceCalculationPeriodValues.md create mode 100644 docs/Model/NationalInsuranceCode.md create mode 100644 docs/Model/NationalMinimumWage.md create mode 100644 docs/Model/NiLetterError.md create mode 100644 docs/Model/NiLetterValidationReport.md create mode 100644 docs/Model/NiLetterValidationReportLine.md create mode 100644 docs/Model/NiLetterValidationReportReportResponse.md create mode 100644 docs/Model/NiYtdReport.md create mode 100644 docs/Model/NiYtdReportReportResponse.md create mode 100644 docs/Model/NiYtdValue.md create mode 100644 docs/Model/NicSummary.md create mode 100644 docs/Model/NominalCodeMapping.md create mode 100644 docs/Model/Note.md create mode 100644 docs/Model/NoteType.md create mode 100644 docs/Model/Nvr.md create mode 100644 docs/Model/NvrEmployee.md create mode 100644 docs/Model/NvrEmployeeDetails.md create mode 100644 docs/Model/NvrEmployment.md create mode 100644 docs/Model/NvrRequest.md create mode 100644 docs/Model/OccupationalPolicy.md create mode 100644 docs/Model/OccupationalPolicyEntitlement.md create mode 100644 docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md create mode 100644 docs/Model/OccupationalPolicyPayCalculatedOn.md create mode 100644 docs/Model/OccupationalPolicySicknessYear.md create mode 100644 docs/Model/OccupationalPolicyType.md create mode 100644 docs/Model/OccupationalSickLeaveHistory.md create mode 100644 docs/Model/OpeningBalances.md create mode 100644 docs/Model/OpeningBalancesTotals.md create mode 100644 docs/Model/OverseasEmployerDetails.md create mode 100644 docs/Model/OverseasSecondmentStatus.md create mode 100644 docs/Model/P11.md create mode 100644 docs/Model/P11DAssetAvailable.md create mode 100644 docs/Model/P11DAssetAvailableCollection.md create mode 100644 docs/Model/P11DAssetTransferredCollection.md create mode 100644 docs/Model/P11DCar.md create mode 100644 docs/Model/P11DCarCollection.md create mode 100644 docs/Model/P11DDescOther.md create mode 100644 docs/Model/P11DLoan.md create mode 100644 docs/Model/P11DLoanCollection.md create mode 100644 docs/Model/P11DOther.md create mode 100644 docs/Model/P11DPaymentCollection.md create mode 100644 docs/Model/P11DSingleItem.md create mode 100644 docs/Model/P11Detailed.md create mode 100644 docs/Model/P11DetailedNiValues.md create mode 100644 docs/Model/P11DetailedReportResponse.md create mode 100644 docs/Model/P11Line.md create mode 100644 docs/Model/P11NiAndStatPaymentsLine.md create mode 100644 docs/Model/P11NiAndStatPaymentsTotalsLine.md create mode 100644 docs/Model/P11NiValues.md create mode 100644 docs/Model/P11PayeLine.md create mode 100644 docs/Model/P11PayeSummary.md create mode 100644 docs/Model/P11PayeTotalsLine.md create mode 100644 docs/Model/P11ReportResponse.md create mode 100644 docs/Model/P11dCarFreeFuelWithdrawn.md create mode 100644 docs/Model/P11dExpenses.md create mode 100644 docs/Model/P11dVans.md create mode 100644 docs/Model/P32.md create mode 100644 docs/Model/P32ReportResponse.md create mode 100644 docs/Model/PapdisDocument.md create mode 100644 docs/Model/PapdisDocumentReportResponse.md create mode 100644 docs/Model/PapdisEmployee.md create mode 100644 docs/Model/PapdisEmployeeAssessment.md create mode 100644 docs/Model/PapdisEmployeeContact.md create mode 100644 docs/Model/PapdisEmployeeContactPostalAddress.md create mode 100644 docs/Model/PapdisEmployeeContribution.md create mode 100644 docs/Model/PapdisEmployeeExit.md create mode 100644 docs/Model/PapdisEmployeeIdentity.md create mode 100644 docs/Model/PapdisEmployeeName.md create mode 100644 docs/Model/PapdisEmployeePay.md create mode 100644 docs/Model/PapdisEmployer.md create mode 100644 docs/Model/PapdisEmployerContactPostalAddress.md create mode 100644 docs/Model/PapdisMessageFunctionCode.md create mode 100644 docs/Model/PapdisPayrollPeriod.md create mode 100644 docs/Model/PapdisPensionProvider.md create mode 100644 docs/Model/PapdisVersion.md create mode 100644 docs/Model/PartnerDetails.md create mode 100644 docs/Model/PayBasis.md create mode 100644 docs/Model/PayCode.md create mode 100644 docs/Model/PayCodeCalculationType.md create mode 100644 docs/Model/PayCodeMultiplierType.md create mode 100644 docs/Model/PayCodeSet.md create mode 100644 docs/Model/PayCodeVarianceLine.md create mode 100644 docs/Model/PayElementReport.md create mode 100644 docs/Model/PayElementReportLine.md create mode 100644 docs/Model/PayElementReportReportResponse.md create mode 100644 docs/Model/PayGradesReport.md create mode 100644 docs/Model/PayGradesReportReportResponse.md create mode 100644 docs/Model/PayLine.md create mode 100644 docs/Model/PayMethod.md create mode 100644 docs/Model/PayOptions.md create mode 100644 docs/Model/PayOptionsImport.md create mode 100644 docs/Model/PayPeriodEventType.md create mode 100644 docs/Model/PayPeriodTypes.md create mode 100644 docs/Model/PayPeriods.md create mode 100644 docs/Model/PayRun.md create mode 100644 docs/Model/PayRunChanges.md create mode 100644 docs/Model/PayRunCsvType.md create mode 100644 docs/Model/PayRunEntry.md create mode 100644 docs/Model/PayRunEntrySortBy.md create mode 100644 docs/Model/PayRunEntryWarningType.md create mode 100644 docs/Model/PayRunJournal.md create mode 100644 docs/Model/PayRunPayment.md create mode 100644 docs/Model/PayRunState.md create mode 100644 docs/Model/PayRunStateChange.md create mode 100644 docs/Model/PayRunStateChangeReason.md create mode 100644 docs/Model/PayRunSummaryLine.md create mode 100644 docs/Model/PayRunSummaryLineIEnumerableReportResponse.md create mode 100644 docs/Model/PayRunTotals.md create mode 100644 docs/Model/PaySchedule.md create mode 100644 docs/Model/PaySchedulePeriod.md create mode 100644 docs/Model/PaySchedulePeriodEvent.md create mode 100644 docs/Model/PaySchedulePeriodEventsConfig.md create mode 100644 docs/Model/PaySpineReport.md create mode 100644 docs/Model/PaySpineReportLine.md create mode 100644 docs/Model/PaySpineReportReportResponse.md create mode 100644 docs/Model/PaySpineYearsServiceEntitlementBasis.md create mode 100644 docs/Model/Payee.md create mode 100644 docs/Model/PayeeType.md create mode 100644 docs/Model/PaylineCalculationData.md create mode 100644 docs/Model/PaymentDateRule.md create mode 100644 docs/Model/PaymentDateType.md create mode 100644 docs/Model/PaymentMethodAfterLeaving.md create mode 100644 docs/Model/PaymentsCsvMapping.md create mode 100644 docs/Model/PaymentsCsvMappingColumn.md create mode 100644 docs/Model/PaymentsCsvMappingType.md create mode 100644 docs/Model/PayrollAnalysisCostBreakdownReport.md create mode 100644 docs/Model/PayrollAnalysisCostBreakdownReportLine.md create mode 100644 docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md create mode 100644 docs/Model/PayrollAnalysisCostBreakdownReportValue.md create mode 100644 docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md create mode 100644 docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md create mode 100644 docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md create mode 100644 docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md create mode 100644 docs/Model/PayrollValueType.md create mode 100644 docs/Model/PayrunEmail.md create mode 100644 docs/Model/PayrunPaymentsReport.md create mode 100644 docs/Model/PayrunPaymentsReportReportResponse.md create mode 100644 docs/Model/Payslip.md create mode 100644 docs/Model/PayslipCustomisation.md create mode 100644 docs/Model/PayslipLine.md create mode 100644 docs/Model/PayslipLineType.md create mode 100644 docs/Model/PayslipReleaseType.md create mode 100644 docs/Model/PayslipReportResponse.md create mode 100644 docs/Model/PdfPaperMargins.md create mode 100644 docs/Model/PdfPaperOrientation.md create mode 100644 docs/Model/PdfPaperSize.md create mode 100644 docs/Model/PdfPasswordType.md create mode 100644 docs/Model/Pension.md create mode 100644 docs/Model/PensionAdministrator.md create mode 100644 docs/Model/PensionContributionLevelType.md create mode 100644 docs/Model/PensionContributionsSubmission.md create mode 100644 docs/Model/PensionCsvFormat.md create mode 100644 docs/Model/PensionEndReason.md create mode 100644 docs/Model/PensionJoinReason.md create mode 100644 docs/Model/PensionMembershipReportLine.md create mode 100644 docs/Model/PensionMembershipsReport.md create mode 100644 docs/Model/PensionMembershipsReportReportResponse.md create mode 100644 docs/Model/PensionOpeningBalances.md create mode 100644 docs/Model/PensionPayCode.md create mode 100644 docs/Model/PensionProvider.md create mode 100644 docs/Model/PensionRefund.md create mode 100644 docs/Model/PensionReportingType.md create mode 100644 docs/Model/PensionRule.md create mode 100644 docs/Model/PensionScheme.md create mode 100644 docs/Model/PensionSchemeNominalCodeMapping.md create mode 100644 docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md create mode 100644 docs/Model/PensionSchemeReportOptionsLgpsIConnect.md create mode 100644 docs/Model/PensionSelection.md create mode 100644 docs/Model/PensionSummary.md create mode 100644 docs/Model/PensionSummaryCostBreakdown.md create mode 100644 docs/Model/PensionablePayDefinition.md create mode 100644 docs/Model/PensionerPayroll.md create mode 100644 docs/Model/PeriodValue.md create mode 100644 docs/Model/PeriodValuePeriodValues.md create mode 100644 docs/Model/PersonalDetails.md create mode 100644 docs/Model/PricingBand.md create mode 100644 docs/Model/PricingTable.md create mode 100644 docs/Model/ProRataRule.md create mode 100644 docs/Model/ProcessingNote.md create mode 100644 docs/Model/ProcessingNoteStatus.md create mode 100644 docs/Model/RecoverableAmounts.md create mode 100644 docs/Model/Report.md create mode 100644 docs/Model/ReportCustomCssOption.md create mode 100644 docs/Model/ReportFormat.md create mode 100644 docs/Model/ReportPack.md create mode 100644 docs/Model/ReportResponse.md create mode 100644 docs/Model/ReportSortBy.md create mode 100644 docs/Model/ReportTemplate.md create mode 100644 docs/Model/RightToWork.md create mode 100644 docs/Model/RightToWorkDocumentType.md create mode 100644 docs/Model/RightToWorkReport.md create mode 100644 docs/Model/RightToWorkReportLine.md create mode 100644 docs/Model/RightToWorkReportReportResponse.md create mode 100644 docs/Model/RoleBasis.md create mode 100644 docs/Model/RoleType.md create mode 100644 docs/Model/RtiAgent.md create mode 100644 docs/Model/RtiContact.md create mode 100644 docs/Model/RtiEmployeeAddress.md create mode 100644 docs/Model/RtiEmployeeName.md create mode 100644 docs/Model/RtiSenderType.md create mode 100644 docs/Model/RtiSubmissionSettings.md create mode 100644 docs/Model/RtiValidationWarning.md create mode 100644 docs/Model/RtiValidationWarningType.md create mode 100644 docs/Model/ServiceBand.md create mode 100644 docs/Model/ShiftWorkingPatternDay.md create mode 100644 docs/Model/SmtpEncryption.md create mode 100644 docs/Model/SmtpSettings.md create mode 100644 docs/Model/SpinePointReport.md create mode 100644 docs/Model/SpinePointReportLine.md create mode 100644 docs/Model/SpinePointReportReportResponse.md create mode 100644 docs/Model/StarterDeclaration.md create mode 100644 docs/Model/StarterDetails.md create mode 100644 docs/Model/StartersLeaversFilter.md create mode 100644 docs/Model/StatPayFrequency.md create mode 100644 docs/Model/StatutoryPay.md create mode 100644 docs/Model/StatutoryPayReport.md create mode 100644 docs/Model/StatutoryPayReportLine.md create mode 100644 docs/Model/StatutoryPayReportReportResponse.md create mode 100644 docs/Model/StringDecimalKeyValuePair.md create mode 100644 docs/Model/StringStringKeyValuePair.md create mode 100644 docs/Model/StudentLoan.md create mode 100644 docs/Model/StudentLoanRecovered.md create mode 100644 docs/Model/SubmissionStatus.md create mode 100644 docs/Model/Tag.md create mode 100644 docs/Model/TaxAndNi.md create mode 100644 docs/Model/TaxBracket.md create mode 100644 docs/Model/TaxCodeChange.md create mode 100644 docs/Model/TaxCodeChangeReport.md create mode 100644 docs/Model/TaxCodeChangeReportReportResponse.md create mode 100644 docs/Model/TaxCodeChangeValues.md create mode 100644 docs/Model/TaxYear.md create mode 100644 docs/Model/TaxYearConfig.md create mode 100644 docs/Model/TaxYearTypes.md create mode 100644 docs/Model/TeachersPensionAgeWarning.md create mode 100644 docs/Model/TeachersPensionDetails.md create mode 100644 docs/Model/TeachersPensionEmploymentType.md create mode 100644 docs/Model/TeachersPensionEoyLineItem.md create mode 100644 docs/Model/TeachersPensionEoyReport.md create mode 100644 docs/Model/TeachersPensionEoyReportReportResponse.md create mode 100644 docs/Model/Tenant.md create mode 100644 docs/Model/TenantBillingSettings.md create mode 100644 docs/Model/TenantEmail.md create mode 100644 docs/Model/TenantHtmlInsertion.md create mode 100644 docs/Model/TenantItem.md create mode 100644 docs/Model/TieredPension.md create mode 100644 docs/Model/TieredPensionRate.md create mode 100644 docs/Model/UmbrellaPayment.md create mode 100644 docs/Model/UmbrellaReconciliationReport.md create mode 100644 docs/Model/UmbrellaReconciliationReportLine.md create mode 100644 docs/Model/UmbrellaReconciliationReportReportResponse.md create mode 100644 docs/Model/UmbrellaSettings.md create mode 100644 docs/Model/UsageBill.md create mode 100644 docs/Model/User.md create mode 100644 docs/Model/UserAuthorization.md create mode 100644 docs/Model/UserCategory.md create mode 100644 docs/Model/UserDisplayPreferences.md create mode 100644 docs/Model/UserIndustry.md create mode 100644 docs/Model/UserJobType.md create mode 100644 docs/Model/UserRole.md create mode 100644 docs/Model/UserstartPage.md create mode 100644 docs/Model/UtmInfo.md create mode 100644 docs/Model/ValueOverride.md create mode 100644 docs/Model/VarianceReport.md create mode 100644 docs/Model/VarianceReportReportResponse.md create mode 100644 docs/Model/VeteranDetails.md create mode 100644 docs/Model/WarningsReport.md create mode 100644 docs/Model/WarningsReportLine.md create mode 100644 docs/Model/WarningsReportReportResponse.md create mode 100644 docs/Model/Webhook.md create mode 100644 docs/Model/WebhookEvent.md create mode 100644 docs/Model/WebhookPayload.md create mode 100644 docs/Model/WorkerGroup.md create mode 100644 docs/Model/WorkingPattern.md create mode 100644 docs/Model/WorkingPatternHoursType.md create mode 100644 docs/Model/WorkingPatternType.md create mode 100644 docs/Model/YearEnd.md create mode 100644 docs/Model/YearEndTaxCodeChange.md create mode 100644 docs/Model/YtdReport.md create mode 100644 docs/Model/YtdReportReportResponse.md create mode 100644 docs/Model/YtdValue.md create mode 100644 docs/Model/ZeroPaidFilter.md create mode 100644 generate/README.md create mode 100644 generate/config.yaml create mode 100644 generate/swagger.json create mode 100644 phpunit.xml.dist create mode 100644 src/Api/AccountApi.php create mode 100644 src/Api/AnalysisCategoryApi.php create mode 100644 src/Api/AttachmentOrderApi.php create mode 100644 src/Api/AuditApi.php create mode 100644 src/Api/AutoEnrolmentApi.php create mode 100644 src/Api/AverageHolidayPayHistoryApi.php create mode 100644 src/Api/BenefitsApi.php create mode 100644 src/Api/BillingApi.php create mode 100644 src/Api/BureauApi.php create mode 100644 src/Api/Cis300Api.php create mode 100644 src/Api/CisVerificationApi.php create mode 100644 src/Api/CostCentreApi.php create mode 100644 src/Api/DepartmentApi.php create mode 100644 src/Api/DpsApi.php create mode 100644 src/Api/EmailApi.php create mode 100644 src/Api/EmployeeApi.php create mode 100644 src/Api/EmployeeRoleApi.php create mode 100644 src/Api/EmployerApi.php create mode 100644 src/Api/EmployerGroupApi.php create mode 100644 src/Api/EmployerTemplateApi.php create mode 100644 src/Api/EngineApi.php create mode 100644 src/Api/EpsApi.php create mode 100644 src/Api/ExbApi.php create mode 100644 src/Api/ExternalDataApi.php create mode 100644 src/Api/FpsApi.php create mode 100644 src/Api/HmrcPaymentApi.php create mode 100644 src/Api/HolidaySchemeApi.php create mode 100644 src/Api/ImportApi.php create mode 100644 src/Api/InvitationApi.php create mode 100644 src/Api/JobApi.php create mode 100644 src/Api/JournalTemplateApi.php create mode 100644 src/Api/JournalTokenApi.php create mode 100644 src/Api/LeaveApi.php create mode 100644 src/Api/LoanApi.php create mode 100644 src/Api/NoteApi.php create mode 100644 src/Api/NvrApi.php create mode 100644 src/Api/OccupationalPolicyApi.php create mode 100644 src/Api/OccupationalSickLeaveHistoryApi.php create mode 100644 src/Api/OpeningBalancesApi.php create mode 100644 src/Api/P11HistoryApi.php create mode 100644 src/Api/PayCodeApi.php create mode 100644 src/Api/PayCodeSetApi.php create mode 100644 src/Api/PayRunApi.php create mode 100644 src/Api/PayRunAsyncApi.php create mode 100644 src/Api/PayScheduleApi.php create mode 100644 src/Api/PaySpineApi.php create mode 100644 src/Api/PayeeApi.php create mode 100644 src/Api/PensionApi.php create mode 100644 src/Api/PensionRefundApi.php create mode 100644 src/Api/PensionSchemeApi.php create mode 100644 src/Api/ProcessingNoteApi.php create mode 100644 src/Api/ReportPackApi.php create mode 100644 src/Api/ReportTemplateApi.php create mode 100644 src/Api/ReportsApi.php create mode 100644 src/Api/ReportsAsyncApi.php create mode 100644 src/Api/TagApi.php create mode 100644 src/Api/TenantApi.php create mode 100644 src/Api/TenantEmailApi.php create mode 100644 src/Api/TermCalendarApi.php create mode 100644 src/Api/TermCalendarYearApi.php create mode 100644 src/Api/TierablePayApi.php create mode 100644 src/Api/ToolsApi.php create mode 100644 src/Api/WebhookApi.php create mode 100644 src/Api/WorkingPatternApi.php create mode 100644 src/ApiException.php create mode 100644 src/Configuration.php create mode 100644 src/HeaderSelector.php create mode 100644 src/Model/Address.php create mode 100644 src/Model/AdvancedVarianceReport.php create mode 100644 src/Model/AdvancedVarianceReportLine.php create mode 100644 src/Model/AdvancedVarianceReportReportResponse.php create mode 100644 src/Model/AeAction.php create mode 100644 src/Model/AeAssessment.php create mode 100644 src/Model/AeAssessmentAction.php create mode 100644 src/Model/AeEmployeeState.php create mode 100644 src/Model/AeExclusionCode.php create mode 100644 src/Model/AeStatus.php create mode 100644 src/Model/AeStatutoryLetter.php create mode 100644 src/Model/AeUKWorker.php create mode 100644 src/Model/AllowanceType.php create mode 100644 src/Model/AnalysisCategory.php create mode 100644 src/Model/AnalysisCategoryCode.php create mode 100644 src/Model/AnalysisCategoryCodes.php create mode 100644 src/Model/AnalysisCategoryIndex.php create mode 100644 src/Model/AnalysisReport.php create mode 100644 src/Model/AnalysisReportLine.php create mode 100644 src/Model/AnalysisReportLineValue.php create mode 100644 src/Model/AnalysisReportReportResponse.php create mode 100644 src/Model/AnnualRoundingRule.php create mode 100644 src/Model/AssumedPensionablePay.php create mode 100644 src/Model/AttachmentOrder.php create mode 100644 src/Model/AttachmentOrderPayment.php create mode 100644 src/Model/AttachmentOrderReportResponse.php create mode 100644 src/Model/AttachmentOrderType.php create mode 100644 src/Model/AttachmentOrdersReport.php create mode 100644 src/Model/AttachmentOrdersReportReportResponse.php create mode 100644 src/Model/AuditEventAction.php create mode 100644 src/Model/AuthScheme.php create mode 100644 src/Model/AutoEnrolment.php create mode 100644 src/Model/AutoEnrolmentSettings.php create mode 100644 src/Model/AutoPilotFinaliseTime.php create mode 100644 src/Model/AutomationSettings.php create mode 100644 src/Model/AverageHolidayPayRateReport.php create mode 100644 src/Model/AverageHolidayPayRateReportLine.php create mode 100644 src/Model/AverageHolidayPayRateReportReportResponse.php create mode 100644 src/Model/AveragePayGradesReportLine.php create mode 100644 src/Model/AverageWeeklyEarnings.php create mode 100644 src/Model/AverageWeeklyEarningsResult.php create mode 100644 src/Model/BackgroundTaskStatus.php create mode 100644 src/Model/BankDetails.php create mode 100644 src/Model/BankHolidayCollection.php create mode 100644 src/Model/BankPaymentInstruction.php create mode 100644 src/Model/BankPaymentInstructionReportResponse.php create mode 100644 src/Model/BankPaymentInstructionsCsvFormat.php create mode 100644 src/Model/Benefit.php create mode 100644 src/Model/BenefitDeclarationType.php create mode 100644 src/Model/BenefitDetailsAssetType.php create mode 100644 src/Model/BenefitDetailsCar.php create mode 100644 src/Model/BenefitDetailsCarPowerType.php create mode 100644 src/Model/BenefitDetailsClass1AType.php create mode 100644 src/Model/BenefitDetailsLoan.php create mode 100644 src/Model/BenefitDetailsNonClass1AType.php create mode 100644 src/Model/BenefitDetailsPaymentType.php create mode 100644 src/Model/BenefitDetailsUseOfAssetType.php create mode 100644 src/Model/BenefitPayrolled.php create mode 100644 src/Model/BenefitType.php create mode 100644 src/Model/BureauSettings.php create mode 100644 src/Model/CISSubContractorType.php create mode 100644 src/Model/CISTaxStatus.php create mode 100644 src/Model/CalendarEntry.php create mode 100644 src/Model/CalendarEntryType.php create mode 100644 src/Model/CalendarMonth.php create mode 100644 src/Model/CarCharge.php create mode 100644 src/Model/CarChargeRate.php create mode 100644 src/Model/ChangeSummary.php create mode 100644 src/Model/ChangeSummaryListReportResponse.php create mode 100644 src/Model/Cis300.php create mode 100644 src/Model/Cis300Declarations.php create mode 100644 src/Model/Cis300ReportResponse.php create mode 100644 src/Model/CisContractor.php create mode 100644 src/Model/CisDetails.php create mode 100644 src/Model/CisPartnership.php create mode 100644 src/Model/CisRequest.php create mode 100644 src/Model/CisReturn.php create mode 100644 src/Model/CisStatement.php create mode 100644 src/Model/CisStatementListReportResponse.php create mode 100644 src/Model/CisSubContractor.php create mode 100644 src/Model/CisSubContractorSummary.php create mode 100644 src/Model/CisSubContractorSummaryListReportResponse.php create mode 100644 src/Model/CisVerification.php create mode 100644 src/Model/CisVerificationDetails.php create mode 100644 src/Model/ContractAddress.php create mode 100644 src/Model/ContractAeAssessmentAction.php create mode 100644 src/Model/ContractAeAssessmentRequest.php create mode 100644 src/Model/ContractAeAssessmentResponse.php create mode 100644 src/Model/ContractAllowanceGradesRequest.php create mode 100644 src/Model/ContractAllowanceGradesResponse.php create mode 100644 src/Model/ContractAllowanceGradesUpdateRequest.php create mode 100644 src/Model/ContractAnalysisCategoryCodeRequest.php create mode 100644 src/Model/ContractAnalysisCategoryCodeResponse.php create mode 100644 src/Model/ContractAnalysisCategoryRequest.php create mode 100644 src/Model/ContractAnalysisCategoryResponse.php create mode 100644 src/Model/ContractAutoEnrolmentRequest.php create mode 100644 src/Model/ContractAutoEnrolmentResponse.php create mode 100644 src/Model/ContractBankDetails.php create mode 100644 src/Model/ContractCisDetailsRequest.php create mode 100644 src/Model/ContractCisDetailsResponse.php create mode 100644 src/Model/ContractCisPartnership.php create mode 100644 src/Model/ContractCisSubContractor.php create mode 100644 src/Model/ContractCisSubContractorItem.php create mode 100644 src/Model/ContractCisVerificationDetailsRequest.php create mode 100644 src/Model/ContractCisVerificationDetailsResponse.php create mode 100644 src/Model/ContractCostCentreJournalOverridesRequest.php create mode 100644 src/Model/ContractCostCentreJournalOverridesResponse.php create mode 100644 src/Model/ContractCostCentreJournalOverridesResponseItem.php create mode 100644 src/Model/ContractCostCentreJournalOverridesUpdateRequest.php create mode 100644 src/Model/ContractCreateEmployeeRequest.php create mode 100644 src/Model/ContractDepartmentJournalOverridesRequest.php create mode 100644 src/Model/ContractDepartmentJournalOverridesResponse.php create mode 100644 src/Model/ContractDepartmentJournalOverridesResponseItem.php create mode 100644 src/Model/ContractDepartmentJournalOverridesUpdateRequest.php create mode 100644 src/Model/ContractDepartmentRequest.php create mode 100644 src/Model/ContractDepartmentResponse.php create mode 100644 src/Model/ContractDirectorshipDetails.php create mode 100644 src/Model/ContractEmployeeItem.php create mode 100644 src/Model/ContractEmployeeResponse.php create mode 100644 src/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.php create mode 100644 src/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.php create mode 100644 src/Model/ContractEmployeeRoleItem.php create mode 100644 src/Model/ContractEmployeeRoleResponse.php create mode 100644 src/Model/ContractEmployeeRoleWorkingPatternRequest.php create mode 100644 src/Model/ContractEmployeeRoleWorkingPatternResponse.php create mode 100644 src/Model/ContractEmployeeRoleWorkingPatternResponseItem.php create mode 100644 src/Model/ContractEmployerBase.php create mode 100644 src/Model/ContractEmploymentDetailsRequest.php create mode 100644 src/Model/ContractEmploymentDetailsResponse.php create mode 100644 src/Model/ContractFpsFields.php create mode 100644 src/Model/ContractGrossToNetReportRequest.php create mode 100644 src/Model/ContractHolidayEntitlementRequest.php create mode 100644 src/Model/ContractHolidayEntitlementResponse.php create mode 100644 src/Model/ContractHolidayEntitlementUpdateRequest.php create mode 100644 src/Model/ContractHolidaySchemeRequest.php create mode 100644 src/Model/ContractHolidaySchemeResponse.php create mode 100644 src/Model/ContractJobErrorResponse.php create mode 100644 src/Model/ContractJobResponse.php create mode 100644 src/Model/ContractJobResultFileResponse.php create mode 100644 src/Model/ContractJobResultResponse.php create mode 100644 src/Model/ContractJournalTemplateRequest.php create mode 100644 src/Model/ContractJournalTemplateResponse.php create mode 100644 src/Model/ContractJournalTokenRequest.php create mode 100644 src/Model/ContractJournalTokenResponse.php create mode 100644 src/Model/ContractJournalTokenResponseItem.php create mode 100644 src/Model/ContractLeaveImportRequest.php create mode 100644 src/Model/ContractLeaveSettingsRequest.php create mode 100644 src/Model/ContractLeaveSettingsResponse.php create mode 100644 src/Model/ContractLeaverDetails.php create mode 100644 src/Model/ContractLondonAllowanceRequest.php create mode 100644 src/Model/ContractLondonAllowanceResponse.php create mode 100644 src/Model/ContractNetOfOnCostsResponse.php create mode 100644 src/Model/ContractNetOfOnCostsSimulationResponse.php create mode 100644 src/Model/ContractOverseasEmployerDetails.php create mode 100644 src/Model/ContractP11HistoryRequest.php create mode 100644 src/Model/ContractP11HistoryResponse.php create mode 100644 src/Model/ContractPartnerDetails.php create mode 100644 src/Model/ContractPayHistoryRequest.php create mode 100644 src/Model/ContractPayHistoryResponse.php create mode 100644 src/Model/ContractPayHistoryUpdateRequest.php create mode 100644 src/Model/ContractPayLineRequest.php create mode 100644 src/Model/ContractPayLineResponse.php create mode 100644 src/Model/ContractPayOptionsBaseResponse.php create mode 100644 src/Model/ContractPayOptionsImportRequest.php create mode 100644 src/Model/ContractPayOptionsRequest.php create mode 100644 src/Model/ContractPayOptionsResponse.php create mode 100644 src/Model/ContractPayRunStateHistoryResponse.php create mode 100644 src/Model/ContractPaySpineGradeRequest.php create mode 100644 src/Model/ContractPaySpineGradeResponse.php create mode 100644 src/Model/ContractPaySpineRequest.php create mode 100644 src/Model/ContractPaySpineResponse.php create mode 100644 src/Model/ContractPaySpineUpdateRequest.php create mode 100644 src/Model/ContractPaylineAnalysisCategoriesCodes.php create mode 100644 src/Model/ContractPaylineRequest0.php create mode 100644 src/Model/ContractPayrollSquadEmployerRequest.php create mode 100644 src/Model/ContractPayrollSquadEmployerResponse.php create mode 100644 src/Model/ContractPayrollSquadMemberRequest.php create mode 100644 src/Model/ContractPayrollSquadMemberResponse.php create mode 100644 src/Model/ContractPayrollSquadRequest.php create mode 100644 src/Model/ContractPayrollSquadResponse.php create mode 100644 src/Model/ContractPendingLettersCountResponse.php create mode 100644 src/Model/ContractPensionerPayroll.php create mode 100644 src/Model/ContractPersonalDetailsRequest.php create mode 100644 src/Model/ContractPersonalDetailsResponse.php create mode 100644 src/Model/ContractReapplyDpsNoticeResponse.php create mode 100644 src/Model/ContractRightToWork.php create mode 100644 src/Model/ContractRtiEmployeeAddress.php create mode 100644 src/Model/ContractRtiEmployeeName.php create mode 100644 src/Model/ContractShiftWorkingPatternDayRequest.php create mode 100644 src/Model/ContractShiftWorkingPatternDayResponse.php create mode 100644 src/Model/ContractSpinalPointRequest.php create mode 100644 src/Model/ContractSpinalPointResponse.php create mode 100644 src/Model/ContractSpinalPointUpdateRequest.php create mode 100644 src/Model/ContractSpineAllowanceRequest.php create mode 100644 src/Model/ContractSpineAllowanceResponse.php create mode 100644 src/Model/ContractSpineAllowanceUpdateRequest.php create mode 100644 src/Model/ContractStarterDetails.php create mode 100644 src/Model/ContractTaxAndNi.php create mode 100644 src/Model/ContractTermCalendarRequest.php create mode 100644 src/Model/ContractTermCalendarResponse.php create mode 100644 src/Model/ContractTermCalendarYearRequest.php create mode 100644 src/Model/ContractTermCalendarYearResponse.php create mode 100644 src/Model/ContractUpdateEmployeeRequest.php create mode 100644 src/Model/ContractVeteranDetails.php create mode 100644 src/Model/ContractWorkingPatternRequest.php create mode 100644 src/Model/ContractWorkingPatternResponse.php create mode 100644 src/Model/ContractYearsServiceEntitlementRequest.php create mode 100644 src/Model/ContractYearsServiceEntitlementResponse.php create mode 100644 src/Model/ContractYearsServiceEntitlementUpdateRequest.php create mode 100644 src/Model/CostAnalysisReport.php create mode 100644 src/Model/CostAnalysisReportReportResponse.php create mode 100644 src/Model/CostCentre.php create mode 100644 src/Model/CostOfEmploymentReport.php create mode 100644 src/Model/CostOfEmploymentReportLine.php create mode 100644 src/Model/CostOfEmploymentReportReportResponse.php create mode 100644 src/Model/Country.php create mode 100644 src/Model/CsvFileFormat.php create mode 100644 src/Model/DayOfWeek.php create mode 100644 src/Model/DecimalTaxYearConfigPrimitiveValue.php create mode 100644 src/Model/DeferalPeriodType.php create mode 100644 src/Model/Department.php create mode 100644 src/Model/DepartmentMembership.php create mode 100644 src/Model/DirectDebitMandate.php create mode 100644 src/Model/DirectorshipDetails.php create mode 100644 src/Model/DpsDataType.php create mode 100644 src/Model/DpsNotice.php create mode 100644 src/Model/DpsSettings.php create mode 100644 src/Model/EmailAttachment.php create mode 100644 src/Model/EmpRefs.php create mode 100644 src/Model/Employee.php create mode 100644 src/Model/EmployeeBenefitsReport.php create mode 100644 src/Model/EmployeeBenefitsReportReportResponse.php create mode 100644 src/Model/EmployeeCostCentre.php create mode 100644 src/Model/EmployeeLeaveReport.php create mode 100644 src/Model/EmployeeLeaveReportLine.php create mode 100644 src/Model/EmployeeLeaveReportReportResponse.php create mode 100644 src/Model/EmployeeNiYtdValues.php create mode 100644 src/Model/EmployeePayRunTotal.php create mode 100644 src/Model/EmployeeRole.php create mode 100644 src/Model/EmployeeRoleAnalysisCategoryCode.php create mode 100644 src/Model/EmployeeRolePayItem.php create mode 100644 src/Model/EmployeeRolePayOptions.php create mode 100644 src/Model/EmployeeSortBy.php create mode 100644 src/Model/EmployeeStatus.php create mode 100644 src/Model/EmployeeYtdValues.php create mode 100644 src/Model/Employer.php create mode 100644 src/Model/EmployerDefaults.php create mode 100644 src/Model/EmployerEmail.php create mode 100644 src/Model/EmployerEvcOptInHistory.php create mode 100644 src/Model/EmployerGroup.php create mode 100644 src/Model/EmployerGroupMembership.php create mode 100644 src/Model/EmployerItem.php create mode 100644 src/Model/EmployerOpeningBalances.php create mode 100644 src/Model/EmployerPensionContribution.php create mode 100644 src/Model/EmployerSettings.php create mode 100644 src/Model/EmployerTemplate.php create mode 100644 src/Model/EmployerTemplateType.php create mode 100644 src/Model/EmploymentDetails.php create mode 100644 src/Model/EntitlementBand.php create mode 100644 src/Model/EntityType.php create mode 100644 src/Model/Eps.php create mode 100644 src/Model/EpsAccount.php create mode 100644 src/Model/EpsApprenticeshipLevy.php create mode 100644 src/Model/EpsDeMinimisStateAid.php create mode 100644 src/Model/EpsFinalSubmission.php create mode 100644 src/Model/Establishment.php create mode 100644 src/Model/EvcSettings.php create mode 100644 src/Model/Exb.php create mode 100644 src/Model/ExbDeclarations.php create mode 100644 src/Model/ExbEmployer.php create mode 100644 src/Model/ExbP11d.php create mode 100644 src/Model/ExbP11dEmployee.php create mode 100644 src/Model/ExbP11db.php create mode 100644 src/Model/ExbP11dbClass1A.php create mode 100644 src/Model/ExbP11dbClass1AAdjustment.php create mode 100644 src/Model/ExbP11dbClass1AAdjustments.php create mode 100644 src/Model/ExbP11dbClass1ATotalBenefit.php create mode 100644 src/Model/ExbReportResponse.php create mode 100644 src/Model/ExpensesAndBenefits.php create mode 100644 src/Model/ExternalDataCompany.php create mode 100644 src/Model/ExternalDataProvider.php create mode 100644 src/Model/ExternalDataProviderId.php create mode 100644 src/Model/ExternalDataProviderType.php create mode 100644 src/Model/ExternalEmployeeMapping.php create mode 100644 src/Model/ExternalEmployeeMappingStatus.php create mode 100644 src/Model/ExternalProviderConversation.php create mode 100644 src/Model/FieldModification.php create mode 100644 src/Model/FixedCode.php create mode 100644 src/Model/FlexibleDrawdown.php create mode 100644 src/Model/Fps.php create mode 100644 src/Model/FpsBenefit.php create mode 100644 src/Model/FpsCar.php create mode 100644 src/Model/FpsCarFuel.php create mode 100644 src/Model/FpsEmployee.php create mode 100644 src/Model/FpsEmployeeDetails.php create mode 100644 src/Model/FpsEmployeeDetailsPartnerDetails.php create mode 100644 src/Model/FpsEmployeeFigsToDate.php create mode 100644 src/Model/FpsEmployeeFlexibleDrawdown.php create mode 100644 src/Model/FpsEmployeeNIlettersAndValues.php create mode 100644 src/Model/FpsEmployeePayment.php create mode 100644 src/Model/FpsEmployeeSeconded.php create mode 100644 src/Model/FpsEmployeeStarter.php create mode 100644 src/Model/FpsEmployeeStarterOccPension.php create mode 100644 src/Model/FpsEmployeeTaxCode.php create mode 100644 src/Model/FpsEmployeeTrivialCommutationPayment.php create mode 100644 src/Model/FpsEmployerPayIdChanged.php create mode 100644 src/Model/FpsEmployment.php create mode 100644 src/Model/FpsFields.php create mode 100644 src/Model/FpsLateReason.php create mode 100644 src/Model/FpsPriorVersion.php create mode 100644 src/Model/FpsReportResponse.php create mode 100644 src/Model/FromToDates.php create mode 100644 src/Model/FullPaymentSubmission.php create mode 100644 src/Model/FullSummaryOfPayReport.php create mode 100644 src/Model/FullSummaryOfPayReportLine.php create mode 100644 src/Model/FullSummaryOfPayReportReportResponse.php create mode 100644 src/Model/FurloughCalculationBasis.php create mode 100644 src/Model/FurloughReport.php create mode 100644 src/Model/FurloughReportLine.php create mode 100644 src/Model/FurloughReportReportResponse.php create mode 100644 src/Model/Gender.php create mode 100644 src/Model/GenderPayGapLine.php create mode 100644 src/Model/GenderPayGapReport.php create mode 100644 src/Model/GenderPayGapReportReportResponse.php create mode 100644 src/Model/GenderPayGapSnapShotDate.php create mode 100644 src/Model/GovTalk.php create mode 100644 src/Model/GovTalkError.php create mode 100644 src/Model/GovTalkSubmission.php create mode 100644 src/Model/GrossToNetReport.php create mode 100644 src/Model/GrossToNetReportCisLine.php create mode 100644 src/Model/GrossToNetReportLine.php create mode 100644 src/Model/GrossToNetReportReportResponse.php create mode 100644 src/Model/HmrcDetails.php create mode 100644 src/Model/HmrcLiability.php create mode 100644 src/Model/HmrcPayment.php create mode 100644 src/Model/HolidayAccrual.php create mode 100644 src/Model/HolidayAccrualDefaultRateType.php create mode 100644 src/Model/HolidayReport.php create mode 100644 src/Model/HolidayReportLine.php create mode 100644 src/Model/HolidayReportReportResponse.php create mode 100644 src/Model/HolidaySchemeDurationType.php create mode 100644 src/Model/HolidayType.php create mode 100644 src/Model/HourlyPayReport.php create mode 100644 src/Model/HourlyPayReportLine.php create mode 100644 src/Model/HourlyPayReportReportResponse.php create mode 100644 src/Model/HoursNormallyWorked.php create mode 100644 src/Model/HtmlEmailSettings.php create mode 100644 src/Model/HtmlInsertionPoint.php create mode 100644 src/Model/IncrementRule.php create mode 100644 src/Model/Invitation.php create mode 100644 src/Model/Item.php create mode 100644 src/Model/ItemListReportResponse.php create mode 100644 src/Model/JobStatus.php create mode 100644 src/Model/JobType.php create mode 100644 src/Model/JournalCsvFormat.php create mode 100644 src/Model/JournalTemplate.php create mode 100644 src/Model/JournalTokenType.php create mode 100644 src/Model/Leave.php create mode 100644 src/Model/LeaveAssumedPensionablePay.php create mode 100644 src/Model/LeaveCalculationType.php create mode 100644 src/Model/LeaveCustomPayment.php create mode 100644 src/Model/LeaveCustomProRataRule.php create mode 100644 src/Model/LeavePayType.php create mode 100644 src/Model/LeaveProRataRule.php create mode 100644 src/Model/LeaveSettings.php create mode 100644 src/Model/LeaveType.php create mode 100644 src/Model/LeaverDetails.php create mode 100644 src/Model/LgpsCivicaCasualHours.php create mode 100644 src/Model/LgpsCivicaPayrollNumber.php create mode 100644 src/Model/LgpsFund.php create mode 100644 src/Model/LgpsIConnectFileType.php create mode 100644 src/Model/LgpsIConnectPayrollReference.php create mode 100644 src/Model/LgpsIConnectSalaryType.php create mode 100644 src/Model/LgpsPayCategory.php create mode 100644 src/Model/LinkedPiw.php create mode 100644 src/Model/LinkedPiwResult.php create mode 100644 src/Model/Loan.php create mode 100644 src/Model/LoanBalancesReport.php create mode 100644 src/Model/LoanBalancesReportLine.php create mode 100644 src/Model/LoanBalancesReportReportResponse.php create mode 100644 src/Model/LoanCharge.php create mode 100644 src/Model/LogEntry.php create mode 100644 src/Model/LondonAllowance.php create mode 100644 src/Model/LondonAllowanceType.php create mode 100644 src/Model/LondonAllowanceValueType.php create mode 100644 src/Model/MailSettings.php create mode 100644 src/Model/MaritalStatus.php create mode 100644 src/Model/McrPayCategory.php create mode 100644 src/Model/MileageAllowancePaymentsRate.php create mode 100644 src/Model/MileageVehicleType.php create mode 100644 src/Model/ModelInterface.php create mode 100644 src/Model/MonthlyMinimum.php create mode 100644 src/Model/NationalInsuranceCalculation.php create mode 100644 src/Model/NationalInsuranceCalculationBase.php create mode 100644 src/Model/NationalInsuranceCalculationPeriodValues.php create mode 100644 src/Model/NationalInsuranceCode.php create mode 100644 src/Model/NationalMinimumWage.php create mode 100644 src/Model/NiLetterError.php create mode 100644 src/Model/NiLetterValidationReport.php create mode 100644 src/Model/NiLetterValidationReportLine.php create mode 100644 src/Model/NiLetterValidationReportReportResponse.php create mode 100644 src/Model/NiYtdReport.php create mode 100644 src/Model/NiYtdReportReportResponse.php create mode 100644 src/Model/NiYtdValue.php create mode 100644 src/Model/NicSummary.php create mode 100644 src/Model/NominalCodeMapping.php create mode 100644 src/Model/Note.php create mode 100644 src/Model/NoteType.php create mode 100644 src/Model/Nvr.php create mode 100644 src/Model/NvrEmployee.php create mode 100644 src/Model/NvrEmployeeDetails.php create mode 100644 src/Model/NvrEmployment.php create mode 100644 src/Model/NvrRequest.php create mode 100644 src/Model/OccupationalPolicy.php create mode 100644 src/Model/OccupationalPolicyEntitlement.php create mode 100644 src/Model/OccupationalPolicyEntitlementRecalculationBasis.php create mode 100644 src/Model/OccupationalPolicyPayCalculatedOn.php create mode 100644 src/Model/OccupationalPolicySicknessYear.php create mode 100644 src/Model/OccupationalPolicyType.php create mode 100644 src/Model/OccupationalSickLeaveHistory.php create mode 100644 src/Model/OpeningBalances.php create mode 100644 src/Model/OpeningBalancesTotals.php create mode 100644 src/Model/OverseasEmployerDetails.php create mode 100644 src/Model/OverseasSecondmentStatus.php create mode 100644 src/Model/P11.php create mode 100644 src/Model/P11DAssetAvailable.php create mode 100644 src/Model/P11DAssetAvailableCollection.php create mode 100644 src/Model/P11DAssetTransferredCollection.php create mode 100644 src/Model/P11DCar.php create mode 100644 src/Model/P11DCarCollection.php create mode 100644 src/Model/P11DDescOther.php create mode 100644 src/Model/P11DLoan.php create mode 100644 src/Model/P11DLoanCollection.php create mode 100644 src/Model/P11DOther.php create mode 100644 src/Model/P11DPaymentCollection.php create mode 100644 src/Model/P11DSingleItem.php create mode 100644 src/Model/P11Detailed.php create mode 100644 src/Model/P11DetailedNiValues.php create mode 100644 src/Model/P11DetailedReportResponse.php create mode 100644 src/Model/P11Line.php create mode 100644 src/Model/P11NiAndStatPaymentsLine.php create mode 100644 src/Model/P11NiAndStatPaymentsTotalsLine.php create mode 100644 src/Model/P11NiValues.php create mode 100644 src/Model/P11PayeLine.php create mode 100644 src/Model/P11PayeSummary.php create mode 100644 src/Model/P11PayeTotalsLine.php create mode 100644 src/Model/P11ReportResponse.php create mode 100644 src/Model/P11dCarFreeFuelWithdrawn.php create mode 100644 src/Model/P11dExpenses.php create mode 100644 src/Model/P11dVans.php create mode 100644 src/Model/P32.php create mode 100644 src/Model/P32ReportResponse.php create mode 100644 src/Model/PapdisDocument.php create mode 100644 src/Model/PapdisDocumentReportResponse.php create mode 100644 src/Model/PapdisEmployee.php create mode 100644 src/Model/PapdisEmployeeAssessment.php create mode 100644 src/Model/PapdisEmployeeContact.php create mode 100644 src/Model/PapdisEmployeeContactPostalAddress.php create mode 100644 src/Model/PapdisEmployeeContribution.php create mode 100644 src/Model/PapdisEmployeeExit.php create mode 100644 src/Model/PapdisEmployeeIdentity.php create mode 100644 src/Model/PapdisEmployeeName.php create mode 100644 src/Model/PapdisEmployeePay.php create mode 100644 src/Model/PapdisEmployer.php create mode 100644 src/Model/PapdisEmployerContactPostalAddress.php create mode 100644 src/Model/PapdisMessageFunctionCode.php create mode 100644 src/Model/PapdisPayrollPeriod.php create mode 100644 src/Model/PapdisPensionProvider.php create mode 100644 src/Model/PapdisVersion.php create mode 100644 src/Model/PartnerDetails.php create mode 100644 src/Model/PayBasis.php create mode 100644 src/Model/PayCode.php create mode 100644 src/Model/PayCodeCalculationType.php create mode 100644 src/Model/PayCodeMultiplierType.php create mode 100644 src/Model/PayCodeSet.php create mode 100644 src/Model/PayCodeVarianceLine.php create mode 100644 src/Model/PayElementReport.php create mode 100644 src/Model/PayElementReportLine.php create mode 100644 src/Model/PayElementReportReportResponse.php create mode 100644 src/Model/PayGradesReport.php create mode 100644 src/Model/PayGradesReportReportResponse.php create mode 100644 src/Model/PayLine.php create mode 100644 src/Model/PayMethod.php create mode 100644 src/Model/PayOptions.php create mode 100644 src/Model/PayOptionsImport.php create mode 100644 src/Model/PayPeriodEventType.php create mode 100644 src/Model/PayPeriodTypes.php create mode 100644 src/Model/PayPeriods.php create mode 100644 src/Model/PayRun.php create mode 100644 src/Model/PayRunChanges.php create mode 100644 src/Model/PayRunCsvType.php create mode 100644 src/Model/PayRunEntry.php create mode 100644 src/Model/PayRunEntrySortBy.php create mode 100644 src/Model/PayRunEntryWarningType.php create mode 100644 src/Model/PayRunJournal.php create mode 100644 src/Model/PayRunPayment.php create mode 100644 src/Model/PayRunState.php create mode 100644 src/Model/PayRunStateChange.php create mode 100644 src/Model/PayRunStateChangeReason.php create mode 100644 src/Model/PayRunSummaryLine.php create mode 100644 src/Model/PayRunSummaryLineIEnumerableReportResponse.php create mode 100644 src/Model/PayRunTotals.php create mode 100644 src/Model/PaySchedule.php create mode 100644 src/Model/PaySchedulePeriod.php create mode 100644 src/Model/PaySchedulePeriodEvent.php create mode 100644 src/Model/PaySchedulePeriodEventsConfig.php create mode 100644 src/Model/PaySpineReport.php create mode 100644 src/Model/PaySpineReportLine.php create mode 100644 src/Model/PaySpineReportReportResponse.php create mode 100644 src/Model/PaySpineYearsServiceEntitlementBasis.php create mode 100644 src/Model/Payee.php create mode 100644 src/Model/PayeeType.php create mode 100644 src/Model/PaylineCalculationData.php create mode 100644 src/Model/PaymentDateRule.php create mode 100644 src/Model/PaymentDateType.php create mode 100644 src/Model/PaymentMethodAfterLeaving.php create mode 100644 src/Model/PaymentsCsvMapping.php create mode 100644 src/Model/PaymentsCsvMappingColumn.php create mode 100644 src/Model/PaymentsCsvMappingType.php create mode 100644 src/Model/PayrollAnalysisCostBreakdownReport.php create mode 100644 src/Model/PayrollAnalysisCostBreakdownReportLine.php create mode 100644 src/Model/PayrollAnalysisCostBreakdownReportReportResponse.php create mode 100644 src/Model/PayrollAnalysisCostBreakdownReportValue.php create mode 100644 src/Model/PayrollAnalysisEmployeeRoleBreakdownReport.php create mode 100644 src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.php create mode 100644 src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.php create mode 100644 src/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.php create mode 100644 src/Model/PayrollValueType.php create mode 100644 src/Model/PayrunEmail.php create mode 100644 src/Model/PayrunPaymentsReport.php create mode 100644 src/Model/PayrunPaymentsReportReportResponse.php create mode 100644 src/Model/Payslip.php create mode 100644 src/Model/PayslipCustomisation.php create mode 100644 src/Model/PayslipLine.php create mode 100644 src/Model/PayslipLineType.php create mode 100644 src/Model/PayslipReleaseType.php create mode 100644 src/Model/PayslipReportResponse.php create mode 100644 src/Model/PdfPaperMargins.php create mode 100644 src/Model/PdfPaperOrientation.php create mode 100644 src/Model/PdfPaperSize.php create mode 100644 src/Model/PdfPasswordType.php create mode 100644 src/Model/Pension.php create mode 100644 src/Model/PensionAdministrator.php create mode 100644 src/Model/PensionContributionLevelType.php create mode 100644 src/Model/PensionContributionsSubmission.php create mode 100644 src/Model/PensionCsvFormat.php create mode 100644 src/Model/PensionEndReason.php create mode 100644 src/Model/PensionJoinReason.php create mode 100644 src/Model/PensionMembershipReportLine.php create mode 100644 src/Model/PensionMembershipsReport.php create mode 100644 src/Model/PensionMembershipsReportReportResponse.php create mode 100644 src/Model/PensionOpeningBalances.php create mode 100644 src/Model/PensionPayCode.php create mode 100644 src/Model/PensionProvider.php create mode 100644 src/Model/PensionRefund.php create mode 100644 src/Model/PensionReportingType.php create mode 100644 src/Model/PensionRule.php create mode 100644 src/Model/PensionScheme.php create mode 100644 src/Model/PensionSchemeNominalCodeMapping.php create mode 100644 src/Model/PensionSchemeReportOptionsLgpsCivicaUpm.php create mode 100644 src/Model/PensionSchemeReportOptionsLgpsIConnect.php create mode 100644 src/Model/PensionSelection.php create mode 100644 src/Model/PensionSummary.php create mode 100644 src/Model/PensionSummaryCostBreakdown.php create mode 100644 src/Model/PensionablePayDefinition.php create mode 100644 src/Model/PensionerPayroll.php create mode 100644 src/Model/PeriodValue.php create mode 100644 src/Model/PeriodValuePeriodValues.php create mode 100644 src/Model/PersonalDetails.php create mode 100644 src/Model/PricingBand.php create mode 100644 src/Model/PricingTable.php create mode 100644 src/Model/ProRataRule.php create mode 100644 src/Model/ProcessingNote.php create mode 100644 src/Model/ProcessingNoteStatus.php create mode 100644 src/Model/RecoverableAmounts.php create mode 100644 src/Model/Report.php create mode 100644 src/Model/ReportCustomCssOption.php create mode 100644 src/Model/ReportFormat.php create mode 100644 src/Model/ReportPack.php create mode 100644 src/Model/ReportResponse.php create mode 100644 src/Model/ReportSortBy.php create mode 100644 src/Model/ReportTemplate.php create mode 100644 src/Model/RightToWork.php create mode 100644 src/Model/RightToWorkDocumentType.php create mode 100644 src/Model/RightToWorkReport.php create mode 100644 src/Model/RightToWorkReportLine.php create mode 100644 src/Model/RightToWorkReportReportResponse.php create mode 100644 src/Model/RoleBasis.php create mode 100644 src/Model/RoleType.php create mode 100644 src/Model/RtiAgent.php create mode 100644 src/Model/RtiContact.php create mode 100644 src/Model/RtiEmployeeAddress.php create mode 100644 src/Model/RtiEmployeeName.php create mode 100644 src/Model/RtiSenderType.php create mode 100644 src/Model/RtiSubmissionSettings.php create mode 100644 src/Model/RtiValidationWarning.php create mode 100644 src/Model/RtiValidationWarningType.php create mode 100644 src/Model/ServiceBand.php create mode 100644 src/Model/ShiftWorkingPatternDay.php create mode 100644 src/Model/SmtpEncryption.php create mode 100644 src/Model/SmtpSettings.php create mode 100644 src/Model/SpinePointReport.php create mode 100644 src/Model/SpinePointReportLine.php create mode 100644 src/Model/SpinePointReportReportResponse.php create mode 100644 src/Model/StarterDeclaration.php create mode 100644 src/Model/StarterDetails.php create mode 100644 src/Model/StartersLeaversFilter.php create mode 100644 src/Model/StatPayFrequency.php create mode 100644 src/Model/StatutoryPay.php create mode 100644 src/Model/StatutoryPayReport.php create mode 100644 src/Model/StatutoryPayReportLine.php create mode 100644 src/Model/StatutoryPayReportReportResponse.php create mode 100644 src/Model/StringDecimalKeyValuePair.php create mode 100644 src/Model/StringStringKeyValuePair.php create mode 100644 src/Model/StudentLoan.php create mode 100644 src/Model/StudentLoanRecovered.php create mode 100644 src/Model/SubmissionStatus.php create mode 100644 src/Model/Tag.php create mode 100644 src/Model/TaxAndNi.php create mode 100644 src/Model/TaxBracket.php create mode 100644 src/Model/TaxCodeChange.php create mode 100644 src/Model/TaxCodeChangeReport.php create mode 100644 src/Model/TaxCodeChangeReportReportResponse.php create mode 100644 src/Model/TaxCodeChangeValues.php create mode 100644 src/Model/TaxYear.php create mode 100644 src/Model/TaxYearConfig.php create mode 100644 src/Model/TaxYearTypes.php create mode 100644 src/Model/TeachersPensionAgeWarning.php create mode 100644 src/Model/TeachersPensionDetails.php create mode 100644 src/Model/TeachersPensionEmploymentType.php create mode 100644 src/Model/TeachersPensionEoyLineItem.php create mode 100644 src/Model/TeachersPensionEoyReport.php create mode 100644 src/Model/TeachersPensionEoyReportReportResponse.php create mode 100644 src/Model/Tenant.php create mode 100644 src/Model/TenantBillingSettings.php create mode 100644 src/Model/TenantEmail.php create mode 100644 src/Model/TenantHtmlInsertion.php create mode 100644 src/Model/TenantItem.php create mode 100644 src/Model/TieredPension.php create mode 100644 src/Model/TieredPensionRate.php create mode 100644 src/Model/UmbrellaPayment.php create mode 100644 src/Model/UmbrellaReconciliationReport.php create mode 100644 src/Model/UmbrellaReconciliationReportLine.php create mode 100644 src/Model/UmbrellaReconciliationReportReportResponse.php create mode 100644 src/Model/UmbrellaSettings.php create mode 100644 src/Model/UsageBill.php create mode 100644 src/Model/User.php create mode 100644 src/Model/UserAuthorization.php create mode 100644 src/Model/UserCategory.php create mode 100644 src/Model/UserDisplayPreferences.php create mode 100644 src/Model/UserIndustry.php create mode 100644 src/Model/UserJobType.php create mode 100644 src/Model/UserRole.php create mode 100644 src/Model/UserstartPage.php create mode 100644 src/Model/UtmInfo.php create mode 100644 src/Model/ValueOverride.php create mode 100644 src/Model/VarianceReport.php create mode 100644 src/Model/VarianceReportReportResponse.php create mode 100644 src/Model/VeteranDetails.php create mode 100644 src/Model/WarningsReport.php create mode 100644 src/Model/WarningsReportLine.php create mode 100644 src/Model/WarningsReportReportResponse.php create mode 100644 src/Model/Webhook.php create mode 100644 src/Model/WebhookEvent.php create mode 100644 src/Model/WebhookPayload.php create mode 100644 src/Model/WorkerGroup.php create mode 100644 src/Model/WorkingPattern.php create mode 100644 src/Model/WorkingPatternHoursType.php create mode 100644 src/Model/WorkingPatternType.php create mode 100644 src/Model/YearEnd.php create mode 100644 src/Model/YearEndTaxCodeChange.php create mode 100644 src/Model/YtdReport.php create mode 100644 src/Model/YtdReportReportResponse.php create mode 100644 src/Model/YtdValue.php create mode 100644 src/Model/ZeroPaidFilter.php create mode 100644 src/ObjectSerializer.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc2a4bd --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# makes sense since it's a library(client SDK) and not a project +composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache + +# PHPLint cache +build/phplint.cache diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5d570be --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..7d11e4f --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml new file mode 100644 index 0000000..4f8104c --- /dev/null +++ b/.idea/phpunit.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/staffology-php.iml b/.idea/staffology-php.iml new file mode 100644 index 0000000..0405872 --- /dev/null +++ b/.idea/staffology-php.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..da0a094 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,1490 @@ +.gitignore +.openapi-generator-ignore +.php-cs-fixer.dist.php +.phplint.yml +.travis.yml +README.md +composer.json +docs/Api/AccountApi.md +docs/Api/AnalysisCategoryApi.md +docs/Api/AttachmentOrderApi.md +docs/Api/AuditApi.md +docs/Api/AutoEnrolmentApi.md +docs/Api/AverageHolidayPayHistoryApi.md +docs/Api/BenefitsApi.md +docs/Api/BillingApi.md +docs/Api/BureauApi.md +docs/Api/Cis300Api.md +docs/Api/CisVerificationApi.md +docs/Api/CostCentreApi.md +docs/Api/DepartmentApi.md +docs/Api/DpsApi.md +docs/Api/EmailApi.md +docs/Api/EmployeeApi.md +docs/Api/EmployeeRoleApi.md +docs/Api/EmployerApi.md +docs/Api/EmployerGroupApi.md +docs/Api/EmployerTemplateApi.md +docs/Api/EngineApi.md +docs/Api/EpsApi.md +docs/Api/ExbApi.md +docs/Api/ExternalDataApi.md +docs/Api/FpsApi.md +docs/Api/HmrcPaymentApi.md +docs/Api/HolidaySchemeApi.md +docs/Api/ImportApi.md +docs/Api/InvitationApi.md +docs/Api/JobApi.md +docs/Api/JournalTemplateApi.md +docs/Api/JournalTokenApi.md +docs/Api/LeaveApi.md +docs/Api/LoanApi.md +docs/Api/NoteApi.md +docs/Api/NvrApi.md +docs/Api/OccupationalPolicyApi.md +docs/Api/OccupationalSickLeaveHistoryApi.md +docs/Api/OpeningBalancesApi.md +docs/Api/P11HistoryApi.md +docs/Api/PayCodeApi.md +docs/Api/PayCodeSetApi.md +docs/Api/PayRunApi.md +docs/Api/PayRunAsyncApi.md +docs/Api/PayScheduleApi.md +docs/Api/PaySpineApi.md +docs/Api/PayeeApi.md +docs/Api/PensionApi.md +docs/Api/PensionRefundApi.md +docs/Api/PensionSchemeApi.md +docs/Api/ProcessingNoteApi.md +docs/Api/ReportPackApi.md +docs/Api/ReportTemplateApi.md +docs/Api/ReportsApi.md +docs/Api/ReportsAsyncApi.md +docs/Api/TagApi.md +docs/Api/TenantApi.md +docs/Api/TenantEmailApi.md +docs/Api/TermCalendarApi.md +docs/Api/TermCalendarYearApi.md +docs/Api/TierablePayApi.md +docs/Api/ToolsApi.md +docs/Api/WebhookApi.md +docs/Api/WorkingPatternApi.md +docs/Model/Address.md +docs/Model/AdvancedVarianceReport.md +docs/Model/AdvancedVarianceReportLine.md +docs/Model/AdvancedVarianceReportReportResponse.md +docs/Model/AeAction.md +docs/Model/AeAssessment.md +docs/Model/AeAssessmentAction.md +docs/Model/AeEmployeeState.md +docs/Model/AeExclusionCode.md +docs/Model/AeStatus.md +docs/Model/AeStatutoryLetter.md +docs/Model/AeUKWorker.md +docs/Model/AllowanceType.md +docs/Model/AnalysisCategory.md +docs/Model/AnalysisCategoryCode.md +docs/Model/AnalysisCategoryCodes.md +docs/Model/AnalysisCategoryIndex.md +docs/Model/AnalysisReport.md +docs/Model/AnalysisReportLine.md +docs/Model/AnalysisReportLineValue.md +docs/Model/AnalysisReportReportResponse.md +docs/Model/AnnualRoundingRule.md +docs/Model/AssumedPensionablePay.md +docs/Model/AttachmentOrder.md +docs/Model/AttachmentOrderPayment.md +docs/Model/AttachmentOrderReportResponse.md +docs/Model/AttachmentOrderType.md +docs/Model/AttachmentOrdersReport.md +docs/Model/AttachmentOrdersReportReportResponse.md +docs/Model/AuditEventAction.md +docs/Model/AuthScheme.md +docs/Model/AutoEnrolment.md +docs/Model/AutoEnrolmentSettings.md +docs/Model/AutoPilotFinaliseTime.md +docs/Model/AutomationSettings.md +docs/Model/AverageHolidayPayRateReport.md +docs/Model/AverageHolidayPayRateReportLine.md +docs/Model/AverageHolidayPayRateReportReportResponse.md +docs/Model/AveragePayGradesReportLine.md +docs/Model/AverageWeeklyEarnings.md +docs/Model/AverageWeeklyEarningsResult.md +docs/Model/BackgroundTaskStatus.md +docs/Model/BankDetails.md +docs/Model/BankHolidayCollection.md +docs/Model/BankPaymentInstruction.md +docs/Model/BankPaymentInstructionReportResponse.md +docs/Model/BankPaymentInstructionsCsvFormat.md +docs/Model/Benefit.md +docs/Model/BenefitDeclarationType.md +docs/Model/BenefitDetailsAssetType.md +docs/Model/BenefitDetailsCar.md +docs/Model/BenefitDetailsCarPowerType.md +docs/Model/BenefitDetailsClass1AType.md +docs/Model/BenefitDetailsLoan.md +docs/Model/BenefitDetailsNonClass1AType.md +docs/Model/BenefitDetailsPaymentType.md +docs/Model/BenefitDetailsUseOfAssetType.md +docs/Model/BenefitPayrolled.md +docs/Model/BenefitType.md +docs/Model/BureauSettings.md +docs/Model/CISSubContractorType.md +docs/Model/CISTaxStatus.md +docs/Model/CalendarEntry.md +docs/Model/CalendarEntryType.md +docs/Model/CalendarMonth.md +docs/Model/CarCharge.md +docs/Model/CarChargeRate.md +docs/Model/ChangeSummary.md +docs/Model/ChangeSummaryListReportResponse.md +docs/Model/Cis300.md +docs/Model/Cis300Declarations.md +docs/Model/Cis300ReportResponse.md +docs/Model/CisContractor.md +docs/Model/CisDetails.md +docs/Model/CisPartnership.md +docs/Model/CisRequest.md +docs/Model/CisReturn.md +docs/Model/CisStatement.md +docs/Model/CisStatementListReportResponse.md +docs/Model/CisSubContractor.md +docs/Model/CisSubContractorSummary.md +docs/Model/CisSubContractorSummaryListReportResponse.md +docs/Model/CisVerification.md +docs/Model/CisVerificationDetails.md +docs/Model/ContractAddress.md +docs/Model/ContractAeAssessmentAction.md +docs/Model/ContractAeAssessmentRequest.md +docs/Model/ContractAeAssessmentResponse.md +docs/Model/ContractAllowanceGradesRequest.md +docs/Model/ContractAllowanceGradesResponse.md +docs/Model/ContractAllowanceGradesUpdateRequest.md +docs/Model/ContractAnalysisCategoryCodeRequest.md +docs/Model/ContractAnalysisCategoryCodeResponse.md +docs/Model/ContractAnalysisCategoryRequest.md +docs/Model/ContractAnalysisCategoryResponse.md +docs/Model/ContractAutoEnrolmentRequest.md +docs/Model/ContractAutoEnrolmentResponse.md +docs/Model/ContractBankDetails.md +docs/Model/ContractCisDetailsRequest.md +docs/Model/ContractCisDetailsResponse.md +docs/Model/ContractCisPartnership.md +docs/Model/ContractCisSubContractor.md +docs/Model/ContractCisSubContractorItem.md +docs/Model/ContractCisVerificationDetailsRequest.md +docs/Model/ContractCisVerificationDetailsResponse.md +docs/Model/ContractCostCentreJournalOverridesRequest.md +docs/Model/ContractCostCentreJournalOverridesResponse.md +docs/Model/ContractCostCentreJournalOverridesResponseItem.md +docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md +docs/Model/ContractCreateEmployeeRequest.md +docs/Model/ContractDepartmentJournalOverridesRequest.md +docs/Model/ContractDepartmentJournalOverridesResponse.md +docs/Model/ContractDepartmentJournalOverridesResponseItem.md +docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md +docs/Model/ContractDepartmentRequest.md +docs/Model/ContractDepartmentResponse.md +docs/Model/ContractDirectorshipDetails.md +docs/Model/ContractEmployeeItem.md +docs/Model/ContractEmployeeResponse.md +docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md +docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md +docs/Model/ContractEmployeeRoleItem.md +docs/Model/ContractEmployeeRoleResponse.md +docs/Model/ContractEmployeeRoleWorkingPatternRequest.md +docs/Model/ContractEmployeeRoleWorkingPatternResponse.md +docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md +docs/Model/ContractEmployerBase.md +docs/Model/ContractEmploymentDetailsRequest.md +docs/Model/ContractEmploymentDetailsResponse.md +docs/Model/ContractFpsFields.md +docs/Model/ContractGrossToNetReportRequest.md +docs/Model/ContractHolidayEntitlementRequest.md +docs/Model/ContractHolidayEntitlementResponse.md +docs/Model/ContractHolidayEntitlementUpdateRequest.md +docs/Model/ContractHolidaySchemeRequest.md +docs/Model/ContractHolidaySchemeResponse.md +docs/Model/ContractJobErrorResponse.md +docs/Model/ContractJobResponse.md +docs/Model/ContractJobResultFileResponse.md +docs/Model/ContractJobResultResponse.md +docs/Model/ContractJournalTemplateRequest.md +docs/Model/ContractJournalTemplateResponse.md +docs/Model/ContractJournalTokenRequest.md +docs/Model/ContractJournalTokenResponse.md +docs/Model/ContractJournalTokenResponseItem.md +docs/Model/ContractLeaveImportRequest.md +docs/Model/ContractLeaveSettingsRequest.md +docs/Model/ContractLeaveSettingsResponse.md +docs/Model/ContractLeaverDetails.md +docs/Model/ContractLondonAllowanceRequest.md +docs/Model/ContractLondonAllowanceResponse.md +docs/Model/ContractNetOfOnCostsResponse.md +docs/Model/ContractNetOfOnCostsSimulationResponse.md +docs/Model/ContractOverseasEmployerDetails.md +docs/Model/ContractP11HistoryRequest.md +docs/Model/ContractP11HistoryResponse.md +docs/Model/ContractPartnerDetails.md +docs/Model/ContractPayHistoryRequest.md +docs/Model/ContractPayHistoryResponse.md +docs/Model/ContractPayHistoryUpdateRequest.md +docs/Model/ContractPayLineRequest.md +docs/Model/ContractPayLineResponse.md +docs/Model/ContractPayOptionsBaseResponse.md +docs/Model/ContractPayOptionsImportRequest.md +docs/Model/ContractPayOptionsRequest.md +docs/Model/ContractPayOptionsResponse.md +docs/Model/ContractPayRunStateHistoryResponse.md +docs/Model/ContractPaySpineGradeRequest.md +docs/Model/ContractPaySpineGradeResponse.md +docs/Model/ContractPaySpineRequest.md +docs/Model/ContractPaySpineResponse.md +docs/Model/ContractPaySpineUpdateRequest.md +docs/Model/ContractPaylineAnalysisCategoriesCodes.md +docs/Model/ContractPaylineRequest.md +docs/Model/ContractPayrollSquadEmployerRequest.md +docs/Model/ContractPayrollSquadEmployerResponse.md +docs/Model/ContractPayrollSquadMemberRequest.md +docs/Model/ContractPayrollSquadMemberResponse.md +docs/Model/ContractPayrollSquadRequest.md +docs/Model/ContractPayrollSquadResponse.md +docs/Model/ContractPendingLettersCountResponse.md +docs/Model/ContractPensionerPayroll.md +docs/Model/ContractPersonalDetailsRequest.md +docs/Model/ContractPersonalDetailsResponse.md +docs/Model/ContractReapplyDpsNoticeResponse.md +docs/Model/ContractRightToWork.md +docs/Model/ContractRtiEmployeeAddress.md +docs/Model/ContractRtiEmployeeName.md +docs/Model/ContractShiftWorkingPatternDayRequest.md +docs/Model/ContractShiftWorkingPatternDayResponse.md +docs/Model/ContractSpinalPointRequest.md +docs/Model/ContractSpinalPointResponse.md +docs/Model/ContractSpinalPointUpdateRequest.md +docs/Model/ContractSpineAllowanceRequest.md +docs/Model/ContractSpineAllowanceResponse.md +docs/Model/ContractSpineAllowanceUpdateRequest.md +docs/Model/ContractStarterDetails.md +docs/Model/ContractTaxAndNi.md +docs/Model/ContractTermCalendarRequest.md +docs/Model/ContractTermCalendarResponse.md +docs/Model/ContractTermCalendarYearRequest.md +docs/Model/ContractTermCalendarYearResponse.md +docs/Model/ContractUpdateEmployeeRequest.md +docs/Model/ContractVeteranDetails.md +docs/Model/ContractWorkingPatternRequest.md +docs/Model/ContractWorkingPatternResponse.md +docs/Model/ContractYearsServiceEntitlementRequest.md +docs/Model/ContractYearsServiceEntitlementResponse.md +docs/Model/ContractYearsServiceEntitlementUpdateRequest.md +docs/Model/CostAnalysisReport.md +docs/Model/CostAnalysisReportReportResponse.md +docs/Model/CostCentre.md +docs/Model/CostOfEmploymentReport.md +docs/Model/CostOfEmploymentReportLine.md +docs/Model/CostOfEmploymentReportReportResponse.md +docs/Model/Country.md +docs/Model/CsvFileFormat.md +docs/Model/DayOfWeek.md +docs/Model/DecimalTaxYearConfigPrimitiveValue.md +docs/Model/DeferalPeriodType.md +docs/Model/Department.md +docs/Model/DepartmentMembership.md +docs/Model/DirectDebitMandate.md +docs/Model/DirectorshipDetails.md +docs/Model/DpsDataType.md +docs/Model/DpsNotice.md +docs/Model/DpsSettings.md +docs/Model/EmailAttachment.md +docs/Model/EmpRefs.md +docs/Model/Employee.md +docs/Model/EmployeeBenefitsReport.md +docs/Model/EmployeeBenefitsReportReportResponse.md +docs/Model/EmployeeCostCentre.md +docs/Model/EmployeeLeaveReport.md +docs/Model/EmployeeLeaveReportLine.md +docs/Model/EmployeeLeaveReportReportResponse.md +docs/Model/EmployeeNiYtdValues.md +docs/Model/EmployeePayRunTotal.md +docs/Model/EmployeeRole.md +docs/Model/EmployeeRoleAnalysisCategoryCode.md +docs/Model/EmployeeRolePayItem.md +docs/Model/EmployeeRolePayOptions.md +docs/Model/EmployeeSortBy.md +docs/Model/EmployeeStatus.md +docs/Model/EmployeeYtdValues.md +docs/Model/Employer.md +docs/Model/EmployerDefaults.md +docs/Model/EmployerEmail.md +docs/Model/EmployerEvcOptInHistory.md +docs/Model/EmployerGroup.md +docs/Model/EmployerGroupMembership.md +docs/Model/EmployerItem.md +docs/Model/EmployerOpeningBalances.md +docs/Model/EmployerPensionContribution.md +docs/Model/EmployerSettings.md +docs/Model/EmployerTemplate.md +docs/Model/EmployerTemplateType.md +docs/Model/EmploymentDetails.md +docs/Model/EntitlementBand.md +docs/Model/EntityType.md +docs/Model/Eps.md +docs/Model/EpsAccount.md +docs/Model/EpsApprenticeshipLevy.md +docs/Model/EpsDeMinimisStateAid.md +docs/Model/EpsFinalSubmission.md +docs/Model/Establishment.md +docs/Model/EvcSettings.md +docs/Model/Exb.md +docs/Model/ExbDeclarations.md +docs/Model/ExbEmployer.md +docs/Model/ExbP11d.md +docs/Model/ExbP11dEmployee.md +docs/Model/ExbP11db.md +docs/Model/ExbP11dbClass1A.md +docs/Model/ExbP11dbClass1AAdjustment.md +docs/Model/ExbP11dbClass1AAdjustments.md +docs/Model/ExbP11dbClass1ATotalBenefit.md +docs/Model/ExbReportResponse.md +docs/Model/ExpensesAndBenefits.md +docs/Model/ExternalDataCompany.md +docs/Model/ExternalDataProvider.md +docs/Model/ExternalDataProviderId.md +docs/Model/ExternalDataProviderType.md +docs/Model/ExternalEmployeeMapping.md +docs/Model/ExternalEmployeeMappingStatus.md +docs/Model/ExternalProviderConversation.md +docs/Model/FieldModification.md +docs/Model/FixedCode.md +docs/Model/FlexibleDrawdown.md +docs/Model/Fps.md +docs/Model/FpsBenefit.md +docs/Model/FpsCar.md +docs/Model/FpsCarFuel.md +docs/Model/FpsEmployee.md +docs/Model/FpsEmployeeDetails.md +docs/Model/FpsEmployeeDetailsPartnerDetails.md +docs/Model/FpsEmployeeFigsToDate.md +docs/Model/FpsEmployeeFlexibleDrawdown.md +docs/Model/FpsEmployeeNIlettersAndValues.md +docs/Model/FpsEmployeePayment.md +docs/Model/FpsEmployeeSeconded.md +docs/Model/FpsEmployeeStarter.md +docs/Model/FpsEmployeeStarterOccPension.md +docs/Model/FpsEmployeeTaxCode.md +docs/Model/FpsEmployeeTrivialCommutationPayment.md +docs/Model/FpsEmployerPayIdChanged.md +docs/Model/FpsEmployment.md +docs/Model/FpsFields.md +docs/Model/FpsLateReason.md +docs/Model/FpsPriorVersion.md +docs/Model/FpsReportResponse.md +docs/Model/FromToDates.md +docs/Model/FullPaymentSubmission.md +docs/Model/FullSummaryOfPayReport.md +docs/Model/FullSummaryOfPayReportLine.md +docs/Model/FullSummaryOfPayReportReportResponse.md +docs/Model/FurloughCalculationBasis.md +docs/Model/FurloughReport.md +docs/Model/FurloughReportLine.md +docs/Model/FurloughReportReportResponse.md +docs/Model/Gender.md +docs/Model/GenderPayGapLine.md +docs/Model/GenderPayGapReport.md +docs/Model/GenderPayGapReportReportResponse.md +docs/Model/GenderPayGapSnapShotDate.md +docs/Model/GovTalk.md +docs/Model/GovTalkError.md +docs/Model/GovTalkSubmission.md +docs/Model/GrossToNetReport.md +docs/Model/GrossToNetReportCisLine.md +docs/Model/GrossToNetReportLine.md +docs/Model/GrossToNetReportReportResponse.md +docs/Model/HmrcDetails.md +docs/Model/HmrcLiability.md +docs/Model/HmrcPayment.md +docs/Model/HolidayAccrual.md +docs/Model/HolidayAccrualDefaultRateType.md +docs/Model/HolidayReport.md +docs/Model/HolidayReportLine.md +docs/Model/HolidayReportReportResponse.md +docs/Model/HolidaySchemeDurationType.md +docs/Model/HolidayType.md +docs/Model/HourlyPayReport.md +docs/Model/HourlyPayReportLine.md +docs/Model/HourlyPayReportReportResponse.md +docs/Model/HoursNormallyWorked.md +docs/Model/HtmlEmailSettings.md +docs/Model/HtmlInsertionPoint.md +docs/Model/IncrementRule.md +docs/Model/Invitation.md +docs/Model/Item.md +docs/Model/ItemListReportResponse.md +docs/Model/JobStatus.md +docs/Model/JobType.md +docs/Model/JournalCsvFormat.md +docs/Model/JournalTemplate.md +docs/Model/JournalTokenType.md +docs/Model/Leave.md +docs/Model/LeaveAssumedPensionablePay.md +docs/Model/LeaveCalculationType.md +docs/Model/LeaveCustomPayment.md +docs/Model/LeaveCustomProRataRule.md +docs/Model/LeavePayType.md +docs/Model/LeaveProRataRule.md +docs/Model/LeaveSettings.md +docs/Model/LeaveType.md +docs/Model/LeaverDetails.md +docs/Model/LgpsCivicaCasualHours.md +docs/Model/LgpsCivicaPayrollNumber.md +docs/Model/LgpsFund.md +docs/Model/LgpsIConnectFileType.md +docs/Model/LgpsIConnectPayrollReference.md +docs/Model/LgpsIConnectSalaryType.md +docs/Model/LgpsPayCategory.md +docs/Model/LinkedPiw.md +docs/Model/LinkedPiwResult.md +docs/Model/Loan.md +docs/Model/LoanBalancesReport.md +docs/Model/LoanBalancesReportLine.md +docs/Model/LoanBalancesReportReportResponse.md +docs/Model/LoanCharge.md +docs/Model/LogEntry.md +docs/Model/LondonAllowance.md +docs/Model/LondonAllowanceType.md +docs/Model/LondonAllowanceValueType.md +docs/Model/MailSettings.md +docs/Model/MaritalStatus.md +docs/Model/McrPayCategory.md +docs/Model/MileageAllowancePaymentsRate.md +docs/Model/MileageVehicleType.md +docs/Model/MonthlyMinimum.md +docs/Model/NationalInsuranceCalculation.md +docs/Model/NationalInsuranceCalculationBase.md +docs/Model/NationalInsuranceCalculationPeriodValues.md +docs/Model/NationalInsuranceCode.md +docs/Model/NationalMinimumWage.md +docs/Model/NiLetterError.md +docs/Model/NiLetterValidationReport.md +docs/Model/NiLetterValidationReportLine.md +docs/Model/NiLetterValidationReportReportResponse.md +docs/Model/NiYtdReport.md +docs/Model/NiYtdReportReportResponse.md +docs/Model/NiYtdValue.md +docs/Model/NicSummary.md +docs/Model/NominalCodeMapping.md +docs/Model/Note.md +docs/Model/NoteType.md +docs/Model/Nvr.md +docs/Model/NvrEmployee.md +docs/Model/NvrEmployeeDetails.md +docs/Model/NvrEmployment.md +docs/Model/NvrRequest.md +docs/Model/OccupationalPolicy.md +docs/Model/OccupationalPolicyEntitlement.md +docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md +docs/Model/OccupationalPolicyPayCalculatedOn.md +docs/Model/OccupationalPolicySicknessYear.md +docs/Model/OccupationalPolicyType.md +docs/Model/OccupationalSickLeaveHistory.md +docs/Model/OpeningBalances.md +docs/Model/OpeningBalancesTotals.md +docs/Model/OverseasEmployerDetails.md +docs/Model/OverseasSecondmentStatus.md +docs/Model/P11.md +docs/Model/P11DAssetAvailable.md +docs/Model/P11DAssetAvailableCollection.md +docs/Model/P11DAssetTransferredCollection.md +docs/Model/P11DCar.md +docs/Model/P11DCarCollection.md +docs/Model/P11DDescOther.md +docs/Model/P11DLoan.md +docs/Model/P11DLoanCollection.md +docs/Model/P11DOther.md +docs/Model/P11DPaymentCollection.md +docs/Model/P11DSingleItem.md +docs/Model/P11Detailed.md +docs/Model/P11DetailedNiValues.md +docs/Model/P11DetailedReportResponse.md +docs/Model/P11Line.md +docs/Model/P11NiAndStatPaymentsLine.md +docs/Model/P11NiAndStatPaymentsTotalsLine.md +docs/Model/P11NiValues.md +docs/Model/P11PayeLine.md +docs/Model/P11PayeSummary.md +docs/Model/P11PayeTotalsLine.md +docs/Model/P11ReportResponse.md +docs/Model/P11dCarFreeFuelWithdrawn.md +docs/Model/P11dExpenses.md +docs/Model/P11dVans.md +docs/Model/P32.md +docs/Model/P32ReportResponse.md +docs/Model/PapdisDocument.md +docs/Model/PapdisDocumentReportResponse.md +docs/Model/PapdisEmployee.md +docs/Model/PapdisEmployeeAssessment.md +docs/Model/PapdisEmployeeContact.md +docs/Model/PapdisEmployeeContactPostalAddress.md +docs/Model/PapdisEmployeeContribution.md +docs/Model/PapdisEmployeeExit.md +docs/Model/PapdisEmployeeIdentity.md +docs/Model/PapdisEmployeeName.md +docs/Model/PapdisEmployeePay.md +docs/Model/PapdisEmployer.md +docs/Model/PapdisEmployerContactPostalAddress.md +docs/Model/PapdisMessageFunctionCode.md +docs/Model/PapdisPayrollPeriod.md +docs/Model/PapdisPensionProvider.md +docs/Model/PapdisVersion.md +docs/Model/PartnerDetails.md +docs/Model/PayBasis.md +docs/Model/PayCode.md +docs/Model/PayCodeCalculationType.md +docs/Model/PayCodeMultiplierType.md +docs/Model/PayCodeSet.md +docs/Model/PayCodeVarianceLine.md +docs/Model/PayElementReport.md +docs/Model/PayElementReportLine.md +docs/Model/PayElementReportReportResponse.md +docs/Model/PayGradesReport.md +docs/Model/PayGradesReportReportResponse.md +docs/Model/PayLine.md +docs/Model/PayMethod.md +docs/Model/PayOptions.md +docs/Model/PayOptionsImport.md +docs/Model/PayPeriodEventType.md +docs/Model/PayPeriodTypes.md +docs/Model/PayPeriods.md +docs/Model/PayRun.md +docs/Model/PayRunChanges.md +docs/Model/PayRunCsvType.md +docs/Model/PayRunEntry.md +docs/Model/PayRunEntrySortBy.md +docs/Model/PayRunEntryWarningType.md +docs/Model/PayRunJournal.md +docs/Model/PayRunPayment.md +docs/Model/PayRunState.md +docs/Model/PayRunStateChange.md +docs/Model/PayRunStateChangeReason.md +docs/Model/PayRunSummaryLine.md +docs/Model/PayRunSummaryLineIEnumerableReportResponse.md +docs/Model/PayRunTotals.md +docs/Model/PaySchedule.md +docs/Model/PaySchedulePeriod.md +docs/Model/PaySchedulePeriodEvent.md +docs/Model/PaySchedulePeriodEventsConfig.md +docs/Model/PaySpineReport.md +docs/Model/PaySpineReportLine.md +docs/Model/PaySpineReportReportResponse.md +docs/Model/PaySpineYearsServiceEntitlementBasis.md +docs/Model/Payee.md +docs/Model/PayeeType.md +docs/Model/PaylineCalculationData.md +docs/Model/PaymentDateRule.md +docs/Model/PaymentDateType.md +docs/Model/PaymentMethodAfterLeaving.md +docs/Model/PaymentsCsvMapping.md +docs/Model/PaymentsCsvMappingColumn.md +docs/Model/PaymentsCsvMappingType.md +docs/Model/PayrollAnalysisCostBreakdownReport.md +docs/Model/PayrollAnalysisCostBreakdownReportLine.md +docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md +docs/Model/PayrollAnalysisCostBreakdownReportValue.md +docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md +docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md +docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md +docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md +docs/Model/PayrollValueType.md +docs/Model/PayrunEmail.md +docs/Model/PayrunPaymentsReport.md +docs/Model/PayrunPaymentsReportReportResponse.md +docs/Model/Payslip.md +docs/Model/PayslipCustomisation.md +docs/Model/PayslipLine.md +docs/Model/PayslipLineType.md +docs/Model/PayslipReleaseType.md +docs/Model/PayslipReportResponse.md +docs/Model/PdfPaperMargins.md +docs/Model/PdfPaperOrientation.md +docs/Model/PdfPaperSize.md +docs/Model/PdfPasswordType.md +docs/Model/Pension.md +docs/Model/PensionAdministrator.md +docs/Model/PensionContributionLevelType.md +docs/Model/PensionContributionsSubmission.md +docs/Model/PensionCsvFormat.md +docs/Model/PensionEndReason.md +docs/Model/PensionJoinReason.md +docs/Model/PensionMembershipReportLine.md +docs/Model/PensionMembershipsReport.md +docs/Model/PensionMembershipsReportReportResponse.md +docs/Model/PensionOpeningBalances.md +docs/Model/PensionPayCode.md +docs/Model/PensionProvider.md +docs/Model/PensionRefund.md +docs/Model/PensionReportingType.md +docs/Model/PensionRule.md +docs/Model/PensionScheme.md +docs/Model/PensionSchemeNominalCodeMapping.md +docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md +docs/Model/PensionSchemeReportOptionsLgpsIConnect.md +docs/Model/PensionSelection.md +docs/Model/PensionSummary.md +docs/Model/PensionSummaryCostBreakdown.md +docs/Model/PensionablePayDefinition.md +docs/Model/PensionerPayroll.md +docs/Model/PeriodValue.md +docs/Model/PeriodValuePeriodValues.md +docs/Model/PersonalDetails.md +docs/Model/PricingBand.md +docs/Model/PricingTable.md +docs/Model/ProRataRule.md +docs/Model/ProcessingNote.md +docs/Model/ProcessingNoteStatus.md +docs/Model/RecoverableAmounts.md +docs/Model/Report.md +docs/Model/ReportCustomCssOption.md +docs/Model/ReportFormat.md +docs/Model/ReportPack.md +docs/Model/ReportResponse.md +docs/Model/ReportSortBy.md +docs/Model/ReportTemplate.md +docs/Model/RightToWork.md +docs/Model/RightToWorkDocumentType.md +docs/Model/RightToWorkReport.md +docs/Model/RightToWorkReportLine.md +docs/Model/RightToWorkReportReportResponse.md +docs/Model/RoleBasis.md +docs/Model/RoleType.md +docs/Model/RtiAgent.md +docs/Model/RtiContact.md +docs/Model/RtiEmployeeAddress.md +docs/Model/RtiEmployeeName.md +docs/Model/RtiSenderType.md +docs/Model/RtiSubmissionSettings.md +docs/Model/RtiValidationWarning.md +docs/Model/RtiValidationWarningType.md +docs/Model/ServiceBand.md +docs/Model/ShiftWorkingPatternDay.md +docs/Model/SmtpEncryption.md +docs/Model/SmtpSettings.md +docs/Model/SpinePointReport.md +docs/Model/SpinePointReportLine.md +docs/Model/SpinePointReportReportResponse.md +docs/Model/StarterDeclaration.md +docs/Model/StarterDetails.md +docs/Model/StartersLeaversFilter.md +docs/Model/StatPayFrequency.md +docs/Model/StatutoryPay.md +docs/Model/StatutoryPayReport.md +docs/Model/StatutoryPayReportLine.md +docs/Model/StatutoryPayReportReportResponse.md +docs/Model/StringDecimalKeyValuePair.md +docs/Model/StringStringKeyValuePair.md +docs/Model/StudentLoan.md +docs/Model/StudentLoanRecovered.md +docs/Model/SubmissionStatus.md +docs/Model/Tag.md +docs/Model/TaxAndNi.md +docs/Model/TaxBracket.md +docs/Model/TaxCodeChange.md +docs/Model/TaxCodeChangeReport.md +docs/Model/TaxCodeChangeReportReportResponse.md +docs/Model/TaxCodeChangeValues.md +docs/Model/TaxYear.md +docs/Model/TaxYearConfig.md +docs/Model/TaxYearTypes.md +docs/Model/TeachersPensionAgeWarning.md +docs/Model/TeachersPensionDetails.md +docs/Model/TeachersPensionEmploymentType.md +docs/Model/TeachersPensionEoyLineItem.md +docs/Model/TeachersPensionEoyReport.md +docs/Model/TeachersPensionEoyReportReportResponse.md +docs/Model/Tenant.md +docs/Model/TenantBillingSettings.md +docs/Model/TenantEmail.md +docs/Model/TenantHtmlInsertion.md +docs/Model/TenantItem.md +docs/Model/TieredPension.md +docs/Model/TieredPensionRate.md +docs/Model/UmbrellaPayment.md +docs/Model/UmbrellaReconciliationReport.md +docs/Model/UmbrellaReconciliationReportLine.md +docs/Model/UmbrellaReconciliationReportReportResponse.md +docs/Model/UmbrellaSettings.md +docs/Model/UsageBill.md +docs/Model/User.md +docs/Model/UserAuthorization.md +docs/Model/UserCategory.md +docs/Model/UserDisplayPreferences.md +docs/Model/UserIndustry.md +docs/Model/UserJobType.md +docs/Model/UserRole.md +docs/Model/UserstartPage.md +docs/Model/UtmInfo.md +docs/Model/ValueOverride.md +docs/Model/VarianceReport.md +docs/Model/VarianceReportReportResponse.md +docs/Model/VeteranDetails.md +docs/Model/WarningsReport.md +docs/Model/WarningsReportLine.md +docs/Model/WarningsReportReportResponse.md +docs/Model/Webhook.md +docs/Model/WebhookEvent.md +docs/Model/WebhookPayload.md +docs/Model/WorkerGroup.md +docs/Model/WorkingPattern.md +docs/Model/WorkingPatternHoursType.md +docs/Model/WorkingPatternType.md +docs/Model/YearEnd.md +docs/Model/YearEndTaxCodeChange.md +docs/Model/YtdReport.md +docs/Model/YtdReportReportResponse.md +docs/Model/YtdValue.md +docs/Model/ZeroPaidFilter.md +git_push.sh +phpunit.xml.dist +src/Api/AccountApi.php +src/Api/AnalysisCategoryApi.php +src/Api/AttachmentOrderApi.php +src/Api/AuditApi.php +src/Api/AutoEnrolmentApi.php +src/Api/AverageHolidayPayHistoryApi.php +src/Api/BenefitsApi.php +src/Api/BillingApi.php +src/Api/BureauApi.php +src/Api/Cis300Api.php +src/Api/CisVerificationApi.php +src/Api/CostCentreApi.php +src/Api/DepartmentApi.php +src/Api/DpsApi.php +src/Api/EmailApi.php +src/Api/EmployeeApi.php +src/Api/EmployeeRoleApi.php +src/Api/EmployerApi.php +src/Api/EmployerGroupApi.php +src/Api/EmployerTemplateApi.php +src/Api/EngineApi.php +src/Api/EpsApi.php +src/Api/ExbApi.php +src/Api/ExternalDataApi.php +src/Api/FpsApi.php +src/Api/HmrcPaymentApi.php +src/Api/HolidaySchemeApi.php +src/Api/ImportApi.php +src/Api/InvitationApi.php +src/Api/JobApi.php +src/Api/JournalTemplateApi.php +src/Api/JournalTokenApi.php +src/Api/LeaveApi.php +src/Api/LoanApi.php +src/Api/NoteApi.php +src/Api/NvrApi.php +src/Api/OccupationalPolicyApi.php +src/Api/OccupationalSickLeaveHistoryApi.php +src/Api/OpeningBalancesApi.php +src/Api/P11HistoryApi.php +src/Api/PayCodeApi.php +src/Api/PayCodeSetApi.php +src/Api/PayRunApi.php +src/Api/PayRunAsyncApi.php +src/Api/PayScheduleApi.php +src/Api/PaySpineApi.php +src/Api/PayeeApi.php +src/Api/PensionApi.php +src/Api/PensionRefundApi.php +src/Api/PensionSchemeApi.php +src/Api/ProcessingNoteApi.php +src/Api/ReportPackApi.php +src/Api/ReportTemplateApi.php +src/Api/ReportsApi.php +src/Api/ReportsAsyncApi.php +src/Api/TagApi.php +src/Api/TenantApi.php +src/Api/TenantEmailApi.php +src/Api/TermCalendarApi.php +src/Api/TermCalendarYearApi.php +src/Api/TierablePayApi.php +src/Api/ToolsApi.php +src/Api/WebhookApi.php +src/Api/WorkingPatternApi.php +src/ApiException.php +src/Configuration.php +src/HeaderSelector.php +src/Model/Address.php +src/Model/AdvancedVarianceReport.php +src/Model/AdvancedVarianceReportLine.php +src/Model/AdvancedVarianceReportReportResponse.php +src/Model/AeAction.php +src/Model/AeAssessment.php +src/Model/AeAssessmentAction.php +src/Model/AeEmployeeState.php +src/Model/AeExclusionCode.php +src/Model/AeStatus.php +src/Model/AeStatutoryLetter.php +src/Model/AeUKWorker.php +src/Model/AllowanceType.php +src/Model/AnalysisCategory.php +src/Model/AnalysisCategoryCode.php +src/Model/AnalysisCategoryCodes.php +src/Model/AnalysisCategoryIndex.php +src/Model/AnalysisReport.php +src/Model/AnalysisReportLine.php +src/Model/AnalysisReportLineValue.php +src/Model/AnalysisReportReportResponse.php +src/Model/AnnualRoundingRule.php +src/Model/AssumedPensionablePay.php +src/Model/AttachmentOrder.php +src/Model/AttachmentOrderPayment.php +src/Model/AttachmentOrderReportResponse.php +src/Model/AttachmentOrderType.php +src/Model/AttachmentOrdersReport.php +src/Model/AttachmentOrdersReportReportResponse.php +src/Model/AuditEventAction.php +src/Model/AuthScheme.php +src/Model/AutoEnrolment.php +src/Model/AutoEnrolmentSettings.php +src/Model/AutoPilotFinaliseTime.php +src/Model/AutomationSettings.php +src/Model/AverageHolidayPayRateReport.php +src/Model/AverageHolidayPayRateReportLine.php +src/Model/AverageHolidayPayRateReportReportResponse.php +src/Model/AveragePayGradesReportLine.php +src/Model/AverageWeeklyEarnings.php +src/Model/AverageWeeklyEarningsResult.php +src/Model/BackgroundTaskStatus.php +src/Model/BankDetails.php +src/Model/BankHolidayCollection.php +src/Model/BankPaymentInstruction.php +src/Model/BankPaymentInstructionReportResponse.php +src/Model/BankPaymentInstructionsCsvFormat.php +src/Model/Benefit.php +src/Model/BenefitDeclarationType.php +src/Model/BenefitDetailsAssetType.php +src/Model/BenefitDetailsCar.php +src/Model/BenefitDetailsCarPowerType.php +src/Model/BenefitDetailsClass1AType.php +src/Model/BenefitDetailsLoan.php +src/Model/BenefitDetailsNonClass1AType.php +src/Model/BenefitDetailsPaymentType.php +src/Model/BenefitDetailsUseOfAssetType.php +src/Model/BenefitPayrolled.php +src/Model/BenefitType.php +src/Model/BureauSettings.php +src/Model/CISSubContractorType.php +src/Model/CISTaxStatus.php +src/Model/CalendarEntry.php +src/Model/CalendarEntryType.php +src/Model/CalendarMonth.php +src/Model/CarCharge.php +src/Model/CarChargeRate.php +src/Model/ChangeSummary.php +src/Model/ChangeSummaryListReportResponse.php +src/Model/Cis300.php +src/Model/Cis300Declarations.php +src/Model/Cis300ReportResponse.php +src/Model/CisContractor.php +src/Model/CisDetails.php +src/Model/CisPartnership.php +src/Model/CisRequest.php +src/Model/CisReturn.php +src/Model/CisStatement.php +src/Model/CisStatementListReportResponse.php +src/Model/CisSubContractor.php +src/Model/CisSubContractorSummary.php +src/Model/CisSubContractorSummaryListReportResponse.php +src/Model/CisVerification.php +src/Model/CisVerificationDetails.php +src/Model/ContractAddress.php +src/Model/ContractAeAssessmentAction.php +src/Model/ContractAeAssessmentRequest.php +src/Model/ContractAeAssessmentResponse.php +src/Model/ContractAllowanceGradesRequest.php +src/Model/ContractAllowanceGradesResponse.php +src/Model/ContractAllowanceGradesUpdateRequest.php +src/Model/ContractAnalysisCategoryCodeRequest.php +src/Model/ContractAnalysisCategoryCodeResponse.php +src/Model/ContractAnalysisCategoryRequest.php +src/Model/ContractAnalysisCategoryResponse.php +src/Model/ContractAutoEnrolmentRequest.php +src/Model/ContractAutoEnrolmentResponse.php +src/Model/ContractBankDetails.php +src/Model/ContractCisDetailsRequest.php +src/Model/ContractCisDetailsResponse.php +src/Model/ContractCisPartnership.php +src/Model/ContractCisSubContractor.php +src/Model/ContractCisSubContractorItem.php +src/Model/ContractCisVerificationDetailsRequest.php +src/Model/ContractCisVerificationDetailsResponse.php +src/Model/ContractCostCentreJournalOverridesRequest.php +src/Model/ContractCostCentreJournalOverridesResponse.php +src/Model/ContractCostCentreJournalOverridesResponseItem.php +src/Model/ContractCostCentreJournalOverridesUpdateRequest.php +src/Model/ContractCreateEmployeeRequest.php +src/Model/ContractDepartmentJournalOverridesRequest.php +src/Model/ContractDepartmentJournalOverridesResponse.php +src/Model/ContractDepartmentJournalOverridesResponseItem.php +src/Model/ContractDepartmentJournalOverridesUpdateRequest.php +src/Model/ContractDepartmentRequest.php +src/Model/ContractDepartmentResponse.php +src/Model/ContractDirectorshipDetails.php +src/Model/ContractEmployeeItem.php +src/Model/ContractEmployeeResponse.php +src/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.php +src/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.php +src/Model/ContractEmployeeRoleItem.php +src/Model/ContractEmployeeRoleResponse.php +src/Model/ContractEmployeeRoleWorkingPatternRequest.php +src/Model/ContractEmployeeRoleWorkingPatternResponse.php +src/Model/ContractEmployeeRoleWorkingPatternResponseItem.php +src/Model/ContractEmployerBase.php +src/Model/ContractEmploymentDetailsRequest.php +src/Model/ContractEmploymentDetailsResponse.php +src/Model/ContractFpsFields.php +src/Model/ContractGrossToNetReportRequest.php +src/Model/ContractHolidayEntitlementRequest.php +src/Model/ContractHolidayEntitlementResponse.php +src/Model/ContractHolidayEntitlementUpdateRequest.php +src/Model/ContractHolidaySchemeRequest.php +src/Model/ContractHolidaySchemeResponse.php +src/Model/ContractJobErrorResponse.php +src/Model/ContractJobResponse.php +src/Model/ContractJobResultFileResponse.php +src/Model/ContractJobResultResponse.php +src/Model/ContractJournalTemplateRequest.php +src/Model/ContractJournalTemplateResponse.php +src/Model/ContractJournalTokenRequest.php +src/Model/ContractJournalTokenResponse.php +src/Model/ContractJournalTokenResponseItem.php +src/Model/ContractLeaveImportRequest.php +src/Model/ContractLeaveSettingsRequest.php +src/Model/ContractLeaveSettingsResponse.php +src/Model/ContractLeaverDetails.php +src/Model/ContractLondonAllowanceRequest.php +src/Model/ContractLondonAllowanceResponse.php +src/Model/ContractNetOfOnCostsResponse.php +src/Model/ContractNetOfOnCostsSimulationResponse.php +src/Model/ContractOverseasEmployerDetails.php +src/Model/ContractP11HistoryRequest.php +src/Model/ContractP11HistoryResponse.php +src/Model/ContractPartnerDetails.php +src/Model/ContractPayHistoryRequest.php +src/Model/ContractPayHistoryResponse.php +src/Model/ContractPayHistoryUpdateRequest.php +src/Model/ContractPayLineRequest.php +src/Model/ContractPayLineResponse.php +src/Model/ContractPayOptionsBaseResponse.php +src/Model/ContractPayOptionsImportRequest.php +src/Model/ContractPayOptionsRequest.php +src/Model/ContractPayOptionsResponse.php +src/Model/ContractPayRunStateHistoryResponse.php +src/Model/ContractPaySpineGradeRequest.php +src/Model/ContractPaySpineGradeResponse.php +src/Model/ContractPaySpineRequest.php +src/Model/ContractPaySpineResponse.php +src/Model/ContractPaySpineUpdateRequest.php +src/Model/ContractPaylineAnalysisCategoriesCodes.php +src/Model/ContractPaylineRequest0.php +src/Model/ContractPayrollSquadEmployerRequest.php +src/Model/ContractPayrollSquadEmployerResponse.php +src/Model/ContractPayrollSquadMemberRequest.php +src/Model/ContractPayrollSquadMemberResponse.php +src/Model/ContractPayrollSquadRequest.php +src/Model/ContractPayrollSquadResponse.php +src/Model/ContractPendingLettersCountResponse.php +src/Model/ContractPensionerPayroll.php +src/Model/ContractPersonalDetailsRequest.php +src/Model/ContractPersonalDetailsResponse.php +src/Model/ContractReapplyDpsNoticeResponse.php +src/Model/ContractRightToWork.php +src/Model/ContractRtiEmployeeAddress.php +src/Model/ContractRtiEmployeeName.php +src/Model/ContractShiftWorkingPatternDayRequest.php +src/Model/ContractShiftWorkingPatternDayResponse.php +src/Model/ContractSpinalPointRequest.php +src/Model/ContractSpinalPointResponse.php +src/Model/ContractSpinalPointUpdateRequest.php +src/Model/ContractSpineAllowanceRequest.php +src/Model/ContractSpineAllowanceResponse.php +src/Model/ContractSpineAllowanceUpdateRequest.php +src/Model/ContractStarterDetails.php +src/Model/ContractTaxAndNi.php +src/Model/ContractTermCalendarRequest.php +src/Model/ContractTermCalendarResponse.php +src/Model/ContractTermCalendarYearRequest.php +src/Model/ContractTermCalendarYearResponse.php +src/Model/ContractUpdateEmployeeRequest.php +src/Model/ContractVeteranDetails.php +src/Model/ContractWorkingPatternRequest.php +src/Model/ContractWorkingPatternResponse.php +src/Model/ContractYearsServiceEntitlementRequest.php +src/Model/ContractYearsServiceEntitlementResponse.php +src/Model/ContractYearsServiceEntitlementUpdateRequest.php +src/Model/CostAnalysisReport.php +src/Model/CostAnalysisReportReportResponse.php +src/Model/CostCentre.php +src/Model/CostOfEmploymentReport.php +src/Model/CostOfEmploymentReportLine.php +src/Model/CostOfEmploymentReportReportResponse.php +src/Model/Country.php +src/Model/CsvFileFormat.php +src/Model/DayOfWeek.php +src/Model/DecimalTaxYearConfigPrimitiveValue.php +src/Model/DeferalPeriodType.php +src/Model/Department.php +src/Model/DepartmentMembership.php +src/Model/DirectDebitMandate.php +src/Model/DirectorshipDetails.php +src/Model/DpsDataType.php +src/Model/DpsNotice.php +src/Model/DpsSettings.php +src/Model/EmailAttachment.php +src/Model/EmpRefs.php +src/Model/Employee.php +src/Model/EmployeeBenefitsReport.php +src/Model/EmployeeBenefitsReportReportResponse.php +src/Model/EmployeeCostCentre.php +src/Model/EmployeeLeaveReport.php +src/Model/EmployeeLeaveReportLine.php +src/Model/EmployeeLeaveReportReportResponse.php +src/Model/EmployeeNiYtdValues.php +src/Model/EmployeePayRunTotal.php +src/Model/EmployeeRole.php +src/Model/EmployeeRoleAnalysisCategoryCode.php +src/Model/EmployeeRolePayItem.php +src/Model/EmployeeRolePayOptions.php +src/Model/EmployeeSortBy.php +src/Model/EmployeeStatus.php +src/Model/EmployeeYtdValues.php +src/Model/Employer.php +src/Model/EmployerDefaults.php +src/Model/EmployerEmail.php +src/Model/EmployerEvcOptInHistory.php +src/Model/EmployerGroup.php +src/Model/EmployerGroupMembership.php +src/Model/EmployerItem.php +src/Model/EmployerOpeningBalances.php +src/Model/EmployerPensionContribution.php +src/Model/EmployerSettings.php +src/Model/EmployerTemplate.php +src/Model/EmployerTemplateType.php +src/Model/EmploymentDetails.php +src/Model/EntitlementBand.php +src/Model/EntityType.php +src/Model/Eps.php +src/Model/EpsAccount.php +src/Model/EpsApprenticeshipLevy.php +src/Model/EpsDeMinimisStateAid.php +src/Model/EpsFinalSubmission.php +src/Model/Establishment.php +src/Model/EvcSettings.php +src/Model/Exb.php +src/Model/ExbDeclarations.php +src/Model/ExbEmployer.php +src/Model/ExbP11d.php +src/Model/ExbP11dEmployee.php +src/Model/ExbP11db.php +src/Model/ExbP11dbClass1A.php +src/Model/ExbP11dbClass1AAdjustment.php +src/Model/ExbP11dbClass1AAdjustments.php +src/Model/ExbP11dbClass1ATotalBenefit.php +src/Model/ExbReportResponse.php +src/Model/ExpensesAndBenefits.php +src/Model/ExternalDataCompany.php +src/Model/ExternalDataProvider.php +src/Model/ExternalDataProviderId.php +src/Model/ExternalDataProviderType.php +src/Model/ExternalEmployeeMapping.php +src/Model/ExternalEmployeeMappingStatus.php +src/Model/ExternalProviderConversation.php +src/Model/FieldModification.php +src/Model/FixedCode.php +src/Model/FlexibleDrawdown.php +src/Model/Fps.php +src/Model/FpsBenefit.php +src/Model/FpsCar.php +src/Model/FpsCarFuel.php +src/Model/FpsEmployee.php +src/Model/FpsEmployeeDetails.php +src/Model/FpsEmployeeDetailsPartnerDetails.php +src/Model/FpsEmployeeFigsToDate.php +src/Model/FpsEmployeeFlexibleDrawdown.php +src/Model/FpsEmployeeNIlettersAndValues.php +src/Model/FpsEmployeePayment.php +src/Model/FpsEmployeeSeconded.php +src/Model/FpsEmployeeStarter.php +src/Model/FpsEmployeeStarterOccPension.php +src/Model/FpsEmployeeTaxCode.php +src/Model/FpsEmployeeTrivialCommutationPayment.php +src/Model/FpsEmployerPayIdChanged.php +src/Model/FpsEmployment.php +src/Model/FpsFields.php +src/Model/FpsLateReason.php +src/Model/FpsPriorVersion.php +src/Model/FpsReportResponse.php +src/Model/FromToDates.php +src/Model/FullPaymentSubmission.php +src/Model/FullSummaryOfPayReport.php +src/Model/FullSummaryOfPayReportLine.php +src/Model/FullSummaryOfPayReportReportResponse.php +src/Model/FurloughCalculationBasis.php +src/Model/FurloughReport.php +src/Model/FurloughReportLine.php +src/Model/FurloughReportReportResponse.php +src/Model/Gender.php +src/Model/GenderPayGapLine.php +src/Model/GenderPayGapReport.php +src/Model/GenderPayGapReportReportResponse.php +src/Model/GenderPayGapSnapShotDate.php +src/Model/GovTalk.php +src/Model/GovTalkError.php +src/Model/GovTalkSubmission.php +src/Model/GrossToNetReport.php +src/Model/GrossToNetReportCisLine.php +src/Model/GrossToNetReportLine.php +src/Model/GrossToNetReportReportResponse.php +src/Model/HmrcDetails.php +src/Model/HmrcLiability.php +src/Model/HmrcPayment.php +src/Model/HolidayAccrual.php +src/Model/HolidayAccrualDefaultRateType.php +src/Model/HolidayReport.php +src/Model/HolidayReportLine.php +src/Model/HolidayReportReportResponse.php +src/Model/HolidaySchemeDurationType.php +src/Model/HolidayType.php +src/Model/HourlyPayReport.php +src/Model/HourlyPayReportLine.php +src/Model/HourlyPayReportReportResponse.php +src/Model/HoursNormallyWorked.php +src/Model/HtmlEmailSettings.php +src/Model/HtmlInsertionPoint.php +src/Model/IncrementRule.php +src/Model/Invitation.php +src/Model/Item.php +src/Model/ItemListReportResponse.php +src/Model/JobStatus.php +src/Model/JobType.php +src/Model/JournalCsvFormat.php +src/Model/JournalTemplate.php +src/Model/JournalTokenType.php +src/Model/Leave.php +src/Model/LeaveAssumedPensionablePay.php +src/Model/LeaveCalculationType.php +src/Model/LeaveCustomPayment.php +src/Model/LeaveCustomProRataRule.php +src/Model/LeavePayType.php +src/Model/LeaveProRataRule.php +src/Model/LeaveSettings.php +src/Model/LeaveType.php +src/Model/LeaverDetails.php +src/Model/LgpsCivicaCasualHours.php +src/Model/LgpsCivicaPayrollNumber.php +src/Model/LgpsFund.php +src/Model/LgpsIConnectFileType.php +src/Model/LgpsIConnectPayrollReference.php +src/Model/LgpsIConnectSalaryType.php +src/Model/LgpsPayCategory.php +src/Model/LinkedPiw.php +src/Model/LinkedPiwResult.php +src/Model/Loan.php +src/Model/LoanBalancesReport.php +src/Model/LoanBalancesReportLine.php +src/Model/LoanBalancesReportReportResponse.php +src/Model/LoanCharge.php +src/Model/LogEntry.php +src/Model/LondonAllowance.php +src/Model/LondonAllowanceType.php +src/Model/LondonAllowanceValueType.php +src/Model/MailSettings.php +src/Model/MaritalStatus.php +src/Model/McrPayCategory.php +src/Model/MileageAllowancePaymentsRate.php +src/Model/MileageVehicleType.php +src/Model/ModelInterface.php +src/Model/MonthlyMinimum.php +src/Model/NationalInsuranceCalculation.php +src/Model/NationalInsuranceCalculationBase.php +src/Model/NationalInsuranceCalculationPeriodValues.php +src/Model/NationalInsuranceCode.php +src/Model/NationalMinimumWage.php +src/Model/NiLetterError.php +src/Model/NiLetterValidationReport.php +src/Model/NiLetterValidationReportLine.php +src/Model/NiLetterValidationReportReportResponse.php +src/Model/NiYtdReport.php +src/Model/NiYtdReportReportResponse.php +src/Model/NiYtdValue.php +src/Model/NicSummary.php +src/Model/NominalCodeMapping.php +src/Model/Note.php +src/Model/NoteType.php +src/Model/Nvr.php +src/Model/NvrEmployee.php +src/Model/NvrEmployeeDetails.php +src/Model/NvrEmployment.php +src/Model/NvrRequest.php +src/Model/OccupationalPolicy.php +src/Model/OccupationalPolicyEntitlement.php +src/Model/OccupationalPolicyEntitlementRecalculationBasis.php +src/Model/OccupationalPolicyPayCalculatedOn.php +src/Model/OccupationalPolicySicknessYear.php +src/Model/OccupationalPolicyType.php +src/Model/OccupationalSickLeaveHistory.php +src/Model/OpeningBalances.php +src/Model/OpeningBalancesTotals.php +src/Model/OverseasEmployerDetails.php +src/Model/OverseasSecondmentStatus.php +src/Model/P11.php +src/Model/P11DAssetAvailable.php +src/Model/P11DAssetAvailableCollection.php +src/Model/P11DAssetTransferredCollection.php +src/Model/P11DCar.php +src/Model/P11DCarCollection.php +src/Model/P11DDescOther.php +src/Model/P11DLoan.php +src/Model/P11DLoanCollection.php +src/Model/P11DOther.php +src/Model/P11DPaymentCollection.php +src/Model/P11DSingleItem.php +src/Model/P11Detailed.php +src/Model/P11DetailedNiValues.php +src/Model/P11DetailedReportResponse.php +src/Model/P11Line.php +src/Model/P11NiAndStatPaymentsLine.php +src/Model/P11NiAndStatPaymentsTotalsLine.php +src/Model/P11NiValues.php +src/Model/P11PayeLine.php +src/Model/P11PayeSummary.php +src/Model/P11PayeTotalsLine.php +src/Model/P11ReportResponse.php +src/Model/P11dCarFreeFuelWithdrawn.php +src/Model/P11dExpenses.php +src/Model/P11dVans.php +src/Model/P32.php +src/Model/P32ReportResponse.php +src/Model/PapdisDocument.php +src/Model/PapdisDocumentReportResponse.php +src/Model/PapdisEmployee.php +src/Model/PapdisEmployeeAssessment.php +src/Model/PapdisEmployeeContact.php +src/Model/PapdisEmployeeContactPostalAddress.php +src/Model/PapdisEmployeeContribution.php +src/Model/PapdisEmployeeExit.php +src/Model/PapdisEmployeeIdentity.php +src/Model/PapdisEmployeeName.php +src/Model/PapdisEmployeePay.php +src/Model/PapdisEmployer.php +src/Model/PapdisEmployerContactPostalAddress.php +src/Model/PapdisMessageFunctionCode.php +src/Model/PapdisPayrollPeriod.php +src/Model/PapdisPensionProvider.php +src/Model/PapdisVersion.php +src/Model/PartnerDetails.php +src/Model/PayBasis.php +src/Model/PayCode.php +src/Model/PayCodeCalculationType.php +src/Model/PayCodeMultiplierType.php +src/Model/PayCodeSet.php +src/Model/PayCodeVarianceLine.php +src/Model/PayElementReport.php +src/Model/PayElementReportLine.php +src/Model/PayElementReportReportResponse.php +src/Model/PayGradesReport.php +src/Model/PayGradesReportReportResponse.php +src/Model/PayLine.php +src/Model/PayMethod.php +src/Model/PayOptions.php +src/Model/PayOptionsImport.php +src/Model/PayPeriodEventType.php +src/Model/PayPeriodTypes.php +src/Model/PayPeriods.php +src/Model/PayRun.php +src/Model/PayRunChanges.php +src/Model/PayRunCsvType.php +src/Model/PayRunEntry.php +src/Model/PayRunEntrySortBy.php +src/Model/PayRunEntryWarningType.php +src/Model/PayRunJournal.php +src/Model/PayRunPayment.php +src/Model/PayRunState.php +src/Model/PayRunStateChange.php +src/Model/PayRunStateChangeReason.php +src/Model/PayRunSummaryLine.php +src/Model/PayRunSummaryLineIEnumerableReportResponse.php +src/Model/PayRunTotals.php +src/Model/PaySchedule.php +src/Model/PaySchedulePeriod.php +src/Model/PaySchedulePeriodEvent.php +src/Model/PaySchedulePeriodEventsConfig.php +src/Model/PaySpineReport.php +src/Model/PaySpineReportLine.php +src/Model/PaySpineReportReportResponse.php +src/Model/PaySpineYearsServiceEntitlementBasis.php +src/Model/Payee.php +src/Model/PayeeType.php +src/Model/PaylineCalculationData.php +src/Model/PaymentDateRule.php +src/Model/PaymentDateType.php +src/Model/PaymentMethodAfterLeaving.php +src/Model/PaymentsCsvMapping.php +src/Model/PaymentsCsvMappingColumn.php +src/Model/PaymentsCsvMappingType.php +src/Model/PayrollAnalysisCostBreakdownReport.php +src/Model/PayrollAnalysisCostBreakdownReportLine.php +src/Model/PayrollAnalysisCostBreakdownReportReportResponse.php +src/Model/PayrollAnalysisCostBreakdownReportValue.php +src/Model/PayrollAnalysisEmployeeRoleBreakdownReport.php +src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.php +src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.php +src/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.php +src/Model/PayrollValueType.php +src/Model/PayrunEmail.php +src/Model/PayrunPaymentsReport.php +src/Model/PayrunPaymentsReportReportResponse.php +src/Model/Payslip.php +src/Model/PayslipCustomisation.php +src/Model/PayslipLine.php +src/Model/PayslipLineType.php +src/Model/PayslipReleaseType.php +src/Model/PayslipReportResponse.php +src/Model/PdfPaperMargins.php +src/Model/PdfPaperOrientation.php +src/Model/PdfPaperSize.php +src/Model/PdfPasswordType.php +src/Model/Pension.php +src/Model/PensionAdministrator.php +src/Model/PensionContributionLevelType.php +src/Model/PensionContributionsSubmission.php +src/Model/PensionCsvFormat.php +src/Model/PensionEndReason.php +src/Model/PensionJoinReason.php +src/Model/PensionMembershipReportLine.php +src/Model/PensionMembershipsReport.php +src/Model/PensionMembershipsReportReportResponse.php +src/Model/PensionOpeningBalances.php +src/Model/PensionPayCode.php +src/Model/PensionProvider.php +src/Model/PensionRefund.php +src/Model/PensionReportingType.php +src/Model/PensionRule.php +src/Model/PensionScheme.php +src/Model/PensionSchemeNominalCodeMapping.php +src/Model/PensionSchemeReportOptionsLgpsCivicaUpm.php +src/Model/PensionSchemeReportOptionsLgpsIConnect.php +src/Model/PensionSelection.php +src/Model/PensionSummary.php +src/Model/PensionSummaryCostBreakdown.php +src/Model/PensionablePayDefinition.php +src/Model/PensionerPayroll.php +src/Model/PeriodValue.php +src/Model/PeriodValuePeriodValues.php +src/Model/PersonalDetails.php +src/Model/PricingBand.php +src/Model/PricingTable.php +src/Model/ProRataRule.php +src/Model/ProcessingNote.php +src/Model/ProcessingNoteStatus.php +src/Model/RecoverableAmounts.php +src/Model/Report.php +src/Model/ReportCustomCssOption.php +src/Model/ReportFormat.php +src/Model/ReportPack.php +src/Model/ReportResponse.php +src/Model/ReportSortBy.php +src/Model/ReportTemplate.php +src/Model/RightToWork.php +src/Model/RightToWorkDocumentType.php +src/Model/RightToWorkReport.php +src/Model/RightToWorkReportLine.php +src/Model/RightToWorkReportReportResponse.php +src/Model/RoleBasis.php +src/Model/RoleType.php +src/Model/RtiAgent.php +src/Model/RtiContact.php +src/Model/RtiEmployeeAddress.php +src/Model/RtiEmployeeName.php +src/Model/RtiSenderType.php +src/Model/RtiSubmissionSettings.php +src/Model/RtiValidationWarning.php +src/Model/RtiValidationWarningType.php +src/Model/ServiceBand.php +src/Model/ShiftWorkingPatternDay.php +src/Model/SmtpEncryption.php +src/Model/SmtpSettings.php +src/Model/SpinePointReport.php +src/Model/SpinePointReportLine.php +src/Model/SpinePointReportReportResponse.php +src/Model/StarterDeclaration.php +src/Model/StarterDetails.php +src/Model/StartersLeaversFilter.php +src/Model/StatPayFrequency.php +src/Model/StatutoryPay.php +src/Model/StatutoryPayReport.php +src/Model/StatutoryPayReportLine.php +src/Model/StatutoryPayReportReportResponse.php +src/Model/StringDecimalKeyValuePair.php +src/Model/StringStringKeyValuePair.php +src/Model/StudentLoan.php +src/Model/StudentLoanRecovered.php +src/Model/SubmissionStatus.php +src/Model/Tag.php +src/Model/TaxAndNi.php +src/Model/TaxBracket.php +src/Model/TaxCodeChange.php +src/Model/TaxCodeChangeReport.php +src/Model/TaxCodeChangeReportReportResponse.php +src/Model/TaxCodeChangeValues.php +src/Model/TaxYear.php +src/Model/TaxYearConfig.php +src/Model/TaxYearTypes.php +src/Model/TeachersPensionAgeWarning.php +src/Model/TeachersPensionDetails.php +src/Model/TeachersPensionEmploymentType.php +src/Model/TeachersPensionEoyLineItem.php +src/Model/TeachersPensionEoyReport.php +src/Model/TeachersPensionEoyReportReportResponse.php +src/Model/Tenant.php +src/Model/TenantBillingSettings.php +src/Model/TenantEmail.php +src/Model/TenantHtmlInsertion.php +src/Model/TenantItem.php +src/Model/TieredPension.php +src/Model/TieredPensionRate.php +src/Model/UmbrellaPayment.php +src/Model/UmbrellaReconciliationReport.php +src/Model/UmbrellaReconciliationReportLine.php +src/Model/UmbrellaReconciliationReportReportResponse.php +src/Model/UmbrellaSettings.php +src/Model/UsageBill.php +src/Model/User.php +src/Model/UserAuthorization.php +src/Model/UserCategory.php +src/Model/UserDisplayPreferences.php +src/Model/UserIndustry.php +src/Model/UserJobType.php +src/Model/UserRole.php +src/Model/UserstartPage.php +src/Model/UtmInfo.php +src/Model/ValueOverride.php +src/Model/VarianceReport.php +src/Model/VarianceReportReportResponse.php +src/Model/VeteranDetails.php +src/Model/WarningsReport.php +src/Model/WarningsReportLine.php +src/Model/WarningsReportReportResponse.php +src/Model/Webhook.php +src/Model/WebhookEvent.php +src/Model/WebhookPayload.php +src/Model/WorkerGroup.php +src/Model/WorkingPattern.php +src/Model/WorkingPatternHoursType.php +src/Model/WorkingPatternType.php +src/Model/YearEnd.php +src/Model/YearEndTaxCodeChange.php +src/Model/YtdReport.php +src/Model/YtdReportReportResponse.php +src/Model/YtdValue.php +src/Model/ZeroPaidFilter.php +src/ObjectSerializer.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..8841191 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0-SNAPSHOT diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/.phplint.yml b/.phplint.yml new file mode 100644 index 0000000..ef4be48 --- /dev/null +++ b/.phplint.yml @@ -0,0 +1,11 @@ +path: + - ./src + - ./tests +jobs: 10 +extensions: + - php +exclude: + - vendor +warning: true +memory-limit: -1 +no-cache: true diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..707be2a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: php +# Jammy Jellyfish environment has preinstalled PHP 8.1 +# Focal Fossa doesn't fit since it contains preinstalled PHP 7.4 only +# https://docs.travis-ci.com/user/reference/jammy/#php-support +dist: jammy +os: + - linux +php: + - 8.1 + - 8.2 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ebf660 --- /dev/null +++ b/README.md @@ -0,0 +1,1500 @@ +# Staffology-PHP + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +For more information, please visit [http://www.staffology.co.uk](http://www.staffology.co.uk). + +## Installation & Usage + +### Requirements + +PHP 8.1 and later. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/synergitech/staffology-php.git" + } + ], + "require": { + "synergitech/staffology-php": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$brandCode = 'brandCode_example'; // string +$autoActivate = false; // bool | If autoActivate is set to true, the account activation should be automatically performed without any user interaction +$user = new \SynergiTech\Staffology\Model\User(); // \SynergiTech\Staffology\Model\User + +try { + $result = $apiInstance->activateAccount($brandCode, $autoActivate, $user); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->activateAccount: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccountApi* | [**activateAccount**](docs/Api/AccountApi.md#activateaccount) | **POST** /account/activate | Activate an Account +*AccountApi* | [**changeEmailAddressAccount**](docs/Api/AccountApi.md#changeemailaddressaccount) | **POST** /account/emailaddress | Change Email Address +*AccountApi* | [**createApiKeyAccount**](docs/Api/AccountApi.md#createapikeyaccount) | **POST** /account/keys | Create ApiKey +*AccountApi* | [**createDemoEmployerAccount**](docs/Api/AccountApi.md#createdemoemployeraccount) | **POST** /account/demo | Create Demo Employer +*AccountApi* | [**deleteApiKeyAccount**](docs/Api/AccountApi.md#deleteapikeyaccount) | **DELETE** /account/keys/{id} | Delete ApiKey +*AccountApi* | [**getAccount**](docs/Api/AccountApi.md#getaccount) | **GET** /account | Get Account Details +*AccountApi* | [**getApiKeyAccount**](docs/Api/AccountApi.md#getapikeyaccount) | **GET** /account/keys/{id} | Get ApiKey +*AccountApi* | [**getEmployerDefaultsAccount**](docs/Api/AccountApi.md#getemployerdefaultsaccount) | **GET** /account/employerdefaults | Get EmployerDefaults +*AccountApi* | [**getInvitationsAccount**](docs/Api/AccountApi.md#getinvitationsaccount) | **GET** /account/invitations | Get Invitations +*AccountApi* | [**getTenantAccount**](docs/Api/AccountApi.md#gettenantaccount) | **GET** /account/Tenant | Get Tenant +*AccountApi* | [**getUserEmployersAccount**](docs/Api/AccountApi.md#getuseremployersaccount) | **GET** /account/useremployers | List User Employers +*AccountApi* | [**listApiKeysAccount**](docs/Api/AccountApi.md#listapikeysaccount) | **GET** /account/keys | List ApiKeys +*AccountApi* | [**profileAccount**](docs/Api/AccountApi.md#profileaccount) | **POST** /account/profile | Update Profile +*AccountApi* | [**setEmployerDefaultsAccount**](docs/Api/AccountApi.md#setemployerdefaultsaccount) | **PUT** /account/employerdefaults | Set EmployerDefaults +*AccountApi* | [**updatePhotoAccount**](docs/Api/AccountApi.md#updatephotoaccount) | **POST** /account/photo | Update Photo +*AccountApi* | [**verifyAccount**](docs/Api/AccountApi.md#verifyaccount) | **POST** /account/verify | Re-send Verification Email +*AccountApi* | [**verifyResponseAccount**](docs/Api/AccountApi.md#verifyresponseaccount) | **PUT** /account/verify/respond | Verify Email Address +*AnalysisCategoryApi* | [**createAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#createanalysiscategory) | **POST** /employers/{employerId}/analysiscategories | Create AnalysisCategory +*AnalysisCategoryApi* | [**createAnalysisCategoryCodeAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#createanalysiscategorycodeanalysiscategory) | **POST** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes | Create AnalysisCategoryCode +*AnalysisCategoryApi* | [**deleteAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#deleteanalysiscategory) | **DELETE** /employers/{employerId}/analysiscategories/{id} | Delete AnalysisCategory +*AnalysisCategoryApi* | [**deleteAnalysisCategoryCodeAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#deleteanalysiscategorycodeanalysiscategory) | **DELETE** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Delete AnalysisCategoryCode +*AnalysisCategoryApi* | [**getAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#getanalysiscategory) | **GET** /employers/{employerId}/analysiscategories/{id} | Get AnalysisCategory +*AnalysisCategoryApi* | [**getAnalysisCategoryCodeAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#getanalysiscategorycodeanalysiscategory) | **GET** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Get AnalysisCategoryCode +*AnalysisCategoryApi* | [**getCodesAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#getcodesanalysiscategory) | **GET** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes | List AnalysisCategoryCodes +*AnalysisCategoryApi* | [**indexAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#indexanalysiscategory) | **GET** /employers/{employerId}/analysiscategories | List AnalysisCategories +*AnalysisCategoryApi* | [**updateAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#updateanalysiscategory) | **PUT** /employers/{employerId}/analysiscategories/{id} | Update AnalysisCategory +*AnalysisCategoryApi* | [**updateAnalysisCategoryCodeAnalysisCategory**](docs/Api/AnalysisCategoryApi.md#updateanalysiscategorycodeanalysiscategory) | **PUT** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Update AnalysisCategoryCode +*AttachmentOrderApi* | [**addDocumentAttachmentOrder**](docs/Api/AttachmentOrderApi.md#adddocumentattachmentorder) | **POST** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents | Add Document +*AttachmentOrderApi* | [**createAttachmentOrder**](docs/Api/AttachmentOrderApi.md#createattachmentorder) | **POST** /employers/{employerId}/employees/{employeeId}/attachmentorders | Create AttachmentOrder +*AttachmentOrderApi* | [**deleteAttachmentOrder**](docs/Api/AttachmentOrderApi.md#deleteattachmentorder) | **DELETE** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Delete AttachmentOrder +*AttachmentOrderApi* | [**deleteDocumentAttachmentOrder**](docs/Api/AttachmentOrderApi.md#deletedocumentattachmentorder) | **DELETE** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId} | Delete AttachmentOrder Document +*AttachmentOrderApi* | [**getAttachmentOrder**](docs/Api/AttachmentOrderApi.md#getattachmentorder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Get AttachmentOrder +*AttachmentOrderApi* | [**getDocumentAttachmentOrder**](docs/Api/AttachmentOrderApi.md#getdocumentattachmentorder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId} | Get AttachmentOrder Document +*AttachmentOrderApi* | [**indexAttachmentOrder**](docs/Api/AttachmentOrderApi.md#indexattachmentorder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders | List AttachmentOrders +*AttachmentOrderApi* | [**paymentsAttachmentOrder**](docs/Api/AttachmentOrderApi.md#paymentsattachmentorder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/payments/{taxYear} | Get Payments +*AttachmentOrderApi* | [**updateAttachmentOrder**](docs/Api/AttachmentOrderApi.md#updateattachmentorder) | **PUT** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Update AttachmentOrder +*AuditApi* | [**employerAuditListAudit**](docs/Api/AuditApi.md#employerauditlistaudit) | **GET** /employers/{employerId}/audit | Employer Audit Log +*AutoEnrolmentApi* | [**assessAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#assessautoenrolment) | **POST** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments | Assess Employee for AutoEnrolment +*AutoEnrolmentApi* | [**deleteAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#deleteautoenrolment) | **DELETE** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id} | Delete AE Assessment +*AutoEnrolmentApi* | [**emailAllLettersAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#emailalllettersautoenrolment) | **POST** /employers/{employerId}/autoenrolment/letters/email | Email All Letters +*AutoEnrolmentApi* | [**emailLetterAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#emailletterautoenrolment) | **POST** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/email | Email Letter +*AutoEnrolmentApi* | [**getAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#getautoenrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id} | Get AE Assessment +*AutoEnrolmentApi* | [**getLastAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#getlastautoenrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/last | Get Last AE Assessment +*AutoEnrolmentApi* | [**getLetterAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#getletterautoenrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter | Get Letter +*AutoEnrolmentApi* | [**listAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#listautoenrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment | Get AE Assessments +*AutoEnrolmentApi* | [**markLetterAsSentAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#markletterassentautoenrolment) | **PUT** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/sent | Mark Letter as Sent +*AutoEnrolmentApi* | [**markLettersAsSentAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#marklettersassentautoenrolment) | **PUT** /employers/{employerId}/autoenrolment/letters/sent | Mark All Letters as Sent +*AutoEnrolmentApi* | [**pendingLettersAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#pendinglettersautoenrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending | Pending Letters +*AutoEnrolmentApi* | [**pendingLettersCountAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#pendingletterscountautoenrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending/count | Pending Letters Count +*AutoEnrolmentApi* | [**pendingPostponementLettersAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#pendingpostponementlettersautoenrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending/postponement | Pending Postponement Letters +*AutoEnrolmentApi* | [**reenrolAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#reenrolautoenrolment) | **GET** /employers/{employerId}/autoenrolment/renrol | Cyclical Re-enrolment +*AutoEnrolmentApi* | [**setStateAutoEnrolment**](docs/Api/AutoEnrolmentApi.md#setstateautoenrolment) | **PUT** /employers/{employerId}/employees/{employeeId}/autoenrolment/state | Update State +*AverageHolidayPayHistoryApi* | [**createAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#createaverageholidaypayhistory) | **POST** /{employerId}/employees/AverageHolidayPay/PayHistory | Create multiple AverageHolidayPayHistory for an Employer +*AverageHolidayPayHistoryApi* | [**deleteAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#deleteaverageholidaypayhistory) | **DELETE** /{employerId}/employees/AverageHolidayPay/PayHistory/{id} | Delete an AverageHolidayPayHistory record +*AverageHolidayPayHistoryApi* | [**deleteByEmployeeIdAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#deletebyemployeeidaverageholidaypayhistory) | **DELETE** /{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory | Delete all AverageHolidayPayHistory for an Employee +*AverageHolidayPayHistoryApi* | [**getByEmployeeAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#getbyemployeeaverageholidaypayhistory) | **GET** /{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory/{taxYear} | List AverageHolidayPayHistory for Employee +*AverageHolidayPayHistoryApi* | [**getByEmployerAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#getbyemployeraverageholidaypayhistory) | **GET** /{employerId}/employees/AverageHolidayPay/PayHistory | Get AverageHolidayPayHistory for Employer +*AverageHolidayPayHistoryApi* | [**importCsvAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#importcsvaverageholidaypayhistory) | **POST** /{employerId}/employees/AverageHolidayPay/PayHistory/import | Import AverageHistoryPayHistory from csv file +*AverageHolidayPayHistoryApi* | [**updateAverageHolidayPayHistory**](docs/Api/AverageHolidayPayHistoryApi.md#updateaverageholidaypayhistory) | **PUT** /{employerId}/employees/AverageHolidayPay/PayHistory | Update multiple AverageHolidayPayHistory for an Employer +*BenefitsApi* | [**createBenefits**](docs/Api/BenefitsApi.md#createbenefits) | **POST** /employers/{employerId}/employees/{employeeId}/benefits | Create Benefit +*BenefitsApi* | [**deleteBenefits**](docs/Api/BenefitsApi.md#deletebenefits) | **DELETE** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Delete Benefit +*BenefitsApi* | [**getBenefits**](docs/Api/BenefitsApi.md#getbenefits) | **GET** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Get Benefit +*BenefitsApi* | [**indexBenefits**](docs/Api/BenefitsApi.md#indexbenefits) | **GET** /employers/{employerId}/employees/{employeeId}/benefits | List Benefits +*BenefitsApi* | [**updateBenefits**](docs/Api/BenefitsApi.md#updatebenefits) | **PUT** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Update Benefit +*BillingApi* | [**billBilling**](docs/Api/BillingApi.md#billbilling) | **GET** /billing/bill/{id} | Get Bill +*BillingApi* | [**billCsvBilling**](docs/Api/BillingApi.md#billcsvbilling) | **GET** /billing/bill/{id}/csv | Get Bill CSV +*BillingApi* | [**billsBilling**](docs/Api/BillingApi.md#billsbilling) | **GET** /billing/bills | List Bills +*BillingApi* | [**confirmDirectDebitMandateBilling**](docs/Api/BillingApi.md#confirmdirectdebitmandatebilling) | **GET** /billing/directdebit/confirm | Confirm Direct Debit Setup +*BillingApi* | [**deleteDirectDebitMandateBilling**](docs/Api/BillingApi.md#deletedirectdebitmandatebilling) | **DELETE** /billing/directdebit | Delete DirectDebitMandate +*BillingApi* | [**directDebitMandateBilling**](docs/Api/BillingApi.md#directdebitmandatebilling) | **GET** /billing/directdebit | Get DirectDebitMandate +*BillingApi* | [**getUsageStatsBilling**](docs/Api/BillingApi.md#getusagestatsbilling) | **GET** /billing/usage-stats | Get UsageStats Report +*BillingApi* | [**setupDirectDebitMandateBilling**](docs/Api/BillingApi.md#setupdirectdebitmandatebilling) | **GET** /billing/directdebit/setup | Setup DirectDebitMandate +*BureauApi* | [**employersBureau**](docs/Api/BureauApi.md#employersbureau) | **GET** /bureau/employers | List Employers +*BureauApi* | [**getProcessorUserBureau**](docs/Api/BureauApi.md#getprocessoruserbureau) | **GET** /employers/{employerId}/bureau/settings/processor | Get Processor +*BureauApi* | [**getReportPackBureau**](docs/Api/BureauApi.md#getreportpackbureau) | **GET** /employers/{employerId}/bureau/settings/reportpack | Get BureauSettings ReportPack +*BureauApi* | [**getSettingsBureau**](docs/Api/BureauApi.md#getsettingsbureau) | **GET** /employers/{employerId}/bureau/settings | Get BureauSettings +*BureauApi* | [**processorUsersBureau**](docs/Api/BureauApi.md#processorusersbureau) | **GET** /bureau/processors | List Allocated Processors +*BureauApi* | [**updateSettingsBureau**](docs/Api/BureauApi.md#updatesettingsbureau) | **PUT** /employers/{employerId}/bureau/settings | Update BureauSettings +*Cis300Api* | [**createCis300**](docs/Api/Cis300Api.md#createcis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear} | Create Cis300 +*Cis300Api* | [**deleteCis300**](docs/Api/Cis300Api.md#deletecis300) | **DELETE** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Delete Cis300 +*Cis300Api* | [**getCis300**](docs/Api/Cis300Api.md#getcis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Get Cis300 +*Cis300Api* | [**getXmlRequestCis300**](docs/Api/Cis300Api.md#getxmlrequestcis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear}/{id}/xml/request | Get XML Request +*Cis300Api* | [**listCis300**](docs/Api/Cis300Api.md#listcis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear} | List Cis300 +*Cis300Api* | [**markAsAcceptedCis300**](docs/Api/Cis300Api.md#markasacceptedcis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear}/{id}/markasaccepted | Mark as Sent +*Cis300Api* | [**requiringAttentionCis300**](docs/Api/Cis300Api.md#requiringattentioncis300) | **GET** /employers/{employerId}/rti/cis300/requiringattention | Cis300 Requiring Attention +*Cis300Api* | [**submitCis300**](docs/Api/Cis300Api.md#submitcis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear}/{id}/submit | Submit Cis300 +*Cis300Api* | [**updateCis300**](docs/Api/Cis300Api.md#updatecis300) | **PUT** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Update Cis300 +*CisVerificationApi* | [**createCisVerification**](docs/Api/CisVerificationApi.md#createcisverification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear} | Create CisVerificationRequest +*CisVerificationApi* | [**deleteCisVerification**](docs/Api/CisVerificationApi.md#deletecisverification) | **DELETE** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Delete CisVerificationRequest +*CisVerificationApi* | [**getCisVerification**](docs/Api/CisVerificationApi.md#getcisverification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Get CisVerificationRequest +*CisVerificationApi* | [**getXmlRequestCisVerification**](docs/Api/CisVerificationApi.md#getxmlrequestcisverification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/xml/request | Get XML Request +*CisVerificationApi* | [**listCisVerification**](docs/Api/CisVerificationApi.md#listcisverification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear} | List CisVerificationRequest +*CisVerificationApi* | [**markAsAcceptedCisVerification**](docs/Api/CisVerificationApi.md#markasacceptedcisverification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/markasaccepted | Mark as Sent +*CisVerificationApi* | [**requiringAttentionCisVerification**](docs/Api/CisVerificationApi.md#requiringattentioncisverification) | **GET** /employers/{employerId}/rti/cis-verification/requiringattention | CisVerificationRequest Requiring Attention +*CisVerificationApi* | [**submitCisVerification**](docs/Api/CisVerificationApi.md#submitcisverification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/submit | Submit CisVerificationRequest +*CisVerificationApi* | [**updateCisVerification**](docs/Api/CisVerificationApi.md#updatecisverification) | **PUT** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Update CisVerificationRequest +*CostCentreApi* | [**createCostCentre**](docs/Api/CostCentreApi.md#createcostcentre) | **POST** /employers/{employerId}/costcentres | Create Cost Centre +*CostCentreApi* | [**deleteCostCentre**](docs/Api/CostCentreApi.md#deletecostcentre) | **DELETE** /employers/{employerId}/costcentres/{code} | Delete Cost Centre (deprecated) +*CostCentreApi* | [**deleteCostCentreCostCentre**](docs/Api/CostCentreApi.md#deletecostcentrecostcentre) | **DELETE** /employers/{employerId}/costcentres | Delete Cost Centre +*CostCentreApi* | [**getCostCentre**](docs/Api/CostCentreApi.md#getcostcentre) | **GET** /employers/{employerId}/costcentres/{code} | Get Cost Centre (deprecated) +*CostCentreApi* | [**getCostCentreCostCentre**](docs/Api/CostCentreApi.md#getcostcentrecostcentre) | **GET** /employers/{employerId}/costcentres/costcentre | Get Cost Centre +*CostCentreApi* | [**indexCostCentre**](docs/Api/CostCentreApi.md#indexcostcentre) | **GET** /employers/{employerId}/costcentres | List Cost Centres +*CostCentreApi* | [**updateCostCentre**](docs/Api/CostCentreApi.md#updatecostcentre) | **PUT** /employers/{employerId}/costcentres/{code} | Update Cost Centre (deprecated) +*CostCentreApi* | [**updateCostCentreCostCentre**](docs/Api/CostCentreApi.md#updatecostcentrecostcentre) | **PUT** /employers/{employerId}/costcentres | Update Cost Centre +*DepartmentApi* | [**createDepartment**](docs/Api/DepartmentApi.md#createdepartment) | **POST** /employers/{employerId}/departments | Create Department +*DepartmentApi* | [**deleteDepartment**](docs/Api/DepartmentApi.md#deletedepartment) | **DELETE** /employers/{employerId}/departments/{code} | Delete Department (deprecated) +*DepartmentApi* | [**deleteDepartmentDepartment**](docs/Api/DepartmentApi.md#deletedepartmentdepartment) | **DELETE** /employers/{employerId}/departments/department | Delete Department +*DepartmentApi* | [**getDepartment**](docs/Api/DepartmentApi.md#getdepartment) | **GET** /employers/{employerId}/departments/{code} | Get Department (deprecated) +*DepartmentApi* | [**getDepartmentDepartment**](docs/Api/DepartmentApi.md#getdepartmentdepartment) | **GET** /employers/{employerId}/departments/Department | Get Department +*DepartmentApi* | [**indexDepartment**](docs/Api/DepartmentApi.md#indexdepartment) | **GET** /employers/{employerId}/departments | List Departments +*DepartmentApi* | [**updateDepartment**](docs/Api/DepartmentApi.md#updatedepartment) | **PUT** /employers/{employerId}/departments/{code} | Update Department (deprecated) +*DepartmentApi* | [**updateDepartmentDepartment**](docs/Api/DepartmentApi.md#updatedepartmentdepartment) | **PUT** /employers/{employerId}/departments/department | Update Department +*DpsApi* | [**applyDps**](docs/Api/DpsApi.md#applydps) | **PUT** /employers/{employerId}/dps/notices/{id} | Apply Notice +*DpsApi* | [**checkForNoticesDps**](docs/Api/DpsApi.md#checkfornoticesdps) | **POST** /employers/{employerId}/dps/notices | Check for new Notices +*DpsApi* | [**deleteAllDps**](docs/Api/DpsApi.md#deletealldps) | **DELETE** /employers/{employerId}/dps/notices | Delete All Notices +*DpsApi* | [**deleteDps**](docs/Api/DpsApi.md#deletedps) | **DELETE** /employers/{employerId}/dps/notices/{id} | Delete Notice +*DpsApi* | [**getDps**](docs/Api/DpsApi.md#getdps) | **GET** /employers/{employerId}/dps/notices/{id} | Get Notice +*DpsApi* | [**getDpsSettingsDps**](docs/Api/DpsApi.md#getdpssettingsdps) | **GET** /employers/{employerId}/dps/settings | Get DPS Settings +*DpsApi* | [**listNoticesDps**](docs/Api/DpsApi.md#listnoticesdps) | **GET** /employers/{employerId}/dps/notices | List Notices +*DpsApi* | [**parseXmlDps**](docs/Api/DpsApi.md#parsexmldps) | **POST** /employers/{employerId}/dps/notices/xml | Parse notices from XML +*DpsApi* | [**reapplyNoticesDps**](docs/Api/DpsApi.md#reapplynoticesdps) | **PUT** /employers/{employerId}/dps/reapply | Reapply DpsNotices +*DpsApi* | [**updateDpsSettingsDps**](docs/Api/DpsApi.md#updatedpssettingsdps) | **PUT** /employers/{employerId}/dps/settings | Update DPS Settings +*EmailApi* | [**getEmailEmail**](docs/Api/EmailApi.md#getemailemail) | **GET** /employers/{employerId}/email/{emailId} | Get Email +*EmailApi* | [**getMailSettingsEmail**](docs/Api/EmailApi.md#getmailsettingsemail) | **GET** /employers/{employerId}/email/settings | Get MailSettings +*EmailApi* | [**indexEmail**](docs/Api/EmailApi.md#indexemail) | **GET** /employers/{employerId}/email | List Emails +*EmailApi* | [**resendEmailEmail**](docs/Api/EmailApi.md#resendemailemail) | **POST** /employers/{employerId}/email/{emailId} | Re-send Email +*EmailApi* | [**testMailSettingsEmail**](docs/Api/EmailApi.md#testmailsettingsemail) | **POST** /employers/{employerId}/email/settings/test | Send Test Email +*EmailApi* | [**updateMailSettingsEmail**](docs/Api/EmailApi.md#updatemailsettingsemail) | **PUT** /employers/{employerId}/email/settings | Update MailSettings +*EmailApi* | [**verifyMailSettingsEmail**](docs/Api/EmailApi.md#verifymailsettingsemail) | **POST** /employers/{employerId}/email/settings/verify | Email Verification (Request) +*EmailApi* | [**verifyMailSettingsResponseEmail**](docs/Api/EmailApi.md#verifymailsettingsresponseemail) | **PUT** /employers/{employerId}/email/settings/verify | Email Verification (Respond) +*EmployeeApi* | [**applyPayIncreaseEmployee**](docs/Api/EmployeeApi.md#applypayincreaseemployee) | **PUT** /employers/{employerId}/employees/payincrease | Apply Pay Increase +*EmployeeApi* | [**applyPayOptionsEmployee**](docs/Api/EmployeeApi.md#applypayoptionsemployee) | **PUT** /employers/{employerId}/employees/payoptions | Apply PayOptions +*EmployeeApi* | [**averageWeeklyEarningsEmployee**](docs/Api/EmployeeApi.md#averageweeklyearningsemployee) | **GET** /employers/{employerId}/employees/{id}/awe | Average Weekly Earnings +*EmployeeApi* | [**baseDailyRateEmployee**](docs/Api/EmployeeApi.md#basedailyrateemployee) | **GET** /employers/{employerId}/employees/{id}/basedailyrate | Calculate Base Daily Rate (deprecated) +*EmployeeApi* | [**baseHourlyRateEmployee**](docs/Api/EmployeeApi.md#basehourlyrateemployee) | **GET** /employers/{employerId}/employees/{id}/basehourlyrate | Calculate Base Hourly Rate (deprecated) +*EmployeeApi* | [**createEmployee**](docs/Api/EmployeeApi.md#createemployee) | **POST** /employers/{employerId}/employees | Create a new Employee +*EmployeeApi* | [**deleteEmployee**](docs/Api/EmployeeApi.md#deleteemployee) | **DELETE** /employers/{employerId}/employees/{id} | Delete an Employee +*EmployeeApi* | [**deleteMultipleEmployee**](docs/Api/EmployeeApi.md#deletemultipleemployee) | **POST** /employers/{employerId}/employees/delete | Delete Employees +*EmployeeApi* | [**deletePhotoEmployee**](docs/Api/EmployeeApi.md#deletephotoemployee) | **DELETE** /employers/{employerId}/employees/{id}/photo | Delete Photo +*EmployeeApi* | [**expiringRtwEmployee**](docs/Api/EmployeeApi.md#expiringrtwemployee) | **GET** /employers/{employerId}/employees/expiring-rtw | Expiring RightToWork +*EmployeeApi* | [**getDepartmentMembershipsEmployee**](docs/Api/EmployeeApi.md#getdepartmentmembershipsemployee) | **GET** /employers/{employerId}/employees/{id}/departments | Get Employee Departments +*EmployeeApi* | [**getEmployee**](docs/Api/EmployeeApi.md#getemployee) | **GET** /employers/{employerId}/employees/{id} | Get an Employee +*EmployeeApi* | [**getEmployeeCostCentresEmployee**](docs/Api/EmployeeApi.md#getemployeecostcentresemployee) | **GET** /employers/{employerId}/employees/{id}/costcentres | Get Employee Cost Centres +*EmployeeApi* | [**getEvcSettingsEmployee**](docs/Api/EmployeeApi.md#getevcsettingsemployee) | **GET** /employers/{employerId}/employees/{id}/evcsettings | Get EvcSettings +*EmployeeApi* | [**importCsvEmployee**](docs/Api/EmployeeApi.md#importcsvemployee) | **POST** /employers/{employerId}/employees/import | Import CSV +*EmployeeApi* | [**indexEmployee**](docs/Api/EmployeeApi.md#indexemployee) | **GET** /employers/{employerId}/employees | List Employees +*EmployeeApi* | [**leaversEmployee**](docs/Api/EmployeeApi.md#leaversemployee) | **GET** /employers/{employerId}/employees/leavers | List Leavers +*EmployeeApi* | [**markAsLeaversEmployee**](docs/Api/EmployeeApi.md#markasleaversemployee) | **PUT** /employers/{employerId}/employees/leavers | Mark as Leavers +*EmployeeApi* | [**minimumWageEmployee**](docs/Api/EmployeeApi.md#minimumwageemployee) | **GET** /employers/{employerId}/employees/{id}/{taxYear}/minimum-wage | Minimum Wage +*EmployeeApi* | [**payRunEntriesEmployee**](docs/Api/EmployeeApi.md#payrunentriesemployee) | **GET** /employers/{employerId}/employees/{id}/payrunentries/{taxYear} | PayRunEntries for Employee +*EmployeeApi* | [**reHireEmployee**](docs/Api/EmployeeApi.md#rehireemployee) | **GET** /employers/{employerId}/employees/{id}/rehire | Rehire an Employee +*EmployeeApi* | [**searchByPayrollCodeEmployee**](docs/Api/EmployeeApi.md#searchbypayrollcodeemployee) | **GET** /employers/{employerId}/employees/search/payrollcode | Get Employee by Payroll Code +*EmployeeApi* | [**searchEmployee**](docs/Api/EmployeeApi.md#searchemployee) | **GET** /employers/{employerId}/employees/search | Search Employer for Employees +*EmployeeApi* | [**setDepartmentMembershipsEmployee**](docs/Api/EmployeeApi.md#setdepartmentmembershipsemployee) | **PUT** /employers/{employerId}/employees/{id}/departments | Set Employee Departments +*EmployeeApi* | [**setEmployeeCostCentresEmployee**](docs/Api/EmployeeApi.md#setemployeecostcentresemployee) | **PUT** /employers/{employerId}/employees/{id}/costcentres | Set Employee Cost Centres +*EmployeeApi* | [**setOnHoldEmployee**](docs/Api/EmployeeApi.md#setonholdemployee) | **PUT** /employers/{employerId}/employees/onhold | Mark as On Hold +*EmployeeApi* | [**updateEmployee**](docs/Api/EmployeeApi.md#updateemployee) | **PUT** /employers/{employerId}/employees/{id} | Update an Employee +*EmployeeApi* | [**updateEvcSettingsEmployee**](docs/Api/EmployeeApi.md#updateevcsettingsemployee) | **PUT** /employers/{employerId}/employees/{id}/evcsettings | Update EvcSettings +*EmployeeApi* | [**updatePhotoEmployee**](docs/Api/EmployeeApi.md#updatephotoemployee) | **POST** /employers/{employerId}/employees/{id}/photo | Update Photo +*EmployeeRoleApi* | [**createEmployeeRole**](docs/Api/EmployeeRoleApi.md#createemployeerole) | **POST** /employers/{employerId}/employees/{employeeId}/roles | Create Employee Role +*EmployeeRoleApi* | [**createRoleWorkingPatternEmployeeRole**](docs/Api/EmployeeRoleApi.md#createroleworkingpatternemployeerole) | **POST** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns | Create Employee Role Working Pattern +*EmployeeRoleApi* | [**deleteEmployeeRole**](docs/Api/EmployeeRoleApi.md#deleteemployeerole) | **DELETE** /employers/{employerId}/employees/{employeeId}/roles/{id} | Delete Employee Role +*EmployeeRoleApi* | [**deleteRoleWorkingPatternEmployeeRole**](docs/Api/EmployeeRoleApi.md#deleteroleworkingpatternemployeerole) | **DELETE** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId} | Delete Employee Role Working Pattern +*EmployeeRoleApi* | [**getBaseDailyRateEmployeeRole**](docs/Api/EmployeeRoleApi.md#getbasedailyrateemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/basedailyrate | Calculate Base Daily Rate +*EmployeeRoleApi* | [**getBaseHourlyRateEmployeeRole**](docs/Api/EmployeeRoleApi.md#getbasehourlyrateemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/basehourlyrate | Calculate Base Hourly Rate +*EmployeeRoleApi* | [**getCostCentreMembershipsEmployeeRole**](docs/Api/EmployeeRoleApi.md#getcostcentremembershipsemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres | Get Employee Role Cost Centres +*EmployeeRoleApi* | [**getDepartmentMembershipsEmployeeRole**](docs/Api/EmployeeRoleApi.md#getdepartmentmembershipsemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/departments | Get Employee Role Departments +*EmployeeRoleApi* | [**getEmployeeRole**](docs/Api/EmployeeRoleApi.md#getemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id} | Get Employee Role +*EmployeeRoleApi* | [**getEmployeeRoleAnalysisCategoryCodesEmployeeRole**](docs/Api/EmployeeRoleApi.md#getemployeeroleanalysiscategorycodesemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategorycodes | Get Employee Role AnalysisCategoryCode +*EmployeeRoleApi* | [**getRoleAssumedPensionablePayEmployeeRole**](docs/Api/EmployeeRoleApi.md#getroleassumedpensionablepayemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/assumedpensionablepay | Calculate Assumed Pensionable Pay +*EmployeeRoleApi* | [**getRoleWorkingPatternEmployeeRole**](docs/Api/EmployeeRoleApi.md#getroleworkingpatternemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId} | Get Employee Role Working Pattern +*EmployeeRoleApi* | [**indexEmployeeRole**](docs/Api/EmployeeRoleApi.md#indexemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles | List Employee Roles +*EmployeeRoleApi* | [**listRoleWorkingPatternsEmployeeRole**](docs/Api/EmployeeRoleApi.md#listroleworkingpatternsemployeerole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns | List Working Patterns for an Employee Role +*EmployeeRoleApi* | [**setCostCentreMembershipsEmployeeRole**](docs/Api/EmployeeRoleApi.md#setcostcentremembershipsemployeerole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres | Set Employee Role Cost Centres +*EmployeeRoleApi* | [**setDepartmentMembershipsEmployeeRole**](docs/Api/EmployeeRoleApi.md#setdepartmentmembershipsemployeerole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/departments | Set Employee Role Departments +*EmployeeRoleApi* | [**setEmployeeRoleAnalysisCategoryCodesEmployeeRole**](docs/Api/EmployeeRoleApi.md#setemployeeroleanalysiscategorycodesemployeerole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategories/{analysisCategoryId}/analysiscategorycodes | Set Employee Role AnalysisCategorycode +*EmployeeRoleApi* | [**updateEmployeeRole**](docs/Api/EmployeeRoleApi.md#updateemployeerole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id} | Update Employee Role +*EmployeeRoleApi* | [**updateRoleWorkingPatternEmployeeRole**](docs/Api/EmployeeRoleApi.md#updateroleworkingpatternemployeerole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingPatterns/{roleWorkingPatternId} | Update Employee Role Working Pattern +*EmployerApi* | [**applyYearEndEmployer**](docs/Api/EmployerApi.md#applyyearendemployer) | **PUT** /employers/{id}/YearEnd | Make Year End Changes +*EmployerApi* | [**calendarEmployer**](docs/Api/EmployerApi.md#calendaremployer) | **GET** /employers/{id}/calendar | Get Employer Calendar +*EmployerApi* | [**createEmployer**](docs/Api/EmployerApi.md#createemployer) | **POST** /employers | Create an Employer +*EmployerApi* | [**customPayslipEmployer**](docs/Api/EmployerApi.md#custompayslipemployer) | **GET** /employers/{id}/custompayslip | Get Payslip Customisations +*EmployerApi* | [**deleteEmployer**](docs/Api/EmployerApi.md#deleteemployer) | **DELETE** /employers/{id} | Delete an Employer +*EmployerApi* | [**getAutomationSettingsEmployer**](docs/Api/EmployerApi.md#getautomationsettingsemployer) | **GET** /employers/{id}/automation | Get Automation Settings +*EmployerApi* | [**getEmployer**](docs/Api/EmployerApi.md#getemployer) | **GET** /employers/{id} | Get an Employer +*EmployerApi* | [**getEmployerOpeningBalancesEmployer**](docs/Api/EmployerApi.md#getemployeropeningbalancesemployer) | **GET** /employers/{id}/openingbalances | Get EmployerOpeningBalances +*EmployerApi* | [**getEvcOptInHistoryEmployer**](docs/Api/EmployerApi.md#getevcoptinhistoryemployer) | **GET** /employers/{id}/evc | Get EVC OptIn History +*EmployerApi* | [**getGroupMembershipsEmployer**](docs/Api/EmployerApi.md#getgroupmembershipsemployer) | **GET** /employers/{id}/groups | Get Employer Groups +*EmployerApi* | [**importCsvEmployer**](docs/Api/EmployerApi.md#importcsvemployer) | **POST** /employers/import | Import CSV +*EmployerApi* | [**indexEmployer**](docs/Api/EmployerApi.md#indexemployer) | **GET** /employers | List Employers +*EmployerApi* | [**listUsersEmployer**](docs/Api/EmployerApi.md#listusersemployer) | **GET** /employers/{id}/users | List Users +*EmployerApi* | [**removeUserEmployer**](docs/Api/EmployerApi.md#removeuseremployer) | **DELETE** /employers/{id}/users/{userId} | Remove User +*EmployerApi* | [**reviewYearEndEmployer**](docs/Api/EmployerApi.md#reviewyearendemployer) | **GET** /employers/{id}/YearEnd | Review Year End Changes +*EmployerApi* | [**rtiRequiringAttentionEmployer**](docs/Api/EmployerApi.md#rtirequiringattentionemployer) | **GET** /employers/{id}/rti/requiringattention | RTI Documents Requiring Attention +*EmployerApi* | [**searchEmployeesEmployer**](docs/Api/EmployerApi.md#searchemployeesemployer) | **GET** /employers/employees/search | Search Employees +*EmployerApi* | [**searchEmployer**](docs/Api/EmployerApi.md#searchemployer) | **GET** /employers/search | Search Employers +*EmployerApi* | [**setEvcOptInEmployer**](docs/Api/EmployerApi.md#setevcoptinemployer) | **PUT** /employers/{id}/evc | Update EVC OptIn +*EmployerApi* | [**setGroupMembershipsEmployer**](docs/Api/EmployerApi.md#setgroupmembershipsemployer) | **PUT** /employers/{id}/groups | Set Employer Groups +*EmployerApi* | [**setOwnerEmployer**](docs/Api/EmployerApi.md#setowneremployer) | **PUT** /employers/{id}/users/owner | Set Owner +*EmployerApi* | [**suggestPayCodeEmployer**](docs/Api/EmployerApi.md#suggestpaycodeemployer) | **GET** /employers/{id}/suggestPayrollCode | Suggest Payroll Code +*EmployerApi* | [**updateAutomationSettingsEmployer**](docs/Api/EmployerApi.md#updateautomationsettingsemployer) | **PUT** /employers/{id}/automation | Update Automation Settings +*EmployerApi* | [**updateCustomPayslipEmployer**](docs/Api/EmployerApi.md#updatecustompayslipemployer) | **POST** /employers/{id}/custompayslip | Update Payslip Customisations +*EmployerApi* | [**updateEmployer**](docs/Api/EmployerApi.md#updateemployer) | **PUT** /employers/{id} | Update an Employer +*EmployerApi* | [**updateEmployerOpeningBalancesEmployer**](docs/Api/EmployerApi.md#updateemployeropeningbalancesemployer) | **PUT** /employers/{id}/openingbalances | Update EmployerOpeningBalances +*EmployerApi* | [**updateLogoEmployer**](docs/Api/EmployerApi.md#updatelogoemployer) | **POST** /employers/{id}/logo | Update Employer Logo +*EmployerGroupApi* | [**createEmployerGroup**](docs/Api/EmployerGroupApi.md#createemployergroup) | **POST** /employers/groups | Create EmployerGroup +*EmployerGroupApi* | [**deleteEmployerGroup**](docs/Api/EmployerGroupApi.md#deleteemployergroup) | **DELETE** /employers/groups/{code} | Delete EmployerGroup +*EmployerGroupApi* | [**getEmployerGroup**](docs/Api/EmployerGroupApi.md#getemployergroup) | **GET** /employers/groups/{code} | Get EmployerGroup +*EmployerGroupApi* | [**indexEmployerGroup**](docs/Api/EmployerGroupApi.md#indexemployergroup) | **GET** /employers/groups | List EmployerGroups +*EmployerGroupApi* | [**updateEmployerGroup**](docs/Api/EmployerGroupApi.md#updateemployergroup) | **PUT** /employers/groups/{code} | Update EmployerGroup +*EmployerTemplateApi* | [**getEmployerTemplate**](docs/Api/EmployerTemplateApi.md#getemployertemplate) | **GET** /employers/{employerId}/templates/{type} | Get EmployerTemplate +*EmployerTemplateApi* | [**indexEmployerTemplate**](docs/Api/EmployerTemplateApi.md#indexemployertemplate) | **GET** /employers/{employerId}/templates | List EmployerTemplates +*EmployerTemplateApi* | [**updateEmployerTemplate**](docs/Api/EmployerTemplateApi.md#updateemployertemplate) | **PUT** /employers/{employerId}/templates/{type} | Update EmployerTemplate +*EngineApi* | [**calculateNiEngine**](docs/Api/EngineApi.md#calculateniengine) | **GET** /engine/ni | Calculate NI due. +*EngineApi* | [**calculateTaxEngine**](docs/Api/EngineApi.md#calculatetaxengine) | **GET** /engine/tax | Calculate Tax due +*EngineApi* | [**configEngine**](docs/Api/EngineApi.md#configengine) | **GET** /engine/config | Get Configuration +*EngineApi* | [**getNationalInsuranceThresholdsEngine**](docs/Api/EngineApi.md#getnationalinsurancethresholdsengine) | **GET** /engine/config/{taxYear}/ni/{payPeriod} | Get National Insurance Thresholds +*EngineApi* | [**getTenantBrandingEngine**](docs/Api/EngineApi.md#gettenantbrandingengine) | **GET** /engine/branding/{brandCode} | Tenant Branding +*EpsApi* | [**apprenticeshipLevyEps**](docs/Api/EpsApi.md#apprenticeshiplevyeps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/apprenticeshipLevytodate | Apprenticeship Levy +*EpsApi* | [**createEps**](docs/Api/EpsApi.md#createeps) | **POST** /employers/{employerId}/rti/eps/{taxYear} | Create EPS +*EpsApi* | [**deleteEps**](docs/Api/EpsApi.md#deleteeps) | **DELETE** /employers/{employerId}/rti/eps/{taxYear}/{id} | Delete Eps +*EpsApi* | [**getEps**](docs/Api/EpsApi.md#geteps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{id} | Get EPS +*EpsApi* | [**getXmlRequestEps**](docs/Api/EpsApi.md#getxmlrequesteps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{id}/xml/request | Get XML Request +*EpsApi* | [**listEps**](docs/Api/EpsApi.md#listeps) | **GET** /employers/{employerId}/rti/eps/{taxYear} | List EPS +*EpsApi* | [**markAsAcceptedEps**](docs/Api/EpsApi.md#markasacceptedeps) | **POST** /employers/{employerId}/rti/eps/{taxYear}/{id}/markasaccepted | Mark as Sent +*EpsApi* | [**recoverableAmountsEps**](docs/Api/EpsApi.md#recoverableamountseps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/recoverableamounts | Recoverable Amounts +*EpsApi* | [**requiringAttentionEps**](docs/Api/EpsApi.md#requiringattentioneps) | **GET** /employers/{employerId}/rti/eps/requiringattention | EPS Requiring Attention +*EpsApi* | [**submitEps**](docs/Api/EpsApi.md#submiteps) | **POST** /employers/{employerId}/rti/eps/{taxYear}/{id}/submit | Submit EPS +*EpsApi* | [**updateEps**](docs/Api/EpsApi.md#updateeps) | **PUT** /employers/{employerId}/rti/eps/{taxYear}/{id} | Update EPS +*ExbApi* | [**annualValuesExb**](docs/Api/ExbApi.md#annualvaluesexb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/values | Annual Values +*ExbApi* | [**createExb**](docs/Api/ExbApi.md#createexb) | **POST** /employers/{employerId}/rti/exb/{taxYear} | Create EXB +*ExbApi* | [**deleteExb**](docs/Api/ExbApi.md#deleteexb) | **DELETE** /employers/{employerId}/rti/exb/{taxYear}/{id} | Delete EXB +*ExbApi* | [**getExb**](docs/Api/ExbApi.md#getexb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/{id} | Get EXB +*ExbApi* | [**getXmlRequestExb**](docs/Api/ExbApi.md#getxmlrequestexb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/{id}/xml/request | Get XML Request +*ExbApi* | [**listExb**](docs/Api/ExbApi.md#listexb) | **GET** /employers/{employerId}/rti/exb/{taxYear} | List EXB +*ExbApi* | [**markAsAcceptedExb**](docs/Api/ExbApi.md#markasacceptedexb) | **POST** /employers/{employerId}/rti/exb/{taxYear}/{id}/markasaccepted | Mark as Sent +*ExbApi* | [**requiringAttentionExb**](docs/Api/ExbApi.md#requiringattentionexb) | **GET** /employers/{employerId}/rti/exb/requiringattention | EXB Requiring Attention +*ExbApi* | [**submitExb**](docs/Api/ExbApi.md#submitexb) | **POST** /employers/{employerId}/rti/exb/{taxYear}/{id}/submit | Submit EXB +*ExbApi* | [**updateExb**](docs/Api/ExbApi.md#updateexb) | **PUT** /employers/{employerId}/rti/exb/{taxYear}/{id} | Update EXB +*ExternalDataApi* | [**authorizeExternalData**](docs/Api/ExternalDataApi.md#authorizeexternaldata) | **GET** /employers/{employerId}/external-data/{id}/authorize | Get Authorization Url +*ExternalDataApi* | [**companiesExternalData**](docs/Api/ExternalDataApi.md#companiesexternaldata) | **GET** /employers/{employerId}/external-data/{id}/companies | List Companies +*ExternalDataApi* | [**disconnectExternalData**](docs/Api/ExternalDataApi.md#disconnectexternaldata) | **GET** /employers/{employerId}/external-data/{id}/disconnect | Disconnect +*ExternalDataApi* | [**employeeExternalData**](docs/Api/ExternalDataApi.md#employeeexternaldata) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId} | Get Employee +*ExternalDataApi* | [**employeeLogsExternalData**](docs/Api/ExternalDataApi.md#employeelogsexternaldata) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId}/logs | Get Employee Logs +*ExternalDataApi* | [**employeesExternalData**](docs/Api/ExternalDataApi.md#employeesexternaldata) | **GET** /employers/{employerId}/external-data/{id}/employees | List Employees +*ExternalDataApi* | [**getConfigDataExternalData**](docs/Api/ExternalDataApi.md#getconfigdataexternaldata) | **GET** /employers/{employerId}/external-data/{id}/config | Get Config Data +*ExternalDataApi* | [**importEmployeesExternalData**](docs/Api/ExternalDataApi.md#importemployeesexternaldata) | **POST** /employers/{employerId}/external-data/{id}/employees | Import Employees +*ExternalDataApi* | [**listExternalData**](docs/Api/ExternalDataApi.md#listexternaldata) | **GET** /employers/{employerId}/external-data | List Providers +*ExternalDataApi* | [**nominalCodesExternalData**](docs/Api/ExternalDataApi.md#nominalcodesexternaldata) | **GET** /employers/{employerId}/external-data/{id}/nominals | List Nominal Codes +*ExternalDataApi* | [**pensionContributionsCsvExternalData**](docs/Api/ExternalDataApi.md#pensioncontributionscsvexternaldata) | **GET** /employers/{employerId}/external-data/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber} | Contributions CSV File +*ExternalDataApi* | [**postJournalExternalData**](docs/Api/ExternalDataApi.md#postjournalexternaldata) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/journal | Post Journal +*ExternalDataApi* | [**postPaymentsExternalData**](docs/Api/ExternalDataApi.md#postpaymentsexternaldata) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/payments | Post Payments +*ExternalDataApi* | [**pushEmployeesExternalData**](docs/Api/ExternalDataApi.md#pushemployeesexternaldata) | **PUT** /employers/{employerId}/external-data/{id}/employees/push | Push Employees +*ExternalDataApi* | [**pushP11DExternalData**](docs/Api/ExternalDataApi.md#pushp11dexternaldata) | **POST** /employers/{employerId}/external-data/{id}/p11d | Push P11D +*ExternalDataApi* | [**pushP11DsExternalData**](docs/Api/ExternalDataApi.md#pushp11dsexternaldata) | **POST** /employers/{employerId}/external-data/{id}/p11ds | Push P11Ds +*ExternalDataApi* | [**pushP45ExternalData**](docs/Api/ExternalDataApi.md#pushp45externaldata) | **POST** /employers/{employerId}/external-data/{id}/p45 | Push P45 +*ExternalDataApi* | [**pushP45sExternalData**](docs/Api/ExternalDataApi.md#pushp45sexternaldata) | **POST** /employers/{employerId}/external-data/{id}/p45s | Push P45s +*ExternalDataApi* | [**pushP60ExternalData**](docs/Api/ExternalDataApi.md#pushp60externaldata) | **POST** /employers/{employerId}/external-data/{id}/p60 | Push P60 +*ExternalDataApi* | [**pushP60sExternalData**](docs/Api/ExternalDataApi.md#pushp60sexternaldata) | **POST** /employers/{employerId}/external-data/{id}/p60s | Push P60s +*ExternalDataApi* | [**pushPayslipsExternalData**](docs/Api/ExternalDataApi.md#pushpayslipsexternaldata) | **POST** /employers/{employerId}/external-data/{id}/payslips | Push Payslips +*ExternalDataApi* | [**pushPensionLetterExternalData**](docs/Api/ExternalDataApi.md#pushpensionletterexternaldata) | **POST** /employers/{employerId}/external-data/{id}/pension-letter | Push Pension Letter +*ExternalDataApi* | [**pushPensionLettersExternalData**](docs/Api/ExternalDataApi.md#pushpensionlettersexternaldata) | **POST** /employers/{employerId}/external-data/{id}/pension-letters | Push Pension Letters +*ExternalDataApi* | [**respondExternalData**](docs/Api/ExternalDataApi.md#respondexternaldata) | **GET** /external-data/{id}/respond | 3rd Party Response +*ExternalDataApi* | [**setConfigDataExternalData**](docs/Api/ExternalDataApi.md#setconfigdataexternaldata) | **PUT** /employers/{employerId}/external-data/{id}/config | Set Config Data +*ExternalDataApi* | [**setCredentialsExternalData**](docs/Api/ExternalDataApi.md#setcredentialsexternaldata) | **PUT** /employers/{employerId}/external-data/{id}/authorize | Set Credentials +*ExternalDataApi* | [**syncAllEmployeesExternalData**](docs/Api/ExternalDataApi.md#syncallemployeesexternaldata) | **GET** /employers/{employerId}/external-data/{id}/employees/i/sync-all | Sync Employees +*ExternalDataApi* | [**syncEmployeeExternalData**](docs/Api/ExternalDataApi.md#syncemployeeexternaldata) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId}/sync | Sync Employee +*ExternalDataApi* | [**syncLeaveExternalData**](docs/Api/ExternalDataApi.md#syncleaveexternaldata) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/leave | Sync Leave +*ExternalDataApi* | [**timeAndAttendanceExternalData**](docs/Api/ExternalDataApi.md#timeandattendanceexternaldata) | **GET** /employers/{employerId}/external-data/{id}/time-and-attendance | Get Time And Attendance Data +*ExternalDataApi* | [**updateEmployeeExternalData**](docs/Api/ExternalDataApi.md#updateemployeeexternaldata) | **PUT** /employers/{employerId}/external-data/{id}/employees/{employeeId} | Update Employee +*FpsApi* | [**createFps**](docs/Api/FpsApi.md#createfps) | **POST** /employers/{employerId}/rti/fps/{taxYear} | Create FPS +*FpsApi* | [**deleteFps**](docs/Api/FpsApi.md#deletefps) | **DELETE** /employers/{employerId}/rti/fps/{taxYear}/{id} | Delete FPS +*FpsApi* | [**getFps**](docs/Api/FpsApi.md#getfps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/{id} | Get FPS +*FpsApi* | [**getXmlRequestFps**](docs/Api/FpsApi.md#getxmlrequestfps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/{id}/xml/request | Get XML Request +*FpsApi* | [**listFps**](docs/Api/FpsApi.md#listfps) | **GET** /employers/{employerId}/rti/fps/{taxYear} | List FPS +*FpsApi* | [**markAsAcceptedFps**](docs/Api/FpsApi.md#markasacceptedfps) | **POST** /employers/{employerId}/rti/fps/{taxYear}/{id}/markasaccepted | Mark as Sent +*FpsApi* | [**mostRecentForEmployeeFps**](docs/Api/FpsApi.md#mostrecentforemployeefps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/mostrecentforemployee/{employeeId} | Get most recent FPS for Employee +*FpsApi* | [**requiringAttentionFps**](docs/Api/FpsApi.md#requiringattentionfps) | **GET** /employers/{employerId}/rti/fps/requiringattention | FPS Requiring Attention +*FpsApi* | [**submitFps**](docs/Api/FpsApi.md#submitfps) | **POST** /employers/{employerId}/rti/fps/{taxYear}/{id}/submit | Submit FPS +*FpsApi* | [**updateFps**](docs/Api/FpsApi.md#updatefps) | **PUT** /employers/{employerId}/rti/fps/{taxYear}/{id} | Update FPS +*HmrcPaymentApi* | [**bankPaymentHmrcPayment**](docs/Api/HmrcPaymentApi.md#bankpaymenthmrcpayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}/bankpayment | HMRC Bank Payment +*HmrcPaymentApi* | [**getHmrcPayment**](docs/Api/HmrcPaymentApi.md#gethmrcpayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding} | Get HmrcLiability +*HmrcPaymentApi* | [**indexHmrcPayment**](docs/Api/HmrcPaymentApi.md#indexhmrcpayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear} | List HmrcLiabilities +*HmrcPaymentApi* | [**updateHmrcPayment**](docs/Api/HmrcPaymentApi.md#updatehmrcpayment) | **PUT** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding} | Update HmrcLiability +*HolidaySchemeApi* | [**createHolidayScheme**](docs/Api/HolidaySchemeApi.md#createholidayscheme) | **POST** /employers/{employerId}/holidayscheme | Create holiday scheme +*HolidaySchemeApi* | [**deleteHolidayScheme**](docs/Api/HolidaySchemeApi.md#deleteholidayscheme) | **DELETE** /employers/{employerId}/holidayscheme/{id} | Delete holiday scheme +*HolidaySchemeApi* | [**getByIdHolidayScheme**](docs/Api/HolidaySchemeApi.md#getbyidholidayscheme) | **GET** /employers/{employerId}/holidayscheme/{id} | Get holiday scheme by Id +*HolidaySchemeApi* | [**getHolidayScheme**](docs/Api/HolidaySchemeApi.md#getholidayscheme) | **GET** /employers/{employerId}/holidayscheme | Get holiday scheme +*HolidaySchemeApi* | [**updateHolidayScheme**](docs/Api/HolidaySchemeApi.md#updateholidayscheme) | **PUT** /employers/{employerId}/holidayscheme/{id} | Update holiday scheme +*ImportApi* | [**createPaymentsCsvMappingImport**](docs/Api/ImportApi.md#createpaymentscsvmappingimport) | **POST** /employers/{employerId}/import/payments/mappings | Create PaymentsCsvMapping +*ImportApi* | [**deletePaymentCsvMappingImport**](docs/Api/ImportApi.md#deletepaymentcsvmappingimport) | **DELETE** /employers/{employerId}/import/payments/mappings/{id} | Delete PaymentsCsvMapping +*ImportApi* | [**employeeImportCsvImport**](docs/Api/ImportApi.md#employeeimportcsvimport) | **POST** /employers/{employerId}/import/employees/async | Import Employees Asynchronously (Beta) +*ImportApi* | [**importEmployeePayImport**](docs/Api/ImportApi.md#importemployeepayimport) | **POST** /employers/{employerId}/import/pay | Import Pay To Employee +*ImportApi* | [**importLeaveImport**](docs/Api/ImportApi.md#importleaveimport) | **POST** /employers/{employerId}/import/leave | Import Leave Asynchronously +*ImportApi* | [**importPensionMembershipsImport**](docs/Api/ImportApi.md#importpensionmembershipsimport) | **POST** /employers/{employerId}/import/pensionmemberships | Import PensionMemberships from csv file +*ImportApi* | [**importRolesImport**](docs/Api/ImportApi.md#importrolesimport) | **POST** /employers/{employerId}/import/import | Import EmployeeRoles from csv file +*ImportApi* | [**listPaymentsCsvMappingsImport**](docs/Api/ImportApi.md#listpaymentscsvmappingsimport) | **GET** /employers/{employerId}/import/payments/mappings | List PaymentsCsvMappings +*ImportApi* | [**paymentsCsvMappingCsvFileImport**](docs/Api/ImportApi.md#paymentscsvmappingcsvfileimport) | **GET** /employers/{employerId}/import/payments/mappings/{id}/csv | Get PaymentsCsvMapping CSV File +*ImportApi* | [**paymentsCsvMappingImport**](docs/Api/ImportApi.md#paymentscsvmappingimport) | **GET** /employers/{employerId}/import/payments/mappings/{id} | Get PaymentsCsvMapping +*ImportApi* | [**updatePaymentsCsvMappingImport**](docs/Api/ImportApi.md#updatepaymentscsvmappingimport) | **PUT** /employers/{employerId}/import/payments/mappings/{id} | Update PaymentsCsvMapping +*InvitationApi* | [**acceptInvitation**](docs/Api/InvitationApi.md#acceptinvitation) | **POST** /invitations/{id} | Accept Invitation +*InvitationApi* | [**createInvitation**](docs/Api/InvitationApi.md#createinvitation) | **POST** /employers/{employerId}/invitation | Create Invitation +*InvitationApi* | [**deleteInvitation**](docs/Api/InvitationApi.md#deleteinvitation) | **DELETE** /employers/{employerId}/invitation/{id} | Delete Invitation +*InvitationApi* | [**getInvitation**](docs/Api/InvitationApi.md#getinvitation) | **GET** /employers/{employerId}/invitation/{id} | Get Invitation +*InvitationApi* | [**indexInvitation**](docs/Api/InvitationApi.md#indexinvitation) | **GET** /employers/{employerId}/invitation | List Invitations +*JobApi* | [**deleteCompletedJobsJob**](docs/Api/JobApi.md#deletecompletedjobsjob) | **DELETE** /jobs/completed | Delete Completed Jobs +*JobApi* | [**getJobErrorsByJobIdJob**](docs/Api/JobApi.md#getjoberrorsbyjobidjob) | **GET** /jobs/{jobId}/errors | Get Job Errors +*JobApi* | [**getJobJob**](docs/Api/JobApi.md#getjobjob) | **GET** /jobs/{jobId} | Get Job +*JobApi* | [**getJobsListJob**](docs/Api/JobApi.md#getjobslistjob) | **GET** /jobs | List Jobs +*JobApi* | [**getReportJobResultJob**](docs/Api/JobApi.md#getreportjobresultjob) | **GET** /jobs/{jobId}/document | Get Job file +*JournalTemplateApi* | [**createJournalTemplate**](docs/Api/JournalTemplateApi.md#createjournaltemplate) | **POST** /employers/{employerId}/journaltemplate | Create Journal Template +*JournalTemplateApi* | [**getJournalTemplate**](docs/Api/JournalTemplateApi.md#getjournaltemplate) | **GET** /employers/{employerId}/journaltemplate | Get Journal Template +*JournalTemplateApi* | [**updateJournalTemplate**](docs/Api/JournalTemplateApi.md#updatejournaltemplate) | **PUT** /employers/{employerId}/journaltemplate/{id} | Update Journal Template +*JournalTokenApi* | [**createCostCentreJournalOverridesJournalToken**](docs/Api/JournalTokenApi.md#createcostcentrejournaloverridesjournaltoken) | **POST** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | Create CostCentre Journal Overrides +*JournalTokenApi* | [**createDepartmentJournalOverridesJournalToken**](docs/Api/JournalTokenApi.md#createdepartmentjournaloverridesjournaltoken) | **POST** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | Create Department Journal Overrides +*JournalTokenApi* | [**createJournalToken**](docs/Api/JournalTokenApi.md#createjournaltoken) | **POST** /employers/{employerId}/journaltokens | Create Journal Token +*JournalTokenApi* | [**deleteJournalToken**](docs/Api/JournalTokenApi.md#deletejournaltoken) | **DELETE** /employers/{employerId}/journaltokens/{id} | Delete Journal Token +*JournalTokenApi* | [**getCostCentreJournalOverridesListJournalToken**](docs/Api/JournalTokenApi.md#getcostcentrejournaloverrideslistjournaltoken) | **GET** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | List CostCentre Journal Overrides +*JournalTokenApi* | [**getDepartmentJournalOverridesListJournalToken**](docs/Api/JournalTokenApi.md#getdepartmentjournaloverrideslistjournaltoken) | **GET** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | List Department Journal Overrides +*JournalTokenApi* | [**getJournalToken**](docs/Api/JournalTokenApi.md#getjournaltoken) | **GET** /employers/{employerId}/journaltokens/{id} | Get Journal Token +*JournalTokenApi* | [**indexJournalToken**](docs/Api/JournalTokenApi.md#indexjournaltoken) | **GET** /employers/{employerId}/journaltokens | List Journal Tokens +*JournalTokenApi* | [**updateCostCentreJournalOverridesJournalToken**](docs/Api/JournalTokenApi.md#updatecostcentrejournaloverridesjournaltoken) | **PUT** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | Update CostCentre Journal Overrides +*JournalTokenApi* | [**updateDepartmentJournalOverridesJournalToken**](docs/Api/JournalTokenApi.md#updatedepartmentjournaloverridesjournaltoken) | **PUT** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | Update Department Journal Overrides +*JournalTokenApi* | [**updateJournalToken**](docs/Api/JournalTokenApi.md#updatejournaltoken) | **PUT** /employers/{employerId}/journaltokens/{id} | Update Journal Token +*LeaveApi* | [**addDocumentLeave**](docs/Api/LeaveApi.md#adddocumentleave) | **POST** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents | Add Document +*LeaveApi* | [**createLeave**](docs/Api/LeaveApi.md#createleave) | **POST** /employers/{employerId}/employees/{employeeId}/leave | Create Leave +*LeaveApi* | [**deleteDocumentLeave**](docs/Api/LeaveApi.md#deletedocumentleave) | **DELETE** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId} | Delete Leave Document +*LeaveApi* | [**deleteLeave**](docs/Api/LeaveApi.md#deleteleave) | **DELETE** /employers/{employerId}/employees/{employeeId}/leave/{id} | Delete Leave +*LeaveApi* | [**findLinkedPiwLeave**](docs/Api/LeaveApi.md#findlinkedpiwleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/findlinkedpiw | Find Linked Piw +*LeaveApi* | [**getDocumentLeave**](docs/Api/LeaveApi.md#getdocumentleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId} | Get Leave Document +*LeaveApi* | [**getLeave**](docs/Api/LeaveApi.md#getleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/{id} | Get Leave +*LeaveApi* | [**getMaternityLeaveScheduleLeave**](docs/Api/LeaveApi.md#getmaternityleavescheduleleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/statutorymaternityschedule | List Statutory Maternity Leave History +*LeaveApi* | [**getOccupationalMaternityScheduleLeave**](docs/Api/LeaveApi.md#getoccupationalmaternityscheduleleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/occupationalmaternityschedule/{id} | List occupational Maternity Leave History +*LeaveApi* | [**indexLeave**](docs/Api/LeaveApi.md#indexleave) | **GET** /employers/{employerId}/employees/{employeeId}/leave | List Leave +*LeaveApi* | [**updateLeave**](docs/Api/LeaveApi.md#updateleave) | **PUT** /employers/{employerId}/employees/{employeeId}/leave/{id} | Update Leave +*LoanApi* | [**addDocumentLoan**](docs/Api/LoanApi.md#adddocumentloan) | **POST** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents | Add Document +*LoanApi* | [**createLoan**](docs/Api/LoanApi.md#createloan) | **POST** /employers/{employerId}/employees/{employeeId}/loans | Create Loan +*LoanApi* | [**deleteDocumentLoan**](docs/Api/LoanApi.md#deletedocumentloan) | **DELETE** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId} | Delete Loan Document +*LoanApi* | [**deleteLoan**](docs/Api/LoanApi.md#deleteloan) | **DELETE** /employers/{employerId}/employees/{employeeId}/loans/{id} | Delete Loan +*LoanApi* | [**getDocumentLoan**](docs/Api/LoanApi.md#getdocumentloan) | **GET** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId} | Get Loan Document +*LoanApi* | [**getLoan**](docs/Api/LoanApi.md#getloan) | **GET** /employers/{employerId}/employees/{employeeId}/loans/{id} | Get Loan +*LoanApi* | [**indexLoan**](docs/Api/LoanApi.md#indexloan) | **GET** /employers/{employerId}/employees/{employeeId}/loans | List Loans +*LoanApi* | [**updateLoan**](docs/Api/LoanApi.md#updateloan) | **PUT** /employers/{employerId}/employees/{employeeId}/loans/{id} | Update Loan +*NoteApi* | [**addDocumentNote**](docs/Api/NoteApi.md#adddocumentnote) | **POST** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents | Add Document +*NoteApi* | [**createNote**](docs/Api/NoteApi.md#createnote) | **POST** /employers/{employerId}/employees/{employeeId}/notes | Create Note +*NoteApi* | [**deleteDocumentNote**](docs/Api/NoteApi.md#deletedocumentnote) | **DELETE** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId} | Delete Note Document +*NoteApi* | [**deleteNote**](docs/Api/NoteApi.md#deletenote) | **DELETE** /employers/{employerId}/employees/{employeeId}/notes/{id} | Delete Note +*NoteApi* | [**getDocumentNote**](docs/Api/NoteApi.md#getdocumentnote) | **GET** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId} | Get Note Document +*NoteApi* | [**getNote**](docs/Api/NoteApi.md#getnote) | **GET** /employers/{employerId}/employees/{employeeId}/notes/{id} | Get Note +*NoteApi* | [**indexNote**](docs/Api/NoteApi.md#indexnote) | **GET** /employers/{employerId}/employees/{employeeId}/notes | List Notes +*NoteApi* | [**updateNote**](docs/Api/NoteApi.md#updatenote) | **PUT** /employers/{employerId}/employees/{employeeId}/notes/{id} | Update Note +*NvrApi* | [**createNvr**](docs/Api/NvrApi.md#createnvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear} | Create NVR +*NvrApi* | [**deleteNvr**](docs/Api/NvrApi.md#deletenvr) | **DELETE** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Delete NVR +*NvrApi* | [**getNvr**](docs/Api/NvrApi.md#getnvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Get NVR +*NvrApi* | [**getXmlRequestNvr**](docs/Api/NvrApi.md#getxmlrequestnvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear}/{id}/xml/request | Get XML Request +*NvrApi* | [**listNvr**](docs/Api/NvrApi.md#listnvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear} | List NVR +*NvrApi* | [**markAsAcceptedNvr**](docs/Api/NvrApi.md#markasacceptednvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear}/{id}/markasaccepted | Mark as Sent +*NvrApi* | [**requiringAttentionNvr**](docs/Api/NvrApi.md#requiringattentionnvr) | **GET** /employers/{employerId}/rti/nvr/requiringattention | NVR Requiring Attention +*NvrApi* | [**submitNvr**](docs/Api/NvrApi.md#submitnvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear}/{id}/submit | Submit an existing NVR +*NvrApi* | [**updateNvr**](docs/Api/NvrApi.md#updatenvr) | **PUT** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Update NVR +*OccupationalPolicyApi* | [**createOccupationalPolicy**](docs/Api/OccupationalPolicyApi.md#createoccupationalpolicy) | **POST** /employers/{employerId}/occupationalpolicies | Create Occupational Policy +*OccupationalPolicyApi* | [**deleteOccupationalPolicy**](docs/Api/OccupationalPolicyApi.md#deleteoccupationalpolicy) | **DELETE** /employers/{employerId}/occupationalpolicies/{id} | Delete Occupational Policy +*OccupationalPolicyApi* | [**getOccupationalPolicy**](docs/Api/OccupationalPolicyApi.md#getoccupationalpolicy) | **GET** /employers/{employerId}/occupationalpolicies/{id} | Get Occupational Policy +*OccupationalPolicyApi* | [**indexOccupationalPolicy**](docs/Api/OccupationalPolicyApi.md#indexoccupationalpolicy) | **GET** /employers/{employerId}/occupationalpolicies | List Occupational Policies +*OccupationalPolicyApi* | [**updateOccupationalPolicy**](docs/Api/OccupationalPolicyApi.md#updateoccupationalpolicy) | **PUT** /employers/{employerId}/occupationalpolicies/{id} | Update Occupational Policy +*OccupationalSickLeaveHistoryApi* | [**createOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#createoccupationalsickleavehistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId} | Create OccupationalSickLeaveHistory +*OccupationalSickLeaveHistoryApi* | [**deleteOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#deleteoccupationalsickleavehistory) | **DELETE** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Delete OccupationalSickLeaveHistory +*OccupationalSickLeaveHistoryApi* | [**getOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#getoccupationalsickleavehistory) | **GET** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Get OccupationalSickLeaveHistory +*OccupationalSickLeaveHistoryApi* | [**importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#importoccupationalsickleavehistorycsvoccupationalsickleavehistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/importfile | Import OccupationalSickLeaveHistory from csv file +*OccupationalSickLeaveHistoryApi* | [**occupationalSickLeaveHistoryOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#occupationalsickleavehistoryoccupationalsickleavehistory) | **GET** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId} | List OccupationalSickLeaveHistory +*OccupationalSickLeaveHistoryApi* | [**updateOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#updateoccupationalsickleavehistory) | **PUT** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Update OccupationalSickLeaveHistory +*OccupationalSickLeaveHistoryApi* | [**uploadOSPHistoryOccupationalSickLeaveHistory**](docs/Api/OccupationalSickLeaveHistoryApi.md#uploadosphistoryoccupationalsickleavehistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/import | Upload OccupationalSickLeaveHistory +*OpeningBalancesApi* | [**createNicSummaryOpeningBalances**](docs/Api/OpeningBalancesApi.md#createnicsummaryopeningbalances) | **POST** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Create NicSummary +*OpeningBalancesApi* | [**deleteNicSummaryOpeningBalances**](docs/Api/OpeningBalancesApi.md#deletenicsummaryopeningbalances) | **DELETE** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Delete NicSummary +*OpeningBalancesApi* | [**getNicSummariesOpeningBalances**](docs/Api/OpeningBalancesApi.md#getnicsummariesopeningbalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Get NicSummaries +*OpeningBalancesApi* | [**getNicSummaryOpeningBalances**](docs/Api/OpeningBalancesApi.md#getnicsummaryopeningbalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Get NicSummary +*OpeningBalancesApi* | [**getOpeningBalances**](docs/Api/OpeningBalancesApi.md#getopeningbalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances | Get Opening Balances +*OpeningBalancesApi* | [**getOpeningBalancesTotalsOpeningBalances**](docs/Api/OpeningBalancesApi.md#getopeningbalancestotalsopeningbalances) | **GET** /employers/{employerId}/employees/openingbalances/{taxYear} | Totals of employee opening balances for a tax year +*OpeningBalancesApi* | [**updateNicSummariesOpeningBalances**](docs/Api/OpeningBalancesApi.md#updatenicsummariesopeningbalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Update NicSummaries +*OpeningBalancesApi* | [**updateNicSummaryOpeningBalances**](docs/Api/OpeningBalancesApi.md#updatenicsummaryopeningbalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Update NicSummary +*OpeningBalancesApi* | [**updateOpeningBalances**](docs/Api/OpeningBalancesApi.md#updateopeningbalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances | Update Opening Balances +*OpeningBalancesApi* | [**updateP45OpeningBalances**](docs/Api/OpeningBalancesApi.md#updatep45openingbalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/p45 | Update P45 Value +*OpeningBalancesApi* | [**updateTerminationPaymentsOpeningBalances**](docs/Api/OpeningBalancesApi.md#updateterminationpaymentsopeningbalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/terminationpayments | Update Termination Pay +*P11HistoryApi* | [**createP11History**](docs/Api/P11HistoryApi.md#createp11history) | **POST** /employers/{employerId}/employees/{employeeId}/p11history | Create P11 Historical data +*P11HistoryApi* | [**deleteP11History**](docs/Api/P11HistoryApi.md#deletep11history) | **DELETE** /employers/{employerId}/employees/{employeeId}/p11history/{id} | Delete P11 Historical data +*P11HistoryApi* | [**listPagedP11History**](docs/Api/P11HistoryApi.md#listpagedp11history) | **GET** /employers/{employerId}/employees/{employeeId}/p11history | Retrieve P11 Historical data +*P11HistoryApi* | [**updateP11History**](docs/Api/P11HistoryApi.md#updatep11history) | **PUT** /employers/{employerId}/employees/{employeeId}/p11history/{id} | Update P11 Historical entry +*PayCodeApi* | [**createPayCode**](docs/Api/PayCodeApi.md#createpaycode) | **POST** /employers/{employerId}/paycodes | Create PayCode +*PayCodeApi* | [**deletePayCode**](docs/Api/PayCodeApi.md#deletepaycode) | **DELETE** /employers/{employerId}/paycodes/{code} | Delete PayCode (deprecated) +*PayCodeApi* | [**deletePayCodePayCode**](docs/Api/PayCodeApi.md#deletepaycodepaycode) | **DELETE** /employers/{employerId}/paycodes/paycode | Delete PayCode +*PayCodeApi* | [**getPayCode**](docs/Api/PayCodeApi.md#getpaycode) | **GET** /employers/{employerId}/paycodes/{code} | Get PayCode (deprecated) +*PayCodeApi* | [**getPayCodePayCode**](docs/Api/PayCodeApi.md#getpaycodepaycode) | **GET** /employers/{employerId}/paycodes/paycode | Get PayCode +*PayCodeApi* | [**indexPayCode**](docs/Api/PayCodeApi.md#indexpaycode) | **GET** /employers/{employerId}/paycodes | List PayCodes +*PayCodeApi* | [**nominalCodeMappingsPayCode**](docs/Api/PayCodeApi.md#nominalcodemappingspaycode) | **GET** /employers/{employerId}/paycodes/nominalcodes | Get Nominal Code Mappings +*PayCodeApi* | [**updateNominalCodeMappingsPayCode**](docs/Api/PayCodeApi.md#updatenominalcodemappingspaycode) | **PUT** /employers/{employerId}/paycodes/nominalcodes | Updates Nominal Code Mappings +*PayCodeApi* | [**updatePayCode**](docs/Api/PayCodeApi.md#updatepaycode) | **PUT** /employers/{employerId}/paycodes/{code} | Update PayCode (deprecated) +*PayCodeApi* | [**updatePayCodePayCode**](docs/Api/PayCodeApi.md#updatepaycodepaycode) | **PUT** /employers/{employerId}/paycodes/paycode | Update PayCode +*PayCodeSetApi* | [**createPayCodeSet**](docs/Api/PayCodeSetApi.md#createpaycodeset) | **POST** /employers/{employerId}/paycodesets | Create PayCodeSet +*PayCodeSetApi* | [**deletePayCodeSet**](docs/Api/PayCodeSetApi.md#deletepaycodeset) | **DELETE** /employers/{employerId}/paycodesets/{id} | Delete PayCodeSet +*PayCodeSetApi* | [**getPayCodeSet**](docs/Api/PayCodeSetApi.md#getpaycodeset) | **GET** /employers/{employerId}/paycodesets/{id} | Get PayCodeSet +*PayCodeSetApi* | [**indexPayCodeSet**](docs/Api/PayCodeSetApi.md#indexpaycodeset) | **GET** /employers/{employerId}/paycodesets | List PayCodeSets +*PayCodeSetApi* | [**updatePayCodeSet**](docs/Api/PayCodeSetApi.md#updatepaycodeset) | **PUT** /employers/{employerId}/paycodesets/{id} | Update PayCodeSet +*PayRunApi* | [**addPayRunEntriesPayRun**](docs/Api/PayRunApi.md#addpayrunentriespayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/addpayrunentries | Add PayRunEntries (deprecated) +*PayRunApi* | [**aeoPayRun**](docs/Api/PayRunApi.md#aeopayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/aeo | List AttachmentOrders related to a PayRun +*PayRunApi* | [**calculateAverageHolidayPayPayRun**](docs/Api/PayRunApi.md#calculateaverageholidaypaypayrun) | **GET** /employers/{employerId}/payrun/employees/{employeeId}/averageholidaypayrate | Calculate Average Holiday Pay Rate +*PayRunApi* | [**changesForPayRunEntryPayRun**](docs/Api/PayRunApi.md#changesforpayrunentrypayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/changes | List PayRun Changes for PayRunEntry +*PayRunApi* | [**changesPayRun**](docs/Api/PayRunApi.md#changespayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/changes | List PayRun Changes +*PayRunApi* | [**createNextPayRunPayRun**](docs/Api/PayRunApi.md#createnextpayrunpayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | Starts the next PayRun +*PayRunApi* | [**deletePayRun**](docs/Api/PayRunApi.md#deletepayrun) | **DELETE** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Delete a PayRun +*PayRunApi* | [**emailMultipleP45sPayRun**](docs/Api/PayRunApi.md#emailmultiplep45spayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/p45/email | (Re)send P45 Emails +*PayRunApi* | [**finalisePayRunPayRun**](docs/Api/PayRunApi.md#finalisepayrunpayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/finalise | Finalise a PayRun (deprecated) +*PayRunApi* | [**getPayRunEntryPayRun**](docs/Api/PayRunApi.md#getpayrunentrypayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id} | Get a PayRunEntry +*PayRunApi* | [**getPayRunEventsPayRun**](docs/Api/PayRunApi.md#getpayruneventspayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/events | Get PayPeriodEvents +*PayRunApi* | [**getPayRunJournalPayRun**](docs/Api/PayRunApi.md#getpayrunjournalpayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/journal | Get Journal for PayRun +*PayRunApi* | [**getPayRunPayCodesPayRun**](docs/Api/PayRunApi.md#getpayrunpaycodespayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paycodes | Get PayCodes for a PayRun +*PayRunApi* | [**getPayRunPayRun**](docs/Api/PayRunApi.md#getpayrunpayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Get a PayRun +*PayRunApi* | [**getPayRunStateHistoryPayRun**](docs/Api/PayRunApi.md#getpayrunstatehistorypayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/stateHistory | List PayRunStateHistory +*PayRunApi* | [**getPayRunWarningsPayRun**](docs/Api/PayRunApi.md#getpayrunwarningspayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/warnings | Get PayRun Warnings +*PayRunApi* | [**getPayRunsPayRun**](docs/Api/PayRunApi.md#getpayrunspayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | List PayRuns +*PayRunApi* | [**importPayPayRun**](docs/Api/PayRunApi.md#importpaypayrun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importpay | Import Pay +*PayRunApi* | [**importTimeAndAttendancePayRun**](docs/Api/PayRunApi.md#importtimeandattendancepayrun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importtimeandattendance | Import Time And Attendance +*PayRunApi* | [**importUmbrellaPayPayRun**](docs/Api/PayRunApi.md#importumbrellapaypayrun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importumbrellapay | Import Umbrella Pay +*PayRunApi* | [**lastPayRunEntryForEmployeePayRun**](docs/Api/PayRunApi.md#lastpayrunentryforemployeepayrun) | **GET** /employers/{employerId}/payrun/employees/{employeeId}/Last | Gets the last closed pay run entry for an employee. +*PayRunApi* | [**lastPayRunEntryWithPensionYtdValuesForEmployeePayRun**](docs/Api/PayRunApi.md#lastpayrunentrywithpensionytdvaluesforemployeepayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/employees/{employeeId}/pension/{pensionUniqueId}/pensionytd | Gets last PayRunEntry for a Pension +*PayRunApi* | [**leavePayRun**](docs/Api/PayRunApi.md#leavepayrun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/leave | List Leave related to a PayRun +*PayRunApi* | [**payRunEntryUmbrellaPaymentPayRun**](docs/Api/PayRunApi.md#payrunentryumbrellapaymentpayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/umbrella | PayRunEntry Umbrella Payment +*PayRunApi* | [**reOpenPayRunPayRun**](docs/Api/PayRunApi.md#reopenpayrunpayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/reopen | Re-open a PayRun (deprecated) +*PayRunApi* | [**removePayRunEntriesPayRun**](docs/Api/PayRunApi.md#removepayrunentriespayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/removepayrunentries | Remove PayRunEntries (deprecated) +*PayRunApi* | [**sendPayslipEmailsPayRun**](docs/Api/PayRunApi.md#sendpayslipemailspayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/email | (Re)send Payslip Emails +*PayRunApi* | [**startNextPayRunPayRun**](docs/Api/PayRunApi.md#startnextpayrunpayrun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | Starts the next PayRun (deprecated) +*PayRunApi* | [**updatePayRunEntryPayRun**](docs/Api/PayRunApi.md#updatepayrunentrypayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id} | Update a PayRunEntry +*PayRunApi* | [**updatePayRunPayRun**](docs/Api/PayRunApi.md#updatepayrunpayrun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Update PayRun +*PayRunApi* | [**updatePaymentDatePayRun**](docs/Api/PayRunApi.md#updatepaymentdatepayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paymentdate | Set PaymentDate +*PayRunApi* | [**ytdPayRun**](docs/Api/PayRunApi.md#ytdpayrun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/ytd | Update YTD +*PayRunApi* | [**zeroisePayRunEntriesPayRun**](docs/Api/PayRunApi.md#zeroisepayrunentriespayrun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/zeroise | Zeroise PayRunEntries +*PayRunAsyncApi* | [**importPayPayRunAsync**](docs/Api/PayRunAsyncApi.md#importpaypayrunasync) | **POST** /employers/{employerId}/payrun-async/{payPeriod}/importpay | Import Pay (beta) +*PayRunAsyncApi* | [**queueCreatePayRunPayRunAsync**](docs/Api/PayRunAsyncApi.md#queuecreatepayrunpayrunasync) | **POST** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod} | Registers a request to start the next PayRun (beta) +*PayRunAsyncApi* | [**queueDeletePayRunPayRunAsync**](docs/Api/PayRunAsyncApi.md#queuedeletepayrunpayrunasync) | **DELETE** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber} | Registers a request to delete a PayRun (beta) +*PayRunAsyncApi* | [**queueUpdatePayRunPayRunAsync**](docs/Api/PayRunAsyncApi.md#queueupdatepayrunpayrunasync) | **PUT** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber} | Registers a request to update the PayRun (beta) +*PayScheduleApi* | [**createPaySchedule**](docs/Api/PayScheduleApi.md#createpayschedule) | **POST** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Create a PaySchedule +*PayScheduleApi* | [**createWithOptionalOrdinalPaySchedule**](docs/Api/PayScheduleApi.md#createwithoptionalordinalpayschedule) | **POST** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Create a PaySchedule (deprecated) +*PayScheduleApi* | [**deletePaySchedule**](docs/Api/PayScheduleApi.md#deletepayschedule) | **DELETE** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Delete PaySchedule +*PayScheduleApi* | [**deleteWithOptionalOrdinalPaySchedule**](docs/Api/PayScheduleApi.md#deletewithoptionalordinalpayschedule) | **DELETE** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Delete PaySchedule (deprecated) +*PayScheduleApi* | [**getAllPaySchedule**](docs/Api/PayScheduleApi.md#getallpayschedule) | **GET** /employers/{employerId}/schedules/{taxYear} | Get PaySchedules +*PayScheduleApi* | [**getPaySchedule**](docs/Api/PayScheduleApi.md#getpayschedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Get PaySchedule +*PayScheduleApi* | [**getPeriodsPaySchedule**](docs/Api/PayScheduleApi.md#getperiodspayschedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods | Get PaySchedulePeriods +*PayScheduleApi* | [**getWithOptionalOrdinalPaySchedule**](docs/Api/PayScheduleApi.md#getwithoptionalordinalpayschedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Get PaySchedule (deprecated) +*PayScheduleApi* | [**savePaySchedule**](docs/Api/PayScheduleApi.md#savepayschedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Update PaySchedule +*PayScheduleApi* | [**saveWithOptionalOrdinalPaySchedule**](docs/Api/PayScheduleApi.md#savewithoptionalordinalpayschedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Update PaySchedule (deprecated) +*PayScheduleApi* | [**updatePaySchedulePeriodPaySchedule**](docs/Api/PayScheduleApi.md#updatepayscheduleperiodpayschedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods/{periodNumber} | Update PaySchedulePeriod +*PaySpineApi* | [**createAllowanceGradesPaySpine**](docs/Api/PaySpineApi.md#createallowancegradespayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | Create AllowanceGrade +*PaySpineApi* | [**createLondonAllowancePaySpine**](docs/Api/PaySpineApi.md#createlondonallowancepayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/londonallowances | Create LondonAllowance +*PaySpineApi* | [**createMultipleAllowanceGradesPaySpine**](docs/Api/PaySpineApi.md#createmultipleallowancegradespayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/create/bulk | Create Multiple AllowanceGrades +*PaySpineApi* | [**createMultiplePaySpine**](docs/Api/PaySpineApi.md#createmultiplepayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk | Create Multiple SpinalPoints +*PaySpineApi* | [**createMultipleSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#createmultiplespineallowancepayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/create/bulk | Create Multiple SpineAllowances +*PaySpineApi* | [**createPaySpine**](docs/Api/PaySpineApi.md#createpayspine) | **POST** /employers/{employerId}/payspines | Create PaySpine +*PaySpineApi* | [**createPaySpineGradePaySpine**](docs/Api/PaySpineApi.md#createpayspinegradepayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/paygrades | Create PaySpine Grade +*PaySpineApi* | [**createSpinalPointPaySpine**](docs/Api/PaySpineApi.md#createspinalpointpayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | Create SpinalPoint +*PaySpineApi* | [**createSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#createspineallowancepayspine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances | Create SpineAllowance +*PaySpineApi* | [**deleteAllAllowanceGradesPaySpine**](docs/Api/PaySpineApi.md#deleteallallowancegradespayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | Delete All AllowanceGrades Associated with a PaySpine +*PaySpineApi* | [**deleteAllSpinalPointsPaySpine**](docs/Api/PaySpineApi.md#deleteallspinalpointspayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | Delete All SpinalPoints Associated with a PaySpine +*PaySpineApi* | [**deleteAllSpineAllowancesPaySpine**](docs/Api/PaySpineApi.md#deleteallspineallowancespayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances | Delete All SpineAllowances Associated with a PaySpine +*PaySpineApi* | [**deleteAllowanceGradePaySpine**](docs/Api/PaySpineApi.md#deleteallowancegradepayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Delete AllowanceGrade +*PaySpineApi* | [**deleteLondonAllowancePaySpine**](docs/Api/PaySpineApi.md#deletelondonallowancepayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Delete LondonAllowance +*PaySpineApi* | [**deletePaySpine**](docs/Api/PaySpineApi.md#deletepayspine) | **DELETE** /employers/{employerId}/payspines/{id} | Delete PaySpine +*PaySpineApi* | [**deletePaySpineGradePaySpine**](docs/Api/PaySpineApi.md#deletepayspinegradepayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Delete PaySpine Grade +*PaySpineApi* | [**deleteSpinalPointPaySpine**](docs/Api/PaySpineApi.md#deletespinalpointpayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Delete SpinalPoint +*PaySpineApi* | [**deleteSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#deletespineallowancepayspine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Delete SpineAllowance +*PaySpineApi* | [**getAllowanceGradePaySpine**](docs/Api/PaySpineApi.md#getallowancegradepayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Get AllowanceGrade +*PaySpineApi* | [**getAllowanceGradesPaySpine**](docs/Api/PaySpineApi.md#getallowancegradespayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | List AllowanceGrades +*PaySpineApi* | [**getAnnualValueFromSalaryFormulaPaySpine**](docs/Api/PaySpineApi.md#getannualvaluefromsalaryformulapayspine) | **GET** /employers/{employerId}/payspines/{id}/annualsalarybypayspines | Get Annual Value from pay spines formula +*PaySpineApi* | [**getLondonAllowanceListPaySpine**](docs/Api/PaySpineApi.md#getlondonallowancelistpayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/londonallowances | List LondonAllowances +*PaySpineApi* | [**getLondonAllowancePaySpine**](docs/Api/PaySpineApi.md#getlondonallowancepayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Get LondonAllowance +*PaySpineApi* | [**getPaySpine**](docs/Api/PaySpineApi.md#getpayspine) | **GET** /employers/{employerId}/payspines/{id} | Get PaySpine +*PaySpineApi* | [**getPaySpineGradeListPaySpine**](docs/Api/PaySpineApi.md#getpayspinegradelistpayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/paygrades | List PaySpine Grade +*PaySpineApi* | [**getPaySpineGradePaySpine**](docs/Api/PaySpineApi.md#getpayspinegradepayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Get PaySpine Grade +*PaySpineApi* | [**getSpinalPointListPaySpine**](docs/Api/PaySpineApi.md#getspinalpointlistpayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | List SpinalPoints +*PaySpineApi* | [**getSpinalPointPaySpine**](docs/Api/PaySpineApi.md#getspinalpointpayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Get SpinalPoint +*PaySpineApi* | [**getSpineAllowanceListPaySpine**](docs/Api/PaySpineApi.md#getspineallowancelistpayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances | List SpineAllowances +*PaySpineApi* | [**getSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#getspineallowancepayspine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Get SpineAllowance +*PaySpineApi* | [**importCsvPaySpine**](docs/Api/PaySpineApi.md#importcsvpayspine) | **POST** /employers/{employerId}/payspines/spinalpoints/import | Import SpinalPoints from csv file +*PaySpineApi* | [**importCsvPaySpinePaySpine**](docs/Api/PaySpineApi.md#importcsvpayspinepayspine) | **POST** /employers/{employerId}/payspines/import | Import PaySpine from csv file +*PaySpineApi* | [**importPayspineGradeCsvPaySpine**](docs/Api/PaySpineApi.md#importpayspinegradecsvpayspine) | **POST** /employers/{employerId}/payspines/paygrades/import | Import SpineGrades from csv file +*PaySpineApi* | [**indexPaySpine**](docs/Api/PaySpineApi.md#indexpayspine) | **GET** /employers/{employerId}/payspines | List PaySpine +*PaySpineApi* | [**updateAllowanceGradePaySpine**](docs/Api/PaySpineApi.md#updateallowancegradepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Update AllowanceGrade +*PaySpineApi* | [**updateLondonAllowancePaySpine**](docs/Api/PaySpineApi.md#updatelondonallowancepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Update LondonAllowance +*PaySpineApi* | [**updateMultipleAllowanceGradesPaySpine**](docs/Api/PaySpineApi.md#updatemultipleallowancegradespayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/update/bulk | Update Multiple AllowanceGrades +*PaySpineApi* | [**updateMultiplePaySpine**](docs/Api/PaySpineApi.md#updatemultiplepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk | Update Multiple SpinalPoints +*PaySpineApi* | [**updateMultipleSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#updatemultiplespineallowancepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/update/bulk | Update Multiple SpineAllowances +*PaySpineApi* | [**updatePayGradePaySpine**](docs/Api/PaySpineApi.md#updatepaygradepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Update PaySpine Grade +*PaySpineApi* | [**updatePaySpine**](docs/Api/PaySpineApi.md#updatepayspine) | **PUT** /employers/{employerId}/payspines/{id} | Update PaySpine +*PaySpineApi* | [**updateSpinalPointPaySpine**](docs/Api/PaySpineApi.md#updatespinalpointpayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Update SpinalPoint +*PaySpineApi* | [**updateSpineAllowancePaySpine**](docs/Api/PaySpineApi.md#updatespineallowancepayspine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Update SpineAllowance +*PayeeApi* | [**createPayee**](docs/Api/PayeeApi.md#createpayee) | **POST** /employers/{employerId}/payees | Create Payee +*PayeeApi* | [**deletePayee**](docs/Api/PayeeApi.md#deletepayee) | **DELETE** /employers/{employerId}/payees/{id} | Delete Payee +*PayeeApi* | [**getPayee**](docs/Api/PayeeApi.md#getpayee) | **GET** /employers/{employerId}/payees/{id} | Get Payee +*PayeeApi* | [**indexPayee**](docs/Api/PayeeApi.md#indexpayee) | **GET** /employers/{employerId}/payees | List Payees +*PayeeApi* | [**updatePayee**](docs/Api/PayeeApi.md#updatepayee) | **PUT** /employers/{employerId}/payees/{id} | Update Payee +*PensionApi* | [**createPension**](docs/Api/PensionApi.md#createpension) | **POST** /employers/{employerId}/employees/{employeeId}/pension | Create Pension +*PensionApi* | [**getDeprecatedPension**](docs/Api/PensionApi.md#getdeprecatedpension) | **GET** /employers/{employerId}/employees/{employeeId}/pension | Get Pension (deprecated) +*PensionApi* | [**getPension**](docs/Api/PensionApi.md#getpension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/{id} | Get Pension +*PensionApi* | [**lastPayRunEntryWithPensionYtdValuesForEmployeePension**](docs/Api/PensionApi.md#lastpayrunentrywithpensionytdvaluesforemployeepension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/{pensionUniqueId}/{taxYear}/pensionytd | Get last PayRunEntry for a Pension (deprecated) +*PensionApi* | [**listPension**](docs/Api/PensionApi.md#listpension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/list | List Pensions +*PensionApi* | [**removeDeprecatedPension**](docs/Api/PensionApi.md#removedeprecatedpension) | **DELETE** /employers/{employerId}/employees/{employeeId}/pension | Remove Pension (deprecated) +*PensionApi* | [**removePension**](docs/Api/PensionApi.md#removepension) | **DELETE** /employers/{employerId}/employees/{employeeId}/pension/{id} | Remove Pension +*PensionApi* | [**updateDeprecatedPension**](docs/Api/PensionApi.md#updatedeprecatedpension) | **PUT** /employers/{employerId}/employees/{employeeId}/pension | Update Pension (deprecated) +*PensionApi* | [**updatePension**](docs/Api/PensionApi.md#updatepension) | **PUT** /employers/{employerId}/employees/{employeeId}/pension/{id} | Update Pension +*PensionRefundApi* | [**createPensionRefund**](docs/Api/PensionRefundApi.md#createpensionrefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund | Create Pension Refund +*PensionRefundApi* | [**deletePensionRefund**](docs/Api/PensionRefundApi.md#deletepensionrefund) | **DELETE** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Delete Pension Refund +*PensionRefundApi* | [**getPensionRefund**](docs/Api/PensionRefundApi.md#getpensionrefund) | **GET** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Get Pension Refund +*PensionRefundApi* | [**indexPensionRefund**](docs/Api/PensionRefundApi.md#indexpensionrefund) | **GET** /employers/{employerId}/employees/{employeeId}/pensionrefund | List Pension Refunds +*PensionRefundApi* | [**issueRefundForCurrentPensionSchemePensionRefund**](docs/Api/PensionRefundApi.md#issuerefundforcurrentpensionschemepensionrefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund/autocalculated | Issue Pension Refund (deprecated) +*PensionRefundApi* | [**issueRefundForPensionPensionRefund**](docs/Api/PensionRefundApi.md#issuerefundforpensionpensionrefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund/{pensionId}/autocalculated | Issue Pension Refund +*PensionRefundApi* | [**updatePensionRefund**](docs/Api/PensionRefundApi.md#updatepensionrefund) | **PUT** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Update Pension Refund +*PensionSchemeApi* | [**contributionsForPayrunPensionScheme**](docs/Api/PensionSchemeApi.md#contributionsforpayrunpensionscheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber} | Contributions for Payrun +*PensionSchemeApi* | [**contributionsPensionScheme**](docs/Api/PensionSchemeApi.md#contributionspensionscheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId} | Contributions Data +*PensionSchemeApi* | [**createPensionScheme**](docs/Api/PensionSchemeApi.md#createpensionscheme) | **POST** /employers/{employerId}/pensionschemes | Create a PensionScheme +*PensionSchemeApi* | [**deletePensionScheme**](docs/Api/PensionSchemeApi.md#deletepensionscheme) | **DELETE** /employers/{employerId}/pensionschemes/{id} | Delete a PensionScheme +*PensionSchemeApi* | [**employeesPensionScheme**](docs/Api/PensionSchemeApi.md#employeespensionscheme) | **GET** /employers/{employerId}/pensionschemes/{id}/employees | Get Employees +*PensionSchemeApi* | [**getPensionScheme**](docs/Api/PensionSchemeApi.md#getpensionscheme) | **GET** /employers/{employerId}/pensionschemes/{id} | Get a PensionScheme +*PensionSchemeApi* | [**indexPensionScheme**](docs/Api/PensionSchemeApi.md#indexpensionscheme) | **GET** /employers/{employerId}/pensionschemes | List PensionSchemes +*PensionSchemeApi* | [**listContributionsPensionScheme**](docs/Api/PensionSchemeApi.md#listcontributionspensionscheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear} | List Contributions +*PensionSchemeApi* | [**markAsSentPensionScheme**](docs/Api/PensionSchemeApi.md#markassentpensionscheme) | **POST** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}/markassent | Mark as Sent +*PensionSchemeApi* | [**resubmitContributionsPensionScheme**](docs/Api/PensionSchemeApi.md#resubmitcontributionspensionscheme) | **POST** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId} | Re-submit Contributions +*PensionSchemeApi* | [**updatePensionScheme**](docs/Api/PensionSchemeApi.md#updatepensionscheme) | **PUT** /employers/{employerId}/pensionschemes/{id} | Update a PensionScheme +*ProcessingNoteApi* | [**addDocumentProcessingNote**](docs/Api/ProcessingNoteApi.md#adddocumentprocessingnote) | **POST** /employers/{employerId}/payrun/{id}/documents | Add Document +*ProcessingNoteApi* | [**createProcessingNote**](docs/Api/ProcessingNoteApi.md#createprocessingnote) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes | Create ProcessingNote +*ProcessingNoteApi* | [**deleteDocumentProcessingNote**](docs/Api/ProcessingNoteApi.md#deletedocumentprocessingnote) | **DELETE** /employers/{employerId}/payrun/{id}/documents/{documentId} | Delete ProcessingNote Document +*ProcessingNoteApi* | [**getDocumentProcessingNote**](docs/Api/ProcessingNoteApi.md#getdocumentprocessingnote) | **GET** /employers/{employerId}/payrun/{id}/documents/{documentId} | Get ProcessingNote Document +*ProcessingNoteApi* | [**getProcessingNote**](docs/Api/ProcessingNoteApi.md#getprocessingnote) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id} | Get a ProcessingNote +*ProcessingNoteApi* | [**listProcessingNote**](docs/Api/ProcessingNoteApi.md#listprocessingnote) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes | List ProcessingNotes for a PayRun +*ProcessingNoteApi* | [**setStatusProcessingNote**](docs/Api/ProcessingNoteApi.md#setstatusprocessingnote) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}/status | Set a ProcessingNote status +*ReportPackApi* | [**createReportPack**](docs/Api/ReportPackApi.md#createreportpack) | **POST** /employers/{employerId}/reports/packs | Create ReportPack +*ReportPackApi* | [**deleteReportPack**](docs/Api/ReportPackApi.md#deletereportpack) | **DELETE** /employers/{employerId}/reports/packs/{id} | Delete ReportPack +*ReportPackApi* | [**getReportPack**](docs/Api/ReportPackApi.md#getreportpack) | **GET** /employers/{employerId}/reports/packs/{id} | Get ReportPack +*ReportPackApi* | [**indexReportPack**](docs/Api/ReportPackApi.md#indexreportpack) | **GET** /employers/{employerId}/reports/packs | List ReportPacks +*ReportPackApi* | [**updateReportPack**](docs/Api/ReportPackApi.md#updatereportpack) | **PUT** /employers/{employerId}/reports/packs/{id} | Update ReportPack +*ReportTemplateApi* | [**createReportTemplate**](docs/Api/ReportTemplateApi.md#createreporttemplate) | **POST** /employers/{employerId}/reporttemplates | Create Report Template (beta) +*ReportTemplateApi* | [**deleteReportTemplate**](docs/Api/ReportTemplateApi.md#deletereporttemplate) | **DELETE** /employers/{employerId}/reporttemplates/{id} | Delete Report Template (beta) +*ReportTemplateApi* | [**getReportTemplate**](docs/Api/ReportTemplateApi.md#getreporttemplate) | **GET** /employers/{employerId}/reporttemplates/{id} | Get Report Template (beta) +*ReportTemplateApi* | [**indexReportTemplate**](docs/Api/ReportTemplateApi.md#indexreporttemplate) | **GET** /employers/{employerId}/reporttemplates | List Report Templates (beta) +*ReportTemplateApi* | [**updateReportTemplate**](docs/Api/ReportTemplateApi.md#updatereporttemplate) | **PUT** /employers/{employerId}/reporttemplates/{id} | Update Report Template (beta) +*ReportsApi* | [**advancedVarianceReportReports**](docs/Api/ReportsApi.md#advancedvariancereportreports) | **GET** /employers/{employerId}/reports/advancedvariance | Advanced Variance Report +*ReportsApi* | [**aeAssessmentsReports**](docs/Api/ReportsApi.md#aeassessmentsreports) | **GET** /employers/{employerId}/reports/AeAssessments | AutoEnrolment Assessments +*ReportsApi* | [**aeoStatementReports**](docs/Api/ReportsApi.md#aeostatementreports) | **GET** /aeo/{employeeId}/{id} | AEO Statement +*ReportsApi* | [**analysisReports**](docs/Api/ReportsApi.md#analysisreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysis | Analysis +*ReportsApi* | [**apprenticeshipLevyDetailsReports**](docs/Api/ReportsApi.md#apprenticeshiplevydetailsreports) | **GET** /employers/{employerId}/reports/{taxYear}/apprenticeshiplevy | Apprenticeship Levy Details +*ReportsApi* | [**attachmentOrdersReports**](docs/Api/ReportsApi.md#attachmentordersreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/attachmentorders | Attachment Orders +*ReportsApi* | [**averageHolidayPayRateReports**](docs/Api/ReportsApi.md#averageholidaypayratereports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/averageholidaypayrate | Average Holiday Pay Rate +*ReportsApi* | [**bankPaymentInstructionsReports**](docs/Api/ReportsApi.md#bankpaymentinstructionsreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee/credit | Bank Payment Instructions +*ReportsApi* | [**changesReports**](docs/Api/ReportsApi.md#changesreports) | **GET** /employers/{employerId}/reports/changes | Gets audit changes of all employees within a company. +*ReportsApi* | [**cis300Reports**](docs/Api/ReportsApi.md#cis300reports) | **GET** /employers/{employerId}/reports/{taxYear}/cis300/{id} | CIS300 +*ReportsApi* | [**cisStatementReports**](docs/Api/ReportsApi.md#cisstatementreports) | **GET** /employers/{employerId}/reports/{taxYear}/cisstatement/{taxMonth} | CIS Statement +*ReportsApi* | [**cisSubContractorSummaryReports**](docs/Api/ReportsApi.md#cissubcontractorsummaryreports) | **GET** /employers/{employerId}/reports/cissummary | CIS Subcontractor Summary +*ReportsApi* | [**costAnalysisReports**](docs/Api/ReportsApi.md#costanalysisreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/costanalysis | Cost Analysis +*ReportsApi* | [**costOfEmploymentReports**](docs/Api/ReportsApi.md#costofemploymentreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/costofemployment | Cost Of Employment +*ReportsApi* | [**downloadMaternitySchedulesReports**](docs/Api/ReportsApi.md#downloadmaternityschedulesreports) | **GET** /employers/{employerId}/reports/downloadmaternityschedules | Download Maternity Payment Schedule +*ReportsApi* | [**emailP11DMultipleReports**](docs/Api/ReportsApi.md#emailp11dmultiplereports) | **POST** /employers/{employerId}/reports/p11d/email | Email P11D to all Employees +*ReportsApi* | [**emailP11DReports**](docs/Api/ReportsApi.md#emailp11dreports) | **POST** /employers/{employerId}/reports/p11d/email/{employeeId} | Email P11D to an Employee +*ReportsApi* | [**emailP45Reports**](docs/Api/ReportsApi.md#emailp45reports) | **POST** /employers/{employerId}/reports/p45/email | Email P45 to Employee +*ReportsApi* | [**emailP60MultipleReports**](docs/Api/ReportsApi.md#emailp60multiplereports) | **POST** /employers/{employerId}/reports/p60/email | Email P60 to all Employees +*ReportsApi* | [**emailP60Reports**](docs/Api/ReportsApi.md#emailp60reports) | **POST** /employers/{employerId}/reports/p60/email/{employeeId} | Email P60 to an Employee +*ReportsApi* | [**employeeBenefitsReports**](docs/Api/ReportsApi.md#employeebenefitsreports) | **GET** /employers/{employerId}/reports/{taxYear}/EmployeeBenefits | Employee Benefits +*ReportsApi* | [**employeeExportReports**](docs/Api/ReportsApi.md#employeeexportreports) | **GET** /employees | Employee Export Details +*ReportsApi* | [**employeeLeaveReports**](docs/Api/ReportsApi.md#employeeleavereports) | **GET** /employers/{employerId}/reports/employeeleave | Employee Leave +*ReportsApi* | [**employeeRoleExportReports**](docs/Api/ReportsApi.md#employeeroleexportreports) | **GET** /employeeroles | Employee Export Roles Details +*ReportsApi* | [**employerChangesReports**](docs/Api/ReportsApi.md#employerchangesreports) | **GET** /employers/{employerId}/reports/employerchanges | Gets audit changes for a company. +*ReportsApi* | [**employerExportReports**](docs/Api/ReportsApi.md#employerexportreports) | **GET** /employers/{employerId}/reports/employers | Employer Export +*ReportsApi* | [**examplePayslipReports**](docs/Api/ReportsApi.md#examplepayslipreports) | **POST** /payslip/example/pdf | Example Payslip +*ReportsApi* | [**exbReports**](docs/Api/ReportsApi.md#exbreports) | **GET** /employers/{employerId}/reports/{taxYear}/exb/{id} | EXB +*ReportsApi* | [**fpsReports**](docs/Api/ReportsApi.md#fpsreports) | **GET** /employers/{employerId}/reports/{taxYear}/fps/{id} | FPS +*ReportsApi* | [**fullSummaryOfPayReports**](docs/Api/ReportsApi.md#fullsummaryofpayreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/fullsummaryofpay | Cost Of Employment +*ReportsApi* | [**furloughReportReports**](docs/Api/ReportsApi.md#furloughreportreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/furlough | FurloughReport +*ReportsApi* | [**genderPayGapReports**](docs/Api/ReportsApi.md#genderpaygapreports) | **GET** /employers/{employerId}/reports/{taxYear}/GenderPayGap | Gender Pay Gap +*ReportsApi* | [**getPayRunCsvReports**](docs/Api/ReportsApi.md#getpayruncsvreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payruncsv | Get PayRun CSV +*ReportsApi* | [**grossToNetReports**](docs/Api/ReportsApi.md#grosstonetreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/gross-to-net | Gross To Net +*ReportsApi* | [**holidayReports**](docs/Api/ReportsApi.md#holidayreports) | **GET** /employers/{employerId}/reports/holiday | Holiday +*ReportsApi* | [**hourlyPayReports**](docs/Api/ReportsApi.md#hourlypayreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/hourly-pay | Hourly Pay +*ReportsApi* | [**loanBalancesReports**](docs/Api/ReportsApi.md#loanbalancesreports) | **GET** /employers/{employerId}/reports/{payPeriod}/loanbalances | Loan Balances +*ReportsApi* | [**niLetterValidationReportEmployeesReports**](docs/Api/ReportsApi.md#nilettervalidationreportemployeesreports) | **GET** /employers/{employerId}/reports/NiLetterValidationReport | NI Letter Validation (Employees) +*ReportsApi* | [**niLetterValidationReportReports**](docs/Api/ReportsApi.md#nilettervalidationreportreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/NiLetterValidationReport | NI Letter Validation (Payrun) +*ReportsApi* | [**niYtdReports**](docs/Api/ReportsApi.md#niytdreports) | **GET** /niytd | NI Year To Date Values +*ReportsApi* | [**p11DMultipleReports**](docs/Api/ReportsApi.md#p11dmultiplereports) | **GET** /employers/{employerId}/reports/{taxYear}/p11d | All P11Ds For TaxYear +*ReportsApi* | [**p11DReports**](docs/Api/ReportsApi.md#p11dreports) | **GET** /employers/{employerId}/reports/{taxYear}/p11d/{employeeId} | P11D For Employee +*ReportsApi* | [**p11DetailedMultipleReports**](docs/Api/ReportsApi.md#p11detailedmultiplereports) | **GET** /employers/{employerId}/reports/{taxYear}/p11detailed | All Detailed P11s For TaxYear +*ReportsApi* | [**p11DetailedReports**](docs/Api/ReportsApi.md#p11detailedreports) | **GET** /employers/{employerId}/reports/{taxYear}/{employeeId}/p11detailed | P11 (Detailed) +*ReportsApi* | [**p11Reports**](docs/Api/ReportsApi.md#p11reports) | **GET** /employers/{employerId}/reports/{taxYear}/{employeeId}/p11 | P11 +*ReportsApi* | [**p30Reports**](docs/Api/ReportsApi.md#p30reports) | **GET** /employers/{employerId}/reports/{taxYear}/p30/{periodEnding} | P30 +*ReportsApi* | [**p32Reports**](docs/Api/ReportsApi.md#p32reports) | **GET** /employers/{employerId}/reports/{taxYear}/p32 | P32 +*ReportsApi* | [**p45Reports**](docs/Api/ReportsApi.md#p45reports) | **GET** /employers/{employerId}/reports/p45 | P45 For Employee +*ReportsApi* | [**p60MultipleReports**](docs/Api/ReportsApi.md#p60multiplereports) | **GET** /employers/{employerId}/reports/{taxYear}/p60 | All P60s For TaxYear +*ReportsApi* | [**p60Reports**](docs/Api/ReportsApi.md#p60reports) | **GET** /employers/{employerId}/reports/{taxYear}/p60/{employeeId} | P60 For Employee +*ReportsApi* | [**papdisFileReports**](docs/Api/ReportsApi.md#papdisfilereports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/papdis | PAPDIS File +*ReportsApi* | [**payCodeExportReports**](docs/Api/ReportsApi.md#paycodeexportreports) | **GET** /employers/{employerId}/reports/paycodes | Pay Code Export Details +*ReportsApi* | [**payElementReports**](docs/Api/ReportsApi.md#payelementreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/pay-element | Pay Element +*ReportsApi* | [**payGradesReports**](docs/Api/ReportsApi.md#paygradesreports) | **GET** /employers/{employerId}/reports/payGrades | Pay Grade +*ReportsApi* | [**payRunCsvReports**](docs/Api/ReportsApi.md#payruncsvreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrun-csv | PayRun CSV (deprecated) +*ReportsApi* | [**payRunPaymentsReports**](docs/Api/ReportsApi.md#payrunpaymentsreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee | PayRun Payments +*ReportsApi* | [**payRunSummaryReports**](docs/Api/ReportsApi.md#payrunsummaryreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/payrunsummary | PayRunSummary +*ReportsApi* | [**paySpineReports**](docs/Api/ReportsApi.md#payspinereports) | **GET** /employers/{employerId}/reports/payspines | Pay Spine +*ReportsApi* | [**payrollAnalysisCostBreakdownReports**](docs/Api/ReportsApi.md#payrollanalysiscostbreakdownreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysiscostbreakdown | Analysis Cost Breakdown +*ReportsApi* | [**payrollAnalysisEmployeeRoleBreakdownReports**](docs/Api/ReportsApi.md#payrollanalysisemployeerolebreakdownreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysisemployeerolebreakdown | Payroll Analysis with Employee Role Breakdown +*ReportsApi* | [**payrollJournalCsvReportReports**](docs/Api/ReportsApi.md#payrolljournalcsvreportreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrolljournalcsv | Payroll Journal CSV +*ReportsApi* | [**payrunNiYtdReports**](docs/Api/ReportsApi.md#payrunniytdreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/niytd | NI Year To Date Values +*ReportsApi* | [**payrunYtdReports**](docs/Api/ReportsApi.md#payrunytdreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/ytd | Year To Date Values +*ReportsApi* | [**payslipReports**](docs/Api/ReportsApi.md#payslipreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/{id}/payslip | Payslip +*ReportsApi* | [**payslipsReports**](docs/Api/ReportsApi.md#payslipsreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payslips | Payslips +*ReportsApi* | [**pensionMembershipsReports**](docs/Api/ReportsApi.md#pensionmembershipsreports) | **GET** /employers/{employerId}/reports/{taxYear}/pensionmemberships | Export Multiple Pension Memberships Report +*ReportsApi* | [**rightToWorkReports**](docs/Api/ReportsApi.md#righttoworkreports) | **GET** /employers/{employerId}/reports/right-to-work | RightToWork +*ReportsApi* | [**spinePointReports**](docs/Api/ReportsApi.md#spinepointreports) | **GET** /employers/{employerId}/reports/spinepoints | Spine Point +*ReportsApi* | [**statutoryPayReports**](docs/Api/ReportsApi.md#statutorypayreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/statutory-pay | Statutory Pay +*ReportsApi* | [**taxCodeChangesReports**](docs/Api/ReportsApi.md#taxcodechangesreports) | **GET** /employers/{employerId}/reports/{taxYear}/taxcode | Taxcode Change +*ReportsApi* | [**teachersPensionEoyReports**](docs/Api/ReportsApi.md#teacherspensioneoyreports) | **GET** /employers/{employerId}/reports/{taxYear}/teachersPensionEoy | Teachers Pension Eoy Report +*ReportsApi* | [**umbrellaReconciliationReports**](docs/Api/ReportsApi.md#umbrellareconciliationreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/umbrella-reconciliation | Umbrella Reconciliation +*ReportsApi* | [**varianceReportReports**](docs/Api/ReportsApi.md#variancereportreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/variance | Variance Report +*ReportsApi* | [**warningsReports**](docs/Api/ReportsApi.md#warningsreports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/PayrollRunWarnings | Export Payroll Run Warnings +*ReportsApi* | [**ytdReports**](docs/Api/ReportsApi.md#ytdreports) | **GET** /ytd | Year To Date Values +*ReportsAsyncApi* | [**queueGrossToNetReportReportsAsync**](docs/Api/ReportsAsyncApi.md#queuegrosstonetreportreportsasync) | **POST** /employers/{employerId}/reports-async/gross-to-net | Gross To Net async (beta) +*TagApi* | [**createTag**](docs/Api/TagApi.md#createtag) | **POST** /employers/{employerId}/tags | Create Tag +*TagApi* | [**deleteTag**](docs/Api/TagApi.md#deletetag) | **DELETE** /employers/{employerId}/tags/{code} | Delete Tag (deprecated) +*TagApi* | [**deleteTagTag**](docs/Api/TagApi.md#deletetagtag) | **DELETE** /employers/{employerId}/tags/tag | Delete Tag +*TagApi* | [**getTag**](docs/Api/TagApi.md#gettag) | **GET** /employers/{employerId}/tags/{code} | Get Tag (deprecated) +*TagApi* | [**getTagTag**](docs/Api/TagApi.md#gettagtag) | **GET** /employers/{employerId}/tags/Tag | Get Tag +*TagApi* | [**indexTag**](docs/Api/TagApi.md#indextag) | **GET** /employers/{employerId}/tags | List Tags +*TagApi* | [**updateTag**](docs/Api/TagApi.md#updatetag) | **PUT** /employers/{employerId}/tags/{code} | Update Tag (deprecated) +*TagApi* | [**updateTagTag**](docs/Api/TagApi.md#updatetagtag) | **PUT** /employers/{employerId}/tags/tag | Update Tag +*TenantApi* | [**addAdminUserTenant**](docs/Api/TenantApi.md#addadminusertenant) | **POST** /tenants/{id}/users/admins | Add Admin User +*TenantApi* | [**adminUsersTenant**](docs/Api/TenantApi.md#adminuserstenant) | **GET** /tenants/{id}/users/admins | List Admin Users +*TenantApi* | [**billTenant**](docs/Api/TenantApi.md#billtenant) | **GET** /tenants/{id}/bills/{year}/{month}/{billId} | Get Bill +*TenantApi* | [**billsTenant**](docs/Api/TenantApi.md#billstenant) | **GET** /tenants/{id}/bills/{year}/{month} | Get Bills +*TenantApi* | [**createBillsTenant**](docs/Api/TenantApi.md#createbillstenant) | **POST** /tenants/bills | Create Bills for Period +*TenantApi* | [**createPayrollSquadTenant**](docs/Api/TenantApi.md#createpayrollsquadtenant) | **POST** /tenants/{id}/payrollsquad | Create Payroll Squad +*TenantApi* | [**createPricingTableTenant**](docs/Api/TenantApi.md#createpricingtabletenant) | **POST** /tenants/{id}/pricingtables | Create PricingTable +*TenantApi* | [**createTenant**](docs/Api/TenantApi.md#createtenant) | **POST** /tenants | Create a Tenant +*TenantApi* | [**deletePayrollSquadMemberTenant**](docs/Api/TenantApi.md#deletepayrollsquadmembertenant) | **DELETE** /tenants/{id}/payrollsquad/{payrollSquadId}/member/{payrollSquadMemberId} | Delete Payroll Squad Member +*TenantApi* | [**deletePayrollSquadTenant**](docs/Api/TenantApi.md#deletepayrollsquadtenant) | **DELETE** /tenants/{id}/payrollsquad/{payrollSquadId} | Delete Payroll Squad and it's Members and Employers. +*TenantApi* | [**deletePricingTableTenant**](docs/Api/TenantApi.md#deletepricingtabletenant) | **DELETE** /tenants/{id}/pricingtables/{pricingTableId} | Delete PricingTable +*TenantApi* | [**disabledTenant**](docs/Api/TenantApi.md#disabledtenant) | **PUT** /tenants/{id}/users/{userId}/disabled | Disable User Account +*TenantApi* | [**employerCreationTenant**](docs/Api/TenantApi.md#employercreationtenant) | **PUT** /tenants/{id}/users/{userId}/employercreation | Enable Employer Creation +*TenantApi* | [**employerUsageTenant**](docs/Api/TenantApi.md#employerusagetenant) | **GET** /tenants/{id}/employers/{employerId}/usage | Get Employer Usage +*TenantApi* | [**employerUsersTenant**](docs/Api/TenantApi.md#employeruserstenant) | **GET** /tenants/{id}/employers/{employerId}/users | Get Employer Users +*TenantApi* | [**getApiMailingListReportByIdTenant**](docs/Api/TenantApi.md#getapimailinglistreportbyidtenant) | **GET** /tenants/{id}/reports/apimailinglist | Api Mailing List Report +*TenantApi* | [**getApiMailingListReportTenant**](docs/Api/TenantApi.md#getapimailinglistreporttenant) | **GET** /tenants/reports/apimailinglist | Api Mailing List Report +*TenantApi* | [**getEmployersTenant**](docs/Api/TenantApi.md#getemployerstenant) | **GET** /tenants/{id}/users/employers | Get Employers +*TenantApi* | [**getPayrollSquadTenant**](docs/Api/TenantApi.md#getpayrollsquadtenant) | **GET** /tenants/{id}/payrollsquad/{payrollSquadId} | Get Payroll Squad +*TenantApi* | [**getPayrollSquadsTenant**](docs/Api/TenantApi.md#getpayrollsquadstenant) | **GET** /tenants/{id}/payrollsquad | Get Payroll Squads +*TenantApi* | [**getPricingTableTenant**](docs/Api/TenantApi.md#getpricingtabletenant) | **GET** /tenants/{id}/pricingtables/{pricingTableId} | Get PricingTable +*TenantApi* | [**getPricingTablesTenant**](docs/Api/TenantApi.md#getpricingtablestenant) | **GET** /tenants/{id}/pricingtables | Get PricingTables +*TenantApi* | [**getRtiSubmissionSettingsTenant**](docs/Api/TenantApi.md#getrtisubmissionsettingstenant) | **GET** /tenants/ritsubmissionsettings | Get RtiSubmissionSettings +*TenantApi* | [**getTenant**](docs/Api/TenantApi.md#gettenant) | **GET** /tenants/{id} | Get a Tenant +*TenantApi* | [**getUsersWithNoBillableActivityTenant**](docs/Api/TenantApi.md#getuserswithnobillableactivitytenant) | **GET** /tenants/{id}/reports/users/nobillableactivity | Get Users with no Billable Activity. +*TenantApi* | [**netSuiteBillingTenant**](docs/Api/TenantApi.md#netsuitebillingtenant) | **GET** /tenants/{id}/reports/netsuitebills | NetSuite Billing Report +*TenantApi* | [**payrollSquadAddMemberTenant**](docs/Api/TenantApi.md#payrollsquadaddmembertenant) | **POST** /tenants/{id}/payrollsquad/member | Add Payroll Squad Member +*TenantApi* | [**payrollSquadUpdateEmployersTenant**](docs/Api/TenantApi.md#payrollsquadupdateemployerstenant) | **POST** /tenants/{id}/payrollsquad/employers | Update Payroll Squad Employers +*TenantApi* | [**removeAdminUserTenant**](docs/Api/TenantApi.md#removeadminusertenant) | **DELETE** /tenants/{id}/users/admins | Remove Admin User +*TenantApi* | [**setAccountingIdTenant**](docs/Api/TenantApi.md#setaccountingidtenant) | **PUT** /tenants/{id}/users/{userId}/accounting | Set User Accounting Id +*TenantApi* | [**setAddressTenant**](docs/Api/TenantApi.md#setaddresstenant) | **PUT** /tenants/{id}/users/{userId}/address | Set Address +*TenantApi* | [**setBureauRedirectEmailAddressTenant**](docs/Api/TenantApi.md#setbureauredirectemailaddresstenant) | **PUT** /tenants/{id}/users/{userId}/bureauredir | Set Bureau Redirect +*TenantApi* | [**setBusinessNameTenant**](docs/Api/TenantApi.md#setbusinessnametenant) | **PUT** /tenants/{id}/users/{userId}/businessname | Set User Business Name +*TenantApi* | [**setCountryTenant**](docs/Api/TenantApi.md#setcountrytenant) | **PUT** /tenants/{id}/users/{userId}/country | Set Country +*TenantApi* | [**setEmployeeCountTenant**](docs/Api/TenantApi.md#setemployeecounttenant) | **PUT** /tenants/{id}/users/{userId}/employeecount | Set Employee Count +*TenantApi* | [**setEvcTenant**](docs/Api/TenantApi.md#setevctenant) | **PUT** /tenants/{id}/admin/evc | Set Evc +*TenantApi* | [**setIndustryTenant**](docs/Api/TenantApi.md#setindustrytenant) | **PUT** /tenants/{id}/users/{userId}/industry | Set Industry +*TenantApi* | [**setMonthlyMinimumTenant**](docs/Api/TenantApi.md#setmonthlyminimumtenant) | **PUT** /tenants/{id}/users/{userId}/monthlyminimum | Set Monthly Minimum +*TenantApi* | [**setPricingTableIdTenant**](docs/Api/TenantApi.md#setpricingtableidtenant) | **PUT** /tenants/{id}/users/{userId}/pricingtable | Set User PricingTableId +*TenantApi* | [**setTenantTenant**](docs/Api/TenantApi.md#settenanttenant) | **PUT** /tenants/{id}/users/{userId}/tenant | Set User Tenant +*TenantApi* | [**updateBillTenant**](docs/Api/TenantApi.md#updatebilltenant) | **PUT** /tenants/{id}/bills/{year}/{month}/{billId} | Update Bill +*TenantApi* | [**updateCssColorsTenant**](docs/Api/TenantApi.md#updatecsscolorstenant) | **PUT** /tenants/{id}/css/colors | Update CSS Colors +*TenantApi* | [**updateCssTenant**](docs/Api/TenantApi.md#updatecsstenant) | **PUT** /tenants/{id}/css | Update CSS +*TenantApi* | [**updateFavIconTenant**](docs/Api/TenantApi.md#updatefavicontenant) | **PUT** /tenants/{id}/favicon | Upload Favicon +*TenantApi* | [**updateLogoTenant**](docs/Api/TenantApi.md#updatelogotenant) | **PUT** /tenants/{id}/logo | Upload Logo +*TenantApi* | [**updatePricingTableTenant**](docs/Api/TenantApi.md#updatepricingtabletenant) | **PUT** /tenants/{id}/pricingtables/{pricingTableId} | Update PricingTable +*TenantApi* | [**updateRtiSubmissionSettingsTenant**](docs/Api/TenantApi.md#updatertisubmissionsettingstenant) | **PUT** /tenants/ritsubmissionsettings | Update RtiSubmissionSettings +*TenantApi* | [**updateTenant**](docs/Api/TenantApi.md#updatetenant) | **PUT** /tenants/{id} | Update a Tenant +*TenantApi* | [**updateUserTenant**](docs/Api/TenantApi.md#updateusertenant) | **PUT** /tenants/{id}/users/{userId} | Update a User +*TenantApi* | [**usageTenant**](docs/Api/TenantApi.md#usagetenant) | **GET** /tenants/{id}/usage/{year}/{month} | Get Usage +*TenantApi* | [**userBillsTenant**](docs/Api/TenantApi.md#userbillstenant) | **GET** /tenants/{id}/users/{userId}/bills | Get User Bills +*TenantApi* | [**userEmployersTenant**](docs/Api/TenantApi.md#useremployerstenant) | **GET** /tenants/{id}/users/{userId}/employers | Get User Employers +*TenantApi* | [**userTenant**](docs/Api/TenantApi.md#usertenant) | **GET** /tenants/{id}/users/{userId} | Get a User +*TenantApi* | [**usersSearchTenant**](docs/Api/TenantApi.md#userssearchtenant) | **GET** /tenants/{id}/users/search | Search Users +*TenantApi* | [**usersTenant**](docs/Api/TenantApi.md#userstenant) | **GET** /tenants/{id}/users | List Users +*TenantApi* | [**weeklyActivityTenant**](docs/Api/TenantApi.md#weeklyactivitytenant) | **GET** /tenants/{id}/reports/weeklyactivity | Weekly Activity Report +*TenantEmailApi* | [**getEmailTenantEmail**](docs/Api/TenantEmailApi.md#getemailtenantemail) | **GET** /tenants/{id}/email/{emailId} | Get Email +*TenantEmailApi* | [**getMailSettingsTenantEmail**](docs/Api/TenantEmailApi.md#getmailsettingstenantemail) | **GET** /tenants/{id}/email/settings | Get MailSettings +*TenantEmailApi* | [**indexTenantEmail**](docs/Api/TenantEmailApi.md#indextenantemail) | **GET** /tenants/{id}/email | List Emails +*TenantEmailApi* | [**resendEmailTenantEmail**](docs/Api/TenantEmailApi.md#resendemailtenantemail) | **POST** /tenants/{id}/email/{emailId} | Re-send Email +*TenantEmailApi* | [**testMailSettingsTenantEmail**](docs/Api/TenantEmailApi.md#testmailsettingstenantemail) | **POST** /tenants/{id}/email/settings/test | Send test email +*TenantEmailApi* | [**updateMailSettingsTenantEmail**](docs/Api/TenantEmailApi.md#updatemailsettingstenantemail) | **PUT** /tenants/{id}/email/settings | Update MailSettings +*TermCalendarApi* | [**createTermCalendar**](docs/Api/TermCalendarApi.md#createtermcalendar) | **POST** /employers/{employerId}/termcalendars | Create Term Calendar +*TermCalendarApi* | [**deleteTermCalendar**](docs/Api/TermCalendarApi.md#deletetermcalendar) | **DELETE** /employers/{employerId}/termcalendars/{id} | Delete Term Calendar +*TermCalendarApi* | [**getTermCalendar**](docs/Api/TermCalendarApi.md#gettermcalendar) | **GET** /employers/{employerId}/termcalendars/{id} | Get Term Calendar +*TermCalendarApi* | [**indexTermCalendar**](docs/Api/TermCalendarApi.md#indextermcalendar) | **GET** /employers/{employerId}/termcalendars | List Term Calendars +*TermCalendarApi* | [**updateTermCalendar**](docs/Api/TermCalendarApi.md#updatetermcalendar) | **PUT** /employers/{employerId}/termcalendars/{id} | Update Term Calendar +*TermCalendarYearApi* | [**createTermCalendarYear**](docs/Api/TermCalendarYearApi.md#createtermcalendaryear) | **POST** /employers/{employerId}/termcalendaryears/{termCalendarId} | Create Term Calendar Year +*TermCalendarYearApi* | [**deleteTermCalendarYear**](docs/Api/TermCalendarYearApi.md#deletetermcalendaryear) | **DELETE** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Delete Term Calendar Year +*TermCalendarYearApi* | [**getTermCalendarYear**](docs/Api/TermCalendarYearApi.md#gettermcalendaryear) | **GET** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Get Term Calendar Year +*TermCalendarYearApi* | [**indexTermCalendarYear**](docs/Api/TermCalendarYearApi.md#indextermcalendaryear) | **GET** /employers/{employerId}/termcalendaryears/{termCalendarId} | List Term Calendar Years +*TermCalendarYearApi* | [**updateTermCalendarYear**](docs/Api/TermCalendarYearApi.md#updatetermcalendaryear) | **PUT** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Update Term Calendar Year +*TierablePayApi* | [**getTierablePay**](docs/Api/TierablePayApi.md#gettierablepay) | **GET** /employers/{employerId}/tierablepay/{payrunEntryId} | Calculate tierable pay +*ToolsApi* | [**calculateNetOfOnCostsTools**](docs/Api/ToolsApi.md#calculatenetofoncoststools) | **GET** /tools/calculate-net-of-on-costs | Calculate Net of On Costs +*WebhookApi* | [**createWebhook**](docs/Api/WebhookApi.md#createwebhook) | **POST** /employers/{employerId}/webhooks | Create Webhook +*WebhookApi* | [**deleteWebhook**](docs/Api/WebhookApi.md#deletewebhook) | **DELETE** /employers/{employerId}/webhooks/{id} | Delete Webhook +*WebhookApi* | [**getWebhook**](docs/Api/WebhookApi.md#getwebhook) | **GET** /employers/{employerId}/webhooks/{id} | Get Webhook +*WebhookApi* | [**indexWebhook**](docs/Api/WebhookApi.md#indexwebhook) | **GET** /employers/{employerId}/webhooks | List Webhooks +*WebhookApi* | [**payloadWebhook**](docs/Api/WebhookApi.md#payloadwebhook) | **GET** /employers/{employerId}/webhooks/{id}/payloads/{payloadId} | Get WebhookPayload +*WebhookApi* | [**payloadsWebhook**](docs/Api/WebhookApi.md#payloadswebhook) | **GET** /employers/{employerId}/webhooks/{id}/payloads | List WebhookPayloads +*WebhookApi* | [**sampleWebhook**](docs/Api/WebhookApi.md#samplewebhook) | **GET** /employers/{employerId}/webhooks/samples/{webhookEvent} | Sample Value +*WebhookApi* | [**updateWebhook**](docs/Api/WebhookApi.md#updatewebhook) | **PUT** /employers/{employerId}/webhooks/{id} | Update Webhook +*WorkingPatternApi* | [**createWorkingPattern**](docs/Api/WorkingPatternApi.md#createworkingpattern) | **POST** /employers/{employerId}/workingpatterns | Create WorkingPattern +*WorkingPatternApi* | [**deleteWorkingPattern**](docs/Api/WorkingPatternApi.md#deleteworkingpattern) | **DELETE** /employers/{employerId}/workingpatterns/{id} | Delete WorkingPattern +*WorkingPatternApi* | [**getAsyncWorkingPattern**](docs/Api/WorkingPatternApi.md#getasyncworkingpattern) | **GET** /employers/{employerId}/workingpatterns/{id} | Get WorkingPattern +*WorkingPatternApi* | [**indexAsyncWorkingPattern**](docs/Api/WorkingPatternApi.md#indexasyncworkingpattern) | **GET** /employers/{employerId}/workingpatterns | List WorkingPatterns +*WorkingPatternApi* | [**updateWorkingPattern**](docs/Api/WorkingPatternApi.md#updateworkingpattern) | **PUT** /employers/{employerId}/workingpatterns/{id} | Update WorkingPattern + +## Models + +- [Address](docs/Model/Address.md) +- [AdvancedVarianceReport](docs/Model/AdvancedVarianceReport.md) +- [AdvancedVarianceReportLine](docs/Model/AdvancedVarianceReportLine.md) +- [AdvancedVarianceReportReportResponse](docs/Model/AdvancedVarianceReportReportResponse.md) +- [AeAction](docs/Model/AeAction.md) +- [AeAssessment](docs/Model/AeAssessment.md) +- [AeAssessmentAction](docs/Model/AeAssessmentAction.md) +- [AeEmployeeState](docs/Model/AeEmployeeState.md) +- [AeExclusionCode](docs/Model/AeExclusionCode.md) +- [AeStatus](docs/Model/AeStatus.md) +- [AeStatutoryLetter](docs/Model/AeStatutoryLetter.md) +- [AeUKWorker](docs/Model/AeUKWorker.md) +- [AllowanceType](docs/Model/AllowanceType.md) +- [AnalysisCategory](docs/Model/AnalysisCategory.md) +- [AnalysisCategoryCode](docs/Model/AnalysisCategoryCode.md) +- [AnalysisCategoryCodes](docs/Model/AnalysisCategoryCodes.md) +- [AnalysisCategoryIndex](docs/Model/AnalysisCategoryIndex.md) +- [AnalysisReport](docs/Model/AnalysisReport.md) +- [AnalysisReportLine](docs/Model/AnalysisReportLine.md) +- [AnalysisReportLineValue](docs/Model/AnalysisReportLineValue.md) +- [AnalysisReportReportResponse](docs/Model/AnalysisReportReportResponse.md) +- [AnnualRoundingRule](docs/Model/AnnualRoundingRule.md) +- [AssumedPensionablePay](docs/Model/AssumedPensionablePay.md) +- [AttachmentOrder](docs/Model/AttachmentOrder.md) +- [AttachmentOrderPayment](docs/Model/AttachmentOrderPayment.md) +- [AttachmentOrderReportResponse](docs/Model/AttachmentOrderReportResponse.md) +- [AttachmentOrderType](docs/Model/AttachmentOrderType.md) +- [AttachmentOrdersReport](docs/Model/AttachmentOrdersReport.md) +- [AttachmentOrdersReportReportResponse](docs/Model/AttachmentOrdersReportReportResponse.md) +- [AuditEventAction](docs/Model/AuditEventAction.md) +- [AuthScheme](docs/Model/AuthScheme.md) +- [AutoEnrolment](docs/Model/AutoEnrolment.md) +- [AutoEnrolmentSettings](docs/Model/AutoEnrolmentSettings.md) +- [AutoPilotFinaliseTime](docs/Model/AutoPilotFinaliseTime.md) +- [AutomationSettings](docs/Model/AutomationSettings.md) +- [AverageHolidayPayRateReport](docs/Model/AverageHolidayPayRateReport.md) +- [AverageHolidayPayRateReportLine](docs/Model/AverageHolidayPayRateReportLine.md) +- [AverageHolidayPayRateReportReportResponse](docs/Model/AverageHolidayPayRateReportReportResponse.md) +- [AveragePayGradesReportLine](docs/Model/AveragePayGradesReportLine.md) +- [AverageWeeklyEarnings](docs/Model/AverageWeeklyEarnings.md) +- [AverageWeeklyEarningsResult](docs/Model/AverageWeeklyEarningsResult.md) +- [BackgroundTaskStatus](docs/Model/BackgroundTaskStatus.md) +- [BankDetails](docs/Model/BankDetails.md) +- [BankHolidayCollection](docs/Model/BankHolidayCollection.md) +- [BankPaymentInstruction](docs/Model/BankPaymentInstruction.md) +- [BankPaymentInstructionReportResponse](docs/Model/BankPaymentInstructionReportResponse.md) +- [BankPaymentInstructionsCsvFormat](docs/Model/BankPaymentInstructionsCsvFormat.md) +- [Benefit](docs/Model/Benefit.md) +- [BenefitDeclarationType](docs/Model/BenefitDeclarationType.md) +- [BenefitDetailsAssetType](docs/Model/BenefitDetailsAssetType.md) +- [BenefitDetailsCar](docs/Model/BenefitDetailsCar.md) +- [BenefitDetailsCarPowerType](docs/Model/BenefitDetailsCarPowerType.md) +- [BenefitDetailsClass1AType](docs/Model/BenefitDetailsClass1AType.md) +- [BenefitDetailsLoan](docs/Model/BenefitDetailsLoan.md) +- [BenefitDetailsNonClass1AType](docs/Model/BenefitDetailsNonClass1AType.md) +- [BenefitDetailsPaymentType](docs/Model/BenefitDetailsPaymentType.md) +- [BenefitDetailsUseOfAssetType](docs/Model/BenefitDetailsUseOfAssetType.md) +- [BenefitPayrolled](docs/Model/BenefitPayrolled.md) +- [BenefitType](docs/Model/BenefitType.md) +- [BureauSettings](docs/Model/BureauSettings.md) +- [CISSubContractorType](docs/Model/CISSubContractorType.md) +- [CISTaxStatus](docs/Model/CISTaxStatus.md) +- [CalendarEntry](docs/Model/CalendarEntry.md) +- [CalendarEntryType](docs/Model/CalendarEntryType.md) +- [CalendarMonth](docs/Model/CalendarMonth.md) +- [CarCharge](docs/Model/CarCharge.md) +- [CarChargeRate](docs/Model/CarChargeRate.md) +- [ChangeSummary](docs/Model/ChangeSummary.md) +- [ChangeSummaryListReportResponse](docs/Model/ChangeSummaryListReportResponse.md) +- [Cis300](docs/Model/Cis300.md) +- [Cis300Declarations](docs/Model/Cis300Declarations.md) +- [Cis300ReportResponse](docs/Model/Cis300ReportResponse.md) +- [CisContractor](docs/Model/CisContractor.md) +- [CisDetails](docs/Model/CisDetails.md) +- [CisPartnership](docs/Model/CisPartnership.md) +- [CisRequest](docs/Model/CisRequest.md) +- [CisReturn](docs/Model/CisReturn.md) +- [CisStatement](docs/Model/CisStatement.md) +- [CisStatementListReportResponse](docs/Model/CisStatementListReportResponse.md) +- [CisSubContractor](docs/Model/CisSubContractor.md) +- [CisSubContractorSummary](docs/Model/CisSubContractorSummary.md) +- [CisSubContractorSummaryListReportResponse](docs/Model/CisSubContractorSummaryListReportResponse.md) +- [CisVerification](docs/Model/CisVerification.md) +- [CisVerificationDetails](docs/Model/CisVerificationDetails.md) +- [ContractAddress](docs/Model/ContractAddress.md) +- [ContractAeAssessmentAction](docs/Model/ContractAeAssessmentAction.md) +- [ContractAeAssessmentRequest](docs/Model/ContractAeAssessmentRequest.md) +- [ContractAeAssessmentResponse](docs/Model/ContractAeAssessmentResponse.md) +- [ContractAllowanceGradesRequest](docs/Model/ContractAllowanceGradesRequest.md) +- [ContractAllowanceGradesResponse](docs/Model/ContractAllowanceGradesResponse.md) +- [ContractAllowanceGradesUpdateRequest](docs/Model/ContractAllowanceGradesUpdateRequest.md) +- [ContractAnalysisCategoryCodeRequest](docs/Model/ContractAnalysisCategoryCodeRequest.md) +- [ContractAnalysisCategoryCodeResponse](docs/Model/ContractAnalysisCategoryCodeResponse.md) +- [ContractAnalysisCategoryRequest](docs/Model/ContractAnalysisCategoryRequest.md) +- [ContractAnalysisCategoryResponse](docs/Model/ContractAnalysisCategoryResponse.md) +- [ContractAutoEnrolmentRequest](docs/Model/ContractAutoEnrolmentRequest.md) +- [ContractAutoEnrolmentResponse](docs/Model/ContractAutoEnrolmentResponse.md) +- [ContractBankDetails](docs/Model/ContractBankDetails.md) +- [ContractCisDetailsRequest](docs/Model/ContractCisDetailsRequest.md) +- [ContractCisDetailsResponse](docs/Model/ContractCisDetailsResponse.md) +- [ContractCisPartnership](docs/Model/ContractCisPartnership.md) +- [ContractCisSubContractor](docs/Model/ContractCisSubContractor.md) +- [ContractCisSubContractorItem](docs/Model/ContractCisSubContractorItem.md) +- [ContractCisVerificationDetailsRequest](docs/Model/ContractCisVerificationDetailsRequest.md) +- [ContractCisVerificationDetailsResponse](docs/Model/ContractCisVerificationDetailsResponse.md) +- [ContractCostCentreJournalOverridesRequest](docs/Model/ContractCostCentreJournalOverridesRequest.md) +- [ContractCostCentreJournalOverridesResponse](docs/Model/ContractCostCentreJournalOverridesResponse.md) +- [ContractCostCentreJournalOverridesResponseItem](docs/Model/ContractCostCentreJournalOverridesResponseItem.md) +- [ContractCostCentreJournalOverridesUpdateRequest](docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md) +- [ContractCreateEmployeeRequest](docs/Model/ContractCreateEmployeeRequest.md) +- [ContractDepartmentJournalOverridesRequest](docs/Model/ContractDepartmentJournalOverridesRequest.md) +- [ContractDepartmentJournalOverridesResponse](docs/Model/ContractDepartmentJournalOverridesResponse.md) +- [ContractDepartmentJournalOverridesResponseItem](docs/Model/ContractDepartmentJournalOverridesResponseItem.md) +- [ContractDepartmentJournalOverridesUpdateRequest](docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md) +- [ContractDepartmentRequest](docs/Model/ContractDepartmentRequest.md) +- [ContractDepartmentResponse](docs/Model/ContractDepartmentResponse.md) +- [ContractDirectorshipDetails](docs/Model/ContractDirectorshipDetails.md) +- [ContractEmployeeItem](docs/Model/ContractEmployeeItem.md) +- [ContractEmployeeResponse](docs/Model/ContractEmployeeResponse.md) +- [ContractEmployeeRoleAnalysisCategoryCodeRequest](docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md) +- [ContractEmployeeRoleAnalysisCategoryCodeResponse](docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md) +- [ContractEmployeeRoleItem](docs/Model/ContractEmployeeRoleItem.md) +- [ContractEmployeeRoleResponse](docs/Model/ContractEmployeeRoleResponse.md) +- [ContractEmployeeRoleWorkingPatternRequest](docs/Model/ContractEmployeeRoleWorkingPatternRequest.md) +- [ContractEmployeeRoleWorkingPatternResponse](docs/Model/ContractEmployeeRoleWorkingPatternResponse.md) +- [ContractEmployeeRoleWorkingPatternResponseItem](docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md) +- [ContractEmployerBase](docs/Model/ContractEmployerBase.md) +- [ContractEmploymentDetailsRequest](docs/Model/ContractEmploymentDetailsRequest.md) +- [ContractEmploymentDetailsResponse](docs/Model/ContractEmploymentDetailsResponse.md) +- [ContractFpsFields](docs/Model/ContractFpsFields.md) +- [ContractGrossToNetReportRequest](docs/Model/ContractGrossToNetReportRequest.md) +- [ContractHolidayEntitlementRequest](docs/Model/ContractHolidayEntitlementRequest.md) +- [ContractHolidayEntitlementResponse](docs/Model/ContractHolidayEntitlementResponse.md) +- [ContractHolidayEntitlementUpdateRequest](docs/Model/ContractHolidayEntitlementUpdateRequest.md) +- [ContractHolidaySchemeRequest](docs/Model/ContractHolidaySchemeRequest.md) +- [ContractHolidaySchemeResponse](docs/Model/ContractHolidaySchemeResponse.md) +- [ContractJobErrorResponse](docs/Model/ContractJobErrorResponse.md) +- [ContractJobResponse](docs/Model/ContractJobResponse.md) +- [ContractJobResultFileResponse](docs/Model/ContractJobResultFileResponse.md) +- [ContractJobResultResponse](docs/Model/ContractJobResultResponse.md) +- [ContractJournalTemplateRequest](docs/Model/ContractJournalTemplateRequest.md) +- [ContractJournalTemplateResponse](docs/Model/ContractJournalTemplateResponse.md) +- [ContractJournalTokenRequest](docs/Model/ContractJournalTokenRequest.md) +- [ContractJournalTokenResponse](docs/Model/ContractJournalTokenResponse.md) +- [ContractJournalTokenResponseItem](docs/Model/ContractJournalTokenResponseItem.md) +- [ContractLeaveImportRequest](docs/Model/ContractLeaveImportRequest.md) +- [ContractLeaveSettingsRequest](docs/Model/ContractLeaveSettingsRequest.md) +- [ContractLeaveSettingsResponse](docs/Model/ContractLeaveSettingsResponse.md) +- [ContractLeaverDetails](docs/Model/ContractLeaverDetails.md) +- [ContractLondonAllowanceRequest](docs/Model/ContractLondonAllowanceRequest.md) +- [ContractLondonAllowanceResponse](docs/Model/ContractLondonAllowanceResponse.md) +- [ContractNetOfOnCostsResponse](docs/Model/ContractNetOfOnCostsResponse.md) +- [ContractNetOfOnCostsSimulationResponse](docs/Model/ContractNetOfOnCostsSimulationResponse.md) +- [ContractOverseasEmployerDetails](docs/Model/ContractOverseasEmployerDetails.md) +- [ContractP11HistoryRequest](docs/Model/ContractP11HistoryRequest.md) +- [ContractP11HistoryResponse](docs/Model/ContractP11HistoryResponse.md) +- [ContractPartnerDetails](docs/Model/ContractPartnerDetails.md) +- [ContractPayHistoryRequest](docs/Model/ContractPayHistoryRequest.md) +- [ContractPayHistoryResponse](docs/Model/ContractPayHistoryResponse.md) +- [ContractPayHistoryUpdateRequest](docs/Model/ContractPayHistoryUpdateRequest.md) +- [ContractPayLineRequest](docs/Model/ContractPayLineRequest.md) +- [ContractPayLineResponse](docs/Model/ContractPayLineResponse.md) +- [ContractPayOptionsBaseResponse](docs/Model/ContractPayOptionsBaseResponse.md) +- [ContractPayOptionsImportRequest](docs/Model/ContractPayOptionsImportRequest.md) +- [ContractPayOptionsRequest](docs/Model/ContractPayOptionsRequest.md) +- [ContractPayOptionsResponse](docs/Model/ContractPayOptionsResponse.md) +- [ContractPayRunStateHistoryResponse](docs/Model/ContractPayRunStateHistoryResponse.md) +- [ContractPaySpineGradeRequest](docs/Model/ContractPaySpineGradeRequest.md) +- [ContractPaySpineGradeResponse](docs/Model/ContractPaySpineGradeResponse.md) +- [ContractPaySpineRequest](docs/Model/ContractPaySpineRequest.md) +- [ContractPaySpineResponse](docs/Model/ContractPaySpineResponse.md) +- [ContractPaySpineUpdateRequest](docs/Model/ContractPaySpineUpdateRequest.md) +- [ContractPaylineAnalysisCategoriesCodes](docs/Model/ContractPaylineAnalysisCategoriesCodes.md) +- [ContractPaylineRequest](docs/Model/ContractPaylineRequest.md) +- [ContractPayrollSquadEmployerRequest](docs/Model/ContractPayrollSquadEmployerRequest.md) +- [ContractPayrollSquadEmployerResponse](docs/Model/ContractPayrollSquadEmployerResponse.md) +- [ContractPayrollSquadMemberRequest](docs/Model/ContractPayrollSquadMemberRequest.md) +- [ContractPayrollSquadMemberResponse](docs/Model/ContractPayrollSquadMemberResponse.md) +- [ContractPayrollSquadRequest](docs/Model/ContractPayrollSquadRequest.md) +- [ContractPayrollSquadResponse](docs/Model/ContractPayrollSquadResponse.md) +- [ContractPendingLettersCountResponse](docs/Model/ContractPendingLettersCountResponse.md) +- [ContractPensionerPayroll](docs/Model/ContractPensionerPayroll.md) +- [ContractPersonalDetailsRequest](docs/Model/ContractPersonalDetailsRequest.md) +- [ContractPersonalDetailsResponse](docs/Model/ContractPersonalDetailsResponse.md) +- [ContractReapplyDpsNoticeResponse](docs/Model/ContractReapplyDpsNoticeResponse.md) +- [ContractRightToWork](docs/Model/ContractRightToWork.md) +- [ContractRtiEmployeeAddress](docs/Model/ContractRtiEmployeeAddress.md) +- [ContractRtiEmployeeName](docs/Model/ContractRtiEmployeeName.md) +- [ContractShiftWorkingPatternDayRequest](docs/Model/ContractShiftWorkingPatternDayRequest.md) +- [ContractShiftWorkingPatternDayResponse](docs/Model/ContractShiftWorkingPatternDayResponse.md) +- [ContractSpinalPointRequest](docs/Model/ContractSpinalPointRequest.md) +- [ContractSpinalPointResponse](docs/Model/ContractSpinalPointResponse.md) +- [ContractSpinalPointUpdateRequest](docs/Model/ContractSpinalPointUpdateRequest.md) +- [ContractSpineAllowanceRequest](docs/Model/ContractSpineAllowanceRequest.md) +- [ContractSpineAllowanceResponse](docs/Model/ContractSpineAllowanceResponse.md) +- [ContractSpineAllowanceUpdateRequest](docs/Model/ContractSpineAllowanceUpdateRequest.md) +- [ContractStarterDetails](docs/Model/ContractStarterDetails.md) +- [ContractTaxAndNi](docs/Model/ContractTaxAndNi.md) +- [ContractTermCalendarRequest](docs/Model/ContractTermCalendarRequest.md) +- [ContractTermCalendarResponse](docs/Model/ContractTermCalendarResponse.md) +- [ContractTermCalendarYearRequest](docs/Model/ContractTermCalendarYearRequest.md) +- [ContractTermCalendarYearResponse](docs/Model/ContractTermCalendarYearResponse.md) +- [ContractUpdateEmployeeRequest](docs/Model/ContractUpdateEmployeeRequest.md) +- [ContractVeteranDetails](docs/Model/ContractVeteranDetails.md) +- [ContractWorkingPatternRequest](docs/Model/ContractWorkingPatternRequest.md) +- [ContractWorkingPatternResponse](docs/Model/ContractWorkingPatternResponse.md) +- [ContractYearsServiceEntitlementRequest](docs/Model/ContractYearsServiceEntitlementRequest.md) +- [ContractYearsServiceEntitlementResponse](docs/Model/ContractYearsServiceEntitlementResponse.md) +- [ContractYearsServiceEntitlementUpdateRequest](docs/Model/ContractYearsServiceEntitlementUpdateRequest.md) +- [CostAnalysisReport](docs/Model/CostAnalysisReport.md) +- [CostAnalysisReportReportResponse](docs/Model/CostAnalysisReportReportResponse.md) +- [CostCentre](docs/Model/CostCentre.md) +- [CostOfEmploymentReport](docs/Model/CostOfEmploymentReport.md) +- [CostOfEmploymentReportLine](docs/Model/CostOfEmploymentReportLine.md) +- [CostOfEmploymentReportReportResponse](docs/Model/CostOfEmploymentReportReportResponse.md) +- [Country](docs/Model/Country.md) +- [CsvFileFormat](docs/Model/CsvFileFormat.md) +- [DayOfWeek](docs/Model/DayOfWeek.md) +- [DecimalTaxYearConfigPrimitiveValue](docs/Model/DecimalTaxYearConfigPrimitiveValue.md) +- [DeferalPeriodType](docs/Model/DeferalPeriodType.md) +- [Department](docs/Model/Department.md) +- [DepartmentMembership](docs/Model/DepartmentMembership.md) +- [DirectDebitMandate](docs/Model/DirectDebitMandate.md) +- [DirectorshipDetails](docs/Model/DirectorshipDetails.md) +- [DpsDataType](docs/Model/DpsDataType.md) +- [DpsNotice](docs/Model/DpsNotice.md) +- [DpsSettings](docs/Model/DpsSettings.md) +- [EmailAttachment](docs/Model/EmailAttachment.md) +- [EmpRefs](docs/Model/EmpRefs.md) +- [Employee](docs/Model/Employee.md) +- [EmployeeBenefitsReport](docs/Model/EmployeeBenefitsReport.md) +- [EmployeeBenefitsReportReportResponse](docs/Model/EmployeeBenefitsReportReportResponse.md) +- [EmployeeCostCentre](docs/Model/EmployeeCostCentre.md) +- [EmployeeLeaveReport](docs/Model/EmployeeLeaveReport.md) +- [EmployeeLeaveReportLine](docs/Model/EmployeeLeaveReportLine.md) +- [EmployeeLeaveReportReportResponse](docs/Model/EmployeeLeaveReportReportResponse.md) +- [EmployeeNiYtdValues](docs/Model/EmployeeNiYtdValues.md) +- [EmployeePayRunTotal](docs/Model/EmployeePayRunTotal.md) +- [EmployeeRole](docs/Model/EmployeeRole.md) +- [EmployeeRoleAnalysisCategoryCode](docs/Model/EmployeeRoleAnalysisCategoryCode.md) +- [EmployeeRolePayItem](docs/Model/EmployeeRolePayItem.md) +- [EmployeeRolePayOptions](docs/Model/EmployeeRolePayOptions.md) +- [EmployeeSortBy](docs/Model/EmployeeSortBy.md) +- [EmployeeStatus](docs/Model/EmployeeStatus.md) +- [EmployeeYtdValues](docs/Model/EmployeeYtdValues.md) +- [Employer](docs/Model/Employer.md) +- [EmployerDefaults](docs/Model/EmployerDefaults.md) +- [EmployerEmail](docs/Model/EmployerEmail.md) +- [EmployerEvcOptInHistory](docs/Model/EmployerEvcOptInHistory.md) +- [EmployerGroup](docs/Model/EmployerGroup.md) +- [EmployerGroupMembership](docs/Model/EmployerGroupMembership.md) +- [EmployerItem](docs/Model/EmployerItem.md) +- [EmployerOpeningBalances](docs/Model/EmployerOpeningBalances.md) +- [EmployerPensionContribution](docs/Model/EmployerPensionContribution.md) +- [EmployerSettings](docs/Model/EmployerSettings.md) +- [EmployerTemplate](docs/Model/EmployerTemplate.md) +- [EmployerTemplateType](docs/Model/EmployerTemplateType.md) +- [EmploymentDetails](docs/Model/EmploymentDetails.md) +- [EntitlementBand](docs/Model/EntitlementBand.md) +- [EntityType](docs/Model/EntityType.md) +- [Eps](docs/Model/Eps.md) +- [EpsAccount](docs/Model/EpsAccount.md) +- [EpsApprenticeshipLevy](docs/Model/EpsApprenticeshipLevy.md) +- [EpsDeMinimisStateAid](docs/Model/EpsDeMinimisStateAid.md) +- [EpsFinalSubmission](docs/Model/EpsFinalSubmission.md) +- [Establishment](docs/Model/Establishment.md) +- [EvcSettings](docs/Model/EvcSettings.md) +- [Exb](docs/Model/Exb.md) +- [ExbDeclarations](docs/Model/ExbDeclarations.md) +- [ExbEmployer](docs/Model/ExbEmployer.md) +- [ExbP11d](docs/Model/ExbP11d.md) +- [ExbP11dEmployee](docs/Model/ExbP11dEmployee.md) +- [ExbP11db](docs/Model/ExbP11db.md) +- [ExbP11dbClass1A](docs/Model/ExbP11dbClass1A.md) +- [ExbP11dbClass1AAdjustment](docs/Model/ExbP11dbClass1AAdjustment.md) +- [ExbP11dbClass1AAdjustments](docs/Model/ExbP11dbClass1AAdjustments.md) +- [ExbP11dbClass1ATotalBenefit](docs/Model/ExbP11dbClass1ATotalBenefit.md) +- [ExbReportResponse](docs/Model/ExbReportResponse.md) +- [ExpensesAndBenefits](docs/Model/ExpensesAndBenefits.md) +- [ExternalDataCompany](docs/Model/ExternalDataCompany.md) +- [ExternalDataProvider](docs/Model/ExternalDataProvider.md) +- [ExternalDataProviderId](docs/Model/ExternalDataProviderId.md) +- [ExternalDataProviderType](docs/Model/ExternalDataProviderType.md) +- [ExternalEmployeeMapping](docs/Model/ExternalEmployeeMapping.md) +- [ExternalEmployeeMappingStatus](docs/Model/ExternalEmployeeMappingStatus.md) +- [ExternalProviderConversation](docs/Model/ExternalProviderConversation.md) +- [FieldModification](docs/Model/FieldModification.md) +- [FixedCode](docs/Model/FixedCode.md) +- [FlexibleDrawdown](docs/Model/FlexibleDrawdown.md) +- [Fps](docs/Model/Fps.md) +- [FpsBenefit](docs/Model/FpsBenefit.md) +- [FpsCar](docs/Model/FpsCar.md) +- [FpsCarFuel](docs/Model/FpsCarFuel.md) +- [FpsEmployee](docs/Model/FpsEmployee.md) +- [FpsEmployeeDetails](docs/Model/FpsEmployeeDetails.md) +- [FpsEmployeeDetailsPartnerDetails](docs/Model/FpsEmployeeDetailsPartnerDetails.md) +- [FpsEmployeeFigsToDate](docs/Model/FpsEmployeeFigsToDate.md) +- [FpsEmployeeFlexibleDrawdown](docs/Model/FpsEmployeeFlexibleDrawdown.md) +- [FpsEmployeeNIlettersAndValues](docs/Model/FpsEmployeeNIlettersAndValues.md) +- [FpsEmployeePayment](docs/Model/FpsEmployeePayment.md) +- [FpsEmployeeSeconded](docs/Model/FpsEmployeeSeconded.md) +- [FpsEmployeeStarter](docs/Model/FpsEmployeeStarter.md) +- [FpsEmployeeStarterOccPension](docs/Model/FpsEmployeeStarterOccPension.md) +- [FpsEmployeeTaxCode](docs/Model/FpsEmployeeTaxCode.md) +- [FpsEmployeeTrivialCommutationPayment](docs/Model/FpsEmployeeTrivialCommutationPayment.md) +- [FpsEmployerPayIdChanged](docs/Model/FpsEmployerPayIdChanged.md) +- [FpsEmployment](docs/Model/FpsEmployment.md) +- [FpsFields](docs/Model/FpsFields.md) +- [FpsLateReason](docs/Model/FpsLateReason.md) +- [FpsPriorVersion](docs/Model/FpsPriorVersion.md) +- [FpsReportResponse](docs/Model/FpsReportResponse.md) +- [FromToDates](docs/Model/FromToDates.md) +- [FullPaymentSubmission](docs/Model/FullPaymentSubmission.md) +- [FullSummaryOfPayReport](docs/Model/FullSummaryOfPayReport.md) +- [FullSummaryOfPayReportLine](docs/Model/FullSummaryOfPayReportLine.md) +- [FullSummaryOfPayReportReportResponse](docs/Model/FullSummaryOfPayReportReportResponse.md) +- [FurloughCalculationBasis](docs/Model/FurloughCalculationBasis.md) +- [FurloughReport](docs/Model/FurloughReport.md) +- [FurloughReportLine](docs/Model/FurloughReportLine.md) +- [FurloughReportReportResponse](docs/Model/FurloughReportReportResponse.md) +- [Gender](docs/Model/Gender.md) +- [GenderPayGapLine](docs/Model/GenderPayGapLine.md) +- [GenderPayGapReport](docs/Model/GenderPayGapReport.md) +- [GenderPayGapReportReportResponse](docs/Model/GenderPayGapReportReportResponse.md) +- [GenderPayGapSnapShotDate](docs/Model/GenderPayGapSnapShotDate.md) +- [GovTalk](docs/Model/GovTalk.md) +- [GovTalkError](docs/Model/GovTalkError.md) +- [GovTalkSubmission](docs/Model/GovTalkSubmission.md) +- [GrossToNetReport](docs/Model/GrossToNetReport.md) +- [GrossToNetReportCisLine](docs/Model/GrossToNetReportCisLine.md) +- [GrossToNetReportLine](docs/Model/GrossToNetReportLine.md) +- [GrossToNetReportReportResponse](docs/Model/GrossToNetReportReportResponse.md) +- [HmrcDetails](docs/Model/HmrcDetails.md) +- [HmrcLiability](docs/Model/HmrcLiability.md) +- [HmrcPayment](docs/Model/HmrcPayment.md) +- [HolidayAccrual](docs/Model/HolidayAccrual.md) +- [HolidayAccrualDefaultRateType](docs/Model/HolidayAccrualDefaultRateType.md) +- [HolidayReport](docs/Model/HolidayReport.md) +- [HolidayReportLine](docs/Model/HolidayReportLine.md) +- [HolidayReportReportResponse](docs/Model/HolidayReportReportResponse.md) +- [HolidaySchemeDurationType](docs/Model/HolidaySchemeDurationType.md) +- [HolidayType](docs/Model/HolidayType.md) +- [HourlyPayReport](docs/Model/HourlyPayReport.md) +- [HourlyPayReportLine](docs/Model/HourlyPayReportLine.md) +- [HourlyPayReportReportResponse](docs/Model/HourlyPayReportReportResponse.md) +- [HoursNormallyWorked](docs/Model/HoursNormallyWorked.md) +- [HtmlEmailSettings](docs/Model/HtmlEmailSettings.md) +- [HtmlInsertionPoint](docs/Model/HtmlInsertionPoint.md) +- [IncrementRule](docs/Model/IncrementRule.md) +- [Invitation](docs/Model/Invitation.md) +- [Item](docs/Model/Item.md) +- [ItemListReportResponse](docs/Model/ItemListReportResponse.md) +- [JobStatus](docs/Model/JobStatus.md) +- [JobType](docs/Model/JobType.md) +- [JournalCsvFormat](docs/Model/JournalCsvFormat.md) +- [JournalTemplate](docs/Model/JournalTemplate.md) +- [JournalTokenType](docs/Model/JournalTokenType.md) +- [Leave](docs/Model/Leave.md) +- [LeaveAssumedPensionablePay](docs/Model/LeaveAssumedPensionablePay.md) +- [LeaveCalculationType](docs/Model/LeaveCalculationType.md) +- [LeaveCustomPayment](docs/Model/LeaveCustomPayment.md) +- [LeaveCustomProRataRule](docs/Model/LeaveCustomProRataRule.md) +- [LeavePayType](docs/Model/LeavePayType.md) +- [LeaveProRataRule](docs/Model/LeaveProRataRule.md) +- [LeaveSettings](docs/Model/LeaveSettings.md) +- [LeaveType](docs/Model/LeaveType.md) +- [LeaverDetails](docs/Model/LeaverDetails.md) +- [LgpsCivicaCasualHours](docs/Model/LgpsCivicaCasualHours.md) +- [LgpsCivicaPayrollNumber](docs/Model/LgpsCivicaPayrollNumber.md) +- [LgpsFund](docs/Model/LgpsFund.md) +- [LgpsIConnectFileType](docs/Model/LgpsIConnectFileType.md) +- [LgpsIConnectPayrollReference](docs/Model/LgpsIConnectPayrollReference.md) +- [LgpsIConnectSalaryType](docs/Model/LgpsIConnectSalaryType.md) +- [LgpsPayCategory](docs/Model/LgpsPayCategory.md) +- [LinkedPiw](docs/Model/LinkedPiw.md) +- [LinkedPiwResult](docs/Model/LinkedPiwResult.md) +- [Loan](docs/Model/Loan.md) +- [LoanBalancesReport](docs/Model/LoanBalancesReport.md) +- [LoanBalancesReportLine](docs/Model/LoanBalancesReportLine.md) +- [LoanBalancesReportReportResponse](docs/Model/LoanBalancesReportReportResponse.md) +- [LoanCharge](docs/Model/LoanCharge.md) +- [LogEntry](docs/Model/LogEntry.md) +- [LondonAllowance](docs/Model/LondonAllowance.md) +- [LondonAllowanceType](docs/Model/LondonAllowanceType.md) +- [LondonAllowanceValueType](docs/Model/LondonAllowanceValueType.md) +- [MailSettings](docs/Model/MailSettings.md) +- [MaritalStatus](docs/Model/MaritalStatus.md) +- [McrPayCategory](docs/Model/McrPayCategory.md) +- [MileageAllowancePaymentsRate](docs/Model/MileageAllowancePaymentsRate.md) +- [MileageVehicleType](docs/Model/MileageVehicleType.md) +- [MonthlyMinimum](docs/Model/MonthlyMinimum.md) +- [NationalInsuranceCalculation](docs/Model/NationalInsuranceCalculation.md) +- [NationalInsuranceCalculationBase](docs/Model/NationalInsuranceCalculationBase.md) +- [NationalInsuranceCalculationPeriodValues](docs/Model/NationalInsuranceCalculationPeriodValues.md) +- [NationalInsuranceCode](docs/Model/NationalInsuranceCode.md) +- [NationalMinimumWage](docs/Model/NationalMinimumWage.md) +- [NiLetterError](docs/Model/NiLetterError.md) +- [NiLetterValidationReport](docs/Model/NiLetterValidationReport.md) +- [NiLetterValidationReportLine](docs/Model/NiLetterValidationReportLine.md) +- [NiLetterValidationReportReportResponse](docs/Model/NiLetterValidationReportReportResponse.md) +- [NiYtdReport](docs/Model/NiYtdReport.md) +- [NiYtdReportReportResponse](docs/Model/NiYtdReportReportResponse.md) +- [NiYtdValue](docs/Model/NiYtdValue.md) +- [NicSummary](docs/Model/NicSummary.md) +- [NominalCodeMapping](docs/Model/NominalCodeMapping.md) +- [Note](docs/Model/Note.md) +- [NoteType](docs/Model/NoteType.md) +- [Nvr](docs/Model/Nvr.md) +- [NvrEmployee](docs/Model/NvrEmployee.md) +- [NvrEmployeeDetails](docs/Model/NvrEmployeeDetails.md) +- [NvrEmployment](docs/Model/NvrEmployment.md) +- [NvrRequest](docs/Model/NvrRequest.md) +- [OccupationalPolicy](docs/Model/OccupationalPolicy.md) +- [OccupationalPolicyEntitlement](docs/Model/OccupationalPolicyEntitlement.md) +- [OccupationalPolicyEntitlementRecalculationBasis](docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md) +- [OccupationalPolicyPayCalculatedOn](docs/Model/OccupationalPolicyPayCalculatedOn.md) +- [OccupationalPolicySicknessYear](docs/Model/OccupationalPolicySicknessYear.md) +- [OccupationalPolicyType](docs/Model/OccupationalPolicyType.md) +- [OccupationalSickLeaveHistory](docs/Model/OccupationalSickLeaveHistory.md) +- [OpeningBalances](docs/Model/OpeningBalances.md) +- [OpeningBalancesTotals](docs/Model/OpeningBalancesTotals.md) +- [OverseasEmployerDetails](docs/Model/OverseasEmployerDetails.md) +- [OverseasSecondmentStatus](docs/Model/OverseasSecondmentStatus.md) +- [P11](docs/Model/P11.md) +- [P11DAssetAvailable](docs/Model/P11DAssetAvailable.md) +- [P11DAssetAvailableCollection](docs/Model/P11DAssetAvailableCollection.md) +- [P11DAssetTransferredCollection](docs/Model/P11DAssetTransferredCollection.md) +- [P11DCar](docs/Model/P11DCar.md) +- [P11DCarCollection](docs/Model/P11DCarCollection.md) +- [P11DDescOther](docs/Model/P11DDescOther.md) +- [P11DLoan](docs/Model/P11DLoan.md) +- [P11DLoanCollection](docs/Model/P11DLoanCollection.md) +- [P11DOther](docs/Model/P11DOther.md) +- [P11DPaymentCollection](docs/Model/P11DPaymentCollection.md) +- [P11DSingleItem](docs/Model/P11DSingleItem.md) +- [P11Detailed](docs/Model/P11Detailed.md) +- [P11DetailedNiValues](docs/Model/P11DetailedNiValues.md) +- [P11DetailedReportResponse](docs/Model/P11DetailedReportResponse.md) +- [P11Line](docs/Model/P11Line.md) +- [P11NiAndStatPaymentsLine](docs/Model/P11NiAndStatPaymentsLine.md) +- [P11NiAndStatPaymentsTotalsLine](docs/Model/P11NiAndStatPaymentsTotalsLine.md) +- [P11NiValues](docs/Model/P11NiValues.md) +- [P11PayeLine](docs/Model/P11PayeLine.md) +- [P11PayeSummary](docs/Model/P11PayeSummary.md) +- [P11PayeTotalsLine](docs/Model/P11PayeTotalsLine.md) +- [P11ReportResponse](docs/Model/P11ReportResponse.md) +- [P11dCarFreeFuelWithdrawn](docs/Model/P11dCarFreeFuelWithdrawn.md) +- [P11dExpenses](docs/Model/P11dExpenses.md) +- [P11dVans](docs/Model/P11dVans.md) +- [P32](docs/Model/P32.md) +- [P32ReportResponse](docs/Model/P32ReportResponse.md) +- [PapdisDocument](docs/Model/PapdisDocument.md) +- [PapdisDocumentReportResponse](docs/Model/PapdisDocumentReportResponse.md) +- [PapdisEmployee](docs/Model/PapdisEmployee.md) +- [PapdisEmployeeAssessment](docs/Model/PapdisEmployeeAssessment.md) +- [PapdisEmployeeContact](docs/Model/PapdisEmployeeContact.md) +- [PapdisEmployeeContactPostalAddress](docs/Model/PapdisEmployeeContactPostalAddress.md) +- [PapdisEmployeeContribution](docs/Model/PapdisEmployeeContribution.md) +- [PapdisEmployeeExit](docs/Model/PapdisEmployeeExit.md) +- [PapdisEmployeeIdentity](docs/Model/PapdisEmployeeIdentity.md) +- [PapdisEmployeeName](docs/Model/PapdisEmployeeName.md) +- [PapdisEmployeePay](docs/Model/PapdisEmployeePay.md) +- [PapdisEmployer](docs/Model/PapdisEmployer.md) +- [PapdisEmployerContactPostalAddress](docs/Model/PapdisEmployerContactPostalAddress.md) +- [PapdisMessageFunctionCode](docs/Model/PapdisMessageFunctionCode.md) +- [PapdisPayrollPeriod](docs/Model/PapdisPayrollPeriod.md) +- [PapdisPensionProvider](docs/Model/PapdisPensionProvider.md) +- [PapdisVersion](docs/Model/PapdisVersion.md) +- [PartnerDetails](docs/Model/PartnerDetails.md) +- [PayBasis](docs/Model/PayBasis.md) +- [PayCode](docs/Model/PayCode.md) +- [PayCodeCalculationType](docs/Model/PayCodeCalculationType.md) +- [PayCodeMultiplierType](docs/Model/PayCodeMultiplierType.md) +- [PayCodeSet](docs/Model/PayCodeSet.md) +- [PayCodeVarianceLine](docs/Model/PayCodeVarianceLine.md) +- [PayElementReport](docs/Model/PayElementReport.md) +- [PayElementReportLine](docs/Model/PayElementReportLine.md) +- [PayElementReportReportResponse](docs/Model/PayElementReportReportResponse.md) +- [PayGradesReport](docs/Model/PayGradesReport.md) +- [PayGradesReportReportResponse](docs/Model/PayGradesReportReportResponse.md) +- [PayLine](docs/Model/PayLine.md) +- [PayMethod](docs/Model/PayMethod.md) +- [PayOptions](docs/Model/PayOptions.md) +- [PayOptionsImport](docs/Model/PayOptionsImport.md) +- [PayPeriodEventType](docs/Model/PayPeriodEventType.md) +- [PayPeriodTypes](docs/Model/PayPeriodTypes.md) +- [PayPeriods](docs/Model/PayPeriods.md) +- [PayRun](docs/Model/PayRun.md) +- [PayRunChanges](docs/Model/PayRunChanges.md) +- [PayRunCsvType](docs/Model/PayRunCsvType.md) +- [PayRunEntry](docs/Model/PayRunEntry.md) +- [PayRunEntrySortBy](docs/Model/PayRunEntrySortBy.md) +- [PayRunEntryWarningType](docs/Model/PayRunEntryWarningType.md) +- [PayRunJournal](docs/Model/PayRunJournal.md) +- [PayRunPayment](docs/Model/PayRunPayment.md) +- [PayRunState](docs/Model/PayRunState.md) +- [PayRunStateChange](docs/Model/PayRunStateChange.md) +- [PayRunStateChangeReason](docs/Model/PayRunStateChangeReason.md) +- [PayRunSummaryLine](docs/Model/PayRunSummaryLine.md) +- [PayRunSummaryLineIEnumerableReportResponse](docs/Model/PayRunSummaryLineIEnumerableReportResponse.md) +- [PayRunTotals](docs/Model/PayRunTotals.md) +- [PaySchedule](docs/Model/PaySchedule.md) +- [PaySchedulePeriod](docs/Model/PaySchedulePeriod.md) +- [PaySchedulePeriodEvent](docs/Model/PaySchedulePeriodEvent.md) +- [PaySchedulePeriodEventsConfig](docs/Model/PaySchedulePeriodEventsConfig.md) +- [PaySpineReport](docs/Model/PaySpineReport.md) +- [PaySpineReportLine](docs/Model/PaySpineReportLine.md) +- [PaySpineReportReportResponse](docs/Model/PaySpineReportReportResponse.md) +- [PaySpineYearsServiceEntitlementBasis](docs/Model/PaySpineYearsServiceEntitlementBasis.md) +- [Payee](docs/Model/Payee.md) +- [PayeeType](docs/Model/PayeeType.md) +- [PaylineCalculationData](docs/Model/PaylineCalculationData.md) +- [PaymentDateRule](docs/Model/PaymentDateRule.md) +- [PaymentDateType](docs/Model/PaymentDateType.md) +- [PaymentMethodAfterLeaving](docs/Model/PaymentMethodAfterLeaving.md) +- [PaymentsCsvMapping](docs/Model/PaymentsCsvMapping.md) +- [PaymentsCsvMappingColumn](docs/Model/PaymentsCsvMappingColumn.md) +- [PaymentsCsvMappingType](docs/Model/PaymentsCsvMappingType.md) +- [PayrollAnalysisCostBreakdownReport](docs/Model/PayrollAnalysisCostBreakdownReport.md) +- [PayrollAnalysisCostBreakdownReportLine](docs/Model/PayrollAnalysisCostBreakdownReportLine.md) +- [PayrollAnalysisCostBreakdownReportReportResponse](docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md) +- [PayrollAnalysisCostBreakdownReportValue](docs/Model/PayrollAnalysisCostBreakdownReportValue.md) +- [PayrollAnalysisEmployeeRoleBreakdownReport](docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md) +- [PayrollAnalysisEmployeeRoleBreakdownReportLine](docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md) +- [PayrollAnalysisEmployeeRoleBreakdownReportLineValue](docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md) +- [PayrollAnalysisEmployeeRoleBreakdownReportReportResponse](docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md) +- [PayrollValueType](docs/Model/PayrollValueType.md) +- [PayrunEmail](docs/Model/PayrunEmail.md) +- [PayrunPaymentsReport](docs/Model/PayrunPaymentsReport.md) +- [PayrunPaymentsReportReportResponse](docs/Model/PayrunPaymentsReportReportResponse.md) +- [Payslip](docs/Model/Payslip.md) +- [PayslipCustomisation](docs/Model/PayslipCustomisation.md) +- [PayslipLine](docs/Model/PayslipLine.md) +- [PayslipLineType](docs/Model/PayslipLineType.md) +- [PayslipReleaseType](docs/Model/PayslipReleaseType.md) +- [PayslipReportResponse](docs/Model/PayslipReportResponse.md) +- [PdfPaperMargins](docs/Model/PdfPaperMargins.md) +- [PdfPaperOrientation](docs/Model/PdfPaperOrientation.md) +- [PdfPaperSize](docs/Model/PdfPaperSize.md) +- [PdfPasswordType](docs/Model/PdfPasswordType.md) +- [Pension](docs/Model/Pension.md) +- [PensionAdministrator](docs/Model/PensionAdministrator.md) +- [PensionContributionLevelType](docs/Model/PensionContributionLevelType.md) +- [PensionContributionsSubmission](docs/Model/PensionContributionsSubmission.md) +- [PensionCsvFormat](docs/Model/PensionCsvFormat.md) +- [PensionEndReason](docs/Model/PensionEndReason.md) +- [PensionJoinReason](docs/Model/PensionJoinReason.md) +- [PensionMembershipReportLine](docs/Model/PensionMembershipReportLine.md) +- [PensionMembershipsReport](docs/Model/PensionMembershipsReport.md) +- [PensionMembershipsReportReportResponse](docs/Model/PensionMembershipsReportReportResponse.md) +- [PensionOpeningBalances](docs/Model/PensionOpeningBalances.md) +- [PensionPayCode](docs/Model/PensionPayCode.md) +- [PensionProvider](docs/Model/PensionProvider.md) +- [PensionRefund](docs/Model/PensionRefund.md) +- [PensionReportingType](docs/Model/PensionReportingType.md) +- [PensionRule](docs/Model/PensionRule.md) +- [PensionScheme](docs/Model/PensionScheme.md) +- [PensionSchemeNominalCodeMapping](docs/Model/PensionSchemeNominalCodeMapping.md) +- [PensionSchemeReportOptionsLgpsCivicaUpm](docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md) +- [PensionSchemeReportOptionsLgpsIConnect](docs/Model/PensionSchemeReportOptionsLgpsIConnect.md) +- [PensionSelection](docs/Model/PensionSelection.md) +- [PensionSummary](docs/Model/PensionSummary.md) +- [PensionSummaryCostBreakdown](docs/Model/PensionSummaryCostBreakdown.md) +- [PensionablePayDefinition](docs/Model/PensionablePayDefinition.md) +- [PensionerPayroll](docs/Model/PensionerPayroll.md) +- [PeriodValue](docs/Model/PeriodValue.md) +- [PeriodValuePeriodValues](docs/Model/PeriodValuePeriodValues.md) +- [PersonalDetails](docs/Model/PersonalDetails.md) +- [PricingBand](docs/Model/PricingBand.md) +- [PricingTable](docs/Model/PricingTable.md) +- [ProRataRule](docs/Model/ProRataRule.md) +- [ProcessingNote](docs/Model/ProcessingNote.md) +- [ProcessingNoteStatus](docs/Model/ProcessingNoteStatus.md) +- [RecoverableAmounts](docs/Model/RecoverableAmounts.md) +- [Report](docs/Model/Report.md) +- [ReportCustomCssOption](docs/Model/ReportCustomCssOption.md) +- [ReportFormat](docs/Model/ReportFormat.md) +- [ReportPack](docs/Model/ReportPack.md) +- [ReportResponse](docs/Model/ReportResponse.md) +- [ReportSortBy](docs/Model/ReportSortBy.md) +- [ReportTemplate](docs/Model/ReportTemplate.md) +- [RightToWork](docs/Model/RightToWork.md) +- [RightToWorkDocumentType](docs/Model/RightToWorkDocumentType.md) +- [RightToWorkReport](docs/Model/RightToWorkReport.md) +- [RightToWorkReportLine](docs/Model/RightToWorkReportLine.md) +- [RightToWorkReportReportResponse](docs/Model/RightToWorkReportReportResponse.md) +- [RoleBasis](docs/Model/RoleBasis.md) +- [RoleType](docs/Model/RoleType.md) +- [RtiAgent](docs/Model/RtiAgent.md) +- [RtiContact](docs/Model/RtiContact.md) +- [RtiEmployeeAddress](docs/Model/RtiEmployeeAddress.md) +- [RtiEmployeeName](docs/Model/RtiEmployeeName.md) +- [RtiSenderType](docs/Model/RtiSenderType.md) +- [RtiSubmissionSettings](docs/Model/RtiSubmissionSettings.md) +- [RtiValidationWarning](docs/Model/RtiValidationWarning.md) +- [RtiValidationWarningType](docs/Model/RtiValidationWarningType.md) +- [ServiceBand](docs/Model/ServiceBand.md) +- [ShiftWorkingPatternDay](docs/Model/ShiftWorkingPatternDay.md) +- [SmtpEncryption](docs/Model/SmtpEncryption.md) +- [SmtpSettings](docs/Model/SmtpSettings.md) +- [SpinePointReport](docs/Model/SpinePointReport.md) +- [SpinePointReportLine](docs/Model/SpinePointReportLine.md) +- [SpinePointReportReportResponse](docs/Model/SpinePointReportReportResponse.md) +- [StarterDeclaration](docs/Model/StarterDeclaration.md) +- [StarterDetails](docs/Model/StarterDetails.md) +- [StartersLeaversFilter](docs/Model/StartersLeaversFilter.md) +- [StatPayFrequency](docs/Model/StatPayFrequency.md) +- [StatutoryPay](docs/Model/StatutoryPay.md) +- [StatutoryPayReport](docs/Model/StatutoryPayReport.md) +- [StatutoryPayReportLine](docs/Model/StatutoryPayReportLine.md) +- [StatutoryPayReportReportResponse](docs/Model/StatutoryPayReportReportResponse.md) +- [StringDecimalKeyValuePair](docs/Model/StringDecimalKeyValuePair.md) +- [StringStringKeyValuePair](docs/Model/StringStringKeyValuePair.md) +- [StudentLoan](docs/Model/StudentLoan.md) +- [StudentLoanRecovered](docs/Model/StudentLoanRecovered.md) +- [SubmissionStatus](docs/Model/SubmissionStatus.md) +- [Tag](docs/Model/Tag.md) +- [TaxAndNi](docs/Model/TaxAndNi.md) +- [TaxBracket](docs/Model/TaxBracket.md) +- [TaxCodeChange](docs/Model/TaxCodeChange.md) +- [TaxCodeChangeReport](docs/Model/TaxCodeChangeReport.md) +- [TaxCodeChangeReportReportResponse](docs/Model/TaxCodeChangeReportReportResponse.md) +- [TaxCodeChangeValues](docs/Model/TaxCodeChangeValues.md) +- [TaxYear](docs/Model/TaxYear.md) +- [TaxYearConfig](docs/Model/TaxYearConfig.md) +- [TaxYearTypes](docs/Model/TaxYearTypes.md) +- [TeachersPensionAgeWarning](docs/Model/TeachersPensionAgeWarning.md) +- [TeachersPensionDetails](docs/Model/TeachersPensionDetails.md) +- [TeachersPensionEmploymentType](docs/Model/TeachersPensionEmploymentType.md) +- [TeachersPensionEoyLineItem](docs/Model/TeachersPensionEoyLineItem.md) +- [TeachersPensionEoyReport](docs/Model/TeachersPensionEoyReport.md) +- [TeachersPensionEoyReportReportResponse](docs/Model/TeachersPensionEoyReportReportResponse.md) +- [Tenant](docs/Model/Tenant.md) +- [TenantBillingSettings](docs/Model/TenantBillingSettings.md) +- [TenantEmail](docs/Model/TenantEmail.md) +- [TenantHtmlInsertion](docs/Model/TenantHtmlInsertion.md) +- [TenantItem](docs/Model/TenantItem.md) +- [TieredPension](docs/Model/TieredPension.md) +- [TieredPensionRate](docs/Model/TieredPensionRate.md) +- [UmbrellaPayment](docs/Model/UmbrellaPayment.md) +- [UmbrellaReconciliationReport](docs/Model/UmbrellaReconciliationReport.md) +- [UmbrellaReconciliationReportLine](docs/Model/UmbrellaReconciliationReportLine.md) +- [UmbrellaReconciliationReportReportResponse](docs/Model/UmbrellaReconciliationReportReportResponse.md) +- [UmbrellaSettings](docs/Model/UmbrellaSettings.md) +- [UsageBill](docs/Model/UsageBill.md) +- [User](docs/Model/User.md) +- [UserAuthorization](docs/Model/UserAuthorization.md) +- [UserCategory](docs/Model/UserCategory.md) +- [UserDisplayPreferences](docs/Model/UserDisplayPreferences.md) +- [UserIndustry](docs/Model/UserIndustry.md) +- [UserJobType](docs/Model/UserJobType.md) +- [UserRole](docs/Model/UserRole.md) +- [UserstartPage](docs/Model/UserstartPage.md) +- [UtmInfo](docs/Model/UtmInfo.md) +- [ValueOverride](docs/Model/ValueOverride.md) +- [VarianceReport](docs/Model/VarianceReport.md) +- [VarianceReportReportResponse](docs/Model/VarianceReportReportResponse.md) +- [VeteranDetails](docs/Model/VeteranDetails.md) +- [WarningsReport](docs/Model/WarningsReport.md) +- [WarningsReportLine](docs/Model/WarningsReportLine.md) +- [WarningsReportReportResponse](docs/Model/WarningsReportReportResponse.md) +- [Webhook](docs/Model/Webhook.md) +- [WebhookEvent](docs/Model/WebhookEvent.md) +- [WebhookPayload](docs/Model/WebhookPayload.md) +- [WorkerGroup](docs/Model/WorkerGroup.md) +- [WorkingPattern](docs/Model/WorkingPattern.md) +- [WorkingPatternHoursType](docs/Model/WorkingPatternHoursType.md) +- [WorkingPatternType](docs/Model/WorkingPatternType.md) +- [YearEnd](docs/Model/YearEnd.md) +- [YearEndTaxCodeChange](docs/Model/YearEndTaxCodeChange.md) +- [YtdReport](docs/Model/YtdReport.md) +- [YtdReportReportResponse](docs/Model/YtdReportReportResponse.md) +- [YtdValue](docs/Model/YtdValue.md) +- [ZeroPaidFilter](docs/Model/ZeroPaidFilter.md) + +## Authorization + +### Basic + +- **Type**: HTTP basic authentication + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + +duane@staffology.co.uk + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `v1` + - Package version: `1.0.0` + - Generator version: `7.11.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.PhpNextgenClientCodegen` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7f5598a --- /dev/null +++ b/composer.json @@ -0,0 +1,47 @@ +{ + "name": "synergitech/staffology-php", + "version": "1.0.0", + "description": "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^8.1", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.5", + "overtrue/phplint": "^9.0", + "phpunit/phpunit": "^9.0" + }, + "autoload": { + "psr-4": { "SynergiTech\\Staffology\\" : "src/" } + }, + "autoload-dev": { + "psr-4": { "SynergiTech\\Staffology\\Test\\" : "tests/" } + }, + "scripts": { + "test": [ + "@phplint" + ], + "phplint": "phplint" + } +} diff --git a/docs/Api/AccountApi.md b/docs/Api/AccountApi.md new file mode 100644 index 0000000..4fdcb1e --- /dev/null +++ b/docs/Api/AccountApi.md @@ -0,0 +1,1070 @@ +# SynergiTech\Staffology\AccountApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**activateAccount()**](AccountApi.md#activateAccount) | **POST** /account/activate | Activate an Account | +| [**changeEmailAddressAccount()**](AccountApi.md#changeEmailAddressAccount) | **POST** /account/emailaddress | Change Email Address | +| [**createApiKeyAccount()**](AccountApi.md#createApiKeyAccount) | **POST** /account/keys | Create ApiKey | +| [**createDemoEmployerAccount()**](AccountApi.md#createDemoEmployerAccount) | **POST** /account/demo | Create Demo Employer | +| [**deleteApiKeyAccount()**](AccountApi.md#deleteApiKeyAccount) | **DELETE** /account/keys/{id} | Delete ApiKey | +| [**getAccount()**](AccountApi.md#getAccount) | **GET** /account | Get Account Details | +| [**getApiKeyAccount()**](AccountApi.md#getApiKeyAccount) | **GET** /account/keys/{id} | Get ApiKey | +| [**getEmployerDefaultsAccount()**](AccountApi.md#getEmployerDefaultsAccount) | **GET** /account/employerdefaults | Get EmployerDefaults | +| [**getInvitationsAccount()**](AccountApi.md#getInvitationsAccount) | **GET** /account/invitations | Get Invitations | +| [**getTenantAccount()**](AccountApi.md#getTenantAccount) | **GET** /account/Tenant | Get Tenant | +| [**getUserEmployersAccount()**](AccountApi.md#getUserEmployersAccount) | **GET** /account/useremployers | List User Employers | +| [**listApiKeysAccount()**](AccountApi.md#listApiKeysAccount) | **GET** /account/keys | List ApiKeys | +| [**profileAccount()**](AccountApi.md#profileAccount) | **POST** /account/profile | Update Profile | +| [**setEmployerDefaultsAccount()**](AccountApi.md#setEmployerDefaultsAccount) | **PUT** /account/employerdefaults | Set EmployerDefaults | +| [**updatePhotoAccount()**](AccountApi.md#updatePhotoAccount) | **POST** /account/photo | Update Photo | +| [**verifyAccount()**](AccountApi.md#verifyAccount) | **POST** /account/verify | Re-send Verification Email | +| [**verifyResponseAccount()**](AccountApi.md#verifyResponseAccount) | **PUT** /account/verify/respond | Verify Email Address | + + +## `activateAccount()` + +```php +activateAccount($brandCode, $autoActivate, $user): \SynergiTech\Staffology\Model\User +``` + +Activate an Account + +New accounts need to be activated to confirm Terms and Conditions have been accepted. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$brandCode = 'brandCode_example'; // string +$autoActivate = false; // bool | If autoActivate is set to true, the account activation should be automatically performed without any user interaction +$user = new \SynergiTech\Staffology\Model\User(); // \SynergiTech\Staffology\Model\User + +try { + $result = $apiInstance->activateAccount($brandCode, $autoActivate, $user); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->activateAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **brandCode** | **string**| | [optional] | +| **autoActivate** | **bool**| If autoActivate is set to true, the account activation should be automatically performed without any user interaction | [optional] [default to false] | +| **user** | [**\SynergiTech\Staffology\Model\User**](../Model/User.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `changeEmailAddressAccount()` + +```php +changeEmailAddressAccount($emailAddress): \SynergiTech\Staffology\Model\User +``` + +Change Email Address + +The user.PendingEmailAddress will be set to the give address and a new verification email will be sent. Once the link in the email is clicked on then the user account will be updated to use the new email address + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$emailAddress = 'emailAddress_example'; // string + +try { + $result = $apiInstance->changeEmailAddressAccount($emailAddress); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->changeEmailAddressAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **emailAddress** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createApiKeyAccount()` + +```php +createApiKeyAccount($item): \SynergiTech\Staffology\Model\Item +``` + +Create ApiKey + +Creates a new APIKey. The only property that's required or used is Name. A new ApiKey will be generated and returned to you. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$item = new \SynergiTech\Staffology\Model\Item(); // \SynergiTech\Staffology\Model\Item + +try { + $result = $apiInstance->createApiKeyAccount($item); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->createApiKeyAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item** | [**\SynergiTech\Staffology\Model\Item**](../Model/Item.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createDemoEmployerAccount()` + +```php +createDemoEmployerAccount() +``` + +Create Demo Employer + +Creates a demo employer for the user + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->createDemoEmployerAccount(); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->createDemoEmployerAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteApiKeyAccount()` + +```php +deleteApiKeyAccount($id) +``` + +Delete ApiKey + + + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $apiInstance->deleteApiKeyAccount($id); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->deleteApiKeyAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAccount()` + +```php +getAccount($defaults, $defaultsKey): \SynergiTech\Staffology\Model\User +``` + +Get Account Details + +Returns the details for the authorised account. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$defaults = 'defaults_example'; // string | You can leave this empty, it's for internal use only. +$defaultsKey = 'defaultsKey_example'; // string | You can leave this empty, it's for internal use only. + +try { + $result = $apiInstance->getAccount($defaults, $defaultsKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **defaults** | **string**| You can leave this empty, it's for internal use only. | [optional] | +| **defaultsKey** | **string**| You can leave this empty, it's for internal use only. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiKeyAccount()` + +```php +getApiKeyAccount($id): \SynergiTech\Staffology\Model\Item +``` + +Get ApiKey + + + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->getApiKeyAccount($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getApiKeyAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployerDefaultsAccount()` + +```php +getEmployerDefaultsAccount(): \SynergiTech\Staffology\Model\EmployerDefaults +``` + +Get EmployerDefaults + +Get the EmployerDefaults for the currently authorised User. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getEmployerDefaultsAccount(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getEmployerDefaultsAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerDefaults**](../Model/EmployerDefaults.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getInvitationsAccount()` + +```php +getInvitationsAccount(): \SynergiTech\Staffology\Model\Item[] +``` + +Get Invitations + +Returns any pending Invitations for the authorised user. If the email address isn't yet verified then the Name displayed in the Item will be the users email address instead of the company name. Invitations cannot be accepted until the email address for the user is verified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getInvitationsAccount(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getInvitationsAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTenantAccount()` + +```php +getTenantAccount($tenantId, $key): \SynergiTech\Staffology\Model\Tenant +``` + +Get Tenant + +Returns branding details for the specified tenant. This is used by the web app and is unlikely to be used by third-parties. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$tenantId = 'tenantId_example'; // string +$key = 'key_example'; // string + +try { + $result = $apiInstance->getTenantAccount($tenantId, $key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getTenantAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenantId** | **string**| | [optional] | +| **key** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserEmployersAccount()` + +```php +getUserEmployersAccount($id): \SynergiTech\Staffology\Model\EmployerItem[] +``` + +List User Employers + +Returns a list of Employers that are associated to the given User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int | The Id of the user you want a list of employers for. + +try { + $result = $apiInstance->getUserEmployersAccount($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->getUserEmployersAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| The Id of the user you want a list of employers for. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerItem[]**](../Model/EmployerItem.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listApiKeysAccount()` + +```php +listApiKeysAccount(): \SynergiTech\Staffology\Model\Item[] +``` + +List ApiKeys + + + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listApiKeysAccount(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->listApiKeysAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `profileAccount()` + +```php +profileAccount($user): \SynergiTech\Staffology\Model\User +``` + +Update Profile + +Updates your profile. Only Salutation, FirstName, LastName, JobType, JobTitle, TelephoneNumber, BusinessName, Industry, Address and DisplayPrefs fields are updated. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$user = new \SynergiTech\Staffology\Model\User(); // \SynergiTech\Staffology\Model\User + +try { + $result = $apiInstance->profileAccount($user); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->profileAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**\SynergiTech\Staffology\Model\User**](../Model/User.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEmployerDefaultsAccount()` + +```php +setEmployerDefaultsAccount($employerDefaults): \SynergiTech\Staffology\Model\EmployerDefaults +``` + +Set EmployerDefaults + +Set the EmployerDefaults for the currently authorised User. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerDefaults = new \SynergiTech\Staffology\Model\EmployerDefaults(); // \SynergiTech\Staffology\Model\EmployerDefaults + +try { + $result = $apiInstance->setEmployerDefaultsAccount($employerDefaults); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->setEmployerDefaultsAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerDefaults** | [**\SynergiTech\Staffology\Model\EmployerDefaults**](../Model/EmployerDefaults.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerDefaults**](../Model/EmployerDefaults.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePhotoAccount()` + +```php +updatePhotoAccount($file): \SynergiTech\Staffology\Model\User +``` + +Update Photo + +Submit an image here and we'll upload it, resize it to 200px squared and set it as the image for your account. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->updatePhotoAccount($file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->updatePhotoAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `verifyAccount()` + +```php +verifyAccount() +``` + +Re-send Verification Email + +Users should receive an email to verify their email address when they first register or if they change their email address. However, this API endpoint can be used to re-send the email. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->verifyAccount(); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->verifyAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `verifyResponseAccount()` + +```php +verifyResponseAccount($u, $k): bool +``` + +Verify Email Address + +Used to process the link sent in an email to verify an email address. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$u = 'u_example'; // string | The value from the link in the email. +$k = 'k_example'; // string | The value from the link in the email. + +try { + $result = $apiInstance->verifyResponseAccount($u, $k); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AccountApi->verifyResponseAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **u** | **string**| The value from the link in the email. | [optional] | +| **k** | **string**| The value from the link in the email. | [optional] | + +### Return type + +**bool** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AnalysisCategoryApi.md b/docs/Api/AnalysisCategoryApi.md new file mode 100644 index 0000000..a79725f --- /dev/null +++ b/docs/Api/AnalysisCategoryApi.md @@ -0,0 +1,665 @@ +# SynergiTech\Staffology\AnalysisCategoryApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createAnalysisCategory()**](AnalysisCategoryApi.md#createAnalysisCategory) | **POST** /employers/{employerId}/analysiscategories | Create AnalysisCategory | +| [**createAnalysisCategoryCodeAnalysisCategory()**](AnalysisCategoryApi.md#createAnalysisCategoryCodeAnalysisCategory) | **POST** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes | Create AnalysisCategoryCode | +| [**deleteAnalysisCategory()**](AnalysisCategoryApi.md#deleteAnalysisCategory) | **DELETE** /employers/{employerId}/analysiscategories/{id} | Delete AnalysisCategory | +| [**deleteAnalysisCategoryCodeAnalysisCategory()**](AnalysisCategoryApi.md#deleteAnalysisCategoryCodeAnalysisCategory) | **DELETE** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Delete AnalysisCategoryCode | +| [**getAnalysisCategory()**](AnalysisCategoryApi.md#getAnalysisCategory) | **GET** /employers/{employerId}/analysiscategories/{id} | Get AnalysisCategory | +| [**getAnalysisCategoryCodeAnalysisCategory()**](AnalysisCategoryApi.md#getAnalysisCategoryCodeAnalysisCategory) | **GET** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Get AnalysisCategoryCode | +| [**getCodesAnalysisCategory()**](AnalysisCategoryApi.md#getCodesAnalysisCategory) | **GET** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes | List AnalysisCategoryCodes | +| [**indexAnalysisCategory()**](AnalysisCategoryApi.md#indexAnalysisCategory) | **GET** /employers/{employerId}/analysiscategories | List AnalysisCategories | +| [**updateAnalysisCategory()**](AnalysisCategoryApi.md#updateAnalysisCategory) | **PUT** /employers/{employerId}/analysiscategories/{id} | Update AnalysisCategory | +| [**updateAnalysisCategoryCodeAnalysisCategory()**](AnalysisCategoryApi.md#updateAnalysisCategoryCodeAnalysisCategory) | **PUT** /employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code} | Update AnalysisCategoryCode | + + +## `createAnalysisCategory()` + +```php +createAnalysisCategory($employerId, $contractAnalysisCategoryRequest): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse +``` + +Create AnalysisCategory + +Create a new AnalysisCategory for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$contractAnalysisCategoryRequest = new \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest(); // \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest + +try { + $result = $apiInstance->createAnalysisCategory($employerId, $contractAnalysisCategoryRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->createAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractAnalysisCategoryRequest** | [**\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest**](../Model/ContractAnalysisCategoryRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse**](../Model/ContractAnalysisCategoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createAnalysisCategoryCodeAnalysisCategory()` + +```php +createAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse +``` + +Create AnalysisCategoryCode + +Create the details of an existing AnalysisCategoryCode. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Analysis category belongs. +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Analysis category id for which you want to create code +$contractAnalysisCategoryCodeRequest = new \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest(); // \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest + +try { + $result = $apiInstance->createAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->createAnalysisCategoryCodeAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Analysis category belongs. | | +| **analysisCategoryId** | **string**| The Analysis category id for which you want to create code | | +| **contractAnalysisCategoryCodeRequest** | [**\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest**](../Model/ContractAnalysisCategoryCodeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse**](../Model/ContractAnalysisCategoryCodeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAnalysisCategory()` + +```php +deleteAnalysisCategory($employerId, $id) +``` + +Delete AnalysisCategory + +Deletes the specified AnalysisCategory. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteAnalysisCategory($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->deleteAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAnalysisCategoryCodeAnalysisCategory()` + +```php +deleteAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code) +``` + +Delete AnalysisCategoryCode + +Deletes the specified AnalysisCategoryCode. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Id of the AnalysisCategory to which the Code belongs. +$code = 'code_example'; // string | The code of the AnalysisCategoryCode you want to delete. + +try { + $apiInstance->deleteAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->deleteAnalysisCategoryCodeAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **analysisCategoryId** | **string**| The Id of the AnalysisCategory to which the Code belongs. | | +| **code** | **string**| The code of the AnalysisCategoryCode you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAnalysisCategory()` + +```php +getAnalysisCategory($employerId, $id): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse +``` + +Get AnalysisCategory + +Gets the AnalysisCategory specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the AnalysisCategory belongs. +$id = 'id_example'; // string | The Id of the AnalysisCategory which you want to fetch + +try { + $result = $apiInstance->getAnalysisCategory($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->getAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the AnalysisCategory belongs. | | +| **id** | **string**| The Id of the AnalysisCategory which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse**](../Model/ContractAnalysisCategoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAnalysisCategoryCodeAnalysisCategory()` + +```php +getAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse +``` + +Get AnalysisCategoryCode + +Gets the AnalysisCategoryCode specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Id of the AnalysisCategory to which the Code belongs. +$code = 'code_example'; // string | The code of the AnalysisCategoryCode you want to retrieve. + +try { + $result = $apiInstance->getAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->getAnalysisCategoryCodeAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **analysisCategoryId** | **string**| The Id of the AnalysisCategory to which the Code belongs. | | +| **code** | **string**| The code of the AnalysisCategoryCode you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse**](../Model/ContractAnalysisCategoryCodeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCodesAnalysisCategory()` + +```php +getCodesAnalysisCategory($employerId, $analysisCategoryId): \SynergiTech\Staffology\Model\Item[] +``` + +List AnalysisCategoryCodes + +Lists all AnalysisCategoryCodes for an Category. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Id of the Category for which you want to list Codes + +try { + $result = $apiInstance->getCodesAnalysisCategory($employerId, $analysisCategoryId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->getCodesAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **analysisCategoryId** | **string**| The Id of the Category for which you want to list Codes | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexAnalysisCategory()` + +```php +indexAnalysisCategory($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List AnalysisCategories + +Lists all AnalysisCategories for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list AnalysisCategories + +try { + $result = $apiInstance->indexAnalysisCategory($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->indexAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list AnalysisCategories | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAnalysisCategory()` + +```php +updateAnalysisCategory($employerId, $id, $contractAnalysisCategoryRequest): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse +``` + +Update AnalysisCategory + +Updates a AnalysisCategory for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$contractAnalysisCategoryRequest = new \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest(); // \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest + +try { + $result = $apiInstance->updateAnalysisCategory($employerId, $id, $contractAnalysisCategoryRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->updateAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **contractAnalysisCategoryRequest** | [**\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest**](../Model/ContractAnalysisCategoryRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse**](../Model/ContractAnalysisCategoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAnalysisCategoryCodeAnalysisCategory()` + +```php +updateAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse +``` + +Update AnalysisCategoryCode + +Updates the details of an existing AnalysisCategoryCode. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AnalysisCategoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Analysis category belongs. +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Analysis category id for which you want to update Analysis code +$code = 'code_example'; // string | The code of the Analysis category code you want to update. +$contractAnalysisCategoryCodeRequest = new \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest(); // \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest + +try { + $result = $apiInstance->updateAnalysisCategoryCodeAnalysisCategory($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnalysisCategoryApi->updateAnalysisCategoryCodeAnalysisCategory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Analysis category belongs. | | +| **analysisCategoryId** | **string**| The Analysis category id for which you want to update Analysis code | | +| **code** | **string**| The code of the Analysis category code you want to update. | | +| **contractAnalysisCategoryCodeRequest** | [**\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest**](../Model/ContractAnalysisCategoryCodeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse**](../Model/ContractAnalysisCategoryCodeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AttachmentOrderApi.md b/docs/Api/AttachmentOrderApi.md new file mode 100644 index 0000000..5a3b250 --- /dev/null +++ b/docs/Api/AttachmentOrderApi.md @@ -0,0 +1,610 @@ +# SynergiTech\Staffology\AttachmentOrderApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addDocumentAttachmentOrder()**](AttachmentOrderApi.md#addDocumentAttachmentOrder) | **POST** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents | Add Document | +| [**createAttachmentOrder()**](AttachmentOrderApi.md#createAttachmentOrder) | **POST** /employers/{employerId}/employees/{employeeId}/attachmentorders | Create AttachmentOrder | +| [**deleteAttachmentOrder()**](AttachmentOrderApi.md#deleteAttachmentOrder) | **DELETE** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Delete AttachmentOrder | +| [**deleteDocumentAttachmentOrder()**](AttachmentOrderApi.md#deleteDocumentAttachmentOrder) | **DELETE** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId} | Delete AttachmentOrder Document | +| [**getAttachmentOrder()**](AttachmentOrderApi.md#getAttachmentOrder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Get AttachmentOrder | +| [**getDocumentAttachmentOrder()**](AttachmentOrderApi.md#getDocumentAttachmentOrder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId} | Get AttachmentOrder Document | +| [**indexAttachmentOrder()**](AttachmentOrderApi.md#indexAttachmentOrder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders | List AttachmentOrders | +| [**paymentsAttachmentOrder()**](AttachmentOrderApi.md#paymentsAttachmentOrder) | **GET** /employers/{employerId}/employees/{employeeId}/attachmentorders/payments/{taxYear} | Get Payments | +| [**updateAttachmentOrder()**](AttachmentOrderApi.md#updateAttachmentOrder) | **PUT** /employers/{employerId}/employees/{employeeId}/attachmentorders/{id} | Update AttachmentOrder | + + +## `addDocumentAttachmentOrder()` + +```php +addDocumentAttachmentOrder($employerId, $employeeId, $id, $file) +``` + +Add Document + +Adds document to the AttachmentOrder + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the AttachmentOrder you want to attach documents to +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $apiInstance->addDocumentAttachmentOrder($employerId, $employeeId, $id, $file); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->addDocumentAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the AttachmentOrder you want to attach documents to | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createAttachmentOrder()` + +```php +createAttachmentOrder($employerId, $employeeId, $attachmentOrder) +``` + +Create AttachmentOrder + +Creates an AttachmentOrder for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$attachmentOrder = new \SynergiTech\Staffology\Model\AttachmentOrder(); // \SynergiTech\Staffology\Model\AttachmentOrder + +try { + $apiInstance->createAttachmentOrder($employerId, $employeeId, $attachmentOrder); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->createAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **attachmentOrder** | [**\SynergiTech\Staffology\Model\AttachmentOrder**](../Model/AttachmentOrder.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAttachmentOrder()` + +```php +deleteAttachmentOrder($employerId, $employeeId, $id) +``` + +Delete AttachmentOrder + +Deletes the AttachmentOrder specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the AttachmentOrder you want to delete. + +try { + $apiInstance->deleteAttachmentOrder($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->deleteAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the AttachmentOrder you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocumentAttachmentOrder()` + +```php +deleteDocumentAttachmentOrder($employerId, $employeeId, $id, $documentId) +``` + +Delete AttachmentOrder Document + +Deletes the document specified by the documentId for the AttachmentOrder specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to delete. + +try { + $apiInstance->deleteDocumentAttachmentOrder($employerId, $employeeId, $id, $documentId); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->deleteDocumentAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAttachmentOrder()` + +```php +getAttachmentOrder($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\AttachmentOrder +``` + +Get AttachmentOrder + +Gets the AttachmentOrder specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the AttachmentOrder you want to retrieve. + +try { + $result = $apiInstance->getAttachmentOrder($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->getAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the AttachmentOrder you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\AttachmentOrder**](../Model/AttachmentOrder.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentAttachmentOrder()` + +```php +getDocumentAttachmentOrder($employerId, $employeeId, $id, $documentId): \SplFileObject +``` + +Get AttachmentOrder Document + +Gets the document specified by the documentId for the AttachmentOrder specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to retrieve. + +try { + $result = $apiInstance->getDocumentAttachmentOrder($employerId, $employeeId, $id, $documentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->getDocumentAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to retrieve. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexAttachmentOrder()` + +```php +indexAttachmentOrder($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List AttachmentOrders + +Lists all AttachmentOrders for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexAttachmentOrder($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->indexAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `paymentsAttachmentOrder()` + +```php +paymentsAttachmentOrder($employerId, $employeeId, $taxYear): \SynergiTech\Staffology\Model\AttachmentOrderPayment[] +``` + +Get Payments + +Lists all Payments made to AttachmentOrders for the Employee in the given TaxYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->paymentsAttachmentOrder($employerId, $employeeId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->paymentsAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\AttachmentOrderPayment[]**](../Model/AttachmentOrderPayment.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAttachmentOrder()` + +```php +updateAttachmentOrder($employerId, $employeeId, $id, $attachmentOrder): \SynergiTech\Staffology\Model\AttachmentOrder +``` + +Update AttachmentOrder + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AttachmentOrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the AttachmentOrder you want to update. +$attachmentOrder = new \SynergiTech\Staffology\Model\AttachmentOrder(); // \SynergiTech\Staffology\Model\AttachmentOrder + +try { + $result = $apiInstance->updateAttachmentOrder($employerId, $employeeId, $id, $attachmentOrder); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AttachmentOrderApi->updateAttachmentOrder: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the AttachmentOrder you want to update. | | +| **attachmentOrder** | [**\SynergiTech\Staffology\Model\AttachmentOrder**](../Model/AttachmentOrder.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\AttachmentOrder**](../Model/AttachmentOrder.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AuditApi.md b/docs/Api/AuditApi.md new file mode 100644 index 0000000..e03eab6 --- /dev/null +++ b/docs/Api/AuditApi.md @@ -0,0 +1,80 @@ +# SynergiTech\Staffology\AuditApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**employerAuditListAudit()**](AuditApi.md#employerAuditListAudit) | **GET** /employers/{employerId}/audit | Employer Audit Log | + + +## `employerAuditListAudit()` + +```php +employerAuditListAudit($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +Employer Audit Log + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AuditApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Audit logs +$entity = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\EntityType(); // \SynergiTech\Staffology\Model\EntityType | Entity type name for which audit log should be retrieved +$entityId = 'entityId_example'; // string | Id of the entity for which audit log should be retrieved +$fromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Date from which records should be retrieved +$toDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Date till records should be retrieved +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->employerAuditListAudit($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuditApi->employerAuditListAudit: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Audit logs | | +| **entity** | [**\SynergiTech\Staffology\Model\EntityType**](../Model/.md)| Entity type name for which audit log should be retrieved | [optional] | +| **entityId** | **string**| Id of the entity for which audit log should be retrieved | [optional] | +| **fromDate** | **\DateTime**| Date from which records should be retrieved | [optional] | +| **toDate** | **\DateTime**| Date till records should be retrieved | [optional] | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AutoEnrolmentApi.md b/docs/Api/AutoEnrolmentApi.md new file mode 100644 index 0000000..79692db --- /dev/null +++ b/docs/Api/AutoEnrolmentApi.md @@ -0,0 +1,994 @@ +# SynergiTech\Staffology\AutoEnrolmentApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**assessAutoEnrolment()**](AutoEnrolmentApi.md#assessAutoEnrolment) | **POST** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments | Assess Employee for AutoEnrolment | +| [**deleteAutoEnrolment()**](AutoEnrolmentApi.md#deleteAutoEnrolment) | **DELETE** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id} | Delete AE Assessment | +| [**emailAllLettersAutoEnrolment()**](AutoEnrolmentApi.md#emailAllLettersAutoEnrolment) | **POST** /employers/{employerId}/autoenrolment/letters/email | Email All Letters | +| [**emailLetterAutoEnrolment()**](AutoEnrolmentApi.md#emailLetterAutoEnrolment) | **POST** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/email | Email Letter | +| [**getAutoEnrolment()**](AutoEnrolmentApi.md#getAutoEnrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id} | Get AE Assessment | +| [**getLastAutoEnrolment()**](AutoEnrolmentApi.md#getLastAutoEnrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/last | Get Last AE Assessment | +| [**getLetterAutoEnrolment()**](AutoEnrolmentApi.md#getLetterAutoEnrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter | Get Letter | +| [**listAutoEnrolment()**](AutoEnrolmentApi.md#listAutoEnrolment) | **GET** /employers/{employerId}/employees/{employeeId}/autoenrolment | Get AE Assessments | +| [**markLetterAsSentAutoEnrolment()**](AutoEnrolmentApi.md#markLetterAsSentAutoEnrolment) | **PUT** /employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/sent | Mark Letter as Sent | +| [**markLettersAsSentAutoEnrolment()**](AutoEnrolmentApi.md#markLettersAsSentAutoEnrolment) | **PUT** /employers/{employerId}/autoenrolment/letters/sent | Mark All Letters as Sent | +| [**pendingLettersAutoEnrolment()**](AutoEnrolmentApi.md#pendingLettersAutoEnrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending | Pending Letters | +| [**pendingLettersCountAutoEnrolment()**](AutoEnrolmentApi.md#pendingLettersCountAutoEnrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending/count | Pending Letters Count | +| [**pendingPostponementLettersAutoEnrolment()**](AutoEnrolmentApi.md#pendingPostponementLettersAutoEnrolment) | **GET** /employers/{employerId}/autoenrolment/letters/pending/postponement | Pending Postponement Letters | +| [**reenrolAutoEnrolment()**](AutoEnrolmentApi.md#reenrolAutoEnrolment) | **GET** /employers/{employerId}/autoenrolment/renrol | Cyclical Re-enrolment | +| [**setStateAutoEnrolment()**](AutoEnrolmentApi.md#setStateAutoEnrolment) | **PUT** /employers/{employerId}/employees/{employeeId}/autoenrolment/state | Update State | + + +## `assessAutoEnrolment()` + +```php +assessAutoEnrolment($employerId, $employeeId): \SynergiTech\Staffology\Model\AeAssessment +``` + +Assess Employee for AutoEnrolment + +Asseses an Employee for AutoEnrolment + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to assess + +try { + $result = $apiInstance->assessAutoEnrolment($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->assessAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee you want to assess | | + +### Return type + +[**\SynergiTech\Staffology\Model\AeAssessment**](../Model/AeAssessment.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAutoEnrolment()` + +```php +deleteAutoEnrolment($employerId, $employeeId, $id) +``` + +Delete AE Assessment + +Deletes the AeAssessment specified by the Id for the Employee specified by the EmployeeId. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for +$id = 'id_example'; // string | The Id of the Assessment. + +try { + $apiInstance->deleteAutoEnrolment($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->deleteAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | +| **id** | **string**| The Id of the Assessment. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailAllLettersAutoEnrolment()` + +```php +emailAllLettersAutoEnrolment($employerId) +``` + +Email All Letters + + + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs + +try { + $apiInstance->emailAllLettersAutoEnrolment($employerId); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->emailAllLettersAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailLetterAutoEnrolment()` + +```php +emailLetterAutoEnrolment($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\EmployerEmail +``` + +Email Letter + +Send via email letter that needs to be sent to an employee as a result of the assessment. The letter is then marked as having been sent. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for +$id = 'id_example'; // string | The Id of the Assessment + +try { + $result = $apiInstance->emailLetterAutoEnrolment($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->emailLetterAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | +| **id** | **string**| The Id of the Assessment | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEmail**](../Model/EmployerEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAutoEnrolment()` + +```php +getAutoEnrolment($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\AeAssessment +``` + +Get AE Assessment + +Returns the specified AeAssessment for the specified Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for +$id = 'id_example'; // string | The Id of the Assessment. + +try { + $result = $apiInstance->getAutoEnrolment($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->getAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | +| **id** | **string**| The Id of the Assessment. | | + +### Return type + +[**\SynergiTech\Staffology\Model\AeAssessment**](../Model/AeAssessment.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLastAutoEnrolment()` + +```php +getLastAutoEnrolment($employerId, $employeeId): \SynergiTech\Staffology\Model\AeAssessment +``` + +Get Last AE Assessment + +Returns the most recent AeAssessment for an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for + +try { + $result = $apiInstance->getLastAutoEnrolment($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->getLastAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | + +### Return type + +[**\SynergiTech\Staffology\Model\AeAssessment**](../Model/AeAssessment.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLetterAutoEnrolment()` + +```php +getLetterAutoEnrolment($employerId, $employeeId, $id, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get Letter + +Returns either a PDF or HTML (depending on accept header) of the letter that needs to be sent to an employee as a result of the assessment. The same ReportResponse model that is used for reports is used here. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for +$id = 'id_example'; // string | The Id of the Assessment +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->getLetterAutoEnrolment($employerId, $employeeId, $id, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->getLetterAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | +| **id** | **string**| The Id of the Assessment | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listAutoEnrolment()` + +```php +listAutoEnrolment($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +Get AE Assessments + +Returns all AE Assessments for the Employee specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve AE Assessments + +try { + $result = $apiInstance->listAutoEnrolment($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->listAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve AE Assessments | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markLetterAsSentAutoEnrolment()` + +```php +markLetterAsSentAutoEnrolment($employerId, $employeeId, $id) +``` + +Mark Letter as Sent + +Update an Assessment to mark the letter as sent. This is done automatically if you send the letter via email so you'd only need to use this is you are printing/posting the letter. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee the assessment is for +$id = 'id_example'; // string | The Id of the Assessment + +try { + $apiInstance->markLetterAsSentAutoEnrolment($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->markLetterAsSentAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee the assessment is for | | +| **id** | **string**| The Id of the Assessment | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markLettersAsSentAutoEnrolment()` + +```php +markLettersAsSentAutoEnrolment($employerId) +``` + +Mark All Letters as Sent + +Update an Assessments to mark all the letter as sent. This is done automatically if you send the letter via email so you'd only need to use this is you are printing/posting the letter. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs + +try { + $apiInstance->markLettersAsSentAutoEnrolment($employerId); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->markLettersAsSentAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pendingLettersAutoEnrolment()` + +```php +pendingLettersAutoEnrolment($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Pending Letters + +Returns all AE Assessments that are awaiting a letter to be sent + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->pendingLettersAutoEnrolment($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->pendingLettersAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pendingLettersCountAutoEnrolment()` + +```php +pendingLettersCountAutoEnrolment($employerId): \SynergiTech\Staffology\Model\ContractPendingLettersCountResponse +``` + +Pending Letters Count + +Returns the count of AE Assessments that are awaiting a letter to be sent and the count of the employees that are awaiting a postponement letter to be sent. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->pendingLettersCountAutoEnrolment($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->pendingLettersCountAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse**](../Model/ContractPendingLettersCountResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pendingPostponementLettersAutoEnrolment()` + +```php +pendingPostponementLettersAutoEnrolment($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Pending Postponement Letters + +Returns all employees that are awaiting a postponement letter to be sent. Because there is no associated AeAssessment they can't be returned with the other pending letters + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->pendingPostponementLettersAutoEnrolment($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->pendingPostponementLettersAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `reenrolAutoEnrolment()` + +```php +reenrolAutoEnrolment($employerId, $cyclicalReenrolmentDate): \SynergiTech\Staffology\Model\Item[] +``` + +Cyclical Re-enrolment + +Performs a Cyclical Re-enrolment. All employees that have opted-out or ceased membership will be re-assessed and auto-enrolled if necessary. The employers cyclical re-enrolment date will then be updated to the date provided. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$cyclicalReenrolmentDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The new Cyclical Re-enrolment Date for the Employer + +try { + $result = $apiInstance->reenrolAutoEnrolment($employerId, $cyclicalReenrolmentDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->reenrolAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **cyclicalReenrolmentDate** | **\DateTime**| The new Cyclical Re-enrolment Date for the Employer | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setStateAutoEnrolment()` + +```php +setStateAutoEnrolment($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported): \SynergiTech\Staffology\Model\AeAssessment +``` + +Update State + +Updates the AutoEnrolment state for an Employee. You would use this API call to process notices such as Opt Out, Opt In, etc. A new assessment is returned showing the result of the state change. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AutoEnrolmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to set the status for +$state = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\AeEmployeeState(); // \SynergiTech\Staffology\Model\AeEmployeeState | The AutoEnrolment State to set for the Employee +$status = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\AeStatus(); // \SynergiTech\Staffology\Model\AeStatus +$stateDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Optional. Will default to the current date +$pensionId = 'pensionId_example'; // string | Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn +$workerGroupId = 'workerGroupId_example'; // string | Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. +$startActionAlreadyReported = false; // bool +$endActionAlreadyReported = false; // bool + +try { + $result = $apiInstance->setStateAutoEnrolment($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AutoEnrolmentApi->setStateAutoEnrolment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee you want to set the status for | | +| **state** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](../Model/.md)| The AutoEnrolment State to set for the Employee | [optional] | +| **status** | [**\SynergiTech\Staffology\Model\AeStatus**](../Model/.md)| | [optional] | +| **stateDate** | **\DateTime**| Optional. Will default to the current date | [optional] | +| **pensionId** | **string**| Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn | [optional] | +| **workerGroupId** | **string**| Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. | [optional] | +| **startActionAlreadyReported** | **bool**| | [optional] [default to false] | +| **endActionAlreadyReported** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\AeAssessment**](../Model/AeAssessment.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AverageHolidayPayHistoryApi.md b/docs/Api/AverageHolidayPayHistoryApi.md new file mode 100644 index 0000000..7b94fa7 --- /dev/null +++ b/docs/Api/AverageHolidayPayHistoryApi.md @@ -0,0 +1,450 @@ +# SynergiTech\Staffology\AverageHolidayPayHistoryApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#createAverageHolidayPayHistory) | **POST** /{employerId}/employees/AverageHolidayPay/PayHistory | Create multiple AverageHolidayPayHistory for an Employer | +| [**deleteAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#deleteAverageHolidayPayHistory) | **DELETE** /{employerId}/employees/AverageHolidayPay/PayHistory/{id} | Delete an AverageHolidayPayHistory record | +| [**deleteByEmployeeIdAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#deleteByEmployeeIdAverageHolidayPayHistory) | **DELETE** /{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory | Delete all AverageHolidayPayHistory for an Employee | +| [**getByEmployeeAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#getByEmployeeAverageHolidayPayHistory) | **GET** /{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory/{taxYear} | List AverageHolidayPayHistory for Employee | +| [**getByEmployerAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#getByEmployerAverageHolidayPayHistory) | **GET** /{employerId}/employees/AverageHolidayPay/PayHistory | Get AverageHolidayPayHistory for Employer | +| [**importCsvAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#importCsvAverageHolidayPayHistory) | **POST** /{employerId}/employees/AverageHolidayPay/PayHistory/import | Import AverageHistoryPayHistory from csv file | +| [**updateAverageHolidayPayHistory()**](AverageHolidayPayHistoryApi.md#updateAverageHolidayPayHistory) | **PUT** /{employerId}/employees/AverageHolidayPay/PayHistory | Update multiple AverageHolidayPayHistory for an Employer | + + +## `createAverageHolidayPayHistory()` + +```php +createAverageHolidayPayHistory($employerId, $contractPayHistoryRequest) +``` + +Create multiple AverageHolidayPayHistory for an Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | +$contractPayHistoryRequest = array(new \SynergiTech\Staffology\Model\ContractPayHistoryRequest()); // \SynergiTech\Staffology\Model\ContractPayHistoryRequest[] | + +try { + $apiInstance->createAverageHolidayPayHistory($employerId, $contractPayHistoryRequest); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->createAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractPayHistoryRequest** | [**\SynergiTech\Staffology\Model\ContractPayHistoryRequest[]**](../Model/ContractPayHistoryRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAverageHolidayPayHistory()` + +```php +deleteAverageHolidayPayHistory($employerId, $id) +``` + +Delete an AverageHolidayPayHistory record + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$id = 'id_example'; // string | The pay history unique id + +try { + $apiInstance->deleteAverageHolidayPayHistory($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->deleteAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **id** | **string**| The pay history unique id | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteByEmployeeIdAverageHolidayPayHistory()` + +```php +deleteByEmployeeIdAverageHolidayPayHistory($employerId, $employeeId) +``` + +Delete all AverageHolidayPayHistory for an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee + +try { + $apiInstance->deleteByEmployeeIdAverageHolidayPayHistory($employerId, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->deleteByEmployeeIdAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getByEmployeeAverageHolidayPayHistory()` + +```php +getByEmployeeAverageHolidayPayHistory($employerId, $employeeId, $taxYear): \SynergiTech\Staffology\Model\ContractPayHistoryResponse[] +``` + +List AverageHolidayPayHistory for Employee + +List AverageHistoryPayHistory for the given Employee in the specified TaxYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Employee Id. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear for which you want the history. + +try { + $result = $apiInstance->getByEmployeeAverageHolidayPayHistory($employerId, $employeeId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->getByEmployeeAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Employee Id. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear for which you want the history. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]**](../Model/ContractPayHistoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getByEmployerAverageHolidayPayHistory()` + +```php +getByEmployerAverageHolidayPayHistory($employerId): \SynergiTech\Staffology\Model\ContractPayHistoryResponse[] +``` + +Get AverageHolidayPayHistory for Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->getByEmployerAverageHolidayPayHistory($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->getByEmployerAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]**](../Model/ContractPayHistoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importCsvAverageHolidayPayHistory()` + +```php +importCsvAverageHolidayPayHistory($employerId, $previewOnly, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import AverageHistoryPayHistory from csv file + +Import Pay History from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$previewOnly = false; // bool | Set to true and nothing will be imported but you'll be shown a preview of the data. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importCsvAverageHolidayPayHistory($employerId, $previewOnly, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->importCsvAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **previewOnly** | **bool**| Set to true and nothing will be imported but you'll be shown a preview of the data. | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAverageHolidayPayHistory()` + +```php +updateAverageHolidayPayHistory($employerId, $contractPayHistoryUpdateRequest) +``` + +Update multiple AverageHolidayPayHistory for an Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\AverageHolidayPayHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | +$contractPayHistoryUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest()); // \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[] | + +try { + $apiInstance->updateAverageHolidayPayHistory($employerId, $contractPayHistoryUpdateRequest); +} catch (Exception $e) { + echo 'Exception when calling AverageHolidayPayHistoryApi->updateAverageHolidayPayHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractPayHistoryUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]**](../Model/ContractPayHistoryUpdateRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/BenefitsApi.md b/docs/Api/BenefitsApi.md new file mode 100644 index 0000000..5ccc11b --- /dev/null +++ b/docs/Api/BenefitsApi.md @@ -0,0 +1,338 @@ +# SynergiTech\Staffology\BenefitsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createBenefits()**](BenefitsApi.md#createBenefits) | **POST** /employers/{employerId}/employees/{employeeId}/benefits | Create Benefit | +| [**deleteBenefits()**](BenefitsApi.md#deleteBenefits) | **DELETE** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Delete Benefit | +| [**getBenefits()**](BenefitsApi.md#getBenefits) | **GET** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Get Benefit | +| [**indexBenefits()**](BenefitsApi.md#indexBenefits) | **GET** /employers/{employerId}/employees/{employeeId}/benefits | List Benefits | +| [**updateBenefits()**](BenefitsApi.md#updateBenefits) | **PUT** /employers/{employerId}/employees/{employeeId}/benefits/{id} | Update Benefit | + + +## `createBenefits()` + +```php +createBenefits($employerId, $employeeId, $benefit) +``` + +Create Benefit + +Creates a Benefit for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BenefitsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$benefit = new \SynergiTech\Staffology\Model\Benefit(); // \SynergiTech\Staffology\Model\Benefit + +try { + $apiInstance->createBenefits($employerId, $employeeId, $benefit); +} catch (Exception $e) { + echo 'Exception when calling BenefitsApi->createBenefits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **benefit** | [**\SynergiTech\Staffology\Model\Benefit**](../Model/Benefit.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteBenefits()` + +```php +deleteBenefits($employerId, $employeeId, $id) +``` + +Delete Benefit + +Deletes the Benefit specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BenefitsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Benefit you want to delete. + +try { + $apiInstance->deleteBenefits($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling BenefitsApi->deleteBenefits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Benefit you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getBenefits()` + +```php +getBenefits($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Benefit +``` + +Get Benefit + +Gets the Benefit specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BenefitsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Benefit you want to retrieve. + +try { + $result = $apiInstance->getBenefits($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BenefitsApi->getBenefits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Benefit you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Benefit**](../Model/Benefit.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexBenefits()` + +```php +indexBenefits($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Benefits + +Lists all Benefits for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BenefitsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexBenefits($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BenefitsApi->indexBenefits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateBenefits()` + +```php +updateBenefits($employerId, $employeeId, $id, $benefit): \SynergiTech\Staffology\Model\Benefit +``` + +Update Benefit + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BenefitsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Benefit you want to update. +$benefit = new \SynergiTech\Staffology\Model\Benefit(); // \SynergiTech\Staffology\Model\Benefit + +try { + $result = $apiInstance->updateBenefits($employerId, $employeeId, $id, $benefit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BenefitsApi->updateBenefits: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Benefit you want to update. | | +| **benefit** | [**\SynergiTech\Staffology\Model\Benefit**](../Model/Benefit.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Benefit**](../Model/Benefit.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/BillingApi.md b/docs/Api/BillingApi.md new file mode 100644 index 0000000..19b947f --- /dev/null +++ b/docs/Api/BillingApi.md @@ -0,0 +1,504 @@ +# SynergiTech\Staffology\BillingApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**billBilling()**](BillingApi.md#billBilling) | **GET** /billing/bill/{id} | Get Bill | +| [**billCsvBilling()**](BillingApi.md#billCsvBilling) | **GET** /billing/bill/{id}/csv | Get Bill CSV | +| [**billsBilling()**](BillingApi.md#billsBilling) | **GET** /billing/bills | List Bills | +| [**confirmDirectDebitMandateBilling()**](BillingApi.md#confirmDirectDebitMandateBilling) | **GET** /billing/directdebit/confirm | Confirm Direct Debit Setup | +| [**deleteDirectDebitMandateBilling()**](BillingApi.md#deleteDirectDebitMandateBilling) | **DELETE** /billing/directdebit | Delete DirectDebitMandate | +| [**directDebitMandateBilling()**](BillingApi.md#directDebitMandateBilling) | **GET** /billing/directdebit | Get DirectDebitMandate | +| [**getUsageStatsBilling()**](BillingApi.md#getUsageStatsBilling) | **GET** /billing/usage-stats | Get UsageStats Report | +| [**setupDirectDebitMandateBilling()**](BillingApi.md#setupDirectDebitMandateBilling) | **GET** /billing/directdebit/setup | Setup DirectDebitMandate | + + +## `billBilling()` + +```php +billBilling($id): \SynergiTech\Staffology\Model\UsageBill +``` + +Get Bill + +Returns the specified UsageBill + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->billBilling($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->billBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\UsageBill**](../Model/UsageBill.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `billCsvBilling()` + +```php +billCsvBilling($id): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get Bill CSV + +Returns the specified UsageBill as a CSV file + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->billCsvBilling($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->billCsvBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `billsBilling()` + +```php +billsBilling(): \SynergiTech\Staffology\Model\Item[] +``` + +List Bills + +Returns a list of UsageBills for the authenticated account + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->billsBilling(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->billsBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `confirmDirectDebitMandateBilling()` + +```php +confirmDirectDebitMandateBilling($redirectFlowId) +``` + +Confirm Direct Debit Setup + +This endpoint is called by an external provider. You will never have to call this endpoint yourself. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$redirectFlowId = 'redirectFlowId_example'; // string + +try { + $apiInstance->confirmDirectDebitMandateBilling($redirectFlowId); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->confirmDirectDebitMandateBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **redirectFlowId** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDirectDebitMandateBilling()` + +```php +deleteDirectDebitMandateBilling() +``` + +Delete DirectDebitMandate + +Cancels and deletes the Direct Debit Mandate for the account + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->deleteDirectDebitMandateBilling(); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->deleteDirectDebitMandateBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `directDebitMandateBilling()` + +```php +directDebitMandateBilling(): \SynergiTech\Staffology\Model\DirectDebitMandate +``` + +Get DirectDebitMandate + +Returns the DirectDebitMandate for the authenticated account + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->directDebitMandateBilling(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->directDebitMandateBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\DirectDebitMandate**](../Model/DirectDebitMandate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUsageStatsBilling()` + +```php +getUsageStatsBilling($fromDate, $toDate, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get UsageStats Report + +Returns usage statistics data for all employers the logged in user has access to for the given date range. If either of the dates are not provided then the values are defaulted to the first and last date of the previous calendar month. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$fromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$toDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->getUsageStatsBilling($fromDate, $toDate, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->getUsageStatsBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fromDate** | **\DateTime**| | [optional] | +| **toDate** | **\DateTime**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setupDirectDebitMandateBilling()` + +```php +setupDirectDebitMandateBilling($returnUrl): string +``` + +Setup DirectDebitMandate + +Returns a Url to redirect a user to in order to start the process of setting up a Direct Debit Mandate. Once the process is complete then the user is sent to the URL specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BillingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$returnUrl = 'returnUrl_example'; // string + +try { + $result = $apiInstance->setupDirectDebitMandateBilling($returnUrl); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->setupDirectDebitMandateBilling: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **returnUrl** | **string**| | [optional] | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/BureauApi.md b/docs/Api/BureauApi.md new file mode 100644 index 0000000..b69847c --- /dev/null +++ b/docs/Api/BureauApi.md @@ -0,0 +1,384 @@ +# SynergiTech\Staffology\BureauApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**employersBureau()**](BureauApi.md#employersBureau) | **GET** /bureau/employers | List Employers | +| [**getProcessorUserBureau()**](BureauApi.md#getProcessorUserBureau) | **GET** /employers/{employerId}/bureau/settings/processor | Get Processor | +| [**getReportPackBureau()**](BureauApi.md#getReportPackBureau) | **GET** /employers/{employerId}/bureau/settings/reportpack | Get BureauSettings ReportPack | +| [**getSettingsBureau()**](BureauApi.md#getSettingsBureau) | **GET** /employers/{employerId}/bureau/settings | Get BureauSettings | +| [**processorUsersBureau()**](BureauApi.md#processorUsersBureau) | **GET** /bureau/processors | List Allocated Processors | +| [**updateSettingsBureau()**](BureauApi.md#updateSettingsBureau) | **PUT** /employers/{employerId}/bureau/settings | Update BureauSettings | + + +## `employersBureau()` + +```php +employersBureau($processor): \SynergiTech\Staffology\Model\Item[] +``` + +List Employers + +Returns a list of Employers. This differs from the main Employer list end point in that the metadata included is more relevant to Bureau activities It also gives you the ability to filter based on the allocated Processor. Note: an entry is returned for each PaySchedule. So if the employer has both a Monthly and a Weekly PaySchedule then they'll appear twice + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$processor = 'processor_example'; // string | The Id of the Processor (User) you want to restrict the list to. + +try { + $result = $apiInstance->employersBureau($processor); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->employersBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **processor** | **string**| The Id of the Processor (User) you want to restrict the list to. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProcessorUserBureau()` + +```php +getProcessorUserBureau($employerId): \SynergiTech\Staffology\Model\User +``` + +Get Processor + +If a Processor is specified in the BureauSettings then it is returned as a User, otherwise a 404 is returned + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getProcessorUserBureau($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->getProcessorUserBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getReportPackBureau()` + +```php +getReportPackBureau($employerId): \SynergiTech\Staffology\Model\ReportPack +``` + +Get BureauSettings ReportPack + +If a ReportPack is specified in the BureauSettings then it is returned, otherwise an empty ReportPAck is returned + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getReportPackBureau($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->getReportPackBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSettingsBureau()` + +```php +getSettingsBureau($employerId): \SynergiTech\Staffology\Model\BureauSettings +``` + +Get BureauSettings + +Returns the BureauSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getSettingsBureau($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->getSettingsBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\BureauSettings**](../Model/BureauSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `processorUsersBureau()` + +```php +processorUsersBureau(): \SynergiTech\Staffology\Model\Item[] +``` + +List Allocated Processors + +Returns a list of Users that have one or more Employers allocated to them as the Processor + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->processorUsersBureau(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->processorUsersBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSettingsBureau()` + +```php +updateSettingsBureau($employerId, $bureauSettings): \SynergiTech\Staffology\Model\BureauSettings +``` + +Update BureauSettings + +Updates the BureauSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\BureauApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$bureauSettings = new \SynergiTech\Staffology\Model\BureauSettings(); // \SynergiTech\Staffology\Model\BureauSettings + +try { + $result = $apiInstance->updateSettingsBureau($employerId, $bureauSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BureauApi->updateSettingsBureau: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **bureauSettings** | [**\SynergiTech\Staffology\Model\BureauSettings**](../Model/BureauSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\BureauSettings**](../Model/BureauSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/Cis300Api.md b/docs/Api/Cis300Api.md new file mode 100644 index 0000000..8b465e8 --- /dev/null +++ b/docs/Api/Cis300Api.md @@ -0,0 +1,607 @@ +# SynergiTech\Staffology\Cis300Api + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createCis300()**](Cis300Api.md#createCis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear} | Create Cis300 | +| [**deleteCis300()**](Cis300Api.md#deleteCis300) | **DELETE** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Delete Cis300 | +| [**getCis300()**](Cis300Api.md#getCis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Get Cis300 | +| [**getXmlRequestCis300()**](Cis300Api.md#getXmlRequestCis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear}/{id}/xml/request | Get XML Request | +| [**listCis300()**](Cis300Api.md#listCis300) | **GET** /employers/{employerId}/rti/cis300/{taxYear} | List Cis300 | +| [**markAsAcceptedCis300()**](Cis300Api.md#markAsAcceptedCis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**requiringAttentionCis300()**](Cis300Api.md#requiringAttentionCis300) | **GET** /employers/{employerId}/rti/cis300/requiringattention | Cis300 Requiring Attention | +| [**submitCis300()**](Cis300Api.md#submitCis300) | **POST** /employers/{employerId}/rti/cis300/{taxYear}/{id}/submit | Submit Cis300 | +| [**updateCis300()**](Cis300Api.md#updateCis300) | **PUT** /employers/{employerId}/rti/cis300/{taxYear}/{id} | Update Cis300 | + + +## `createCis300()` + +```php +createCis300($employerId, $taxYear, $cis300): \SynergiTech\Staffology\Model\Cis300 +``` + +Create Cis300 + +A Cis300 is automatically created for each Tax Month that you pay a Subcontractor. You would only manually create one if you are intending to submit a nil return. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$cis300 = new \SynergiTech\Staffology\Model\Cis300(); // \SynergiTech\Staffology\Model\Cis300 + +try { + $result = $apiInstance->createCis300($employerId, $taxYear, $cis300); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->createCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **cis300** | [**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteCis300()` + +```php +deleteCis300($employerId, $taxYear, $id) +``` + +Delete Cis300 + +Not implemented, CIS300s cannot be deleted + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteCis300($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->deleteCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCis300()` + +```php +getCis300($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Cis300 +``` + +Get Cis300 + +Retrieves a Cis300 + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getCis300($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->getCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestCis300()` + +```php +getXmlRequestCis300($employerId, $taxYear, $id): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getXmlRequestCis300($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->getXmlRequestCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listCis300()` + +```php +listCis300($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List Cis300 + +Returns all Cis300s for the given tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listCis300($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->listCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedCis300()` + +```php +markAsAcceptedCis300($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Cis300 +``` + +Mark as Sent + +Marks a Cis300 as having been sent to HMRC and accepted by them You only use this method if the request has been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedCis300($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->markAsAcceptedCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionCis300()` + +```php +requiringAttentionCis300($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Cis300 Requiring Attention + +Returns all Cis300 that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionCis300($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->requiringAttentionCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitCis300()` + +```php +submitCis300($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\Cis300 +``` + +Submit Cis300 + +Submits an existing Cis300 to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool | If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted + +try { + $result = $apiInstance->submitCis300($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->submitCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCis300()` + +```php +updateCis300($employerId, $taxYear, $id, $cis300): \SynergiTech\Staffology\Model\Cis300 +``` + +Update Cis300 + +Updates an existing Cis300. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\Cis300Api( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$cis300 = new \SynergiTech\Staffology\Model\Cis300(); // \SynergiTech\Staffology\Model\Cis300 + +try { + $result = $apiInstance->updateCis300($employerId, $taxYear, $id, $cis300); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Cis300Api->updateCis300: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **cis300** | [**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300**](../Model/Cis300.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CisVerificationApi.md b/docs/Api/CisVerificationApi.md new file mode 100644 index 0000000..ec6fe31 --- /dev/null +++ b/docs/Api/CisVerificationApi.md @@ -0,0 +1,607 @@ +# SynergiTech\Staffology\CisVerificationApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createCisVerification()**](CisVerificationApi.md#createCisVerification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear} | Create CisVerificationRequest | +| [**deleteCisVerification()**](CisVerificationApi.md#deleteCisVerification) | **DELETE** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Delete CisVerificationRequest | +| [**getCisVerification()**](CisVerificationApi.md#getCisVerification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Get CisVerificationRequest | +| [**getXmlRequestCisVerification()**](CisVerificationApi.md#getXmlRequestCisVerification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/xml/request | Get XML Request | +| [**listCisVerification()**](CisVerificationApi.md#listCisVerification) | **GET** /employers/{employerId}/rti/cis-verification/{taxYear} | List CisVerificationRequest | +| [**markAsAcceptedCisVerification()**](CisVerificationApi.md#markAsAcceptedCisVerification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**requiringAttentionCisVerification()**](CisVerificationApi.md#requiringAttentionCisVerification) | **GET** /employers/{employerId}/rti/cis-verification/requiringattention | CisVerificationRequest Requiring Attention | +| [**submitCisVerification()**](CisVerificationApi.md#submitCisVerification) | **POST** /employers/{employerId}/rti/cis-verification/{taxYear}/{id}/submit | Submit CisVerificationRequest | +| [**updateCisVerification()**](CisVerificationApi.md#updateCisVerification) | **PUT** /employers/{employerId}/rti/cis-verification/{taxYear}/{id} | Update CisVerificationRequest | + + +## `createCisVerification()` + +```php +createCisVerification($employerId, $taxYear, $cisVerification): \SynergiTech\Staffology\Model\CisVerification +``` + +Create CisVerificationRequest + +Creates a new CIS Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$cisVerification = new \SynergiTech\Staffology\Model\CisVerification(); // \SynergiTech\Staffology\Model\CisVerification + +try { + $result = $apiInstance->createCisVerification($employerId, $taxYear, $cisVerification); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->createCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **cisVerification** | [**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteCisVerification()` + +```php +deleteCisVerification($employerId, $taxYear, $id) +``` + +Delete CisVerificationRequest + +Deletes the CIS Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteCisVerification($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->deleteCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCisVerification()` + +```php +getCisVerification($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\CisVerification +``` + +Get CisVerificationRequest + +Retrieves the CIS Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getCisVerification($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->getCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestCisVerification()` + +```php +getXmlRequestCisVerification($employerId, $taxYear, $id): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getXmlRequestCisVerification($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->getXmlRequestCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listCisVerification()` + +```php +listCisVerification($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List CisVerificationRequest + +Returns all CIS Verification Requests for the given tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listCisVerification($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->listCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedCisVerification()` + +```php +markAsAcceptedCisVerification($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\CisVerification +``` + +Mark as Sent + +Marks a CIS Verification Request as having been sent to HMRC and accepted by them You only use this method if the request has been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedCisVerification($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->markAsAcceptedCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionCisVerification()` + +```php +requiringAttentionCisVerification($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +CisVerificationRequest Requiring Attention + +Returns all CIS Verification Requests that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionCisVerification($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->requiringAttentionCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitCisVerification()` + +```php +submitCisVerification($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\CisVerification +``` + +Submit CisVerificationRequest + +Submits an existing CIS Verification Request to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool | If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted + +try { + $result = $apiInstance->submitCisVerification($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->submitCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCisVerification()` + +```php +updateCisVerification($employerId, $taxYear, $id, $cisVerification): \SynergiTech\Staffology\Model\CisVerification +``` + +Update CisVerificationRequest + +Updates an existing CIS Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CisVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$cisVerification = new \SynergiTech\Staffology\Model\CisVerification(); // \SynergiTech\Staffology\Model\CisVerification + +try { + $result = $apiInstance->updateCisVerification($employerId, $taxYear, $id, $cisVerification); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CisVerificationApi->updateCisVerification: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **cisVerification** | [**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CisVerification**](../Model/CisVerification.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CostCentreApi.md b/docs/Api/CostCentreApi.md new file mode 100644 index 0000000..2f7aec0 --- /dev/null +++ b/docs/Api/CostCentreApi.md @@ -0,0 +1,527 @@ +# SynergiTech\Staffology\CostCentreApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createCostCentre()**](CostCentreApi.md#createCostCentre) | **POST** /employers/{employerId}/costcentres | Create Cost Centre | +| [**deleteCostCentre()**](CostCentreApi.md#deleteCostCentre) | **DELETE** /employers/{employerId}/costcentres/{code} | Delete Cost Centre (deprecated) | +| [**deleteCostCentreCostCentre()**](CostCentreApi.md#deleteCostCentreCostCentre) | **DELETE** /employers/{employerId}/costcentres | Delete Cost Centre | +| [**getCostCentre()**](CostCentreApi.md#getCostCentre) | **GET** /employers/{employerId}/costcentres/{code} | Get Cost Centre (deprecated) | +| [**getCostCentreCostCentre()**](CostCentreApi.md#getCostCentreCostCentre) | **GET** /employers/{employerId}/costcentres/costcentre | Get Cost Centre | +| [**indexCostCentre()**](CostCentreApi.md#indexCostCentre) | **GET** /employers/{employerId}/costcentres | List Cost Centres | +| [**updateCostCentre()**](CostCentreApi.md#updateCostCentre) | **PUT** /employers/{employerId}/costcentres/{code} | Update Cost Centre (deprecated) | +| [**updateCostCentreCostCentre()**](CostCentreApi.md#updateCostCentreCostCentre) | **PUT** /employers/{employerId}/costcentres | Update Cost Centre | + + +## `createCostCentre()` + +```php +createCostCentre($employerId, $costCentre): \SynergiTech\Staffology\Model\CostCentre +``` + +Create Cost Centre + +Creates a new CostCentre for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$costCentre = new \SynergiTech\Staffology\Model\CostCentre(); // \SynergiTech\Staffology\Model\CostCentre + +try { + $result = $apiInstance->createCostCentre($employerId, $costCentre); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->createCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **costCentre** | [**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteCostCentre()` + +```php +deleteCostCentre($employerId, $code) +``` + +Delete Cost Centre (deprecated) + +Deletes the specified Cost Centre. Use the other Delete endpoint that supports non-alphanumeric characters for a cost centre code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string + +try { + $apiInstance->deleteCostCentre($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->deleteCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteCostCentreCostCentre()` + +```php +deleteCostCentreCostCentre($employerId, $code) +``` + +Delete Cost Centre + +Deletes the specified Cost Centre. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Cost Centre belongs. +$code = 'code_example'; // string | The code of the Cost Centre you want to delete. + +try { + $apiInstance->deleteCostCentreCostCentre($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->deleteCostCentreCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Cost Centre belongs. | | +| **code** | **string**| The code of the Cost Centre you want to delete. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCostCentre()` + +```php +getCostCentre($employerId, $code): \SynergiTech\Staffology\Model\CostCentre +``` + +Get Cost Centre (deprecated) + +Gets the Cost Centres specified. Use the other GET endpoint that supports non-alphanumeric characters for a cost centre code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Department belongs. +$code = 'code_example'; // string + +try { + $result = $apiInstance->getCostCentre($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->getCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Department belongs. | | +| **code** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCostCentreCostCentre()` + +```php +getCostCentreCostCentre($employerId, $code): \SynergiTech\Staffology\Model\CostCentre +``` + +Get Cost Centre + +Gets the Cost Centres specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Department belongs. +$code = 'code_example'; // string | The existing code of the Cost Centre you want to get. + +try { + $result = $apiInstance->getCostCentreCostCentre($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->getCostCentreCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Department belongs. | | +| **code** | **string**| The existing code of the Cost Centre you want to get. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexCostCentre()` + +```php +indexCostCentre($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Cost Centres + +Lists all Cost Centres for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Cost Centres + +try { + $result = $apiInstance->indexCostCentre($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->indexCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Cost Centres | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCostCentre()` + +```php +updateCostCentre($employerId, $code, $costCentre): \SynergiTech\Staffology\Model\CostCentre +``` + +Update Cost Centre (deprecated) + +Updates a Cost Centre for the Employer. Use the other Update endpoint that supports non-alphanumeric characters for a cost centre code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string +$costCentre = new \SynergiTech\Staffology\Model\CostCentre(); // \SynergiTech\Staffology\Model\CostCentre + +try { + $result = $apiInstance->updateCostCentre($employerId, $code, $costCentre); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->updateCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | +| **costCentre** | [**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCostCentreCostCentre()` + +```php +updateCostCentreCostCentre($employerId, $code, $costCentre): \SynergiTech\Staffology\Model\CostCentre +``` + +Update Cost Centre + +Updates a Cost Centre for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\CostCentreApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Cost Centre belongs. +$code = 'code_example'; // string | The existing code of the Cost Centre you want to get. +$costCentre = new \SynergiTech\Staffology\Model\CostCentre(); // \SynergiTech\Staffology\Model\CostCentre | The new values for the Cost Centre you want to update + +try { + $result = $apiInstance->updateCostCentreCostCentre($employerId, $code, $costCentre); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CostCentreApi->updateCostCentreCostCentre: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Cost Centre belongs. | | +| **code** | **string**| The existing code of the Cost Centre you want to get. | [optional] | +| **costCentre** | [**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md)| The new values for the Cost Centre you want to update | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostCentre**](../Model/CostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/DepartmentApi.md b/docs/Api/DepartmentApi.md new file mode 100644 index 0000000..94083d9 --- /dev/null +++ b/docs/Api/DepartmentApi.md @@ -0,0 +1,527 @@ +# SynergiTech\Staffology\DepartmentApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createDepartment()**](DepartmentApi.md#createDepartment) | **POST** /employers/{employerId}/departments | Create Department | +| [**deleteDepartment()**](DepartmentApi.md#deleteDepartment) | **DELETE** /employers/{employerId}/departments/{code} | Delete Department (deprecated) | +| [**deleteDepartmentDepartment()**](DepartmentApi.md#deleteDepartmentDepartment) | **DELETE** /employers/{employerId}/departments/department | Delete Department | +| [**getDepartment()**](DepartmentApi.md#getDepartment) | **GET** /employers/{employerId}/departments/{code} | Get Department (deprecated) | +| [**getDepartmentDepartment()**](DepartmentApi.md#getDepartmentDepartment) | **GET** /employers/{employerId}/departments/Department | Get Department | +| [**indexDepartment()**](DepartmentApi.md#indexDepartment) | **GET** /employers/{employerId}/departments | List Departments | +| [**updateDepartment()**](DepartmentApi.md#updateDepartment) | **PUT** /employers/{employerId}/departments/{code} | Update Department (deprecated) | +| [**updateDepartmentDepartment()**](DepartmentApi.md#updateDepartmentDepartment) | **PUT** /employers/{employerId}/departments/department | Update Department | + + +## `createDepartment()` + +```php +createDepartment($employerId, $department): \SynergiTech\Staffology\Model\Department +``` + +Create Department + +Creates a new Department for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$department = new \SynergiTech\Staffology\Model\Department(); // \SynergiTech\Staffology\Model\Department + +try { + $result = $apiInstance->createDepartment($employerId, $department); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->createDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **department** | [**\SynergiTech\Staffology\Model\Department**](../Model/Department.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Department**](../Model/Department.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDepartment()` + +```php +deleteDepartment($employerId, $code) +``` + +Delete Department (deprecated) + +Deletes the specified Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string + +try { + $apiInstance->deleteDepartment($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->deleteDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDepartmentDepartment()` + +```php +deleteDepartmentDepartment($employerId, $code) +``` + +Delete Department + +Deletes the specified Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string + +try { + $apiInstance->deleteDepartmentDepartment($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->deleteDepartmentDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDepartment()` + +```php +getDepartment($employerId, $code): \SynergiTech\Staffology\Model\Department +``` + +Get Department (deprecated) + +Gets the Department specified. Use the other GET endpoint that supports non-alphanumeric characters for a department code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Department belongs. +$code = 'code_example'; // string + +try { + $result = $apiInstance->getDepartment($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->getDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Department belongs. | | +| **code** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Department**](../Model/Department.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDepartmentDepartment()` + +```php +getDepartmentDepartment($employerId, $code): \SynergiTech\Staffology\Model\Department +``` + +Get Department + +Gets the Department specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Department belongs. +$code = 'code_example'; // string | The code of the Department you want to retrieve. + +try { + $result = $apiInstance->getDepartmentDepartment($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->getDepartmentDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Department belongs. | | +| **code** | **string**| The code of the Department you want to retrieve. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Department**](../Model/Department.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexDepartment()` + +```php +indexDepartment($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Departments + +Lists all Departments for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Departments + +try { + $result = $apiInstance->indexDepartment($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->indexDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Departments | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDepartment()` + +```php +updateDepartment($employerId, $code, $department): \SynergiTech\Staffology\Model\Department +``` + +Update Department (deprecated) + +Updates a Department for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string +$department = new \SynergiTech\Staffology\Model\Department(); // \SynergiTech\Staffology\Model\Department + +try { + $result = $apiInstance->updateDepartment($employerId, $code, $department); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->updateDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | +| **department** | [**\SynergiTech\Staffology\Model\Department**](../Model/Department.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Department**](../Model/Department.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDepartmentDepartment()` + +```php +updateDepartmentDepartment($employerId, $code, $department): \SynergiTech\Staffology\Model\Department +``` + +Update Department + +Updates the details of an existing Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DepartmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string +$department = new \SynergiTech\Staffology\Model\Department(); // \SynergiTech\Staffology\Model\Department + +try { + $result = $apiInstance->updateDepartmentDepartment($employerId, $code, $department); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DepartmentApi->updateDepartmentDepartment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | [optional] | +| **department** | [**\SynergiTech\Staffology\Model\Department**](../Model/Department.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Department**](../Model/Department.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/DpsApi.md b/docs/Api/DpsApi.md new file mode 100644 index 0000000..39d1902 --- /dev/null +++ b/docs/Api/DpsApi.md @@ -0,0 +1,647 @@ +# SynergiTech\Staffology\DpsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**applyDps()**](DpsApi.md#applyDps) | **PUT** /employers/{employerId}/dps/notices/{id} | Apply Notice | +| [**checkForNoticesDps()**](DpsApi.md#checkForNoticesDps) | **POST** /employers/{employerId}/dps/notices | Check for new Notices | +| [**deleteAllDps()**](DpsApi.md#deleteAllDps) | **DELETE** /employers/{employerId}/dps/notices | Delete All Notices | +| [**deleteDps()**](DpsApi.md#deleteDps) | **DELETE** /employers/{employerId}/dps/notices/{id} | Delete Notice | +| [**getDps()**](DpsApi.md#getDps) | **GET** /employers/{employerId}/dps/notices/{id} | Get Notice | +| [**getDpsSettingsDps()**](DpsApi.md#getDpsSettingsDps) | **GET** /employers/{employerId}/dps/settings | Get DPS Settings | +| [**listNoticesDps()**](DpsApi.md#listNoticesDps) | **GET** /employers/{employerId}/dps/notices | List Notices | +| [**parseXmlDps()**](DpsApi.md#parseXmlDps) | **POST** /employers/{employerId}/dps/notices/xml | Parse notices from XML | +| [**reapplyNoticesDps()**](DpsApi.md#reapplyNoticesDps) | **PUT** /employers/{employerId}/dps/reapply | Reapply DpsNotices | +| [**updateDpsSettingsDps()**](DpsApi.md#updateDpsSettingsDps) | **PUT** /employers/{employerId}/dps/settings | Update DPS Settings | + + +## `applyDps()` + +```php +applyDps($employerId, $id): \SynergiTech\Staffology\Model\DpsNotice +``` + +Apply Notice + +Applies the specified DPS Notice. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string | The Id of the DpsNotice you want to apply. + +try { + $result = $apiInstance->applyDps($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->applyDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| The Id of the DpsNotice you want to apply. | | + +### Return type + +[**\SynergiTech\Staffology\Model\DpsNotice**](../Model/DpsNotice.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `checkForNoticesDps()` + +```php +checkForNoticesDps($employerId): int +``` + +Check for new Notices + +Checks with HMRC for new notices. Returns an integer showing how many new notices were found + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->checkForNoticesDps($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->checkForNoticesDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +**int** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAllDps()` + +```php +deleteAllDps($employerId) +``` + +Delete All Notices + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer that you want to delete all notices for. + +try { + $apiInstance->deleteAllDps($employerId); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->deleteAllDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer that you want to delete all notices for. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDps()` + +```php +deleteDps($employerId, $id) +``` + +Delete Notice + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the DpsNotice belongs. +$id = 'id_example'; // string | The Id of the DsNotice you want to delete. + +try { + $apiInstance->deleteDps($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->deleteDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the DpsNotice belongs. | | +| **id** | **string**| The Id of the DsNotice you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDps()` + +```php +getDps($employerId, $id): \SynergiTech\Staffology\Model\DpsNotice +``` + +Get Notice + +Returns the specified DPS Notice. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string | The Id of the DpsNotice you want to retrieve. + +try { + $result = $apiInstance->getDps($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->getDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| The Id of the DpsNotice you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\DpsNotice**](../Model/DpsNotice.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDpsSettingsDps()` + +```php +getDpsSettingsDps($employerId): \SynergiTech\Staffology\Model\DpsSettings +``` + +Get DPS Settings + +Returns the DpsSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getDpsSettingsDps($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->getDpsSettingsDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\DpsSettings**](../Model/DpsSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listNoticesDps()` + +```php +listNoticesDps($employerId, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +List Notices + +Lists DPS Notices. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->listNoticesDps($employerId, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->listNoticesDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `parseXmlDps()` + +```php +parseXmlDps($employerId, $body): int +``` + +Parse notices from XML + +Checks the supplied XML string for notices. They're then processed in the same was as if received from HMRC. Only used for testing the parsing of DPS XML. Returns an integer showing how many new notices were found + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$body = 'body_example'; // string + +try { + $result = $apiInstance->parseXmlDps($employerId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->parseXmlDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **body** | **string**| | [optional] | + +### Return type + +**int** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `reapplyNoticesDps()` + +```php +reapplyNoticesDps($employerId, $appliedFromDate): \SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse +``` + +Reapply DpsNotices + +From a specified date onwards, reapply DpsNotices + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$appliedFromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date from which to apply DpsNotices + +try { + $result = $apiInstance->reapplyNoticesDps($employerId, $appliedFromDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->reapplyNoticesDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **appliedFromDate** | **\DateTime**| The date from which to apply DpsNotices | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse**](../Model/ContractReapplyDpsNoticeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDpsSettingsDps()` + +```php +updateDpsSettingsDps($employerId, $dpsSettings): \SynergiTech\Staffology\Model\DpsSettings +``` + +Update DPS Settings + +Updates the DpsSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\DpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$dpsSettings = new \SynergiTech\Staffology\Model\DpsSettings(); // \SynergiTech\Staffology\Model\DpsSettings + +try { + $result = $apiInstance->updateDpsSettingsDps($employerId, $dpsSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DpsApi->updateDpsSettingsDps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **dpsSettings** | [**\SynergiTech\Staffology\Model\DpsSettings**](../Model/DpsSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\DpsSettings**](../Model/DpsSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmailApi.md b/docs/Api/EmailApi.md new file mode 100644 index 0000000..f7f316e --- /dev/null +++ b/docs/Api/EmailApi.md @@ -0,0 +1,526 @@ +# SynergiTech\Staffology\EmailApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getEmailEmail()**](EmailApi.md#getEmailEmail) | **GET** /employers/{employerId}/email/{emailId} | Get Email | +| [**getMailSettingsEmail()**](EmailApi.md#getMailSettingsEmail) | **GET** /employers/{employerId}/email/settings | Get MailSettings | +| [**indexEmail()**](EmailApi.md#indexEmail) | **GET** /employers/{employerId}/email | List Emails | +| [**resendEmailEmail()**](EmailApi.md#resendEmailEmail) | **POST** /employers/{employerId}/email/{emailId} | Re-send Email | +| [**testMailSettingsEmail()**](EmailApi.md#testMailSettingsEmail) | **POST** /employers/{employerId}/email/settings/test | Send Test Email | +| [**updateMailSettingsEmail()**](EmailApi.md#updateMailSettingsEmail) | **PUT** /employers/{employerId}/email/settings | Update MailSettings | +| [**verifyMailSettingsEmail()**](EmailApi.md#verifyMailSettingsEmail) | **POST** /employers/{employerId}/email/settings/verify | Email Verification (Request) | +| [**verifyMailSettingsResponseEmail()**](EmailApi.md#verifyMailSettingsResponseEmail) | **PUT** /employers/{employerId}/email/settings/verify | Email Verification (Respond) | + + +## `getEmailEmail()` + +```php +getEmailEmail($employerId, $emailId): \SynergiTech\Staffology\Model\EmployerEmail +``` + +Get Email + +Returns the email along with its status. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$emailId = 'emailId_example'; // string + +try { + $result = $apiInstance->getEmailEmail($employerId, $emailId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->getEmailEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **emailId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEmail**](../Model/EmployerEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailSettingsEmail()` + +```php +getMailSettingsEmail($employerId): \SynergiTech\Staffology\Model\MailSettings +``` + +Get MailSettings + +Returns the MailSettings for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getMailSettingsEmail($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->getMailSettingsEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmail()` + +```php +indexEmail($employerId, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +List Emails + +Returns a list of all emails sent for this Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->indexEmail($employerId, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->indexEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `resendEmailEmail()` + +```php +resendEmailEmail($employerId, $emailId): \SynergiTech\Staffology\Model\EmployerEmail +``` + +Re-send Email + +Re-send an existing email. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$emailId = 'emailId_example'; // string + +try { + $result = $apiInstance->resendEmailEmail($employerId, $emailId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->resendEmailEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **emailId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEmail**](../Model/EmployerEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `testMailSettingsEmail()` + +```php +testMailSettingsEmail($employerId, $email): \SynergiTech\Staffology\Model\EmployerEmail +``` + +Send Test Email + +This API call will generate a test email based on your MailSettings. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$email = 'email_example'; // string | The address to send a test email to + +try { + $result = $apiInstance->testMailSettingsEmail($employerId, $email); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->testMailSettingsEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **email** | **string**| The address to send a test email to | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEmail**](../Model/EmployerEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMailSettingsEmail()` + +```php +updateMailSettingsEmail($employerId, $mailSettings): \SynergiTech\Staffology\Model\MailSettings +``` + +Update MailSettings + +Updates the MailSettings for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$mailSettings = new \SynergiTech\Staffology\Model\MailSettings(); // \SynergiTech\Staffology\Model\MailSettings + +try { + $result = $apiInstance->updateMailSettingsEmail($employerId, $mailSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->updateMailSettingsEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **mailSettings** | [**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `verifyMailSettingsEmail()` + +```php +verifyMailSettingsEmail($employerId) +``` + +Email Verification (Request) + +If the user attempts to use a non-verified email address in their MailSettings then we'll send them a verification email. This API endpoint can be used to re-send the email. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer + +try { + $apiInstance->verifyMailSettingsEmail($employerId); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->verifyMailSettingsEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `verifyMailSettingsResponseEmail()` + +```php +verifyMailSettingsResponseEmail($employerId, $u, $k): bool +``` + +Email Verification (Respond) + +Used to process the link sent in an email to verify an email address that's being used in MailSettings. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The employer Id. +$u = 'u_example'; // string | The value from the link in the email. +$k = 'k_example'; // string | The value from the link in the email. + +try { + $result = $apiInstance->verifyMailSettingsResponseEmail($employerId, $u, $k); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->verifyMailSettingsResponseEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The employer Id. | | +| **u** | **string**| The value from the link in the email. | [optional] | +| **k** | **string**| The value from the link in the email. | [optional] | + +### Return type + +**bool** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmployeeApi.md b/docs/Api/EmployeeApi.md new file mode 100644 index 0000000..57f462e --- /dev/null +++ b/docs/Api/EmployeeApi.md @@ -0,0 +1,1918 @@ +# SynergiTech\Staffology\EmployeeApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**applyPayIncreaseEmployee()**](EmployeeApi.md#applyPayIncreaseEmployee) | **PUT** /employers/{employerId}/employees/payincrease | Apply Pay Increase | +| [**applyPayOptionsEmployee()**](EmployeeApi.md#applyPayOptionsEmployee) | **PUT** /employers/{employerId}/employees/payoptions | Apply PayOptions | +| [**averageWeeklyEarningsEmployee()**](EmployeeApi.md#averageWeeklyEarningsEmployee) | **GET** /employers/{employerId}/employees/{id}/awe | Average Weekly Earnings | +| [**baseDailyRateEmployee()**](EmployeeApi.md#baseDailyRateEmployee) | **GET** /employers/{employerId}/employees/{id}/basedailyrate | Calculate Base Daily Rate (deprecated) | +| [**baseHourlyRateEmployee()**](EmployeeApi.md#baseHourlyRateEmployee) | **GET** /employers/{employerId}/employees/{id}/basehourlyrate | Calculate Base Hourly Rate (deprecated) | +| [**createEmployee()**](EmployeeApi.md#createEmployee) | **POST** /employers/{employerId}/employees | Create a new Employee | +| [**deleteEmployee()**](EmployeeApi.md#deleteEmployee) | **DELETE** /employers/{employerId}/employees/{id} | Delete an Employee | +| [**deleteMultipleEmployee()**](EmployeeApi.md#deleteMultipleEmployee) | **POST** /employers/{employerId}/employees/delete | Delete Employees | +| [**deletePhotoEmployee()**](EmployeeApi.md#deletePhotoEmployee) | **DELETE** /employers/{employerId}/employees/{id}/photo | Delete Photo | +| [**expiringRtwEmployee()**](EmployeeApi.md#expiringRtwEmployee) | **GET** /employers/{employerId}/employees/expiring-rtw | Expiring RightToWork | +| [**getDepartmentMembershipsEmployee()**](EmployeeApi.md#getDepartmentMembershipsEmployee) | **GET** /employers/{employerId}/employees/{id}/departments | Get Employee Departments | +| [**getEmployee()**](EmployeeApi.md#getEmployee) | **GET** /employers/{employerId}/employees/{id} | Get an Employee | +| [**getEmployeeCostCentresEmployee()**](EmployeeApi.md#getEmployeeCostCentresEmployee) | **GET** /employers/{employerId}/employees/{id}/costcentres | Get Employee Cost Centres | +| [**getEvcSettingsEmployee()**](EmployeeApi.md#getEvcSettingsEmployee) | **GET** /employers/{employerId}/employees/{id}/evcsettings | Get EvcSettings | +| [**importCsvEmployee()**](EmployeeApi.md#importCsvEmployee) | **POST** /employers/{employerId}/employees/import | Import CSV | +| [**indexEmployee()**](EmployeeApi.md#indexEmployee) | **GET** /employers/{employerId}/employees | List Employees | +| [**leaversEmployee()**](EmployeeApi.md#leaversEmployee) | **GET** /employers/{employerId}/employees/leavers | List Leavers | +| [**markAsLeaversEmployee()**](EmployeeApi.md#markAsLeaversEmployee) | **PUT** /employers/{employerId}/employees/leavers | Mark as Leavers | +| [**minimumWageEmployee()**](EmployeeApi.md#minimumWageEmployee) | **GET** /employers/{employerId}/employees/{id}/{taxYear}/minimum-wage | Minimum Wage | +| [**payRunEntriesEmployee()**](EmployeeApi.md#payRunEntriesEmployee) | **GET** /employers/{employerId}/employees/{id}/payrunentries/{taxYear} | PayRunEntries for Employee | +| [**reHireEmployee()**](EmployeeApi.md#reHireEmployee) | **GET** /employers/{employerId}/employees/{id}/rehire | Rehire an Employee | +| [**searchByPayrollCodeEmployee()**](EmployeeApi.md#searchByPayrollCodeEmployee) | **GET** /employers/{employerId}/employees/search/payrollcode | Get Employee by Payroll Code | +| [**searchEmployee()**](EmployeeApi.md#searchEmployee) | **GET** /employers/{employerId}/employees/search | Search Employer for Employees | +| [**setDepartmentMembershipsEmployee()**](EmployeeApi.md#setDepartmentMembershipsEmployee) | **PUT** /employers/{employerId}/employees/{id}/departments | Set Employee Departments | +| [**setEmployeeCostCentresEmployee()**](EmployeeApi.md#setEmployeeCostCentresEmployee) | **PUT** /employers/{employerId}/employees/{id}/costcentres | Set Employee Cost Centres | +| [**setOnHoldEmployee()**](EmployeeApi.md#setOnHoldEmployee) | **PUT** /employers/{employerId}/employees/onhold | Mark as On Hold | +| [**updateEmployee()**](EmployeeApi.md#updateEmployee) | **PUT** /employers/{employerId}/employees/{id} | Update an Employee | +| [**updateEvcSettingsEmployee()**](EmployeeApi.md#updateEvcSettingsEmployee) | **PUT** /employers/{employerId}/employees/{id}/evcsettings | Update EvcSettings | +| [**updatePhotoEmployee()**](EmployeeApi.md#updatePhotoEmployee) | **POST** /employers/{employerId}/employees/{id}/photo | Update Photo | + + +## `applyPayIncreaseEmployee()` + +```php +applyPayIncreaseEmployee($employerId, $percentage, $allEmployees) +``` + +Apply Pay Increase + +Increases the PayOptions.PayAmount and PayOptions.BaseHourlyRate by the percentage given. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the employees belong. +$percentage = 3.4; // float +$allEmployees = True; // bool | Set this to true + +try { + $apiInstance->applyPayIncreaseEmployee($employerId, $percentage, $allEmployees); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->applyPayIncreaseEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the employees belong. | | +| **percentage** | **float**| | [optional] | +| **allEmployees** | **bool**| Set this to true | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `applyPayOptionsEmployee()` + +```php +applyPayOptionsEmployee($employerId, $payOptions) +``` + +Apply PayOptions + +Overwrite the PayOptions for all employees with the values provided. Currently only the following fields are updated: period, payAmount, basis, payamountMultiplier, nationalMinimumWage and regularPaylines. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the employees belong. +$payOptions = new \SynergiTech\Staffology\Model\PayOptions(); // \SynergiTech\Staffology\Model\PayOptions + +try { + $apiInstance->applyPayOptionsEmployee($employerId, $payOptions); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->applyPayOptionsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the employees belong. | | +| **payOptions** | [**\SynergiTech\Staffology\Model\PayOptions**](../Model/PayOptions.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `averageWeeklyEarningsEmployee()` + +```php +averageWeeklyEarningsEmployee($employerId, $id, $date, $leaveType): \SynergiTech\Staffology\Model\AverageWeeklyEarnings +``` + +Average Weekly Earnings + +Calculates the Average Weekly Earnings for an Employee at the given date. You can optionally include a LeaveType and we'll adjust the given date accordingly For example if you specify Maternity then it'll be moved back by 15 weeks + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$id = 'id_example'; // string | The Employee Id. +$date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date at which you want to calculate the earnings from. +$leaveType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeaveType(); // \SynergiTech\Staffology\Model\LeaveType | + +try { + $result = $apiInstance->averageWeeklyEarningsEmployee($employerId, $id, $date, $leaveType); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->averageWeeklyEarningsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **id** | **string**| The Employee Id. | | +| **date** | **\DateTime**| The date at which you want to calculate the earnings from. | [optional] | +| **leaveType** | [**\SynergiTech\Staffology\Model\LeaveType**](../Model/.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\AverageWeeklyEarnings**](../Model/AverageWeeklyEarnings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `baseDailyRateEmployee()` + +```php +baseDailyRateEmployee($employerId, $id, $payPeriod, $payBasis, $payAmount): float +``` + +Calculate Base Daily Rate (deprecated) + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = 'id_example'; // string | The Employee Id. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The frequency that this Employee is paid. +$payBasis = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayBasis(); // \SynergiTech\Staffology\Model\PayBasis | +$payAmount = 3.4; // float | The amount the Employee is regularly paid each period. + +try { + $result = $apiInstance->baseDailyRateEmployee($employerId, $id, $payPeriod, $payBasis, $payAmount); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->baseDailyRateEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | **string**| The Employee Id. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The frequency that this Employee is paid. | [optional] | +| **payBasis** | [**\SynergiTech\Staffology\Model\PayBasis**](../Model/.md)| | [optional] | +| **payAmount** | **float**| The amount the Employee is regularly paid each period. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `baseHourlyRateEmployee()` + +```php +baseHourlyRateEmployee($employerId, $id, $payPeriod, $payBasis, $payAmount): float +``` + +Calculate Base Hourly Rate (deprecated) + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = 'id_example'; // string | The Employee Id. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The frequency that this Employee is paid. +$payBasis = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayBasis(); // \SynergiTech\Staffology\Model\PayBasis | +$payAmount = 3.4; // float | The amount the Employee is regularly paid each period. + +try { + $result = $apiInstance->baseHourlyRateEmployee($employerId, $id, $payPeriod, $payBasis, $payAmount); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->baseHourlyRateEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | **string**| The Employee Id. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The frequency that this Employee is paid. | [optional] | +| **payBasis** | [**\SynergiTech\Staffology\Model\PayBasis**](../Model/.md)| | [optional] | +| **payAmount** | **float**| The amount the Employee is regularly paid each period. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createEmployee()` + +```php +createEmployee($employerId, $contractCreateEmployeeRequest): \SynergiTech\Staffology\Model\ContractEmployeeResponse +``` + +Create a new Employee + +Creates an Employee for the Employer specified. If you don't provide PayOptions then the DefaultPayOptions from the Employer will be used + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer you are creating the Employee for +$contractCreateEmployeeRequest = new \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest(); // \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest + +try { + $result = $apiInstance->createEmployee($employerId, $contractCreateEmployeeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->createEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer you are creating the Employee for | | +| **contractCreateEmployeeRequest** | [**\SynergiTech\Staffology\Model\ContractCreateEmployeeRequest**](../Model/ContractCreateEmployeeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeResponse**](../Model/ContractEmployeeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteEmployee()` + +```php +deleteEmployee($employerId, $id) +``` + +Delete an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to delete. + +try { + $apiInstance->deleteEmployee($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->deleteEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteMultipleEmployee()` + +```php +deleteMultipleEmployee($employerId, $requestBody) +``` + +Delete Employees + +Used to delete multiple employees. The body should contain an array of Ids to identify the employees to delete. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employees belong +$requestBody = array('requestBody_example'); // string[] + +try { + $apiInstance->deleteMultipleEmployee($employerId, $requestBody); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->deleteMultipleEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employees belong | | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePhotoEmployee()` + +```php +deletePhotoEmployee($employerId, $id) +``` + +Delete Photo + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string | The Id of the Employee you want to update. + +try { + $apiInstance->deletePhotoEmployee($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->deletePhotoEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| The Id of the Employee you want to update. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `expiringRtwEmployee()` + +```php +expiringRtwEmployee($employerId, $numberOfDays): \SynergiTech\Staffology\Model\Item[] +``` + +Expiring RightToWork + +Returns a list of Item representing Employees that have a RightToWork with a DocumentExpiring date within the next numberOfDays days. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to search. +$numberOfDays = 56; // int | The number of days in the future to look got expiry dates. + +try { + $result = $apiInstance->expiringRtwEmployee($employerId, $numberOfDays); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->expiringRtwEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to search. | | +| **numberOfDays** | **int**| The number of days in the future to look got expiry dates. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDepartmentMembershipsEmployee()` + +```php +getDepartmentMembershipsEmployee($employerId, $id): \SynergiTech\Staffology\Model\DepartmentMembership[] +``` + +Get Employee Departments + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to retrieve Departments for. + +try { + $result = $apiInstance->getDepartmentMembershipsEmployee($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->getDepartmentMembershipsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to retrieve Departments for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployee()` + +```php +getEmployee($employerId, $id): \SynergiTech\Staffology\Model\ContractEmployeeResponse +``` + +Get an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to retrieve. + +try { + $result = $apiInstance->getEmployee($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->getEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeResponse**](../Model/ContractEmployeeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployeeCostCentresEmployee()` + +```php +getEmployeeCostCentresEmployee($employerId, $id): \SynergiTech\Staffology\Model\EmployeeCostCentre[] +``` + +Get Employee Cost Centres + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to retrieve CostCenntres for. + +try { + $result = $apiInstance->getEmployeeCostCentresEmployee($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->getEmployeeCostCentresEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to retrieve CostCenntres for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEvcSettingsEmployee()` + +```php +getEvcSettingsEmployee($employerId, $id): \SynergiTech\Staffology\Model\EvcSettings +``` + +Get EvcSettings + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee for which you want to retrieve EvcSettings. + +try { + $result = $apiInstance->getEvcSettingsEmployee($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->getEvcSettingsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee for which you want to retrieve EvcSettings. | | + +### Return type + +[**\SynergiTech\Staffology\Model\EvcSettings**](../Model/EvcSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importCsvEmployee()` + +```php +importCsvEmployee($employerId, $format, $previewOnly, $allowUpdates, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import CSV + +Import employee data from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$format = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\CsvFileFormat(); // \SynergiTech\Staffology\Model\CsvFileFormat | The format of the CSV file. +$previewOnly = false; // bool | Set to true and nothing will be imported but you'll be shown a preview of the data. +$allowUpdates = false; // bool | Set to true and if the payroll code matches an existing employee then that employee will be updated. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importCsvEmployee($employerId, $format, $previewOnly, $allowUpdates, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->importCsvEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **format** | [**\SynergiTech\Staffology\Model\CsvFileFormat**](../Model/.md)| The format of the CSV file. | [optional] | +| **previewOnly** | **bool**| Set to true and nothing will be imported but you'll be shown a preview of the data. | [optional] [default to false] | +| **allowUpdates** | **bool**| Set to true and if the payroll code matches an existing employee then that employee will be updated. | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmployee()` + +```php +indexEmployee($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending): \SynergiTech\Staffology\Model\Item[] +``` + +List Employees + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to see Employees +$pageNum = 56; // int | Zero-based page number, used in conjunction with pageSize +$pageSize = 56; // int | The number of items per page +$status = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\EmployeeStatus(); // \SynergiTech\Staffology\Model\EmployeeStatus | Restrict the results to employees with the given status +$deptCode = 'deptCode_example'; // string | If specified then only employees assigned to this department code will be listed +$pensionSchemeId = 'pensionSchemeId_example'; // string | If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. +$sortBy = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\EmployeeSortBy(); // \SynergiTech\Staffology\Model\EmployeeSortBy | Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. +$sortDescending = false; // bool | Specifies whether the sorting should be in descending order. Default is false. + +try { + $result = $apiInstance->indexEmployee($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->indexEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to see Employees | | +| **pageNum** | **int**| Zero-based page number, used in conjunction with pageSize | [optional] | +| **pageSize** | **int**| The number of items per page | [optional] | +| **status** | [**\SynergiTech\Staffology\Model\EmployeeStatus**](../Model/.md)| Restrict the results to employees with the given status | [optional] | +| **deptCode** | **string**| If specified then only employees assigned to this department code will be listed | [optional] | +| **pensionSchemeId** | **string**| If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. | [optional] | +| **sortBy** | [**\SynergiTech\Staffology\Model\EmployeeSortBy**](../Model/.md)| Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. | [optional] | +| **sortDescending** | **bool**| Specifies whether the sorting should be in descending order. Default is false. | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `leaversEmployee()` + +```php +leaversEmployee($employerId, $onlyUnsentP45s): \SynergiTech\Staffology\Model\Item[] +``` + +List Leavers + +Returns a list of all Employees that have a leaving date set + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to see Leavers +$onlyUnsentP45s = false; // bool | If set to true then only employees that don't have the P45Sent set to true will be returned + +try { + $result = $apiInstance->leaversEmployee($employerId, $onlyUnsentP45s); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->leaversEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to see Leavers | | +| **onlyUnsentP45s** | **bool**| If set to true then only employees that don't have the P45Sent set to true will be returned | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsLeaversEmployee()` + +```php +markAsLeaversEmployee($employerId, $date, $emailP45, $requestBody) +``` + +Mark as Leavers + +Used to mark multiple employees as leavers. The body should contain an array of Ids to identify the employees to update. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employees belong +$date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date the employees left or are leaving +$emailP45 = True; // bool | If set to true, the employee will be email a P45 if they have an email address +$requestBody = array('requestBody_example'); // string[] + +try { + $apiInstance->markAsLeaversEmployee($employerId, $date, $emailP45, $requestBody); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->markAsLeaversEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employees belong | | +| **date** | **\DateTime**| The date the employees left or are leaving | [optional] | +| **emailP45** | **bool**| If set to true, the employee will be email a P45 if they have an email address | [optional] | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `minimumWageEmployee()` + +```php +minimumWageEmployee($employerId, $id, $taxYear, $date): float +``` + +Minimum Wage + +Calculates the National Minimum Wage for this employee for the given TaxYear and based on their age at the given date + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$id = 'id_example'; // string | The Employee Id. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear +$date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date for which we should calculate the employees age, for not provided we'll use today's date. + +try { + $result = $apiInstance->minimumWageEmployee($employerId, $id, $taxYear, $date); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->minimumWageEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **id** | **string**| The Employee Id. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear | | +| **date** | **\DateTime**| The date for which we should calculate the employees age, for not provided we'll use today's date. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payRunEntriesEmployee()` + +```php +payRunEntriesEmployee($employerId, $id, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +PayRunEntries for Employee + +List PayRunEntries for the given Employee in the specified TaxYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to search. +$id = 'id_example'; // string | The Employee Id. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear for which you want to list PayRunEntries. + +try { + $result = $apiInstance->payRunEntriesEmployee($employerId, $id, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->payRunEntriesEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to search. | | +| **id** | **string**| The Employee Id. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear for which you want to list PayRunEntries. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `reHireEmployee()` + +```php +reHireEmployee($employerId, $id) +``` + +Rehire an Employee + +If an employee has left and you want to rehire him/her, then this method will create a copy of the employee record but with a new payroll code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to rehire. + +try { + $apiInstance->reHireEmployee($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->reHireEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to rehire. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchByPayrollCodeEmployee()` + +```php +searchByPayrollCodeEmployee($employerId, $code): \SynergiTech\Staffology\Model\Item +``` + +Get Employee by Payroll Code + +Get an employee by their payroll code. Will return an Item that contains the Id for you to retrieve the full Employee record + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$code = 'code_example'; // string | The payroll code to look for. + +try { + $result = $apiInstance->searchByPayrollCodeEmployee($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->searchByPayrollCodeEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **code** | **string**| The payroll code to look for. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchEmployee()` + +```php +searchEmployee($employerId, $query, $exludeCisSubContactors): \SynergiTech\Staffology\Model\Item[] +``` + +Search Employer for Employees + +Search for an employee of the specified employer based on their name or payroll code. Ensure your query is at least 3 characters long or you wont get any results. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to search. +$query = 'query_example'; // string | The search string (at least 3 characters). +$exludeCisSubContactors = false; // bool | If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors + +try { + $result = $apiInstance->searchEmployee($employerId, $query, $exludeCisSubContactors); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->searchEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to search. | | +| **query** | **string**| The search string (at least 3 characters). | [optional] | +| **exludeCisSubContactors** | **bool**| If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setDepartmentMembershipsEmployee()` + +```php +setDepartmentMembershipsEmployee($employerId, $id, $departmentMembership): \SynergiTech\Staffology\Model\DepartmentMembership[] +``` + +Set Employee Departments + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to set Departments for. +$departmentMembership = array(new \SynergiTech\Staffology\Model\DepartmentMembership()); // \SynergiTech\Staffology\Model\DepartmentMembership[] + +try { + $result = $apiInstance->setDepartmentMembershipsEmployee($employerId, $id, $departmentMembership); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->setDepartmentMembershipsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to set Departments for. | | +| **departmentMembership** | [**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEmployeeCostCentresEmployee()` + +```php +setEmployeeCostCentresEmployee($employerId, $id, $employeeCostCentre): \SynergiTech\Staffology\Model\EmployeeCostCentre[] +``` + +Set Employee Cost Centres + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to set CostCentres for. +$employeeCostCentre = array(new \SynergiTech\Staffology\Model\EmployeeCostCentre()); // \SynergiTech\Staffology\Model\EmployeeCostCentre[] + +try { + $result = $apiInstance->setEmployeeCostCentresEmployee($employerId, $id, $employeeCostCentre); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->setEmployeeCostCentresEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to set CostCentres for. | | +| **employeeCostCentre** | [**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setOnHoldEmployee()` + +```php +setOnHoldEmployee($employerId, $onHold, $requestBody) +``` + +Mark as On Hold + +Used to mark multiple employees as On Hold or not On Hold. The body should contain an array of Ids to identify the employees to update. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employees belong +$onHold = True; // bool | The OnHold status to set +$requestBody = array('requestBody_example'); // string[] + +try { + $apiInstance->setOnHoldEmployee($employerId, $onHold, $requestBody); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->setOnHoldEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employees belong | | +| **onHold** | **bool**| The OnHold status to set | [optional] | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployee()` + +```php +updateEmployee($employerId, $id, $contractUpdateEmployeeRequest): \SynergiTech\Staffology\Model\ContractEmployeeResponse +``` + +Update an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee you want to update. +$contractUpdateEmployeeRequest = new \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest(); // \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest + +try { + $result = $apiInstance->updateEmployee($employerId, $id, $contractUpdateEmployeeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->updateEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee you want to update. | | +| **contractUpdateEmployeeRequest** | [**\SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest**](../Model/ContractUpdateEmployeeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeResponse**](../Model/ContractEmployeeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEvcSettingsEmployee()` + +```php +updateEvcSettingsEmployee($employerId, $id, $evcSettings): \SynergiTech\Staffology\Model\EvcSettings +``` + +Update EvcSettings + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$id = 'id_example'; // string | The Id of the Employee for who you want to update EvcSettings. +$evcSettings = new \SynergiTech\Staffology\Model\EvcSettings(); // \SynergiTech\Staffology\Model\EvcSettings + +try { + $result = $apiInstance->updateEvcSettingsEmployee($employerId, $id, $evcSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->updateEvcSettingsEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **id** | **string**| The Id of the Employee for who you want to update EvcSettings. | | +| **evcSettings** | [**\SynergiTech\Staffology\Model\EvcSettings**](../Model/EvcSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EvcSettings**](../Model/EvcSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePhotoEmployee()` + +```php +updatePhotoEmployee($employerId, $id, $file): \SynergiTech\Staffology\Model\ContractEmployeeResponse +``` + +Update Photo + +If you already have a URL for the employee photo then you can just set the PhotoUrl property of the Employee. Alternatively, submit an image here and we'll upload it, resize it to 200px squared and set the PhotoUrl for you. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string | The Id of the Employee you want to update. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->updatePhotoEmployee($employerId, $id, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeApi->updatePhotoEmployee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| The Id of the Employee you want to update. | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeResponse**](../Model/ContractEmployeeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmployeeRoleApi.md b/docs/Api/EmployeeRoleApi.md new file mode 100644 index 0000000..6c6ac82 --- /dev/null +++ b/docs/Api/EmployeeRoleApi.md @@ -0,0 +1,1314 @@ +# SynergiTech\Staffology\EmployeeRoleApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createEmployeeRole()**](EmployeeRoleApi.md#createEmployeeRole) | **POST** /employers/{employerId}/employees/{employeeId}/roles | Create Employee Role | +| [**createRoleWorkingPatternEmployeeRole()**](EmployeeRoleApi.md#createRoleWorkingPatternEmployeeRole) | **POST** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns | Create Employee Role Working Pattern | +| [**deleteEmployeeRole()**](EmployeeRoleApi.md#deleteEmployeeRole) | **DELETE** /employers/{employerId}/employees/{employeeId}/roles/{id} | Delete Employee Role | +| [**deleteRoleWorkingPatternEmployeeRole()**](EmployeeRoleApi.md#deleteRoleWorkingPatternEmployeeRole) | **DELETE** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId} | Delete Employee Role Working Pattern | +| [**getBaseDailyRateEmployeeRole()**](EmployeeRoleApi.md#getBaseDailyRateEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/basedailyrate | Calculate Base Daily Rate | +| [**getBaseHourlyRateEmployeeRole()**](EmployeeRoleApi.md#getBaseHourlyRateEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/basehourlyrate | Calculate Base Hourly Rate | +| [**getCostCentreMembershipsEmployeeRole()**](EmployeeRoleApi.md#getCostCentreMembershipsEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres | Get Employee Role Cost Centres | +| [**getDepartmentMembershipsEmployeeRole()**](EmployeeRoleApi.md#getDepartmentMembershipsEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/departments | Get Employee Role Departments | +| [**getEmployeeRole()**](EmployeeRoleApi.md#getEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id} | Get Employee Role | +| [**getEmployeeRoleAnalysisCategoryCodesEmployeeRole()**](EmployeeRoleApi.md#getEmployeeRoleAnalysisCategoryCodesEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategorycodes | Get Employee Role AnalysisCategoryCode | +| [**getRoleAssumedPensionablePayEmployeeRole()**](EmployeeRoleApi.md#getRoleAssumedPensionablePayEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{roleId}/assumedpensionablepay | Calculate Assumed Pensionable Pay | +| [**getRoleWorkingPatternEmployeeRole()**](EmployeeRoleApi.md#getRoleWorkingPatternEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId} | Get Employee Role Working Pattern | +| [**indexEmployeeRole()**](EmployeeRoleApi.md#indexEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles | List Employee Roles | +| [**listRoleWorkingPatternsEmployeeRole()**](EmployeeRoleApi.md#listRoleWorkingPatternsEmployeeRole) | **GET** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns | List Working Patterns for an Employee Role | +| [**setCostCentreMembershipsEmployeeRole()**](EmployeeRoleApi.md#setCostCentreMembershipsEmployeeRole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres | Set Employee Role Cost Centres | +| [**setDepartmentMembershipsEmployeeRole()**](EmployeeRoleApi.md#setDepartmentMembershipsEmployeeRole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/departments | Set Employee Role Departments | +| [**setEmployeeRoleAnalysisCategoryCodesEmployeeRole()**](EmployeeRoleApi.md#setEmployeeRoleAnalysisCategoryCodesEmployeeRole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategories/{analysisCategoryId}/analysiscategorycodes | Set Employee Role AnalysisCategorycode | +| [**updateEmployeeRole()**](EmployeeRoleApi.md#updateEmployeeRole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id} | Update Employee Role | +| [**updateRoleWorkingPatternEmployeeRole()**](EmployeeRoleApi.md#updateRoleWorkingPatternEmployeeRole) | **PUT** /employers/{employerId}/employees/{employeeId}/roles/{id}/workingPatterns/{roleWorkingPatternId} | Update Employee Role Working Pattern | + + +## `createEmployeeRole()` + +```php +createEmployeeRole($employerId, $employeeId, $employeeRole): \SynergiTech\Staffology\Model\EmployeeRole +``` + +Create Employee Role + +Creates a new Role for the Employee. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$employeeRole = new \SynergiTech\Staffology\Model\EmployeeRole(); // \SynergiTech\Staffology\Model\EmployeeRole + +try { + $result = $apiInstance->createEmployeeRole($employerId, $employeeId, $employeeRole); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->createEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **employeeRole** | [**\SynergiTech\Staffology\Model\EmployeeRole**](../Model/EmployeeRole.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeRole**](../Model/EmployeeRole.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createRoleWorkingPatternEmployeeRole()` + +```php +createRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse +``` + +Create Employee Role Working Pattern + +Creates a new Role Working Pattern for the Employee Role. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Employee Role you want to create a Role Working Pattern for. +$contractEmployeeRoleWorkingPatternRequest = new \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest(); // \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest + +try { + $result = $apiInstance->createRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->createRoleWorkingPatternEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Employee Role you want to create a Role Working Pattern for. | | +| **contractEmployeeRoleWorkingPatternRequest** | [**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest**](../Model/ContractEmployeeRoleWorkingPatternRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse**](../Model/ContractEmployeeRoleWorkingPatternResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteEmployeeRole()` + +```php +deleteEmployeeRole($employerId, $employeeId, $id) +``` + +Delete Employee Role + +Deletes the specified Role. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Role to delete. + +try { + $apiInstance->deleteEmployeeRole($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->deleteEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Role to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteRoleWorkingPatternEmployeeRole()` + +```php +deleteRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId) +``` + +Delete Employee Role Working Pattern + +Deletes the specified Employee Role Working Pattern. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Employee Role to which the Role Working Pattern belongs. +$roleWorkingPatternId = 'roleWorkingPatternId_example'; // string | The Id of the Employee Role Working Pattern you want to delete. + +try { + $apiInstance->deleteRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->deleteRoleWorkingPatternEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Employee Role to which the Role Working Pattern belongs. | | +| **roleWorkingPatternId** | **string**| The Id of the Employee Role Working Pattern you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getBaseDailyRateEmployeeRole()` + +```php +getBaseDailyRateEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId): float +``` + +Calculate Base Daily Rate + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee. +$roleId = 'roleId_example'; // string | The Employee Role Id. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The frequency that this Employee Role is paid. +$payBasis = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayBasis(); // \SynergiTech\Staffology\Model\PayBasis | +$payAmount = 3.4; // float | The amount the Employee Role is regularly paid each period. +$workingPatternId = 'workingPatternId_example'; // string | The Id of the Working Pattern that we want the calculations against. + +try { + $result = $apiInstance->getBaseDailyRateEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getBaseDailyRateEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee. | | +| **roleId** | **string**| The Employee Role Id. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The frequency that this Employee Role is paid. | [optional] | +| **payBasis** | [**\SynergiTech\Staffology\Model\PayBasis**](../Model/.md)| | [optional] | +| **payAmount** | **float**| The amount the Employee Role is regularly paid each period. | [optional] | +| **workingPatternId** | **string**| The Id of the Working Pattern that we want the calculations against. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getBaseHourlyRateEmployeeRole()` + +```php +getBaseHourlyRateEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId): float +``` + +Calculate Base Hourly Rate + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee. +$roleId = 'roleId_example'; // string | The Employee Role Id. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The frequency that this Employee Role is paid. +$payBasis = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayBasis(); // \SynergiTech\Staffology\Model\PayBasis | +$payAmount = 3.4; // float | The amount the Employee Role is regularly paid each period. +$workingPatternId = 'workingPatternId_example'; // string | The Id of the Working Pattern that we want the calculations against. + +try { + $result = $apiInstance->getBaseHourlyRateEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getBaseHourlyRateEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee. | | +| **roleId** | **string**| The Employee Role Id. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The frequency that this Employee Role is paid. | [optional] | +| **payBasis** | [**\SynergiTech\Staffology\Model\PayBasis**](../Model/.md)| | [optional] | +| **payAmount** | **float**| The amount the Employee Role is regularly paid each period. | [optional] | +| **workingPatternId** | **string**| The Id of the Working Pattern that we want the calculations against. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCostCentreMembershipsEmployeeRole()` + +```php +getCostCentreMembershipsEmployeeRole($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\EmployeeCostCentre[] +``` + +Get Employee Role Cost Centres + +Gets Cost Centres that are Assigned to an Employee Role. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to retrieve Cost Centres for. +$id = 'id_example'; // string | The Id of the Employee Role you want to retrieve Cost Centres for. + +try { + $result = $apiInstance->getCostCentreMembershipsEmployeeRole($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getCostCentreMembershipsEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to retrieve Cost Centres for. | | +| **id** | **string**| The Id of the Employee Role you want to retrieve Cost Centres for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDepartmentMembershipsEmployeeRole()` + +```php +getDepartmentMembershipsEmployeeRole($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\DepartmentMembership[] +``` + +Get Employee Role Departments + +Gets Departments that are Assigned to an Employee Role. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to retrieve Departments for. +$id = 'id_example'; // string | The Id of the Employee Role you want to retrieve Departments for. + +try { + $result = $apiInstance->getDepartmentMembershipsEmployeeRole($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getDepartmentMembershipsEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to retrieve Departments for. | | +| **id** | **string**| The Id of the Employee Role you want to retrieve Departments for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployeeRole()` + +```php +getEmployeeRole($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\ContractEmployeeRoleResponse +``` + +Get Employee Role + +Gets the Role specified. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The id of the Role you want to retrieve. + +try { + $result = $apiInstance->getEmployeeRole($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The id of the Role you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse**](../Model/ContractEmployeeRoleResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployeeRoleAnalysisCategoryCodesEmployeeRole()` + +```php +getEmployeeRoleAnalysisCategoryCodesEmployeeRole($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[] +``` + +Get Employee Role AnalysisCategoryCode + +Gets AnalysisCategoryCode that are Assigned to an Employee Role. You must have the multi-role feature enabled. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to retrieve AnalysisCategoryCode for. +$id = 'id_example'; // string | The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. + +try { + $result = $apiInstance->getEmployeeRoleAnalysisCategoryCodesEmployeeRole($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getEmployeeRoleAnalysisCategoryCodesEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to retrieve AnalysisCategoryCode for. | | +| **id** | **string**| The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]**](../Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRoleAssumedPensionablePayEmployeeRole()` + +```php +getRoleAssumedPensionablePayEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from): float +``` + +Calculate Assumed Pensionable Pay + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee. +$roleId = 'roleId_example'; // string | The Employee Role Id. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The frequency that this Employee Role is paid. +$leaveType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeaveType(); // \SynergiTech\Staffology\Model\LeaveType | The type of the Leave. +$leavePayType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeavePayType(); // \SynergiTech\Staffology\Model\LeavePayType | The pay type of the Leave. +$from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date from which the Assumed Pensionable Pay is calculated. + +try { + $result = $apiInstance->getRoleAssumedPensionablePayEmployeeRole($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getRoleAssumedPensionablePayEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee. | | +| **roleId** | **string**| The Employee Role Id. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The frequency that this Employee Role is paid. | [optional] | +| **leaveType** | [**\SynergiTech\Staffology\Model\LeaveType**](../Model/.md)| The type of the Leave. | [optional] | +| **leavePayType** | [**\SynergiTech\Staffology\Model\LeavePayType**](../Model/.md)| The pay type of the Leave. | [optional] | +| **from** | **\DateTime**| The date from which the Assumed Pensionable Pay is calculated. | [optional] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRoleWorkingPatternEmployeeRole()` + +```php +getRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse +``` + +Get Employee Role Working Pattern + +Gets the Employee Role Working Pattern specified. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Employee Role you want to retrieve a Role Working Pattern for. +$roleWorkingPatternId = 'roleWorkingPatternId_example'; // string | The Id of the Employee Role Working Pattern you want to retrieve. + +try { + $result = $apiInstance->getRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->getRoleWorkingPatternEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Employee Role you want to retrieve a Role Working Pattern for. | | +| **roleWorkingPatternId** | **string**| The Id of the Employee Role Working Pattern you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse**](../Model/ContractEmployeeRoleWorkingPatternResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmployeeRole()` + +```php +indexEmployeeRole($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Employee Roles + +Lists all Roles for an Employee. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee which you want to list Roles. + +try { + $result = $apiInstance->indexEmployeeRole($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->indexEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee which you want to list Roles. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listRoleWorkingPatternsEmployeeRole()` + +```php +listRoleWorkingPatternsEmployeeRole($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[] +``` + +List Working Patterns for an Employee Role + +Lists all Working Patterns for an Employee Role. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. + +try { + $result = $apiInstance->listRoleWorkingPatternsEmployeeRole($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->listRoleWorkingPatternsEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]**](../Model/ContractEmployeeRoleWorkingPatternResponseItem.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setCostCentreMembershipsEmployeeRole()` + +```php +setCostCentreMembershipsEmployeeRole($employerId, $employeeId, $id, $employeeCostCentre): \SynergiTech\Staffology\Model\EmployeeCostCentre[] +``` + +Set Employee Role Cost Centres + +Assigns Cost Centres to an Employee Role. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to set Cost Centres for. +$id = 'id_example'; // string | The Id of the Employee Role you want to set Cost Centres for. +$employeeCostCentre = array(new \SynergiTech\Staffology\Model\EmployeeCostCentre()); // \SynergiTech\Staffology\Model\EmployeeCostCentre[] + +try { + $result = $apiInstance->setCostCentreMembershipsEmployeeRole($employerId, $employeeId, $id, $employeeCostCentre); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->setCostCentreMembershipsEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to set Cost Centres for. | | +| **id** | **string**| The Id of the Employee Role you want to set Cost Centres for. | | +| **employeeCostCentre** | [**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](../Model/EmployeeCostCentre.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setDepartmentMembershipsEmployeeRole()` + +```php +setDepartmentMembershipsEmployeeRole($employerId, $employeeId, $id, $departmentMembership): \SynergiTech\Staffology\Model\DepartmentMembership[] +``` + +Set Employee Role Departments + +Assigns Departments to an Employee Role. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to set Departments for. +$id = 'id_example'; // string | The Id of the Employee Role you want to set Departments for. +$departmentMembership = array(new \SynergiTech\Staffology\Model\DepartmentMembership()); // \SynergiTech\Staffology\Model\DepartmentMembership[] + +try { + $result = $apiInstance->setDepartmentMembershipsEmployeeRole($employerId, $employeeId, $id, $departmentMembership); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->setDepartmentMembershipsEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to set Departments for. | | +| **id** | **string**| The Id of the Employee Role you want to set Departments for. | | +| **departmentMembership** | [**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\DepartmentMembership[]**](../Model/DepartmentMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEmployeeRoleAnalysisCategoryCodesEmployeeRole()` + +```php +setEmployeeRoleAnalysisCategoryCodesEmployeeRole($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest): \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[] +``` + +Set Employee Role AnalysisCategorycode + +Assigns AnalysisCategoryCode to an Employee Role. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to set AnalysisCategoryCode for. +$id = 'id_example'; // string | The Id of the Employee Role you want to set AnalysisCategoryCode for. +$analysisCategoryId = 'analysisCategoryId_example'; // string | The Id of the Analysis Category you want to set AnalysisCategoryCode for. +$contractEmployeeRoleAnalysisCategoryCodeRequest = array(new \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest()); // \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[] + +try { + $result = $apiInstance->setEmployeeRoleAnalysisCategoryCodesEmployeeRole($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->setEmployeeRoleAnalysisCategoryCodesEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to set AnalysisCategoryCode for. | | +| **id** | **string**| The Id of the Employee Role you want to set AnalysisCategoryCode for. | | +| **analysisCategoryId** | **string**| The Id of the Analysis Category you want to set AnalysisCategoryCode for. | | +| **contractEmployeeRoleAnalysisCategoryCodeRequest** | [**\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]**](../Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]**](../Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployeeRole()` + +```php +updateEmployeeRole($employerId, $employeeId, $id, $employeeRole): \SynergiTech\Staffology\Model\EmployeeRole +``` + +Update Employee Role + +Updates a Role for the Employee. You must have the multi-role feature enabled. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Role to update. +$employeeRole = new \SynergiTech\Staffology\Model\EmployeeRole(); // \SynergiTech\Staffology\Model\EmployeeRole + +try { + $result = $apiInstance->updateEmployeeRole($employerId, $employeeId, $id, $employeeRole); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->updateEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Role to update. | | +| **employeeRole** | [**\SynergiTech\Staffology\Model\EmployeeRole**](../Model/EmployeeRole.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeRole**](../Model/EmployeeRole.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateRoleWorkingPatternEmployeeRole()` + +```php +updateRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse +``` + +Update Employee Role Working Pattern + +Updates a Working Pattern for the Employee Role. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployeeRoleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for the Employee. +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Role belongs. +$id = 'id_example'; // string | The Id of the Role to which the Employee Role Working Pattern belongs. +$roleWorkingPatternId = 'roleWorkingPatternId_example'; // string | The Id of the Employee Role Working Pattern you want to update. +$contractEmployeeRoleWorkingPatternRequest = new \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest(); // \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest + +try { + $result = $apiInstance->updateRoleWorkingPatternEmployeeRole($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeeRoleApi->updateRoleWorkingPatternEmployeeRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for the Employee. | | +| **employeeId** | **string**| The Id of the Employee to which the Role belongs. | | +| **id** | **string**| The Id of the Role to which the Employee Role Working Pattern belongs. | | +| **roleWorkingPatternId** | **string**| The Id of the Employee Role Working Pattern you want to update. | | +| **contractEmployeeRoleWorkingPatternRequest** | [**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest**](../Model/ContractEmployeeRoleWorkingPatternRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse**](../Model/ContractEmployeeRoleWorkingPatternResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmployerApi.md b/docs/Api/EmployerApi.md new file mode 100644 index 0000000..5bed165 --- /dev/null +++ b/docs/Api/EmployerApi.md @@ -0,0 +1,1718 @@ +# SynergiTech\Staffology\EmployerApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**applyYearEndEmployer()**](EmployerApi.md#applyYearEndEmployer) | **PUT** /employers/{id}/YearEnd | Make Year End Changes | +| [**calendarEmployer()**](EmployerApi.md#calendarEmployer) | **GET** /employers/{id}/calendar | Get Employer Calendar | +| [**createEmployer()**](EmployerApi.md#createEmployer) | **POST** /employers | Create an Employer | +| [**customPayslipEmployer()**](EmployerApi.md#customPayslipEmployer) | **GET** /employers/{id}/custompayslip | Get Payslip Customisations | +| [**deleteEmployer()**](EmployerApi.md#deleteEmployer) | **DELETE** /employers/{id} | Delete an Employer | +| [**getAutomationSettingsEmployer()**](EmployerApi.md#getAutomationSettingsEmployer) | **GET** /employers/{id}/automation | Get Automation Settings | +| [**getEmployer()**](EmployerApi.md#getEmployer) | **GET** /employers/{id} | Get an Employer | +| [**getEmployerOpeningBalancesEmployer()**](EmployerApi.md#getEmployerOpeningBalancesEmployer) | **GET** /employers/{id}/openingbalances | Get EmployerOpeningBalances | +| [**getEvcOptInHistoryEmployer()**](EmployerApi.md#getEvcOptInHistoryEmployer) | **GET** /employers/{id}/evc | Get EVC OptIn History | +| [**getGroupMembershipsEmployer()**](EmployerApi.md#getGroupMembershipsEmployer) | **GET** /employers/{id}/groups | Get Employer Groups | +| [**importCsvEmployer()**](EmployerApi.md#importCsvEmployer) | **POST** /employers/import | Import CSV | +| [**indexEmployer()**](EmployerApi.md#indexEmployer) | **GET** /employers | List Employers | +| [**listUsersEmployer()**](EmployerApi.md#listUsersEmployer) | **GET** /employers/{id}/users | List Users | +| [**removeUserEmployer()**](EmployerApi.md#removeUserEmployer) | **DELETE** /employers/{id}/users/{userId} | Remove User | +| [**reviewYearEndEmployer()**](EmployerApi.md#reviewYearEndEmployer) | **GET** /employers/{id}/YearEnd | Review Year End Changes | +| [**rtiRequiringAttentionEmployer()**](EmployerApi.md#rtiRequiringAttentionEmployer) | **GET** /employers/{id}/rti/requiringattention | RTI Documents Requiring Attention | +| [**searchEmployeesEmployer()**](EmployerApi.md#searchEmployeesEmployer) | **GET** /employers/employees/search | Search Employees | +| [**searchEmployer()**](EmployerApi.md#searchEmployer) | **GET** /employers/search | Search Employers | +| [**setEvcOptInEmployer()**](EmployerApi.md#setEvcOptInEmployer) | **PUT** /employers/{id}/evc | Update EVC OptIn | +| [**setGroupMembershipsEmployer()**](EmployerApi.md#setGroupMembershipsEmployer) | **PUT** /employers/{id}/groups | Set Employer Groups | +| [**setOwnerEmployer()**](EmployerApi.md#setOwnerEmployer) | **PUT** /employers/{id}/users/owner | Set Owner | +| [**suggestPayCodeEmployer()**](EmployerApi.md#suggestPayCodeEmployer) | **GET** /employers/{id}/suggestPayrollCode | Suggest Payroll Code | +| [**updateAutomationSettingsEmployer()**](EmployerApi.md#updateAutomationSettingsEmployer) | **PUT** /employers/{id}/automation | Update Automation Settings | +| [**updateCustomPayslipEmployer()**](EmployerApi.md#updateCustomPayslipEmployer) | **POST** /employers/{id}/custompayslip | Update Payslip Customisations | +| [**updateEmployer()**](EmployerApi.md#updateEmployer) | **PUT** /employers/{id} | Update an Employer | +| [**updateEmployerOpeningBalancesEmployer()**](EmployerApi.md#updateEmployerOpeningBalancesEmployer) | **PUT** /employers/{id}/openingbalances | Update EmployerOpeningBalances | +| [**updateLogoEmployer()**](EmployerApi.md#updateLogoEmployer) | **POST** /employers/{id}/logo | Update Employer Logo | + + +## `applyYearEndEmployer()` + +```php +applyYearEndEmployer($id, $requestBody): \SynergiTech\Staffology\Model\YearEnd +``` + +Make Year End Changes + +Apply the changes for the year end and start the next tax year for the employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer +$requestBody = NULL; // array | You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements + +try { + $result = $apiInstance->applyYearEndEmployer($id, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->applyYearEndEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | +| **requestBody** | [**array**](../Model/mixed.md)| You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\YearEnd**](../Model/YearEnd.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `calendarEmployer()` + +```php +calendarEmployer($id, $from, $to): \SynergiTech\Staffology\Model\CalendarEntry[] +``` + +Get Employer Calendar + +Get a list of upcoming CalendarEntry for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer. +$from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime + +try { + $result = $apiInstance->calendarEmployer($id, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->calendarEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer. | | +| **from** | **\DateTime**| | [optional] | +| **to** | **\DateTime**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CalendarEntry[]**](../Model/CalendarEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createEmployer()` + +```php +createEmployer($employer): \SynergiTech\Staffology\Model\Employer +``` + +Create an Employer + +Use this method to create a new Employer The only required field is the Employer name. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employer = new \SynergiTech\Staffology\Model\Employer(); // \SynergiTech\Staffology\Model\Employer + +try { + $result = $apiInstance->createEmployer($employer); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->createEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employer** | [**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `customPayslipEmployer()` + +```php +customPayslipEmployer($id): \SynergiTech\Staffology\Model\PayslipCustomisation +``` + +Get Payslip Customisations + +Get the settings used to customise PaySlips for this Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want customisations for. + +try { + $result = $apiInstance->customPayslipEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->customPayslipEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want customisations for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PayslipCustomisation**](../Model/PayslipCustomisation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteEmployer()` + +```php +deleteEmployer($id) +``` + +Delete an Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to delete. + +try { + $apiInstance->deleteEmployer($id); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->deleteEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAutomationSettingsEmployer()` + +```php +getAutomationSettingsEmployer($id): \SynergiTech\Staffology\Model\AutomationSettings +``` + +Get Automation Settings + +Returns the AutomationSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getAutomationSettingsEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->getAutomationSettingsEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\AutomationSettings**](../Model/AutomationSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployer()` + +```php +getEmployer($id): \SynergiTech\Staffology\Model\Employer +``` + +Get an Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to retrieve. + +try { + $result = $apiInstance->getEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->getEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployerOpeningBalancesEmployer()` + +```php +getEmployerOpeningBalancesEmployer($id): \SynergiTech\Staffology\Model\EmployerOpeningBalances +``` + +Get EmployerOpeningBalances + +Returns the EmployerOpeningBalances for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getEmployerOpeningBalancesEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->getEmployerOpeningBalancesEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerOpeningBalances**](../Model/EmployerOpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEvcOptInHistoryEmployer()` + +```php +getEvcOptInHistoryEmployer($id): \SynergiTech\Staffology\Model\EmployerEvcOptInHistory[] +``` + +Get EVC OptIn History + +Gets the history of changes to the EVC OptIn setting for the employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->getEvcOptInHistoryEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->getEvcOptInHistoryEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]**](../Model/EmployerEvcOptInHistory.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGroupMembershipsEmployer()` + +```php +getGroupMembershipsEmployer($id): \SynergiTech\Staffology\Model\EmployerGroupMembership[] +``` + +Get Employer Groups + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to retrieve Groups for. + +try { + $result = $apiInstance->getGroupMembershipsEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->getGroupMembershipsEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to retrieve Groups for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerGroupMembership[]**](../Model/EmployerGroupMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importCsvEmployer()` + +```php +importCsvEmployer($previewOnly, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import CSV + +Import employers from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$previewOnly = false; // bool | Set to true and nothing will be imported but you'll be shown a preview of the data. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importCsvEmployer($previewOnly, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->importCsvEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **previewOnly** | **bool**| Set to true and nothing will be imported but you'll be shown a preview of the data. | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmployer()` + +```php +indexEmployer($employerGroupCode): \SynergiTech\Staffology\Model\Item[] +``` + +List Employers + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerGroupCode = 'employerGroupCode_example'; // string | Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. + +try { + $result = $apiInstance->indexEmployer($employerGroupCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->indexEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerGroupCode** | **string**| Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listUsersEmployer()` + +```php +listUsersEmployer($id): \SynergiTech\Staffology\Model\Item[] +``` + +List Users + +Returns a list of Users that have access to the given Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want a list of Users for. + +try { + $result = $apiInstance->listUsersEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->listUsersEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want a list of Users for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removeUserEmployer()` + +```php +removeUserEmployer($id, $userId) +``` + +Remove User + +Removes a User from an Employer. You cannot remove Users that are marked as the owner of the Employer. You must be the owner of the Employer in order to remove other Users. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to remove the User from. +$userId = 'userId_example'; // string | The Id of the User you want to remove. + +try { + $apiInstance->removeUserEmployer($id, $userId); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->removeUserEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to remove the User from. | | +| **userId** | **string**| The Id of the User you want to remove. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `reviewYearEndEmployer()` + +```php +reviewYearEndEmployer($id): \SynergiTech\Staffology\Model\YearEnd +``` + +Review Year End Changes + +View the changes that will be made when you start the next tax year for the employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->reviewYearEndEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->reviewYearEndEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\YearEnd**](../Model/YearEnd.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `rtiRequiringAttentionEmployer()` + +```php +rtiRequiringAttentionEmployer($id): \SynergiTech\Staffology\Model\Item[] +``` + +RTI Documents Requiring Attention + +Returns all RTI documents that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer + +try { + $result = $apiInstance->rtiRequiringAttentionEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->rtiRequiringAttentionEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchEmployeesEmployer()` + +```php +searchEmployeesEmployer($query, $exludeCisSubContactors): \SynergiTech\Staffology\Model\Item[] +``` + +Search Employees + +Search all employers for an employee based on their name or payroll code. Ensure your query is at least 3 characters long or you wont get any results. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$query = 'query_example'; // string | The search string (at least 3 characters). +$exludeCisSubContactors = false; // bool | If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors + +try { + $result = $apiInstance->searchEmployeesEmployer($query, $exludeCisSubContactors); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->searchEmployeesEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **query** | **string**| The search string (at least 3 characters). | [optional] | +| **exludeCisSubContactors** | **bool**| If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchEmployer()` + +```php +searchEmployer($query): \SynergiTech\Staffology\Model\Item[] +``` + +Search Employers + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$query = 'query_example'; // string + +try { + $result = $apiInstance->searchEmployer($query); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->searchEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **query** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEvcOptInEmployer()` + +```php +setEvcOptInEmployer($id, $body) +``` + +Update EVC OptIn + +Sets the EVC OptIn setting for the employer. A boolean value needs to be sent in the body to indicate if the employer is opted in. So sending false would result in the employer being opted out. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer +$body = True; // bool + +try { + $apiInstance->setEvcOptInEmployer($id, $body); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->setEvcOptInEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | +| **body** | **bool**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setGroupMembershipsEmployer()` + +```php +setGroupMembershipsEmployer($id, $employerGroupMembership): \SynergiTech\Staffology\Model\EmployerGroupMembership[] +``` + +Set Employer Groups + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to set Groups for. +$employerGroupMembership = array(new \SynergiTech\Staffology\Model\EmployerGroupMembership()); // \SynergiTech\Staffology\Model\EmployerGroupMembership[] + +try { + $result = $apiInstance->setGroupMembershipsEmployer($id, $employerGroupMembership); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->setGroupMembershipsEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to set Groups for. | | +| **employerGroupMembership** | [**\SynergiTech\Staffology\Model\EmployerGroupMembership[]**](../Model/EmployerGroupMembership.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerGroupMembership[]**](../Model/EmployerGroupMembership.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setOwnerEmployer()` + +```php +setOwnerEmployer($id, $body) +``` + +Set Owner + +Sets the owner for the employer. You must be the owner of the Employer to set this value. The user you are setting as the owner must already have the role Admin. You can get a list of users from the ListUsers endpoint. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to change the ownership of. +$body = 'body_example'; // string | The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. + +try { + $apiInstance->setOwnerEmployer($id, $body); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->setOwnerEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to change the ownership of. | | +| **body** | **string**| The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `suggestPayCodeEmployer()` + +```php +suggestPayCodeEmployer($id): string +``` + +Suggest Payroll Code + +This helper method returns a unique code for the next Employee that you create for the specified Employer. You don't have to use the value provided, you can use any value that is unique across Employees for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want a suggestion for. + +try { + $result = $apiInstance->suggestPayCodeEmployer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->suggestPayCodeEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want a suggestion for. | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAutomationSettingsEmployer()` + +```php +updateAutomationSettingsEmployer($id, $automationSettings): \SynergiTech\Staffology\Model\AutomationSettings +``` + +Update Automation Settings + +Updates the AutomationSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer +$automationSettings = new \SynergiTech\Staffology\Model\AutomationSettings(); // \SynergiTech\Staffology\Model\AutomationSettings + +try { + $result = $apiInstance->updateAutomationSettingsEmployer($id, $automationSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->updateAutomationSettingsEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | +| **automationSettings** | [**\SynergiTech\Staffology\Model\AutomationSettings**](../Model/AutomationSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\AutomationSettings**](../Model/AutomationSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCustomPayslipEmployer()` + +```php +updateCustomPayslipEmployer($id, $payslipCustomisation): \SynergiTech\Staffology\Model\PayslipCustomisation +``` + +Update Payslip Customisations + +Set the settings used to customise PaySlips for this Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want customisations for. +$payslipCustomisation = new \SynergiTech\Staffology\Model\PayslipCustomisation(); // \SynergiTech\Staffology\Model\PayslipCustomisation + +try { + $result = $apiInstance->updateCustomPayslipEmployer($id, $payslipCustomisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->updateCustomPayslipEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want customisations for. | | +| **payslipCustomisation** | [**\SynergiTech\Staffology\Model\PayslipCustomisation**](../Model/PayslipCustomisation.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayslipCustomisation**](../Model/PayslipCustomisation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployer()` + +```php +updateEmployer($id, $employer): \SynergiTech\Staffology\Model\Employer +``` + +Update an Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to update. +$employer = new \SynergiTech\Staffology\Model\Employer(); // \SynergiTech\Staffology\Model\Employer + +try { + $result = $apiInstance->updateEmployer($id, $employer); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->updateEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to update. | | +| **employer** | [**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployerOpeningBalancesEmployer()` + +```php +updateEmployerOpeningBalancesEmployer($id, $employerOpeningBalances): \SynergiTech\Staffology\Model\EmployerOpeningBalances +``` + +Update EmployerOpeningBalances + +Updates the EmployerOpeningBalances for the Employer for their StartYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer +$employerOpeningBalances = new \SynergiTech\Staffology\Model\EmployerOpeningBalances(); // \SynergiTech\Staffology\Model\EmployerOpeningBalances + +try { + $result = $apiInstance->updateEmployerOpeningBalancesEmployer($id, $employerOpeningBalances); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->updateEmployerOpeningBalancesEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer | | +| **employerOpeningBalances** | [**\SynergiTech\Staffology\Model\EmployerOpeningBalances**](../Model/EmployerOpeningBalances.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerOpeningBalances**](../Model/EmployerOpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLogoEmployer()` + +```php +updateLogoEmployer($id, $file): \SynergiTech\Staffology\Model\Employer +``` + +Update Employer Logo + +If you already have a URL for the employer Logo then you can just set the LogoUrl property of the Employer. Alternatively, submit a logo here and we'll upload it and set the LogoUrl for you. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Employer you want to update. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->updateLogoEmployer($id, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerApi->updateLogoEmployer: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Employer you want to update. | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Employer**](../Model/Employer.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmployerGroupApi.md b/docs/Api/EmployerGroupApi.md new file mode 100644 index 0000000..dc0a6c4 --- /dev/null +++ b/docs/Api/EmployerGroupApi.md @@ -0,0 +1,320 @@ +# SynergiTech\Staffology\EmployerGroupApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createEmployerGroup()**](EmployerGroupApi.md#createEmployerGroup) | **POST** /employers/groups | Create EmployerGroup | +| [**deleteEmployerGroup()**](EmployerGroupApi.md#deleteEmployerGroup) | **DELETE** /employers/groups/{code} | Delete EmployerGroup | +| [**getEmployerGroup()**](EmployerGroupApi.md#getEmployerGroup) | **GET** /employers/groups/{code} | Get EmployerGroup | +| [**indexEmployerGroup()**](EmployerGroupApi.md#indexEmployerGroup) | **GET** /employers/groups | List EmployerGroups | +| [**updateEmployerGroup()**](EmployerGroupApi.md#updateEmployerGroup) | **PUT** /employers/groups/{code} | Update EmployerGroup | + + +## `createEmployerGroup()` + +```php +createEmployerGroup($employerGroup): \SynergiTech\Staffology\Model\EmployerGroup +``` + +Create EmployerGroup + +Creates a new EmployerGroup for the user. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerGroupApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerGroup = new \SynergiTech\Staffology\Model\EmployerGroup(); // \SynergiTech\Staffology\Model\EmployerGroup + +try { + $result = $apiInstance->createEmployerGroup($employerGroup); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerGroupApi->createEmployerGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerGroup** | [**\SynergiTech\Staffology\Model\EmployerGroup**](../Model/EmployerGroup.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerGroup**](../Model/EmployerGroup.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteEmployerGroup()` + +```php +deleteEmployerGroup($code) +``` + +Delete EmployerGroup + +Deletes the specified EmployerGroup. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerGroupApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$code = 'code_example'; // string + +try { + $apiInstance->deleteEmployerGroup($code); +} catch (Exception $e) { + echo 'Exception when calling EmployerGroupApi->deleteEmployerGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **code** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployerGroup()` + +```php +getEmployerGroup($code): \SynergiTech\Staffology\Model\EmployerGroup +``` + +Get EmployerGroup + +Gets the EmployerGroup specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerGroupApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$code = 'code_example'; // string + +try { + $result = $apiInstance->getEmployerGroup($code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerGroupApi->getEmployerGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **code** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerGroup**](../Model/EmployerGroup.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmployerGroup()` + +```php +indexEmployerGroup(): \SynergiTech\Staffology\Model\Item[] +``` + +List EmployerGroups + +Lists all EmployerGroups for the user. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerGroupApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->indexEmployerGroup(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerGroupApi->indexEmployerGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployerGroup()` + +```php +updateEmployerGroup($code, $employerGroup): \SynergiTech\Staffology\Model\EmployerGroup +``` + +Update EmployerGroup + +Updates a EmployerGroup for the user. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerGroupApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$code = 'code_example'; // string +$employerGroup = new \SynergiTech\Staffology\Model\EmployerGroup(); // \SynergiTech\Staffology\Model\EmployerGroup + +try { + $result = $apiInstance->updateEmployerGroup($code, $employerGroup); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerGroupApi->updateEmployerGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **code** | **string**| | | +| **employerGroup** | [**\SynergiTech\Staffology\Model\EmployerGroup**](../Model/EmployerGroup.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerGroup**](../Model/EmployerGroup.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EmployerTemplateApi.md b/docs/Api/EmployerTemplateApi.md new file mode 100644 index 0000000..a3a9e3d --- /dev/null +++ b/docs/Api/EmployerTemplateApi.md @@ -0,0 +1,202 @@ +# SynergiTech\Staffology\EmployerTemplateApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getEmployerTemplate()**](EmployerTemplateApi.md#getEmployerTemplate) | **GET** /employers/{employerId}/templates/{type} | Get EmployerTemplate | +| [**indexEmployerTemplate()**](EmployerTemplateApi.md#indexEmployerTemplate) | **GET** /employers/{employerId}/templates | List EmployerTemplates | +| [**updateEmployerTemplate()**](EmployerTemplateApi.md#updateEmployerTemplate) | **PUT** /employers/{employerId}/templates/{type} | Update EmployerTemplate | + + +## `getEmployerTemplate()` + +```php +getEmployerTemplate($employerId, $type): \SynergiTech\Staffology\Model\EmployerTemplate +``` + +Get EmployerTemplate + +Gets the EmployerTemplate specified by the Type. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the EmployerTemplate belongs. +$type = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\EmployerTemplateType(); // \SynergiTech\Staffology\Model\EmployerTemplateType | The EmployerTemplateType you want to retrieve. + +try { + $result = $apiInstance->getEmployerTemplate($employerId, $type); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerTemplateApi->getEmployerTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the EmployerTemplate belongs. | | +| **type** | [**\SynergiTech\Staffology\Model\EmployerTemplateType**](../Model/.md)| The EmployerTemplateType you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerTemplate**](../Model/EmployerTemplate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexEmployerTemplate()` + +```php +indexEmployerTemplate($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List EmployerTemplates + +Lists all EmployerTemplates for the Employer specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Pay Codes + +try { + $result = $apiInstance->indexEmployerTemplate($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerTemplateApi->indexEmployerTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Pay Codes | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployerTemplate()` + +```php +updateEmployerTemplate($employerId, $type, $employerTemplate): \SynergiTech\Staffology\Model\EmployerTemplate +``` + +Update EmployerTemplate + +Updates the EmployerTemplate specified by the Type. The only values need to supply are ```Content``` and (if applicable) ```Subject```. If these values are empty strings or not provided then the template will revert to the default values. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EmployerTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the EmployerTemplate belongs. +$type = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\EmployerTemplateType(); // \SynergiTech\Staffology\Model\EmployerTemplateType +$employerTemplate = new \SynergiTech\Staffology\Model\EmployerTemplate(); // \SynergiTech\Staffology\Model\EmployerTemplate | The EmployerTemplateType you want to retrieve. + +try { + $result = $apiInstance->updateEmployerTemplate($employerId, $type, $employerTemplate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployerTemplateApi->updateEmployerTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the EmployerTemplate belongs. | | +| **type** | [**\SynergiTech\Staffology\Model\EmployerTemplateType**](../Model/.md)| | | +| **employerTemplate** | [**\SynergiTech\Staffology\Model\EmployerTemplate**](../Model/EmployerTemplate.md)| The EmployerTemplateType you want to retrieve. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerTemplate**](../Model/EmployerTemplate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EngineApi.md b/docs/Api/EngineApi.md new file mode 100644 index 0000000..2ea9590 --- /dev/null +++ b/docs/Api/EngineApi.md @@ -0,0 +1,354 @@ +# SynergiTech\Staffology\EngineApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**calculateNiEngine()**](EngineApi.md#calculateNiEngine) | **GET** /engine/ni | Calculate NI due. | +| [**calculateTaxEngine()**](EngineApi.md#calculateTaxEngine) | **GET** /engine/tax | Calculate Tax due | +| [**configEngine()**](EngineApi.md#configEngine) | **GET** /engine/config | Get Configuration | +| [**getNationalInsuranceThresholdsEngine()**](EngineApi.md#getNationalInsuranceThresholdsEngine) | **GET** /engine/config/{taxYear}/ni/{payPeriod} | Get National Insurance Thresholds | +| [**getTenantBrandingEngine()**](EngineApi.md#getTenantBrandingEngine) | **GET** /engine/branding/{brandCode} | Tenant Branding | + + +## `calculateNiEngine()` + +```php +calculateNiEngine($taxYear, $gross, $niCategory, $payPeriod): \SynergiTech\Staffology\Model\NationalInsuranceCalculation +``` + +Calculate NI due. + +Calculates National Insurance Contributions due given the values specified. You would never need to use this API call in practice. It is provided just for information and testing purposes. Access is limited so you'll probably receive a 401 response if you try to use it. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EngineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | If not provided then current tax year will be used. +$gross = 3.4; // float | The gross amount for which tax should be calculated. +$niCategory = 'niCategory_example'; // string | The letter from the NI table +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (Weekly, Monthly, etc) + +try { + $result = $apiInstance->calculateNiEngine($taxYear, $gross, $niCategory, $payPeriod); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EngineApi->calculateNiEngine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| If not provided then current tax year will be used. | [optional] | +| **gross** | **float**| The gross amount for which tax should be calculated. | [optional] | +| **niCategory** | **string**| The letter from the NI table | [optional] | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (Weekly, Monthly, etc) | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NationalInsuranceCalculation**](../Model/NationalInsuranceCalculation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `calculateTaxEngine()` + +```php +calculateTaxEngine($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate): float +``` + +Calculate Tax due + +Calculates tax amount due, given the values specified. You would never need to use this API call. It is provided just for information and testing purposes. Access is limited so you'll probably receive a 401 response if you try to use it. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EngineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | If not provided then current tax year will be used. +$taxCode = 'taxCode_example'; // string | If not provided then the default code for the tax year will be used. +$gross = 3.4; // float | The gross amount for which tax should be calculated. +$periodStart = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$periodEnd = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (Weekly, Monthly, etc) +$period = 1; // int | The period that this payment is being made for +$week1 = false; // bool | If set to true then tax will be calculated in a Week1/Month1 basis +$grossToDate = 0; // float | Gross pay to date +$taxToDate = 0; // float | Tax paid to date + +try { + $result = $apiInstance->calculateTaxEngine($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EngineApi->calculateTaxEngine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| If not provided then current tax year will be used. | [optional] | +| **taxCode** | **string**| If not provided then the default code for the tax year will be used. | [optional] | +| **gross** | **float**| The gross amount for which tax should be calculated. | [optional] | +| **periodStart** | **\DateTime**| | [optional] | +| **periodEnd** | **\DateTime**| | [optional] | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (Weekly, Monthly, etc) | [optional] | +| **period** | **int**| The period that this payment is being made for | [optional] [default to 1] | +| **week1** | **bool**| If set to true then tax will be calculated in a Week1/Month1 basis | [optional] [default to false] | +| **grossToDate** | **float**| Gross pay to date | [optional] [default to 0] | +| **taxToDate** | **float**| Tax paid to date | [optional] [default to 0] | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `configEngine()` + +```php +configEngine($taxYear): \SynergiTech\Staffology\Model\TaxYearConfig +``` + +Get Configuration + +Returns the raw configuration data that is used as the basis for any calculations for the given tax year. You would never need to use this configuration values yourself in any API calls. It is provided just for information purposes + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EngineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. If not provided then current tax year will be used. + +try { + $result = $apiInstance->configEngine($taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EngineApi->configEngine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. If not provided then current tax year will be used. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\TaxYearConfig**](../Model/TaxYearConfig.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNationalInsuranceThresholdsEngine()` + +```php +getNationalInsuranceThresholdsEngine($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate): \SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues +``` + +Get National Insurance Thresholds + +Returns the National Insurance thresholds for the given PayPeriod + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EngineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, monthly) that you want to retrieve details for. +$periodStart = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$periodEnd = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$effectiveDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. + +try { + $result = $apiInstance->getNationalInsuranceThresholdsEngine($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EngineApi->getNationalInsuranceThresholdsEngine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, monthly) that you want to retrieve details for. | | +| **periodStart** | **\DateTime**| | [optional] | +| **periodEnd** | **\DateTime**| | [optional] | +| **effectiveDate** | **\DateTime**| The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues**](../Model/NationalInsuranceCalculationPeriodValues.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTenantBrandingEngine()` + +```php +getTenantBrandingEngine($brandCode): \SynergiTech\Staffology\Model\Tenant +``` + +Tenant Branding + +Returns Tenant Branding. Not for public use, will return 401 + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EngineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$brandCode = 'brandCode_example'; // string | The Id of the Tenant you want to retrieve. + +try { + $result = $apiInstance->getTenantBrandingEngine($brandCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EngineApi->getTenantBrandingEngine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **brandCode** | **string**| The Id of the Tenant you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/EpsApi.md b/docs/Api/EpsApi.md new file mode 100644 index 0000000..1d8be21 --- /dev/null +++ b/docs/Api/EpsApi.md @@ -0,0 +1,741 @@ +# SynergiTech\Staffology\EpsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apprenticeshipLevyEps()**](EpsApi.md#apprenticeshipLevyEps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/apprenticeshipLevytodate | Apprenticeship Levy | +| [**createEps()**](EpsApi.md#createEps) | **POST** /employers/{employerId}/rti/eps/{taxYear} | Create EPS | +| [**deleteEps()**](EpsApi.md#deleteEps) | **DELETE** /employers/{employerId}/rti/eps/{taxYear}/{id} | Delete Eps | +| [**getEps()**](EpsApi.md#getEps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{id} | Get EPS | +| [**getXmlRequestEps()**](EpsApi.md#getXmlRequestEps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{id}/xml/request | Get XML Request | +| [**listEps()**](EpsApi.md#listEps) | **GET** /employers/{employerId}/rti/eps/{taxYear} | List EPS | +| [**markAsAcceptedEps()**](EpsApi.md#markAsAcceptedEps) | **POST** /employers/{employerId}/rti/eps/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**recoverableAmountsEps()**](EpsApi.md#recoverableAmountsEps) | **GET** /employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/recoverableamounts | Recoverable Amounts | +| [**requiringAttentionEps()**](EpsApi.md#requiringAttentionEps) | **GET** /employers/{employerId}/rti/eps/requiringattention | EPS Requiring Attention | +| [**submitEps()**](EpsApi.md#submitEps) | **POST** /employers/{employerId}/rti/eps/{taxYear}/{id}/submit | Submit EPS | +| [**updateEps()**](EpsApi.md#updateEps) | **PUT** /employers/{employerId}/rti/eps/{taxYear}/{id} | Update EPS | + + +## `apprenticeshipLevyEps()` + +```php +apprenticeshipLevyEps($employerId, $taxYear, $taxMonth): \SynergiTech\Staffology\Model\EpsApprenticeshipLevy +``` + +Apprenticeship Levy + +Get all Apprenticeship Levy (SMP, etc) for a given tax year, up to the given tax month, and if the 'Linked EPS' is enabled by the employer, apprenticeship levy as well as the apprenticeship levy for any employers with 'Linked EPS' enabled and with the same PAYE scheme is returned as a sum. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$taxMonth = 56; // int + +try { + $result = $apiInstance->apprenticeshipLevyEps($employerId, $taxYear, $taxMonth); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->apprenticeshipLevyEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **taxMonth** | **int**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\EpsApprenticeshipLevy**](../Model/EpsApprenticeshipLevy.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createEps()` + +```php +createEps($employerId, $taxYear, $eps): \SynergiTech\Staffology\Model\Eps +``` + +Create EPS + +Creates a new Employer Payment Summary + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$eps = new \SynergiTech\Staffology\Model\Eps(); // \SynergiTech\Staffology\Model\Eps + +try { + $result = $apiInstance->createEps($employerId, $taxYear, $eps); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->createEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **eps** | [**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteEps()` + +```php +deleteEps($employerId, $taxYear, $id) +``` + +Delete Eps + +Deletes the Eps. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteEps($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->deleteEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEps()` + +```php +getEps($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Eps +``` + +Get EPS + +Retrieves the Employer Payment Summary specified + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getEps($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->getEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestEps()` + +```php +getXmlRequestEps($employerId, $taxYear, $id): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getXmlRequestEps($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->getXmlRequestEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listEps()` + +```php +listEps($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List EPS + +Returns all Employment Payment Summaries for the given tax year. If the 'Linked EPS' is enabled by the employer, Employment Payment Summaries for employer as well as for any linked employers with 'Linked EPS' enabled and with the same PAYE scheme are returned. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listEps($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->listEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedEps()` + +```php +markAsAcceptedEps($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Eps +``` + +Mark as Sent + +Marks an Employer Payment Summary as having been sent to HMRC and accepted by them. You would only use this method if the EPS had been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedEps($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->markAsAcceptedEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `recoverableAmountsEps()` + +```php +recoverableAmountsEps($employerId, $taxYear, $taxMonth): \SynergiTech\Staffology\Model\RecoverableAmounts +``` + +Recoverable Amounts + +Get all recoverable amounts (SMP, etc) for a given tax year, up to the given tax month, and if the 'Linked EPS' is enabled by the employer, recoverable amounts as well as the recoverable amounts for any employers with 'Linked EPS' enabled and with the same PAYE scheme is returned as a sum. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$taxMonth = 56; // int + +try { + $result = $apiInstance->recoverableAmountsEps($employerId, $taxYear, $taxMonth); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->recoverableAmountsEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **taxMonth** | **int**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\RecoverableAmounts**](../Model/RecoverableAmounts.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionEps()` + +```php +requiringAttentionEps($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +EPS Requiring Attention + +Returns all Employer Payment Summaries that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionEps($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->requiringAttentionEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitEps()` + +```php +submitEps($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\Eps +``` + +Submit EPS + +Submits an existing Employment Payment Summary to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool | If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted + +try { + $result = $apiInstance->submitEps($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->submitEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEps()` + +```php +updateEps($employerId, $taxYear, $id, $eps): \SynergiTech\Staffology\Model\Eps +``` + +Update EPS + +Updates an existing Employment Payment Summary. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\EpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$eps = new \SynergiTech\Staffology\Model\Eps(); // \SynergiTech\Staffology\Model\Eps + +try { + $result = $apiInstance->updateEps($employerId, $taxYear, $id, $eps); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EpsApi->updateEps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **eps** | [**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ExbApi.md b/docs/Api/ExbApi.md new file mode 100644 index 0000000..9d3ff4e --- /dev/null +++ b/docs/Api/ExbApi.md @@ -0,0 +1,672 @@ +# SynergiTech\Staffology\ExbApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**annualValuesExb()**](ExbApi.md#annualValuesExb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/values | Annual Values | +| [**createExb()**](ExbApi.md#createExb) | **POST** /employers/{employerId}/rti/exb/{taxYear} | Create EXB | +| [**deleteExb()**](ExbApi.md#deleteExb) | **DELETE** /employers/{employerId}/rti/exb/{taxYear}/{id} | Delete EXB | +| [**getExb()**](ExbApi.md#getExb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/{id} | Get EXB | +| [**getXmlRequestExb()**](ExbApi.md#getXmlRequestExb) | **GET** /employers/{employerId}/rti/exb/{taxYear}/{id}/xml/request | Get XML Request | +| [**listExb()**](ExbApi.md#listExb) | **GET** /employers/{employerId}/rti/exb/{taxYear} | List EXB | +| [**markAsAcceptedExb()**](ExbApi.md#markAsAcceptedExb) | **POST** /employers/{employerId}/rti/exb/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**requiringAttentionExb()**](ExbApi.md#requiringAttentionExb) | **GET** /employers/{employerId}/rti/exb/requiringattention | EXB Requiring Attention | +| [**submitExb()**](ExbApi.md#submitExb) | **POST** /employers/{employerId}/rti/exb/{taxYear}/{id}/submit | Submit EXB | +| [**updateExb()**](ExbApi.md#updateExb) | **PUT** /employers/{employerId}/rti/exb/{taxYear}/{id} | Update EXB | + + +## `annualValuesExb()` + +```php +annualValuesExb($employerId, $taxYear): \SynergiTech\Staffology\Model\Exb +``` + +Annual Values + +Returns an empty Exb showing the number of employees and total benefits for the year provided + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->annualValuesExb($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->annualValuesExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createExb()` + +```php +createExb($employerId, $taxYear, $exb): \SynergiTech\Staffology\Model\Eps +``` + +Create EXB + +Creates a new Expenses And Benefits submission + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$exb = new \SynergiTech\Staffology\Model\Exb(); // \SynergiTech\Staffology\Model\Exb + +try { + $result = $apiInstance->createExb($employerId, $taxYear, $exb); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->createExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **exb** | [**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Eps**](../Model/Eps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteExb()` + +```php +deleteExb($employerId, $taxYear, $id) +``` + +Delete EXB + +Deletes the EXB. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteExb($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->deleteExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getExb()` + +```php +getExb($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Exb +``` + +Get EXB + +Retrieves the Expenses And Benefits submission specified + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getExb($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->getExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestExb()` + +```php +getXmlRequestExb($employerId, $taxYear, $id): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getXmlRequestExb($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->getXmlRequestExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listExb()` + +```php +listExb($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List EXB + +Returns all ExpensesAndBenefits for the given tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listExb($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->listExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedExb()` + +```php +markAsAcceptedExb($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Exb +``` + +Mark as Sent + +Marks an Expenses And Benefits submission as having been sent to HMRC and accepted by them. You would only use this method if the EXB had been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedExb($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->markAsAcceptedExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionExb()` + +```php +requiringAttentionExb($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +EXB Requiring Attention + +Returns all Expenses And Benefits submissions that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionExb($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->requiringAttentionExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitExb()` + +```php +submitExb($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\Exb +``` + +Submit EXB + +Submits an existing Expenses And Benefits submission to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool | If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted + +try { + $result = $apiInstance->submitExb($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->submitExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateExb()` + +```php +updateExb($employerId, $taxYear, $id, $exb): \SynergiTech\Staffology\Model\Exb +``` + +Update EXB + +Updates an existing Expenses And Benefits submission. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExbApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$exb = new \SynergiTech\Staffology\Model\Exb(); // \SynergiTech\Staffology\Model\Exb + +try { + $result = $apiInstance->updateExb($employerId, $taxYear, $id, $exb); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExbApi->updateExb: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **exb** | [**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Exb**](../Model/Exb.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ExternalDataApi.md b/docs/Api/ExternalDataApi.md new file mode 100644 index 0000000..7fd6562 --- /dev/null +++ b/docs/Api/ExternalDataApi.md @@ -0,0 +1,2121 @@ +# SynergiTech\Staffology\ExternalDataApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**authorizeExternalData()**](ExternalDataApi.md#authorizeExternalData) | **GET** /employers/{employerId}/external-data/{id}/authorize | Get Authorization Url | +| [**companiesExternalData()**](ExternalDataApi.md#companiesExternalData) | **GET** /employers/{employerId}/external-data/{id}/companies | List Companies | +| [**disconnectExternalData()**](ExternalDataApi.md#disconnectExternalData) | **GET** /employers/{employerId}/external-data/{id}/disconnect | Disconnect | +| [**employeeExternalData()**](ExternalDataApi.md#employeeExternalData) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId} | Get Employee | +| [**employeeLogsExternalData()**](ExternalDataApi.md#employeeLogsExternalData) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId}/logs | Get Employee Logs | +| [**employeesExternalData()**](ExternalDataApi.md#employeesExternalData) | **GET** /employers/{employerId}/external-data/{id}/employees | List Employees | +| [**getConfigDataExternalData()**](ExternalDataApi.md#getConfigDataExternalData) | **GET** /employers/{employerId}/external-data/{id}/config | Get Config Data | +| [**importEmployeesExternalData()**](ExternalDataApi.md#importEmployeesExternalData) | **POST** /employers/{employerId}/external-data/{id}/employees | Import Employees | +| [**listExternalData()**](ExternalDataApi.md#listExternalData) | **GET** /employers/{employerId}/external-data | List Providers | +| [**nominalCodesExternalData()**](ExternalDataApi.md#nominalCodesExternalData) | **GET** /employers/{employerId}/external-data/{id}/nominals | List Nominal Codes | +| [**pensionContributionsCsvExternalData()**](ExternalDataApi.md#pensionContributionsCsvExternalData) | **GET** /employers/{employerId}/external-data/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber} | Contributions CSV File | +| [**postJournalExternalData()**](ExternalDataApi.md#postJournalExternalData) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/journal | Post Journal | +| [**postPaymentsExternalData()**](ExternalDataApi.md#postPaymentsExternalData) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/payments | Post Payments | +| [**pushEmployeesExternalData()**](ExternalDataApi.md#pushEmployeesExternalData) | **PUT** /employers/{employerId}/external-data/{id}/employees/push | Push Employees | +| [**pushP11DExternalData()**](ExternalDataApi.md#pushP11DExternalData) | **POST** /employers/{employerId}/external-data/{id}/p11d | Push P11D | +| [**pushP11DsExternalData()**](ExternalDataApi.md#pushP11DsExternalData) | **POST** /employers/{employerId}/external-data/{id}/p11ds | Push P11Ds | +| [**pushP45ExternalData()**](ExternalDataApi.md#pushP45ExternalData) | **POST** /employers/{employerId}/external-data/{id}/p45 | Push P45 | +| [**pushP45sExternalData()**](ExternalDataApi.md#pushP45sExternalData) | **POST** /employers/{employerId}/external-data/{id}/p45s | Push P45s | +| [**pushP60ExternalData()**](ExternalDataApi.md#pushP60ExternalData) | **POST** /employers/{employerId}/external-data/{id}/p60 | Push P60 | +| [**pushP60sExternalData()**](ExternalDataApi.md#pushP60sExternalData) | **POST** /employers/{employerId}/external-data/{id}/p60s | Push P60s | +| [**pushPayslipsExternalData()**](ExternalDataApi.md#pushPayslipsExternalData) | **POST** /employers/{employerId}/external-data/{id}/payslips | Push Payslips | +| [**pushPensionLetterExternalData()**](ExternalDataApi.md#pushPensionLetterExternalData) | **POST** /employers/{employerId}/external-data/{id}/pension-letter | Push Pension Letter | +| [**pushPensionLettersExternalData()**](ExternalDataApi.md#pushPensionLettersExternalData) | **POST** /employers/{employerId}/external-data/{id}/pension-letters | Push Pension Letters | +| [**respondExternalData()**](ExternalDataApi.md#respondExternalData) | **GET** /external-data/{id}/respond | 3rd Party Response | +| [**setConfigDataExternalData()**](ExternalDataApi.md#setConfigDataExternalData) | **PUT** /employers/{employerId}/external-data/{id}/config | Set Config Data | +| [**setCredentialsExternalData()**](ExternalDataApi.md#setCredentialsExternalData) | **PUT** /employers/{employerId}/external-data/{id}/authorize | Set Credentials | +| [**syncAllEmployeesExternalData()**](ExternalDataApi.md#syncAllEmployeesExternalData) | **GET** /employers/{employerId}/external-data/{id}/employees/i/sync-all | Sync Employees | +| [**syncEmployeeExternalData()**](ExternalDataApi.md#syncEmployeeExternalData) | **GET** /employers/{employerId}/external-data/{id}/employees/{employeeId}/sync | Sync Employee | +| [**syncLeaveExternalData()**](ExternalDataApi.md#syncLeaveExternalData) | **POST** /employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/leave | Sync Leave | +| [**timeAndAttendanceExternalData()**](ExternalDataApi.md#timeAndAttendanceExternalData) | **GET** /employers/{employerId}/external-data/{id}/time-and-attendance | Get Time And Attendance Data | +| [**updateEmployeeExternalData()**](ExternalDataApi.md#updateEmployeeExternalData) | **PUT** /employers/{employerId}/external-data/{id}/employees/{employeeId} | Update Employee | + + +## `authorizeExternalData()` + +```php +authorizeExternalData($employerId, $id, $returnUrl): string +``` + +Get Authorization Url + +For ExternalDataProviders with an AuthScheme of OAuth1 or OAuth2. Returns a Url to redirect a user to in order to start the authorization process with the given ExternalDataProvider. Our API handles the response from the OAuth provider and processes it to obtain a token. The user is then sent to the URL specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the ExternalDataProvider you want to authorize with. +$returnUrl = 'returnUrl_example'; // string | The URL to send the user to once the process is complete. + +try { + $result = $apiInstance->authorizeExternalData($employerId, $id, $returnUrl); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->authorizeExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the ExternalDataProvider you want to authorize with. | | +| **returnUrl** | **string**| The URL to send the user to once the process is complete. | [optional] | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `companiesExternalData()` + +```php +companiesExternalData($id, $employerId): \SynergiTech\Staffology\Model\ExternalDataCompany[] +``` + +List Companies + +Return a list of companies from the external data provider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->companiesExternalData($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->companiesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalDataCompany[]**](../Model/ExternalDataCompany.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `disconnectExternalData()` + +```php +disconnectExternalData($employerId, $id) +``` + +Disconnect + +Disconnect from the external provider and revoke any OAuth token that has been received. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the ExternalDataProvider you want to disconnect from. + +try { + $apiInstance->disconnectExternalData($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->disconnectExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the ExternalDataProvider you want to disconnect from. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeExternalData()` + +```php +employeeExternalData($id, $employerId, $employeeId): \SynergiTech\Staffology\Model\ExternalEmployeeMapping +``` + +Get Employee + +Return an ExternalEmployeeMapping for the specified Employee from the external data provider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The Id of the employee in the external data provider + +try { + $result = $apiInstance->employeeExternalData($id, $employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->employeeExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| The Id of the employee in the external data provider | | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalEmployeeMapping**](../Model/ExternalEmployeeMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeLogsExternalData()` + +```php +employeeLogsExternalData($id, $employerId, $employeeId): \SynergiTech\Staffology\Model\LogEntry[] +``` + +Get Employee Logs + +Return a list of changes made locally to this employee based on changes in the external data provider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The Id of the employee in the external data provider + +try { + $result = $apiInstance->employeeLogsExternalData($id, $employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->employeeLogsExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| The Id of the employee in the external data provider | | + +### Return type + +[**\SynergiTech\Staffology\Model\LogEntry[]**](../Model/LogEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeesExternalData()` + +```php +employeesExternalData($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Employees + +Return a list of ExternalEmployeeMapping for Employees in the external data provider. The metadata of the Item contains a field called externalId. This can be used to retrieve the full employee record. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->employeesExternalData($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->employeesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getConfigDataExternalData()` + +```php +getConfigDataExternalData($employerId, $id): mixed +``` + +Get Config Data + +Returns any additional configuration data for the connection to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the ExternalDataProvider you want configuration data for. + +try { + $result = $apiInstance->getConfigDataExternalData($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->getConfigDataExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the ExternalDataProvider you want configuration data for. | | + +### Return type + +**mixed** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importEmployeesExternalData()` + +```php +importEmployeesExternalData($id, $employerId, $requestBody): \SynergiTech\Staffology\Model\Item[] +``` + +Import Employees + +Import Employees from the external data provider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$requestBody = array('requestBody_example'); // string[] | The externalIds to import + +try { + $result = $apiInstance->importEmployeesExternalData($id, $employerId, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->importEmployeesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **requestBody** | [**string[]**](../Model/string.md)| The externalIds to import | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listExternalData()` + +```php +listExternalData($employerId): \SynergiTech\Staffology\Model\ExternalDataProvider[] +``` + +List Providers + +Returns a list of External Data Providers and indicates which the Employer has successfully authenticated with. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. + +try { + $result = $apiInstance->listExternalData($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->listExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalDataProvider[]**](../Model/ExternalDataProvider.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `nominalCodesExternalData()` + +```php +nominalCodesExternalData($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Nominal Codes + +Return a list of Nominal Codes from the external data provider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->nominalCodesExternalData($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->nominalCodesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pensionContributionsCsvExternalData()` + +```php +pensionContributionsCsvExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal): string +``` + +Contributions CSV File + +Returns a CSV file containing contributions for the specified payrun in a format specific to the ExternalDataProvider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$schemeId = 'schemeId_example'; // string | The Id of the Pension Scheme you want a file for. +$ordinal = 1; // int + +try { + $result = $apiInstance->pensionContributionsCsvExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pensionContributionsCsvExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **schemeId** | **string**| The Id of the Pension Scheme you want a file for. | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postJournalExternalData()` + +```php +postJournalExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal): \SynergiTech\Staffology\Model\PayRunJournal +``` + +Post Journal + +Post a Journal for a payrun to the ExternalDataProvider A 200 response does not mean the journal was necessarily successfully posted. The PayRunJournal is returned (without the Lines) so that you can inspect the status to determine success + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | To identify the PayRun +$periodNumber = 56; // int | To identify the PayRun +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | To identify the PayRun +$force = True; // bool | Set to true if you want to force the journal to be posted even if it already has been +$ordinal = 1; // int + +try { + $result = $apiInstance->postJournalExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->postJournalExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| To identify the PayRun | | +| **periodNumber** | **int**| To identify the PayRun | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| To identify the PayRun | | +| **force** | **bool**| Set to true if you want to force the journal to be posted even if it already has been | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunJournal**](../Model/PayRunJournal.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `postPaymentsExternalData()` + +```php +postPaymentsExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate): \SynergiTech\Staffology\Model\BankPaymentInstruction +``` + +Post Payments + +Post Payments for a payrun to the ExternalDataProvider A 200 response does not mean the payments were necessarily successfully posted. The BankPaymentInstruction is returned (without the payments) so that you can inspect the status to determine success + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | To identify the PayRun +$periodNumber = 56; // int | To identify the PayRun +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | To identify the PayRun +$incEmployees = True; // bool | Include payments for employees +$incHmrc = True; // bool | Include payments for HMRC (if any) +$incPensions = True; // bool | Include payments for Pension Providers (if any) +$incAeos = True; // bool | Include any payment due as a result of AttachmentOrders (if any) +$incDeductions = True; // bool | Include any payment due to Deductions that are set to be paid to a Payee (if any) +$force = True; // bool | Set to true if you want to force the payments to be posted even if it already has been +$ordinal = 1; // int +$paymentDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Optional. If a value is provided then it'll be used in place of the payment date for the payment. + +try { + $result = $apiInstance->postPaymentsExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->postPaymentsExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| To identify the PayRun | | +| **periodNumber** | **int**| To identify the PayRun | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| To identify the PayRun | | +| **incEmployees** | **bool**| Include payments for employees | [optional] | +| **incHmrc** | **bool**| Include payments for HMRC (if any) | [optional] | +| **incPensions** | **bool**| Include payments for Pension Providers (if any) | [optional] | +| **incAeos** | **bool**| Include any payment due as a result of AttachmentOrders (if any) | [optional] | +| **incDeductions** | **bool**| Include any payment due to Deductions that are set to be paid to a Payee (if any) | [optional] | +| **force** | **bool**| Set to true if you want to force the payments to be posted even if it already has been | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **paymentDate** | **\DateTime**| Optional. If a value is provided then it'll be used in place of the payment date for the payment. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\BankPaymentInstruction**](../Model/BankPaymentInstruction.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushEmployeesExternalData()` + +```php +pushEmployeesExternalData($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Push Employees + +Push employees to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->pushEmployeesExternalData($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushEmployeesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP11DExternalData()` + +```php +pushP11DExternalData($id, $employerId, $employeeId, $taxYear) +``` + +Push P11D + +Pushes a P11D for the given employee to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $apiInstance->pushP11DExternalData($id, $employerId, $employeeId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP11DExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP11DsExternalData()` + +```php +pushP11DsExternalData($id, $employerId, $taxYear) +``` + +Push P11Ds + +Pushes all P11Ds for the given TaxYear to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $apiInstance->pushP11DsExternalData($id, $employerId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP11DsExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP45ExternalData()` + +```php +pushP45ExternalData($id, $employerId, $employeeId) +``` + +Push P45 + +Push a P45 to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $apiInstance->pushP45ExternalData($id, $employerId, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP45ExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP45sExternalData()` + +```php +pushP45sExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal) +``` + +Push P45s + +Push P45s to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the External Provider to which you want to send P45s +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to send P45s +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s +$periodNumber = 56; // int | The Period (i.e, Tax Month, Tax Week) for which you want to send P45s +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The Tax Year for which you want to send P45s +$ordinal = 1; // int | Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s + +try { + $apiInstance->pushP45sExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP45sExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the External Provider to which you want to send P45s | | +| **employerId** | **string**| The Id of the Employer for which you want to send P45s | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s | [optional] | +| **periodNumber** | **int**| The Period (i.e, Tax Month, Tax Week) for which you want to send P45s | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The Tax Year for which you want to send P45s | [optional] | +| **ordinal** | **int**| Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP60ExternalData()` + +```php +pushP60ExternalData($id, $employerId, $employeeId, $taxYear) +``` + +Push P60 + +Pushes a P60 to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $apiInstance->pushP60ExternalData($id, $employerId, $employeeId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP60ExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushP60sExternalData()` + +```php +pushP60sExternalData($id, $employerId, $taxYear) +``` + +Push P60s + +Pushes P60s to the ExternalDataProvider for all employees paid for a given tax year, provided they were paid during that tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $apiInstance->pushP60sExternalData($id, $employerId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushP60sExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushPayslipsExternalData()` + +```php +pushPayslipsExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId) +``` + +Push Payslips + +Push payslips to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$force = True; // bool +$ordinal = 1; // int +$employeeId = 'employeeId_example'; // string + +try { + $apiInstance->pushPayslipsExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushPayslipsExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | [optional] | +| **periodNumber** | **int**| | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **force** | **bool**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **employeeId** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushPensionLetterExternalData()` + +```php +pushPensionLetterExternalData($id, $employerId, $employeeId, $assessmentId) +``` + +Push Pension Letter + +Pushes a Pension Letter for the given employee to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$assessmentId = 'assessmentId_example'; // string + +try { + $apiInstance->pushPensionLetterExternalData($id, $employerId, $employeeId, $assessmentId); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushPensionLetterExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| | [optional] | +| **assessmentId** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pushPensionLettersExternalData()` + +```php +pushPensionLettersExternalData($id, $employerId) +``` + +Push Pension Letters + +Pushes a Pension Letters for the given employees to the ExternalDataProvider. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $apiInstance->pushPensionLettersExternalData($id, $employerId); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->pushPensionLettersExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `respondExternalData()` + +```php +respondExternalData($id, $error) +``` + +3rd Party Response + +This endpoint is used by third parties to respond to an oAuth authorization request. You do not need to use this + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$error = 'error_example'; // string + +try { + $apiInstance->respondExternalData($id, $error); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->respondExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **error** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setConfigDataExternalData()` + +```php +setConfigDataExternalData($employerId, $id, $body): mixed +``` + +Set Config Data + +Sets the additional configuration data for the connection to the ExternalDataProvider. Only the value set in the userData field is updated + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the ExternalDataProvider you want configuration data for. +$body = NULL; // mixed + +try { + $result = $apiInstance->setConfigDataExternalData($employerId, $id, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->setConfigDataExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the ExternalDataProvider you want configuration data for. | | +| **body** | **mixed**| | [optional] | + +### Return type + +**mixed** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setCredentialsExternalData()` + +```php +setCredentialsExternalData($employerId, $id, $username, $password, $stringStringKeyValuePair) +``` + +Set Credentials + +For ExternalDataProviders with an AuthScheme of Basic. Sets the username and password for the service. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId | The Id of the ExternalDataProvider you want to authorize with. +$username = 'username_example'; // string | The username for the ExternalDataProvider. +$password = 'password_example'; // string | The password for the ExternalDataProvider. +$stringStringKeyValuePair = array(new \SynergiTech\Staffology\Model\StringStringKeyValuePair()); // \SynergiTech\Staffology\Model\StringStringKeyValuePair[] | Any additional data that is needed (optional) + +try { + $apiInstance->setCredentialsExternalData($employerId, $id, $username, $password, $stringStringKeyValuePair); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->setCredentialsExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| The Id of the ExternalDataProvider you want to authorize with. | | +| **username** | **string**| The username for the ExternalDataProvider. | [optional] | +| **password** | **string**| The password for the ExternalDataProvider. | [optional] | +| **stringStringKeyValuePair** | [**\SynergiTech\Staffology\Model\StringStringKeyValuePair[]**](../Model/StringStringKeyValuePair.md)| Any additional data that is needed (optional) | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `syncAllEmployeesExternalData()` + +```php +syncAllEmployeesExternalData($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Sync Employees + +Syncs data from the ExternalDataProvider to update all mapped employees + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->syncAllEmployeesExternalData($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->syncAllEmployeesExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `syncEmployeeExternalData()` + +```php +syncEmployeeExternalData($id, $employerId, $employeeId): \SynergiTech\Staffology\Model\Item +``` + +Sync Employee + +Syncs data from the ExternalDataProvider to update the specified mapped employee. Any changes made as a result of the sync are show in the metadata.logs property. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The Id of the employee in the external data provider + +try { + $result = $apiInstance->syncEmployeeExternalData($id, $employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->syncEmployeeExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| The Id of the employee in the external data provider | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `syncLeaveExternalData()` + +```php +syncLeaveExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal) +``` + +Sync Leave + +Sync Leave from the ExternalDataProvider for the specified PayRun. Returns a JSON object indicating how many Leaves have been created, updated or deleted, etc. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->syncLeaveExternalData($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->syncLeaveExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `timeAndAttendanceExternalData()` + +```php +timeAndAttendanceExternalData($id, $employerId, $from, $to): \SynergiTech\Staffology\Model\PayOptionsImport[] +``` + +Get Time And Attendance Data + +Return a list of PayOptionsImport representing Time and Attendance data from the specified ExternalDataProvider, for to specified date range + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime + +try { + $result = $apiInstance->timeAndAttendanceExternalData($id, $employerId, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->timeAndAttendanceExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **from** | **\DateTime**| | [optional] | +| **to** | **\DateTime**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayOptionsImport[]**](../Model/PayOptionsImport.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateEmployeeExternalData()` + +```php +updateEmployeeExternalData($id, $employerId, $employeeId, $externalEmployeeMapping): \SynergiTech\Staffology\Model\ExternalEmployeeMapping +``` + +Update Employee + +Update an ExternalEmployeeMapping to map/unmap/import/ignore an employee from an external data provider + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ExternalDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The Id of the employee in the external data provider +$externalEmployeeMapping = new \SynergiTech\Staffology\Model\ExternalEmployeeMapping(); // \SynergiTech\Staffology\Model\ExternalEmployeeMapping + +try { + $result = $apiInstance->updateEmployeeExternalData($id, $employerId, $employeeId, $externalEmployeeMapping); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExternalDataApi->updateEmployeeExternalData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | | +| **employerId** | **string**| | | +| **employeeId** | **string**| The Id of the employee in the external data provider | | +| **externalEmployeeMapping** | [**\SynergiTech\Staffology\Model\ExternalEmployeeMapping**](../Model/ExternalEmployeeMapping.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalEmployeeMapping**](../Model/ExternalEmployeeMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/FpsApi.md b/docs/Api/FpsApi.md new file mode 100644 index 0000000..9deda92 --- /dev/null +++ b/docs/Api/FpsApi.md @@ -0,0 +1,678 @@ +# SynergiTech\Staffology\FpsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createFps()**](FpsApi.md#createFps) | **POST** /employers/{employerId}/rti/fps/{taxYear} | Create FPS | +| [**deleteFps()**](FpsApi.md#deleteFps) | **DELETE** /employers/{employerId}/rti/fps/{taxYear}/{id} | Delete FPS | +| [**getFps()**](FpsApi.md#getFps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/{id} | Get FPS | +| [**getXmlRequestFps()**](FpsApi.md#getXmlRequestFps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/{id}/xml/request | Get XML Request | +| [**listFps()**](FpsApi.md#listFps) | **GET** /employers/{employerId}/rti/fps/{taxYear} | List FPS | +| [**markAsAcceptedFps()**](FpsApi.md#markAsAcceptedFps) | **POST** /employers/{employerId}/rti/fps/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**mostRecentForEmployeeFps()**](FpsApi.md#mostRecentForEmployeeFps) | **GET** /employers/{employerId}/rti/fps/{taxYear}/mostrecentforemployee/{employeeId} | Get most recent FPS for Employee | +| [**requiringAttentionFps()**](FpsApi.md#requiringAttentionFps) | **GET** /employers/{employerId}/rti/fps/requiringattention | FPS Requiring Attention | +| [**submitFps()**](FpsApi.md#submitFps) | **POST** /employers/{employerId}/rti/fps/{taxYear}/{id}/submit | Submit FPS | +| [**updateFps()**](FpsApi.md#updateFps) | **PUT** /employers/{employerId}/rti/fps/{taxYear}/{id} | Update FPS | + + +## `createFps()` + +```php +createFps($employerId, $taxYear, $fps): \SynergiTech\Staffology\Model\Fps +``` + +Create FPS + +Creates a new Full Payment Submission. This is limited to corrections, to a previous year, for a single employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fps = new \SynergiTech\Staffology\Model\Fps(); // \SynergiTech\Staffology\Model\Fps + +try { + $result = $apiInstance->createFps($employerId, $taxYear, $fps); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->createFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fps** | [**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteFps()` + +```php +deleteFps($employerId, $taxYear, $id) +``` + +Delete FPS + +Not implemented, FPSes cannot be deleted + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteFps($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->deleteFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFps()` + +```php +getFps($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Fps +``` + +Get FPS + +Retrieves the Full Payment Submission specified + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getFps($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->getFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestFps()` + +```php +getXmlRequestFps($employerId, $taxYear, $id, $compressed): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$compressed = false; // bool | Indicates whether the FPS XML should be in compressed format. + +try { + $result = $apiInstance->getXmlRequestFps($employerId, $taxYear, $id, $compressed); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->getXmlRequestFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **compressed** | **bool**| Indicates whether the FPS XML should be in compressed format. | [optional] [default to false] | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listFps()` + +```php +listFps($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List FPS + +Returns all Full Payment Submissions for the given tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listFps($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->listFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedFps()` + +```php +markAsAcceptedFps($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Fps +``` + +Mark as Sent + +Marks an Full Payment Submission as having been sent to HMRC and accepted by them. You only use this method if the FPS has been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedFps($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->markAsAcceptedFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `mostRecentForEmployeeFps()` + +```php +mostRecentForEmployeeFps($employerId, $taxYear, $employeeId, $correction): \SynergiTech\Staffology\Model\Item +``` + +Get most recent FPS for Employee + +Returns the most recent Full Payment Submission that includes the specified employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$employeeId = 'employeeId_example'; // string +$correction = false; // bool | Only search for FPS's submitted as a correction to a previous year + +try { + $result = $apiInstance->mostRecentForEmployeeFps($employerId, $taxYear, $employeeId, $correction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->mostRecentForEmployeeFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **employeeId** | **string**| | | +| **correction** | **bool**| Only search for FPS's submitted as a correction to a previous year | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionFps()` + +```php +requiringAttentionFps($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +FPS Requiring Attention + +Returns all Full Payment Submissions that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionFps($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->requiringAttentionFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitFps()` + +```php +submitFps($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\Fps +``` + +Submit FPS + +Submits an existing Full Payment Submission to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool | If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted + +try { + $result = $apiInstance->submitFps($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->submitFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateFps()` + +```php +updateFps($employerId, $taxYear, $id, $fps): \SynergiTech\Staffology\Model\Fps +``` + +Update FPS + +Updates an existing Full Payment Submission. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\FpsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$fps = new \SynergiTech\Staffology\Model\Fps(); // \SynergiTech\Staffology\Model\Fps + +try { + $result = $apiInstance->updateFps($employerId, $taxYear, $id, $fps); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FpsApi->updateFps: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **fps** | [**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Fps**](../Model/Fps.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/HmrcPaymentApi.md b/docs/Api/HmrcPaymentApi.md new file mode 100644 index 0000000..2cb6347 --- /dev/null +++ b/docs/Api/HmrcPaymentApi.md @@ -0,0 +1,277 @@ +# SynergiTech\Staffology\HmrcPaymentApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**bankPaymentHmrcPayment()**](HmrcPaymentApi.md#bankPaymentHmrcPayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}/bankpayment | HMRC Bank Payment | +| [**getHmrcPayment()**](HmrcPaymentApi.md#getHmrcPayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding} | Get HmrcLiability | +| [**indexHmrcPayment()**](HmrcPaymentApi.md#indexHmrcPayment) | **GET** /employers/{employerId}/hmrcpayment/{taxYear} | List HmrcLiabilities | +| [**updateHmrcPayment()**](HmrcPaymentApi.md#updateHmrcPayment) | **PUT** /employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding} | Update HmrcLiability | + + +## `bankPaymentHmrcPayment()` + +```php +bankPaymentHmrcPayment($employerId, $taxYear, $periodEnding, $accept): \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse +``` + +HMRC Bank Payment + +Returns a payments file for the HMRC payment that needs to be made + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HmrcPaymentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodEnding = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->bankPaymentHmrcPayment($employerId, $taxYear, $periodEnding, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HmrcPaymentApi->bankPaymentHmrcPayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodEnding** | **\DateTime**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse**](../Model/BankPaymentInstructionReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getHmrcPayment()` + +```php +getHmrcPayment($employerId, $taxYear, $periodEnding): \SynergiTech\Staffology\Model\HmrcLiability +``` + +Get HmrcLiability + +Gets the HmrcLiability record for the period ending on the date specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HmrcPaymentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodEnding = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The final date of the month or quarter that the HmrcLiability is for. + +try { + $result = $apiInstance->getHmrcPayment($employerId, $taxYear, $periodEnding); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HmrcPaymentApi->getHmrcPayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodEnding** | **\DateTime**| The final date of the month or quarter that the HmrcLiability is for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\HmrcLiability**](../Model/HmrcLiability.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexHmrcPayment()` + +```php +indexHmrcPayment($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List HmrcLiabilities + +Lists all periods for which a payment is due to HMRC in the given TaxYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HmrcPaymentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list HMRC Payments +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->indexHmrcPayment($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HmrcPaymentApi->indexHmrcPayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list HMRC Payments | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateHmrcPayment()` + +```php +updateHmrcPayment($employerId, $taxYear, $periodEnding, $hmrcLiability): \SynergiTech\Staffology\Model\HmrcLiability +``` + +Update HmrcLiability + +Updates the editable fields of a HmrcLiability (ie, Adjustment, CISDeductionsSuffered, etc) + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HmrcPaymentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodEnding = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The final date of the month or quarter that the HmrcLiability is for. +$hmrcLiability = new \SynergiTech\Staffology\Model\HmrcLiability(); // \SynergiTech\Staffology\Model\HmrcLiability + +try { + $result = $apiInstance->updateHmrcPayment($employerId, $taxYear, $periodEnding, $hmrcLiability); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HmrcPaymentApi->updateHmrcPayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodEnding** | **\DateTime**| The final date of the month or quarter that the HmrcLiability is for. | | +| **hmrcLiability** | [**\SynergiTech\Staffology\Model\HmrcLiability**](../Model/HmrcLiability.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\HmrcLiability**](../Model/HmrcLiability.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/HolidaySchemeApi.md b/docs/Api/HolidaySchemeApi.md new file mode 100644 index 0000000..7c2221c --- /dev/null +++ b/docs/Api/HolidaySchemeApi.md @@ -0,0 +1,321 @@ +# SynergiTech\Staffology\HolidaySchemeApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createHolidayScheme()**](HolidaySchemeApi.md#createHolidayScheme) | **POST** /employers/{employerId}/holidayscheme | Create holiday scheme | +| [**deleteHolidayScheme()**](HolidaySchemeApi.md#deleteHolidayScheme) | **DELETE** /employers/{employerId}/holidayscheme/{id} | Delete holiday scheme | +| [**getByIdHolidayScheme()**](HolidaySchemeApi.md#getByIdHolidayScheme) | **GET** /employers/{employerId}/holidayscheme/{id} | Get holiday scheme by Id | +| [**getHolidayScheme()**](HolidaySchemeApi.md#getHolidayScheme) | **GET** /employers/{employerId}/holidayscheme | Get holiday scheme | +| [**updateHolidayScheme()**](HolidaySchemeApi.md#updateHolidayScheme) | **PUT** /employers/{employerId}/holidayscheme/{id} | Update holiday scheme | + + +## `createHolidayScheme()` + +```php +createHolidayScheme($employerId, $contractHolidaySchemeRequest): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse +``` + +Create holiday scheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HolidaySchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$contractHolidaySchemeRequest = new \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest(); // \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest + +try { + $result = $apiInstance->createHolidayScheme($employerId, $contractHolidaySchemeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HolidaySchemeApi->createHolidayScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractHolidaySchemeRequest** | [**\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest**](../Model/ContractHolidaySchemeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse**](../Model/ContractHolidaySchemeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteHolidayScheme()` + +```php +deleteHolidayScheme($employerId, $id) +``` + +Delete holiday scheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HolidaySchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteHolidayScheme($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling HolidaySchemeApi->deleteHolidayScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getByIdHolidayScheme()` + +```php +getByIdHolidayScheme($employerId, $id): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse +``` + +Get holiday scheme by Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HolidaySchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $result = $apiInstance->getByIdHolidayScheme($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HolidaySchemeApi->getByIdHolidayScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse**](../Model/ContractHolidaySchemeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getHolidayScheme()` + +```php +getHolidayScheme($employerId): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[] +``` + +Get holiday scheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HolidaySchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->getHolidayScheme($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HolidaySchemeApi->getHolidayScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]**](../Model/ContractHolidaySchemeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateHolidayScheme()` + +```php +updateHolidayScheme($employerId, $id, $contractHolidaySchemeRequest): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse +``` + +Update holiday scheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\HolidaySchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$contractHolidaySchemeRequest = new \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest(); // \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest + +try { + $result = $apiInstance->updateHolidayScheme($employerId, $id, $contractHolidaySchemeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HolidaySchemeApi->updateHolidayScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **contractHolidaySchemeRequest** | [**\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest**](../Model/ContractHolidaySchemeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse**](../Model/ContractHolidaySchemeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ImportApi.md b/docs/Api/ImportApi.md new file mode 100644 index 0000000..05d5046 --- /dev/null +++ b/docs/Api/ImportApi.md @@ -0,0 +1,737 @@ +# SynergiTech\Staffology\ImportApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPaymentsCsvMappingImport()**](ImportApi.md#createPaymentsCsvMappingImport) | **POST** /employers/{employerId}/import/payments/mappings | Create PaymentsCsvMapping | +| [**deletePaymentCsvMappingImport()**](ImportApi.md#deletePaymentCsvMappingImport) | **DELETE** /employers/{employerId}/import/payments/mappings/{id} | Delete PaymentsCsvMapping | +| [**employeeImportCsvImport()**](ImportApi.md#employeeImportCsvImport) | **POST** /employers/{employerId}/import/employees/async | Import Employees Asynchronously (Beta) | +| [**importEmployeePayImport()**](ImportApi.md#importEmployeePayImport) | **POST** /employers/{employerId}/import/pay | Import Pay To Employee | +| [**importLeaveImport()**](ImportApi.md#importLeaveImport) | **POST** /employers/{employerId}/import/leave | Import Leave Asynchronously | +| [**importPensionMembershipsImport()**](ImportApi.md#importPensionMembershipsImport) | **POST** /employers/{employerId}/import/pensionmemberships | Import PensionMemberships from csv file | +| [**importRolesImport()**](ImportApi.md#importRolesImport) | **POST** /employers/{employerId}/import/import | Import EmployeeRoles from csv file | +| [**listPaymentsCsvMappingsImport()**](ImportApi.md#listPaymentsCsvMappingsImport) | **GET** /employers/{employerId}/import/payments/mappings | List PaymentsCsvMappings | +| [**paymentsCsvMappingCsvFileImport()**](ImportApi.md#paymentsCsvMappingCsvFileImport) | **GET** /employers/{employerId}/import/payments/mappings/{id}/csv | Get PaymentsCsvMapping CSV File | +| [**paymentsCsvMappingImport()**](ImportApi.md#paymentsCsvMappingImport) | **GET** /employers/{employerId}/import/payments/mappings/{id} | Get PaymentsCsvMapping | +| [**updatePaymentsCsvMappingImport()**](ImportApi.md#updatePaymentsCsvMappingImport) | **PUT** /employers/{employerId}/import/payments/mappings/{id} | Update PaymentsCsvMapping | + + +## `createPaymentsCsvMappingImport()` + +```php +createPaymentsCsvMappingImport($employerId, $paymentsCsvMapping) +``` + +Create PaymentsCsvMapping + +Creates a new PaymentsCsvMapping for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$paymentsCsvMapping = new \SynergiTech\Staffology\Model\PaymentsCsvMapping(); // \SynergiTech\Staffology\Model\PaymentsCsvMapping + +try { + $apiInstance->createPaymentsCsvMappingImport($employerId, $paymentsCsvMapping); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->createPaymentsCsvMappingImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **paymentsCsvMapping** | [**\SynergiTech\Staffology\Model\PaymentsCsvMapping**](../Model/PaymentsCsvMapping.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePaymentCsvMappingImport()` + +```php +deletePaymentCsvMappingImport($employerId, $id) +``` + +Delete PaymentsCsvMapping + +Deletes the specified PaymentsCsvMapping. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deletePaymentCsvMappingImport($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->deletePaymentCsvMappingImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeImportCsvImport()` + +```php +employeeImportCsvImport($employerId, $format, $allowUpdates, $file): \SynergiTech\Staffology\Model\ContractJobResponse +``` + +Import Employees Asynchronously (Beta) + +This endpoint is currently being beta tested and subject to unannounced breaking changes. Allows the import of employees asynchronously from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The employer id. +$format = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\CsvFileFormat(); // \SynergiTech\Staffology\Model\CsvFileFormat | The CSV format. +$allowUpdates = false; // bool | If set to true, and if the payroll code matches an existing employee, then that employee will be updated. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->employeeImportCsvImport($employerId, $format, $allowUpdates, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->employeeImportCsvImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The employer id. | | +| **format** | [**\SynergiTech\Staffology\Model\CsvFileFormat**](../Model/.md)| The CSV format. | [optional] | +| **allowUpdates** | **bool**| If set to true, and if the payroll code matches an existing employee, then that employee will be updated. | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importEmployeePayImport()` + +```php +importEmployeePayImport($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport) +``` + +Import Pay To Employee + +Takes a list PayOptionsImport and updates employees PayOptions to use the values provided. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$linesOnly = false; // bool | If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. +$append = false; // bool | If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. +$updateExisting = false; // bool | If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. +$validateOnly = false; // bool | If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. +$payOptionsImport = array(new \SynergiTech\Staffology\Model\PayOptionsImport()); // \SynergiTech\Staffology\Model\PayOptionsImport[] + +try { + $apiInstance->importEmployeePayImport($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->importEmployeePayImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **linesOnly** | **bool**| If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. | [optional] [default to false] | +| **append** | **bool**| If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. | [optional] [default to false] | +| **updateExisting** | **bool**| If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. | [optional] [default to false] | +| **validateOnly** | **bool**| If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. | [optional] [default to false] | +| **payOptionsImport** | [**\SynergiTech\Staffology\Model\PayOptionsImport[]**](../Model/PayOptionsImport.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importLeaveImport()` + +```php +importLeaveImport($employerId, $contractLeaveImportRequest): \SynergiTech\Staffology\Model\ContractJobResponse +``` + +Import Leave Asynchronously + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The employer id. +$contractLeaveImportRequest = array(new \SynergiTech\Staffology\Model\ContractLeaveImportRequest()); // \SynergiTech\Staffology\Model\ContractLeaveImportRequest[] | The import leave items. + +try { + $result = $apiInstance->importLeaveImport($employerId, $contractLeaveImportRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->importLeaveImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The employer id. | | +| **contractLeaveImportRequest** | [**\SynergiTech\Staffology\Model\ContractLeaveImportRequest[]**](../Model/ContractLeaveImportRequest.md)| The import leave items. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importPensionMembershipsImport()` + +```php +importPensionMembershipsImport($employerId, $previewOnly, $allowUpdates, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import PensionMemberships from csv file + +Import Pension Memberships from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$previewOnly = false; // bool | Set to true and nothing will be imported but you'll be shown a preview of the data. +$allowUpdates = false; // bool +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importPensionMembershipsImport($employerId, $previewOnly, $allowUpdates, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->importPensionMembershipsImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **previewOnly** | **bool**| Set to true and nothing will be imported but you'll be shown a preview of the data. | [optional] [default to false] | +| **allowUpdates** | **bool**| | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importRolesImport()` + +```php +importRolesImport($employerId, $previewOnly, $allowUpdates, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import EmployeeRoles from csv file + +Import Employee Roles from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$previewOnly = false; // bool | Set to true and nothing will be imported but you'll be shown a preview of the data. +$allowUpdates = false; // bool +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importRolesImport($employerId, $previewOnly, $allowUpdates, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->importRolesImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **previewOnly** | **bool**| Set to true and nothing will be imported but you'll be shown a preview of the data. | [optional] [default to false] | +| **allowUpdates** | **bool**| | [optional] [default to false] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listPaymentsCsvMappingsImport()` + +```php +listPaymentsCsvMappingsImport($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List PaymentsCsvMappings + +Lists all PaymentsCsvMappings for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list mappings + +try { + $result = $apiInstance->listPaymentsCsvMappingsImport($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->listPaymentsCsvMappingsImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list mappings | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `paymentsCsvMappingCsvFileImport()` + +```php +paymentsCsvMappingCsvFileImport($employerId, $id): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get PaymentsCsvMapping CSV File + +Gets a CSV file in the format needed to import for the specified PaymentsCsvMapping This is only available for PaymentsCsvMapping with a Type of ColumnBased + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PaymentCsvMapping belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->paymentsCsvMappingCsvFileImport($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->paymentsCsvMappingCsvFileImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PaymentCsvMapping belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `paymentsCsvMappingImport()` + +```php +paymentsCsvMappingImport($employerId, $id): \SynergiTech\Staffology\Model\PaymentsCsvMapping +``` + +Get PaymentsCsvMapping + +Gets the PaymentsCsvMapping specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PaymentCsvMapping belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->paymentsCsvMappingImport($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->paymentsCsvMappingImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PaymentCsvMapping belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PaymentsCsvMapping**](../Model/PaymentsCsvMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePaymentsCsvMappingImport()` + +```php +updatePaymentsCsvMappingImport($employerId, $id, $paymentsCsvMapping): \SynergiTech\Staffology\Model\PaymentsCsvMapping +``` + +Update PaymentsCsvMapping + +Updates the PaymentsCsvMapping specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ImportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PaymentsCsvMapping belongs. +$id = 'id_example'; // string +$paymentsCsvMapping = new \SynergiTech\Staffology\Model\PaymentsCsvMapping(); // \SynergiTech\Staffology\Model\PaymentsCsvMapping + +try { + $result = $apiInstance->updatePaymentsCsvMappingImport($employerId, $id, $paymentsCsvMapping); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ImportApi->updatePaymentsCsvMappingImport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PaymentsCsvMapping belongs. | | +| **id** | **string**| | | +| **paymentsCsvMapping** | [**\SynergiTech\Staffology\Model\PaymentsCsvMapping**](../Model/PaymentsCsvMapping.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaymentsCsvMapping**](../Model/PaymentsCsvMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/InvitationApi.md b/docs/Api/InvitationApi.md new file mode 100644 index 0000000..fdde058 --- /dev/null +++ b/docs/Api/InvitationApi.md @@ -0,0 +1,330 @@ +# SynergiTech\Staffology\InvitationApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**acceptInvitation()**](InvitationApi.md#acceptInvitation) | **POST** /invitations/{id} | Accept Invitation | +| [**createInvitation()**](InvitationApi.md#createInvitation) | **POST** /employers/{employerId}/invitation | Create Invitation | +| [**deleteInvitation()**](InvitationApi.md#deleteInvitation) | **DELETE** /employers/{employerId}/invitation/{id} | Delete Invitation | +| [**getInvitation()**](InvitationApi.md#getInvitation) | **GET** /employers/{employerId}/invitation/{id} | Get Invitation | +| [**indexInvitation()**](InvitationApi.md#indexInvitation) | **GET** /employers/{employerId}/invitation | List Invitations | + + +## `acceptInvitation()` + +```php +acceptInvitation($id, $acceptInvitation) +``` + +Accept Invitation + +Accepts the Invitation. The user making this API call must have the email address that the invite was created for and the email address must be verified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\InvitationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$acceptInvitation = True; // bool | Set to true to accept the invitation or false to decline it. + +try { + $apiInstance->acceptInvitation($id, $acceptInvitation); +} catch (Exception $e) { + echo 'Exception when calling InvitationApi->acceptInvitation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **acceptInvitation** | **bool**| Set to true to accept the invitation or false to decline it. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createInvitation()` + +```php +createInvitation($employerId, $autoAccept, $invitation): \SynergiTech\Staffology\Model\Invitation +``` + +Create Invitation + +Creates a new Invitation for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\InvitationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$autoAccept = True; // bool | This is useful for when you want to invite a user to an employer and automatically accept the invitation. +$invitation = new \SynergiTech\Staffology\Model\Invitation(); // \SynergiTech\Staffology\Model\Invitation + +try { + $result = $apiInstance->createInvitation($employerId, $autoAccept, $invitation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InvitationApi->createInvitation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **autoAccept** | **bool**| This is useful for when you want to invite a user to an employer and automatically accept the invitation. | [optional] | +| **invitation** | [**\SynergiTech\Staffology\Model\Invitation**](../Model/Invitation.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Invitation**](../Model/Invitation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteInvitation()` + +```php +deleteInvitation($employerId, $id) +``` + +Delete Invitation + +Deletes the specified Invitation. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\InvitationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteInvitation($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling InvitationApi->deleteInvitation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getInvitation()` + +```php +getInvitation($employerId, $id): \SynergiTech\Staffology\Model\Invitation +``` + +Get Invitation + +Gets the Invitation specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\InvitationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Invitation belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->getInvitation($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InvitationApi->getInvitation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Invitation belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Invitation**](../Model/Invitation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexInvitation()` + +```php +indexInvitation($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Invitations + +Lists all Invitations for an Employer. Only unaccepted Invitations are listed as they are deleted once they've been accepted. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\InvitationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Pay Codes + +try { + $result = $apiInstance->indexInvitation($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InvitationApi->indexInvitation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Pay Codes | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/JobApi.md b/docs/Api/JobApi.md new file mode 100644 index 0000000..bbc5dcc --- /dev/null +++ b/docs/Api/JobApi.md @@ -0,0 +1,328 @@ +# SynergiTech\Staffology\JobApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**deleteCompletedJobsJob()**](JobApi.md#deleteCompletedJobsJob) | **DELETE** /jobs/completed | Delete Completed Jobs | +| [**getJobErrorsByJobIdJob()**](JobApi.md#getJobErrorsByJobIdJob) | **GET** /jobs/{jobId}/errors | Get Job Errors | +| [**getJobJob()**](JobApi.md#getJobJob) | **GET** /jobs/{jobId} | Get Job | +| [**getJobsListJob()**](JobApi.md#getJobsListJob) | **GET** /jobs | List Jobs | +| [**getReportJobResultJob()**](JobApi.md#getReportJobResultJob) | **GET** /jobs/{jobId}/document | Get Job file | + + +## `deleteCompletedJobsJob()` + +```php +deleteCompletedJobsJob() +``` + +Delete Completed Jobs + +Deletes the users completed Jobs. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JobApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->deleteCompletedJobsJob(); +} catch (Exception $e) { + echo 'Exception when calling JobApi->deleteCompletedJobsJob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getJobErrorsByJobIdJob()` + +```php +getJobErrorsByJobIdJob($jobId, $pageNum, $pageSize): \SynergiTech\Staffology\Model\ContractJobErrorResponse[] +``` + +Get Job Errors + +Returns a list of errors for a job. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JobApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$jobId = 'jobId_example'; // string | The job identifier. +$pageNum = 0; // int +$pageSize = 10; // int + +try { + $result = $apiInstance->getJobErrorsByJobIdJob($jobId, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JobApi->getJobErrorsByJobIdJob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **jobId** | **string**| The job identifier. | | +| **pageNum** | **int**| | [optional] [default to 0] | +| **pageSize** | **int**| | [optional] [default to 10] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobErrorResponse[]**](../Model/ContractJobErrorResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getJobJob()` + +```php +getJobJob($jobId): \SynergiTech\Staffology\Model\ContractJobResponse +``` + +Get Job + +Returns a job. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JobApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$jobId = 'jobId_example'; // string | The job identifier. + +try { + $result = $apiInstance->getJobJob($jobId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JobApi->getJobJob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **jobId** | **string**| The job identifier. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getJobsListJob()` + +```php +getJobsListJob($employerId, $jobType, $pageNum, $pageSize): \SynergiTech\Staffology\Model\ContractJobResponse[] +``` + +List Jobs + +Returns a list of Jobs for all Employers that belong to the User with pagination. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JobApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The employer identifier. +$jobType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\JobType(); // \SynergiTech\Staffology\Model\JobType | Type of the job. +$pageNum = 56; // int | The page number. +$pageSize = 56; // int | Size of the page. + +try { + $result = $apiInstance->getJobsListJob($employerId, $jobType, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JobApi->getJobsListJob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The employer identifier. | [optional] | +| **jobType** | [**\SynergiTech\Staffology\Model\JobType**](../Model/.md)| Type of the job. | [optional] | +| **pageNum** | **int**| The page number. | [optional] | +| **pageSize** | **int**| Size of the page. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse[]**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getReportJobResultJob()` + +```php +getReportJobResultJob($jobId): \SplFileObject +``` + +Get Job file + +Returns the file generated for a successfully completed Job of type Report as a string representing a filestream. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JobApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$jobId = 'jobId_example'; // string | The job identifier. + +try { + $result = $apiInstance->getReportJobResultJob($jobId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JobApi->getReportJobResultJob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **jobId** | **string**| The job identifier. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/JournalTemplateApi.md b/docs/Api/JournalTemplateApi.md new file mode 100644 index 0000000..8854259 --- /dev/null +++ b/docs/Api/JournalTemplateApi.md @@ -0,0 +1,202 @@ +# SynergiTech\Staffology\JournalTemplateApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createJournalTemplate()**](JournalTemplateApi.md#createJournalTemplate) | **POST** /employers/{employerId}/journaltemplate | Create Journal Template | +| [**getJournalTemplate()**](JournalTemplateApi.md#getJournalTemplate) | **GET** /employers/{employerId}/journaltemplate | Get Journal Template | +| [**updateJournalTemplate()**](JournalTemplateApi.md#updateJournalTemplate) | **PUT** /employers/{employerId}/journaltemplate/{id} | Update Journal Template | + + +## `createJournalTemplate()` + +```php +createJournalTemplate($employerId, $contractJournalTemplateRequest): \SynergiTech\Staffology\Model\JournalTemplate +``` + +Create Journal Template + +Create Journal Template for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Journal Template +$contractJournalTemplateRequest = new \SynergiTech\Staffology\Model\ContractJournalTemplateRequest(); // \SynergiTech\Staffology\Model\ContractJournalTemplateRequest + +try { + $result = $apiInstance->createJournalTemplate($employerId, $contractJournalTemplateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTemplateApi->createJournalTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Journal Template | | +| **contractJournalTemplateRequest** | [**\SynergiTech\Staffology\Model\ContractJournalTemplateRequest**](../Model/ContractJournalTemplateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\JournalTemplate**](../Model/JournalTemplate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getJournalTemplate()` + +```php +getJournalTemplate($employerId): \SynergiTech\Staffology\Model\ContractJournalTemplateResponse +``` + +Get Journal Template + +Get Journal Template for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get Journal Template + +try { + $result = $apiInstance->getJournalTemplate($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTemplateApi->getJournalTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get Journal Template | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTemplateResponse**](../Model/ContractJournalTemplateResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateJournalTemplate()` + +```php +updateJournalTemplate($employerId, $id, $contractJournalTemplateRequest): \SynergiTech\Staffology\Model\ContractJournalTemplateResponse +``` + +Update Journal Template + +Updates Specified Journal Template for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Journal Template +$id = 'id_example'; // string +$contractJournalTemplateRequest = new \SynergiTech\Staffology\Model\ContractJournalTemplateRequest(); // \SynergiTech\Staffology\Model\ContractJournalTemplateRequest + +try { + $result = $apiInstance->updateJournalTemplate($employerId, $id, $contractJournalTemplateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTemplateApi->updateJournalTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Journal Template | | +| **id** | **string**| | | +| **contractJournalTemplateRequest** | [**\SynergiTech\Staffology\Model\ContractJournalTemplateRequest**](../Model/ContractJournalTemplateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTemplateResponse**](../Model/ContractJournalTemplateResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/JournalTokenApi.md b/docs/Api/JournalTokenApi.md new file mode 100644 index 0000000..6fcc91e --- /dev/null +++ b/docs/Api/JournalTokenApi.md @@ -0,0 +1,729 @@ +# SynergiTech\Staffology\JournalTokenApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createCostCentreJournalOverridesJournalToken()**](JournalTokenApi.md#createCostCentreJournalOverridesJournalToken) | **POST** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | Create CostCentre Journal Overrides | +| [**createDepartmentJournalOverridesJournalToken()**](JournalTokenApi.md#createDepartmentJournalOverridesJournalToken) | **POST** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | Create Department Journal Overrides | +| [**createJournalToken()**](JournalTokenApi.md#createJournalToken) | **POST** /employers/{employerId}/journaltokens | Create Journal Token | +| [**deleteJournalToken()**](JournalTokenApi.md#deleteJournalToken) | **DELETE** /employers/{employerId}/journaltokens/{id} | Delete Journal Token | +| [**getCostCentreJournalOverridesListJournalToken()**](JournalTokenApi.md#getCostCentreJournalOverridesListJournalToken) | **GET** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | List CostCentre Journal Overrides | +| [**getDepartmentJournalOverridesListJournalToken()**](JournalTokenApi.md#getDepartmentJournalOverridesListJournalToken) | **GET** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | List Department Journal Overrides | +| [**getJournalToken()**](JournalTokenApi.md#getJournalToken) | **GET** /employers/{employerId}/journaltokens/{id} | Get Journal Token | +| [**indexJournalToken()**](JournalTokenApi.md#indexJournalToken) | **GET** /employers/{employerId}/journaltokens | List Journal Tokens | +| [**updateCostCentreJournalOverridesJournalToken()**](JournalTokenApi.md#updateCostCentreJournalOverridesJournalToken) | **PUT** /employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides | Update CostCentre Journal Overrides | +| [**updateDepartmentJournalOverridesJournalToken()**](JournalTokenApi.md#updateDepartmentJournalOverridesJournalToken) | **PUT** /employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides | Update Department Journal Overrides | +| [**updateJournalToken()**](JournalTokenApi.md#updateJournalToken) | **PUT** /employers/{employerId}/journaltokens/{id} | Update Journal Token | + + +## `createCostCentreJournalOverridesJournalToken()` + +```php +createCostCentreJournalOverridesJournalToken($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest): \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[] +``` + +Create CostCentre Journal Overrides + +Create Journal Overrides for an CostCentre. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Journal Overrides +$costCentreId = 'costCentreId_example'; // string | The Id of the CostCentre for which you want to create Journal Overrides +$contractCostCentreJournalOverridesRequest = array(new \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest()); // \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[] + +try { + $result = $apiInstance->createCostCentreJournalOverridesJournalToken($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->createCostCentreJournalOverridesJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Journal Overrides | | +| **costCentreId** | **string**| The Id of the CostCentre for which you want to create Journal Overrides | | +| **contractCostCentreJournalOverridesRequest** | [**\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]**](../Model/ContractCostCentreJournalOverridesRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]**](../Model/ContractCostCentreJournalOverridesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createDepartmentJournalOverridesJournalToken()` + +```php +createDepartmentJournalOverridesJournalToken($employerId, $departmentId, $contractDepartmentJournalOverridesRequest): \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[] +``` + +Create Department Journal Overrides + +Create Journal Overrides for an Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Journal Overrides +$departmentId = 'departmentId_example'; // string | The Id of the Department for which you want to create Journal Overrides +$contractDepartmentJournalOverridesRequest = array(new \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest()); // \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[] + +try { + $result = $apiInstance->createDepartmentJournalOverridesJournalToken($employerId, $departmentId, $contractDepartmentJournalOverridesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->createDepartmentJournalOverridesJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Journal Overrides | | +| **departmentId** | **string**| The Id of the Department for which you want to create Journal Overrides | | +| **contractDepartmentJournalOverridesRequest** | [**\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]**](../Model/ContractDepartmentJournalOverridesRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]**](../Model/ContractDepartmentJournalOverridesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createJournalToken()` + +```php +createJournalToken($employerId, $contractJournalTokenRequest): \SynergiTech\Staffology\Model\ContractJournalTokenResponse +``` + +Create Journal Token + +Create Journal Token for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Journal Token +$contractJournalTokenRequest = new \SynergiTech\Staffology\Model\ContractJournalTokenRequest(); // \SynergiTech\Staffology\Model\ContractJournalTokenRequest + +try { + $result = $apiInstance->createJournalToken($employerId, $contractJournalTokenRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->createJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Journal Token | | +| **contractJournalTokenRequest** | [**\SynergiTech\Staffology\Model\ContractJournalTokenRequest**](../Model/ContractJournalTokenRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTokenResponse**](../Model/ContractJournalTokenResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteJournalToken()` + +```php +deleteJournalToken($employerId, $id) +``` + +Delete Journal Token + +Deletes the specified Journal Token. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteJournalToken($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->deleteJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCostCentreJournalOverridesListJournalToken()` + +```php +getCostCentreJournalOverridesListJournalToken($employerId, $costCentreId): \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[] +``` + +List CostCentre Journal Overrides + +List Journal Overrides for an CostCentre. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of Journal Overrides +$costCentreId = 'costCentreId_example'; // string | The Id of the CostCentre for which you want list of Journal Overrides + +try { + $result = $apiInstance->getCostCentreJournalOverridesListJournalToken($employerId, $costCentreId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->getCostCentreJournalOverridesListJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of Journal Overrides | | +| **costCentreId** | **string**| The Id of the CostCentre for which you want list of Journal Overrides | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]**](../Model/ContractCostCentreJournalOverridesResponseItem.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDepartmentJournalOverridesListJournalToken()` + +```php +getDepartmentJournalOverridesListJournalToken($employerId, $departmentId): \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[] +``` + +List Department Journal Overrides + +List Journal Overrides for an Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of Journal Overrides +$departmentId = 'departmentId_example'; // string | The Id of the Department for which you want list of Journal Overrides + +try { + $result = $apiInstance->getDepartmentJournalOverridesListJournalToken($employerId, $departmentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->getDepartmentJournalOverridesListJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of Journal Overrides | | +| **departmentId** | **string**| The Id of the Department for which you want list of Journal Overrides | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]**](../Model/ContractDepartmentJournalOverridesResponseItem.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getJournalToken()` + +```php +getJournalToken($employerId, $id): \SynergiTech\Staffology\Model\ContractJournalTokenResponse +``` + +Get Journal Token + +Get Specified Journal Token for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get Journal Token +$id = 'id_example'; // string | The Id of the Journal Tokens for which you want to get Journal Token + +try { + $result = $apiInstance->getJournalToken($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->getJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get Journal Token | | +| **id** | **string**| The Id of the Journal Tokens for which you want to get Journal Token | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTokenResponse**](../Model/ContractJournalTokenResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexJournalToken()` + +```php +indexJournalToken($employerId): \SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[] +``` + +List Journal Tokens + +List Journal Tokens for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of Journal Tokens + +try { + $result = $apiInstance->indexJournalToken($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->indexJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of Journal Tokens | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]**](../Model/ContractJournalTokenResponseItem.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCostCentreJournalOverridesJournalToken()` + +```php +updateCostCentreJournalOverridesJournalToken($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest): \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[] +``` + +Update CostCentre Journal Overrides + +Updates Journal Overrides for the CostCentre. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Journal Overrides +$costCentreId = 'costCentreId_example'; // string | The Id of the CostCentre for which you want to update Journal Overrides +$contractCostCentreJournalOverridesUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest()); // \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[] + +try { + $result = $apiInstance->updateCostCentreJournalOverridesJournalToken($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->updateCostCentreJournalOverridesJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Journal Overrides | | +| **costCentreId** | **string**| The Id of the CostCentre for which you want to update Journal Overrides | | +| **contractCostCentreJournalOverridesUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]**](../Model/ContractCostCentreJournalOverridesUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]**](../Model/ContractCostCentreJournalOverridesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDepartmentJournalOverridesJournalToken()` + +```php +updateDepartmentJournalOverridesJournalToken($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest): \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[] +``` + +Update Department Journal Overrides + +Updates Journal Overrides for the Department. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Journal Overrides +$departmentId = 'departmentId_example'; // string | The Id of the Department for which you want to update Journal Overrides +$contractDepartmentJournalOverridesUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest()); // \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[] + +try { + $result = $apiInstance->updateDepartmentJournalOverridesJournalToken($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->updateDepartmentJournalOverridesJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Journal Overrides | | +| **departmentId** | **string**| The Id of the Department for which you want to update Journal Overrides | | +| **contractDepartmentJournalOverridesUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]**](../Model/ContractDepartmentJournalOverridesUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]**](../Model/ContractDepartmentJournalOverridesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateJournalToken()` + +```php +updateJournalToken($employerId, $id, $contractJournalTokenRequest): \SynergiTech\Staffology\Model\ContractJournalTokenResponse +``` + +Update Journal Token + +Updates Specified Journal Token for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\JournalTokenApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$contractJournalTokenRequest = new \SynergiTech\Staffology\Model\ContractJournalTokenRequest(); // \SynergiTech\Staffology\Model\ContractJournalTokenRequest + +try { + $result = $apiInstance->updateJournalToken($employerId, $id, $contractJournalTokenRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling JournalTokenApi->updateJournalToken: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **contractJournalTokenRequest** | [**\SynergiTech\Staffology\Model\ContractJournalTokenRequest**](../Model/ContractJournalTokenRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJournalTokenResponse**](../Model/ContractJournalTokenResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/LeaveApi.md b/docs/Api/LeaveApi.md new file mode 100644 index 0000000..4752a6d --- /dev/null +++ b/docs/Api/LeaveApi.md @@ -0,0 +1,764 @@ +# SynergiTech\Staffology\LeaveApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addDocumentLeave()**](LeaveApi.md#addDocumentLeave) | **POST** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents | Add Document | +| [**createLeave()**](LeaveApi.md#createLeave) | **POST** /employers/{employerId}/employees/{employeeId}/leave | Create Leave | +| [**deleteDocumentLeave()**](LeaveApi.md#deleteDocumentLeave) | **DELETE** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId} | Delete Leave Document | +| [**deleteLeave()**](LeaveApi.md#deleteLeave) | **DELETE** /employers/{employerId}/employees/{employeeId}/leave/{id} | Delete Leave | +| [**findLinkedPiwLeave()**](LeaveApi.md#findLinkedPiwLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/findlinkedpiw | Find Linked Piw | +| [**getDocumentLeave()**](LeaveApi.md#getDocumentLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId} | Get Leave Document | +| [**getLeave()**](LeaveApi.md#getLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/{id} | Get Leave | +| [**getMaternityLeaveScheduleLeave()**](LeaveApi.md#getMaternityLeaveScheduleLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/statutorymaternityschedule | List Statutory Maternity Leave History | +| [**getOccupationalMaternityScheduleLeave()**](LeaveApi.md#getOccupationalMaternityScheduleLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave/occupationalmaternityschedule/{id} | List occupational Maternity Leave History | +| [**indexLeave()**](LeaveApi.md#indexLeave) | **GET** /employers/{employerId}/employees/{employeeId}/leave | List Leave | +| [**updateLeave()**](LeaveApi.md#updateLeave) | **PUT** /employers/{employerId}/employees/{employeeId}/leave/{id} | Update Leave | + + +## `addDocumentLeave()` + +```php +addDocumentLeave($employerId, $employeeId, $id, $file) +``` + +Add Document + +Adds document to the leave + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the leave you want to attach documents to +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $apiInstance->addDocumentLeave($employerId, $employeeId, $id, $file); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->addDocumentLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the leave you want to attach documents to | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createLeave()` + +```php +createLeave($employerId, $employeeId, $leave) +``` + +Create Leave + +Creates Leave for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$leave = new \SynergiTech\Staffology\Model\Leave(); // \SynergiTech\Staffology\Model\Leave + +try { + $apiInstance->createLeave($employerId, $employeeId, $leave); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->createLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **leave** | [**\SynergiTech\Staffology\Model\Leave**](../Model/Leave.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocumentLeave()` + +```php +deleteDocumentLeave($employerId, $employeeId, $id, $documentId) +``` + +Delete Leave Document + +Deletes the document specified by the documentId for the Leave specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to delete. + +try { + $apiInstance->deleteDocumentLeave($employerId, $employeeId, $id, $documentId); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->deleteDocumentLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteLeave()` + +```php +deleteLeave($employerId, $employeeId, $id) +``` + +Delete Leave + +Deletes the Leave specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Leave you want to delete. + +try { + $apiInstance->deleteLeave($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->deleteLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Leave you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `findLinkedPiwLeave()` + +```php +findLinkedPiwLeave($employerId, $employeeId, $leaveType, $leavePayType, $from, $to): \SynergiTech\Staffology\Model\LinkedPiw +``` + +Find Linked Piw + +Finds the linked piw the supplied leave would linked to, or null if none found + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$leaveType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeaveType(); // \SynergiTech\Staffology\Model\LeaveType | The type of leave to you want to find a linked Piw for. +$leavePayType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeavePayType(); // \SynergiTech\Staffology\Model\LeavePayType | The type of leave pay to you want to find a linked Piw for. +$from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The leave from date you want to find a linked Piw for. +$to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The leave to date you want to find a linked Piw for. + +try { + $result = $apiInstance->findLinkedPiwLeave($employerId, $employeeId, $leaveType, $leavePayType, $from, $to); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->findLinkedPiwLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **leaveType** | [**\SynergiTech\Staffology\Model\LeaveType**](../Model/.md)| The type of leave to you want to find a linked Piw for. | [optional] | +| **leavePayType** | [**\SynergiTech\Staffology\Model\LeavePayType**](../Model/.md)| The type of leave pay to you want to find a linked Piw for. | [optional] | +| **from** | **\DateTime**| The leave from date you want to find a linked Piw for. | [optional] | +| **to** | **\DateTime**| The leave to date you want to find a linked Piw for. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\LinkedPiw**](../Model/LinkedPiw.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentLeave()` + +```php +getDocumentLeave($employerId, $employeeId, $id, $documentId): \SplFileObject +``` + +Get Leave Document + +Gets the document specified by the documentId for the Leave specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to retrieve. + +try { + $result = $apiInstance->getDocumentLeave($employerId, $employeeId, $id, $documentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->getDocumentLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to retrieve. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLeave()` + +```php +getLeave($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Leave +``` + +Get Leave + +Gets the Leave specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Leave you want to retrieve. + +try { + $result = $apiInstance->getLeave($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->getLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Leave you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Leave**](../Model/Leave.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMaternityLeaveScheduleLeave()` + +```php +getMaternityLeaveScheduleLeave($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed): \SynergiTech\Staffology\Model\Item[] +``` + +List Statutory Maternity Leave History + +Lists all Statutory Maternity leave history specified for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$babyDueDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$leaveFrom = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$leaveTo = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$leaveType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeaveType(); // \SynergiTech\Staffology\Model\LeaveType +$leavePayType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\LeavePayType(); // \SynergiTech\Staffology\Model\LeavePayType +$payFrequency = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\StatPayFrequency(); // \SynergiTech\Staffology\Model\StatPayFrequency +$averageWeeklyEarnings = 0; // float +$isReversed = false; // bool + +try { + $result = $apiInstance->getMaternityLeaveScheduleLeave($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->getMaternityLeaveScheduleLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **babyDueDate** | **\DateTime**| | [optional] | +| **leaveFrom** | **\DateTime**| | [optional] | +| **leaveTo** | **\DateTime**| | [optional] | +| **leaveType** | [**\SynergiTech\Staffology\Model\LeaveType**](../Model/.md)| | [optional] | +| **leavePayType** | [**\SynergiTech\Staffology\Model\LeavePayType**](../Model/.md)| | [optional] | +| **payFrequency** | [**\SynergiTech\Staffology\Model\StatPayFrequency**](../Model/.md)| | [optional] | +| **averageWeeklyEarnings** | **float**| | [optional] [default to 0] | +| **isReversed** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOccupationalMaternityScheduleLeave()` + +```php +getOccupationalMaternityScheduleLeave($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Item[] +``` + +List occupational Maternity Leave History + +Lists all occupational Maternity leave history specified for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string + +try { + $result = $apiInstance->getOccupationalMaternityScheduleLeave($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->getOccupationalMaternityScheduleLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexLeave()` + +```php +indexLeave($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Leave + +Lists all Leave for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexLeave($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->indexLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLeave()` + +```php +updateLeave($employerId, $employeeId, $id, $leave): \SynergiTech\Staffology\Model\Leave +``` + +Update Leave + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LeaveApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Leave you want to update. +$leave = new \SynergiTech\Staffology\Model\Leave(); // \SynergiTech\Staffology\Model\Leave + +try { + $result = $apiInstance->updateLeave($employerId, $employeeId, $id, $leave); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeaveApi->updateLeave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Leave you want to update. | | +| **leave** | [**\SynergiTech\Staffology\Model\Leave**](../Model/Leave.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Leave**](../Model/Leave.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/LoanApi.md b/docs/Api/LoanApi.md new file mode 100644 index 0000000..d83e0ab --- /dev/null +++ b/docs/Api/LoanApi.md @@ -0,0 +1,543 @@ +# SynergiTech\Staffology\LoanApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addDocumentLoan()**](LoanApi.md#addDocumentLoan) | **POST** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents | Add Document | +| [**createLoan()**](LoanApi.md#createLoan) | **POST** /employers/{employerId}/employees/{employeeId}/loans | Create Loan | +| [**deleteDocumentLoan()**](LoanApi.md#deleteDocumentLoan) | **DELETE** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId} | Delete Loan Document | +| [**deleteLoan()**](LoanApi.md#deleteLoan) | **DELETE** /employers/{employerId}/employees/{employeeId}/loans/{id} | Delete Loan | +| [**getDocumentLoan()**](LoanApi.md#getDocumentLoan) | **GET** /employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId} | Get Loan Document | +| [**getLoan()**](LoanApi.md#getLoan) | **GET** /employers/{employerId}/employees/{employeeId}/loans/{id} | Get Loan | +| [**indexLoan()**](LoanApi.md#indexLoan) | **GET** /employers/{employerId}/employees/{employeeId}/loans | List Loans | +| [**updateLoan()**](LoanApi.md#updateLoan) | **PUT** /employers/{employerId}/employees/{employeeId}/loans/{id} | Update Loan | + + +## `addDocumentLoan()` + +```php +addDocumentLoan($employerId, $employeeId, $id, $file) +``` + +Add Document + +Adds document to the Loan + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Loan you want to attach documents to +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $apiInstance->addDocumentLoan($employerId, $employeeId, $id, $file); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->addDocumentLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Loan you want to attach documents to | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createLoan()` + +```php +createLoan($employerId, $employeeId, $loan) +``` + +Create Loan + +Creates a Loan for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$loan = new \SynergiTech\Staffology\Model\Loan(); // \SynergiTech\Staffology\Model\Loan + +try { + $apiInstance->createLoan($employerId, $employeeId, $loan); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->createLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **loan** | [**\SynergiTech\Staffology\Model\Loan**](../Model/Loan.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocumentLoan()` + +```php +deleteDocumentLoan($employerId, $employeeId, $id, $documentId) +``` + +Delete Loan Document + +Deletes the document specified by the documentId for the Loan specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to delete. + +try { + $apiInstance->deleteDocumentLoan($employerId, $employeeId, $id, $documentId); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->deleteDocumentLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteLoan()` + +```php +deleteLoan($employerId, $employeeId, $id) +``` + +Delete Loan + +Deletes the Loan specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Loan you want to delete. + +try { + $apiInstance->deleteLoan($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->deleteLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Loan you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentLoan()` + +```php +getDocumentLoan($employerId, $employeeId, $id, $documentId): \SplFileObject +``` + +Get Loan Document + +Gets the document specified by the documentId for the Loan specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to retrieve. + +try { + $result = $apiInstance->getDocumentLoan($employerId, $employeeId, $id, $documentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->getDocumentLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to retrieve. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLoan()` + +```php +getLoan($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Loan +``` + +Get Loan + +Gets the Loan specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Loan you want to retrieve. + +try { + $result = $apiInstance->getLoan($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->getLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Loan you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Loan**](../Model/Loan.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexLoan()` + +```php +indexLoan($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Loans + +Lists all AttachmentOrders for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexLoan($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->indexLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLoan()` + +```php +updateLoan($employerId, $employeeId, $id, $loan): \SynergiTech\Staffology\Model\Loan +``` + +Update Loan + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\LoanApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Loan you want to update. +$loan = new \SynergiTech\Staffology\Model\Loan(); // \SynergiTech\Staffology\Model\Loan + +try { + $result = $apiInstance->updateLoan($employerId, $employeeId, $id, $loan); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LoanApi->updateLoan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Loan you want to update. | | +| **loan** | [**\SynergiTech\Staffology\Model\Loan**](../Model/Loan.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Loan**](../Model/Loan.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/NoteApi.md b/docs/Api/NoteApi.md new file mode 100644 index 0000000..11f680a --- /dev/null +++ b/docs/Api/NoteApi.md @@ -0,0 +1,543 @@ +# SynergiTech\Staffology\NoteApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addDocumentNote()**](NoteApi.md#addDocumentNote) | **POST** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents | Add Document | +| [**createNote()**](NoteApi.md#createNote) | **POST** /employers/{employerId}/employees/{employeeId}/notes | Create Note | +| [**deleteDocumentNote()**](NoteApi.md#deleteDocumentNote) | **DELETE** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId} | Delete Note Document | +| [**deleteNote()**](NoteApi.md#deleteNote) | **DELETE** /employers/{employerId}/employees/{employeeId}/notes/{id} | Delete Note | +| [**getDocumentNote()**](NoteApi.md#getDocumentNote) | **GET** /employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId} | Get Note Document | +| [**getNote()**](NoteApi.md#getNote) | **GET** /employers/{employerId}/employees/{employeeId}/notes/{id} | Get Note | +| [**indexNote()**](NoteApi.md#indexNote) | **GET** /employers/{employerId}/employees/{employeeId}/notes | List Notes | +| [**updateNote()**](NoteApi.md#updateNote) | **PUT** /employers/{employerId}/employees/{employeeId}/notes/{id} | Update Note | + + +## `addDocumentNote()` + +```php +addDocumentNote($employerId, $employeeId, $id, $file) +``` + +Add Document + +Adds document to the Note + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Note you want to attach documents to +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $apiInstance->addDocumentNote($employerId, $employeeId, $id, $file); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->addDocumentNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Note you want to attach documents to | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createNote()` + +```php +createNote($employerId, $employeeId, $note) +``` + +Create Note + +Creates a Note for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$note = new \SynergiTech\Staffology\Model\Note(); // \SynergiTech\Staffology\Model\Note + +try { + $apiInstance->createNote($employerId, $employeeId, $note); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->createNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **note** | [**\SynergiTech\Staffology\Model\Note**](../Model/Note.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocumentNote()` + +```php +deleteDocumentNote($employerId, $employeeId, $id, $documentId) +``` + +Delete Note Document + +Deletes the document specified by the documentId for the Note specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to delete. + +try { + $apiInstance->deleteDocumentNote($employerId, $employeeId, $id, $documentId); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->deleteDocumentNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteNote()` + +```php +deleteNote($employerId, $employeeId, $id) +``` + +Delete Note + +Deletes the Note specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Note you want to delete. + +try { + $apiInstance->deleteNote($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->deleteNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Note you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentNote()` + +```php +getDocumentNote($employerId, $employeeId, $id, $documentId): \SplFileObject +``` + +Get Note Document + +Gets the document specified by the documentId for the Note specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to retrieve. + +try { + $result = $apiInstance->getDocumentNote($employerId, $employeeId, $id, $documentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->getDocumentNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to retrieve. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNote()` + +```php +getNote($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Note +``` + +Get Note + +Gets the Note specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Note you want to retrieve. + +try { + $result = $apiInstance->getNote($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->getNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Note you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Note**](../Model/Note.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexNote()` + +```php +indexNote($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Notes + +Lists all Note for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexNote($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->indexNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNote()` + +```php +updateNote($employerId, $employeeId, $id, $note): \SynergiTech\Staffology\Model\Note +``` + +Update Note + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Note you want to update. +$note = new \SynergiTech\Staffology\Model\Note(); // \SynergiTech\Staffology\Model\Note + +try { + $result = $apiInstance->updateNote($employerId, $employeeId, $id, $note); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NoteApi->updateNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Note you want to update. | | +| **note** | [**\SynergiTech\Staffology\Model\Note**](../Model/Note.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Note**](../Model/Note.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/NvrApi.md b/docs/Api/NvrApi.md new file mode 100644 index 0000000..bbe8b25 --- /dev/null +++ b/docs/Api/NvrApi.md @@ -0,0 +1,607 @@ +# SynergiTech\Staffology\NvrApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createNvr()**](NvrApi.md#createNvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear} | Create NVR | +| [**deleteNvr()**](NvrApi.md#deleteNvr) | **DELETE** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Delete NVR | +| [**getNvr()**](NvrApi.md#getNvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Get NVR | +| [**getXmlRequestNvr()**](NvrApi.md#getXmlRequestNvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear}/{id}/xml/request | Get XML Request | +| [**listNvr()**](NvrApi.md#listNvr) | **GET** /employers/{employerId}/rti/nvr/{taxYear} | List NVR | +| [**markAsAcceptedNvr()**](NvrApi.md#markAsAcceptedNvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear}/{id}/markasaccepted | Mark as Sent | +| [**requiringAttentionNvr()**](NvrApi.md#requiringAttentionNvr) | **GET** /employers/{employerId}/rti/nvr/requiringattention | NVR Requiring Attention | +| [**submitNvr()**](NvrApi.md#submitNvr) | **POST** /employers/{employerId}/rti/nvr/{taxYear}/{id}/submit | Submit an existing NVR | +| [**updateNvr()**](NvrApi.md#updateNvr) | **PUT** /employers/{employerId}/rti/nvr/{taxYear}/{id} | Update NVR | + + +## `createNvr()` + +```php +createNvr($employerId, $taxYear, $nvr): \SynergiTech\Staffology\Model\Nvr +``` + +Create NVR + +Creates a new NiNo Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$nvr = new \SynergiTech\Staffology\Model\Nvr(); // \SynergiTech\Staffology\Model\Nvr + +try { + $result = $apiInstance->createNvr($employerId, $taxYear, $nvr); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->createNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **nvr** | [**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteNvr()` + +```php +deleteNvr($employerId, $taxYear, $id) +``` + +Delete NVR + +Deletes the NVR. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $apiInstance->deleteNvr($employerId, $taxYear, $id); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->deleteNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNvr()` + +```php +getNvr($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Nvr +``` + +Get NVR + +Retrieves the NiNo Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getNvr($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->getNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getXmlRequestNvr()` + +```php +getXmlRequestNvr($employerId, $taxYear, $id): string +``` + +Get XML Request + +Returns the XML request that was or will be sent to HMRC for this RTI document. Although the value is XML, it is returned as a JSON string. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->getXmlRequestNvr($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->getXmlRequestNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listNvr()` + +```php +listNvr($employerId, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List NVR + +Returns all NiNo Verification Requests for the given tax year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->listNvr($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->listNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsAcceptedNvr()` + +```php +markAsAcceptedNvr($employerId, $taxYear, $id): \SynergiTech\Staffology\Model\Nvr +``` + +Mark as Sent + +Marks a NiNo Verification Request as having been sent to HMRC and accepted by them You only use this method if the NVR has been submitted via an external system. It will automatically be updated as Sent and/or Accepted if it's submitted via this API. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string + +try { + $result = $apiInstance->markAsAcceptedNvr($employerId, $taxYear, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->markAsAcceptedNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `requiringAttentionNvr()` + +```php +requiringAttentionNvr($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +NVR Requiring Attention + +Returns all NiNo Verification Requests that have a Submission Status of NotSubmitted or ErrorResponse + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string + +try { + $result = $apiInstance->requiringAttentionNvr($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->requiringAttentionNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `submitNvr()` + +```php +submitNvr($employerId, $taxYear, $id, $force): \SynergiTech\Staffology\Model\Nvr +``` + +Submit an existing NVR + +Submits an existing NiNo Verification Request to HMRC. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$force = false; // bool + +try { + $result = $apiInstance->submitNvr($employerId, $taxYear, $id, $force); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->submitNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **force** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNvr()` + +```php +updateNvr($employerId, $taxYear, $id, $nvr): \SynergiTech\Staffology\Model\Nvr +``` + +Update NVR + +Updates an existing NiNo Verification Request. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\NvrApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$nvr = new \SynergiTech\Staffology\Model\Nvr(); // \SynergiTech\Staffology\Model\Nvr + +try { + $result = $apiInstance->updateNvr($employerId, $taxYear, $id, $nvr); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NvrApi->updateNvr: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **nvr** | [**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Nvr**](../Model/Nvr.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OccupationalPolicyApi.md b/docs/Api/OccupationalPolicyApi.md new file mode 100644 index 0000000..bf4cd0e --- /dev/null +++ b/docs/Api/OccupationalPolicyApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\OccupationalPolicyApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createOccupationalPolicy()**](OccupationalPolicyApi.md#createOccupationalPolicy) | **POST** /employers/{employerId}/occupationalpolicies | Create Occupational Policy | +| [**deleteOccupationalPolicy()**](OccupationalPolicyApi.md#deleteOccupationalPolicy) | **DELETE** /employers/{employerId}/occupationalpolicies/{id} | Delete Occupational Policy | +| [**getOccupationalPolicy()**](OccupationalPolicyApi.md#getOccupationalPolicy) | **GET** /employers/{employerId}/occupationalpolicies/{id} | Get Occupational Policy | +| [**indexOccupationalPolicy()**](OccupationalPolicyApi.md#indexOccupationalPolicy) | **GET** /employers/{employerId}/occupationalpolicies | List Occupational Policies | +| [**updateOccupationalPolicy()**](OccupationalPolicyApi.md#updateOccupationalPolicy) | **PUT** /employers/{employerId}/occupationalpolicies/{id} | Update Occupational Policy | + + +## `createOccupationalPolicy()` + +```php +createOccupationalPolicy($employerId, $occupationalPolicy): \SynergiTech\Staffology\Model\OccupationalPolicy +``` + +Create Occupational Policy + +Creates a new Occupational Policy for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalPolicyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$occupationalPolicy = new \SynergiTech\Staffology\Model\OccupationalPolicy(); // \SynergiTech\Staffology\Model\OccupationalPolicy + +try { + $result = $apiInstance->createOccupationalPolicy($employerId, $occupationalPolicy); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalPolicyApi->createOccupationalPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **occupationalPolicy** | [**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOccupationalPolicy()` + +```php +deleteOccupationalPolicy($employerId, $id) +``` + +Delete Occupational Policy + +Deletes the specified Occupational Policy. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalPolicyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Occupational Policy belongs. +$id = 'id_example'; // string | The Id of the Occupational Policy which you want to fetch + +try { + $apiInstance->deleteOccupationalPolicy($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling OccupationalPolicyApi->deleteOccupationalPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Occupational Policy belongs. | | +| **id** | **string**| The Id of the Occupational Policy which you want to fetch | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOccupationalPolicy()` + +```php +getOccupationalPolicy($employerId, $id): \SynergiTech\Staffology\Model\OccupationalPolicy +``` + +Get Occupational Policy + +Gets the Occupational Policy specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalPolicyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Occupational Policy belongs. +$id = 'id_example'; // string | The Id of the Occupational Policy which you want to fetch + +try { + $result = $apiInstance->getOccupationalPolicy($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalPolicyApi->getOccupationalPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Occupational Policy belongs. | | +| **id** | **string**| The Id of the Occupational Policy which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexOccupationalPolicy()` + +```php +indexOccupationalPolicy($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Occupational Policies + +Lists all Occupational Policies for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalPolicyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. + +try { + $result = $apiInstance->indexOccupationalPolicy($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalPolicyApi->indexOccupationalPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOccupationalPolicy()` + +```php +updateOccupationalPolicy($employerId, $id, $occupationalPolicy): \SynergiTech\Staffology\Model\OccupationalPolicy +``` + +Update Occupational Policy + +Updates a Occupational Policy for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalPolicyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Occupational Policy belongs. +$id = 'id_example'; // string | The Id of the Occupational Policy which you want to fetch +$occupationalPolicy = new \SynergiTech\Staffology\Model\OccupationalPolicy(); // \SynergiTech\Staffology\Model\OccupationalPolicy + +try { + $result = $apiInstance->updateOccupationalPolicy($employerId, $id, $occupationalPolicy); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalPolicyApi->updateOccupationalPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Occupational Policy belongs. | | +| **id** | **string**| The Id of the Occupational Policy which you want to fetch | | +| **occupationalPolicy** | [**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OccupationalSickLeaveHistoryApi.md b/docs/Api/OccupationalSickLeaveHistoryApi.md new file mode 100644 index 0000000..1bf6760 --- /dev/null +++ b/docs/Api/OccupationalSickLeaveHistoryApi.md @@ -0,0 +1,471 @@ +# SynergiTech\Staffology\OccupationalSickLeaveHistoryApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#createOccupationalSickLeaveHistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId} | Create OccupationalSickLeaveHistory | +| [**deleteOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#deleteOccupationalSickLeaveHistory) | **DELETE** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Delete OccupationalSickLeaveHistory | +| [**getOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#getOccupationalSickLeaveHistory) | **GET** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Get OccupationalSickLeaveHistory | +| [**importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/importfile | Import OccupationalSickLeaveHistory from csv file | +| [**occupationalSickLeaveHistoryOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#occupationalSickLeaveHistoryOccupationalSickLeaveHistory) | **GET** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId} | List OccupationalSickLeaveHistory | +| [**updateOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#updateOccupationalSickLeaveHistory) | **PUT** /employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id} | Update OccupationalSickLeaveHistory | +| [**uploadOSPHistoryOccupationalSickLeaveHistory()**](OccupationalSickLeaveHistoryApi.md#uploadOSPHistoryOccupationalSickLeaveHistory) | **POST** /employers/{employerId}/occupationalsickleavehistory/import | Upload OccupationalSickLeaveHistory | + + +## `createOccupationalSickLeaveHistory()` + +```php +createOccupationalSickLeaveHistory($employerId, $employeeId, $occupationalSickLeaveHistory): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory +``` + +Create OccupationalSickLeaveHistory + +Creates Occupational sick leave history for the Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$employeeId = 'employeeId_example'; // string | The Id of the Employee to which the Occupational sick leave history belongs +$occupationalSickLeaveHistory = new \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory(); // \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + +try { + $result = $apiInstance->createOccupationalSickLeaveHistory($employerId, $employeeId, $occupationalSickLeaveHistory); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->createOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **employeeId** | **string**| The Id of the Employee to which the Occupational sick leave history belongs | | +| **occupationalSickLeaveHistory** | [**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory**](../Model/OccupationalSickLeaveHistory.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory**](../Model/OccupationalSickLeaveHistory.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOccupationalSickLeaveHistory()` + +```php +deleteOccupationalSickLeaveHistory($employerId, $employeeId, $id) +``` + +Delete OccupationalSickLeaveHistory + +Deletes the specified Occupational leave history record. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Occupational sick leave which you want to fetch + +try { + $apiInstance->deleteOccupationalSickLeaveHistory($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->deleteOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Occupational sick leave which you want to fetch | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOccupationalSickLeaveHistory()` + +```php +getOccupationalSickLeaveHistory($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory +``` + +Get OccupationalSickLeaveHistory + +Gets a occupational sick leave for the employee and employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Occupational leave history which you want to fetch + +try { + $result = $apiInstance->getOccupationalSickLeaveHistory($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->getOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Occupational leave history which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory**](../Model/OccupationalSickLeaveHistory.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory()` + +```php +importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory($employerId, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import OccupationalSickLeaveHistory from csv file + +Import Occupational Sick Leave History from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory($employerId, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `occupationalSickLeaveHistoryOccupationalSickLeaveHistory()` + +```php +occupationalSickLeaveHistoryOccupationalSickLeaveHistory($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List OccupationalSickLeaveHistory + +Lists all OccupationalSickLeaveHistory for the Employee specified + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->occupationalSickLeaveHistoryOccupationalSickLeaveHistory($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->occupationalSickLeaveHistoryOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOccupationalSickLeaveHistory()` + +```php +updateOccupationalSickLeaveHistory($employerId, $employeeId, $id, $occupationalSickLeaveHistory): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory +``` + +Update OccupationalSickLeaveHistory + +Updates a occupational sick leave for the employee and employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Occupational leave history which you want to fetch +$occupationalSickLeaveHistory = new \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory(); // \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + +try { + $result = $apiInstance->updateOccupationalSickLeaveHistory($employerId, $employeeId, $id, $occupationalSickLeaveHistory); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->updateOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Occupational leave history which you want to fetch | | +| **occupationalSickLeaveHistory** | [**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory**](../Model/OccupationalSickLeaveHistory.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory**](../Model/OccupationalSickLeaveHistory.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `uploadOSPHistoryOccupationalSickLeaveHistory()` + +```php +uploadOSPHistoryOccupationalSickLeaveHistory($employerId, $occupationalSickLeaveHistory): \SynergiTech\Staffology\Model\Item[] +``` + +Upload OccupationalSickLeaveHistory + +Uploads new Occupational sick leave history for the Employer against specific occupational policy. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OccupationalSickLeaveHistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the occupational sick leave history is to be uploaded. +$occupationalSickLeaveHistory = array(new \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory()); // \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[] + +try { + $result = $apiInstance->uploadOSPHistoryOccupationalSickLeaveHistory($employerId, $occupationalSickLeaveHistory); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OccupationalSickLeaveHistoryApi->uploadOSPHistoryOccupationalSickLeaveHistory: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the occupational sick leave history is to be uploaded. | | +| **occupationalSickLeaveHistory** | [**\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]**](../Model/OccupationalSickLeaveHistory.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OpeningBalancesApi.md b/docs/Api/OpeningBalancesApi.md new file mode 100644 index 0000000..d527279 --- /dev/null +++ b/docs/Api/OpeningBalancesApi.md @@ -0,0 +1,752 @@ +# SynergiTech\Staffology\OpeningBalancesApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createNicSummaryOpeningBalances()**](OpeningBalancesApi.md#createNicSummaryOpeningBalances) | **POST** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Create NicSummary | +| [**deleteNicSummaryOpeningBalances()**](OpeningBalancesApi.md#deleteNicSummaryOpeningBalances) | **DELETE** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Delete NicSummary | +| [**getNicSummariesOpeningBalances()**](OpeningBalancesApi.md#getNicSummariesOpeningBalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Get NicSummaries | +| [**getNicSummaryOpeningBalances()**](OpeningBalancesApi.md#getNicSummaryOpeningBalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Get NicSummary | +| [**getOpeningBalances()**](OpeningBalancesApi.md#getOpeningBalances) | **GET** /employers/{employerId}/employees/{employeeId}/openingBalances | Get Opening Balances | +| [**getOpeningBalancesTotalsOpeningBalances()**](OpeningBalancesApi.md#getOpeningBalancesTotalsOpeningBalances) | **GET** /employers/{employerId}/employees/openingbalances/{taxYear} | Totals of employee opening balances for a tax year | +| [**updateNicSummariesOpeningBalances()**](OpeningBalancesApi.md#updateNicSummariesOpeningBalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear} | Update NicSummaries | +| [**updateNicSummaryOpeningBalances()**](OpeningBalancesApi.md#updateNicSummaryOpeningBalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId} | Update NicSummary | +| [**updateOpeningBalances()**](OpeningBalancesApi.md#updateOpeningBalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances | Update Opening Balances | +| [**updateP45OpeningBalances()**](OpeningBalancesApi.md#updateP45OpeningBalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/p45 | Update P45 Value | +| [**updateTerminationPaymentsOpeningBalances()**](OpeningBalancesApi.md#updateTerminationPaymentsOpeningBalances) | **PUT** /employers/{employerId}/employees/{employeeId}/openingBalances/terminationpayments | Update Termination Pay | + + +## `createNicSummaryOpeningBalances()` + +```php +createNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $nicSummary) +``` + +Create NicSummary + +Creates a NicSummary for for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to create the Nic Summary +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummary applies to +$nicSummary = new \SynergiTech\Staffology\Model\NicSummary(); // \SynergiTech\Staffology\Model\NicSummary + +try { + $apiInstance->createNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $nicSummary); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->createNicSummaryOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to create the Nic Summary | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummary applies to | | +| **nicSummary** | [**\SynergiTech\Staffology\Model\NicSummary**](../Model/NicSummary.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteNicSummaryOpeningBalances()` + +```php +deleteNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId) +``` + +Delete NicSummary + +Delete a NicSummary for a Unique Id for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to delete the Nic Summary +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummary applies to +$uniqueId = 'uniqueId_example'; // string | The Id of the NicSummary + +try { + $apiInstance->deleteNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->deleteNicSummaryOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to delete the Nic Summary | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummary applies to | | +| **uniqueId** | **string**| The Id of the NicSummary | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNicSummariesOpeningBalances()` + +```php +getNicSummariesOpeningBalances($employerId, $employeeId, $taxYear, $openingBalancesOnly): \SynergiTech\Staffology\Model\NicSummary[] +``` + +Get NicSummaries + +Returns the NicSummaries for an Employee for a given TaxYear. If the TaxYear is the same as on their OpeningBalances then the NicSummaries will be the same as shown there. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve Opening Balances +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummaries apply to +$openingBalancesOnly = true; // bool | Limit the results to opening balance year to date + +try { + $result = $apiInstance->getNicSummariesOpeningBalances($employerId, $employeeId, $taxYear, $openingBalancesOnly); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->getNicSummariesOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve Opening Balances | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummaries apply to | | +| **openingBalancesOnly** | **bool**| Limit the results to opening balance year to date | [optional] [default to true] | + +### Return type + +[**\SynergiTech\Staffology\Model\NicSummary[]**](../Model/NicSummary.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNicSummaryOpeningBalances()` + +```php +getNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId): \SynergiTech\Staffology\Model\NicSummary +``` + +Get NicSummary + +Returns a NicSummary for a Unique Id for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve the Nic Summary +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummary applies to +$uniqueId = 'uniqueId_example'; // string | The Id of the NicSummary + +try { + $result = $apiInstance->getNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->getNicSummaryOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve the Nic Summary | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummary applies to | | +| **uniqueId** | **string**| The Id of the NicSummary | | + +### Return type + +[**\SynergiTech\Staffology\Model\NicSummary**](../Model/NicSummary.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOpeningBalances()` + +```php +getOpeningBalances($employerId, $employeeId): \SynergiTech\Staffology\Model\OpeningBalances +``` + +Get Opening Balances + +Returns the Opening Balances for an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve Opening Balances + +try { + $result = $apiInstance->getOpeningBalances($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->getOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve Opening Balances | | + +### Return type + +[**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOpeningBalancesTotalsOpeningBalances()` + +```php +getOpeningBalancesTotalsOpeningBalances($employerId, $taxYear): \SynergiTech\Staffology\Model\OpeningBalancesTotals +``` + +Totals of employee opening balances for a tax year + +Totals of Employee Opening Balances in the specified TaxYear + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to search. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear for which you want to Opening Balances totals. + +try { + $result = $apiInstance->getOpeningBalancesTotalsOpeningBalances($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->getOpeningBalancesTotalsOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to search. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear for which you want to Opening Balances totals. | | + +### Return type + +[**\SynergiTech\Staffology\Model\OpeningBalancesTotals**](../Model/OpeningBalancesTotals.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNicSummariesOpeningBalances()` + +```php +updateNicSummariesOpeningBalances($employerId, $employeeId, $taxYear, $nicSummary): \SynergiTech\Staffology\Model\NicSummary[] +``` + +Update NicSummaries + +Updates the NicSummaries for an Employee for a given TaxYear. If the TaxYear is the same as on their OpeningBalances then the NicSummaries there will also be updated. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve Opening Balances +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummaries apply to +$nicSummary = array(new \SynergiTech\Staffology\Model\NicSummary()); // \SynergiTech\Staffology\Model\NicSummary[] + +try { + $result = $apiInstance->updateNicSummariesOpeningBalances($employerId, $employeeId, $taxYear, $nicSummary); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->updateNicSummariesOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve Opening Balances | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummaries apply to | | +| **nicSummary** | [**\SynergiTech\Staffology\Model\NicSummary[]**](../Model/NicSummary.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NicSummary[]**](../Model/NicSummary.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNicSummaryOpeningBalances()` + +```php +updateNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary): \SynergiTech\Staffology\Model\NicSummary +``` + +Update NicSummary + +Update a NicSummary for a Unique Id for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update the Nic Summary +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the NicSummary applies to +$uniqueId = 'uniqueId_example'; // string | The Id of the NicSummary +$nicSummary = new \SynergiTech\Staffology\Model\NicSummary(); // \SynergiTech\Staffology\Model\NicSummary + +try { + $result = $apiInstance->updateNicSummaryOpeningBalances($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->updateNicSummaryOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update the Nic Summary | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the NicSummary applies to | | +| **uniqueId** | **string**| The Id of the NicSummary | | +| **nicSummary** | [**\SynergiTech\Staffology\Model\NicSummary**](../Model/NicSummary.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NicSummary**](../Model/NicSummary.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOpeningBalances()` + +```php +updateOpeningBalances($employerId, $employeeId, $openingBalances): \SynergiTech\Staffology\Model\OpeningBalances +``` + +Update Opening Balances + +Updates the Opening Balances for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update Opening Balances +$openingBalances = new \SynergiTech\Staffology\Model\OpeningBalances(); // \SynergiTech\Staffology\Model\OpeningBalances + +try { + $result = $apiInstance->updateOpeningBalances($employerId, $employeeId, $openingBalances); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->updateOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update Opening Balances | | +| **openingBalances** | [**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateP45OpeningBalances()` + +```php +updateP45OpeningBalances($employerId, $employeeId, $openingBalances): \SynergiTech\Staffology\Model\OpeningBalances +``` + +Update P45 Value + +Updates the P45 Values on the Opening Balances for an Employee. This would ideally be done when the Opening Balances are updated but if payruns have already been started for the employee then Opening Balances can't be updated - hence this API call just to update the P45 values. There must be a currently open PayRun for the employee. Only the PreviousEmployerGross and PreviousEmployerTax properties of the submitted OpeningBalances model are updated. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update P45 figures +$openingBalances = new \SynergiTech\Staffology\Model\OpeningBalances(); // \SynergiTech\Staffology\Model\OpeningBalances + +try { + $result = $apiInstance->updateP45OpeningBalances($employerId, $employeeId, $openingBalances); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->updateP45OpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update P45 figures | | +| **openingBalances** | [**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTerminationPaymentsOpeningBalances()` + +```php +updateTerminationPaymentsOpeningBalances($employerId, $employeeId, $openingBalances): \SynergiTech\Staffology\Model\OpeningBalances +``` + +Update Termination Pay + +Updates the Termination Pay value on the Opening Balances for an Employee. This would ideally be done when the Opening Balances are updated but if payruns have already been started for the employee then Opening Balances can't be updated - hence this API call just to update the Termination Pay value. Only the TerminationPayments property of the submitted OpeningBalances model is updated. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\OpeningBalancesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update Termination Payments +$openingBalances = new \SynergiTech\Staffology\Model\OpeningBalances(); // \SynergiTech\Staffology\Model\OpeningBalances + +try { + $result = $apiInstance->updateTerminationPaymentsOpeningBalances($employerId, $employeeId, $openingBalances); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpeningBalancesApi->updateTerminationPaymentsOpeningBalances: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update Termination Payments | | +| **openingBalances** | [**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OpeningBalances**](../Model/OpeningBalances.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/P11HistoryApi.md b/docs/Api/P11HistoryApi.md new file mode 100644 index 0000000..7b797ab --- /dev/null +++ b/docs/Api/P11HistoryApi.md @@ -0,0 +1,269 @@ +# SynergiTech\Staffology\P11HistoryApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createP11History()**](P11HistoryApi.md#createP11History) | **POST** /employers/{employerId}/employees/{employeeId}/p11history | Create P11 Historical data | +| [**deleteP11History()**](P11HistoryApi.md#deleteP11History) | **DELETE** /employers/{employerId}/employees/{employeeId}/p11history/{id} | Delete P11 Historical data | +| [**listPagedP11History()**](P11HistoryApi.md#listPagedP11History) | **GET** /employers/{employerId}/employees/{employeeId}/p11history | Retrieve P11 Historical data | +| [**updateP11History()**](P11HistoryApi.md#updateP11History) | **PUT** /employers/{employerId}/employees/{employeeId}/p11history/{id} | Update P11 Historical entry | + + +## `createP11History()` + +```php +createP11History($employerId, $employeeId, $contractP11HistoryRequest) +``` + +Create P11 Historical data + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\P11HistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee +$contractP11HistoryRequest = array(new \SynergiTech\Staffology\Model\ContractP11HistoryRequest()); // \SynergiTech\Staffology\Model\ContractP11HistoryRequest[] | + +try { + $apiInstance->createP11History($employerId, $employeeId, $contractP11HistoryRequest); +} catch (Exception $e) { + echo 'Exception when calling P11HistoryApi->createP11History: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | +| **contractP11HistoryRequest** | [**\SynergiTech\Staffology\Model\ContractP11HistoryRequest[]**](../Model/ContractP11HistoryRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteP11History()` + +```php +deleteP11History($id, $employerId, $employeeId) +``` + +Delete P11 Historical data + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\P11HistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee + +try { + $apiInstance->deleteP11History($id, $employerId, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling P11HistoryApi->deleteP11History: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listPagedP11History()` + +```php +listPagedP11History($employerId, $employeeId, $pageNum, $pageSize): \SynergiTech\Staffology\Model\ContractP11HistoryResponse[] +``` + +Retrieve P11 Historical data + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\P11HistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee +$pageNum = 56; // int | +$pageSize = 56; // int | + +try { + $result = $apiInstance->listPagedP11History($employerId, $employeeId, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling P11HistoryApi->listPagedP11History: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]**](../Model/ContractP11HistoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateP11History()` + +```php +updateP11History($employerId, $employeeId, $id, $contractP11HistoryRequest): \SynergiTech\Staffology\Model\ContractP11HistoryResponse +``` + +Update P11 Historical entry + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\P11HistoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee +$id = 'id_example'; // string | The unique id of the record +$contractP11HistoryRequest = new \SynergiTech\Staffology\Model\ContractP11HistoryRequest(); // \SynergiTech\Staffology\Model\ContractP11HistoryRequest | + +try { + $result = $apiInstance->updateP11History($employerId, $employeeId, $id, $contractP11HistoryRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling P11HistoryApi->updateP11History: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | +| **id** | **string**| The unique id of the record | | +| **contractP11HistoryRequest** | [**\SynergiTech\Staffology\Model\ContractP11HistoryRequest**](../Model/ContractP11HistoryRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractP11HistoryResponse**](../Model/ContractP11HistoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayCodeApi.md b/docs/Api/PayCodeApi.md new file mode 100644 index 0000000..18a8b2c --- /dev/null +++ b/docs/Api/PayCodeApi.md @@ -0,0 +1,657 @@ +# SynergiTech\Staffology\PayCodeApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPayCode()**](PayCodeApi.md#createPayCode) | **POST** /employers/{employerId}/paycodes | Create PayCode | +| [**deletePayCode()**](PayCodeApi.md#deletePayCode) | **DELETE** /employers/{employerId}/paycodes/{code} | Delete PayCode (deprecated) | +| [**deletePayCodePayCode()**](PayCodeApi.md#deletePayCodePayCode) | **DELETE** /employers/{employerId}/paycodes/paycode | Delete PayCode | +| [**getPayCode()**](PayCodeApi.md#getPayCode) | **GET** /employers/{employerId}/paycodes/{code} | Get PayCode (deprecated) | +| [**getPayCodePayCode()**](PayCodeApi.md#getPayCodePayCode) | **GET** /employers/{employerId}/paycodes/paycode | Get PayCode | +| [**indexPayCode()**](PayCodeApi.md#indexPayCode) | **GET** /employers/{employerId}/paycodes | List PayCodes | +| [**nominalCodeMappingsPayCode()**](PayCodeApi.md#nominalCodeMappingsPayCode) | **GET** /employers/{employerId}/paycodes/nominalcodes | Get Nominal Code Mappings | +| [**updateNominalCodeMappingsPayCode()**](PayCodeApi.md#updateNominalCodeMappingsPayCode) | **PUT** /employers/{employerId}/paycodes/nominalcodes | Updates Nominal Code Mappings | +| [**updatePayCode()**](PayCodeApi.md#updatePayCode) | **PUT** /employers/{employerId}/paycodes/{code} | Update PayCode (deprecated) | +| [**updatePayCodePayCode()**](PayCodeApi.md#updatePayCodePayCode) | **PUT** /employers/{employerId}/paycodes/paycode | Update PayCode | + + +## `createPayCode()` + +```php +createPayCode($employerId, $payCode): \SynergiTech\Staffology\Model\PayCode +``` + +Create PayCode + +Creates a new PayCode for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payCode = new \SynergiTech\Staffology\Model\PayCode(); // \SynergiTech\Staffology\Model\PayCode + +try { + $result = $apiInstance->createPayCode($employerId, $payCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->createPayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payCode** | [**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayCode()` + +```php +deletePayCode($employerId, $code) +``` + +Delete PayCode (deprecated) + +Deletes the specified PayCode. Use the other Delete endpoint that supports non-alphanumeric characters for a pay code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string + +try { + $apiInstance->deletePayCode($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->deletePayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayCodePayCode()` + +```php +deletePayCodePayCode($employerId, $code) +``` + +Delete PayCode + +Deletes the specified PayCode. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string + +try { + $apiInstance->deletePayCodePayCode($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->deletePayCodePayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayCode()` + +```php +getPayCode($employerId, $code): \SynergiTech\Staffology\Model\PayCode +``` + +Get PayCode (deprecated) + +Gets the PayCode specified. Use the other GET endpoint that supports non-alphanumeric characters for a pay code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Pay Code belongs. +$code = 'code_example'; // string | The code of the Pay Code you want to retrieve. + +try { + $result = $apiInstance->getPayCode($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->getPayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Pay Code belongs. | | +| **code** | **string**| The code of the Pay Code you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayCodePayCode()` + +```php +getPayCodePayCode($employerId, $code): \SynergiTech\Staffology\Model\PayCode +``` + +Get PayCode + +Gets the PayCode specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Pay Code belongs. +$code = 'code_example'; // string | The code of the Pay Code you want to retrieve. + +try { + $result = $apiInstance->getPayCodePayCode($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->getPayCodePayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Pay Code belongs. | | +| **code** | **string**| The code of the Pay Code you want to retrieve. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPayCode()` + +```php +indexPayCode($employerId, $verbose): \SynergiTech\Staffology\Model\PayCode[] +``` + +List PayCodes + +Lists all PayCodes for the Employer specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Pay Codes +$verbose = false; // bool | If provided and set to true then full details of all Pay Codes will be returned instead of just a summary + +try { + $result = $apiInstance->indexPayCode($employerId, $verbose); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->indexPayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Pay Codes | | +| **verbose** | **bool**| If provided and set to true then full details of all Pay Codes will be returned instead of just a summary | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode[]**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `nominalCodeMappingsPayCode()` + +```php +nominalCodeMappingsPayCode($employerId): \SynergiTech\Staffology\Model\NominalCodeMapping[] +``` + +Get Nominal Code Mappings + +Returns the list of mappings of PayCodes to NominalCodes + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the mapping + +try { + $result = $apiInstance->nominalCodeMappingsPayCode($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->nominalCodeMappingsPayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the mapping | | + +### Return type + +[**\SynergiTech\Staffology\Model\NominalCodeMapping[]**](../Model/NominalCodeMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNominalCodeMappingsPayCode()` + +```php +updateNominalCodeMappingsPayCode($employerId, $nominalCodeMapping): \SynergiTech\Staffology\Model\NominalCodeMapping[] +``` + +Updates Nominal Code Mappings + +Updates the list of mappings of PayCodes to NominalCodes + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$nominalCodeMapping = array(new \SynergiTech\Staffology\Model\NominalCodeMapping()); // \SynergiTech\Staffology\Model\NominalCodeMapping[] + +try { + $result = $apiInstance->updateNominalCodeMappingsPayCode($employerId, $nominalCodeMapping); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->updateNominalCodeMappingsPayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **nominalCodeMapping** | [**\SynergiTech\Staffology\Model\NominalCodeMapping[]**](../Model/NominalCodeMapping.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NominalCodeMapping[]**](../Model/NominalCodeMapping.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayCode()` + +```php +updatePayCode($employerId, $code, $payCode): \SynergiTech\Staffology\Model\PayCode +``` + +Update PayCode (deprecated) + +Updates the details of an existing PayCode. Use the other Update endpoint that supports non-alphanumeric characters for a pay code + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string +$payCode = new \SynergiTech\Staffology\Model\PayCode(); // \SynergiTech\Staffology\Model\PayCode + +try { + $result = $apiInstance->updatePayCode($employerId, $code, $payCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->updatePayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | | +| **payCode** | [**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayCodePayCode()` + +```php +updatePayCodePayCode($employerId, $code, $payCode): \SynergiTech\Staffology\Model\PayCode +``` + +Update PayCode + +Updates the details of an existing PayCode. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$code = 'code_example'; // string +$payCode = new \SynergiTech\Staffology\Model\PayCode(); // \SynergiTech\Staffology\Model\PayCode + +try { + $result = $apiInstance->updatePayCodePayCode($employerId, $code, $payCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeApi->updatePayCodePayCode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **code** | **string**| | [optional] | +| **payCode** | [**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayCodeSetApi.md b/docs/Api/PayCodeSetApi.md new file mode 100644 index 0000000..dc6ed7b --- /dev/null +++ b/docs/Api/PayCodeSetApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\PayCodeSetApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPayCodeSet()**](PayCodeSetApi.md#createPayCodeSet) | **POST** /employers/{employerId}/paycodesets | Create PayCodeSet | +| [**deletePayCodeSet()**](PayCodeSetApi.md#deletePayCodeSet) | **DELETE** /employers/{employerId}/paycodesets/{id} | Delete PayCodeSet | +| [**getPayCodeSet()**](PayCodeSetApi.md#getPayCodeSet) | **GET** /employers/{employerId}/paycodesets/{id} | Get PayCodeSet | +| [**indexPayCodeSet()**](PayCodeSetApi.md#indexPayCodeSet) | **GET** /employers/{employerId}/paycodesets | List PayCodeSets | +| [**updatePayCodeSet()**](PayCodeSetApi.md#updatePayCodeSet) | **PUT** /employers/{employerId}/paycodesets/{id} | Update PayCodeSet | + + +## `createPayCodeSet()` + +```php +createPayCodeSet($employerId, $payCodeSet): \SynergiTech\Staffology\Model\PayCodeSet +``` + +Create PayCodeSet + +Creates a new PayCodeSet for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeSetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payCodeSet = new \SynergiTech\Staffology\Model\PayCodeSet(); // \SynergiTech\Staffology\Model\PayCodeSet + +try { + $result = $apiInstance->createPayCodeSet($employerId, $payCodeSet); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeSetApi->createPayCodeSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payCodeSet** | [**\SynergiTech\Staffology\Model\PayCodeSet**](../Model/PayCodeSet.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCodeSet**](../Model/PayCodeSet.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayCodeSet()` + +```php +deletePayCodeSet($employerId, $id) +``` + +Delete PayCodeSet + +Deletes the specified PayCodeSet. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeSetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deletePayCodeSet($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling PayCodeSetApi->deletePayCodeSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayCodeSet()` + +```php +getPayCodeSet($employerId, $id): \SynergiTech\Staffology\Model\PayCodeSet +``` + +Get PayCodeSet + +Gets the PayCodeSet specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeSetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Pay Code Set belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->getPayCodeSet($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeSetApi->getPayCodeSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Pay Code Set belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCodeSet**](../Model/PayCodeSet.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPayCodeSet()` + +```php +indexPayCodeSet($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List PayCodeSets + +Lists all PayCodeSets for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeSetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list PayCodeSets + +try { + $result = $apiInstance->indexPayCodeSet($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeSetApi->indexPayCodeSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list PayCodeSets | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayCodeSet()` + +```php +updatePayCodeSet($employerId, $id, $payCodeSet): \SynergiTech\Staffology\Model\PayCodeSet +``` + +Update PayCodeSet + +Updates the details of an existing PayCodeSet. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayCodeSetApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$payCodeSet = new \SynergiTech\Staffology\Model\PayCodeSet(); // \SynergiTech\Staffology\Model\PayCodeSet + +try { + $result = $apiInstance->updatePayCodeSet($employerId, $id, $payCodeSet); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayCodeSetApi->updatePayCodeSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **payCodeSet** | [**\SynergiTech\Staffology\Model\PayCodeSet**](../Model/PayCodeSet.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCodeSet**](../Model/PayCodeSet.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayRunApi.md b/docs/Api/PayRunApi.md new file mode 100644 index 0000000..b52284c --- /dev/null +++ b/docs/Api/PayRunApi.md @@ -0,0 +1,2371 @@ +# SynergiTech\Staffology\PayRunApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addPayRunEntriesPayRun()**](PayRunApi.md#addPayRunEntriesPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/addpayrunentries | Add PayRunEntries (deprecated) | +| [**aeoPayRun()**](PayRunApi.md#aeoPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/aeo | List AttachmentOrders related to a PayRun | +| [**calculateAverageHolidayPayPayRun()**](PayRunApi.md#calculateAverageHolidayPayPayRun) | **GET** /employers/{employerId}/payrun/employees/{employeeId}/averageholidaypayrate | Calculate Average Holiday Pay Rate | +| [**changesForPayRunEntryPayRun()**](PayRunApi.md#changesForPayRunEntryPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/changes | List PayRun Changes for PayRunEntry | +| [**changesPayRun()**](PayRunApi.md#changesPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/changes | List PayRun Changes | +| [**createNextPayRunPayRun()**](PayRunApi.md#createNextPayRunPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | Starts the next PayRun | +| [**deletePayRun()**](PayRunApi.md#deletePayRun) | **DELETE** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Delete a PayRun | +| [**emailMultipleP45sPayRun()**](PayRunApi.md#emailMultipleP45sPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/p45/email | (Re)send P45 Emails | +| [**finalisePayRunPayRun()**](PayRunApi.md#finalisePayRunPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/finalise | Finalise a PayRun (deprecated) | +| [**getPayRunEntryPayRun()**](PayRunApi.md#getPayRunEntryPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id} | Get a PayRunEntry | +| [**getPayRunEventsPayRun()**](PayRunApi.md#getPayRunEventsPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/events | Get PayPeriodEvents | +| [**getPayRunJournalPayRun()**](PayRunApi.md#getPayRunJournalPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/journal | Get Journal for PayRun | +| [**getPayRunPayCodesPayRun()**](PayRunApi.md#getPayRunPayCodesPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paycodes | Get PayCodes for a PayRun | +| [**getPayRunPayRun()**](PayRunApi.md#getPayRunPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Get a PayRun | +| [**getPayRunStateHistoryPayRun()**](PayRunApi.md#getPayRunStateHistoryPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/stateHistory | List PayRunStateHistory | +| [**getPayRunWarningsPayRun()**](PayRunApi.md#getPayRunWarningsPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/warnings | Get PayRun Warnings | +| [**getPayRunsPayRun()**](PayRunApi.md#getPayRunsPayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | List PayRuns | +| [**importPayPayRun()**](PayRunApi.md#importPayPayRun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importpay | Import Pay | +| [**importTimeAndAttendancePayRun()**](PayRunApi.md#importTimeAndAttendancePayRun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importtimeandattendance | Import Time And Attendance | +| [**importUmbrellaPayPayRun()**](PayRunApi.md#importUmbrellaPayPayRun) | **POST** /employers/{employerId}/payrun/{payPeriod}/importumbrellapay | Import Umbrella Pay | +| [**lastPayRunEntryForEmployeePayRun()**](PayRunApi.md#lastPayRunEntryForEmployeePayRun) | **GET** /employers/{employerId}/payrun/employees/{employeeId}/Last | Gets the last closed pay run entry for an employee. | +| [**lastPayRunEntryWithPensionYtdValuesForEmployeePayRun()**](PayRunApi.md#lastPayRunEntryWithPensionYtdValuesForEmployeePayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/employees/{employeeId}/pension/{pensionUniqueId}/pensionytd | Gets last PayRunEntry for a Pension | +| [**leavePayRun()**](PayRunApi.md#leavePayRun) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/leave | List Leave related to a PayRun | +| [**payRunEntryUmbrellaPaymentPayRun()**](PayRunApi.md#payRunEntryUmbrellaPaymentPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/umbrella | PayRunEntry Umbrella Payment | +| [**reOpenPayRunPayRun()**](PayRunApi.md#reOpenPayRunPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/reopen | Re-open a PayRun (deprecated) | +| [**removePayRunEntriesPayRun()**](PayRunApi.md#removePayRunEntriesPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/removepayrunentries | Remove PayRunEntries (deprecated) | +| [**sendPayslipEmailsPayRun()**](PayRunApi.md#sendPayslipEmailsPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/email | (Re)send Payslip Emails | +| [**startNextPayRunPayRun()**](PayRunApi.md#startNextPayRunPayRun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod} | Starts the next PayRun (deprecated) | +| [**updatePayRunEntryPayRun()**](PayRunApi.md#updatePayRunEntryPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id} | Update a PayRunEntry | +| [**updatePayRunPayRun()**](PayRunApi.md#updatePayRunPayRun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber} | Update PayRun | +| [**updatePaymentDatePayRun()**](PayRunApi.md#updatePaymentDatePayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paymentdate | Set PaymentDate | +| [**ytdPayRun()**](PayRunApi.md#ytdPayRun) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/ytd | Update YTD | +| [**zeroisePayRunEntriesPayRun()**](PayRunApi.md#zeroisePayRunEntriesPayRun) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/zeroise | Zeroise PayRunEntries | + + +## `addPayRunEntriesPayRun()` + +```php +addPayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody): \SynergiTech\Staffology\Model\PayRun +``` + +Add PayRunEntries (deprecated) + +Adds the payrun entries specified in the ids property + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$requestBody = array('requestBody_example'); // string[] + +try { + $result = $apiInstance->addPayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->addPayRunEntriesPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aeoPayRun()` + +```php +aeoPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\Item[] +``` + +List AttachmentOrders related to a PayRun + +Returns a List of Items representing any AttachmentOrders within the PayRun date range for Employees that are included in the given PayRun. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->aeoPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->aeoPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `calculateAverageHolidayPayPayRun()` + +```php +calculateAverageHolidayPayPayRun($employerId, $employeeId, $startDate): float +``` + +Calculate Average Holiday Pay Rate + +Calculates the average holiday pay rate for an employee based on their holiday scheme configuration + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee +$startDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The date we used to calculate average holiday pay from + +try { + $result = $apiInstance->calculateAverageHolidayPayPayRun($employerId, $employeeId, $startDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->calculateAverageHolidayPayPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee | | +| **startDate** | **\DateTime**| The date we used to calculate average holiday pay from | | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `changesForPayRunEntryPayRun()` + +```php +changesForPayRunEntryPayRun($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly): \SynergiTech\Staffology\Model\ChangeSummary[] +``` + +List PayRun Changes for PayRunEntry + +Returns a list of AuditEntry reflecting changes made to a PayRunEntry and related employee record for a given PayRun This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$significantChangesOnly = false; // bool + +try { + $result = $apiInstance->changesForPayRunEntryPayRun($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->changesForPayRunEntryPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **significantChangesOnly** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ChangeSummary[]**](../Model/ChangeSummary.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `changesPayRun()` + +```php +changesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PayRunChanges +``` + +List PayRun Changes + +Returns a of changes made to a payrun since it was created. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->changesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->changesPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunChanges**](../Model/PayRunChanges.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createNextPayRunPayRun()` + +```php +createNextPayRunPayRun($employerId, $payPeriod, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PayRun +``` + +Starts the next PayRun + +Starts the next PayRun and returns a 201 if successful + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->createNextPayRunPayRun($employerId, $payPeriod, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->createNextPayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayRun()` + +```php +deletePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal) +``` + +Delete a PayRun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->deletePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->deletePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailMultipleP45sPayRun()` + +```php +emailMultipleP45sPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal) +``` + +(Re)send P45 Emails + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->emailMultipleP45sPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->emailMultipleP45sPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `finalisePayRunPayRun()` + +```php +finalisePayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody): bool +``` + +Finalise a PayRun (deprecated) + +This endpoint is now deprecated and will be removed in Jan 2022. You should instead use the Update method and set the State to Finalised. Returns True if the resulting FPS has been automatically submitted due to the Employers RTISubmissionSettings, otherwise returns false. You can suppress the emailing of payslips to employees by adding a key named dontEmailEmployeePayslips with a value of true to the body. See the related guides for more information. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$requestBody = NULL; // array + +try { + $result = $apiInstance->finalisePayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->finalisePayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **requestBody** | [**array**](../Model/mixed.md)| | [optional] | + +### Return type + +**bool** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunEntryPayRun()` + +```php +getPayRunEntryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal): \SynergiTech\Staffology\Model\PayRunEntry +``` + +Get a PayRunEntry + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->getPayRunEntryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunEntryPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunEventsPayRun()` + +```php +getPayRunEventsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PaySchedulePeriodEvent[] +``` + +Get PayPeriodEvents + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->getPayRunEventsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunEventsPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]**](../Model/PaySchedulePeriodEvent.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunJournalPayRun()` + +```php +getPayRunJournalPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown): \SynergiTech\Staffology\Model\PayRunJournal +``` + +Get Journal for PayRun + +Returns values that can be used to create accounting entries for this PayRun. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$deptBreakdown = false; // bool | Set to true and the journal will be split between any relevant Departments + +try { + $result = $apiInstance->getPayRunJournalPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunJournalPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptBreakdown** | **bool**| Set to true and the journal will be split between any relevant Departments | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunJournal**](../Model/PayRunJournal.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunPayCodesPayRun()` + +```php +getPayRunPayCodesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PayCode[] +``` + +Get PayCodes for a PayRun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->getPayRunPayCodesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunPayCodesPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayCode[]**](../Model/PayCode.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunPayRun()` + +```php +getPayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending): \SynergiTech\Staffology\Model\PayRun +``` + +Get a PayRun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$pageNum = 56; // int | Zero-based page number, used in conjunction with pageSize +$pageSize = 56; // int | The number of items per page +$searchTerm = 'searchTerm_example'; // string | The option to filter on a search term +$zeroPaid = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ZeroPaidFilter(); // \SynergiTech\Staffology\Model\ZeroPaidFilter | The option to filter pay run entries by negative paid, zero paid and non-zero paid +$departmentCode = 'departmentCode_example'; // string | The option to filter on department code +$startersLeavers = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\StartersLeaversFilter(); // \SynergiTech\Staffology\Model\StartersLeaversFilter | The option to filter on whether the employee is a starter or leaver +$sortBy = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayRunEntrySortBy(); // \SynergiTech\Staffology\Model\PayRunEntrySortBy | The option to sort by a certain field. Default is Payroll Code +$sortDescending = false; // bool | Whether to sort in ascending or descending order + +try { + $result = $apiInstance->getPayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **pageNum** | **int**| Zero-based page number, used in conjunction with pageSize | [optional] | +| **pageSize** | **int**| The number of items per page | [optional] | +| **searchTerm** | **string**| The option to filter on a search term | [optional] | +| **zeroPaid** | [**\SynergiTech\Staffology\Model\ZeroPaidFilter**](../Model/.md)| The option to filter pay run entries by negative paid, zero paid and non-zero paid | [optional] | +| **departmentCode** | **string**| The option to filter on department code | [optional] | +| **startersLeavers** | [**\SynergiTech\Staffology\Model\StartersLeaversFilter**](../Model/.md)| The option to filter on whether the employee is a starter or leaver | [optional] | +| **sortBy** | [**\SynergiTech\Staffology\Model\PayRunEntrySortBy**](../Model/.md)| The option to sort by a certain field. Default is Payroll Code | [optional] | +| **sortDescending** | **bool**| Whether to sort in ascending or descending order | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunStateHistoryPayRun()` + +```php +getPayRunStateHistoryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[] +``` + +List PayRunStateHistory + +Returns the state history of a pay run. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history +$periodNumber = 56; // int | The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The Tax Year for which you want to get the Pay Run history +$ordinal = 1; // int | Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod + +try { + $result = $apiInstance->getPayRunStateHistoryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunStateHistoryPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history | | +| **periodNumber** | **int**| The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The Tax Year for which you want to get the Pay Run history | | +| **ordinal** | **int**| Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]**](../Model/ContractPayRunStateHistoryResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunWarningsPayRun()` + +```php +getPayRunWarningsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +Get PayRun Warnings + +Returns a list of Item detailing any Warnings for PayRunEntries on the specified PayRun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->getPayRunWarningsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunWarningsPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunsPayRun()` + +```php +getPayRunsPayRun($employerId, $payPeriod, $taxYear, $ordinal): \SynergiTech\Staffology\Model\Item[] +``` + +List PayRuns + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->getPayRunsPayRun($employerId, $payPeriod, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->getPayRunsPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importPayPayRun()` + +```php +importPayPayRun($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport) +``` + +Import Pay + +Takes a list PayOptionsImport and updates the currently open payrun to use the amounts given. You must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun. Any lines imported for a PayRunEntry will replace existing lines for that PayRunEntry. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$ordinal = 1; // int +$linesOnly = false; // bool | If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. +$append = false; // bool | If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. +$updateExisting = false; // bool | If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. +$validateOnly = false; // bool | If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. +$payOptionsImport = array(new \SynergiTech\Staffology\Model\PayOptionsImport()); // \SynergiTech\Staffology\Model\PayOptionsImport[] + +try { + $apiInstance->importPayPayRun($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->importPayPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **linesOnly** | **bool**| If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. | [optional] [default to false] | +| **append** | **bool**| If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. | [optional] [default to false] | +| **updateExisting** | **bool**| If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. | [optional] [default to false] | +| **validateOnly** | **bool**| If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. | [optional] [default to false] | +| **payOptionsImport** | [**\SynergiTech\Staffology\Model\PayOptionsImport[]**](../Model/PayOptionsImport.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importTimeAndAttendancePayRun()` + +```php +importTimeAndAttendancePayRun($employerId, $payPeriod, $providerId, $ordinal): \SynergiTech\Staffology\Model\PayOptionsImport[] +``` + +Import Time And Attendance + +If the employer is connected to an ExternalDataProvider that provides Time and Attendance data then this API call will update the currently open payrun for the PayPeriod specified with data from the specified provider. Returns a list of PayOptionsImport to show what's been imported. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$providerId = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ExternalDataProviderId(); // \SynergiTech\Staffology\Model\ExternalDataProviderId +$ordinal = 1; // int + +try { + $result = $apiInstance->importTimeAndAttendancePayRun($employerId, $payPeriod, $providerId, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->importTimeAndAttendancePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **providerId** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](../Model/.md)| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayOptionsImport[]**](../Model/PayOptionsImport.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importUmbrellaPayPayRun()` + +```php +importUmbrellaPayPayRun($employerId, $payPeriod, $ordinal, $umbrellaPayment): \SynergiTech\Staffology\Model\PayRun +``` + +Import Umbrella Pay + +Takes a list UmbrellaPayment and updates the currently open payrun to use the amounts given. You must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun. You should have also set the UmbrellaSettings for the Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$ordinal = 1; // int +$umbrellaPayment = array(new \SynergiTech\Staffology\Model\UmbrellaPayment()); // \SynergiTech\Staffology\Model\UmbrellaPayment[] + +try { + $result = $apiInstance->importUmbrellaPayPayRun($employerId, $payPeriod, $ordinal, $umbrellaPayment); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->importUmbrellaPayPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **umbrellaPayment** | [**\SynergiTech\Staffology\Model\UmbrellaPayment[]**](../Model/UmbrellaPayment.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `lastPayRunEntryForEmployeePayRun()` + +```php +lastPayRunEntryForEmployeePayRun($employerId, $employeeId, $isClosed): \SynergiTech\Staffology\Model\PayRunEntry +``` + +Gets the last closed pay run entry for an employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to get last pay run entry for. +$isClosed = True; // bool + +try { + $result = $apiInstance->lastPayRunEntryForEmployeePayRun($employerId, $employeeId, $isClosed); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->lastPayRunEntryForEmployeePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to get last pay run entry for. | | +| **isClosed** | **bool**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `lastPayRunEntryWithPensionYtdValuesForEmployeePayRun()` + +```php +lastPayRunEntryWithPensionYtdValuesForEmployeePayRun($employerId, $employeeId, $pensionUniqueId, $taxYear): \SynergiTech\Staffology\Model\PayRunEntry +``` + +Gets last PayRunEntry for a Pension + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to get pay run entry for. +$pensionUniqueId = 'pensionUniqueId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->lastPayRunEntryWithPensionYtdValuesForEmployeePayRun($employerId, $employeeId, $pensionUniqueId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->lastPayRunEntryWithPensionYtdValuesForEmployeePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs. | | +| **employeeId** | **string**| The Id of the Employee you want to get pay run entry for. | | +| **pensionUniqueId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `leavePayRun()` + +```php +leavePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\Item[] +``` + +List Leave related to a PayRun + +Returns a List of Items representing any Leave within the PayRun date range for Employees that are included in the given PayRun. Note that if Leave was added after the PayRun was closed, but the Leave is within the PayRun period then it'll be returned here even though it wouldn't have been processed with the PayRun. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->leavePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->leavePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payRunEntryUmbrellaPaymentPayRun()` + +```php +payRunEntryUmbrellaPaymentPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment): \SynergiTech\Staffology\Model\PayRunEntry +``` + +PayRunEntry Umbrella Payment + +Automatically sets the values on the PayRunEntry based on an UmbrellaPayment. Using this method overwrites any existing values for the PayRunEntry. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$ordinal = 1; // int +$umbrellaPayment = new \SynergiTech\Staffology\Model\UmbrellaPayment(); // \SynergiTech\Staffology\Model\UmbrellaPayment + +try { + $result = $apiInstance->payRunEntryUmbrellaPaymentPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->payRunEntryUmbrellaPaymentPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **umbrellaPayment** | [**\SynergiTech\Staffology\Model\UmbrellaPayment**](../Model/UmbrellaPayment.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `reOpenPayRunPayRun()` + +```php +reOpenPayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PayRun +``` + +Re-open a PayRun (deprecated) + +This endpoint is now deprecated and will be removed in Jan 2022. You should instead use the Update method and set the State to Open. Re-opens a PayRun so that it can be edited. Only the most recent PayRun can be re-opened, and only if the Employer is still in the same TaxYear as the PayRun and there are no open PayRuns. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $result = $apiInstance->reOpenPayRunPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->reOpenPayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removePayRunEntriesPayRun()` + +```php +removePayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody): \SynergiTech\Staffology\Model\PayRun +``` + +Remove PayRunEntries (deprecated) + +Removes the payrun entries specified in the ids property + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$requestBody = array('requestBody_example'); // string[] + +try { + $result = $apiInstance->removePayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->removePayRunEntriesPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `sendPayslipEmailsPayRun()` + +```php +sendPayslipEmailsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id) +``` + +(Re)send Payslip Emails + +Payslips are usually emailed automatically when a PayRun is finalised. But if you suppressed them or need to re-send them then you can do so with this API call. Providing a pay run entry id will send a single email, otherwise all emails will be sent. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The ID of the employer. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The pay period of the pay run. +$periodNumber = 56; // int | The period number of the pay run. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The tax year of the pay run. +$ordinal = 1; // int | The ordinal number of the pay run. +$id = 'id_example'; // string | The UniqueId of the pay run entry (optional). + +try { + $apiInstance->sendPayslipEmailsPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->sendPayslipEmailsPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The ID of the employer. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The pay period of the pay run. | | +| **periodNumber** | **int**| The period number of the pay run. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The tax year of the pay run. | | +| **ordinal** | **int**| The ordinal number of the pay run. | [optional] [default to 1] | +| **id** | **string**| The UniqueId of the pay run entry (optional). | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `startNextPayRunPayRun()` + +```php +startNextPayRunPayRun($employerId, $payPeriod, $taxYear, $ordinal) +``` + +Starts the next PayRun (deprecated) + +This PUT will be removed in Jan 2022. You should instead use a POST to this URL + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->startNextPayRunPayRun($employerId, $payPeriod, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->startNextPayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayRunEntryPayRun()` + +```php +updatePayRunEntryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry): \SynergiTech\Staffology\Model\PayRunEntry +``` + +Update a PayRunEntry + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$ordinal = 1; // int +$forceSyncEmployeePayOptions = false; // bool | If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. +$payRunEntry = new \SynergiTech\Staffology\Model\PayRunEntry(); // \SynergiTech\Staffology\Model\PayRunEntry + +try { + $result = $apiInstance->updatePayRunEntryPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->updatePayRunEntryPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **forceSyncEmployeePayOptions** | **bool**| If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. | [optional] [default to false] | +| **payRunEntry** | [**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayRunPayRun()` + +```php +updatePayRunPayRun($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange): \SynergiTech\Staffology\Model\PayRun +``` + +Update PayRun + +Updates a PayRun to the state provided along with the reason (optional) for the change. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$ordinal = 1; // int +$sendPayslipEmails = false; // bool | Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. +$payslipReleaseType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayslipReleaseType(); // \SynergiTech\Staffology\Model\PayslipReleaseType +$payslipScheduledDateTime = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$payRunStateChange = new \SynergiTech\Staffology\Model\PayRunStateChange(); // \SynergiTech\Staffology\Model\PayRunStateChange | Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. + +try { + $result = $apiInstance->updatePayRunPayRun($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->updatePayRunPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **sendPayslipEmails** | **bool**| Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. | [optional] [default to false] | +| **payslipReleaseType** | [**\SynergiTech\Staffology\Model\PayslipReleaseType**](../Model/.md)| | [optional] | +| **payslipScheduledDateTime** | **\DateTime**| | [optional] | +| **payRunStateChange** | [**\SynergiTech\Staffology\Model\PayRunStateChange**](../Model/PayRunStateChange.md)| Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePaymentDatePayRun()` + +```php +updatePaymentDatePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body): \SynergiTech\Staffology\Model\PayRun +``` + +Set PaymentDate + +Sets the PaymentDate for a PayRun. If the date given is outside of the TaxPeriod that the payrun is for then only the payment date for the individual PayRunEntries is updated, the PayRun will retain it's current PaymentDate + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$body = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime + +try { + $result = $apiInstance->updatePaymentDatePayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->updatePaymentDatePayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **body** | **\DateTime**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `ytdPayRun()` + +```php +ytdPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file): \SynergiTech\Staffology\Model\EmployeeYtdValues[] +``` + +Update YTD + +Upload a CSV to override the YTD values on a Pay Run. The CSV should have the same headings as the YTD report + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 56; // int +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->ytdPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->ytdPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeYtdValues[]**](../Model/EmployeeYtdValues.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `zeroisePayRunEntriesPayRun()` + +```php +zeroisePayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody): \SynergiTech\Staffology\Model\PayRun +``` + +Zeroise PayRunEntries + +Zeroises the payrun entries specified in the ids property + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$requestBody = array('requestBody_example'); // string[] + +try { + $result = $apiInstance->zeroisePayRunEntriesPayRun($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunApi->zeroisePayRunEntriesPayRun: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **requestBody** | [**string[]**](../Model/string.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayRunAsyncApi.md b/docs/Api/PayRunAsyncApi.md new file mode 100644 index 0000000..d6970e5 --- /dev/null +++ b/docs/Api/PayRunAsyncApi.md @@ -0,0 +1,301 @@ +# SynergiTech\Staffology\PayRunAsyncApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**importPayPayRunAsync()**](PayRunAsyncApi.md#importPayPayRunAsync) | **POST** /employers/{employerId}/payrun-async/{payPeriod}/importpay | Import Pay (beta) | +| [**queueCreatePayRunPayRunAsync()**](PayRunAsyncApi.md#queueCreatePayRunPayRunAsync) | **POST** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod} | Registers a request to start the next PayRun (beta) | +| [**queueDeletePayRunPayRunAsync()**](PayRunAsyncApi.md#queueDeletePayRunPayRunAsync) | **DELETE** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber} | Registers a request to delete a PayRun (beta) | +| [**queueUpdatePayRunPayRunAsync()**](PayRunAsyncApi.md#queueUpdatePayRunPayRunAsync) | **PUT** /employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber} | Registers a request to update the PayRun (beta) | + + +## `importPayPayRunAsync()` + +```php +importPayPayRunAsync($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting): \SynergiTech\Staffology\Model\ContractJobResponse +``` + +Import Pay (beta) + +Takes a list PayOptionsImport and updates the currently open payrun to use the amounts given. You must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun. Any lines imported for a PayRunEntry will replace existing lines for that PayRunEntry. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunAsyncApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$ordinal = 56; // int +$throwOnError = True; // bool +$contractPayOptionsImportRequest = array(new \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest()); // \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] +$linesOnly = True; // bool | If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. +$append = True; // bool | If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. +$updateExisting = True; // bool | If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. + +try { + $result = $apiInstance->importPayPayRunAsync($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunAsyncApi->importPayPayRunAsync: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **ordinal** | **int**| | | +| **throwOnError** | **bool**| | | +| **contractPayOptionsImportRequest** | [**\SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[]**](../Model/ContractPayOptionsImportRequest.md)| | | +| **linesOnly** | **bool**| If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. | [optional] | +| **append** | **bool**| If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. | [optional] | +| **updateExisting** | **bool**| If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `queueCreatePayRunPayRunAsync()` + +```php +queueCreatePayRunPayRunAsync($employerId, $payPeriod, $taxYear, $ordinal) +``` + +Registers a request to start the next PayRun (beta) + +Registers the request to start the next PayRun and returns a 202 if successful This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunAsyncApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->queueCreatePayRunPayRunAsync($employerId, $payPeriod, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayRunAsyncApi->queueCreatePayRunPayRunAsync: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `queueDeletePayRunPayRunAsync()` + +```php +queueDeletePayRunPayRunAsync($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal) +``` + +Registers a request to delete a PayRun (beta) + +Registers a request to delete a PayRun and returns a 202 if successful. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunAsyncApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int + +try { + $apiInstance->queueDeletePayRunPayRunAsync($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayRunAsyncApi->queueDeletePayRunPayRunAsync: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `queueUpdatePayRunPayRunAsync()` + +```php +queueUpdatePayRunPayRunAsync($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange): \SynergiTech\Staffology\Model\PayRun +``` + +Registers a request to update the PayRun (beta) + +Queues a request to update a PayRun to the state provided along with the reason (optional) for the change. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayRunAsyncApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$ordinal = 1; // int +$sendPayslipEmails = false; // bool +$payslipReleaseType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayslipReleaseType(); // \SynergiTech\Staffology\Model\PayslipReleaseType +$payslipScheduledDateTime = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$payRunStateChange = new \SynergiTech\Staffology\Model\PayRunStateChange(); // \SynergiTech\Staffology\Model\PayRunStateChange + +try { + $result = $apiInstance->queueUpdatePayRunPayRunAsync($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayRunAsyncApi->queueUpdatePayRunPayRunAsync: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **sendPayslipEmails** | **bool**| | [optional] [default to false] | +| **payslipReleaseType** | [**\SynergiTech\Staffology\Model\PayslipReleaseType**](../Model/.md)| | [optional] | +| **payslipScheduledDateTime** | **\DateTime**| | [optional] | +| **payRunStateChange** | [**\SynergiTech\Staffology\Model\PayRunStateChange**](../Model/PayRunStateChange.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRun**](../Model/PayRun.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayScheduleApi.md b/docs/Api/PayScheduleApi.md new file mode 100644 index 0000000..d12c2f8 --- /dev/null +++ b/docs/Api/PayScheduleApi.md @@ -0,0 +1,774 @@ +# SynergiTech\Staffology\PayScheduleApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPaySchedule()**](PayScheduleApi.md#createPaySchedule) | **POST** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Create a PaySchedule | +| [**createWithOptionalOrdinalPaySchedule()**](PayScheduleApi.md#createWithOptionalOrdinalPaySchedule) | **POST** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Create a PaySchedule (deprecated) | +| [**deletePaySchedule()**](PayScheduleApi.md#deletePaySchedule) | **DELETE** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Delete PaySchedule | +| [**deleteWithOptionalOrdinalPaySchedule()**](PayScheduleApi.md#deleteWithOptionalOrdinalPaySchedule) | **DELETE** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Delete PaySchedule (deprecated) | +| [**getAllPaySchedule()**](PayScheduleApi.md#getAllPaySchedule) | **GET** /employers/{employerId}/schedules/{taxYear} | Get PaySchedules | +| [**getPaySchedule()**](PayScheduleApi.md#getPaySchedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Get PaySchedule | +| [**getPeriodsPaySchedule()**](PayScheduleApi.md#getPeriodsPaySchedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods | Get PaySchedulePeriods | +| [**getWithOptionalOrdinalPaySchedule()**](PayScheduleApi.md#getWithOptionalOrdinalPaySchedule) | **GET** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Get PaySchedule (deprecated) | +| [**savePaySchedule()**](PayScheduleApi.md#savePaySchedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal} | Update PaySchedule | +| [**saveWithOptionalOrdinalPaySchedule()**](PayScheduleApi.md#saveWithOptionalOrdinalPaySchedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod} | Update PaySchedule (deprecated) | +| [**updatePaySchedulePeriodPaySchedule()**](PayScheduleApi.md#updatePaySchedulePeriodPaySchedule) | **PUT** /employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods/{periodNumber} | Update PaySchedulePeriod | + + +## `createPaySchedule()` + +```php +createPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule) +``` + +Create a PaySchedule + +Create PaySchedule using a certain pay frequency. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to update details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that the PaySchedule is for. +$ordinal = 1; // int | Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. +$paySchedule = new \SynergiTech\Staffology\Model\PaySchedule(); // \SynergiTech\Staffology\Model\PaySchedule + +try { + $apiInstance->createPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->createPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to update details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that the PaySchedule is for. | | +| **ordinal** | **int**| Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. | [default to 1] | +| **paySchedule** | [**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createWithOptionalOrdinalPaySchedule()` + +```php +createWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule) +``` + +Create a PaySchedule (deprecated) + +Create PaySchedule using a certain pay frequency and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided). + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to update details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that the PaySchedule is for. +$ordinal = 56; // int +$paySchedule = new \SynergiTech\Staffology\Model\PaySchedule(); // \SynergiTech\Staffology\Model\PaySchedule + +try { + $apiInstance->createWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->createWithOptionalOrdinalPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to update details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that the PaySchedule is for. | | +| **ordinal** | **int**| | [optional] | +| **paySchedule** | [**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePaySchedule()` + +```php +deletePaySchedule($employerId, $payPeriod, $taxYear, $ordinal) +``` + +Delete PaySchedule + +Delete the PaySchedule for the PayPeriod and TaxYear specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to retrieve details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. +$ordinal = 1; // int | Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. + +try { + $apiInstance->deletePaySchedule($employerId, $payPeriod, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->deletePaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to retrieve details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | +| **ordinal** | **int**| Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. | [default to 1] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteWithOptionalOrdinalPaySchedule()` + +```php +deleteWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal) +``` + +Delete PaySchedule (deprecated) + +Delete the PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided). + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to retrieve details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. +$ordinal = 56; // int + +try { + $apiInstance->deleteWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->deleteWithOptionalOrdinalPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to retrieve details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | +| **ordinal** | **int**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAllPaySchedule()` + +```php +getAllPaySchedule($employerId, $taxYear): \SynergiTech\Staffology\Model\PaySchedule[] +``` + +Get PaySchedules + +Get all PaySchedules for the given TaxYear. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. + +try { + $result = $apiInstance->getAllPaySchedule($employerId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->getAllPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedule[]**](../Model/PaySchedule.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPaySchedule()` + +```php +getPaySchedule($employerId, $payPeriod, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PaySchedule +``` + +Get PaySchedule + +Get the PaySchedule for the PayPeriod and TaxYear specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to retrieve details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. +$ordinal = 1; // int | Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. + +try { + $result = $apiInstance->getPaySchedule($employerId, $payPeriod, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->getPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to retrieve details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | +| **ordinal** | **int**| Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. | [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPeriodsPaySchedule()` + +```php +getPeriodsPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents): \SynergiTech\Staffology\Model\PaySchedulePeriod[] +``` + +Get PaySchedulePeriods + +Get the PaySchedulePeriods for PaySchedule specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule periods +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to retrieve details for +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for +$ordinal = 56; // int | Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) +$periodNumber = 56; // int | Optionally specify a period number to get a result just for that period +$includeEvents = false; // bool + +try { + $result = $apiInstance->getPeriodsPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->getPeriodsPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule periods | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to retrieve details for | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for | | +| **ordinal** | **int**| Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) | | +| **periodNumber** | **int**| Optionally specify a period number to get a result just for that period | [optional] | +| **includeEvents** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedulePeriod[]**](../Model/PaySchedulePeriod.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getWithOptionalOrdinalPaySchedule()` + +```php +getWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal): \SynergiTech\Staffology\Model\PaySchedule +``` + +Get PaySchedule (deprecated) + +Get the PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided). + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to retrieve details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that you want to retrieve details for. +$ordinal = 56; // int + +try { + $result = $apiInstance->getWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->getWithOptionalOrdinalPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to retrieve details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that you want to retrieve details for. | | +| **ordinal** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `savePaySchedule()` + +```php +savePaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule): \SynergiTech\Staffology\Model\PaySchedule +``` + +Update PaySchedule + +Update PaySchedule for the PayPeriod. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to update details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that the PaySchedule is for. +$ordinal = 1; // int | Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. +$paySchedule = new \SynergiTech\Staffology\Model\PaySchedule(); // \SynergiTech\Staffology\Model\PaySchedule + +try { + $result = $apiInstance->savePaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->savePaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to update details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that the PaySchedule is for. | | +| **ordinal** | **int**| Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. | [default to 1] | +| **paySchedule** | [**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `saveWithOptionalOrdinalPaySchedule()` + +```php +saveWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule): \SynergiTech\Staffology\Model\PaySchedule +``` + +Update PaySchedule (deprecated) + +Update PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided). + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update the PaySchedule +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to update details for. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that the PaySchedule is for. +$ordinal = 56; // int +$paySchedule = new \SynergiTech\Staffology\Model\PaySchedule(); // \SynergiTech\Staffology\Model\PaySchedule + +try { + $result = $apiInstance->saveWithOptionalOrdinalPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->saveWithOptionalOrdinalPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update the PaySchedule | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to update details for. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that the PaySchedule is for. | | +| **ordinal** | **int**| | [optional] | +| **paySchedule** | [**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedule**](../Model/PaySchedule.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePaySchedulePeriodPaySchedule()` + +```php +updatePaySchedulePeriodPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod): \SynergiTech\Staffology\Model\PaySchedulePeriod +``` + +Update PaySchedulePeriod + +Update the PaymentDate for a PaySchedulePeriod. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayScheduleApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update the PaySchedulePeriod +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The PayPeriod (ie, Monthly) that you want to update details for +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The year that the PaySchedule is for +$ordinal = 56; // int | Specify the first, second, third (etc) PaySchedule for this PayPeriod. +$periodNumber = 56; // int | Specify the number of the period that you want to update the PaymentDate for +$paySchedulePeriod = new \SynergiTech\Staffology\Model\PaySchedulePeriod(); // \SynergiTech\Staffology\Model\PaySchedulePeriod + +try { + $result = $apiInstance->updatePaySchedulePeriodPaySchedule($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayScheduleApi->updatePaySchedulePeriodPaySchedule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update the PaySchedulePeriod | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The PayPeriod (ie, Monthly) that you want to update details for | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The year that the PaySchedule is for | | +| **ordinal** | **int**| Specify the first, second, third (etc) PaySchedule for this PayPeriod. | | +| **periodNumber** | **int**| Specify the number of the period that you want to update the PaymentDate for | | +| **paySchedulePeriod** | [**\SynergiTech\Staffology\Model\PaySchedulePeriod**](../Model/PaySchedulePeriod.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySchedulePeriod**](../Model/PaySchedulePeriod.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PaySpineApi.md b/docs/Api/PaySpineApi.md new file mode 100644 index 0000000..9d99b07 --- /dev/null +++ b/docs/Api/PaySpineApi.md @@ -0,0 +1,2881 @@ +# SynergiTech\Staffology\PaySpineApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createAllowanceGradesPaySpine()**](PaySpineApi.md#createAllowanceGradesPaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | Create AllowanceGrade | +| [**createLondonAllowancePaySpine()**](PaySpineApi.md#createLondonAllowancePaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/londonallowances | Create LondonAllowance | +| [**createMultipleAllowanceGradesPaySpine()**](PaySpineApi.md#createMultipleAllowanceGradesPaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/create/bulk | Create Multiple AllowanceGrades | +| [**createMultiplePaySpine()**](PaySpineApi.md#createMultiplePaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk | Create Multiple SpinalPoints | +| [**createMultipleSpineAllowancePaySpine()**](PaySpineApi.md#createMultipleSpineAllowancePaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances/create/bulk | Create Multiple SpineAllowances | +| [**createPaySpine()**](PaySpineApi.md#createPaySpine) | **POST** /employers/{employerId}/payspines | Create PaySpine | +| [**createPaySpineGradePaySpine()**](PaySpineApi.md#createPaySpineGradePaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/paygrades | Create PaySpine Grade | +| [**createSpinalPointPaySpine()**](PaySpineApi.md#createSpinalPointPaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | Create SpinalPoint | +| [**createSpineAllowancePaySpine()**](PaySpineApi.md#createSpineAllowancePaySpine) | **POST** /employers/{employerId}/payspines/{paySpineId}/allowances | Create SpineAllowance | +| [**deleteAllAllowanceGradesPaySpine()**](PaySpineApi.md#deleteAllAllowanceGradesPaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | Delete All AllowanceGrades Associated with a PaySpine | +| [**deleteAllSpinalPointsPaySpine()**](PaySpineApi.md#deleteAllSpinalPointsPaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | Delete All SpinalPoints Associated with a PaySpine | +| [**deleteAllSpineAllowancesPaySpine()**](PaySpineApi.md#deleteAllSpineAllowancesPaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances | Delete All SpineAllowances Associated with a PaySpine | +| [**deleteAllowanceGradePaySpine()**](PaySpineApi.md#deleteAllowanceGradePaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Delete AllowanceGrade | +| [**deleteLondonAllowancePaySpine()**](PaySpineApi.md#deleteLondonAllowancePaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Delete LondonAllowance | +| [**deletePaySpine()**](PaySpineApi.md#deletePaySpine) | **DELETE** /employers/{employerId}/payspines/{id} | Delete PaySpine | +| [**deletePaySpineGradePaySpine()**](PaySpineApi.md#deletePaySpineGradePaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Delete PaySpine Grade | +| [**deleteSpinalPointPaySpine()**](PaySpineApi.md#deleteSpinalPointPaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Delete SpinalPoint | +| [**deleteSpineAllowancePaySpine()**](PaySpineApi.md#deleteSpineAllowancePaySpine) | **DELETE** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Delete SpineAllowance | +| [**getAllowanceGradePaySpine()**](PaySpineApi.md#getAllowanceGradePaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Get AllowanceGrade | +| [**getAllowanceGradesPaySpine()**](PaySpineApi.md#getAllowanceGradesPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades | List AllowanceGrades | +| [**getAnnualValueFromSalaryFormulaPaySpine()**](PaySpineApi.md#getAnnualValueFromSalaryFormulaPaySpine) | **GET** /employers/{employerId}/payspines/{id}/annualsalarybypayspines | Get Annual Value from pay spines formula | +| [**getLondonAllowanceListPaySpine()**](PaySpineApi.md#getLondonAllowanceListPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/londonallowances | List LondonAllowances | +| [**getLondonAllowancePaySpine()**](PaySpineApi.md#getLondonAllowancePaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Get LondonAllowance | +| [**getPaySpine()**](PaySpineApi.md#getPaySpine) | **GET** /employers/{employerId}/payspines/{id} | Get PaySpine | +| [**getPaySpineGradeListPaySpine()**](PaySpineApi.md#getPaySpineGradeListPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/paygrades | List PaySpine Grade | +| [**getPaySpineGradePaySpine()**](PaySpineApi.md#getPaySpineGradePaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Get PaySpine Grade | +| [**getSpinalPointListPaySpine()**](PaySpineApi.md#getSpinalPointListPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/spinalpoints | List SpinalPoints | +| [**getSpinalPointPaySpine()**](PaySpineApi.md#getSpinalPointPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Get SpinalPoint | +| [**getSpineAllowanceListPaySpine()**](PaySpineApi.md#getSpineAllowanceListPaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances | List SpineAllowances | +| [**getSpineAllowancePaySpine()**](PaySpineApi.md#getSpineAllowancePaySpine) | **GET** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Get SpineAllowance | +| [**importCsvPaySpine()**](PaySpineApi.md#importCsvPaySpine) | **POST** /employers/{employerId}/payspines/spinalpoints/import | Import SpinalPoints from csv file | +| [**importCsvPaySpinePaySpine()**](PaySpineApi.md#importCsvPaySpinePaySpine) | **POST** /employers/{employerId}/payspines/import | Import PaySpine from csv file | +| [**importPayspineGradeCsvPaySpine()**](PaySpineApi.md#importPayspineGradeCsvPaySpine) | **POST** /employers/{employerId}/payspines/paygrades/import | Import SpineGrades from csv file | +| [**indexPaySpine()**](PaySpineApi.md#indexPaySpine) | **GET** /employers/{employerId}/payspines | List PaySpine | +| [**updateAllowanceGradePaySpine()**](PaySpineApi.md#updateAllowanceGradePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId} | Update AllowanceGrade | +| [**updateLondonAllowancePaySpine()**](PaySpineApi.md#updateLondonAllowancePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId} | Update LondonAllowance | +| [**updateMultipleAllowanceGradesPaySpine()**](PaySpineApi.md#updateMultipleAllowanceGradesPaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/update/bulk | Update Multiple AllowanceGrades | +| [**updateMultiplePaySpine()**](PaySpineApi.md#updateMultiplePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk | Update Multiple SpinalPoints | +| [**updateMultipleSpineAllowancePaySpine()**](PaySpineApi.md#updateMultipleSpineAllowancePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/update/bulk | Update Multiple SpineAllowances | +| [**updatePayGradePaySpine()**](PaySpineApi.md#updatePayGradePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId} | Update PaySpine Grade | +| [**updatePaySpine()**](PaySpineApi.md#updatePaySpine) | **PUT** /employers/{employerId}/payspines/{id} | Update PaySpine | +| [**updateSpinalPointPaySpine()**](PaySpineApi.md#updateSpinalPointPaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId} | Update SpinalPoint | +| [**updateSpineAllowancePaySpine()**](PaySpineApi.md#updateSpineAllowancePaySpine) | **PUT** /employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid} | Update SpineAllowance | + + +## `createAllowanceGradesPaySpine()` + +```php +createAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse +``` + +Create AllowanceGrade + +Create AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Allowance Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay spine for which you want to create Allowance Grade +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to create Allowance Grade +$contractAllowanceGradesRequest = new \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest(); // \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest + +try { + $result = $apiInstance->createAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createAllowanceGradesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Allowance Grade | | +| **paySpineId** | **string**| The Id of the Pay spine for which you want to create Allowance Grade | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to create Allowance Grade | | +| **contractAllowanceGradesRequest** | [**\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest**](../Model/ContractAllowanceGradesRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createLondonAllowancePaySpine()` + +```php +createLondonAllowancePaySpine($employerId, $paySpineId, $contractLondonAllowanceRequest): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse +``` + +Create LondonAllowance + +Create LondonAllowance for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create London Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay spine for which you want to create London Allowance +$contractLondonAllowanceRequest = new \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest(); // \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest + +try { + $result = $apiInstance->createLondonAllowancePaySpine($employerId, $paySpineId, $contractLondonAllowanceRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createLondonAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create London Allowance | | +| **paySpineId** | **string**| The Id of the Pay spine for which you want to create London Allowance | | +| **contractLondonAllowanceRequest** | [**\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest**](../Model/ContractLondonAllowanceRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse**](../Model/ContractLondonAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createMultipleAllowanceGradesPaySpine()` + +```php +createMultipleAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] +``` + +Create Multiple AllowanceGrades + +Create multiple AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create multiple Allowance Grades +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to create multiple Allowance Grades +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to create multiple Allowance Grades +$contractAllowanceGradesRequest = array(new \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest()); // \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[] + +try { + $result = $apiInstance->createMultipleAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createMultipleAllowanceGradesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create multiple Allowance Grades | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to create multiple Allowance Grades | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to create multiple Allowance Grades | | +| **contractAllowanceGradesRequest** | [**\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]**](../Model/ContractAllowanceGradesRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createMultiplePaySpine()` + +```php +createMultiplePaySpine($employerId, $paySpineId, $contractSpinalPointRequest): \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] +``` + +Create Multiple SpinalPoints + +Create multiple SpinalPoints for the specified PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create multiple Spinal Point +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to create multiple Spinal Point +$contractSpinalPointRequest = array(new \SynergiTech\Staffology\Model\ContractSpinalPointRequest()); // \SynergiTech\Staffology\Model\ContractSpinalPointRequest[] + +try { + $result = $apiInstance->createMultiplePaySpine($employerId, $paySpineId, $contractSpinalPointRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createMultiplePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create multiple Spinal Point | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to create multiple Spinal Point | | +| **contractSpinalPointRequest** | [**\SynergiTech\Staffology\Model\ContractSpinalPointRequest[]**](../Model/ContractSpinalPointRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createMultipleSpineAllowancePaySpine()` + +```php +createMultipleSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceRequest): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] +``` + +Create Multiple SpineAllowances + +Creates multiple Spine Allowance for the specified PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create multiple SpineAllowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to create multiple SpineAllowance +$contractSpineAllowanceRequest = array(new \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest()); // \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[] + +try { + $result = $apiInstance->createMultipleSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createMultipleSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create multiple SpineAllowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to create multiple SpineAllowance | | +| **contractSpineAllowanceRequest** | [**\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]**](../Model/ContractSpineAllowanceRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createPaySpine()` + +```php +createPaySpine($employerId, $contractPaySpineRequest): \SynergiTech\Staffology\Model\ContractPaySpineResponse +``` + +Create PaySpine + +Create a new PaySpine for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$contractPaySpineRequest = new \SynergiTech\Staffology\Model\ContractPaySpineRequest(); // \SynergiTech\Staffology\Model\ContractPaySpineRequest + +try { + $result = $apiInstance->createPaySpine($employerId, $contractPaySpineRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractPaySpineRequest** | [**\SynergiTech\Staffology\Model\ContractPaySpineRequest**](../Model/ContractPaySpineRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineResponse**](../Model/ContractPaySpineResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createPaySpineGradePaySpine()` + +```php +createPaySpineGradePaySpine($employerId, $paySpineId, $contractPaySpineGradeRequest): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse +``` + +Create PaySpine Grade + +create PaySpine Grade for an Employer and Payspine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create PaySpine Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay spine for which you want to create PaySpine Grade +$contractPaySpineGradeRequest = new \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest(); // \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest + +try { + $result = $apiInstance->createPaySpineGradePaySpine($employerId, $paySpineId, $contractPaySpineGradeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createPaySpineGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create PaySpine Grade | | +| **paySpineId** | **string**| The Id of the Pay spine for which you want to create PaySpine Grade | | +| **contractPaySpineGradeRequest** | [**\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest**](../Model/ContractPaySpineGradeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse**](../Model/ContractPaySpineGradeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createSpinalPointPaySpine()` + +```php +createSpinalPointPaySpine($employerId, $paySpineId, $contractSpinalPointRequest): \SynergiTech\Staffology\Model\ContractSpinalPointResponse +``` + +Create SpinalPoint + +Create SpinalPoint for an Employer and Payspine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Spinal Point +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay spine for which you want to create Spinal Point +$contractSpinalPointRequest = new \SynergiTech\Staffology\Model\ContractSpinalPointRequest(); // \SynergiTech\Staffology\Model\ContractSpinalPointRequest + +try { + $result = $apiInstance->createSpinalPointPaySpine($employerId, $paySpineId, $contractSpinalPointRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createSpinalPointPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Spinal Point | | +| **paySpineId** | **string**| The Id of the Pay spine for which you want to create Spinal Point | | +| **contractSpinalPointRequest** | [**\SynergiTech\Staffology\Model\ContractSpinalPointRequest**](../Model/ContractSpinalPointRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createSpineAllowancePaySpine()` + +```php +createSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceRequest): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse +``` + +Create SpineAllowance + +Create Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to create Spine Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay spine for which you want to create Spine Allowance +$contractSpineAllowanceRequest = new \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest(); // \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest + +try { + $result = $apiInstance->createSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->createSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to create Spine Allowance | | +| **paySpineId** | **string**| The Id of the Pay spine for which you want to create Spine Allowance | | +| **contractSpineAllowanceRequest** | [**\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest**](../Model/ContractSpineAllowanceRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAllAllowanceGradesPaySpine()` + +```php +deleteAllAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId) +``` + +Delete All AllowanceGrades Associated with a PaySpine + +Delete all AllowanceGrades associated with a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete Allowance Grades +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete Allowance Grades +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to delete Allowance Grades + +try { + $apiInstance->deleteAllAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteAllAllowanceGradesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete Allowance Grades | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete Allowance Grades | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to delete Allowance Grades | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAllSpinalPointsPaySpine()` + +```php +deleteAllSpinalPointsPaySpine($employerId, $paySpineId) +``` + +Delete All SpinalPoints Associated with a PaySpine + +Delete all SpinalPoints associated with the specified PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete Spinal Point List +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete Spinal Point List + +try { + $apiInstance->deleteAllSpinalPointsPaySpine($employerId, $paySpineId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteAllSpinalPointsPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete Spinal Point List | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete Spinal Point List | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAllSpineAllowancesPaySpine()` + +```php +deleteAllSpineAllowancesPaySpine($employerId, $paySpineId) +``` + +Delete All SpineAllowances Associated with a PaySpine + +Delete all Allowances associated with the specified Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete SpineAllowances +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete SpineAllowances + +try { + $apiInstance->deleteAllSpineAllowancesPaySpine($employerId, $paySpineId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteAllSpineAllowancesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete SpineAllowances | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete SpineAllowances | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteAllowanceGradePaySpine()` + +```php +deleteAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId) +``` + +Delete AllowanceGrade + +Delete AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete Allowance Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete Allowance Grade +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to delete Allowance Grade +$allowanceGradeId = 'allowanceGradeId_example'; // string | The Id of the Allowance Grade for which you want to delete Allowance Grade + +try { + $apiInstance->deleteAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteAllowanceGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete Allowance Grade | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete Allowance Grade | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to delete Allowance Grade | | +| **allowanceGradeId** | **string**| The Id of the Allowance Grade for which you want to delete Allowance Grade | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteLondonAllowancePaySpine()` + +```php +deleteLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId) +``` + +Delete LondonAllowance + +Delete the specified London Allowance. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete London Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete London Allowance +$londonAllowanceId = 'londonAllowanceId_example'; // string | The Id of the Spinal Point for which you want to delete London Allowance + +try { + $apiInstance->deleteLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteLondonAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete London Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete London Allowance | | +| **londonAllowanceId** | **string**| The Id of the Spinal Point for which you want to delete London Allowance | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePaySpine()` + +```php +deletePaySpine($employerId, $id) +``` + +Delete PaySpine + +Deletes the specified PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deletePaySpine($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deletePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePaySpineGradePaySpine()` + +```php +deletePaySpineGradePaySpine($employerId, $paySpineId, $payGradeId) +``` + +Delete PaySpine Grade + +Deletes the specified PaySpine Grade. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$paySpineId = 'paySpineId_example'; // string +$payGradeId = 'payGradeId_example'; // string + +try { + $apiInstance->deletePaySpineGradePaySpine($employerId, $paySpineId, $payGradeId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deletePaySpineGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **paySpineId** | **string**| | | +| **payGradeId** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSpinalPointPaySpine()` + +```php +deleteSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId) +``` + +Delete SpinalPoint + +Delete the specified SpinalPoint. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Spinal Point List +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update Spinal Point List +$spinalPointId = 'spinalPointId_example'; // string | The Id of the Spinal Point for which you want to update Spinal Point List + +try { + $apiInstance->deleteSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteSpinalPointPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Spinal Point List | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update Spinal Point List | | +| **spinalPointId** | **string**| The Id of the Spinal Point for which you want to update Spinal Point List | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSpineAllowancePaySpine()` + +```php +deleteSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid) +``` + +Delete SpineAllowance + +Delete Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to delete Spine Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to delete Spine Allowance +$allowanceid = 'allowanceid_example'; // string | The Id of the Spine Allowance for which you want to delete Spine Allowance + +try { + $apiInstance->deleteSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->deleteSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to delete Spine Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to delete Spine Allowance | | +| **allowanceid** | **string**| The Id of the Spine Allowance for which you want to delete Spine Allowance | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAllowanceGradePaySpine()` + +```php +getAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse +``` + +Get AllowanceGrade + +Get AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want Allowance Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want Allowance Grade +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want Allowance Grade +$allowanceGradeId = 'allowanceGradeId_example'; // string | The Id of the Allowance Grade for which you want Allowance Grade + +try { + $result = $apiInstance->getAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getAllowanceGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want Allowance Grade | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want Allowance Grade | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want Allowance Grade | | +| **allowanceGradeId** | **string**| The Id of the Allowance Grade for which you want Allowance Grade | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAllowanceGradesPaySpine()` + +```php +getAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] +``` + +List AllowanceGrades + +List AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of Allowance Grades +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want list of Allowance Grades +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want list of Allowance Grades + +try { + $result = $apiInstance->getAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getAllowanceGradesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of Allowance Grades | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want list of Allowance Grades | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want list of Allowance Grades | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAnnualValueFromSalaryFormulaPaySpine()` + +```php +getAnnualValueFromSalaryFormulaPaySpine($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId): \SynergiTech\Staffology\Model\PaylineCalculationData +``` + +Get Annual Value from pay spines formula + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Employer id. +$id = 'id_example'; // string | The selected PaySpine Id. +$employeeId = 'employeeId_example'; // string | The Employee id. +$paySpineGradeId = 'paySpineGradeId_example'; // string | The selected PaySpineGrade Id. +$spinalPointId = 'spinalPointId_example'; // string | The selected SpinalPoint Id. +$londonAllowanceType = 56; // int | The London Allowance Id of PayLine. +$effectiveFrom = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The PayLine effective from. +$workingPatternId = 'workingPatternId_example'; // string + +try { + $result = $apiInstance->getAnnualValueFromSalaryFormulaPaySpine($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getAnnualValueFromSalaryFormulaPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Employer id. | | +| **id** | **string**| The selected PaySpine Id. | | +| **employeeId** | **string**| The Employee id. | [optional] | +| **paySpineGradeId** | **string**| The selected PaySpineGrade Id. | [optional] | +| **spinalPointId** | **string**| The selected SpinalPoint Id. | [optional] | +| **londonAllowanceType** | **int**| The London Allowance Id of PayLine. | [optional] | +| **effectiveFrom** | **\DateTime**| The PayLine effective from. | [optional] | +| **workingPatternId** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaylineCalculationData**](../Model/PaylineCalculationData.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLondonAllowanceListPaySpine()` + +```php +getLondonAllowanceListPaySpine($employerId, $paySpineId): \SynergiTech\Staffology\Model\LondonAllowance[] +``` + +List LondonAllowances + +List LondonAllowances for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of London Allowances +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want list of London Allowances + +try { + $result = $apiInstance->getLondonAllowanceListPaySpine($employerId, $paySpineId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getLondonAllowanceListPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of London Allowances | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want list of London Allowances | | + +### Return type + +[**\SynergiTech\Staffology\Model\LondonAllowance[]**](../Model/LondonAllowance.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLondonAllowancePaySpine()` + +```php +getLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse +``` + +Get LondonAllowance + +Get LondonAllowance for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get London Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to get London Allowance +$londonAllowanceId = 'londonAllowanceId_example'; // string | The Id of the London Allowance for which you want to get London Allowance + +try { + $result = $apiInstance->getLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getLondonAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get London Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to get London Allowance | | +| **londonAllowanceId** | **string**| The Id of the London Allowance for which you want to get London Allowance | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse**](../Model/ContractLondonAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPaySpine()` + +```php +getPaySpine($employerId, $id): \SynergiTech\Staffology\Model\ContractPaySpineResponse +``` + +Get PaySpine + +Gets the PaySpine specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PaySpine belongs. +$id = 'id_example'; // string | The Id of the PaySpine which you want to fetch + +try { + $result = $apiInstance->getPaySpine($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PaySpine belongs. | | +| **id** | **string**| The Id of the PaySpine which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineResponse**](../Model/ContractPaySpineResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPaySpineGradeListPaySpine()` + +```php +getPaySpineGradeListPaySpine($employerId, $paySpineId): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[] +``` + +List PaySpine Grade + +Lists PaySpine Grade for an Employer and PaySpine Grade. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want PaySpine Grade List +$paySpineId = 'paySpineId_example'; // string | The Id of the PaySpine Grade for which you want PaySpine Grade List + +try { + $result = $apiInstance->getPaySpineGradeListPaySpine($employerId, $paySpineId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getPaySpineGradeListPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want PaySpine Grade List | | +| **paySpineId** | **string**| The Id of the PaySpine Grade for which you want PaySpine Grade List | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]**](../Model/ContractPaySpineGradeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPaySpineGradePaySpine()` + +```php +getPaySpineGradePaySpine($employerId, $paySpineId, $payGradeId): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse +``` + +Get PaySpine Grade + +PaySpine Grade for an Employer and Payspine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want PaySpine Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want PaySpine Grade +$payGradeId = 'payGradeId_example'; // string | The Id of the PaySpine Grade for which you want PaySpine Grade + +try { + $result = $apiInstance->getPaySpineGradePaySpine($employerId, $paySpineId, $payGradeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getPaySpineGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want PaySpine Grade | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want PaySpine Grade | | +| **payGradeId** | **string**| The Id of the PaySpine Grade for which you want PaySpine Grade | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse**](../Model/ContractPaySpineGradeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSpinalPointListPaySpine()` + +```php +getSpinalPointListPaySpine($employerId, $paySpineId): \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] +``` + +List SpinalPoints + +List SpinalPoints for an Employer and Payspine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want Spinal Point List +$paySpineId = 'paySpineId_example'; // string | The Id of the Spinal Point for which you want Spinal Point List + +try { + $result = $apiInstance->getSpinalPointListPaySpine($employerId, $paySpineId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getSpinalPointListPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want Spinal Point List | | +| **paySpineId** | **string**| The Id of the Spinal Point for which you want Spinal Point List | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSpinalPointPaySpine()` + +```php +getSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId): \SynergiTech\Staffology\Model\ContractSpinalPointResponse +``` + +Get SpinalPoint + +Get SpinalPoint for an Employer and Payspine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want Spinal Point +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want Spinal Point +$spinalPointId = 'spinalPointId_example'; // string | The Id of the Spinal Point for which you want Spinal Point + +try { + $result = $apiInstance->getSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getSpinalPointPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want Spinal Point | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want Spinal Point | | +| **spinalPointId** | **string**| The Id of the Spinal Point for which you want Spinal Point | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSpineAllowanceListPaySpine()` + +```php +getSpineAllowanceListPaySpine($employerId, $paySpineId): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] +``` + +List SpineAllowances + +List Spine Allowances for a Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want list of Spine Allowances +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want list of Spine Allowances + +try { + $result = $apiInstance->getSpineAllowanceListPaySpine($employerId, $paySpineId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getSpineAllowanceListPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want list of Spine Allowances | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want list of Spine Allowances | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSpineAllowancePaySpine()` + +```php +getSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse +``` + +Get SpineAllowance + +Get Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get Spine Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to get Spine Allowance +$allowanceid = 'allowanceid_example'; // string | The Id of the Spine Allowance for which you want to get Spine Allowance + +try { + $result = $apiInstance->getSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->getSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get Spine Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to get Spine Allowance | | +| **allowanceid** | **string**| The Id of the Spine Allowance for which you want to get Spine Allowance | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importCsvPaySpine()` + +```php +importCsvPaySpine($employerId, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import SpinalPoints from csv file + +Import SpinalPoints from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importCsvPaySpine($employerId, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->importCsvPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importCsvPaySpinePaySpine()` + +```php +importCsvPaySpinePaySpine($employerId, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import PaySpine from csv file + +Import PaySpine from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importCsvPaySpinePaySpine($employerId, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->importCsvPaySpinePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importPayspineGradeCsvPaySpine()` + +```php +importPayspineGradeCsvPaySpine($employerId, $file): \SynergiTech\Staffology\Model\Item[] +``` + +Import SpineGrades from csv file + +Import Spine Grades from a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->importPayspineGradeCsvPaySpine($employerId, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->importPayspineGradeCsvPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPaySpine()` + +```php +indexPaySpine($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List PaySpine + +Lists all PaySpine for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list PaySpine + +try { + $result = $apiInstance->indexPaySpine($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->indexPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list PaySpine | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateAllowanceGradePaySpine()` + +```php +updateAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse +``` + +Update AllowanceGrade + +Update AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Allowance Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update Allowance Grade +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to update Allowance Grade +$allowanceGradeId = 'allowanceGradeId_example'; // string | The Id of the Allowance Grade for which you want to update Allowance Grade +$contractAllowanceGradesRequest = new \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest(); // \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest + +try { + $result = $apiInstance->updateAllowanceGradePaySpine($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateAllowanceGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Allowance Grade | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update Allowance Grade | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to update Allowance Grade | | +| **allowanceGradeId** | **string**| The Id of the Allowance Grade for which you want to update Allowance Grade | | +| **contractAllowanceGradesRequest** | [**\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest**](../Model/ContractAllowanceGradesRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLondonAllowancePaySpine()` + +```php +updateLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse +``` + +Update LondonAllowance + +Update LondonAllowance for the Employer and PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update London Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update London Allowance +$londonAllowanceId = 'londonAllowanceId_example'; // string | The Id of the London Allowance for which you want to update London Allowance +$contractLondonAllowanceRequest = new \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest(); // \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest + +try { + $result = $apiInstance->updateLondonAllowancePaySpine($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateLondonAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update London Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update London Allowance | | +| **londonAllowanceId** | **string**| The Id of the London Allowance for which you want to update London Allowance | | +| **contractLondonAllowanceRequest** | [**\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest**](../Model/ContractLondonAllowanceRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse**](../Model/ContractLondonAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMultipleAllowanceGradesPaySpine()` + +```php +updateMultipleAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] +``` + +Update Multiple AllowanceGrades + +Update multiple AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update multiple Allowance Grades +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update multiple Allowance Grades +$allowanceId = 'allowanceId_example'; // string | The Id of the Spine Allowance for which you want to update multiple Allowance Grades +$contractAllowanceGradesUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest()); // \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[] + +try { + $result = $apiInstance->updateMultipleAllowanceGradesPaySpine($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateMultipleAllowanceGradesPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update multiple Allowance Grades | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update multiple Allowance Grades | | +| **allowanceId** | **string**| The Id of the Spine Allowance for which you want to update multiple Allowance Grades | | +| **contractAllowanceGradesUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]**](../Model/ContractAllowanceGradesUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]**](../Model/ContractAllowanceGradesResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMultiplePaySpine()` + +```php +updateMultiplePaySpine($employerId, $paySpineId, $contractSpinalPointUpdateRequest): \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] +``` + +Update Multiple SpinalPoints + +Update an array of SpinalPoints for the specified PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update multiple Spinal Point +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update multiple Spinal Point +$contractSpinalPointUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest()); // \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[] + +try { + $result = $apiInstance->updateMultiplePaySpine($employerId, $paySpineId, $contractSpinalPointUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateMultiplePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update multiple Spinal Point | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update multiple Spinal Point | | +| **contractSpinalPointUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]**](../Model/ContractSpinalPointUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMultipleSpineAllowancePaySpine()` + +```php +updateMultipleSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] +``` + +Update Multiple SpineAllowances + +Updates an array of Spine Allowance for the specified PaySpine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update multiple SpineAllowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update multiple SpineAllowance +$contractSpineAllowanceUpdateRequest = array(new \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest()); // \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[] + +try { + $result = $apiInstance->updateMultipleSpineAllowancePaySpine($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateMultipleSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update multiple SpineAllowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update multiple SpineAllowance | | +| **contractSpineAllowanceUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]**](../Model/ContractSpineAllowanceUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayGradePaySpine()` + +```php +updatePayGradePaySpine($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse +``` + +Update PaySpine Grade + +Updates a PaySpine Grade for the Employer and PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update PaySpine Grade +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update PaySpine Grade +$payGradeId = 'payGradeId_example'; // string | The Id of the PaySpine Grade for which you want to update PaySpine Grade +$contractPaySpineGradeRequest = new \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest(); // \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest + +try { + $result = $apiInstance->updatePayGradePaySpine($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updatePayGradePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update PaySpine Grade | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update PaySpine Grade | | +| **payGradeId** | **string**| The Id of the PaySpine Grade for which you want to update PaySpine Grade | | +| **contractPaySpineGradeRequest** | [**\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest**](../Model/ContractPaySpineGradeRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse**](../Model/ContractPaySpineGradeResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePaySpine()` + +```php +updatePaySpine($employerId, $id, $contractPaySpineUpdateRequest): \SynergiTech\Staffology\Model\ContractPaySpineResponse +``` + +Update PaySpine + +Updates a PaySpine for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$contractPaySpineUpdateRequest = new \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest(); // \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest + +try { + $result = $apiInstance->updatePaySpine($employerId, $id, $contractPaySpineUpdateRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updatePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **contractPaySpineUpdateRequest** | [**\SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest**](../Model/ContractPaySpineUpdateRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPaySpineResponse**](../Model/ContractPaySpineResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSpinalPointPaySpine()` + +```php +updateSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest): \SynergiTech\Staffology\Model\ContractSpinalPointResponse +``` + +Update SpinalPoint + +Update SpinalPoint for the Employer and PaySpine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Spinal Point +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update Spinal Point +$spinalPointId = 'spinalPointId_example'; // string | The Id of the Spinal Point for which you want to update Spinal Point +$contractSpinalPointRequest = new \SynergiTech\Staffology\Model\ContractSpinalPointRequest(); // \SynergiTech\Staffology\Model\ContractSpinalPointRequest + +try { + $result = $apiInstance->updateSpinalPointPaySpine($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateSpinalPointPaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Spinal Point | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update Spinal Point | | +| **spinalPointId** | **string**| The Id of the Spinal Point for which you want to update Spinal Point | | +| **contractSpinalPointRequest** | [**\SynergiTech\Staffology\Model\ContractSpinalPointRequest**](../Model/ContractSpinalPointRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpinalPointResponse**](../Model/ContractSpinalPointResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSpineAllowancePaySpine()` + +```php +updateSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse +``` + +Update SpineAllowance + +Update Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used] + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PaySpineApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to update Spine Allowance +$paySpineId = 'paySpineId_example'; // string | The Id of the Pay Spine for which you want to update Spine Allowance +$allowanceid = 'allowanceid_example'; // string | The Id of the Spine Allowance for which you want to update Spine Allowance +$contractSpineAllowanceRequest = new \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest(); // \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest + +try { + $result = $apiInstance->updateSpineAllowancePaySpine($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PaySpineApi->updateSpineAllowancePaySpine: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to update Spine Allowance | | +| **paySpineId** | **string**| The Id of the Pay Spine for which you want to update Spine Allowance | | +| **allowanceid** | **string**| The Id of the Spine Allowance for which you want to update Spine Allowance | | +| **contractSpineAllowanceRequest** | [**\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest**](../Model/ContractSpineAllowanceRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse**](../Model/ContractSpineAllowanceResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PayeeApi.md b/docs/Api/PayeeApi.md new file mode 100644 index 0000000..0056659 --- /dev/null +++ b/docs/Api/PayeeApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\PayeeApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPayee()**](PayeeApi.md#createPayee) | **POST** /employers/{employerId}/payees | Create Payee | +| [**deletePayee()**](PayeeApi.md#deletePayee) | **DELETE** /employers/{employerId}/payees/{id} | Delete Payee | +| [**getPayee()**](PayeeApi.md#getPayee) | **GET** /employers/{employerId}/payees/{id} | Get Payee | +| [**indexPayee()**](PayeeApi.md#indexPayee) | **GET** /employers/{employerId}/payees | List Payees | +| [**updatePayee()**](PayeeApi.md#updatePayee) | **PUT** /employers/{employerId}/payees/{id} | Update Payee | + + +## `createPayee()` + +```php +createPayee($employerId, $payee): \SynergiTech\Staffology\Model\Payee +``` + +Create Payee + +Creates a new Payee for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payee = new \SynergiTech\Staffology\Model\Payee(); // \SynergiTech\Staffology\Model\Payee + +try { + $result = $apiInstance->createPayee($employerId, $payee); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayeeApi->createPayee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payee** | [**\SynergiTech\Staffology\Model\Payee**](../Model/Payee.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Payee**](../Model/Payee.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayee()` + +```php +deletePayee($employerId, $id) +``` + +Delete Payee + +Deletes the specified Payee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deletePayee($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling PayeeApi->deletePayee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayee()` + +```php +getPayee($employerId, $id): \SynergiTech\Staffology\Model\Payee +``` + +Get Payee + +Gets the Payee specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Payee belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->getPayee($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayeeApi->getPayee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Payee belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Payee**](../Model/Payee.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPayee()` + +```php +indexPayee($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Payees + +Lists all Payees for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Payees + +try { + $result = $apiInstance->indexPayee($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayeeApi->indexPayee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Payees | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayee()` + +```php +updatePayee($employerId, $id, $payee): \SynergiTech\Staffology\Model\Payee +``` + +Update Payee + +Updates a Payee for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PayeeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$payee = new \SynergiTech\Staffology\Model\Payee(); // \SynergiTech\Staffology\Model\Payee + +try { + $result = $apiInstance->updatePayee($employerId, $id, $payee); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PayeeApi->updatePayee: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **payee** | [**\SynergiTech\Staffology\Model\Payee**](../Model/Payee.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Payee**](../Model/Payee.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PensionApi.md b/docs/Api/PensionApi.md new file mode 100644 index 0000000..54dff93 --- /dev/null +++ b/docs/Api/PensionApi.md @@ -0,0 +1,606 @@ +# SynergiTech\Staffology\PensionApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPension()**](PensionApi.md#createPension) | **POST** /employers/{employerId}/employees/{employeeId}/pension | Create Pension | +| [**getDeprecatedPension()**](PensionApi.md#getDeprecatedPension) | **GET** /employers/{employerId}/employees/{employeeId}/pension | Get Pension (deprecated) | +| [**getPension()**](PensionApi.md#getPension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/{id} | Get Pension | +| [**lastPayRunEntryWithPensionYtdValuesForEmployeePension()**](PensionApi.md#lastPayRunEntryWithPensionYtdValuesForEmployeePension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/{pensionUniqueId}/{taxYear}/pensionytd | Get last PayRunEntry for a Pension (deprecated) | +| [**listPension()**](PensionApi.md#listPension) | **GET** /employers/{employerId}/employees/{employeeId}/pension/list | List Pensions | +| [**removeDeprecatedPension()**](PensionApi.md#removeDeprecatedPension) | **DELETE** /employers/{employerId}/employees/{employeeId}/pension | Remove Pension (deprecated) | +| [**removePension()**](PensionApi.md#removePension) | **DELETE** /employers/{employerId}/employees/{employeeId}/pension/{id} | Remove Pension | +| [**updateDeprecatedPension()**](PensionApi.md#updateDeprecatedPension) | **PUT** /employers/{employerId}/employees/{employeeId}/pension | Update Pension (deprecated) | +| [**updatePension()**](PensionApi.md#updatePension) | **PUT** /employers/{employerId}/employees/{employeeId}/pension/{id} | Update Pension | + + +## `createPension()` + +```php +createPension($employerId, $employeeId, $pension): \SynergiTech\Staffology\Model\Pension +``` + +Create Pension + +Creates a Pension for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to create a Pension +$pension = new \SynergiTech\Staffology\Model\Pension(); // \SynergiTech\Staffology\Model\Pension + +try { + $result = $apiInstance->createPension($employerId, $employeeId, $pension); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->createPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to create a Pension | | +| **pension** | [**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDeprecatedPension()` + +```php +getDeprecatedPension($employerId, $employeeId): \SynergiTech\Staffology\Model\Pension +``` + +Get Pension (deprecated) + +This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified. Until it is removed, this endpoint will work only for employees with a single pension Returns the Pension, if any, for an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve the Pension + +try { + $result = $apiInstance->getDeprecatedPension($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->getDeprecatedPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve the Pension | | + +### Return type + +[**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPension()` + +```php +getPension($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\Pension +``` + +Get Pension + +Returns a Pension for an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to retrieve the Pension +$id = 'id_example'; // string | The Id of the Pension + +try { + $result = $apiInstance->getPension($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->getPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to retrieve the Pension | | +| **id** | **string**| The Id of the Pension | | + +### Return type + +[**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `lastPayRunEntryWithPensionYtdValuesForEmployeePension()` + +```php +lastPayRunEntryWithPensionYtdValuesForEmployeePension($employerId, $employeeId, $pensionUniqueId, $taxYear): \SynergiTech\Staffology\Model\PayRunEntry +``` + +Get last PayRunEntry for a Pension (deprecated) + +This endpoint is now deprecated. You should use the alternative GET end point from PayRun Gets a last PayRunEntry for a Pension. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want to get pay run entry for +$pensionUniqueId = 'pensionUniqueId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear + +try { + $result = $apiInstance->lastPayRunEntryWithPensionYtdValuesForEmployeePension($employerId, $employeeId, $pensionUniqueId, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->lastPayRunEntryWithPensionYtdValuesForEmployeePension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee you want to get pay run entry for | | +| **pensionUniqueId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunEntry**](../Model/PayRunEntry.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listPension()` + +```php +listPension($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Pensions + +Returns a list of Item representing any Pensions for the given employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to list Pensions + +try { + $result = $apiInstance->listPension($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->listPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to list Pensions | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removeDeprecatedPension()` + +```php +removeDeprecatedPension($employerId, $employeeId) +``` + +Remove Pension (deprecated) + +This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified. Until it is removed, this endpoint will work only for employees with a single pension Removes the Pension for an Employee. For AE Pensions this will remove the employee from the pension and delete any associated AeAssessments + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to remove the Pension + +try { + $apiInstance->removeDeprecatedPension($employerId, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->removeDeprecatedPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to remove the Pension | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removePension()` + +```php +removePension($employerId, $employeeId, $id) +``` + +Remove Pension + +Removes a Pension for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to remove the Pension +$id = 'id_example'; // string | The Id of the Pension + +try { + $apiInstance->removePension($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->removePension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to remove the Pension | | +| **id** | **string**| The Id of the Pension | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDeprecatedPension()` + +```php +updateDeprecatedPension($employerId, $employeeId, $pension): \SynergiTech\Staffology\Model\Pension +``` + +Update Pension (deprecated) + +This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified. Until it is removed, this endpoint will work only for employees with a single pension Updates the Pension for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update the Pension +$pension = new \SynergiTech\Staffology\Model\Pension(); // \SynergiTech\Staffology\Model\Pension + +try { + $result = $apiInstance->updateDeprecatedPension($employerId, $employeeId, $pension); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->updateDeprecatedPension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update the Pension | | +| **pension** | [**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePension()` + +```php +updatePension($employerId, $employeeId, $id, $pension): \SynergiTech\Staffology\Model\Pension +``` + +Update Pension + +Updates the Pension for an Employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Employee belongs +$employeeId = 'employeeId_example'; // string | The Id of the Employee for which you want to update the Pension +$id = 'id_example'; // string | The Id of the Pension +$pension = new \SynergiTech\Staffology\Model\Pension(); // \SynergiTech\Staffology\Model\Pension + +try { + $result = $apiInstance->updatePension($employerId, $employeeId, $id, $pension); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionApi->updatePension: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Employee belongs | | +| **employeeId** | **string**| The Id of the Employee for which you want to update the Pension | | +| **id** | **string**| The Id of the Pension | | +| **pension** | [**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Pension**](../Model/Pension.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PensionRefundApi.md b/docs/Api/PensionRefundApi.md new file mode 100644 index 0000000..cb46903 --- /dev/null +++ b/docs/Api/PensionRefundApi.md @@ -0,0 +1,470 @@ +# SynergiTech\Staffology\PensionRefundApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPensionRefund()**](PensionRefundApi.md#createPensionRefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund | Create Pension Refund | +| [**deletePensionRefund()**](PensionRefundApi.md#deletePensionRefund) | **DELETE** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Delete Pension Refund | +| [**getPensionRefund()**](PensionRefundApi.md#getPensionRefund) | **GET** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Get Pension Refund | +| [**indexPensionRefund()**](PensionRefundApi.md#indexPensionRefund) | **GET** /employers/{employerId}/employees/{employeeId}/pensionrefund | List Pension Refunds | +| [**issueRefundForCurrentPensionSchemePensionRefund()**](PensionRefundApi.md#issueRefundForCurrentPensionSchemePensionRefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund/autocalculated | Issue Pension Refund (deprecated) | +| [**issueRefundForPensionPensionRefund()**](PensionRefundApi.md#issueRefundForPensionPensionRefund) | **POST** /employers/{employerId}/employees/{employeeId}/pensionrefund/{pensionId}/autocalculated | Issue Pension Refund | +| [**updatePensionRefund()**](PensionRefundApi.md#updatePensionRefund) | **PUT** /employers/{employerId}/employees/{employeeId}/pensionrefund/{id} | Update Pension Refund | + + +## `createPensionRefund()` + +```php +createPensionRefund($employerId, $employeeId, $pensionRefund) +``` + +Create Pension Refund + +Creates a Pension Refund for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$pensionRefund = new \SynergiTech\Staffology\Model\PensionRefund(); // \SynergiTech\Staffology\Model\PensionRefund + +try { + $apiInstance->createPensionRefund($employerId, $employeeId, $pensionRefund); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->createPensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **pensionRefund** | [**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePensionRefund()` + +```php +deletePensionRefund($employerId, $employeeId, $id) +``` + +Delete Pension Refund + +Deletes the Pension Refund specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Pension Refund you want to delete. + +try { + $apiInstance->deletePensionRefund($employerId, $employeeId, $id); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->deletePensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Pension Refund you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPensionRefund()` + +```php +getPensionRefund($employerId, $employeeId, $id): \SynergiTech\Staffology\Model\PensionRefund +``` + +Get Pension Refund + +Gets the Pension Refund specified by the Id for the Employee specified by the EmployeeId + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Pension Refund you want to retrieve. + +try { + $result = $apiInstance->getPensionRefund($employerId, $employeeId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->getPensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Pension Refund you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPensionRefund()` + +```php +indexPensionRefund($employerId, $employeeId): \SynergiTech\Staffology\Model\Item[] +``` + +List Pension Refunds + +Lists all Pension Refunds for the Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->indexPensionRefund($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->indexPensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `issueRefundForCurrentPensionSchemePensionRefund()` + +```php +issueRefundForCurrentPensionSchemePensionRefund($employerId, $employeeId): \SynergiTech\Staffology\Model\PensionRefund +``` + +Issue Pension Refund (deprecated) + +Creates a pension refund for full contribution amount for the current tax year for the current pensionScheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string + +try { + $result = $apiInstance->issueRefundForCurrentPensionSchemePensionRefund($employerId, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->issueRefundForCurrentPensionSchemePensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `issueRefundForPensionPensionRefund()` + +```php +issueRefundForPensionPensionRefund($employerId, $employeeId, $pensionId): \SynergiTech\Staffology\Model\PensionRefund +``` + +Issue Pension Refund + +Creates a pension refund for full contribution amount for the current tax year for the current pension + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$pensionId = 'pensionId_example'; // string | The Id of the pension for which you want to issue a refund. + +try { + $result = $apiInstance->issueRefundForPensionPensionRefund($employerId, $employeeId, $pensionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->issueRefundForPensionPensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **pensionId** | **string**| The Id of the pension for which you want to issue a refund. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePensionRefund()` + +```php +updatePensionRefund($employerId, $employeeId, $id, $pensionRefund): \SynergiTech\Staffology\Model\PensionRefund +``` + +Update Pension Refund + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionRefundApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The Id of the Pension Refund you want to update. +$pensionRefund = new \SynergiTech\Staffology\Model\PensionRefund(); // \SynergiTech\Staffology\Model\PensionRefund + +try { + $result = $apiInstance->updatePensionRefund($employerId, $employeeId, $id, $pensionRefund); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionRefundApi->updatePensionRefund: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | | +| **id** | **string**| The Id of the Pension Refund you want to update. | | +| **pensionRefund** | [**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionRefund**](../Model/PensionRefund.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PensionSchemeApi.md b/docs/Api/PensionSchemeApi.md new file mode 100644 index 0000000..7cde992 --- /dev/null +++ b/docs/Api/PensionSchemeApi.md @@ -0,0 +1,732 @@ +# SynergiTech\Staffology\PensionSchemeApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**contributionsForPayrunPensionScheme()**](PensionSchemeApi.md#contributionsForPayrunPensionScheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber} | Contributions for Payrun | +| [**contributionsPensionScheme()**](PensionSchemeApi.md#contributionsPensionScheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId} | Contributions Data | +| [**createPensionScheme()**](PensionSchemeApi.md#createPensionScheme) | **POST** /employers/{employerId}/pensionschemes | Create a PensionScheme | +| [**deletePensionScheme()**](PensionSchemeApi.md#deletePensionScheme) | **DELETE** /employers/{employerId}/pensionschemes/{id} | Delete a PensionScheme | +| [**employeesPensionScheme()**](PensionSchemeApi.md#employeesPensionScheme) | **GET** /employers/{employerId}/pensionschemes/{id}/employees | Get Employees | +| [**getPensionScheme()**](PensionSchemeApi.md#getPensionScheme) | **GET** /employers/{employerId}/pensionschemes/{id} | Get a PensionScheme | +| [**indexPensionScheme()**](PensionSchemeApi.md#indexPensionScheme) | **GET** /employers/{employerId}/pensionschemes | List PensionSchemes | +| [**listContributionsPensionScheme()**](PensionSchemeApi.md#listContributionsPensionScheme) | **GET** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear} | List Contributions | +| [**markAsSentPensionScheme()**](PensionSchemeApi.md#markAsSentPensionScheme) | **POST** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}/markassent | Mark as Sent | +| [**resubmitContributionsPensionScheme()**](PensionSchemeApi.md#resubmitContributionsPensionScheme) | **POST** /employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId} | Re-submit Contributions | +| [**updatePensionScheme()**](PensionSchemeApi.md#updatePensionScheme) | **PUT** /employers/{employerId}/pensionschemes/{id} | Update a PensionScheme | + + +## `contributionsForPayrunPensionScheme()` + +```php +contributionsForPayrunPensionScheme($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal): \SynergiTech\Staffology\Model\PensionContributionsSubmission +``` + +Contributions for Payrun + +Returns contributions for a specific scheme and payrun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear to query +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$ordinal = 1; // int + +try { + $result = $apiInstance->contributionsForPayrunPensionScheme($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->contributionsForPayrunPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear to query | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionContributionsSubmission**](../Model/PensionContributionsSubmission.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `contributionsPensionScheme()` + +```php +contributionsPensionScheme($employerId, $id, $taxYear, $submissionId): \SynergiTech\Staffology\Model\ExternalProviderConversation +``` + +Contributions Data + +Returns an ExternalProviderConversation showing data sent to and received from the ExternalDataProvider for the pension contribution submission. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear of the submission +$submissionId = 'submissionId_example'; // string | The Id of the Submission. + +try { + $result = $apiInstance->contributionsPensionScheme($employerId, $id, $taxYear, $submissionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->contributionsPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear of the submission | | +| **submissionId** | **string**| The Id of the Submission. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalProviderConversation**](../Model/ExternalProviderConversation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createPensionScheme()` + +```php +createPensionScheme($employerId, $pensionScheme): \SynergiTech\Staffology\Model\PensionScheme +``` + +Create a PensionScheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$pensionScheme = new \SynergiTech\Staffology\Model\PensionScheme(); // \SynergiTech\Staffology\Model\PensionScheme + +try { + $result = $apiInstance->createPensionScheme($employerId, $pensionScheme); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->createPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **pensionScheme** | [**\SynergiTech\Staffology\Model\PensionScheme**](../Model/PensionScheme.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionScheme**](../Model/PensionScheme.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePensionScheme()` + +```php +deletePensionScheme($employerId, $id) +``` + +Delete a PensionScheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deletePensionScheme($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->deletePensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeesPensionScheme()` + +```php +employeesPensionScheme($employerId, $id): \SynergiTech\Staffology\Model\Item[] +``` + +Get Employees + +Returns the employees that are enrolled in the specified scheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme you want to retrieve Employees for. + +try { + $result = $apiInstance->employeesPensionScheme($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->employeesPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme you want to retrieve Employees for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPensionScheme()` + +```php +getPensionScheme($employerId, $id): \SynergiTech\Staffology\Model\PensionScheme +``` + +Get a PensionScheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme you want to retrieve. + +try { + $result = $apiInstance->getPensionScheme($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->getPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionScheme**](../Model/PensionScheme.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexPensionScheme()` + +```php +indexPensionScheme($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List PensionSchemes + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list PensionSchemes + +try { + $result = $apiInstance->indexPensionScheme($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->indexPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list PensionSchemes | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listContributionsPensionScheme()` + +```php +listContributionsPensionScheme($employerId, $id, $taxYear): \SynergiTech\Staffology\Model\Item[] +``` + +List Contributions + +Returns a list of Items that tell you which PayRuns contain contributions to this scheme and the Url to the relevant report. IF the scheme is connected to an ExternalDataProvider then the status of the submission will also be included. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear to query + +try { + $result = $apiInstance->listContributionsPensionScheme($employerId, $id, $taxYear); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->listContributionsPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear to query | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `markAsSentPensionScheme()` + +```php +markAsSentPensionScheme($employerId, $id, $taxYear, $submissionId): \SynergiTech\Staffology\Model\ExternalProviderConversation +``` + +Mark as Sent + +Marks the Pension Contributions as sent + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear of the submission +$submissionId = 'submissionId_example'; // string | The Id of the Submission. + +try { + $result = $apiInstance->markAsSentPensionScheme($employerId, $id, $taxYear, $submissionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->markAsSentPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear of the submission | | +| **submissionId** | **string**| The Id of the Submission. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ExternalProviderConversation**](../Model/ExternalProviderConversation.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `resubmitContributionsPensionScheme()` + +```php +resubmitContributionsPensionScheme($employerId, $id, $taxYear, $submissionId) +``` + +Re-submit Contributions + +Re-submits previously failed Contributions to a Pension Scheme. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the PensionScheme belongs. +$id = 'id_example'; // string | The Id of the PensionScheme. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear of the submission +$submissionId = 'submissionId_example'; // string | The Id of the Submission to re-submit. + +try { + $apiInstance->resubmitContributionsPensionScheme($employerId, $id, $taxYear, $submissionId); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->resubmitContributionsPensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the PensionScheme belongs. | | +| **id** | **string**| The Id of the PensionScheme. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear of the submission | | +| **submissionId** | **string**| The Id of the Submission to re-submit. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePensionScheme()` + +```php +updatePensionScheme($employerId, $id, $pensionScheme): \SynergiTech\Staffology\Model\PensionScheme +``` + +Update a PensionScheme + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\PensionSchemeApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$pensionScheme = new \SynergiTech\Staffology\Model\PensionScheme(); // \SynergiTech\Staffology\Model\PensionScheme + +try { + $result = $apiInstance->updatePensionScheme($employerId, $id, $pensionScheme); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PensionSchemeApi->updatePensionScheme: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **pensionScheme** | [**\SynergiTech\Staffology\Model\PensionScheme**](../Model/PensionScheme.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionScheme**](../Model/PensionScheme.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ProcessingNoteApi.md b/docs/Api/ProcessingNoteApi.md new file mode 100644 index 0000000..8b0b927 --- /dev/null +++ b/docs/Api/ProcessingNoteApi.md @@ -0,0 +1,496 @@ +# SynergiTech\Staffology\ProcessingNoteApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addDocumentProcessingNote()**](ProcessingNoteApi.md#addDocumentProcessingNote) | **POST** /employers/{employerId}/payrun/{id}/documents | Add Document | +| [**createProcessingNote()**](ProcessingNoteApi.md#createProcessingNote) | **POST** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes | Create ProcessingNote | +| [**deleteDocumentProcessingNote()**](ProcessingNoteApi.md#deleteDocumentProcessingNote) | **DELETE** /employers/{employerId}/payrun/{id}/documents/{documentId} | Delete ProcessingNote Document | +| [**getDocumentProcessingNote()**](ProcessingNoteApi.md#getDocumentProcessingNote) | **GET** /employers/{employerId}/payrun/{id}/documents/{documentId} | Get ProcessingNote Document | +| [**getProcessingNote()**](ProcessingNoteApi.md#getProcessingNote) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id} | Get a ProcessingNote | +| [**listProcessingNote()**](ProcessingNoteApi.md#listProcessingNote) | **GET** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes | List ProcessingNotes for a PayRun | +| [**setStatusProcessingNote()**](ProcessingNoteApi.md#setStatusProcessingNote) | **PUT** /employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}/status | Set a ProcessingNote status | + + +## `addDocumentProcessingNote()` + +```php +addDocumentProcessingNote($employerId, $id, $file) +``` + +Add Document + +Adds document to the ProcessingNote + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string | The Id of the ProcessingNote you want to attach documents to +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $apiInstance->addDocumentProcessingNote($employerId, $id, $file); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->addDocumentProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| The Id of the ProcessingNote you want to attach documents to | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createProcessingNote()` + +```php +createProcessingNote($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote): \SynergiTech\Staffology\Model\ProcessingNote +``` + +Create ProcessingNote + +Creates a Processing Note for the PayRun. You must have Bureau Features enabled and the payrun must be editable. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$ordinal = 1; // int +$processingNote = new \SynergiTech\Staffology\Model\ProcessingNote(); // \SynergiTech\Staffology\Model\ProcessingNote + +try { + $result = $apiInstance->createProcessingNote($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->createProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **processingNote** | [**\SynergiTech\Staffology\Model\ProcessingNote**](../Model/ProcessingNote.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ProcessingNote**](../Model/ProcessingNote.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocumentProcessingNote()` + +```php +deleteDocumentProcessingNote($employerId, $id, $documentId) +``` + +Delete ProcessingNote Document + +Deletes the document specified by the documentId for the ProcessingNote specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to delete. + +try { + $apiInstance->deleteDocumentProcessingNote($employerId, $id, $documentId); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->deleteDocumentProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentProcessingNote()` + +```php +getDocumentProcessingNote($employerId, $id, $documentId): \SplFileObject +``` + +Get ProcessingNote Document + +Gets the document specified by the documentId for the ProcessingNote specified by the Id + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$documentId = 'documentId_example'; // string | The Id of the Document you want to retrieve. + +try { + $result = $apiInstance->getDocumentProcessingNote($employerId, $id, $documentId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->getDocumentProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **documentId** | **string**| The Id of the Document you want to retrieve. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProcessingNote()` + +```php +getProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal): \SynergiTech\Staffology\Model\ProcessingNote +``` + +Get a ProcessingNote + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->getProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->getProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\ProcessingNote**](../Model/ProcessingNote.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listProcessingNote()` + +```php +listProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId): \SynergiTech\Staffology\Model\Item[] +``` + +List ProcessingNotes for a PayRun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 1; // int +$payrunEntryId = 'payrunEntryId_example'; // string | Optionally filter ProcessingNotes to just those for the specified PayRunEntry + +try { + $result = $apiInstance->listProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->listProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **payrunEntryId** | **string**| Optionally filter ProcessingNotes to just those for the specified PayRunEntry | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setStatusProcessingNote()` + +```php +setStatusProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body): \SynergiTech\Staffology\Model\ProcessingNote +``` + +Set a ProcessingNote status + +Set a ProcessingNote status. You must have Bureau Features enabled and the payrun must be editable. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ProcessingNoteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string +$ordinal = 1; // int +$body = 'body_example'; // string + +try { + $result = $apiInstance->setStatusProcessingNote($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProcessingNoteApi->setStatusProcessingNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **body** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ProcessingNote**](../Model/ProcessingNote.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReportPackApi.md b/docs/Api/ReportPackApi.md new file mode 100644 index 0000000..c415b1e --- /dev/null +++ b/docs/Api/ReportPackApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\ReportPackApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createReportPack()**](ReportPackApi.md#createReportPack) | **POST** /employers/{employerId}/reports/packs | Create ReportPack | +| [**deleteReportPack()**](ReportPackApi.md#deleteReportPack) | **DELETE** /employers/{employerId}/reports/packs/{id} | Delete ReportPack | +| [**getReportPack()**](ReportPackApi.md#getReportPack) | **GET** /employers/{employerId}/reports/packs/{id} | Get ReportPack | +| [**indexReportPack()**](ReportPackApi.md#indexReportPack) | **GET** /employers/{employerId}/reports/packs | List ReportPacks | +| [**updateReportPack()**](ReportPackApi.md#updateReportPack) | **PUT** /employers/{employerId}/reports/packs/{id} | Update ReportPack | + + +## `createReportPack()` + +```php +createReportPack($employerId, $reportPack): \SynergiTech\Staffology\Model\ReportPack +``` + +Create ReportPack + +Creates a new ReportPack for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportPackApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$reportPack = new \SynergiTech\Staffology\Model\ReportPack(); // \SynergiTech\Staffology\Model\ReportPack + +try { + $result = $apiInstance->createReportPack($employerId, $reportPack); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportPackApi->createReportPack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **reportPack** | [**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteReportPack()` + +```php +deleteReportPack($employerId, $id) +``` + +Delete ReportPack + +Deletes the specified ReportPack. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportPackApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteReportPack($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling ReportPackApi->deleteReportPack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getReportPack()` + +```php +getReportPack($employerId, $id): \SynergiTech\Staffology\Model\ReportPack +``` + +Get ReportPack + +Gets the ReportPack specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportPackApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the ReportPack belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->getReportPack($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportPackApi->getReportPack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the ReportPack belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexReportPack()` + +```php +indexReportPack($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List ReportPacks + +Lists all ReportPacks for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportPackApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list ReportPacks + +try { + $result = $apiInstance->indexReportPack($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportPackApi->indexReportPack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list ReportPacks | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateReportPack()` + +```php +updateReportPack($employerId, $id, $reportPack): \SynergiTech\Staffology\Model\ReportPack +``` + +Update ReportPack + +Updates a ReportPack for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportPackApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$reportPack = new \SynergiTech\Staffology\Model\ReportPack(); // \SynergiTech\Staffology\Model\ReportPack + +try { + $result = $apiInstance->updateReportPack($employerId, $id, $reportPack); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportPackApi->updateReportPack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **reportPack** | [**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportPack**](../Model/ReportPack.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReportTemplateApi.md b/docs/Api/ReportTemplateApi.md new file mode 100644 index 0000000..0b78f06 --- /dev/null +++ b/docs/Api/ReportTemplateApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\ReportTemplateApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createReportTemplate()**](ReportTemplateApi.md#createReportTemplate) | **POST** /employers/{employerId}/reporttemplates | Create Report Template (beta) | +| [**deleteReportTemplate()**](ReportTemplateApi.md#deleteReportTemplate) | **DELETE** /employers/{employerId}/reporttemplates/{id} | Delete Report Template (beta) | +| [**getReportTemplate()**](ReportTemplateApi.md#getReportTemplate) | **GET** /employers/{employerId}/reporttemplates/{id} | Get Report Template (beta) | +| [**indexReportTemplate()**](ReportTemplateApi.md#indexReportTemplate) | **GET** /employers/{employerId}/reporttemplates | List Report Templates (beta) | +| [**updateReportTemplate()**](ReportTemplateApi.md#updateReportTemplate) | **PUT** /employers/{employerId}/reporttemplates/{id} | Update Report Template (beta) | + + +## `createReportTemplate()` + +```php +createReportTemplate($employerId, $reportTemplate): \SynergiTech\Staffology\Model\ReportTemplate +``` + +Create Report Template (beta) + +Creates a new Report Template for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Report Template belongs. +$reportTemplate = new \SynergiTech\Staffology\Model\ReportTemplate(); // \SynergiTech\Staffology\Model\ReportTemplate + +try { + $result = $apiInstance->createReportTemplate($employerId, $reportTemplate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportTemplateApi->createReportTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Report Template belongs. | | +| **reportTemplate** | [**\SynergiTech\Staffology\Model\ReportTemplate**](../Model/ReportTemplate.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportTemplate**](../Model/ReportTemplate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteReportTemplate()` + +```php +deleteReportTemplate($employerId, $id) +``` + +Delete Report Template (beta) + +Deletes the specified Report Template. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Report Template belongs. +$id = 'id_example'; // string | The Id of the Report Template which you want to fetch + +try { + $apiInstance->deleteReportTemplate($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling ReportTemplateApi->deleteReportTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Report Template belongs. | | +| **id** | **string**| The Id of the Report Template which you want to fetch | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getReportTemplate()` + +```php +getReportTemplate($employerId, $id): \SynergiTech\Staffology\Model\ReportTemplate +``` + +Get Report Template (beta) + +Gets the Report Template specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Report Template belongs. +$id = 'id_example'; // string | The Id of the Report Template which you want to fetch + +try { + $result = $apiInstance->getReportTemplate($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportTemplateApi->getReportTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Report Template belongs. | | +| **id** | **string**| The Id of the Report Template which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportTemplate**](../Model/ReportTemplate.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexReportTemplate()` + +```php +indexReportTemplate($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Report Templates (beta) + +Lists all Report Templates for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Report Template belongs. + +try { + $result = $apiInstance->indexReportTemplate($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportTemplateApi->indexReportTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Report Template belongs. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateReportTemplate()` + +```php +updateReportTemplate($employerId, $id, $reportTemplate): \SynergiTech\Staffology\Model\OccupationalPolicy +``` + +Update Report Template (beta) + +Updates a Report Template for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportTemplateApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Report Template belongs. +$id = 'id_example'; // string | The Id of the Report Template which you want to fetch +$reportTemplate = new \SynergiTech\Staffology\Model\ReportTemplate(); // \SynergiTech\Staffology\Model\ReportTemplate + +try { + $result = $apiInstance->updateReportTemplate($employerId, $id, $reportTemplate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportTemplateApi->updateReportTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Report Template belongs. | | +| **id** | **string**| The Id of the Report Template which you want to fetch | | +| **reportTemplate** | [**\SynergiTech\Staffology\Model\ReportTemplate**](../Model/ReportTemplate.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\OccupationalPolicy**](../Model/OccupationalPolicy.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReportsApi.md b/docs/Api/ReportsApi.md new file mode 100644 index 0000000..d9e5e82 --- /dev/null +++ b/docs/Api/ReportsApi.md @@ -0,0 +1,5365 @@ +# SynergiTech\Staffology\ReportsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**advancedVarianceReportReports()**](ReportsApi.md#advancedVarianceReportReports) | **GET** /employers/{employerId}/reports/advancedvariance | Advanced Variance Report | +| [**aeAssessmentsReports()**](ReportsApi.md#aeAssessmentsReports) | **GET** /employers/{employerId}/reports/AeAssessments | AutoEnrolment Assessments | +| [**aeoStatementReports()**](ReportsApi.md#aeoStatementReports) | **GET** /aeo/{employeeId}/{id} | AEO Statement | +| [**analysisReports()**](ReportsApi.md#analysisReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysis | Analysis | +| [**apprenticeshipLevyDetailsReports()**](ReportsApi.md#apprenticeshipLevyDetailsReports) | **GET** /employers/{employerId}/reports/{taxYear}/apprenticeshiplevy | Apprenticeship Levy Details | +| [**attachmentOrdersReports()**](ReportsApi.md#attachmentOrdersReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/attachmentorders | Attachment Orders | +| [**averageHolidayPayRateReports()**](ReportsApi.md#averageHolidayPayRateReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/averageholidaypayrate | Average Holiday Pay Rate | +| [**bankPaymentInstructionsReports()**](ReportsApi.md#bankPaymentInstructionsReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee/credit | Bank Payment Instructions | +| [**changesReports()**](ReportsApi.md#changesReports) | **GET** /employers/{employerId}/reports/changes | Gets audit changes of all employees within a company. | +| [**cis300Reports()**](ReportsApi.md#cis300Reports) | **GET** /employers/{employerId}/reports/{taxYear}/cis300/{id} | CIS300 | +| [**cisStatementReports()**](ReportsApi.md#cisStatementReports) | **GET** /employers/{employerId}/reports/{taxYear}/cisstatement/{taxMonth} | CIS Statement | +| [**cisSubContractorSummaryReports()**](ReportsApi.md#cisSubContractorSummaryReports) | **GET** /employers/{employerId}/reports/cissummary | CIS Subcontractor Summary | +| [**costAnalysisReports()**](ReportsApi.md#costAnalysisReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/costanalysis | Cost Analysis | +| [**costOfEmploymentReports()**](ReportsApi.md#costOfEmploymentReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/costofemployment | Cost Of Employment | +| [**downloadMaternitySchedulesReports()**](ReportsApi.md#downloadMaternitySchedulesReports) | **GET** /employers/{employerId}/reports/downloadmaternityschedules | Download Maternity Payment Schedule | +| [**emailP11DMultipleReports()**](ReportsApi.md#emailP11DMultipleReports) | **POST** /employers/{employerId}/reports/p11d/email | Email P11D to all Employees | +| [**emailP11DReports()**](ReportsApi.md#emailP11DReports) | **POST** /employers/{employerId}/reports/p11d/email/{employeeId} | Email P11D to an Employee | +| [**emailP45Reports()**](ReportsApi.md#emailP45Reports) | **POST** /employers/{employerId}/reports/p45/email | Email P45 to Employee | +| [**emailP60MultipleReports()**](ReportsApi.md#emailP60MultipleReports) | **POST** /employers/{employerId}/reports/p60/email | Email P60 to all Employees | +| [**emailP60Reports()**](ReportsApi.md#emailP60Reports) | **POST** /employers/{employerId}/reports/p60/email/{employeeId} | Email P60 to an Employee | +| [**employeeBenefitsReports()**](ReportsApi.md#employeeBenefitsReports) | **GET** /employers/{employerId}/reports/{taxYear}/EmployeeBenefits | Employee Benefits | +| [**employeeExportReports()**](ReportsApi.md#employeeExportReports) | **GET** /employees | Employee Export Details | +| [**employeeLeaveReports()**](ReportsApi.md#employeeLeaveReports) | **GET** /employers/{employerId}/reports/employeeleave | Employee Leave | +| [**employeeRoleExportReports()**](ReportsApi.md#employeeRoleExportReports) | **GET** /employeeroles | Employee Export Roles Details | +| [**employerChangesReports()**](ReportsApi.md#employerChangesReports) | **GET** /employers/{employerId}/reports/employerchanges | Gets audit changes for a company. | +| [**employerExportReports()**](ReportsApi.md#employerExportReports) | **GET** /employers/{employerId}/reports/employers | Employer Export | +| [**examplePayslipReports()**](ReportsApi.md#examplePayslipReports) | **POST** /payslip/example/pdf | Example Payslip | +| [**exbReports()**](ReportsApi.md#exbReports) | **GET** /employers/{employerId}/reports/{taxYear}/exb/{id} | EXB | +| [**fpsReports()**](ReportsApi.md#fpsReports) | **GET** /employers/{employerId}/reports/{taxYear}/fps/{id} | FPS | +| [**fullSummaryOfPayReports()**](ReportsApi.md#fullSummaryOfPayReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/fullsummaryofpay | Cost Of Employment | +| [**furloughReportReports()**](ReportsApi.md#furloughReportReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/furlough | FurloughReport | +| [**genderPayGapReports()**](ReportsApi.md#genderPayGapReports) | **GET** /employers/{employerId}/reports/{taxYear}/GenderPayGap | Gender Pay Gap | +| [**getPayRunCsvReports()**](ReportsApi.md#getPayRunCsvReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payruncsv | Get PayRun CSV | +| [**grossToNetReports()**](ReportsApi.md#grossToNetReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/gross-to-net | Gross To Net | +| [**holidayReports()**](ReportsApi.md#holidayReports) | **GET** /employers/{employerId}/reports/holiday | Holiday | +| [**hourlyPayReports()**](ReportsApi.md#hourlyPayReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/hourly-pay | Hourly Pay | +| [**loanBalancesReports()**](ReportsApi.md#loanBalancesReports) | **GET** /employers/{employerId}/reports/{payPeriod}/loanbalances | Loan Balances | +| [**niLetterValidationReportEmployeesReports()**](ReportsApi.md#niLetterValidationReportEmployeesReports) | **GET** /employers/{employerId}/reports/NiLetterValidationReport | NI Letter Validation (Employees) | +| [**niLetterValidationReportReports()**](ReportsApi.md#niLetterValidationReportReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/NiLetterValidationReport | NI Letter Validation (Payrun) | +| [**niYtdReports()**](ReportsApi.md#niYtdReports) | **GET** /niytd | NI Year To Date Values | +| [**p11DMultipleReports()**](ReportsApi.md#p11DMultipleReports) | **GET** /employers/{employerId}/reports/{taxYear}/p11d | All P11Ds For TaxYear | +| [**p11DReports()**](ReportsApi.md#p11DReports) | **GET** /employers/{employerId}/reports/{taxYear}/p11d/{employeeId} | P11D For Employee | +| [**p11DetailedMultipleReports()**](ReportsApi.md#p11DetailedMultipleReports) | **GET** /employers/{employerId}/reports/{taxYear}/p11detailed | All Detailed P11s For TaxYear | +| [**p11DetailedReports()**](ReportsApi.md#p11DetailedReports) | **GET** /employers/{employerId}/reports/{taxYear}/{employeeId}/p11detailed | P11 (Detailed) | +| [**p11Reports()**](ReportsApi.md#p11Reports) | **GET** /employers/{employerId}/reports/{taxYear}/{employeeId}/p11 | P11 | +| [**p30Reports()**](ReportsApi.md#p30Reports) | **GET** /employers/{employerId}/reports/{taxYear}/p30/{periodEnding} | P30 | +| [**p32Reports()**](ReportsApi.md#p32Reports) | **GET** /employers/{employerId}/reports/{taxYear}/p32 | P32 | +| [**p45Reports()**](ReportsApi.md#p45Reports) | **GET** /employers/{employerId}/reports/p45 | P45 For Employee | +| [**p60MultipleReports()**](ReportsApi.md#p60MultipleReports) | **GET** /employers/{employerId}/reports/{taxYear}/p60 | All P60s For TaxYear | +| [**p60Reports()**](ReportsApi.md#p60Reports) | **GET** /employers/{employerId}/reports/{taxYear}/p60/{employeeId} | P60 For Employee | +| [**papdisFileReports()**](ReportsApi.md#papdisFileReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/papdis | PAPDIS File | +| [**payCodeExportReports()**](ReportsApi.md#payCodeExportReports) | **GET** /employers/{employerId}/reports/paycodes | Pay Code Export Details | +| [**payElementReports()**](ReportsApi.md#payElementReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/pay-element | Pay Element | +| [**payGradesReports()**](ReportsApi.md#payGradesReports) | **GET** /employers/{employerId}/reports/payGrades | Pay Grade | +| [**payRunCsvReports()**](ReportsApi.md#payRunCsvReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrun-csv | PayRun CSV (deprecated) | +| [**payRunPaymentsReports()**](ReportsApi.md#payRunPaymentsReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee | PayRun Payments | +| [**payRunSummaryReports()**](ReportsApi.md#payRunSummaryReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/payrunsummary | PayRunSummary | +| [**paySpineReports()**](ReportsApi.md#paySpineReports) | **GET** /employers/{employerId}/reports/payspines | Pay Spine | +| [**payrollAnalysisCostBreakdownReports()**](ReportsApi.md#payrollAnalysisCostBreakdownReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysiscostbreakdown | Analysis Cost Breakdown | +| [**payrollAnalysisEmployeeRoleBreakdownReports()**](ReportsApi.md#payrollAnalysisEmployeeRoleBreakdownReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/analysisemployeerolebreakdown | Payroll Analysis with Employee Role Breakdown | +| [**payrollJournalCsvReportReports()**](ReportsApi.md#payrollJournalCsvReportReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrolljournalcsv | Payroll Journal CSV | +| [**payrunNiYtdReports()**](ReportsApi.md#payrunNiYtdReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/niytd | NI Year To Date Values | +| [**payrunYtdReports()**](ReportsApi.md#payrunYtdReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/ytd | Year To Date Values | +| [**payslipReports()**](ReportsApi.md#payslipReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/{id}/payslip | Payslip | +| [**payslipsReports()**](ReportsApi.md#payslipsReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payslips | Payslips | +| [**pensionMembershipsReports()**](ReportsApi.md#pensionMembershipsReports) | **GET** /employers/{employerId}/reports/{taxYear}/pensionmemberships | Export Multiple Pension Memberships Report | +| [**rightToWorkReports()**](ReportsApi.md#rightToWorkReports) | **GET** /employers/{employerId}/reports/right-to-work | RightToWork | +| [**spinePointReports()**](ReportsApi.md#spinePointReports) | **GET** /employers/{employerId}/reports/spinepoints | Spine Point | +| [**statutoryPayReports()**](ReportsApi.md#statutoryPayReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/statutory-pay | Statutory Pay | +| [**taxCodeChangesReports()**](ReportsApi.md#taxCodeChangesReports) | **GET** /employers/{employerId}/reports/{taxYear}/taxcode | Taxcode Change | +| [**teachersPensionEoyReports()**](ReportsApi.md#teachersPensionEoyReports) | **GET** /employers/{employerId}/reports/{taxYear}/teachersPensionEoy | Teachers Pension Eoy Report | +| [**umbrellaReconciliationReports()**](ReportsApi.md#umbrellaReconciliationReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/umbrella-reconciliation | Umbrella Reconciliation | +| [**varianceReportReports()**](ReportsApi.md#varianceReportReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/variance | Variance Report | +| [**warningsReports()**](ReportsApi.md#warningsReports) | **GET** /employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/PayrollRunWarnings | Export Payroll Run Warnings | +| [**ytdReports()**](ReportsApi.md#ytdReports) | **GET** /ytd | Year To Date Values | + + +## `advancedVarianceReportReports()` + +```php +advancedVarianceReportReports($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept): \SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse +``` + +Advanced Variance Report + +Returns a report comparing one period to another period. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$ordinal = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$period = 56; // int +$taxYearCompare = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodCompare = 56; // int +$payCodes = 'payCodes_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->advancedVarianceReportReports($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->advancedVarianceReportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | [optional] | +| **ordinal** | **int**| | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **period** | **int**| | [optional] | +| **taxYearCompare** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **periodCompare** | **int**| | [optional] | +| **payCodes** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse**](../Model/AdvancedVarianceReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aeAssessmentsReports()` + +```php +aeAssessmentsReports($employerId, $accept): \SynergiTech\Staffology\Model\ItemListReportResponse +``` + +AutoEnrolment Assessments + +Returns a list of Items representing your current Employees along with their most recent Auto Enrolment Assessment in the metadata field. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->aeAssessmentsReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->aeAssessmentsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ItemListReportResponse**](../Model/ItemListReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aeoStatementReports()` + +```php +aeoStatementReports($employeeId, $id, $employerId, $accept): \SynergiTech\Staffology\Model\AttachmentOrderReportResponse +``` + +AEO Statement + +Returns a statement for an Attachment Order, listing payments that have been made. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string | The id of the AttachmentOrder +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->aeoStatementReports($employeeId, $id, $employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->aeoStatementReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employeeId** | **string**| | | +| **id** | **string**| The id of the AttachmentOrder | | +| **employerId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\AttachmentOrderReportResponse**](../Model/AttachmentOrderReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `analysisReports()` + +```php +analysisReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown): \SynergiTech\Staffology\Model\AnalysisReportReportResponse +``` + +Analysis + +Returns an AnalysisReport for one or multiple periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int +$deptCode = 'deptCode_example'; // string | If specified then only employees assigned to this department code at the time of the payrun will be included +$showPayPeriodBreakdown = false; // bool | If set to true, then the report will show a breakdown of each period for each employee + +try { + $result = $apiInstance->analysisReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->analysisReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptCode** | **string**| If specified then only employees assigned to this department code at the time of the payrun will be included | [optional] | +| **showPayPeriodBreakdown** | **bool**| If set to true, then the report will show a breakdown of each period for each employee | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\AnalysisReportReportResponse**](../Model/AnalysisReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apprenticeshipLevyDetailsReports()` + +```php +apprenticeshipLevyDetailsReports($employerId, $taxYear, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Apprenticeship Levy Details + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear that the Apprenticeship Levy is for. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->apprenticeshipLevyDetailsReports($employerId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->apprenticeshipLevyDetailsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear that the Apprenticeship Levy is for. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `attachmentOrdersReports()` + +```php +attachmentOrdersReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse +``` + +Attachment Orders + +Returns a report detailing attachment of earning order deductions for one or multiple periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->attachmentOrdersReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->attachmentOrdersReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse**](../Model/AttachmentOrdersReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `averageHolidayPayRateReports()` + +```php +averageHolidayPayRateReports($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal): \SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse +``` + +Average Holiday Pay Rate + +Returns a report for average holiday pay rate. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$period = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->averageHolidayPayRateReports($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->averageHolidayPayRateReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **period** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse**](../Model/AverageHolidayPayRateReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `bankPaymentInstructionsReports()` + +```php +bankPaymentInstructionsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions): \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse +``` + +Bank Payment Instructions + +Returns a list of bank payments that need to be made to employees as a result of a Payrun. You can optionally provide a PaymentDate and only payments for that date will be returned. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string +$paymentDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$bankHoliday = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\BankHolidayCollection(); // \SynergiTech\Staffology\Model\BankHolidayCollection | Specifies the region whose bank holidays are to be considered in the operation. +$ordinal = 1; // int +$incPensions = false; // bool | Set to true and we'll include any payment due to Pension Providers +$incHmrc = false; // bool | Set to true and we'll include any payment due to HMRC +$incAeos = false; // bool | Set to true and we'll include any payment due as a result of AttachmentOrders +$incDeductions = false; // bool | Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee + +try { + $result = $apiInstance->bankPaymentInstructionsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->bankPaymentInstructionsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **paymentDate** | **\DateTime**| | [optional] | +| **bankHoliday** | [**\SynergiTech\Staffology\Model\BankHolidayCollection**](../Model/.md)| Specifies the region whose bank holidays are to be considered in the operation. | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **incPensions** | **bool**| Set to true and we'll include any payment due to Pension Providers | [optional] [default to false] | +| **incHmrc** | **bool**| Set to true and we'll include any payment due to HMRC | [optional] [default to false] | +| **incAeos** | **bool**| Set to true and we'll include any payment due as a result of AttachmentOrders | [optional] [default to false] | +| **incDeductions** | **bool**| Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse**](../Model/BankPaymentInstructionReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `application/zip` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `changesReports()` + +```php +changesReports($employerId, $fromDate, $toDate, $accept): \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse +``` + +Gets audit changes of all employees within a company. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of any employer to which you have access. +$fromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$toDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->changesReports($employerId, $fromDate, $toDate, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->changesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of any employer to which you have access. | | +| **fromDate** | **\DateTime**| | [optional] | +| **toDate** | **\DateTime**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse**](../Model/ChangeSummaryListReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cis300Reports()` + +```php +cis300Reports($employerId, $taxYear, $id, $accept): \SynergiTech\Staffology\Model\Cis300ReportResponse +``` + +CIS300 + +Returns a CIS300 as a CSV or human-readable report + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string | The Id of CIS300. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->cis300Reports($employerId, $taxYear, $id, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->cis300Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| The Id of CIS300. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Cis300ReportResponse**](../Model/Cis300ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cisStatementReports()` + +```php +cisStatementReports($employerId, $taxYear, $taxMonth, $employeeId, $accept): \SynergiTech\Staffology\Model\CisStatementListReportResponse +``` + +CIS Statement + +Returns a CIS Statement for the employee specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$taxMonth = 56; // int +$employeeId = 'employeeId_example'; // string | Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->cisStatementReports($employerId, $taxYear, $taxMonth, $employeeId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->cisStatementReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **taxMonth** | **int**| | | +| **employeeId** | **string**| Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CisStatementListReportResponse**](../Model/CisStatementListReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cisSubContractorSummaryReports()` + +```php +cisSubContractorSummaryReports($employerId, $accept): \SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse +``` + +CIS Subcontractor Summary + +Returns a list of all CIS Subcontractors along with verification details + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->cisSubContractorSummaryReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->cisSubContractorSummaryReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse**](../Model/CisSubContractorSummaryListReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `text/html`, `text/csv`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `costAnalysisReports()` + +```php +costAnalysisReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\CostAnalysisReportReportResponse +``` + +Cost Analysis + +Returns a report analysing the costs of a payrun or range of payruns. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->costAnalysisReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->costAnalysisReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse**](../Model/CostAnalysisReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `costOfEmploymentReports()` + +```php +costOfEmploymentReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse +``` + +Cost Of Employment + +Returns a report detailing the employment cost per employee for a payrun or range of payruns. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->costOfEmploymentReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->costOfEmploymentReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse**](../Model/CostOfEmploymentReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `downloadMaternitySchedulesReports()` + +```php +downloadMaternitySchedulesReports($employerId, $employeeId, $id, $leave): \SynergiTech\Staffology\Model\ReportResponse +``` + +Download Maternity Payment Schedule + +Returns a Maternity Pay schedule for employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string +$id = 'id_example'; // string +$leave = new \SynergiTech\Staffology\Model\Leave(); // \SynergiTech\Staffology\Model\Leave + +try { + $result = $apiInstance->downloadMaternitySchedulesReports($employerId, $employeeId, $id, $leave); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->downloadMaternitySchedulesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| | [optional] | +| **id** | **string**| | [optional] | +| **leave** | [**\SynergiTech\Staffology\Model\Leave**](../Model/Leave.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/pdf`, `application/json`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailP11DMultipleReports()` + +```php +emailP11DMultipleReports($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent) +``` + +Email P11D to all Employees + +Email P11D to all Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P11Ds for. +$excludeEmployeesWithP11DEmailSent = false; // bool | Exclude Employees with Already Sent P11D Emails. + +try { + $apiInstance->emailP11DMultipleReports($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->emailP11DMultipleReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P11Ds for. | [optional] | +| **excludeEmployeesWithP11DEmailSent** | **bool**| Exclude Employees with Already Sent P11D Emails. | [optional] [default to false] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailP11DReports()` + +```php +emailP11DReports($employerId, $employeeId, $taxYear) +``` + +Email P11D to an Employee + +Email a P11D to an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want the email a P11D to. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P11Ds for. + +try { + $apiInstance->emailP11DReports($employerId, $employeeId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->emailP11DReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee you want the email a P11D to. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P11Ds for. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailP45Reports()` + +```php +emailP45Reports($employerId, $employeeId) +``` + +Email P45 to Employee + +Email a P45 to an Employee you've marked as a leaver + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want the email a P45 to. + +try { + $apiInstance->emailP45Reports($employerId, $employeeId); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->emailP45Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee you want the email a P45 to. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailP60MultipleReports()` + +```php +emailP60MultipleReports($employerId, $taxYear, $excludeEmployeesWithP60EmailSent) +``` + +Email P60 to all Employees + +Email P60 to all Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P60s for. +$excludeEmployeesWithP60EmailSent = false; // bool | Exclude Employees with Already Sent P60 Emails. + +try { + $apiInstance->emailP60MultipleReports($employerId, $taxYear, $excludeEmployeesWithP60EmailSent); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->emailP60MultipleReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P60s for. | [optional] | +| **excludeEmployeesWithP60EmailSent** | **bool**| Exclude Employees with Already Sent P60 Emails. | [optional] [default to false] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `emailP60Reports()` + +```php +emailP60Reports($employerId, $employeeId, $taxYear) +``` + +Email P60 to an Employee + +Email a P60 to an Employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want the email a P60 to. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P60s for. + +try { + $apiInstance->emailP60Reports($employerId, $employeeId, $taxYear); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->emailP60Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee you want the email a P60 to. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P60s for. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeBenefitsReports()` + +```php +employeeBenefitsReports($employerId, $taxYear, $reportType, $accept): \SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse +``` + +Employee Benefits + +Returns a output containing details for employee benefits. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$reportType = 'reportType_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employeeBenefitsReports($employerId, $taxYear, $reportType, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employeeBenefitsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **reportType** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse**](../Model/EmployeeBenefitsReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeExportReports()` + +```php +employeeExportReports($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Employee Export Details + +Returns a CSV file containing details for all Employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$includeBankAccountDetails = True; // bool +$includeYtd = True; // bool +$incPensionInfo = True; // bool +$includePayInfo = True; // bool +$includeNotes = True; // bool +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employeeExportReports($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employeeExportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | [optional] | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **includeBankAccountDetails** | **bool**| | [optional] | +| **includeYtd** | **bool**| | [optional] | +| **incPensionInfo** | **bool**| | [optional] | +| **includePayInfo** | **bool**| | [optional] | +| **includeNotes** | **bool**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeLeaveReports()` + +```php +employeeLeaveReports($employerId, $taxYear, $accept): \SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse +``` + +Employee Leave + +Returns the Employee Leave report for the selected tax year. If the tax year is not selected, returns the Employee Leave report for all the leave entries. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employeeLeaveReports($employerId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employeeLeaveReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse**](../Model/EmployeeLeaveReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employeeRoleExportReports()` + +```php +employeeRoleExportReports($employerId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Employee Export Roles Details + +Returns a CSV file containing details for all Employee Roles. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employeeRoleExportReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employeeRoleExportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employerChangesReports()` + +```php +employerChangesReports($employerId, $fromDate, $toDate, $accept): \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse +``` + +Gets audit changes for a company. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of any employer to which you have access. +$fromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$toDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employerChangesReports($employerId, $fromDate, $toDate, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employerChangesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of any employer to which you have access. | | +| **fromDate** | **\DateTime**| | [optional] | +| **toDate** | **\DateTime**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse**](../Model/ChangeSummaryListReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employerExportReports()` + +```php +employerExportReports($employerId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Employer Export + +Returns a CSV file containing details for all Employers. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of any employer to which you have access. It wont affect the report results. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->employerExportReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->employerExportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of any employer to which you have access. It wont affect the report results. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `examplePayslipReports()` + +```php +examplePayslipReports($employerId, $accept, $payslipCustomisation): \SynergiTech\Staffology\Model\ReportResponse +``` + +Example Payslip + +Use this operation to test your PayslipCustomisation. We'll use dummy date and create a Payslip PDF or HTML document based on the customisation that you submit + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string +$payslipCustomisation = new \SynergiTech\Staffology\Model\PayslipCustomisation(); // \SynergiTech\Staffology\Model\PayslipCustomisation | Your PayslipCustomisation. + +try { + $result = $apiInstance->examplePayslipReports($employerId, $accept, $payslipCustomisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->examplePayslipReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | +| **payslipCustomisation** | [**\SynergiTech\Staffology\Model\PayslipCustomisation**](../Model/PayslipCustomisation.md)| Your PayslipCustomisation. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json`, `application/pdf`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `exbReports()` + +```php +exbReports($employerId, $taxYear, $id, $accept): \SynergiTech\Staffology\Model\ExbReportResponse +``` + +EXB + +Returns an EXB as a CSV file + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string | The Id of EXB. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->exbReports($employerId, $taxYear, $id, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->exbReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| The Id of EXB. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ExbReportResponse**](../Model/ExbReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `fpsReports()` + +```php +fpsReports($employerId, $taxYear, $id, $incAllEmployees, $accept): \SynergiTech\Staffology\Model\FpsReportResponse +``` + +FPS + +Returns an FPS as a CSV file + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string | The Id of FPS. +$incAllEmployees = True; // bool | If true, then any employees that were paid earlier in the year but not on this FPS will also be included +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->fpsReports($employerId, $taxYear, $id, $incAllEmployees, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->fpsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| The Id of FPS. | | +| **incAllEmployees** | **bool**| If true, then any employees that were paid earlier in the year but not on this FPS will also be included | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\FpsReportResponse**](../Model/FpsReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `fullSummaryOfPayReports()` + +```php +fullSummaryOfPayReports($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal): \SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse +``` + +Cost Of Employment + +Returns a report detailing the employment cost per employee for a payrun or range of payruns. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$period = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->fullSummaryOfPayReports($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->fullSummaryOfPayReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **period** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse**](../Model/FullSummaryOfPayReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `furloughReportReports()` + +```php +furloughReportReports($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal): \SynergiTech\Staffology\Model\FurloughReportReportResponse +``` + +FurloughReport + +Returns a Furlough Report. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodNumber = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->furloughReportReports($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->furloughReportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\FurloughReportReportResponse**](../Model/FurloughReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `genderPayGapReports()` + +```php +genderPayGapReports($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept): \SynergiTech\Staffology\Model\GenderPayGapReportReportResponse +``` + +Gender Pay Gap + +Returns a report containing details for gender pay gap analysis. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$genderPayGapSnapShotDate = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\GenderPayGapSnapShotDate(); // \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate +$ordinaryPayCodeSetId = 'ordinaryPayCodeSetId_example'; // string +$bonusPayCodeSetId = 'bonusPayCodeSetId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->genderPayGapReports($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->genderPayGapReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **genderPayGapSnapShotDate** | [**\SynergiTech\Staffology\Model\GenderPayGapSnapShotDate**](../Model/.md)| | [optional] | +| **ordinaryPayCodeSetId** | **string**| | [optional] | +| **bonusPayCodeSetId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse**](../Model/GenderPayGapReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayRunCsvReports()` + +```php +getPayRunCsvReports($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get PayRun CSV + +Download the lines of a PayRun to a CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$ordinal = 1; // int +$csvType = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayRunCsvType(); // \SynergiTech\Staffology\Model\PayRunCsvType | Choose the type of CSV you want to generate +$mappingId = 'mappingId_example'; // string | If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly +$accept = 'application/json'; // string + +try { + $result = $apiInstance->getPayRunCsvReports($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->getPayRunCsvReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **ordinal** | **int**| | [optional] [default to 1] | +| **csvType** | [**\SynergiTech\Staffology\Model\PayRunCsvType**](../Model/.md)| Choose the type of CSV you want to generate | [optional] | +| **mappingId** | **string**| If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly | [optional] | +| **accept** | **string**| | [optional] [default to 'application/json'] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `grossToNetReports()` + +```php +grossToNetReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis): \SynergiTech\Staffology\Model\GrossToNetReportReportResponse +``` + +Gross To Net + +Returns a report comparing employees' gross pay with their net pay for one or more pay periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$sortBy = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\ReportSortBy(); // \SynergiTech\Staffology\Model\ReportSortBy | Defines the way to sort the data. Defaults to sorting by PayrollCode. +$sortDescending = True; // bool | Defines whether to sort the data in descending order. Defaults to false. +$ordinal = 1; // int +$forCis = false; // bool | If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false + +try { + $result = $apiInstance->grossToNetReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->grossToNetReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **sortBy** | [**\SynergiTech\Staffology\Model\ReportSortBy**](../Model/.md)| Defines the way to sort the data. Defaults to sorting by PayrollCode. | [optional] | +| **sortDescending** | **bool**| Defines whether to sort the data in descending order. Defaults to false. | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **forCis** | **bool**| If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\GrossToNetReportReportResponse**](../Model/GrossToNetReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `holidayReports()` + +```php +holidayReports($employerId, $accept, $accruals, $accrualsHrs): \SynergiTech\Staffology\Model\HolidayReportReportResponse +``` + +Holiday + +Returns a report summarising holiday usage for all employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string +$accruals = false; // bool | If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. +$accrualsHrs = false; // bool | If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. + +try { + $result = $apiInstance->holidayReports($employerId, $accept, $accruals, $accrualsHrs); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->holidayReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | +| **accruals** | **bool**| If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. | [optional] [default to false] | +| **accrualsHrs** | **bool**| If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\HolidayReportReportResponse**](../Model/HolidayReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `hourlyPayReports()` + +```php +hourlyPayReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\HourlyPayReportReportResponse +``` + +Hourly Pay + +Returns a report summarising the hourly pay for employees for one or more pay periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->hourlyPayReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->hourlyPayReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\HourlyPayReportReportResponse**](../Model/HourlyPayReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `loanBalancesReports()` + +```php +loanBalancesReports($employerId, $payPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\LoanBalancesReportReportResponse +``` + +Loan Balances + +Returns the Loan Balances report for the given pay schedule + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->loanBalancesReports($employerId, $payPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->loanBalancesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse**](../Model/LoanBalancesReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `niLetterValidationReportEmployeesReports()` + +```php +niLetterValidationReportEmployeesReports($employerId, $accept, $payDate, $payPeriod): \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse +``` + +NI Letter Validation (Employees) + +Checks the NI Letters allocated to your employees. If no pay date is provided, the checks are based on today's date. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string +$payDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods + +try { + $result = $apiInstance->niLetterValidationReportEmployeesReports($employerId, $accept, $payDate, $payPeriod); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->niLetterValidationReportEmployeesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | +| **payDate** | **\DateTime**| | [optional] | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse**](../Model/NiLetterValidationReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `niLetterValidationReportReports()` + +```php +niLetterValidationReportReports($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal): \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse +``` + +NI Letter Validation (Payrun) + +Checks the NI Letters allocated to employees on a specific payrun + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodNumber = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->niLetterValidationReportReports($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->niLetterValidationReportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse**](../Model/NiLetterValidationReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `niYtdReports()` + +```php +niYtdReports($employerId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +NI Year To Date Values + +Returns a CSV file containing NI YTD values for all Employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->niYtdReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->niYtdReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p11DMultipleReports()` + +```php +p11DMultipleReports($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent): \SynergiTech\Staffology\Model\ReportResponse +``` + +All P11Ds For TaxYear + +Returns all P11Ds in a single PDF file for the TaxYear and Employer specified If you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field. As there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P11Ds for. +$accept = 'accept_example'; // string +$excludeEmployeesWithP11dEmailSent = false; // bool | Exclude Employees with Already Sent P11Ds Emails. + +try { + $result = $apiInstance->p11DMultipleReports($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p11DMultipleReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P11Ds for. | | +| **accept** | **string**| | [optional] | +| **excludeEmployeesWithP11dEmailSent** | **bool**| Exclude Employees with Already Sent P11Ds Emails. | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p11DReports()` + +```php +p11DReports($employerId, $employeeId, $taxYear, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +P11D For Employee + +Gets a P11D in PDF format for the TaxYear and Employee specified. A URL is returned which points to the PDF file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the P60 is for. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p11DReports($employerId, $employeeId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p11DReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the P60 is for. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p11DetailedMultipleReports()` + +```php +p11DetailedMultipleReports($employerId, $taxYear, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +All Detailed P11s For TaxYear + +Returns all detailed P11s in a single PDF file for the TaxYear and Employer specified If you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field. As there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the employer you want to report on +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The tax year you want to report on. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p11DetailedMultipleReports($employerId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p11DetailedMultipleReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the employer you want to report on | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The tax year you want to report on. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p11DetailedReports()` + +```php +p11DetailedReports($employerId, $employeeId, $taxYear, $accept): \SynergiTech\Staffology\Model\P11DetailedReportResponse +``` + +P11 (Detailed) + +Returns a detailed P11 Report for the given employee. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The employee Id of the employee you want to report on +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The tax year you want to report on. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p11DetailedReports($employerId, $employeeId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p11DetailedReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| The employee Id of the employee you want to report on | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The tax year you want to report on. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\P11DetailedReportResponse**](../Model/P11DetailedReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p11Reports()` + +```php +p11Reports($employerId, $employeeId, $taxYear, $accept): \SynergiTech\Staffology\Model\P11ReportResponse +``` + +P11 + +Returns a P11 Report, detailing all payments and deductions for the given employee + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$employeeId = 'employeeId_example'; // string | The employee Id of the employee you want to report on +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The tax year you want to report on. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p11Reports($employerId, $employeeId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p11Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **employeeId** | **string**| The employee Id of the employee you want to report on | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The tax year you want to report on. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\P11ReportResponse**](../Model/P11ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p30Reports()` + +```php +p30Reports($employerId, $taxYear, $periodEnding, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +P30 + +Returns a P30 Report summarising the employers HMRC liabilities for the period. For available periods retrieve a list of HmrcLiability and examine the metadata. If the accept header is set to \"text/csv\" then the periodEnding parameter is ignored and you'll receive a CSV for the entire TaxYear. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$periodEnding = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p30Reports($employerId, $taxYear, $periodEnding, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p30Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **periodEnding** | **\DateTime**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p32Reports()` + +```php +p32Reports($employerId, $taxYear, $accept): \SynergiTech\Staffology\Model\P32ReportResponse +``` + +P32 + +Returns a P32 Report detailing the employers HMRC liabilities for the year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p32Reports($employerId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p32Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\P32ReportResponse**](../Model/P32ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/html`, `application/pdf`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p45Reports()` + +```php +p45Reports($employerId, $employeeId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +P45 For Employee + +Get a P45 for an Employee you've marked as a leaver + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee you want a P45 for. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p45Reports($employerId, $employeeId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p45Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee you want a P45 for. | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p60MultipleReports()` + +```php +p60MultipleReports($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent): \SynergiTech\Staffology\Model\ReportResponse +``` + +All P60s For TaxYear + +Returns all P60s in a single PDF file for the TaxYear and Employer specified If you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field. As there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear you want P60s for. +$accept = 'accept_example'; // string +$excludeEmployeesWithP60EmailSent = false; // bool | Exclude Employees with Already Sent P60 Emails. + +try { + $result = $apiInstance->p60MultipleReports($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p60MultipleReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear you want P60s for. | | +| **accept** | **string**| | [optional] | +| **excludeEmployeesWithP60EmailSent** | **bool**| Exclude Employees with Already Sent P60 Emails. | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `p60Reports()` + +```php +p60Reports($employerId, $employeeId, $taxYear, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +P60 For Employee + +Gets a P60 in PDF format for the TaxYear and Employee specified. A URL is returned which points to the PDF file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer. +$employeeId = 'employeeId_example'; // string | The Id of the Employee. +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear | The TaxYear the P60 is for. +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->p60Reports($employerId, $employeeId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->p60Reports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer. | | +| **employeeId** | **string**| The Id of the Employee. | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| The TaxYear the P60 is for. | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `application/pdf`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `papdisFileReports()` + +```php +papdisFileReports($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat): \SynergiTech\Staffology\Model\PapdisDocumentReportResponse +``` + +PAPDIS File + +Returns a PAPDIS compliant file for the PayRun and Pension Provider PAPDIS Id specified + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$schemeId = 'schemeId_example'; // string | The Id of the Pension Scheme you want a file for. +$accept = 'accept_example'; // string +$ordinal = 1; // int +$csvFormat = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PensionCsvFormat(); // \SynergiTech\Staffology\Model\PensionCsvFormat + +try { + $result = $apiInstance->papdisFileReports($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->papdisFileReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **schemeId** | **string**| The Id of the Pension Scheme you want a file for. | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **csvFormat** | [**\SynergiTech\Staffology\Model\PensionCsvFormat**](../Model/.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PapdisDocumentReportResponse**](../Model/PapdisDocumentReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json`, `text/csv`, `text/xml`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payCodeExportReports()` + +```php +payCodeExportReports($employerId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Pay Code Export Details + +Returns details for all Pay Codes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->payCodeExportReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payCodeExportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payElementReports()` + +```php +payElementReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal): \SynergiTech\Staffology\Model\PayElementReportReportResponse +``` + +Pay Element + +Returns a report detailing pay elements for one or more pay periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$payCodes = 'payCodes_example'; // string | Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->payElementReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payElementReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **payCodes** | **string**| Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayElementReportReportResponse**](../Model/PayElementReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payGradesReports()` + +```php +payGradesReports($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept): \SynergiTech\Staffology\Model\PayGradesReportReportResponse +``` + +Pay Grade + +Returns a report for Pay Grade. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$effectiveDateFrom = 'effectiveDateFrom_example'; // string +$effectiveDateTo = 'effectiveDateTo_example'; // string +$paySpineId = 'paySpineId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->payGradesReports($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payGradesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **effectiveDateFrom** | **string**| | [optional] | +| **effectiveDateTo** | **string**| | [optional] | +| **paySpineId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayGradesReportReportResponse**](../Model/PayGradesReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payRunCsvReports()` + +```php +payRunCsvReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary): \SynergiTech\Staffology\Model\ReportResponse +``` + +PayRun CSV (deprecated) + +Download the lines of a PayRun to a CSV file. Please use Get PayRun CSV that now accepts a parameter for CSV type + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string +$ordinal = 1; // int +$summary = false; // bool | If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee + +try { + $result = $apiInstance->payRunCsvReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payRunCsvReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **summary** | **bool**| If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payRunPaymentsReports()` + +```php +payRunPaymentsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments): \SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse +``` + +PayRun Payments + +Returns a list of all employee payments that need to be made as a result of a Payrun. If you specifically want just bank payments (employees where PayMethod is Credit) then you may find the Bank Payment Instructions API call more useful + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string +$bankHoliday = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\BankHolidayCollection(); // \SynergiTech\Staffology\Model\BankHolidayCollection | Specifies the region whose bank holidays are to be considered in the operation. +$ordinal = 1; // int +$includeNonEmployeePayments = false; // bool | If set to true then we'll also include payments that need to be made to HMRC and PensionProviders + +try { + $result = $apiInstance->payRunPaymentsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payRunPaymentsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **bankHoliday** | [**\SynergiTech\Staffology\Model\BankHolidayCollection**](../Model/.md)| Specifies the region whose bank holidays are to be considered in the operation. | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **includeNonEmployeePayments** | **bool**| If set to true then we'll also include payments that need to be made to HMRC and PensionProviders | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse**](../Model/PayrunPaymentsReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payRunSummaryReports()` + +```php +payRunSummaryReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty): \SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse +``` + +PayRunSummary + +Returns an array of PayRunSummaryLine for one or multiple periods. Similar to a PayRunJournal except that it can cover multiple periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int +$deptCode = 'deptCode_example'; // string | If specified then only employees assigned to this department code at the time of the payrun will be included +$includeQty = false; // bool | If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours + +try { + $result = $apiInstance->payRunSummaryReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payRunSummaryReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptCode** | **string**| If specified then only employees assigned to this department code at the time of the payrun will be included | [optional] | +| **includeQty** | **bool**| If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse**](../Model/PayRunSummaryLineIEnumerableReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `paySpineReports()` + +```php +paySpineReports($employerId, $paySpineId, $accept): \SynergiTech\Staffology\Model\PaySpineReportReportResponse +``` + +Pay Spine + +Returns a report for Pay Spine. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$paySpineId = 'paySpineId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->paySpineReports($employerId, $paySpineId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->paySpineReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **paySpineId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PaySpineReportReportResponse**](../Model/PaySpineReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrollAnalysisCostBreakdownReports()` + +```php +payrollAnalysisCostBreakdownReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode): \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse +``` + +Analysis Cost Breakdown + +Returns an AnalysisCostBreakdownReport for one or multiple periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int +$deptCode = 'deptCode_example'; // string | If specified then only employees assigned to this department code at the time of the payrun will be included + +try { + $result = $apiInstance->payrollAnalysisCostBreakdownReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payrollAnalysisCostBreakdownReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptCode** | **string**| If specified then only employees assigned to this department code at the time of the payrun will be included | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse**](../Model/PayrollAnalysisCostBreakdownReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrollAnalysisEmployeeRoleBreakdownReports()` + +```php +payrollAnalysisEmployeeRoleBreakdownReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode): \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse +``` + +Payroll Analysis with Employee Role Breakdown + +Return a Payroll Analysis Report with Employee Role Breakdown for a specified pay period. If a department code is specified, only employees assigned to this department at the time of the payrun will be included. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int +$deptCode = 'deptCode_example'; // string | Optional. Filters employees by department code. + +try { + $result = $apiInstance->payrollAnalysisEmployeeRoleBreakdownReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payrollAnalysisEmployeeRoleBreakdownReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptCode** | **string**| Optional. Filters employees by department code. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse**](../Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrollJournalCsvReportReports()` + +```php +payrollJournalCsvReportReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown): \SynergiTech\Staffology\Model\ReportResponse +``` + +Payroll Journal CSV + +Download the lines of Payroll Journal to CSV file. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string +$ordinal = 1; // int +$deptBreakdown = false; // bool | Set to true and the journal will be split between any relevant Departments + +try { + $result = $apiInstance->payrollJournalCsvReportReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payrollJournalCsvReportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **deptBreakdown** | **bool**| Set to true and the journal will be split between any relevant Departments | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrunNiYtdReports()` + +```php +payrunNiYtdReports($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept): \SynergiTech\Staffology\Model\NiYtdReportReportResponse +``` + +NI Year To Date Values + +Returns a CSV file containing NI YTD values for all Employees on the payrun. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 56; // int +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->payrunNiYtdReports($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payrunNiYtdReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\NiYtdReportReportResponse**](../Model/NiYtdReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrunYtdReports()` + +```php +payrunYtdReports($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept): \SynergiTech\Staffology\Model\YtdReportReportResponse +``` + +Year To Date Values + +Returns a CSV file containing YTD values for all Employees on the payrun. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 56; // int +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->payrunYtdReports($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payrunYtdReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\YtdReportReportResponse**](../Model/YtdReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payslipReports()` + +```php +payslipReports($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal): \SynergiTech\Staffology\Model\PayslipReportResponse +``` + +Payslip + +Returns a single Payslip for the given PayRunEntry of a PayRun. The type of response depends on the accept header. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$id = 'id_example'; // string | The Id of the PayRunEntry. +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->payslipReports($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payslipReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **id** | **string**| The Id of the PayRunEntry. | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PayslipReportResponse**](../Model/PayslipReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json`, `text/html`, `application/octet-stream` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payslipsReports()` + +```php +payslipsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending): \SynergiTech\Staffology\Model\ReportResponse +``` + +Payslips + +Returns all Payslips for the given PayRun If you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field. As there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string +$ordinal = 1; // int +$unemailed = false; // bool | Set this to True if you only want the Payslips that haven't been sent by email +$deptCode = 'deptCode_example'; // string | Set if you want to filter by department +$startersLeaversFilter = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\StartersLeaversFilter(); // \SynergiTech\Staffology\Model\StartersLeaversFilter +$pageNum = 56; // int +$pageSize = 56; // int +$sortBy = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayRunEntrySortBy(); // \SynergiTech\Staffology\Model\PayRunEntrySortBy +$sortDescending = false; // bool + +try { + $result = $apiInstance->payslipsReports($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->payslipsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **unemailed** | **bool**| Set this to True if you only want the Payslips that haven't been sent by email | [optional] [default to false] | +| **deptCode** | **string**| Set if you want to filter by department | [optional] | +| **startersLeaversFilter** | [**\SynergiTech\Staffology\Model\StartersLeaversFilter**](../Model/.md)| | [optional] | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | +| **sortBy** | [**\SynergiTech\Staffology\Model\PayRunEntrySortBy**](../Model/.md)| | [optional] | +| **sortDescending** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pensionMembershipsReports()` + +```php +pensionMembershipsReports($employerId, $taxYear, $payPeriod, $accept, $ordinal): \SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse +``` + +Export Multiple Pension Memberships Report + +Returns a report for Multiple Pension Memberships + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->pensionMembershipsReports($employerId, $taxYear, $payPeriod, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->pensionMembershipsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse**](../Model/PensionMembershipsReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `rightToWorkReports()` + +```php +rightToWorkReports($employerId, $accept): \SynergiTech\Staffology\Model\RightToWorkReportReportResponse +``` + +RightToWork + +Returns a report summarising RightToWork information for all employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->rightToWorkReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->rightToWorkReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\RightToWorkReportReportResponse**](../Model/RightToWorkReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `spinePointReports()` + +```php +spinePointReports($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept): \SynergiTech\Staffology\Model\SpinePointReportReportResponse +``` + +Spine Point + +Returns a report for Spine Point. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$paySpineId = 'paySpineId_example'; // string +$effectiveDateFrom = 'effectiveDateFrom_example'; // string +$effectiveDateTo = 'effectiveDateTo_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->spinePointReports($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->spinePointReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **paySpineId** | **string**| | [optional] | +| **effectiveDateFrom** | **string**| | [optional] | +| **effectiveDateTo** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\SpinePointReportReportResponse**](../Model/SpinePointReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `statutoryPayReports()` + +```php +statutoryPayReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal): \SynergiTech\Staffology\Model\StatutoryPayReportReportResponse +``` + +Statutory Pay + +Returns a report detailing statutory pay for one or more pay periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$statutoryPayTypes = 'statutoryPayTypes_example'; // string | Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->statutoryPayReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->statutoryPayReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **statutoryPayTypes** | **string**| Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse**](../Model/StatutoryPayReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `taxCodeChangesReports()` + +```php +taxCodeChangesReports($employerId, $taxYear, $accept): \SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse +``` + +Taxcode Change + +Returns a CSV file containing Tax Code Changes values for all Employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->taxCodeChangesReports($employerId, $taxYear, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->taxCodeChangesReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse**](../Model/TaxCodeChangeReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `teachersPensionEoyReports()` + +```php +teachersPensionEoyReports($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept): \SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse +``` + +Teachers Pension Eoy Report + +Returns a report response containing the Teachers Pension EOYC Report + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$localAuthorityNumber = 'localAuthorityNumber_example'; // string +$schoolEmployerType = 'schoolEmployerType_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->teachersPensionEoyReports($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->teachersPensionEoyReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **localAuthorityNumber** | **string**| | [optional] | +| **schoolEmployerType** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse**](../Model/TeachersPensionEoyReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `umbrellaReconciliationReports()` + +```php +umbrellaReconciliationReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId): \SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse +``` + +Umbrella Reconciliation + +Returns an Umbrella Reconciliation report. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriod = 56; // int +$toPeriod = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int +$employeeId = 'employeeId_example'; // string | Specify an employee id to report on just that employee, otherwise all employees will be included. + +try { + $result = $apiInstance->umbrellaReconciliationReports($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->umbrellaReconciliationReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | +| **employeeId** | **string**| Specify an employee id to report on just that employee, otherwise all employees will be included. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse**](../Model/UmbrellaReconciliationReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `varianceReportReports()` + +```php +varianceReportReports($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept): \SynergiTech\Staffology\Model\VarianceReportReportResponse +``` + +Variance Report + +Returns a report comparing two pay periods or two ranges of pay periods. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$ordinal = 56; // int +$fromPeriod = 56; // int +$toPeriod = 56; // int +$payPeriodCompare = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$ordinalCompare = 56; // int +$taxYearCompare = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$fromPeriodCompare = 56; // int +$toPeriodCompare = 56; // int +$showPercentage = True; // bool | If true then any variations will be shown as a percentage. +$minChange = 3.4; // float | Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->varianceReportReports($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->varianceReportReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **ordinal** | **int**| | [optional] | +| **fromPeriod** | **int**| | [optional] | +| **toPeriod** | **int**| | [optional] | +| **payPeriodCompare** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | [optional] | +| **ordinalCompare** | **int**| | [optional] | +| **taxYearCompare** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | [optional] | +| **fromPeriodCompare** | **int**| | [optional] | +| **toPeriodCompare** | **int**| | [optional] | +| **showPercentage** | **bool**| If true then any variations will be shown as a percentage. | [optional] | +| **minChange** | **float**| Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\VarianceReportReportResponse**](../Model/VarianceReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `text/html`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `warningsReports()` + +```php +warningsReports($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal): \SynergiTech\Staffology\Model\WarningsReportReportResponse +``` + +Export Payroll Run Warnings + +Returns a report for payroll warnings + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$taxYear = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\TaxYear(); // \SynergiTech\Staffology\Model\TaxYear +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods +$periodNumber = 56; // int +$accept = 'accept_example'; // string +$ordinal = 1; // int + +try { + $result = $apiInstance->warningsReports($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->warningsReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](../Model/.md)| | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| | | +| **periodNumber** | **int**| | | +| **accept** | **string**| | [optional] | +| **ordinal** | **int**| | [optional] [default to 1] | + +### Return type + +[**\SynergiTech\Staffology\Model\WarningsReportReportResponse**](../Model/WarningsReportReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv`, `application/pdf` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `ytdReports()` + +```php +ytdReports($employerId, $accept): \SynergiTech\Staffology\Model\ReportResponse +``` + +Year To Date Values + +Returns a CSV file containing YTD values for all Employees. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$accept = 'accept_example'; // string + +try { + $result = $apiInstance->ytdReports($employerId, $accept); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsApi->ytdReports: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | [optional] | +| **accept** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ReportsAsyncApi.md b/docs/Api/ReportsAsyncApi.md new file mode 100644 index 0000000..8e42ef4 --- /dev/null +++ b/docs/Api/ReportsAsyncApi.md @@ -0,0 +1,72 @@ +# SynergiTech\Staffology\ReportsAsyncApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**queueGrossToNetReportReportsAsync()**](ReportsAsyncApi.md#queueGrossToNetReportReportsAsync) | **POST** /employers/{employerId}/reports-async/gross-to-net | Gross To Net async (beta) | + + +## `queueGrossToNetReportReportsAsync()` + +```php +queueGrossToNetReportReportsAsync($employerId, $contractGrossToNetReportRequest): \SynergiTech\Staffology\Model\ContractJobResponse +``` + +Gross To Net async (beta) + +Returns a job that is created to process a report comparing employees' gross pay with their net pay for one or more pay periods. This endpoint is currently being beta tested and subject to un-announced breaking changes. Use the GET of Jobs to get the status and response of the job. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ReportsAsyncApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$contractGrossToNetReportRequest = new \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest(); // \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest | The request payload for the gross to net report + +try { + $result = $apiInstance->queueGrossToNetReportReportsAsync($employerId, $contractGrossToNetReportRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ReportsAsyncApi->queueGrossToNetReportReportsAsync: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractGrossToNetReportRequest** | [**\SynergiTech\Staffology\Model\ContractGrossToNetReportRequest**](../Model/ContractGrossToNetReportRequest.md)| The request payload for the gross to net report | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractJobResponse**](../Model/ContractJobResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TagApi.md b/docs/Api/TagApi.md new file mode 100644 index 0000000..0c971be --- /dev/null +++ b/docs/Api/TagApi.md @@ -0,0 +1,527 @@ +# SynergiTech\Staffology\TagApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createTag()**](TagApi.md#createTag) | **POST** /employers/{employerId}/tags | Create Tag | +| [**deleteTag()**](TagApi.md#deleteTag) | **DELETE** /employers/{employerId}/tags/{code} | Delete Tag (deprecated) | +| [**deleteTagTag()**](TagApi.md#deleteTagTag) | **DELETE** /employers/{employerId}/tags/tag | Delete Tag | +| [**getTag()**](TagApi.md#getTag) | **GET** /employers/{employerId}/tags/{code} | Get Tag (deprecated) | +| [**getTagTag()**](TagApi.md#getTagTag) | **GET** /employers/{employerId}/tags/Tag | Get Tag | +| [**indexTag()**](TagApi.md#indexTag) | **GET** /employers/{employerId}/tags | List Tags | +| [**updateTag()**](TagApi.md#updateTag) | **PUT** /employers/{employerId}/tags/{code} | Update Tag (deprecated) | +| [**updateTagTag()**](TagApi.md#updateTagTag) | **PUT** /employers/{employerId}/tags/tag | Update Tag | + + +## `createTag()` + +```php +createTag($employerId, $tag): \SynergiTech\Staffology\Model\Tag +``` + +Create Tag + +Creates a new Tag for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$tag = new \SynergiTech\Staffology\Model\Tag(); // \SynergiTech\Staffology\Model\Tag | The new values for the Tag you want to update. + +try { + $result = $apiInstance->createTag($employerId, $tag); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->createTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **tag** | [**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md)| The new values for the Tag you want to update. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteTag()` + +```php +deleteTag($employerId, $code) +``` + +Delete Tag (deprecated) + +Deletes the specified Tag. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The code of the Tag you want to delete. + +try { + $apiInstance->deleteTag($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling TagApi->deleteTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The code of the Tag you want to delete. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteTagTag()` + +```php +deleteTagTag($employerId, $code) +``` + +Delete Tag + +Deletes the specified Tag. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The code of the Tag you want to delete. + +try { + $apiInstance->deleteTagTag($employerId, $code); +} catch (Exception $e) { + echo 'Exception when calling TagApi->deleteTagTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The code of the Tag you want to delete. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTag()` + +```php +getTag($employerId, $code): \SynergiTech\Staffology\Model\Tag +``` + +Get Tag (deprecated) + +Gets the Tag specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The code of the Tag you want to retrieve. + +try { + $result = $apiInstance->getTag($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->getTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The code of the Tag you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTagTag()` + +```php +getTagTag($employerId, $code): \SynergiTech\Staffology\Model\Tag +``` + +Get Tag + +Gets the Tag specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The code of the Tag you want to retrieve. + +try { + $result = $apiInstance->getTagTag($employerId, $code); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->getTagTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The code of the Tag you want to retrieve. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexTag()` + +```php +indexTag($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Tags + +Lists all Tags for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Tags + +try { + $result = $apiInstance->indexTag($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->indexTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Tags | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTag()` + +```php +updateTag($employerId, $code, $tag): \SynergiTech\Staffology\Model\Tag +``` + +Update Tag (deprecated) + +Updates a Tag for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The existing code of the Tag you want to update. +$tag = new \SynergiTech\Staffology\Model\Tag(); // \SynergiTech\Staffology\Model\Tag | The new values for the Tag you want to update. + +try { + $result = $apiInstance->updateTag($employerId, $code, $tag); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->updateTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The existing code of the Tag you want to update. | | +| **tag** | [**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md)| The new values for the Tag you want to update. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTagTag()` + +```php +updateTagTag($employerId, $code, $tag): \SynergiTech\Staffology\Model\Tag +``` + +Update Tag + +Updates the details of an existing Tag. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TagApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Tag belongs. +$code = 'code_example'; // string | The existing code of the Tag you want to update. +$tag = new \SynergiTech\Staffology\Model\Tag(); // \SynergiTech\Staffology\Model\Tag | The new values for the Tag you want to update. + +try { + $result = $apiInstance->updateTagTag($employerId, $code, $tag); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TagApi->updateTagTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Tag belongs. | | +| **code** | **string**| The existing code of the Tag you want to update. | [optional] | +| **tag** | [**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md)| The new values for the Tag you want to update. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tag**](../Model/Tag.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TenantApi.md b/docs/Api/TenantApi.md new file mode 100644 index 0000000..a1ef19d --- /dev/null +++ b/docs/Api/TenantApi.md @@ -0,0 +1,3679 @@ +# SynergiTech\Staffology\TenantApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addAdminUserTenant()**](TenantApi.md#addAdminUserTenant) | **POST** /tenants/{id}/users/admins | Add Admin User | +| [**adminUsersTenant()**](TenantApi.md#adminUsersTenant) | **GET** /tenants/{id}/users/admins | List Admin Users | +| [**billTenant()**](TenantApi.md#billTenant) | **GET** /tenants/{id}/bills/{year}/{month}/{billId} | Get Bill | +| [**billsTenant()**](TenantApi.md#billsTenant) | **GET** /tenants/{id}/bills/{year}/{month} | Get Bills | +| [**createBillsTenant()**](TenantApi.md#createBillsTenant) | **POST** /tenants/bills | Create Bills for Period | +| [**createPayrollSquadTenant()**](TenantApi.md#createPayrollSquadTenant) | **POST** /tenants/{id}/payrollsquad | Create Payroll Squad | +| [**createPricingTableTenant()**](TenantApi.md#createPricingTableTenant) | **POST** /tenants/{id}/pricingtables | Create PricingTable | +| [**createTenant()**](TenantApi.md#createTenant) | **POST** /tenants | Create a Tenant | +| [**deletePayrollSquadMemberTenant()**](TenantApi.md#deletePayrollSquadMemberTenant) | **DELETE** /tenants/{id}/payrollsquad/{payrollSquadId}/member/{payrollSquadMemberId} | Delete Payroll Squad Member | +| [**deletePayrollSquadTenant()**](TenantApi.md#deletePayrollSquadTenant) | **DELETE** /tenants/{id}/payrollsquad/{payrollSquadId} | Delete Payroll Squad and it's Members and Employers. | +| [**deletePricingTableTenant()**](TenantApi.md#deletePricingTableTenant) | **DELETE** /tenants/{id}/pricingtables/{pricingTableId} | Delete PricingTable | +| [**disabledTenant()**](TenantApi.md#disabledTenant) | **PUT** /tenants/{id}/users/{userId}/disabled | Disable User Account | +| [**employerCreationTenant()**](TenantApi.md#employerCreationTenant) | **PUT** /tenants/{id}/users/{userId}/employercreation | Enable Employer Creation | +| [**employerUsageTenant()**](TenantApi.md#employerUsageTenant) | **GET** /tenants/{id}/employers/{employerId}/usage | Get Employer Usage | +| [**employerUsersTenant()**](TenantApi.md#employerUsersTenant) | **GET** /tenants/{id}/employers/{employerId}/users | Get Employer Users | +| [**getApiMailingListReportByIdTenant()**](TenantApi.md#getApiMailingListReportByIdTenant) | **GET** /tenants/{id}/reports/apimailinglist | Api Mailing List Report | +| [**getApiMailingListReportTenant()**](TenantApi.md#getApiMailingListReportTenant) | **GET** /tenants/reports/apimailinglist | Api Mailing List Report | +| [**getEmployersTenant()**](TenantApi.md#getEmployersTenant) | **GET** /tenants/{id}/users/employers | Get Employers | +| [**getPayrollSquadTenant()**](TenantApi.md#getPayrollSquadTenant) | **GET** /tenants/{id}/payrollsquad/{payrollSquadId} | Get Payroll Squad | +| [**getPayrollSquadsTenant()**](TenantApi.md#getPayrollSquadsTenant) | **GET** /tenants/{id}/payrollsquad | Get Payroll Squads | +| [**getPricingTableTenant()**](TenantApi.md#getPricingTableTenant) | **GET** /tenants/{id}/pricingtables/{pricingTableId} | Get PricingTable | +| [**getPricingTablesTenant()**](TenantApi.md#getPricingTablesTenant) | **GET** /tenants/{id}/pricingtables | Get PricingTables | +| [**getRtiSubmissionSettingsTenant()**](TenantApi.md#getRtiSubmissionSettingsTenant) | **GET** /tenants/ritsubmissionsettings | Get RtiSubmissionSettings | +| [**getTenant()**](TenantApi.md#getTenant) | **GET** /tenants/{id} | Get a Tenant | +| [**getUsersWithNoBillableActivityTenant()**](TenantApi.md#getUsersWithNoBillableActivityTenant) | **GET** /tenants/{id}/reports/users/nobillableactivity | Get Users with no Billable Activity. | +| [**netSuiteBillingTenant()**](TenantApi.md#netSuiteBillingTenant) | **GET** /tenants/{id}/reports/netsuitebills | NetSuite Billing Report | +| [**payrollSquadAddMemberTenant()**](TenantApi.md#payrollSquadAddMemberTenant) | **POST** /tenants/{id}/payrollsquad/member | Add Payroll Squad Member | +| [**payrollSquadUpdateEmployersTenant()**](TenantApi.md#payrollSquadUpdateEmployersTenant) | **POST** /tenants/{id}/payrollsquad/employers | Update Payroll Squad Employers | +| [**removeAdminUserTenant()**](TenantApi.md#removeAdminUserTenant) | **DELETE** /tenants/{id}/users/admins | Remove Admin User | +| [**setAccountingIdTenant()**](TenantApi.md#setAccountingIdTenant) | **PUT** /tenants/{id}/users/{userId}/accounting | Set User Accounting Id | +| [**setAddressTenant()**](TenantApi.md#setAddressTenant) | **PUT** /tenants/{id}/users/{userId}/address | Set Address | +| [**setBureauRedirectEmailAddressTenant()**](TenantApi.md#setBureauRedirectEmailAddressTenant) | **PUT** /tenants/{id}/users/{userId}/bureauredir | Set Bureau Redirect | +| [**setBusinessNameTenant()**](TenantApi.md#setBusinessNameTenant) | **PUT** /tenants/{id}/users/{userId}/businessname | Set User Business Name | +| [**setCountryTenant()**](TenantApi.md#setCountryTenant) | **PUT** /tenants/{id}/users/{userId}/country | Set Country | +| [**setEmployeeCountTenant()**](TenantApi.md#setEmployeeCountTenant) | **PUT** /tenants/{id}/users/{userId}/employeecount | Set Employee Count | +| [**setEvcTenant()**](TenantApi.md#setEvcTenant) | **PUT** /tenants/{id}/admin/evc | Set Evc | +| [**setIndustryTenant()**](TenantApi.md#setIndustryTenant) | **PUT** /tenants/{id}/users/{userId}/industry | Set Industry | +| [**setMonthlyMinimumTenant()**](TenantApi.md#setMonthlyMinimumTenant) | **PUT** /tenants/{id}/users/{userId}/monthlyminimum | Set Monthly Minimum | +| [**setPricingTableIdTenant()**](TenantApi.md#setPricingTableIdTenant) | **PUT** /tenants/{id}/users/{userId}/pricingtable | Set User PricingTableId | +| [**setTenantTenant()**](TenantApi.md#setTenantTenant) | **PUT** /tenants/{id}/users/{userId}/tenant | Set User Tenant | +| [**updateBillTenant()**](TenantApi.md#updateBillTenant) | **PUT** /tenants/{id}/bills/{year}/{month}/{billId} | Update Bill | +| [**updateCssColorsTenant()**](TenantApi.md#updateCssColorsTenant) | **PUT** /tenants/{id}/css/colors | Update CSS Colors | +| [**updateCssTenant()**](TenantApi.md#updateCssTenant) | **PUT** /tenants/{id}/css | Update CSS | +| [**updateFavIconTenant()**](TenantApi.md#updateFavIconTenant) | **PUT** /tenants/{id}/favicon | Upload Favicon | +| [**updateLogoTenant()**](TenantApi.md#updateLogoTenant) | **PUT** /tenants/{id}/logo | Upload Logo | +| [**updatePricingTableTenant()**](TenantApi.md#updatePricingTableTenant) | **PUT** /tenants/{id}/pricingtables/{pricingTableId} | Update PricingTable | +| [**updateRtiSubmissionSettingsTenant()**](TenantApi.md#updateRtiSubmissionSettingsTenant) | **PUT** /tenants/ritsubmissionsettings | Update RtiSubmissionSettings | +| [**updateTenant()**](TenantApi.md#updateTenant) | **PUT** /tenants/{id} | Update a Tenant | +| [**updateUserTenant()**](TenantApi.md#updateUserTenant) | **PUT** /tenants/{id}/users/{userId} | Update a User | +| [**usageTenant()**](TenantApi.md#usageTenant) | **GET** /tenants/{id}/usage/{year}/{month} | Get Usage | +| [**userBillsTenant()**](TenantApi.md#userBillsTenant) | **GET** /tenants/{id}/users/{userId}/bills | Get User Bills | +| [**userEmployersTenant()**](TenantApi.md#userEmployersTenant) | **GET** /tenants/{id}/users/{userId}/employers | Get User Employers | +| [**userTenant()**](TenantApi.md#userTenant) | **GET** /tenants/{id}/users/{userId} | Get a User | +| [**usersSearchTenant()**](TenantApi.md#usersSearchTenant) | **GET** /tenants/{id}/users/search | Search Users | +| [**usersTenant()**](TenantApi.md#usersTenant) | **GET** /tenants/{id}/users | List Users | +| [**weeklyActivityTenant()**](TenantApi.md#weeklyActivityTenant) | **GET** /tenants/{id}/reports/weeklyactivity | Weekly Activity Report | + + +## `addAdminUserTenant()` + +```php +addAdminUserTenant($id, $body) +``` + +Add Admin User + +Adds the specified user as an admin for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to remove the admin User from. +$body = 'body_example'; // string + +try { + $apiInstance->addAdminUserTenant($id, $body); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->addAdminUserTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to remove the admin User from. | | +| **body** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `adminUsersTenant()` + +```php +adminUsersTenant($id): \SynergiTech\Staffology\Model\Item[] +``` + +List Admin Users + +Returns a list of admin users for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to list admin Users for. + +try { + $result = $apiInstance->adminUsersTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->adminUsersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to list admin Users for. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `billTenant()` + +```php +billTenant($id, $year, $month, $billId): \SynergiTech\Staffology\Model\UsageBill +``` + +Get Bill + +Returns details of a UsageBill for a User of this Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant the bill belongs to. +$year = 56; // int +$month = 56; // int +$billId = 'billId_example'; // string | The Id of the UsageBill. + +try { + $result = $apiInstance->billTenant($id, $year, $month, $billId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->billTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant the bill belongs to. | | +| **year** | **int**| | | +| **month** | **int**| | | +| **billId** | **string**| The Id of the UsageBill. | | + +### Return type + +[**\SynergiTech\Staffology\Model\UsageBill**](../Model/UsageBill.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `billsTenant()` + +```php +billsTenant($id, $year, $month, $includeNetSuiteBills): \SynergiTech\Staffology\Model\Item[] +``` + +Get Bills + +Returns a list of UsageBill for Users of this Tenant, for the Year and Month supplied + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to list bills for. +$year = 56; // int +$month = 56; // int +$includeNetSuiteBills = false; // bool + +try { + $result = $apiInstance->billsTenant($id, $year, $month, $includeNetSuiteBills); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->billsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to list bills for. | | +| **year** | **int**| | | +| **month** | **int**| | | +| **includeNetSuiteBills** | **bool**| | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createBillsTenant()` + +```php +createBillsTenant($month, $year) +``` + +Create Bills for Period + +Generates usage and creates bills for all Tenants Only available to SuperAdmins + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$month = 56; // int +$year = 56; // int + +try { + $apiInstance->createBillsTenant($month, $year); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->createBillsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **month** | **int**| | [optional] | +| **year** | **int**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createPayrollSquadTenant()` + +```php +createPayrollSquadTenant($id, $contractPayrollSquadRequest): \SynergiTech\Staffology\Model\ContractPayrollSquadResponse +``` + +Create Payroll Squad + +Create a Payroll Squad + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$contractPayrollSquadRequest = new \SynergiTech\Staffology\Model\ContractPayrollSquadRequest(); // \SynergiTech\Staffology\Model\ContractPayrollSquadRequest + +try { + $result = $apiInstance->createPayrollSquadTenant($id, $contractPayrollSquadRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->createPayrollSquadTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **contractPayrollSquadRequest** | [**\SynergiTech\Staffology\Model\ContractPayrollSquadRequest**](../Model/ContractPayrollSquadRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayrollSquadResponse**](../Model/ContractPayrollSquadResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createPricingTableTenant()` + +```php +createPricingTableTenant($id, $pricingTable): \SynergiTech\Staffology\Model\PricingTable +``` + +Create PricingTable + +Create a PricingTable + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$pricingTable = new \SynergiTech\Staffology\Model\PricingTable(); // \SynergiTech\Staffology\Model\PricingTable + +try { + $result = $apiInstance->createPricingTableTenant($id, $pricingTable); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->createPricingTableTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **pricingTable** | [**\SynergiTech\Staffology\Model\PricingTable**](../Model/PricingTable.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PricingTable**](../Model/PricingTable.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createTenant()` + +```php +createTenant($tenant): \SynergiTech\Staffology\Model\Tenant +``` + +Create a Tenant + +Use this method to create a new Tenant Only available to SuperAdmins + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$tenant = new \SynergiTech\Staffology\Model\Tenant(); // \SynergiTech\Staffology\Model\Tenant + +try { + $result = $apiInstance->createTenant($tenant); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->createTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tenant** | [**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayrollSquadMemberTenant()` + +```php +deletePayrollSquadMemberTenant($id, $payrollSquadId, $payrollSquadMemberId) +``` + +Delete Payroll Squad Member + +Delete a Payroll Squad Member + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$payrollSquadId = 'payrollSquadId_example'; // string | The id of payroll squad +$payrollSquadMemberId = 'payrollSquadMemberId_example'; // string | The id of payroll squad member + +try { + $apiInstance->deletePayrollSquadMemberTenant($id, $payrollSquadId, $payrollSquadMemberId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->deletePayrollSquadMemberTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **payrollSquadId** | **string**| The id of payroll squad | | +| **payrollSquadMemberId** | **string**| The id of payroll squad member | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayrollSquadTenant()` + +```php +deletePayrollSquadTenant($id, $payrollSquadId) +``` + +Delete Payroll Squad and it's Members and Employers. + +Delete Payroll Squad with it's Members and Employers. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$payrollSquadId = 'payrollSquadId_example'; // string | The id of payroll squad + +try { + $apiInstance->deletePayrollSquadTenant($id, $payrollSquadId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->deletePayrollSquadTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **payrollSquadId** | **string**| The id of payroll squad | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePricingTableTenant()` + +```php +deletePricingTableTenant($id, $pricingTableId) +``` + +Delete PricingTable + +Delete a PricingTable + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$pricingTableId = 'pricingTableId_example'; // string + +try { + $apiInstance->deletePricingTableTenant($id, $pricingTableId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->deletePricingTableTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **pricingTableId** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `disabledTenant()` + +```php +disabledTenant($id, $userId, $disabled, $loginDisabled, $body) +``` + +Disable User Account + +Disables (or re-enabled) a user account + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$disabled = True; // bool | Whether or not the account should be disabled. +$loginDisabled = True; // bool | Whether or not the account should have log in permissions. +$body = 'body_example'; // string | A message to show the user explaining why the account is disabled. + +try { + $apiInstance->disabledTenant($id, $userId, $disabled, $loginDisabled, $body); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->disabledTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **disabled** | **bool**| Whether or not the account should be disabled. | [optional] | +| **loginDisabled** | **bool**| Whether or not the account should have log in permissions. | [optional] | +| **body** | **string**| A message to show the user explaining why the account is disabled. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employerCreationTenant()` + +```php +employerCreationTenant($id, $userId, $enabled) +``` + +Enable Employer Creation + +Enable (or disable) a user accounts ability to create new employers + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$enabled = True; // bool | Whether or not the account can create employers. + +try { + $apiInstance->employerCreationTenant($id, $userId, $enabled); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->employerCreationTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **enabled** | **bool**| Whether or not the account can create employers. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employerUsageTenant()` + +```php +employerUsageTenant($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Get Employer Usage + +Returns all activity for the given Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$employerId = 'employerId_example'; // string | The Id of the Employer. + +try { + $result = $apiInstance->employerUsageTenant($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->employerUsageTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **employerId** | **string**| The Id of the Employer. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `employerUsersTenant()` + +```php +employerUsersTenant($id, $employerId): \SynergiTech\Staffology\Model\Item[] +``` + +Get Employer Users + +Returns all users for the given Employer + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$employerId = 'employerId_example'; // string | The Id of the Employer. + +try { + $result = $apiInstance->employerUsersTenant($id, $employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->employerUsersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **employerId** | **string**| The Id of the Employer. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiMailingListReportByIdTenant()` + +```php +getApiMailingListReportByIdTenant($id): \SynergiTech\Staffology\Model\ReportResponse +``` + +Api Mailing List Report + +Returns a report of active users that have asked to be updated about API for specific tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->getApiMailingListReportByIdTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getApiMailingListReportByIdTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiMailingListReportTenant()` + +```php +getApiMailingListReportTenant(): \SynergiTech\Staffology\Model\ReportResponse +``` + +Api Mailing List Report + +Returns a report of active users that have asked to be updated about API across all tenants. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getApiMailingListReportTenant(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getApiMailingListReportTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getEmployersTenant()` + +```php +getEmployersTenant($id): \SynergiTech\Staffology\Model\Item[] +``` + +Get Employers + +Returns all the employers of all the users of the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id + +try { + $result = $apiInstance->getEmployersTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getEmployersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayrollSquadTenant()` + +```php +getPayrollSquadTenant($id, $payrollSquadId): \SynergiTech\Staffology\Model\ContractPayrollSquadResponse +``` + +Get Payroll Squad + +Get a Payroll Squad + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$payrollSquadId = 'payrollSquadId_example'; // string | The id of payroll squad + +try { + $result = $apiInstance->getPayrollSquadTenant($id, $payrollSquadId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getPayrollSquadTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **payrollSquadId** | **string**| The id of payroll squad | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayrollSquadResponse**](../Model/ContractPayrollSquadResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayrollSquadsTenant()` + +```php +getPayrollSquadsTenant($id): \SynergiTech\Staffology\Model\Item[] +``` + +Get Payroll Squads + +Returns all Payroll Squad for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id + +try { + $result = $apiInstance->getPayrollSquadsTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getPayrollSquadsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPricingTableTenant()` + +```php +getPricingTableTenant($id, $pricingTableId): \SynergiTech\Staffology\Model\PricingTable +``` + +Get PricingTable + +Get a PricingTable + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$pricingTableId = 'pricingTableId_example'; // string + +try { + $result = $apiInstance->getPricingTableTenant($id, $pricingTableId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getPricingTableTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **pricingTableId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\PricingTable**](../Model/PricingTable.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPricingTablesTenant()` + +```php +getPricingTablesTenant($id): \SynergiTech\Staffology\Model\Item[] +``` + +Get PricingTables + +Returns all PricingTables for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->getPricingTablesTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getPricingTablesTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRtiSubmissionSettingsTenant()` + +```php +getRtiSubmissionSettingsTenant($id): \SynergiTech\Staffology\Model\RtiSubmissionSettings +``` + +Get RtiSubmissionSettings + +If the Tenant has BureauFeaturesEnabled then they can store RtiSubmissionSettings for use across multiple employers. This end point returns them RtiSubmissionSettings. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. + +try { + $result = $apiInstance->getRtiSubmissionSettingsTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getRtiSubmissionSettingsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\RtiSubmissionSettings**](../Model/RtiSubmissionSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTenant()` + +```php +getTenant($id): \SynergiTech\Staffology\Model\Tenant +``` + +Get a Tenant + +If you are an administrator for a Tenant then you can retrieve the settings for it using this API call + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to retrieve. + +try { + $result = $apiInstance->getTenant($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUsersWithNoBillableActivityTenant()` + +```php +getUsersWithNoBillableActivityTenant($id, $month, $year): \SynergiTech\Staffology\Model\ReportResponse +``` + +Get Users with no Billable Activity. + +Returns a .csv file containing users created in or before the given month that do not have billable activity. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant +$month = 56; // int +$year = 56; // int + +try { + $result = $apiInstance->getUsersWithNoBillableActivityTenant($id, $month, $year); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->getUsersWithNoBillableActivityTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | +| **month** | **int**| | [optional] | +| **year** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `netSuiteBillingTenant()` + +```php +netSuiteBillingTenant($id, $year, $month, $accept, $allTenants): \SynergiTech\Staffology\Model\ReportResponse +``` + +NetSuite Billing Report + +Returns a report detailing billing, for NetSuite, for the given year and month Only available to SuperAdmins + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant +$year = 56; // int | The year of the billing period +$month = 56; // int | The month of the billing period +$accept = 'accept_example'; // string +$allTenants = false; // bool | If set to true then the report will include all Tenants to which you have access + +try { + $result = $apiInstance->netSuiteBillingTenant($id, $year, $month, $accept, $allTenants); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->netSuiteBillingTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | +| **year** | **int**| The year of the billing period | [optional] | +| **month** | **int**| The month of the billing period | [optional] | +| **accept** | **string**| | [optional] | +| **allTenants** | **bool**| If set to true then the report will include all Tenants to which you have access | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrollSquadAddMemberTenant()` + +```php +payrollSquadAddMemberTenant($id, $contractPayrollSquadMemberRequest): \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse +``` + +Add Payroll Squad Member + +Add Payroll Squad Member + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$contractPayrollSquadMemberRequest = new \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest(); // \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest + +try { + $result = $apiInstance->payrollSquadAddMemberTenant($id, $contractPayrollSquadMemberRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->payrollSquadAddMemberTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **contractPayrollSquadMemberRequest** | [**\SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest**](../Model/ContractPayrollSquadMemberRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse**](../Model/ContractPayrollSquadMemberResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payrollSquadUpdateEmployersTenant()` + +```php +payrollSquadUpdateEmployersTenant($id, $contractPayrollSquadEmployerRequest): \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[] +``` + +Update Payroll Squad Employers + +Update Payroll Squad Employers + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Current tenant id +$contractPayrollSquadEmployerRequest = new \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest(); // \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest + +try { + $result = $apiInstance->payrollSquadUpdateEmployersTenant($id, $contractPayrollSquadEmployerRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->payrollSquadUpdateEmployersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| Current tenant id | | +| **contractPayrollSquadEmployerRequest** | [**\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest**](../Model/ContractPayrollSquadEmployerRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]**](../Model/ContractPayrollSquadEmployerResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removeAdminUserTenant()` + +```php +removeAdminUserTenant($id, $body) +``` + +Remove Admin User + +Removes the specified admin user for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to remove the admin User from. +$body = 'body_example'; // string + +try { + $apiInstance->removeAdminUserTenant($id, $body); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->removeAdminUserTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to remove the admin User from. | | +| **body** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setAccountingIdTenant()` + +```php +setAccountingIdTenant($id, $userId, $accountingId) +``` + +Set User Accounting Id + +Updates the Customer Accounting Id for a user + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$accountingId = 'accountingId_example'; // string | The CustomerAccountingId for the user. + +try { + $apiInstance->setAccountingIdTenant($id, $userId, $accountingId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setAccountingIdTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **accountingId** | **string**| The CustomerAccountingId for the user. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setAddressTenant()` + +```php +setAddressTenant($id, $userId, $user) +``` + +Set Address + +Updates the Address for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string | The Id of the User. +$user = new \SynergiTech\Staffology\Model\User(); // \SynergiTech\Staffology\Model\User + +try { + $apiInstance->setAddressTenant($id, $userId, $user); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setAddressTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| The Id of the User. | | +| **user** | [**\SynergiTech\Staffology\Model\User**](../Model/User.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setBureauRedirectEmailAddressTenant()` + +```php +setBureauRedirectEmailAddressTenant($id, $userId, $emailAddress) +``` + +Set Bureau Redirect + +Sets or removes the redirect email address for a users Bureau-related notifications + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$emailAddress = 'emailAddress_example'; // string | The email address to redirect to, or an empty string to remove the redirect. + +try { + $apiInstance->setBureauRedirectEmailAddressTenant($id, $userId, $emailAddress); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setBureauRedirectEmailAddressTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **emailAddress** | **string**| The email address to redirect to, or an empty string to remove the redirect. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setBusinessNameTenant()` + +```php +setBusinessNameTenant($id, $userId, $businessName) +``` + +Set User Business Name + +Updates the Business Name for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string | The Id of the User. +$businessName = 'businessName_example'; // string | The Business Name for the User. + +try { + $apiInstance->setBusinessNameTenant($id, $userId, $businessName); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setBusinessNameTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| The Id of the User. | | +| **businessName** | **string**| The Business Name for the User. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setCountryTenant()` + +```php +setCountryTenant($id, $userId, $country) +``` + +Set Country + +Updates the Country for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string | The Id of the User. +$country = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\Country(); // \SynergiTech\Staffology\Model\Country | The Country for the User. + +try { + $apiInstance->setCountryTenant($id, $userId, $country); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setCountryTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| The Id of the User. | | +| **country** | [**\SynergiTech\Staffology\Model\Country**](../Model/.md)| The Country for the User. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEmployeeCountTenant()` + +```php +setEmployeeCountTenant($id, $userId, $employeeCount) +``` + +Set Employee Count + +Updates the Employee Count for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string | The Id of the User. +$employeeCount = 56; // int | The Employee Count for the User. + +try { + $apiInstance->setEmployeeCountTenant($id, $userId, $employeeCount); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setEmployeeCountTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| The Id of the User. | | +| **employeeCount** | **int**| The Employee Count for the User. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setEvcTenant()` + +```php +setEvcTenant($id, $disableEvc) +``` + +Set Evc + +Disables or enables EVC for a tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the tenant +$disableEvc = True; // bool | A boolean value indicating whether to disable or enable EVC at tenant level. + +try { + $apiInstance->setEvcTenant($id, $disableEvc); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setEvcTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the tenant | | +| **disableEvc** | **bool**| A boolean value indicating whether to disable or enable EVC at tenant level. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setIndustryTenant()` + +```php +setIndustryTenant($id, $userId, $industry) +``` + +Set Industry + +Updates the Industry for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string | The Id of the User. +$industry = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\UserIndustry(); // \SynergiTech\Staffology\Model\UserIndustry | The Industry for the User. + +try { + $apiInstance->setIndustryTenant($id, $userId, $industry); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setIndustryTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| The Id of the User. | | +| **industry** | [**\SynergiTech\Staffology\Model\UserIndustry**](../Model/.md)| The Industry for the User. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setMonthlyMinimumTenant()` + +```php +setMonthlyMinimumTenant($id, $userId, $monthlyMinimum) +``` + +Set Monthly Minimum + +Updates the MonthlyMinimum subscription charge for a user + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$monthlyMinimum = new \SynergiTech\Staffology\Model\MonthlyMinimum(); // \SynergiTech\Staffology\Model\MonthlyMinimum + +try { + $apiInstance->setMonthlyMinimumTenant($id, $userId, $monthlyMinimum); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setMonthlyMinimumTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **monthlyMinimum** | [**\SynergiTech\Staffology\Model\MonthlyMinimum**](../Model/MonthlyMinimum.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setPricingTableIdTenant()` + +```php +setPricingTableIdTenant($id, $userId, $pricingTableId) +``` + +Set User PricingTableId + +Updates the Customer Accounting Id for a user + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$userId = 'userId_example'; // string +$pricingTableId = 'pricingTableId_example'; // string | The PricingTable Id for the user. Provide null and the user will use the Tenant default + +try { + $apiInstance->setPricingTableIdTenant($id, $userId, $pricingTableId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setPricingTableIdTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **userId** | **string**| | | +| **pricingTableId** | **string**| The PricingTable Id for the user. Provide null and the user will use the Tenant default | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setTenantTenant()` + +```php +setTenantTenant($id, $userId, $newTenantId) +``` + +Set User Tenant + +Changes the Tenant for a User. Only applicable if you manage two or more Tenants + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant the user is currently assigned to. +$userId = 'userId_example'; // string +$newTenantId = 'newTenantId_example'; // string | The Id of the Tenant the user is to be assigned to. + +try { + $apiInstance->setTenantTenant($id, $userId, $newTenantId); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->setTenantTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant the user is currently assigned to. | | +| **userId** | **string**| | | +| **newTenantId** | **string**| The Id of the Tenant the user is to be assigned to. | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateBillTenant()` + +```php +updateBillTenant($id, $year, $month, $billId, $usageBill): \SynergiTech\Staffology\Model\UsageBill +``` + +Update Bill + +Updates the UsageBill. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant the bill belongs to. +$year = 56; // int +$month = 56; // int +$billId = 'billId_example'; // string | The Id of the UsageBill. +$usageBill = new \SynergiTech\Staffology\Model\UsageBill(); // \SynergiTech\Staffology\Model\UsageBill + +try { + $result = $apiInstance->updateBillTenant($id, $year, $month, $billId, $usageBill); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateBillTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant the bill belongs to. | | +| **year** | **int**| | | +| **month** | **int**| | | +| **billId** | **string**| The Id of the UsageBill. | | +| **usageBill** | [**\SynergiTech\Staffology\Model\UsageBill**](../Model/UsageBill.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\UsageBill**](../Model/UsageBill.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCssColorsTenant()` + +```php +updateCssColorsTenant($id, $stringStringKeyValuePair): \SynergiTech\Staffology\Model\StringStringKeyValuePair[] +``` + +Update CSS Colors + +Update the colors for a Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update. +$stringStringKeyValuePair = array(new \SynergiTech\Staffology\Model\StringStringKeyValuePair()); // \SynergiTech\Staffology\Model\StringStringKeyValuePair[] + +try { + $result = $apiInstance->updateCssColorsTenant($id, $stringStringKeyValuePair); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateCssColorsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update. | | +| **stringStringKeyValuePair** | [**\SynergiTech\Staffology\Model\StringStringKeyValuePair[]**](../Model/StringStringKeyValuePair.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\StringStringKeyValuePair[]**](../Model/StringStringKeyValuePair.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCssTenant()` + +```php +updateCssTenant($id, $body): string +``` + +Update CSS + +Update the custom CSS for a Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update. +$body = 'body_example'; // string + +try { + $result = $apiInstance->updateCssTenant($id, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateCssTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update. | | +| **body** | **string**| | [optional] | + +### Return type + +**string** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateFavIconTenant()` + +```php +updateFavIconTenant($id, $file): \SynergiTech\Staffology\Model\Tenant +``` + +Upload Favicon + +Upload an image to use as favicon. We'll upload it and set the URL on the FavIcon property of the Tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->updateFavIconTenant($id, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateFavIconTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update. | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLogoTenant()` + +```php +updateLogoTenant($id, $file): \SynergiTech\Staffology\Model\Tenant +``` + +Upload Logo + +Upload an image to use as your main logo. We'll upload it and set the URL on the HomeImgUrl property of the Tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update. +$file = '/path/to/file.txt'; // \SplFileObject + +try { + $result = $apiInstance->updateLogoTenant($id, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateLogoTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update. | | +| **file** | **\SplFileObject****\SplFileObject**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePricingTableTenant()` + +```php +updatePricingTableTenant($id, $pricingTableId, $pricingTable): \SynergiTech\Staffology\Model\PricingTable +``` + +Update PricingTable + +Update a PricingTables + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$pricingTableId = 'pricingTableId_example'; // string +$pricingTable = new \SynergiTech\Staffology\Model\PricingTable(); // \SynergiTech\Staffology\Model\PricingTable + +try { + $result = $apiInstance->updatePricingTableTenant($id, $pricingTableId, $pricingTable); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updatePricingTableTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **pricingTableId** | **string**| | | +| **pricingTable** | [**\SynergiTech\Staffology\Model\PricingTable**](../Model/PricingTable.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\PricingTable**](../Model/PricingTable.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateRtiSubmissionSettingsTenant()` + +```php +updateRtiSubmissionSettingsTenant($id, $rtiSubmissionSettings): \SynergiTech\Staffology\Model\RtiSubmissionSettings +``` + +Update RtiSubmissionSettings + +If the Tenant has BureauFeaturesEnabled then they can store RtiSubmissionSettings for use across multiple employers. This end point updates the RtiSubmissionSettings. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$rtiSubmissionSettings = new \SynergiTech\Staffology\Model\RtiSubmissionSettings(); // \SynergiTech\Staffology\Model\RtiSubmissionSettings + +try { + $result = $apiInstance->updateRtiSubmissionSettingsTenant($id, $rtiSubmissionSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateRtiSubmissionSettingsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | [optional] | +| **rtiSubmissionSettings** | [**\SynergiTech\Staffology\Model\RtiSubmissionSettings**](../Model/RtiSubmissionSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\RtiSubmissionSettings**](../Model/RtiSubmissionSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTenant()` + +```php +updateTenant($id, $tenant): \SynergiTech\Staffology\Model\Tenant +``` + +Update a Tenant + +If you are an administrator for a Tenant then you can update the settings for it using this API call + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update. +$tenant = new \SynergiTech\Staffology\Model\Tenant(); // \SynergiTech\Staffology\Model\Tenant + +try { + $result = $apiInstance->updateTenant($id, $tenant); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update. | | +| **tenant** | [**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Tenant**](../Model/Tenant.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateUserTenant()` + +```php +updateUserTenant($id, $userId, $user): \SynergiTech\Staffology\Model\User +``` + +Update a User + +Set the details of a User that belongs to the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to update a User for. +$userId = 'userId_example'; // string | The Id of the User. +$user = new \SynergiTech\Staffology\Model\User(); // \SynergiTech\Staffology\Model\User | The User details. + +try { + $result = $apiInstance->updateUserTenant($id, $userId, $user); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->updateUserTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to update a User for. | | +| **userId** | **string**| The Id of the User. | | +| **user** | [**\SynergiTech\Staffology\Model\User**](../Model/User.md)| The User details. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `usageTenant()` + +```php +usageTenant($id, $year, $month): \SynergiTech\Staffology\Model\Item[] +``` + +Get Usage + +Returns activity for Users of this Tenant, for the Year and Month supplied + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant. +$year = 56; // int +$month = 56; // int + +try { + $result = $apiInstance->usageTenant($id, $year, $month); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->usageTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant. | | +| **year** | **int**| | | +| **month** | **int**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `userBillsTenant()` + +```php +userBillsTenant($id, $userId): \SynergiTech\Staffology\Model\Item[] +``` + +Get User Bills + +Returns all UsageBills for a User + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to get a Users UsageBills for. +$userId = 'userId_example'; // string + +try { + $result = $apiInstance->userBillsTenant($id, $userId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->userBillsTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to get a Users UsageBills for. | | +| **userId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `userEmployersTenant()` + +```php +userEmployersTenant($id, $userId): \SynergiTech\Staffology\Model\Item[] +``` + +Get User Employers + +Returns Employer details for a User that belongs to the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to get User Employers for. +$userId = 'userId_example'; // string + +try { + $result = $apiInstance->userEmployersTenant($id, $userId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->userEmployersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to get User Employers for. | | +| **userId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `userTenant()` + +```php +userTenant($id, $userId): \SynergiTech\Staffology\Model\User +``` + +Get a User + +Returns details of a User that belongs to the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to get a User for. +$userId = 'userId_example'; // string + +try { + $result = $apiInstance->userTenant($id, $userId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->userTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to get a User for. | | +| **userId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\User**](../Model/User.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `usersSearchTenant()` + +```php +usersSearchTenant($id, $q): \SynergiTech\Staffology\Model\Item[] +``` + +Search Users + +Returns a list of users for the Tenant that match the search + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to search Users for. +$q = 'q_example'; // string + +try { + $result = $apiInstance->usersSearchTenant($id, $q); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->usersSearchTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to search Users for. | | +| **q** | **string**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `usersTenant()` + +```php +usersTenant($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember): \SynergiTech\Staffology\Model\Item[] +``` + +List Users + +Returns a list of users for the Tenant + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant you want to list Users for. +$pageNum = 56; // int +$pageSize = 56; // int +$sortByLastLogin = false; // bool +$category = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\UserCategory(); // \SynergiTech\Staffology\Model\UserCategory +$isBureauMember = True; // bool + +try { + $result = $apiInstance->usersTenant($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->usersTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant you want to list Users for. | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | +| **sortByLastLogin** | **bool**| | [optional] [default to false] | +| **category** | [**\SynergiTech\Staffology\Model\UserCategory**](../Model/.md)| | [optional] | +| **isBureauMember** | **bool**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `weeklyActivityTenant()` + +```php +weeklyActivityTenant($id, $fromDate, $toDate, $accept, $allTenants): \SynergiTech\Staffology\Model\ReportResponse +``` + +Weekly Activity Report + +Returns a report detailing User activity, summarised by week, for the given date range + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant +$fromDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$toDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$accept = 'accept_example'; // string +$allTenants = false; // bool | If set to true then the report will include all Tenants to which you have access + +try { + $result = $apiInstance->weeklyActivityTenant($id, $fromDate, $toDate, $accept, $allTenants); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantApi->weeklyActivityTenant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | +| **fromDate** | **\DateTime**| | [optional] | +| **toDate** | **\DateTime**| | [optional] | +| **accept** | **string**| | [optional] | +| **allTenants** | **bool**| If set to true then the report will include all Tenants to which you have access | [optional] [default to false] | + +### Return type + +[**\SynergiTech\Staffology\Model\ReportResponse**](../Model/ReportResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json`, `text/csv` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TenantEmailApi.md b/docs/Api/TenantEmailApi.md new file mode 100644 index 0000000..42fb890 --- /dev/null +++ b/docs/Api/TenantEmailApi.md @@ -0,0 +1,397 @@ +# SynergiTech\Staffology\TenantEmailApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getEmailTenantEmail()**](TenantEmailApi.md#getEmailTenantEmail) | **GET** /tenants/{id}/email/{emailId} | Get Email | +| [**getMailSettingsTenantEmail()**](TenantEmailApi.md#getMailSettingsTenantEmail) | **GET** /tenants/{id}/email/settings | Get MailSettings | +| [**indexTenantEmail()**](TenantEmailApi.md#indexTenantEmail) | **GET** /tenants/{id}/email | List Emails | +| [**resendEmailTenantEmail()**](TenantEmailApi.md#resendEmailTenantEmail) | **POST** /tenants/{id}/email/{emailId} | Re-send Email | +| [**testMailSettingsTenantEmail()**](TenantEmailApi.md#testMailSettingsTenantEmail) | **POST** /tenants/{id}/email/settings/test | Send test email | +| [**updateMailSettingsTenantEmail()**](TenantEmailApi.md#updateMailSettingsTenantEmail) | **PUT** /tenants/{id}/email/settings | Update MailSettings | + + +## `getEmailTenantEmail()` + +```php +getEmailTenantEmail($id, $emailId): \SynergiTech\Staffology\Model\TenantEmail +``` + +Get Email + +Returns the email along with its status. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$emailId = 'emailId_example'; // string + +try { + $result = $apiInstance->getEmailTenantEmail($id, $emailId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->getEmailTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **emailId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\TenantEmail**](../Model/TenantEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailSettingsTenantEmail()` + +```php +getMailSettingsTenantEmail($id): \SynergiTech\Staffology\Model\MailSettings +``` + +Get MailSettings + +Returns the MailSettings for a Tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant + +try { + $result = $apiInstance->getMailSettingsTenantEmail($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->getMailSettingsTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | + +### Return type + +[**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexTenantEmail()` + +```php +indexTenantEmail($id, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +List Emails + +Returns a list of all emails sent for this Tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->indexTenantEmail($id, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->indexTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `resendEmailTenantEmail()` + +```php +resendEmailTenantEmail($id, $emailId): \SynergiTech\Staffology\Model\TenantEmail +``` + +Re-send Email + +Re-sends an existing email. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$emailId = 'emailId_example'; // string + +try { + $result = $apiInstance->resendEmailTenantEmail($id, $emailId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->resendEmailTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **emailId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\TenantEmail**](../Model/TenantEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `testMailSettingsTenantEmail()` + +```php +testMailSettingsTenantEmail($id, $email): \SynergiTech\Staffology\Model\EmployerEmail +``` + +Send test email + +This API call will generate a test email based on your MailSettings. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant +$email = 'email_example'; // string | The address to send a test email to + +try { + $result = $apiInstance->testMailSettingsTenantEmail($id, $email); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->testMailSettingsTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | +| **email** | **string**| The address to send a test email to | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\EmployerEmail**](../Model/EmployerEmail.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMailSettingsTenantEmail()` + +```php +updateMailSettingsTenantEmail($id, $mailSettings): \SynergiTech\Staffology\Model\MailSettings +``` + +Update MailSettings + +Updates the MailSettings for a Tenant. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TenantEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The Id of the Tenant +$mailSettings = new \SynergiTech\Staffology\Model\MailSettings(); // \SynergiTech\Staffology\Model\MailSettings + +try { + $result = $apiInstance->updateMailSettingsTenantEmail($id, $mailSettings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TenantEmailApi->updateMailSettingsTenantEmail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The Id of the Tenant | | +| **mailSettings** | [**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\MailSettings**](../Model/MailSettings.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TermCalendarApi.md b/docs/Api/TermCalendarApi.md new file mode 100644 index 0000000..8e8d77e --- /dev/null +++ b/docs/Api/TermCalendarApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\TermCalendarApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createTermCalendar()**](TermCalendarApi.md#createTermCalendar) | **POST** /employers/{employerId}/termcalendars | Create Term Calendar | +| [**deleteTermCalendar()**](TermCalendarApi.md#deleteTermCalendar) | **DELETE** /employers/{employerId}/termcalendars/{id} | Delete Term Calendar | +| [**getTermCalendar()**](TermCalendarApi.md#getTermCalendar) | **GET** /employers/{employerId}/termcalendars/{id} | Get Term Calendar | +| [**indexTermCalendar()**](TermCalendarApi.md#indexTermCalendar) | **GET** /employers/{employerId}/termcalendars | List Term Calendars | +| [**updateTermCalendar()**](TermCalendarApi.md#updateTermCalendar) | **PUT** /employers/{employerId}/termcalendars/{id} | Update Term Calendar | + + +## `createTermCalendar()` + +```php +createTermCalendar($employerId, $contractTermCalendarRequest): \SynergiTech\Staffology\Model\ContractTermCalendarResponse +``` + +Create Term Calendar + +Creates a new Term Calendar for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which new Term Calendar will be created. +$contractTermCalendarRequest = new \SynergiTech\Staffology\Model\ContractTermCalendarRequest(); // \SynergiTech\Staffology\Model\ContractTermCalendarRequest + +try { + $result = $apiInstance->createTermCalendar($employerId, $contractTermCalendarRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarApi->createTermCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which new Term Calendar will be created. | | +| **contractTermCalendarRequest** | [**\SynergiTech\Staffology\Model\ContractTermCalendarRequest**](../Model/ContractTermCalendarRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarResponse**](../Model/ContractTermCalendarResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteTermCalendar()` + +```php +deleteTermCalendar($employerId, $id) +``` + +Delete Term Calendar + +Deletes a specified Term Calendar. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar belongs. +$id = 'id_example'; // string | The Id of the Term Calendar which you want to delete + +try { + $apiInstance->deleteTermCalendar($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarApi->deleteTermCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar belongs. | | +| **id** | **string**| The Id of the Term Calendar which you want to delete | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTermCalendar()` + +```php +getTermCalendar($employerId, $id): \SynergiTech\Staffology\Model\ContractTermCalendarResponse +``` + +Get Term Calendar + +Gets a specified Term Calendar. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar belongs. +$id = 'id_example'; // string | The Id of the Term Calendar which you want to fetch + +try { + $result = $apiInstance->getTermCalendar($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarApi->getTermCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar belongs. | | +| **id** | **string**| The Id of the Term Calendar which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarResponse**](../Model/ContractTermCalendarResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexTermCalendar()` + +```php +indexTermCalendar($employerId): \SynergiTech\Staffology\Model\ContractTermCalendarResponse[] +``` + +List Term Calendars + +Lists all Term Calendars for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get the Term Calendar list + +try { + $result = $apiInstance->indexTermCalendar($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarApi->indexTermCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get the Term Calendar list | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]**](../Model/ContractTermCalendarResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTermCalendar()` + +```php +updateTermCalendar($employerId, $id, $contractTermCalendarRequest): \SynergiTech\Staffology\Model\ContractTermCalendarResponse +``` + +Update Term Calendar + +Updates a Term Calendar for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar belongs. +$id = 'id_example'; // string | The Id of the Term Calendar which you want to update +$contractTermCalendarRequest = new \SynergiTech\Staffology\Model\ContractTermCalendarRequest(); // \SynergiTech\Staffology\Model\ContractTermCalendarRequest + +try { + $result = $apiInstance->updateTermCalendar($employerId, $id, $contractTermCalendarRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarApi->updateTermCalendar: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar belongs. | | +| **id** | **string**| The Id of the Term Calendar which you want to update | | +| **contractTermCalendarRequest** | [**\SynergiTech\Staffology\Model\ContractTermCalendarRequest**](../Model/ContractTermCalendarRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarResponse**](../Model/ContractTermCalendarResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TermCalendarYearApi.md b/docs/Api/TermCalendarYearApi.md new file mode 100644 index 0000000..3470755 --- /dev/null +++ b/docs/Api/TermCalendarYearApi.md @@ -0,0 +1,341 @@ +# SynergiTech\Staffology\TermCalendarYearApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createTermCalendarYear()**](TermCalendarYearApi.md#createTermCalendarYear) | **POST** /employers/{employerId}/termcalendaryears/{termCalendarId} | Create Term Calendar Year | +| [**deleteTermCalendarYear()**](TermCalendarYearApi.md#deleteTermCalendarYear) | **DELETE** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Delete Term Calendar Year | +| [**getTermCalendarYear()**](TermCalendarYearApi.md#getTermCalendarYear) | **GET** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Get Term Calendar Year | +| [**indexTermCalendarYear()**](TermCalendarYearApi.md#indexTermCalendarYear) | **GET** /employers/{employerId}/termcalendaryears/{termCalendarId} | List Term Calendar Years | +| [**updateTermCalendarYear()**](TermCalendarYearApi.md#updateTermCalendarYear) | **PUT** /employers/{employerId}/termcalendaryears/{termCalendarId}/{id} | Update Term Calendar Year | + + +## `createTermCalendarYear()` + +```php +createTermCalendarYear($employerId, $termCalendarId, $contractTermCalendarYearRequest): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse +``` + +Create Term Calendar Year + +Creates a new Year data for the Employer and given Term Calendar. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarYearApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar Year belongs. +$termCalendarId = 'termCalendarId_example'; // string | The Id of the Term Calendar which you want to add a new year +$contractTermCalendarYearRequest = new \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest(); // \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest + +try { + $result = $apiInstance->createTermCalendarYear($employerId, $termCalendarId, $contractTermCalendarYearRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarYearApi->createTermCalendarYear: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar Year belongs. | | +| **termCalendarId** | **string**| The Id of the Term Calendar which you want to add a new year | | +| **contractTermCalendarYearRequest** | [**\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest**](../Model/ContractTermCalendarYearRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse**](../Model/ContractTermCalendarYearResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteTermCalendarYear()` + +```php +deleteTermCalendarYear($employerId, $termCalendarId, $id) +``` + +Delete Term Calendar Year + +Deletes a specified Term Calendar Year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarYearApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar Year belongs. +$termCalendarId = 'termCalendarId_example'; // string | The Id of the Term Calendar which you want to delete a year +$id = 'id_example'; // string | The Id of the Term Calendar Year which you want to delete + +try { + $apiInstance->deleteTermCalendarYear($employerId, $termCalendarId, $id); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarYearApi->deleteTermCalendarYear: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar Year belongs. | | +| **termCalendarId** | **string**| The Id of the Term Calendar which you want to delete a year | | +| **id** | **string**| The Id of the Term Calendar Year which you want to delete | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTermCalendarYear()` + +```php +getTermCalendarYear($employerId, $termCalendarId, $id): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse +``` + +Get Term Calendar Year + +Gets a specified Term Calendar Year. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarYearApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar Year belongs. +$termCalendarId = 'termCalendarId_example'; // string | The Id of the Term Calendar to which the Year belongs +$id = 'id_example'; // string | The Id of the Term Calendar Year which you want to fetch + +try { + $result = $apiInstance->getTermCalendarYear($employerId, $termCalendarId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarYearApi->getTermCalendarYear: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar Year belongs. | | +| **termCalendarId** | **string**| The Id of the Term Calendar to which the Year belongs | | +| **id** | **string**| The Id of the Term Calendar Year which you want to fetch | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse**](../Model/ContractTermCalendarYearResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexTermCalendarYear()` + +```php +indexTermCalendarYear($employerId, $termCalendarId): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[] +``` + +List Term Calendar Years + +Lists all Years for an Employer and given Term Calendar. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarYearApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to get Term Calendar Year list +$termCalendarId = 'termCalendarId_example'; // string | The Id of the Term Calendar for which you want to list Years + +try { + $result = $apiInstance->indexTermCalendarYear($employerId, $termCalendarId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarYearApi->indexTermCalendarYear: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to get Term Calendar Year list | | +| **termCalendarId** | **string**| The Id of the Term Calendar for which you want to list Years | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]**](../Model/ContractTermCalendarYearResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTermCalendarYear()` + +```php +updateTermCalendarYear($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse +``` + +Update Term Calendar Year + +Updates Year data for the Employer and given Term Calendar. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TermCalendarYearApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Term Calendar Year belongs. +$termCalendarId = 'termCalendarId_example'; // string | The Id of the Term Calendar which you want to update existing year +$id = 'id_example'; // string | The Id of the Term Calendar Year which you want to update data +$contractTermCalendarYearRequest = new \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest(); // \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest + +try { + $result = $apiInstance->updateTermCalendarYear($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TermCalendarYearApi->updateTermCalendarYear: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Term Calendar Year belongs. | | +| **termCalendarId** | **string**| The Id of the Term Calendar which you want to update existing year | | +| **id** | **string**| The Id of the Term Calendar Year which you want to update data | | +| **contractTermCalendarYearRequest** | [**\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest**](../Model/ContractTermCalendarYearRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse**](../Model/ContractTermCalendarYearResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TierablePayApi.md b/docs/Api/TierablePayApi.md new file mode 100644 index 0000000..3285277 --- /dev/null +++ b/docs/Api/TierablePayApi.md @@ -0,0 +1,70 @@ +# SynergiTech\Staffology\TierablePayApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getTierablePay()**](TierablePayApi.md#getTierablePay) | **GET** /employers/{employerId}/tierablepay/{payrunEntryId} | Calculate tierable pay | + + +## `getTierablePay()` + +```php +getTierablePay($employerId, $payrunEntryId): float +``` + +Calculate tierable pay + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\TierablePayApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | Employer ID +$payrunEntryId = 'payrunEntryId_example'; // string | Payrun entry ID + +try { + $result = $apiInstance->getTierablePay($employerId, $payrunEntryId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TierablePayApi->getTierablePay: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| Employer ID | | +| **payrunEntryId** | **string**| Payrun entry ID | | + +### Return type + +**float** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ToolsApi.md b/docs/Api/ToolsApi.md new file mode 100644 index 0000000..8aa1a47 --- /dev/null +++ b/docs/Api/ToolsApi.md @@ -0,0 +1,96 @@ +# SynergiTech\Staffology\ToolsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**calculateNetOfOnCostsTools()**](ToolsApi.md#calculateNetOfOnCostsTools) | **GET** /tools/calculate-net-of-on-costs | Calculate Net of On Costs | + + +## `calculateNetOfOnCostsTools()` + +```php +calculateNetOfOnCostsTools($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule): \SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse +``` + +Calculate Net of On Costs + +Calculate the Gross Daily Pay and typical Net Costs for an employee. This endpoint is currently being beta tested and subject to un-announced breaking changes. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\ToolsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$notionalDayRate = 3.4; // float | The total chargeable rate per day. +$fee = 3.4; // float | The charge for providing this service, per pay period. +$feeIsPercentage = True; // bool | If true, 'Fee' will be treated as a percentage. +$employersPensionContribution = 3.4; // float | The employers pension contributions, per pay period. +$employersPensionContributionIsPercentage = True; // bool | If true, EmployersPensionContribution will be treated as a percentage. +$employeesPensionContribution = 3.4; // float | The employees pension contributions, per pay period. +$employeesPensionContributionIsPercentage = True; // bool | If true, EmployeesPensionContribution will be used as a percentage. +$useAeBandings = True; // bool | If true, legislative Ae Bandings will be applied during calculation. +$holidayWeeks = 3.4; // float | The holiday weeks to use for the calculation. +$daysWorkedPerWeek = 56; // int | Number of days the employee works per week. +$payPeriod = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PayPeriods(); // \SynergiTech\Staffology\Model\PayPeriods | The pay frequency to be used for the calculation. +$calculationDate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Used to find associated legislative values, default Today. +$apprenticeshipLevyRateOverride = 3.4; // float | Override the Apprenticeship Levy Rate. 0.50 for 0.5%. +$pensionRule = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\PensionRule(); // \SynergiTech\Staffology\Model\PensionRule | The type of pension scheme being enrolled into, default SalarySacrifice. + +try { + $result = $apiInstance->calculateNetOfOnCostsTools($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ToolsApi->calculateNetOfOnCostsTools: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **notionalDayRate** | **float**| The total chargeable rate per day. | | +| **fee** | **float**| The charge for providing this service, per pay period. | | +| **feeIsPercentage** | **bool**| If true, 'Fee' will be treated as a percentage. | | +| **employersPensionContribution** | **float**| The employers pension contributions, per pay period. | | +| **employersPensionContributionIsPercentage** | **bool**| If true, EmployersPensionContribution will be treated as a percentage. | | +| **employeesPensionContribution** | **float**| The employees pension contributions, per pay period. | | +| **employeesPensionContributionIsPercentage** | **bool**| If true, EmployeesPensionContribution will be used as a percentage. | | +| **useAeBandings** | **bool**| If true, legislative Ae Bandings will be applied during calculation. | | +| **holidayWeeks** | **float**| The holiday weeks to use for the calculation. | | +| **daysWorkedPerWeek** | **int**| Number of days the employee works per week. | | +| **payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](../Model/.md)| The pay frequency to be used for the calculation. | | +| **calculationDate** | **\DateTime**| Used to find associated legislative values, default Today. | [optional] | +| **apprenticeshipLevyRateOverride** | **float**| Override the Apprenticeship Levy Rate. 0.50 for 0.5%. | [optional] | +| **pensionRule** | [**\SynergiTech\Staffology\Model\PensionRule**](../Model/.md)| The type of pension scheme being enrolled into, default SalarySacrifice. | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse**](../Model/ContractNetOfOnCostsResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/WebhookApi.md b/docs/Api/WebhookApi.md new file mode 100644 index 0000000..f5d479c --- /dev/null +++ b/docs/Api/WebhookApi.md @@ -0,0 +1,531 @@ +# SynergiTech\Staffology\WebhookApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createWebhook()**](WebhookApi.md#createWebhook) | **POST** /employers/{employerId}/webhooks | Create Webhook | +| [**deleteWebhook()**](WebhookApi.md#deleteWebhook) | **DELETE** /employers/{employerId}/webhooks/{id} | Delete Webhook | +| [**getWebhook()**](WebhookApi.md#getWebhook) | **GET** /employers/{employerId}/webhooks/{id} | Get Webhook | +| [**indexWebhook()**](WebhookApi.md#indexWebhook) | **GET** /employers/{employerId}/webhooks | List Webhooks | +| [**payloadWebhook()**](WebhookApi.md#payloadWebhook) | **GET** /employers/{employerId}/webhooks/{id}/payloads/{payloadId} | Get WebhookPayload | +| [**payloadsWebhook()**](WebhookApi.md#payloadsWebhook) | **GET** /employers/{employerId}/webhooks/{id}/payloads | List WebhookPayloads | +| [**sampleWebhook()**](WebhookApi.md#sampleWebhook) | **GET** /employers/{employerId}/webhooks/samples/{webhookEvent} | Sample Value | +| [**updateWebhook()**](WebhookApi.md#updateWebhook) | **PUT** /employers/{employerId}/webhooks/{id} | Update Webhook | + + +## `createWebhook()` + +```php +createWebhook($employerId, $webhook) +``` + +Create Webhook + +Creates a new Webhook for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$webhook = new \SynergiTech\Staffology\Model\Webhook(); // \SynergiTech\Staffology\Model\Webhook + +try { + $apiInstance->createWebhook($employerId, $webhook); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->createWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **webhook** | [**\SynergiTech\Staffology\Model\Webhook**](../Model/Webhook.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteWebhook()` + +```php +deleteWebhook($employerId, $id) +``` + +Delete Webhook + +Deletes the specified Webhook. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteWebhook($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->deleteWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getWebhook()` + +```php +getWebhook($employerId, $id): \SynergiTech\Staffology\Model\Webhook +``` + +Get Webhook + +Gets the Webhook specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Webhook belongs. +$id = 'id_example'; // string + +try { + $result = $apiInstance->getWebhook($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->getWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Webhook belongs. | | +| **id** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\Webhook**](../Model/Webhook.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexWebhook()` + +```php +indexWebhook($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List Webhooks + +Lists all Webhooks for an Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list Webhooks + +try { + $result = $apiInstance->indexWebhook($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->indexWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list Webhooks | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payloadWebhook()` + +```php +payloadWebhook($employerId, $id, $payloadId): \SynergiTech\Staffology\Model\WebhookPayload +``` + +Get WebhookPayload + +Returns the specified WebhookPayload for this webhook + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$payloadId = 'payloadId_example'; // string + +try { + $result = $apiInstance->payloadWebhook($employerId, $id, $payloadId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->payloadWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **payloadId** | **string**| | | + +### Return type + +[**\SynergiTech\Staffology\Model\WebhookPayload**](../Model/WebhookPayload.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `payloadsWebhook()` + +```php +payloadsWebhook($employerId, $id, $pageNum, $pageSize): \SynergiTech\Staffology\Model\Item[] +``` + +List WebhookPayloads + +Returns a list of all WebhookPayloads for this webhook + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$pageNum = 56; // int +$pageSize = 56; // int + +try { + $result = $apiInstance->payloadsWebhook($employerId, $id, $pageNum, $pageSize); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->payloadsWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **pageNum** | **int**| | [optional] | +| **pageSize** | **int**| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `sampleWebhook()` + +```php +sampleWebhook($employerId, $webhookEvent): mixed +``` + +Sample Value + +Returns an example of the data you can expect your end point to receive when a webhook is fired. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the Webhook belongs. +$webhookEvent = new \SynergiTech\Staffology\Model\\SynergiTech\Staffology\Model\WebhookEvent(); // \SynergiTech\Staffology\Model\WebhookEvent | The WebhookEvent that you want a sample value for. + +try { + $result = $apiInstance->sampleWebhook($employerId, $webhookEvent); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->sampleWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the Webhook belongs. | | +| **webhookEvent** | [**\SynergiTech\Staffology\Model\WebhookEvent**](../Model/.md)| The WebhookEvent that you want a sample value for. | | + +### Return type + +**mixed** + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateWebhook()` + +```php +updateWebhook($employerId, $id, $webhook): \SynergiTech\Staffology\Model\Webhook +``` + +Update Webhook + +Updates a Webhook for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WebhookApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$webhook = new \SynergiTech\Staffology\Model\Webhook(); // \SynergiTech\Staffology\Model\Webhook + +try { + $result = $apiInstance->updateWebhook($employerId, $id, $webhook); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhookApi->updateWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **webhook** | [**\SynergiTech\Staffology\Model\Webhook**](../Model/Webhook.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\Webhook**](../Model/Webhook.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/WorkingPatternApi.md b/docs/Api/WorkingPatternApi.md new file mode 100644 index 0000000..ae6df0d --- /dev/null +++ b/docs/Api/WorkingPatternApi.md @@ -0,0 +1,331 @@ +# SynergiTech\Staffology\WorkingPatternApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createWorkingPattern()**](WorkingPatternApi.md#createWorkingPattern) | **POST** /employers/{employerId}/workingpatterns | Create WorkingPattern | +| [**deleteWorkingPattern()**](WorkingPatternApi.md#deleteWorkingPattern) | **DELETE** /employers/{employerId}/workingpatterns/{id} | Delete WorkingPattern | +| [**getAsyncWorkingPattern()**](WorkingPatternApi.md#getAsyncWorkingPattern) | **GET** /employers/{employerId}/workingpatterns/{id} | Get WorkingPattern | +| [**indexAsyncWorkingPattern()**](WorkingPatternApi.md#indexAsyncWorkingPattern) | **GET** /employers/{employerId}/workingpatterns | List WorkingPatterns | +| [**updateWorkingPattern()**](WorkingPatternApi.md#updateWorkingPattern) | **PUT** /employers/{employerId}/workingpatterns/{id} | Update WorkingPattern | + + +## `createWorkingPattern()` + +```php +createWorkingPattern($employerId, $contractWorkingPatternRequest): \SynergiTech\Staffology\Model\WorkingPattern +``` + +Create WorkingPattern + +Creates a new WorkingPattern for the Employer. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WorkingPatternApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$contractWorkingPatternRequest = new \SynergiTech\Staffology\Model\ContractWorkingPatternRequest(); // \SynergiTech\Staffology\Model\ContractWorkingPatternRequest + +try { + $result = $apiInstance->createWorkingPattern($employerId, $contractWorkingPatternRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WorkingPatternApi->createWorkingPattern: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **contractWorkingPatternRequest** | [**\SynergiTech\Staffology\Model\ContractWorkingPatternRequest**](../Model/ContractWorkingPatternRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\WorkingPattern**](../Model/WorkingPattern.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteWorkingPattern()` + +```php +deleteWorkingPattern($employerId, $id) +``` + +Delete WorkingPattern + +Deletes the specified WorkingPattern. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WorkingPatternApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->deleteWorkingPattern($employerId, $id); +} catch (Exception $e) { + echo 'Exception when calling WorkingPatternApi->deleteWorkingPattern: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getAsyncWorkingPattern()` + +```php +getAsyncWorkingPattern($employerId, $id): \SynergiTech\Staffology\Model\ContractWorkingPatternResponse +``` + +Get WorkingPattern + +Gets the WorkingPattern specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WorkingPatternApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer to which the WorkingPattern belongs. +$id = 'id_example'; // string | The id of the WorkingPattern you want to retrieve. + +try { + $result = $apiInstance->getAsyncWorkingPattern($employerId, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WorkingPatternApi->getAsyncWorkingPattern: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer to which the WorkingPattern belongs. | | +| **id** | **string**| The id of the WorkingPattern you want to retrieve. | | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractWorkingPatternResponse**](../Model/ContractWorkingPatternResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `indexAsyncWorkingPattern()` + +```php +indexAsyncWorkingPattern($employerId): \SynergiTech\Staffology\Model\Item[] +``` + +List WorkingPatterns + +Lists all WorkingPattern for the Employer specified. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WorkingPatternApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string | The Id of the Employer for which you want to list WorkingPattern + +try { + $result = $apiInstance->indexAsyncWorkingPattern($employerId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WorkingPatternApi->indexAsyncWorkingPattern: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| The Id of the Employer for which you want to list WorkingPattern | | + +### Return type + +[**\SynergiTech\Staffology\Model\Item[]**](../Model/Item.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateWorkingPattern()` + +```php +updateWorkingPattern($employerId, $id, $contractWorkingPatternRequest): \SynergiTech\Staffology\Model\ContractWorkingPatternResponse +``` + +Update WorkingPattern + +Updates the details of an existing WorkingPattern. + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new SynergiTech\Staffology\Api\WorkingPatternApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$employerId = 'employerId_example'; // string +$id = 'id_example'; // string +$contractWorkingPatternRequest = new \SynergiTech\Staffology\Model\ContractWorkingPatternRequest(); // \SynergiTech\Staffology\Model\ContractWorkingPatternRequest + +try { + $result = $apiInstance->updateWorkingPattern($employerId, $id, $contractWorkingPatternRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WorkingPatternApi->updateWorkingPattern: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employerId** | **string**| | | +| **id** | **string**| | | +| **contractWorkingPatternRequest** | [**\SynergiTech\Staffology\Model\ContractWorkingPatternRequest**](../Model/ContractWorkingPatternRequest.md)| | [optional] | + +### Return type + +[**\SynergiTech\Staffology\Model\ContractWorkingPatternResponse**](../Model/ContractWorkingPatternResponse.md) + +### Authorization + +[Basic](../../README.md#Basic) + +### HTTP request headers + +- **Content-Type**: `application/json-patch+json`, `application/json`, `text/json`, `application/*+json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Model/Address.md b/docs/Model/Address.md new file mode 100644 index 0000000..9895c0e --- /dev/null +++ b/docs/Model/Address.md @@ -0,0 +1,16 @@ +# # Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line1** | **string** | | [optional] +**line2** | **string** | | [optional] +**line3** | **string** | | [optional] +**line4** | **string** | | [optional] +**line5** | **string** | | [optional] +**postCode** | **string** | | [optional] +**country** | [**\SynergiTech\Staffology\Model\Country**](Country.md) | | [optional] +**foreignCountry** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdvancedVarianceReport.md b/docs/Model/AdvancedVarianceReport.md new file mode 100644 index 0000000..002d3b9 --- /dev/null +++ b/docs/Model/AdvancedVarianceReport.md @@ -0,0 +1,16 @@ +# # AdvancedVarianceReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\AdvancedVarianceReportLine[]**](AdvancedVarianceReportLine.md) | | [optional] +**payCodes** | [**\SynergiTech\Staffology\Model\PayCode[]**](PayCode.md) | | [optional] +**primaryPeriodName** | **string** | | [optional] +**secondaryPeriodName** | **string** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdvancedVarianceReportLine.md b/docs/Model/AdvancedVarianceReportLine.md new file mode 100644 index 0000000..d45046d --- /dev/null +++ b/docs/Model/AdvancedVarianceReportLine.md @@ -0,0 +1,27 @@ +# # AdvancedVarianceReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeCode** | **string** | | [optional] +**employeeName** | **string** | | [optional] +**department** | **string** | | [optional] +**costCentre** | **string** | | [optional] +**primaryGrossTotal** | **float** | | [optional] +**secondaryGrossTotal** | **float** | | [optional] +**primaryGrossTaxable** | **float** | | [optional] +**secondaryGrossTaxable** | **float** | | [optional] +**primaryNetPay** | **float** | | [optional] +**secondaryNetPay** | **float** | | [optional] +**primaryTax** | **float** | | [optional] +**secondaryTax** | **float** | | [optional] +**primaryEmployeeNi** | **float** | | [optional] +**secondaryEmployeeNi** | **float** | | [optional] +**primaryEmployerNi** | **float** | | [optional] +**secondaryEmployerNi** | **float** | | [optional] +**primaryStudentOrPgLoan** | **float** | | [optional] +**secondaryStudentOrPgLoan** | **float** | | [optional] +**payCodeVarianceLines** | [**\SynergiTech\Staffology\Model\PayCodeVarianceLine[]**](PayCodeVarianceLine.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdvancedVarianceReportReportResponse.md b/docs/Model/AdvancedVarianceReportReportResponse.md new file mode 100644 index 0000000..d7be1c6 --- /dev/null +++ b/docs/Model/AdvancedVarianceReportReportResponse.md @@ -0,0 +1,12 @@ +# # AdvancedVarianceReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\AdvancedVarianceReport**](AdvancedVarianceReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeAction.md b/docs/Model/AeAction.md new file mode 100644 index 0000000..f6badd7 --- /dev/null +++ b/docs/Model/AeAction.md @@ -0,0 +1,8 @@ +# # AeAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeAssessment.md b/docs/Model/AeAssessment.md new file mode 100644 index 0000000..67fe4a7 --- /dev/null +++ b/docs/Model/AeAssessment.md @@ -0,0 +1,26 @@ +# # AeAssessment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assessmentDate** | **\DateTime** | | [optional] +**employeeState** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**age** | **int** | [readonly] The age of the Employee at the time of the assessment | [optional] +**ukWorker** | [**\SynergiTech\Staffology\Model\AeUKWorker**](AeUKWorker.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | [readonly] The PaySchedule ordinal for the Employee at the time of the assessment | [optional] +**earningsInPeriod** | **float** | [readonly] | [optional] +**qualifyingEarningsInPeriod** | **float** | [readonly] | [optional] +**aeExclusionCode** | [**\SynergiTech\Staffology\Model\AeExclusionCode**](AeExclusionCode.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\AeStatus**](AeStatus.md) | | [optional] +**reason** | **string** | [readonly] The reason for determining the Status given. | [optional] +**action** | [**\SynergiTech\Staffology\Model\AeAssessmentAction**](AeAssessmentAction.md) | | [optional] +**startReportingType** | [**\SynergiTech\Staffology\Model\PensionReportingType**](PensionReportingType.md) | | [optional] +**endReportingType** | [**\SynergiTech\Staffology\Model\PensionReportingType**](PensionReportingType.md) | | [optional] +**startPayRunEntryId** | **int** | | [optional] +**endPayRunEntryId** | **int** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeAssessmentAction.md b/docs/Model/AeAssessmentAction.md new file mode 100644 index 0000000..219d087 --- /dev/null +++ b/docs/Model/AeAssessmentAction.md @@ -0,0 +1,16 @@ +# # AeAssessmentAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**\SynergiTech\Staffology\Model\AeAction**](AeAction.md) | | [optional] +**employeeState** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**actionCompleted** | **bool** | [readonly] Indicates whether or not the required action was successfully completed | [optional] +**actionCompletedMessage** | **string** | [readonly] Gives further information about the action taken or the reason if wasn't successfully completed | [optional] +**requiredLetter** | [**\SynergiTech\Staffology\Model\AeStatutoryLetter**](AeStatutoryLetter.md) | | [optional] +**pensionSchemeId** | **string** | [readonly] The PensionSchemeId that a completed action relates to | [optional] +**workerGroupId** | **string** | [readonly] The WorkerGroupId that a completed action relates to | [optional] +**letterNotYetSent** | **bool** | [readonly] Indicates whether or not any required letter has been sent | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeEmployeeState.md b/docs/Model/AeEmployeeState.md new file mode 100644 index 0000000..b5b1196 --- /dev/null +++ b/docs/Model/AeEmployeeState.md @@ -0,0 +1,8 @@ +# # AeEmployeeState + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeExclusionCode.md b/docs/Model/AeExclusionCode.md new file mode 100644 index 0000000..0fb857b --- /dev/null +++ b/docs/Model/AeExclusionCode.md @@ -0,0 +1,8 @@ +# # AeExclusionCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeStatus.md b/docs/Model/AeStatus.md new file mode 100644 index 0000000..84957e7 --- /dev/null +++ b/docs/Model/AeStatus.md @@ -0,0 +1,8 @@ +# # AeStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeStatutoryLetter.md b/docs/Model/AeStatutoryLetter.md new file mode 100644 index 0000000..7d2fb0d --- /dev/null +++ b/docs/Model/AeStatutoryLetter.md @@ -0,0 +1,8 @@ +# # AeStatutoryLetter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AeUKWorker.md b/docs/Model/AeUKWorker.md new file mode 100644 index 0000000..dc20c2a --- /dev/null +++ b/docs/Model/AeUKWorker.md @@ -0,0 +1,8 @@ +# # AeUKWorker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AllowanceType.md b/docs/Model/AllowanceType.md new file mode 100644 index 0000000..ebe1424 --- /dev/null +++ b/docs/Model/AllowanceType.md @@ -0,0 +1,8 @@ +# # AllowanceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisCategory.md b/docs/Model/AnalysisCategory.md new file mode 100644 index 0000000..e7e9ee5 --- /dev/null +++ b/docs/Model/AnalysisCategory.md @@ -0,0 +1,9 @@ +# # AnalysisCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The unique Analysis Category Name | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisCategoryCode.md b/docs/Model/AnalysisCategoryCode.md new file mode 100644 index 0000000..843eb9b --- /dev/null +++ b/docs/Model/AnalysisCategoryCode.md @@ -0,0 +1,12 @@ +# # AnalysisCategoryCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | +**title** | **string** | The name of this Analysis Code | +**color** | **string** | A color to used to represent this Analysis Code, in hex format. ie 'ff0000' | [optional] +**accountingCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisCategoryCodes.md b/docs/Model/AnalysisCategoryCodes.md new file mode 100644 index 0000000..038bf4e --- /dev/null +++ b/docs/Model/AnalysisCategoryCodes.md @@ -0,0 +1,12 @@ +# # AnalysisCategoryCodes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysisCategory** | **string** | AnalysisCategory Model | [optional] +**analysisCategoryCode** | **string** | AnalysisCategoryCode Model | [optional] +**analysisCategoryId** | **string** | AnalysisCategory Identifier | [optional] +**analysisCategoryCodeId** | **string** | AnalysisCategoryCode Identifier | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisCategoryIndex.md b/docs/Model/AnalysisCategoryIndex.md new file mode 100644 index 0000000..0329c50 --- /dev/null +++ b/docs/Model/AnalysisCategoryIndex.md @@ -0,0 +1,10 @@ +# # AnalysisCategoryIndex + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**index** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisReport.md b/docs/Model/AnalysisReport.md new file mode 100644 index 0000000..2e8755a --- /dev/null +++ b/docs/Model/AnalysisReport.md @@ -0,0 +1,24 @@ +# # AnalysisReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\AnalysisReportLine[]**](AnalysisReportLine.md) | | [optional] +**payCodes** | [**\SynergiTech\Staffology\Model\PayCode[]**](PayCode.md) | | [optional] +**showPayPeriodBreakdown** | **bool** | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisReportLine.md b/docs/Model/AnalysisReportLine.md new file mode 100644 index 0000000..fed08c4 --- /dev/null +++ b/docs/Model/AnalysisReportLine.md @@ -0,0 +1,21 @@ +# # AnalysisReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**taxYear** | **string** | | [optional] +**payPeriod** | **int** | | [optional] +**gross** | **float** | | [optional] +**niableGross** | **float** | | [optional] +**pensionableGross** | **float** | | [optional] +**net** | **float** | | [optional] +**takeHome** | **float** | | [optional] +**employerNic** | **float** | | [optional] +**employerPension** | **float** | | [optional] +**showQtyColumn** | **bool** | | [optional] +**niSaving** | **float** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\AnalysisReportLineValue[]**](AnalysisReportLineValue.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisReportLineValue.md b/docs/Model/AnalysisReportLineValue.md new file mode 100644 index 0000000..0bb4ab6 --- /dev/null +++ b/docs/Model/AnalysisReportLineValue.md @@ -0,0 +1,11 @@ +# # AnalysisReportLineValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qty** | **float** | | [optional] +**code** | **string** | | [optional] +**value** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalysisReportReportResponse.md b/docs/Model/AnalysisReportReportResponse.md new file mode 100644 index 0000000..2293e49 --- /dev/null +++ b/docs/Model/AnalysisReportReportResponse.md @@ -0,0 +1,12 @@ +# # AnalysisReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\AnalysisReport**](AnalysisReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnnualRoundingRule.md b/docs/Model/AnnualRoundingRule.md new file mode 100644 index 0000000..e3e7b90 --- /dev/null +++ b/docs/Model/AnnualRoundingRule.md @@ -0,0 +1,8 @@ +# # AnnualRoundingRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AssumedPensionablePay.md b/docs/Model/AssumedPensionablePay.md new file mode 100644 index 0000000..956fb60 --- /dev/null +++ b/docs/Model/AssumedPensionablePay.md @@ -0,0 +1,8 @@ +# # AssumedPensionablePay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrder.md b/docs/Model/AttachmentOrder.md new file mode 100644 index 0000000..3196493 --- /dev/null +++ b/docs/Model/AttachmentOrder.md @@ -0,0 +1,36 @@ +# # AttachmentOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\AttachmentOrderType**](AttachmentOrderType.md) | | [optional] +**carryForwardShortfall** | **bool** | [ReadOnly] Whether or not shortfalls should be carried forward | [optional] [readonly] +**allowProtectedEarnings** | **bool** | [ReadOnly] Whether or not shortfalls should be carried forward | [optional] [readonly] +**autoDeduction** | **bool** | [readonly] Whether or not the amount to be deducted is automatically calculated | [optional] [readonly] +**reference** | **string** | The reference which appeared on the court paperwork | [optional] +**issueDate** | **\DateTime** | The date of issue for this Order | [optional] +**applyFrom** | **\DateTime** | The date from which to apply this Order | [optional] +**applyUntil** | **\DateTime** | An optional date on which to stop applying this order | [optional] +**deductionIsPercentage** | **bool** | Whether or not the amount given for Deduction is a percentage rather than a fixed amount | [optional] +**deduction** | **float** | The percentage or amount (depending on DeductionIsPercentage) to deduct | [optional] +**protectedEarningsIsPercentage** | **bool** | Whether or not the amount for ProtectedEarnings is a percentage rather than a fixed amount. | [optional] +**protectedEarnings** | **float** | The percentage or amount or percentage (depending on ProtectedEarningsIsPercentage) to protect | [optional] +**chargeAdminFee** | **bool** | Whether or not a £1 admin fee should be deducted for this order | [optional] +**shortfall** | **float** | Any shortfall that is being carried forward | [optional] +**stopWhenTotalPaid** | **bool** | Whether or not this order should be stopped once a total amount has been paid | [optional] +**totalAmountToPay** | **float** | The Total amount that needs to be paid for this Order | [optional] +**amountPreviouslyPaid** | **float** | Any amount that has previously been paid towards this Order | [optional] +**stopped** | **bool** | [readonly] Whether or not this Order has been stopped. This is set automatically when either it's paid in full or the ApplyUntil date has been reached. | [optional] +**notes** | **string** | A free-form text field to record any comments | [optional] +**includeBankDetails** | **bool** | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**payments** | [**\SynergiTech\Staffology\Model\AttachmentOrderPayment[]**](AttachmentOrderPayment.md) | [readonly] Payments made towards this order. Only populated when viewed as a report. | [optional] +**payee** | **string** | The Id of the Payee, if any, that deductions are to be paid to. | [optional] +**payeeName** | **string** | The name of the Payee, if any, that deductions are to be paid to. | [optional] +**documentCount** | **int** | [readonly] The number of attachments associated with this model | [optional] +**documents** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The attachments associated with this model | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrderPayment.md b/docs/Model/AttachmentOrderPayment.md new file mode 100644 index 0000000..5d884f0 --- /dev/null +++ b/docs/Model/AttachmentOrderPayment.md @@ -0,0 +1,24 @@ +# # AttachmentOrderPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attachmentOrder** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**date** | **\DateTime** | [readonly] The date this deduction was made | [optional] +**description** | **string** | [readonly] Description of deduction, usually the reference from the AttachmentOrder | [optional] +**attachablePay** | **float** | [readonly] The total Attachable pay for the Employee on this PayRun | [optional] +**protectedPay** | **float** | [readonly] The amount of the Attachable Pay that must be protected | [optional] +**otherAttachmentOrderDeductions** | **float** | [readonly] Deductions made on this PayRun for this employee due to other higher priority AttachmentOrders | [optional] +**desiredDeduction** | **float** | [readonly] The amount that should be deducted, if arrestable pay is available. Not including any shortfall | [optional] +**shortfall** | **float** | [readonly] Any shortfall (ie arrears) that existed before this PayRun. | [optional] +**totalPaid** | **float** | [readonly] Total amount paid to date, including this deduction. | [optional] +**resultingDeduction** | **float** | [readonly] The actual amount deducted | [optional] +**resultingShortfall** | **float** | [readonly] The resulting shortfall (including any shortfall from previous periods | [optional] +**adminFee** | **float** | [readonly] Any admin fee charged | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrderReportResponse.md b/docs/Model/AttachmentOrderReportResponse.md new file mode 100644 index 0000000..24fc04a --- /dev/null +++ b/docs/Model/AttachmentOrderReportResponse.md @@ -0,0 +1,12 @@ +# # AttachmentOrderReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\AttachmentOrder**](AttachmentOrder.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrderType.md b/docs/Model/AttachmentOrderType.md new file mode 100644 index 0000000..a3f2772 --- /dev/null +++ b/docs/Model/AttachmentOrderType.md @@ -0,0 +1,8 @@ +# # AttachmentOrderType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrdersReport.md b/docs/Model/AttachmentOrdersReport.md new file mode 100644 index 0000000..4706cd7 --- /dev/null +++ b/docs/Model/AttachmentOrdersReport.md @@ -0,0 +1,21 @@ +# # AttachmentOrdersReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AttachmentOrdersReportReportResponse.md b/docs/Model/AttachmentOrdersReportReportResponse.md new file mode 100644 index 0000000..39d410a --- /dev/null +++ b/docs/Model/AttachmentOrdersReportReportResponse.md @@ -0,0 +1,12 @@ +# # AttachmentOrdersReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\AttachmentOrdersReport**](AttachmentOrdersReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AuditEventAction.md b/docs/Model/AuditEventAction.md new file mode 100644 index 0000000..a2892ee --- /dev/null +++ b/docs/Model/AuditEventAction.md @@ -0,0 +1,8 @@ +# # AuditEventAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AuthScheme.md b/docs/Model/AuthScheme.md new file mode 100644 index 0000000..d38bcf6 --- /dev/null +++ b/docs/Model/AuthScheme.md @@ -0,0 +1,8 @@ +# # AuthScheme + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AutoEnrolment.md b/docs/Model/AutoEnrolment.md new file mode 100644 index 0000000..b26c1a3 --- /dev/null +++ b/docs/Model/AutoEnrolment.md @@ -0,0 +1,18 @@ +# # AutoEnrolment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**stateDate** | **\DateTime** | [readonly] | [optional] +**ukWorker** | [**\SynergiTech\Staffology\Model\AeUKWorker**](AeUKWorker.md) | | [optional] +**daysToDeferAssessment** | **int** | The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. | [optional] +**postponementDate** | **\DateTime** | [readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date. This is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null This is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not. | [optional] +**deferByMonthsNotDays** | **bool** | If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days | [optional] +**exempt** | **bool** | | [optional] +**aeExclusionCode** | [**\SynergiTech\Staffology\Model\AeExclusionCode**](AeExclusionCode.md) | | [optional] +**aePostponementLetterSent** | **bool** | | [optional] +**lastAssessment** | [**\SynergiTech\Staffology\Model\AeAssessment**](AeAssessment.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AutoEnrolmentSettings.md b/docs/Model/AutoEnrolmentSettings.md new file mode 100644 index 0000000..6b6d8b9 --- /dev/null +++ b/docs/Model/AutoEnrolmentSettings.md @@ -0,0 +1,19 @@ +# # AutoEnrolmentSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stagingDate** | **\DateTime** | | [optional] +**cyclicalReenrolmentDate** | **\DateTime** | | [optional] +**previousCyclicalReenrolmentDate** | **\DateTime** | | [optional] +**defaultPension** | [**\SynergiTech\Staffology\Model\PensionSelection**](PensionSelection.md) | | [optional] +**pensionSameAsDefault** | **bool** | | [optional] +**daysToDeferAssessment** | **int** | The number of days, if any, to defer assessment of new employees. You're allowed to defer assessment of new employees by up to 3 months. This is the default value used when you create a new employee. It can be changed on a per-employee basis. | [optional] +**deferByMonthsNotDays** | **bool** | If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days | [optional] +**deferEnrolmentBy** | **int** | The number of days )or weeks, or months), if any, to defer enrolment of employees that are Eligible Jobholders. For example, if this is set to 30 days then if an employee meets the criteria for enrolment then they'll only be enrolled if they still meet the criteria 30 days later | [optional] +**deferEnrolmentByPeriodType** | [**\SynergiTech\Staffology\Model\DeferalPeriodType**](DeferalPeriodType.md) | | [optional] +**includeNonPensionedEmployeesInSubmission** | **bool** | Whether or not to include details of non-pensioned employees in your submissions to this provider | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AutoPilotFinaliseTime.md b/docs/Model/AutoPilotFinaliseTime.md new file mode 100644 index 0000000..cfe9706 --- /dev/null +++ b/docs/Model/AutoPilotFinaliseTime.md @@ -0,0 +1,8 @@ +# # AutoPilotFinaliseTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AutomationSettings.md b/docs/Model/AutomationSettings.md new file mode 100644 index 0000000..145a3db --- /dev/null +++ b/docs/Model/AutomationSettings.md @@ -0,0 +1,29 @@ +# # AutomationSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enableAutoPilot** | **bool** | IF enabled then payruns will be automatically finalised on the payment date and the next payrun will be started | [optional] +**autoPilotTime** | [**\SynergiTech\Staffology\Model\AutoPilotFinaliseTime**](AutoPilotFinaliseTime.md) | | [optional] +**autoPilotOffset** | **int** | How many days before the payment date a payrun should be finalised. Set it to 0 if you want the payrun to be automatically finalised on the payment date itself | [optional] +**enableAutoOpen** | **bool** | IF enabled then whenever you close a payrun, the next one will be started. Automatically set to true if EnableAutoPilot is true | [optional] +**autoSubmitFps** | **bool** | If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun. This property will always have the same value as the property with the same name on the RtiSubmissionSettings model. | [optional] +**autoSubmitPayments** | **bool** | If set to true, we'll automatically submit payments whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'Payments'. | [optional] +**autoSubmitJournal** | **bool** | If set to true, we'll automatically submit the payroll journal whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'Accounting'. | [optional] +**autoSubmitPaymentsEmployee** | **bool** | Used in conjunction with AutoSubmitPayments. | [optional] +**autoSubmitPayslips** | **bool** | If set to true, we'll automatically submit payslips whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. | [optional] +**autoSubmitP45s** | **bool** | If set to true, we'll automatically submit P45s whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. | [optional] +**autoSubmitPaymentsHmrc** | **bool** | Used in conjunction with AutoSubmitPayments. | [optional] +**autoSubmitPaymentsDeductions** | **bool** | Used in conjunction with AutoSubmitPayments. | [optional] +**autoSubmitPaymentsAeos** | **bool** | Used in conjunction with AutoSubmitPayments. | [optional] +**autoSubmitPaymentsPensions** | **bool** | Used in conjunction with AutoSubmitPayments. | [optional] +**employeesWithoutEmailAddress** | **int** | [readonly] A count of how many employees or subcontractors for this employer do not have email addresses | [optional] +**employeesWithEmailAddressButNotAutoSending** | **int** | [readonly] A count of how many employees or subcontractors for this employer do have email addresses but don't have the option enabled to auto-email payslips | [optional] +**subcontractorsNotAutoSendingStatement** | **int** | [readonly] A count of how many subscontractors for this employer do don't have the option enabled to auto-email statement | [optional] +**codingNoticesAutomaticallyApplied** | **bool** | [readonly] An indicator of whether or not this employer is automatically applying DpsNotices | [optional] +**payrunEmails** | [**\SynergiTech\Staffology\Model\PayrunEmail[]**](PayrunEmail.md) | Automated emails that will be sent when a PayRun is finalised | [optional] +**autoSubmitPensionLetters** | **bool** | If set to true, we'll automatically submit Pension Letters whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. | [optional] +**autoSubmitEps** | **bool** | If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AverageHolidayPayRateReport.md b/docs/Model/AverageHolidayPayRateReport.md new file mode 100644 index 0000000..8bac194 --- /dev/null +++ b/docs/Model/AverageHolidayPayRateReport.md @@ -0,0 +1,22 @@ +# # AverageHolidayPayRateReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\AverageHolidayPayRateReportLine[]**](AverageHolidayPayRateReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AverageHolidayPayRateReportLine.md b/docs/Model/AverageHolidayPayRateReportLine.md new file mode 100644 index 0000000..5c23eee --- /dev/null +++ b/docs/Model/AverageHolidayPayRateReportLine.md @@ -0,0 +1,16 @@ +# # AverageHolidayPayRateReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | Payroll code of the employee | [optional] +**firstName** | **string** | The First Name of the employee | [optional] +**lastName** | **string** | The Last Name of the employee | [optional] +**niNumber** | **string** | The NiNumber of the employee | [optional] +**period** | **int** | The Period of the average holiday pay rate | [optional] +**rate** | **float** | The Average holiday pay rate | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AverageHolidayPayRateReportReportResponse.md b/docs/Model/AverageHolidayPayRateReportReportResponse.md new file mode 100644 index 0000000..8d5da7c --- /dev/null +++ b/docs/Model/AverageHolidayPayRateReportReportResponse.md @@ -0,0 +1,12 @@ +# # AverageHolidayPayRateReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\AverageHolidayPayRateReport**](AverageHolidayPayRateReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AveragePayGradesReportLine.md b/docs/Model/AveragePayGradesReportLine.md new file mode 100644 index 0000000..518d0f4 --- /dev/null +++ b/docs/Model/AveragePayGradesReportLine.md @@ -0,0 +1,17 @@ +# # AveragePayGradesReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effectiveDate** | **\DateTime** | Effective date for Pay spine grade | [optional] +**paySpineName** | **string** | Name of Pay Spine | [optional] +**payGradeName** | **string** | Name of Pay grade name | [optional] +**lowerGradePoint** | **string** | Lower grade point of pay spine grade | [optional] +**upperGradePoint** | **string** | Upper grade point of pay spine grade | [optional] +**upperPointAltMax** | **bool** | To Check Alt Max of Upper point | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AverageWeeklyEarnings.md b/docs/Model/AverageWeeklyEarnings.md new file mode 100644 index 0000000..5f21377 --- /dev/null +++ b/docs/Model/AverageWeeklyEarnings.md @@ -0,0 +1,18 @@ +# # AverageWeeklyEarnings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | [**\SynergiTech\Staffology\Model\AverageWeeklyEarningsResult**](AverageWeeklyEarningsResult.md) | | [optional] +**resultDescription** | **string** | | [optional] [readonly] +**averageEarnings** | **float** | | [optional] [readonly] +**threshold** | **float** | | [optional] +**eligibilityThreshold** | **float** | | [optional] +**requestedDate** | **\DateTime** | | [optional] +**relevantPeriodStart** | **\DateTime** | | [optional] +**relevantPeriodEnd** | **\DateTime** | | [optional] +**relevantPeriodWeekCount** | **float** | | [optional] +**relevantPeriodEarnings** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AverageWeeklyEarningsResult.md b/docs/Model/AverageWeeklyEarningsResult.md new file mode 100644 index 0000000..6765f8c --- /dev/null +++ b/docs/Model/AverageWeeklyEarningsResult.md @@ -0,0 +1,8 @@ +# # AverageWeeklyEarningsResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BackgroundTaskStatus.md b/docs/Model/BackgroundTaskStatus.md new file mode 100644 index 0000000..886fcce --- /dev/null +++ b/docs/Model/BackgroundTaskStatus.md @@ -0,0 +1,8 @@ +# # BackgroundTaskStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankDetails.md b/docs/Model/BankDetails.md new file mode 100644 index 0000000..dcf8174 --- /dev/null +++ b/docs/Model/BankDetails.md @@ -0,0 +1,16 @@ +# # BankDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bankName** | **string** | | [optional] +**bankBranch** | **string** | | [optional] +**bankReference** | **string** | | [optional] +**accountName** | **string** | | [optional] +**accountNumber** | **string** | | [optional] +**sortCode** | **string** | | [optional] +**note** | **string** | | [optional] +**buildingSocietyRollNumber** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankHolidayCollection.md b/docs/Model/BankHolidayCollection.md new file mode 100644 index 0000000..89928a3 --- /dev/null +++ b/docs/Model/BankHolidayCollection.md @@ -0,0 +1,8 @@ +# # BankHolidayCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankPaymentInstruction.md b/docs/Model/BankPaymentInstruction.md new file mode 100644 index 0000000..75923e5 --- /dev/null +++ b/docs/Model/BankPaymentInstruction.md @@ -0,0 +1,16 @@ +# # BankPaymentInstruction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**originator** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**bankPayments** | [**\SynergiTech\Staffology\Model\PayRunPayment[]**](PayRunPayment.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusMessage** | **string** | [readonly] A message to elaborate on the Status | [optional] +**link** | **string** | [readonly] If available, a link to the payments in an ExternalDataProvider | [optional] +**serviceUserNumber** | **string** | Service user number to be used while sending payment instruction | [optional] +**bureauNumber** | **string** | Bureau number to be used if available while sending payment instruction | [optional] +**allowsMultiDate** | **bool** | Allows multiple payment dates in the file | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankPaymentInstructionReportResponse.md b/docs/Model/BankPaymentInstructionReportResponse.md new file mode 100644 index 0000000..ac6ff91 --- /dev/null +++ b/docs/Model/BankPaymentInstructionReportResponse.md @@ -0,0 +1,12 @@ +# # BankPaymentInstructionReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\BankPaymentInstruction**](BankPaymentInstruction.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankPaymentInstructionsCsvFormat.md b/docs/Model/BankPaymentInstructionsCsvFormat.md new file mode 100644 index 0000000..781c3b6 --- /dev/null +++ b/docs/Model/BankPaymentInstructionsCsvFormat.md @@ -0,0 +1,8 @@ +# # BankPaymentInstructionsCsvFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Benefit.md b/docs/Model/Benefit.md new file mode 100644 index 0000000..d186f0a --- /dev/null +++ b/docs/Model/Benefit.md @@ -0,0 +1,34 @@ +# # Benefit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**type** | [**\SynergiTech\Staffology\Model\BenefitType**](BenefitType.md) | | [optional] +**declarationType** | [**\SynergiTech\Staffology\Model\BenefitDeclarationType**](BenefitDeclarationType.md) | | [optional] +**benefitPayrolled** | [**\SynergiTech\Staffology\Model\BenefitPayrolled[]**](BenefitPayrolled.md) | | [optional] +**description** | **string** | A description of this benefit | [optional] +**value** | **float** | | [optional] +**employeeContribution** | **float** | | [optional] +**startDate** | **\DateTime** | The date the benefits starts if different to the start date of the TaxYear | [optional] +**endDate** | **\DateTime** | The date the benefits ends if different to the end date of the TaxYear | [optional] +**useProRata** | **bool** | Benefit calculation should be done on pro rata rules | [optional] +**cashEquivalent** | **float** | [readonly] | [optional] [readonly] +**assetType** | [**\SynergiTech\Staffology\Model\BenefitDetailsAssetType**](BenefitDetailsAssetType.md) | | [optional] +**useOfAssetType** | [**\SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType**](BenefitDetailsUseOfAssetType.md) | | [optional] +**class1AType** | [**\SynergiTech\Staffology\Model\BenefitDetailsClass1AType**](BenefitDetailsClass1AType.md) | | [optional] +**nonClass1AType** | [**\SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType**](BenefitDetailsNonClass1AType.md) | | [optional] +**paymentType** | [**\SynergiTech\Staffology\Model\BenefitDetailsPaymentType**](BenefitDetailsPaymentType.md) | | [optional] +**tradingOrganisation** | **bool** | Only relevant to Benefits with Type Entertainment | [optional] +**cashEquivalentFuel** | **float** | Only relevant to Benefits with Type Vans | [optional] +**loan** | [**\SynergiTech\Staffology\Model\BenefitDetailsLoan**](BenefitDetailsLoan.md) | | [optional] +**car** | [**\SynergiTech\Staffology\Model\BenefitDetailsCar**](BenefitDetailsCar.md) | | [optional] +**openingBalance** | **float** | The amount of benefit paid YTD when setting up a benefit | [optional] +**paid** | **float** | [readonly] | [optional] [readonly] +**bikOutstanding** | **float** | [readonly] | [optional] [readonly] +**isPeriodValue** | **bool** | To be used for the benefit period | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDeclarationType.md b/docs/Model/BenefitDeclarationType.md new file mode 100644 index 0000000..afc3024 --- /dev/null +++ b/docs/Model/BenefitDeclarationType.md @@ -0,0 +1,8 @@ +# # BenefitDeclarationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsAssetType.md b/docs/Model/BenefitDetailsAssetType.md new file mode 100644 index 0000000..71d0fdf --- /dev/null +++ b/docs/Model/BenefitDetailsAssetType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsAssetType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsCar.md b/docs/Model/BenefitDetailsCar.md new file mode 100644 index 0000000..b962f52 --- /dev/null +++ b/docs/Model/BenefitDetailsCar.md @@ -0,0 +1,33 @@ +# # BenefitDetailsCar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**makeAndModel** | **string** | | [optional] +**registration** | **string** | | [optional] +**firstRegistered** | **\DateTime** | | [optional] +**hasApprovedEmissionsValue** | **bool** | | [optional] +**co2Emissions** | **int** | | [optional] +**engineSize** | **int** | | [optional] +**zeroEmissionsMileage** | **int** | | [optional] +**fuelType** | [**\SynergiTech\Staffology\Model\BenefitDetailsCarPowerType**](BenefitDetailsCarPowerType.md) | | [optional] +**availableFrom** | **\DateTime** | | [optional] +**availableTo** | **\DateTime** | | [optional] +**daysUnavailable** | **int** | | [optional] +**listPrice** | **float** | | [optional] +**nonStandardAccessories** | **float** | | [optional] +**employeeCapitalContributions** | **float** | | [optional] +**employeePrivateContributions** | **float** | | [optional] +**freeFuel** | **bool** | | [optional] +**fuelAvailableFrom** | **\DateTime** | | [optional] +**fuelAvailableTo** | **\DateTime** | | [optional] +**freeFuelReinstated** | **bool** | | [optional] +**registeredPriorTo1998** | **bool** | [readonly] | [optional] [readonly] +**rate** | **float** | [readonly] The applicable rate based on CO2Emissions and Engine Size | [optional] +**chargeableValue** | **float** | [readonly] The chargeable value of the car | [optional] [readonly] +**fullYearCharge** | **float** | [readonly] The charge for the car for a full year, not taking in to account available dates or EmployeePrivateContributions | [optional] [readonly] +**cashEquivalent** | **float** | [readonly] | [optional] +**cashEquivalentFuel** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsCarPowerType.md b/docs/Model/BenefitDetailsCarPowerType.md new file mode 100644 index 0000000..63a27da --- /dev/null +++ b/docs/Model/BenefitDetailsCarPowerType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsCarPowerType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsClass1AType.md b/docs/Model/BenefitDetailsClass1AType.md new file mode 100644 index 0000000..91377ce --- /dev/null +++ b/docs/Model/BenefitDetailsClass1AType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsClass1AType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsLoan.md b/docs/Model/BenefitDetailsLoan.md new file mode 100644 index 0000000..2fee3e7 --- /dev/null +++ b/docs/Model/BenefitDetailsLoan.md @@ -0,0 +1,19 @@ +# # BenefitDetailsLoan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**numberOfJointBorrowers** | **int** | | [optional] +**loanMade** | **\DateTime** | | [optional] +**loanDischarged** | **\DateTime** | | [optional] +**startingBalance** | **float** | | [optional] +**closingBalance** | **float** | | [optional] +**maxBalanceInYear** | **float** | | [optional] +**interestPaid** | **float** | | [optional] +**cashEquivalent** | **float** | [readonly] | [optional] [readonly] +**fullTaxMonths** | **int** | [readonly] | [optional] +**monthlyValue** | **float** | [readonly] | [optional] +**officialInterest** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsNonClass1AType.md b/docs/Model/BenefitDetailsNonClass1AType.md new file mode 100644 index 0000000..33d1276 --- /dev/null +++ b/docs/Model/BenefitDetailsNonClass1AType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsNonClass1AType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsPaymentType.md b/docs/Model/BenefitDetailsPaymentType.md new file mode 100644 index 0000000..0a5365f --- /dev/null +++ b/docs/Model/BenefitDetailsPaymentType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsPaymentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitDetailsUseOfAssetType.md b/docs/Model/BenefitDetailsUseOfAssetType.md new file mode 100644 index 0000000..05af4a3 --- /dev/null +++ b/docs/Model/BenefitDetailsUseOfAssetType.md @@ -0,0 +1,8 @@ +# # BenefitDetailsUseOfAssetType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitPayrolled.md b/docs/Model/BenefitPayrolled.md new file mode 100644 index 0000000..75d9449 --- /dev/null +++ b/docs/Model/BenefitPayrolled.md @@ -0,0 +1,11 @@ +# # BenefitPayrolled + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**amount** | **float** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BenefitType.md b/docs/Model/BenefitType.md new file mode 100644 index 0000000..e0b47ba --- /dev/null +++ b/docs/Model/BenefitType.md @@ -0,0 +1,8 @@ +# # BenefitType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BureauSettings.md b/docs/Model/BureauSettings.md new file mode 100644 index 0000000..94bdc1b --- /dev/null +++ b/docs/Model/BureauSettings.md @@ -0,0 +1,15 @@ +# # BureauSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enableApprovals** | **bool** | Whether or not Payruns for this employer need to go through an Approval process | [optional] +**processorUserId** | **string** | The Id of the user, if any, that is the allocated Processor | [optional] +**reportPackId** | **string** | The Id of the ReportPack, if any, to present to the Payroll Client | [optional] +**isBacsClient** | **bool** | Indicates that the bureau is responsible for BACS payments of net wages to employees | [optional] +**isBacsClientForHmrc** | **bool** | Indicates that the bureau is responsible for BACS payments of HMRC liabilites | [optional] +**showContactCard** | **bool** | Show a Contact card with the Processors details on the PayrollClient dashboard | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CISSubContractorType.md b/docs/Model/CISSubContractorType.md new file mode 100644 index 0000000..6e26733 --- /dev/null +++ b/docs/Model/CISSubContractorType.md @@ -0,0 +1,8 @@ +# # CISSubContractorType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CISTaxStatus.md b/docs/Model/CISTaxStatus.md new file mode 100644 index 0000000..ff515e7 --- /dev/null +++ b/docs/Model/CISTaxStatus.md @@ -0,0 +1,8 @@ +# # CISTaxStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CalendarEntry.md b/docs/Model/CalendarEntry.md new file mode 100644 index 0000000..f74fcb5 --- /dev/null +++ b/docs/Model/CalendarEntry.md @@ -0,0 +1,12 @@ +# # CalendarEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | [optional] +**start** | **\DateTime** | | [optional] +**end** | **\DateTime** | | [optional] +**type** | [**\SynergiTech\Staffology\Model\CalendarEntryType**](CalendarEntryType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CalendarEntryType.md b/docs/Model/CalendarEntryType.md new file mode 100644 index 0000000..711635c --- /dev/null +++ b/docs/Model/CalendarEntryType.md @@ -0,0 +1,8 @@ +# # CalendarEntryType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CalendarMonth.md b/docs/Model/CalendarMonth.md new file mode 100644 index 0000000..9e01f2d --- /dev/null +++ b/docs/Model/CalendarMonth.md @@ -0,0 +1,8 @@ +# # CalendarMonth + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CarCharge.md b/docs/Model/CarCharge.md new file mode 100644 index 0000000..f946426 --- /dev/null +++ b/docs/Model/CarCharge.md @@ -0,0 +1,17 @@ +# # CarCharge + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dieselSurcharge** | **float** | | [optional] +**maxCharge** | **float** | | [optional] +**minCharge** | **float** | | [optional] +**fuelCharge** | **float** | | [optional] +**newCarRateReductionDate** | **\DateTime** | | [optional] +**newCarRateReductionAmount** | **float** | | [optional] +**co2Table** | [**\SynergiTech\Staffology\Model\CarChargeRate[]**](CarChargeRate.md) | | [optional] +**engineSizeTable** | [**\SynergiTech\Staffology\Model\CarChargeRate[]**](CarChargeRate.md) | | [optional] +**zeroEmissionsTable** | [**\SynergiTech\Staffology\Model\CarChargeRate[]**](CarChargeRate.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CarChargeRate.md b/docs/Model/CarChargeRate.md new file mode 100644 index 0000000..75399f4 --- /dev/null +++ b/docs/Model/CarChargeRate.md @@ -0,0 +1,11 @@ +# # CarChargeRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rangeStart** | **int** | | [optional] +**rangeStop** | **int** | | [optional] +**rate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangeSummary.md b/docs/Model/ChangeSummary.md new file mode 100644 index 0000000..8c5b5ee --- /dev/null +++ b/docs/Model/ChangeSummary.md @@ -0,0 +1,28 @@ +# # ChangeSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**auditId** | **string** | | [optional] +**previousAuditId** | **string** | This Id is used to delete the previous audit entry once the change summary entry is created for the modifications between the current and the previous audit entry. | [optional] +**date** | **\DateTime** | | [optional] +**name** | **string** | | [optional] [readonly] +**actionPerformed** | [**\SynergiTech\Staffology\Model\AuditEventAction**](AuditEventAction.md) | | [optional] +**entityType** | [**\SynergiTech\Staffology\Model\EntityType**](EntityType.md) | | [optional] +**entityId** | **string** | Id of the underlying entity | [optional] +**employeeUniqueId** | **string** | Unique id of the employee this operation belongs to | [optional] +**employerUniqueId** | **string** | Unique id of the employer this operation belongs to | [optional] +**actionPerformedBy** | **string** | | [optional] +**actionPerformedOn** | **string** | | [optional] +**employeeFirstName** | **string** | | [optional] +**employeeLastName** | **string** | | [optional] +**uniqueId** | **string** | Unique id of the owner this request belongs to | [optional] +**parentEventType** | **string** | | [optional] +**displayName** | **string** | | [optional] +**payRunPeriod** | **int** | | [optional] +**changeType** | **string** | | [optional] +**modifications** | [**\SynergiTech\Staffology\Model\FieldModification[]**](FieldModification.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangeSummaryListReportResponse.md b/docs/Model/ChangeSummaryListReportResponse.md new file mode 100644 index 0000000..00ba471 --- /dev/null +++ b/docs/Model/ChangeSummaryListReportResponse.md @@ -0,0 +1,12 @@ +# # ChangeSummaryListReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\ChangeSummary[]**](ChangeSummary.md) | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Cis300.md b/docs/Model/Cis300.md new file mode 100644 index 0000000..0c10df5 --- /dev/null +++ b/docs/Model/Cis300.md @@ -0,0 +1,21 @@ +# # Cis300 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxMonth** | **int** | | [optional] +**employeeCount** | **int** | | [optional] +**employmentStatusDeclaration** | **bool** | | [optional] +**verificationDeclaration** | **bool** | | [optional] +**informationCorrectDeclaration** | **bool** | | [optional] +**inactivityDeclaration** | **bool** | | [optional] +**cisReturn** | [**\SynergiTech\Staffology\Model\CisReturn**](CisReturn.md) | | [optional] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Cis300Declarations.md b/docs/Model/Cis300Declarations.md new file mode 100644 index 0000000..4c35b13 --- /dev/null +++ b/docs/Model/Cis300Declarations.md @@ -0,0 +1,12 @@ +# # Cis300Declarations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employmentStatus** | **string** | | [optional] +**verification** | **string** | | [optional] +**informationCorrect** | **string** | | [optional] +**inactivity** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Cis300ReportResponse.md b/docs/Model/Cis300ReportResponse.md new file mode 100644 index 0000000..6c3515b --- /dev/null +++ b/docs/Model/Cis300ReportResponse.md @@ -0,0 +1,12 @@ +# # Cis300ReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\Cis300**](Cis300.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisContractor.md b/docs/Model/CisContractor.md new file mode 100644 index 0000000..fdc9256 --- /dev/null +++ b/docs/Model/CisContractor.md @@ -0,0 +1,10 @@ +# # CisContractor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**utr** | **string** | | [optional] +**aOref** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisDetails.md b/docs/Model/CisDetails.md new file mode 100644 index 0000000..74dc87a --- /dev/null +++ b/docs/Model/CisDetails.md @@ -0,0 +1,18 @@ +# # CisDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\CISSubContractorType**](CISSubContractorType.md) | | [optional] +**utr** | **string** | | [optional] +**tradingName** | **string** | | [optional] +**companyUtr** | **string** | | [optional] +**companyNumber** | **string** | | [optional] +**vatRegistered** | **bool** | | [optional] +**vatNumber** | **string** | | [optional] +**vatRate** | **float** | | [optional] +**reverseChargeVAT** | **bool** | | [optional] +**verification** | [**\SynergiTech\Staffology\Model\CisVerificationDetails**](CisVerificationDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisPartnership.md b/docs/Model/CisPartnership.md new file mode 100644 index 0000000..7d64404 --- /dev/null +++ b/docs/Model/CisPartnership.md @@ -0,0 +1,10 @@ +# # CisPartnership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**utr** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisRequest.md b/docs/Model/CisRequest.md new file mode 100644 index 0000000..caf937e --- /dev/null +++ b/docs/Model/CisRequest.md @@ -0,0 +1,11 @@ +# # CisRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contractor** | [**\SynergiTech\Staffology\Model\CisContractor**](CisContractor.md) | | [optional] +**subcontractor** | [**\SynergiTech\Staffology\Model\CisSubContractor[]**](CisSubContractor.md) | | [optional] +**declaration** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisReturn.md b/docs/Model/CisReturn.md new file mode 100644 index 0000000..a2dc27e --- /dev/null +++ b/docs/Model/CisReturn.md @@ -0,0 +1,12 @@ +# # CisReturn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contractor** | [**\SynergiTech\Staffology\Model\CisContractor**](CisContractor.md) | | [optional] +**subcontractor** | [**\SynergiTech\Staffology\Model\CisSubContractor[]**](CisSubContractor.md) | | [optional] +**nilReturn** | **string** | | [optional] +**declarations** | [**\SynergiTech\Staffology\Model\Cis300Declarations**](Cis300Declarations.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisStatement.md b/docs/Model/CisStatement.md new file mode 100644 index 0000000..cc69e4c --- /dev/null +++ b/docs/Model/CisStatement.md @@ -0,0 +1,22 @@ +# # CisStatement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**taxMonth** | **int** | [readonly] | [optional] +**contractorName** | **string** | [readonly] | [optional] +**contractorAddress** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**contractorOfficeNumber** | **string** | [readonly] | [optional] +**contractorPayeReference** | **string** | [readonly] | [optional] +**subcontractorName** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] +**subContractorUtr** | **string** | [readonly] | [optional] +**verificationNumber** | **string** | [readonly] | [optional] +**grossAmountPaid** | **float** | [readonly] Gross Amount Paid (Excl VAT) | [optional] +**costOfMaterials** | **float** | [readonly] | [optional] +**amountLiableToDeduction** | **float** | [readonly] | [optional] +**amountDeducted** | **float** | [readonly] | [optional] +**amountPayable** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisStatementListReportResponse.md b/docs/Model/CisStatementListReportResponse.md new file mode 100644 index 0000000..7a80eb0 --- /dev/null +++ b/docs/Model/CisStatementListReportResponse.md @@ -0,0 +1,12 @@ +# # CisStatementListReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\CisStatement[]**](CisStatement.md) | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisSubContractor.md b/docs/Model/CisSubContractor.md new file mode 100644 index 0000000..b9e2402 --- /dev/null +++ b/docs/Model/CisSubContractor.md @@ -0,0 +1,37 @@ +# # CisSubContractor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeUniqueId** | **string** | | [optional] +**emailStatementTo** | **string** | | [optional] +**numberOfPayments** | **int** | | [optional] +**item** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**displayName** | **string** | | [optional] +**action** | **string** | | [optional] +**type** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] +**tradingName** | **string** | | [optional] +**worksRef** | **string** | | [optional] +**unmatchedRate** | **string** | | [optional] +**utr** | **string** | | [optional] +**crn** | **string** | | [optional] +**nino** | **string** | | [optional] +**partnership** | [**\SynergiTech\Staffology\Model\CisPartnership**](CisPartnership.md) | | [optional] +**address** | [**\SynergiTech\Staffology\Model\RtiEmployeeAddress**](RtiEmployeeAddress.md) | | [optional] +**telephone** | **string** | | [optional] +**totalPaymentsUnrounded** | **string** | | [optional] +**costOfMaterialsUnrounded** | **string** | | [optional] +**umbrellaFee** | **string** | | [optional] +**validationMsg** | **string** | | [optional] +**verificationNumber** | **string** | | [optional] +**totalPayments** | **string** | | [optional] +**costOfMaterials** | **string** | | [optional] +**totalDeducted** | **string** | | [optional] +**matched** | **string** | | [optional] +**taxTreatment** | **string** | | [optional] +**netPayment** | **string** | | [optional] +**vatAmount** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisSubContractorSummary.md b/docs/Model/CisSubContractorSummary.md new file mode 100644 index 0000000..42c9d4d --- /dev/null +++ b/docs/Model/CisSubContractorSummary.md @@ -0,0 +1,19 @@ +# # CisSubContractorSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | | [optional] +**tradingName** | **string** | | [optional] +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**niNumber** | **string** | | [optional] +**type** | [**\SynergiTech\Staffology\Model\CISSubContractorType**](CISSubContractorType.md) | | [optional] +**utr** | **string** | | [optional] +**taxStatus** | [**\SynergiTech\Staffology\Model\CISTaxStatus**](CISTaxStatus.md) | | [optional] +**verificationNumber** | **string** | | [optional] +**displayName** | **string** | | [optional] [readonly] +**validationMessage** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisSubContractorSummaryListReportResponse.md b/docs/Model/CisSubContractorSummaryListReportResponse.md new file mode 100644 index 0000000..c7f3feb --- /dev/null +++ b/docs/Model/CisSubContractorSummaryListReportResponse.md @@ -0,0 +1,12 @@ +# # CisSubContractorSummaryListReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\CisSubContractorSummary[]**](CisSubContractorSummary.md) | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisVerification.md b/docs/Model/CisVerification.md new file mode 100644 index 0000000..c959e31 --- /dev/null +++ b/docs/Model/CisVerification.md @@ -0,0 +1,18 @@ +# # CisVerification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employees** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | | [optional] +**employeeCount** | **int** | | [optional] +**cisRequest** | [**\SynergiTech\Staffology\Model\CisRequest**](CisRequest.md) | | [optional] +**responses** | [**\SynergiTech\Staffology\Model\CisSubContractor[]**](CisSubContractor.md) | | [optional] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CisVerificationDetails.md b/docs/Model/CisVerificationDetails.md new file mode 100644 index 0000000..754e489 --- /dev/null +++ b/docs/Model/CisVerificationDetails.md @@ -0,0 +1,15 @@ +# # CisVerificationDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manuallyEntered** | **bool** | | [optional] +**matchInsteadOfVerify** | **bool** | | [optional] +**number** | **string** | | [optional] +**date** | **\DateTime** | | [optional] +**taxStatus** | [**\SynergiTech\Staffology\Model\CISTaxStatus**](CISTaxStatus.md) | | [optional] +**verificationRequest** | **string** | [readonly] If a Verification request has been made for this employee then this will show its ID | [optional] +**verificationResponse** | [**\SynergiTech\Staffology\Model\CisSubContractor**](CisSubContractor.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAddress.md b/docs/Model/ContractAddress.md new file mode 100644 index 0000000..87c8e1d --- /dev/null +++ b/docs/Model/ContractAddress.md @@ -0,0 +1,16 @@ +# # ContractAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line1** | **string** | | [optional] +**line2** | **string** | | [optional] +**line3** | **string** | | [optional] +**line4** | **string** | | [optional] +**line5** | **string** | | [optional] +**postCode** | **string** | | [optional] +**country** | [**\SynergiTech\Staffology\Model\Country**](Country.md) | | [optional] +**foreignCountry** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAeAssessmentAction.md b/docs/Model/ContractAeAssessmentAction.md new file mode 100644 index 0000000..ce3cd90 --- /dev/null +++ b/docs/Model/ContractAeAssessmentAction.md @@ -0,0 +1,16 @@ +# # ContractAeAssessmentAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**\SynergiTech\Staffology\Model\AeAction**](AeAction.md) | | [optional] +**employeeState** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**actionCompleted** | **bool** | Indicates whether or not the required action was successfully completed | [optional] +**actionCompletedMessage** | **string** | Gives further information about the action taken or the reason if wasn't successfully completed | [optional] +**requiredLetter** | [**\SynergiTech\Staffology\Model\AeStatutoryLetter**](AeStatutoryLetter.md) | | [optional] +**pensionSchemeId** | **string** | The PensionSchemeId that a completed action relates to | [optional] +**workerGroupId** | **string** | The WorkerGroupId that a completed action relates to | [optional] +**letterNotYetSent** | **bool** | Indicates whether or not any required letter has been sent | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAeAssessmentRequest.md b/docs/Model/ContractAeAssessmentRequest.md new file mode 100644 index 0000000..040300b --- /dev/null +++ b/docs/Model/ContractAeAssessmentRequest.md @@ -0,0 +1,9 @@ +# # ContractAeAssessmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assessmentDate** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAeAssessmentResponse.md b/docs/Model/ContractAeAssessmentResponse.md new file mode 100644 index 0000000..fb04355 --- /dev/null +++ b/docs/Model/ContractAeAssessmentResponse.md @@ -0,0 +1,22 @@ +# # ContractAeAssessmentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique id of the object | [optional] +**employeeState** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**age** | **int** | The age of the Employee at the time of the assessment | [optional] +**ukWorker** | [**\SynergiTech\Staffology\Model\AeUKWorker**](AeUKWorker.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | The PaySchedule ordinal for the Employee at the time of the assessment | [optional] +**earningsInPeriod** | **float** | | [optional] +**qualifyingEarningsInPeriod** | **float** | | [optional] +**aeExclusionCode** | [**\SynergiTech\Staffology\Model\AeExclusionCode**](AeExclusionCode.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\AeStatus**](AeStatus.md) | | [optional] +**reason** | **string** | The reason for determining the Status given. | [optional] +**action** | [**\SynergiTech\Staffology\Model\ContractAeAssessmentAction**](ContractAeAssessmentAction.md) | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\ContractEmployeeItem**](ContractEmployeeItem.md) | | [optional] +**assessmentDate** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAllowanceGradesRequest.md b/docs/Model/ContractAllowanceGradesRequest.md new file mode 100644 index 0000000..ff87d38 --- /dev/null +++ b/docs/Model/ContractAllowanceGradesRequest.md @@ -0,0 +1,12 @@ +# # ContractAllowanceGradesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowanceGradePayslipText** | **string** | Alternative text for display on the payslip (i.e. TLR1A) | [optional] +**allowanceGradeAnnualValue** | **float** | FTE value of allowance grade | [optional] +**allowanceGradeEffectiveDate** | **\DateTime** | Effective date of the value | [optional] +**allowanceName** | **string** | Spine Allowance Name | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAllowanceGradesResponse.md b/docs/Model/ContractAllowanceGradesResponse.md new file mode 100644 index 0000000..665408b --- /dev/null +++ b/docs/Model/ContractAllowanceGradesResponse.md @@ -0,0 +1,13 @@ +# # ContractAllowanceGradesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowanceGradePayslipText** | **string** | Alternative text for display on the payslip (i.e. TLR1A) | [optional] +**allowanceGradeAnnualValue** | **float** | FTE value of allowance grade | [optional] +**allowanceGradeEffectiveDate** | **\DateTime** | Effective date of the value | [optional] +**uniqueId** | **string** | Spine Allowance identifier | [optional] +**allowanceName** | **string** | Spine Allowance Name | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAllowanceGradesUpdateRequest.md b/docs/Model/ContractAllowanceGradesUpdateRequest.md new file mode 100644 index 0000000..260f738 --- /dev/null +++ b/docs/Model/ContractAllowanceGradesUpdateRequest.md @@ -0,0 +1,13 @@ +# # ContractAllowanceGradesUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Allowance Grades identifier | [optional] +**allowanceGradePayslipText** | **string** | Alternative text for display on the payslip (i.e. TLR1A) | [optional] +**allowanceGradeAnnualValue** | **float** | FTE value of allowance grade | [optional] +**allowanceGradeEffectiveDate** | **\DateTime** | Effective date of the value | [optional] +**allowanceName** | **string** | Spine Allowance Name | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAnalysisCategoryCodeRequest.md b/docs/Model/ContractAnalysisCategoryCodeRequest.md new file mode 100644 index 0000000..af3e3dc --- /dev/null +++ b/docs/Model/ContractAnalysisCategoryCodeRequest.md @@ -0,0 +1,12 @@ +# # ContractAnalysisCategoryCodeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [optional] +**title** | **string** | | [optional] +**color** | **string** | | [optional] +**accountingCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAnalysisCategoryCodeResponse.md b/docs/Model/ContractAnalysisCategoryCodeResponse.md new file mode 100644 index 0000000..7c96b74 --- /dev/null +++ b/docs/Model/ContractAnalysisCategoryCodeResponse.md @@ -0,0 +1,13 @@ +# # ContractAnalysisCategoryCodeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Analysis Category Code identifier | [optional] +**code** | **string** | | [optional] +**title** | **string** | | [optional] +**color** | **string** | | [optional] +**accountingCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAnalysisCategoryRequest.md b/docs/Model/ContractAnalysisCategoryRequest.md new file mode 100644 index 0000000..bb78d65 --- /dev/null +++ b/docs/Model/ContractAnalysisCategoryRequest.md @@ -0,0 +1,9 @@ +# # ContractAnalysisCategoryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Analysis Category Name | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAnalysisCategoryResponse.md b/docs/Model/ContractAnalysisCategoryResponse.md new file mode 100644 index 0000000..b414fa0 --- /dev/null +++ b/docs/Model/ContractAnalysisCategoryResponse.md @@ -0,0 +1,10 @@ +# # ContractAnalysisCategoryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Analysis Category identifier | [optional] +**name** | **string** | Analysis Category Name | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAutoEnrolmentRequest.md b/docs/Model/ContractAutoEnrolmentRequest.md new file mode 100644 index 0000000..5888d6c --- /dev/null +++ b/docs/Model/ContractAutoEnrolmentRequest.md @@ -0,0 +1,15 @@ +# # ContractAutoEnrolmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lastAssessment** | [**\SynergiTech\Staffology\Model\ContractAeAssessmentRequest**](ContractAeAssessmentRequest.md) | | [optional] +**ukWorker** | [**\SynergiTech\Staffology\Model\AeUKWorker**](AeUKWorker.md) | | [optional] +**daysToDeferAssessment** | **int** | The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. | [optional] +**deferByMonthsNotDays** | **bool** | If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days | [optional] +**exempt** | **bool** | | [optional] +**aeExclusionCode** | [**\SynergiTech\Staffology\Model\AeExclusionCode**](AeExclusionCode.md) | | [optional] +**aePostponementLetterSent** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractAutoEnrolmentResponse.md b/docs/Model/ContractAutoEnrolmentResponse.md new file mode 100644 index 0000000..70f62ae --- /dev/null +++ b/docs/Model/ContractAutoEnrolmentResponse.md @@ -0,0 +1,18 @@ +# # ContractAutoEnrolmentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | [**\SynergiTech\Staffology\Model\AeEmployeeState**](AeEmployeeState.md) | | [optional] +**stateDate** | **\DateTime** | | [optional] +**postponementDate** | **\DateTime** | [readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date. This is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null This is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not. | [optional] +**lastAssessment** | [**\SynergiTech\Staffology\Model\ContractAeAssessmentResponse**](ContractAeAssessmentResponse.md) | | [optional] +**ukWorker** | [**\SynergiTech\Staffology\Model\AeUKWorker**](AeUKWorker.md) | | [optional] +**daysToDeferAssessment** | **int** | The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. | [optional] +**deferByMonthsNotDays** | **bool** | If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days | [optional] +**exempt** | **bool** | | [optional] +**aeExclusionCode** | [**\SynergiTech\Staffology\Model\AeExclusionCode**](AeExclusionCode.md) | | [optional] +**aePostponementLetterSent** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractBankDetails.md b/docs/Model/ContractBankDetails.md new file mode 100644 index 0000000..ea8ddd3 --- /dev/null +++ b/docs/Model/ContractBankDetails.md @@ -0,0 +1,16 @@ +# # ContractBankDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bankName** | **string** | | [optional] +**bankBranch** | **string** | | [optional] +**bankReference** | **string** | | [optional] +**accountName** | **string** | | [optional] +**accountNumber** | **string** | | [optional] +**sortCode** | **string** | | [optional] +**note** | **string** | | [optional] +**buildingSocietyRollNumber** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisDetailsRequest.md b/docs/Model/ContractCisDetailsRequest.md new file mode 100644 index 0000000..f43d57e --- /dev/null +++ b/docs/Model/ContractCisDetailsRequest.md @@ -0,0 +1,18 @@ +# # ContractCisDetailsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**verification** | [**\SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest**](ContractCisVerificationDetailsRequest.md) | | [optional] +**type** | [**\SynergiTech\Staffology\Model\CISSubContractorType**](CISSubContractorType.md) | | [optional] +**utr** | **string** | | [optional] +**tradingName** | **string** | | [optional] +**companyUtr** | **string** | | [optional] +**companyNumber** | **string** | | [optional] +**vatRegistered** | **bool** | | [optional] +**vatNumber** | **string** | | [optional] +**vatRate** | **float** | | [optional] +**reverseChargeVAT** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisDetailsResponse.md b/docs/Model/ContractCisDetailsResponse.md new file mode 100644 index 0000000..4b2e0b8 --- /dev/null +++ b/docs/Model/ContractCisDetailsResponse.md @@ -0,0 +1,18 @@ +# # ContractCisDetailsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**verification** | [**\SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse**](ContractCisVerificationDetailsResponse.md) | | [optional] +**type** | [**\SynergiTech\Staffology\Model\CISSubContractorType**](CISSubContractorType.md) | | [optional] +**utr** | **string** | | [optional] +**tradingName** | **string** | | [optional] +**companyUtr** | **string** | | [optional] +**companyNumber** | **string** | | [optional] +**vatRegistered** | **bool** | | [optional] +**vatNumber** | **string** | | [optional] +**vatRate** | **float** | | [optional] +**reverseChargeVAT** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisPartnership.md b/docs/Model/ContractCisPartnership.md new file mode 100644 index 0000000..f0ffc30 --- /dev/null +++ b/docs/Model/ContractCisPartnership.md @@ -0,0 +1,10 @@ +# # ContractCisPartnership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**utr** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisSubContractor.md b/docs/Model/ContractCisSubContractor.md new file mode 100644 index 0000000..3563bb3 --- /dev/null +++ b/docs/Model/ContractCisSubContractor.md @@ -0,0 +1,36 @@ +# # ContractCisSubContractor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeUniqueId** | **string** | | [optional] +**emailStatementTo** | **string** | | [optional] +**numberOfPayments** | **int** | | [optional] +**item** | [**\SynergiTech\Staffology\Model\ContractCisSubContractorItem**](ContractCisSubContractorItem.md) | | [optional] +**displayName** | **string** | | [optional] +**action** | **string** | | [optional] +**type** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\ContractRtiEmployeeName**](ContractRtiEmployeeName.md) | | [optional] +**tradingName** | **string** | | [optional] +**worksRef** | **string** | | [optional] +**unmatchedRate** | **string** | | [optional] +**utr** | **string** | | [optional] +**crn** | **string** | | [optional] +**nino** | **string** | | [optional] +**partnership** | [**\SynergiTech\Staffology\Model\ContractCisPartnership**](ContractCisPartnership.md) | | [optional] +**address** | [**\SynergiTech\Staffology\Model\ContractRtiEmployeeAddress**](ContractRtiEmployeeAddress.md) | | [optional] +**telephone** | **string** | | [optional] +**totalPaymentsUnrounded** | **string** | | [optional] +**costOfMaterialsUnrounded** | **string** | | [optional] +**umbrellaFee** | **string** | | [optional] +**validationMsg** | **string** | | [optional] +**verificationNumber** | **string** | | [optional] +**totalPayments** | **string** | | [optional] +**costOfMaterials** | **string** | | [optional] +**totalDeducted** | **string** | | [optional] +**matched** | **string** | | [optional] +**taxTreatment** | **string** | | [optional] +**netPayment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisSubContractorItem.md b/docs/Model/ContractCisSubContractorItem.md new file mode 100644 index 0000000..539ffc0 --- /dev/null +++ b/docs/Model/ContractCisSubContractorItem.md @@ -0,0 +1,12 @@ +# # ContractCisSubContractorItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisVerificationDetailsRequest.md b/docs/Model/ContractCisVerificationDetailsRequest.md new file mode 100644 index 0000000..22431dc --- /dev/null +++ b/docs/Model/ContractCisVerificationDetailsRequest.md @@ -0,0 +1,14 @@ +# # ContractCisVerificationDetailsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manuallyEntered** | **bool** | | [optional] +**matchInsteadOfVerify** | **bool** | | [optional] +**number** | **string** | | [optional] +**date** | **\DateTime** | | [optional] +**taxStatus** | [**\SynergiTech\Staffology\Model\CISTaxStatus**](CISTaxStatus.md) | | [optional] +**verificationResponse** | [**\SynergiTech\Staffology\Model\ContractCisSubContractor**](ContractCisSubContractor.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCisVerificationDetailsResponse.md b/docs/Model/ContractCisVerificationDetailsResponse.md new file mode 100644 index 0000000..e0fbbb5 --- /dev/null +++ b/docs/Model/ContractCisVerificationDetailsResponse.md @@ -0,0 +1,15 @@ +# # ContractCisVerificationDetailsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**verificationRequest** | **string** | If a Verification request has been made for this employee then this will show its ID | [optional] +**manuallyEntered** | **bool** | | [optional] +**matchInsteadOfVerify** | **bool** | | [optional] +**number** | **string** | | [optional] +**date** | **\DateTime** | | [optional] +**taxStatus** | [**\SynergiTech\Staffology\Model\CISTaxStatus**](CISTaxStatus.md) | | [optional] +**verificationResponse** | [**\SynergiTech\Staffology\Model\ContractCisSubContractor**](ContractCisSubContractor.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCostCentreJournalOverridesRequest.md b/docs/Model/ContractCostCentreJournalOverridesRequest.md new file mode 100644 index 0000000..004449f --- /dev/null +++ b/docs/Model/ContractCostCentreJournalOverridesRequest.md @@ -0,0 +1,11 @@ +# # ContractCostCentreJournalOverridesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | CostCentre Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCostCentreJournalOverridesResponse.md b/docs/Model/ContractCostCentreJournalOverridesResponse.md new file mode 100644 index 0000000..1220e14 --- /dev/null +++ b/docs/Model/ContractCostCentreJournalOverridesResponse.md @@ -0,0 +1,12 @@ +# # ContractCostCentreJournalOverridesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Cost Centre Journal Overrides identifier | [optional] +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | CostCentre Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCostCentreJournalOverridesResponseItem.md b/docs/Model/ContractCostCentreJournalOverridesResponseItem.md new file mode 100644 index 0000000..da2e86c --- /dev/null +++ b/docs/Model/ContractCostCentreJournalOverridesResponseItem.md @@ -0,0 +1,12 @@ +# # ContractCostCentreJournalOverridesResponseItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md b/docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md new file mode 100644 index 0000000..9724051 --- /dev/null +++ b/docs/Model/ContractCostCentreJournalOverridesUpdateRequest.md @@ -0,0 +1,12 @@ +# # ContractCostCentreJournalOverridesUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique Id | [optional] +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | CostCentre Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractCreateEmployeeRequest.md b/docs/Model/ContractCreateEmployeeRequest.md new file mode 100644 index 0000000..7e1ea38 --- /dev/null +++ b/docs/Model/ContractCreateEmployeeRequest.md @@ -0,0 +1,20 @@ +# # ContractCreateEmployeeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**personalDetails** | [**\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest**](ContractPersonalDetailsRequest.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest**](ContractEmploymentDetailsRequest.md) | | [optional] +**autoEnrolment** | [**\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest**](ContractAutoEnrolmentRequest.md) | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest**](ContractLeaveSettingsRequest.md) | | [optional] +**rightToWork** | [**\SynergiTech\Staffology\Model\ContractRightToWork**](ContractRightToWork.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\ContractBankDetails**](ContractBankDetails.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\ContractPayOptionsRequest**](ContractPayOptionsRequest.md) | | [optional] +**tags** | **string[]** | | [optional] +**holidaySchemeUniqueId** | **string** | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**evcId** | **string** | If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. | [optional] +**sourceSystemId** | **string** | Used by external systems so they can store an immutable reference. Once this property is set it cannot be changed. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentJournalOverridesRequest.md b/docs/Model/ContractDepartmentJournalOverridesRequest.md new file mode 100644 index 0000000..59f1403 --- /dev/null +++ b/docs/Model/ContractDepartmentJournalOverridesRequest.md @@ -0,0 +1,11 @@ +# # ContractDepartmentJournalOverridesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | Department Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentJournalOverridesResponse.md b/docs/Model/ContractDepartmentJournalOverridesResponse.md new file mode 100644 index 0000000..61ebd74 --- /dev/null +++ b/docs/Model/ContractDepartmentJournalOverridesResponse.md @@ -0,0 +1,12 @@ +# # ContractDepartmentJournalOverridesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Department Journal Overrides identifier | [optional] +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | Department Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentJournalOverridesResponseItem.md b/docs/Model/ContractDepartmentJournalOverridesResponseItem.md new file mode 100644 index 0000000..cff0195 --- /dev/null +++ b/docs/Model/ContractDepartmentJournalOverridesResponseItem.md @@ -0,0 +1,12 @@ +# # ContractDepartmentJournalOverridesResponseItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md b/docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md new file mode 100644 index 0000000..d89b7c4 --- /dev/null +++ b/docs/Model/ContractDepartmentJournalOverridesUpdateRequest.md @@ -0,0 +1,12 @@ +# # ContractDepartmentJournalOverridesUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique Id | [optional] +**tokenDescription** | **string** | Token Description | [optional] +**mapping** | **string** | Department Journal Overrides Mapping | [optional] +**journalTokenPublicId** | **string** | Journal Token Public Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentRequest.md b/docs/Model/ContractDepartmentRequest.md new file mode 100644 index 0000000..1db4fc5 --- /dev/null +++ b/docs/Model/ContractDepartmentRequest.md @@ -0,0 +1,12 @@ +# # ContractDepartmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The unique code for this Department | +**title** | **string** | The name of this Department | +**color** | **string** | A color to used to represent this Department, in hex format. ie 'ff0000' | [optional] +**accountingCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDepartmentResponse.md b/docs/Model/ContractDepartmentResponse.md new file mode 100644 index 0000000..35983d9 --- /dev/null +++ b/docs/Model/ContractDepartmentResponse.md @@ -0,0 +1,13 @@ +# # ContractDepartmentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeCount** | **int** | The number of employees with this set as their primary department | [optional] +**code** | **string** | The unique code for this Department | +**title** | **string** | The name of this Department | +**color** | **string** | A color to used to represent this Department, in hex format. ie 'ff0000' | [optional] +**accountingCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractDirectorshipDetails.md b/docs/Model/ContractDirectorshipDetails.md new file mode 100644 index 0000000..7a36eae --- /dev/null +++ b/docs/Model/ContractDirectorshipDetails.md @@ -0,0 +1,12 @@ +# # ContractDirectorshipDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isDirector** | **bool** | | [optional] +**startDate** | **\DateTime** | | [optional] +**leaveDate** | **\DateTime** | | [optional] +**niAlternativeMethod** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeItem.md b/docs/Model/ContractEmployeeItem.md new file mode 100644 index 0000000..3de54d3 --- /dev/null +++ b/docs/Model/ContractEmployeeItem.md @@ -0,0 +1,12 @@ +# # ContractEmployeeItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeResponse.md b/docs/Model/ContractEmployeeResponse.md new file mode 100644 index 0000000..c6f2427 --- /dev/null +++ b/docs/Model/ContractEmployeeResponse.md @@ -0,0 +1,23 @@ +# # ContractEmployeeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique id of the object | [optional] +**personalDetails** | [**\SynergiTech\Staffology\Model\ContractPersonalDetailsResponse**](ContractPersonalDetailsResponse.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse**](ContractEmploymentDetailsResponse.md) | | [optional] +**autoEnrolment** | [**\SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse**](ContractAutoEnrolmentResponse.md) | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\ContractLeaveSettingsResponse**](ContractLeaveSettingsResponse.md) | | [optional] +**rightToWork** | [**\SynergiTech\Staffology\Model\ContractRightToWork**](ContractRightToWork.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\ContractBankDetails**](ContractBankDetails.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\ContractPayOptionsResponse**](ContractPayOptionsResponse.md) | | [optional] +**tags** | **string[]** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\EmployeeStatus**](EmployeeStatus.md) | | [optional] +**aeNotEnroledWarning** | **bool** | | [optional] +**sourceSystemId** | **string** | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**holidaySchemeUniqueId** | **string** | | [optional] +**evcId** | **string** | If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md b/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md new file mode 100644 index 0000000..66e43fc --- /dev/null +++ b/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.md @@ -0,0 +1,15 @@ +# # ContractEmployeeRoleAnalysisCategoryCodeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Analysis Category code | [optional] +**color** | **string** | Analysis Category code color | [optional] +**title** | **string** | Analysis Category code Title | [optional] +**weighting** | **float** | Weightage for analysis category code | [optional] +**analysisCategoryName** | **string** | Analysis category name for AnalysisCategory code | [optional] +**analysisCategoryPublicId** | **string** | Analysis category identifier | [optional] +**isPrimary** | **bool** | Return whether Employee Role is primary for not | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md b/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md new file mode 100644 index 0000000..11ba6d3 --- /dev/null +++ b/docs/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.md @@ -0,0 +1,16 @@ +# # ContractEmployeeRoleAnalysisCategoryCodeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Employee Role Analysis Category Code identifier | [optional] +**code** | **string** | Analysis Category code | [optional] +**color** | **string** | Analysis Category code color | [optional] +**title** | **string** | Analysis Category code Title | [optional] +**weighting** | **float** | Weightage for analysis category code | [optional] +**analysisCategoryName** | **string** | Analysis category name for AnalysisCategory code | [optional] +**analysisCategoryPublicId** | **string** | Analysis category identifier | [optional] +**isPrimary** | **bool** | Return whether Employee Role is primary for not | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleItem.md b/docs/Model/ContractEmployeeRoleItem.md new file mode 100644 index 0000000..dc20107 --- /dev/null +++ b/docs/Model/ContractEmployeeRoleItem.md @@ -0,0 +1,12 @@ +# # ContractEmployeeRoleItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleResponse.md b/docs/Model/ContractEmployeeRoleResponse.md new file mode 100644 index 0000000..9a8e15e --- /dev/null +++ b/docs/Model/ContractEmployeeRoleResponse.md @@ -0,0 +1,21 @@ +# # ContractEmployeeRoleResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**jobTitle** | **string** | Job Title of the Role | [optional] +**isPrimary** | **bool** | Set to True if this is Primary role of the Employee | [optional] +**reference** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\RoleBasis**](RoleBasis.md) | | [optional] +**type** | [**\SynergiTech\Staffology\Model\RoleType**](RoleType.md) | | [optional] +**displayName** | **string** | | [optional] [readonly] +**payOptions** | [**\SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse**](ContractPayOptionsBaseResponse.md) | | [optional] +**workingPattern** | [**\SynergiTech\Staffology\Model\ContractWorkingPatternResponse**](ContractWorkingPatternResponse.md) | | [optional] +**occupationalMaternityPolicyUniqueId** | **string** | | [optional] +**occupationalSicknessPolicyUniqueId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleWorkingPatternRequest.md b/docs/Model/ContractEmployeeRoleWorkingPatternRequest.md new file mode 100644 index 0000000..edf9f77 --- /dev/null +++ b/docs/Model/ContractEmployeeRoleWorkingPatternRequest.md @@ -0,0 +1,10 @@ +# # ContractEmployeeRoleWorkingPatternRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effectiveFrom** | **\DateTime** | The date when the assignment of the Working Pattern becomes effective. | [optional] +**workingPatternUniqueId** | **string** | The UniqueId of the Working Pattern. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleWorkingPatternResponse.md b/docs/Model/ContractEmployeeRoleWorkingPatternResponse.md new file mode 100644 index 0000000..7b0f310 --- /dev/null +++ b/docs/Model/ContractEmployeeRoleWorkingPatternResponse.md @@ -0,0 +1,13 @@ +# # ContractEmployeeRoleWorkingPatternResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | The UniqueId of the model. | [optional] +**effectiveTo** | **\DateTime** | [readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates. | [optional] +**workingPattern** | [**\SynergiTech\Staffology\Model\ContractWorkingPatternResponse**](ContractWorkingPatternResponse.md) | | [optional] +**effectiveFrom** | **\DateTime** | The date when the assignment of the Working Pattern becomes effective. | [optional] +**workingPatternUniqueId** | **string** | The UniqueId of the Working Pattern. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md b/docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md new file mode 100644 index 0000000..9fa7b54 --- /dev/null +++ b/docs/Model/ContractEmployeeRoleWorkingPatternResponseItem.md @@ -0,0 +1,18 @@ +# # ContractEmployeeRoleWorkingPatternResponseItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**workingPatternId** | **string** | The unique id of the working pattern. | [optional] +**effectiveFrom** | **\DateTime** | The date when the assignment of the Working Pattern becomes effective. | [optional] +**effectiveTo** | **\DateTime** | [readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates. | [optional] +**totalHours** | **float** | [readonly] The amount of hours per working pattern. | [optional] +**contractedWeeks** | **float** | [readonly] The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. | [optional] +**title** | **string** | The title of the working pattern. | [optional] +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmployerBase.md b/docs/Model/ContractEmployerBase.md new file mode 100644 index 0000000..2044b42 --- /dev/null +++ b/docs/Model/ContractEmployerBase.md @@ -0,0 +1,10 @@ +# # ContractEmployerBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**uniqueId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmploymentDetailsRequest.md b/docs/Model/ContractEmploymentDetailsRequest.md new file mode 100644 index 0000000..aadafa4 --- /dev/null +++ b/docs/Model/ContractEmploymentDetailsRequest.md @@ -0,0 +1,35 @@ +# # ContractEmploymentDetailsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cis** | [**\SynergiTech\Staffology\Model\ContractCisDetailsRequest**](ContractCisDetailsRequest.md) | | [optional] +**department** | [**\SynergiTech\Staffology\Model\ContractDepartmentRequest**](ContractDepartmentRequest.md) | | [optional] +**cisSubContractor** | **bool** | Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information | [optional] +**payrollCode** | **string** | The Employees Payroll Code. Must be unique within the Employer. | +**jobTitle** | **string** | Job Title of Primary role of the Employee | [optional] +**onHold** | **bool** | Set to true to temporarily exclude the employee from payruns | [optional] +**onFurlough** | **bool** | Set to true if the employee is on furlough. | [optional] +**furloughStart** | **\DateTime** | Furlough Start Date. | [optional] +**furloughEnd** | **\DateTime** | Furlough End Date. | [optional] +**furloughCalculationBasis** | [**\SynergiTech\Staffology\Model\FurloughCalculationBasis**](FurloughCalculationBasis.md) | | [optional] +**furloughCalculationBasisAmount** | **float** | | [optional] +**partialFurlough** | **bool** | Set to true if the employee is partially furloughed. | [optional] +**furloughHoursNormallyWorked** | **float** | | [optional] +**furloughHoursOnFurlough** | **float** | | [optional] +**isApprentice** | **bool** | Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage | [optional] +**apprenticeshipStartDate** | **\DateTime** | | [optional] +**apprenticeshipEndDate** | **\DateTime** | | [optional] +**workingPattern** | **string** | Used when calculating payments for Leave. If null then the default Working Pattern is used | [optional] +**forcePreviousPayrollCode** | **string** | If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. | [optional] +**starterDetails** | [**\SynergiTech\Staffology\Model\ContractStarterDetails**](ContractStarterDetails.md) | | [optional] +**directorshipDetails** | [**\SynergiTech\Staffology\Model\ContractDirectorshipDetails**](ContractDirectorshipDetails.md) | | [optional] +**leaverDetails** | [**\SynergiTech\Staffology\Model\ContractLeaverDetails**](ContractLeaverDetails.md) | | [optional] +**roles** | [**\SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]**](ContractEmployeeRoleItem.md) | List of Roles held by Employee | [optional] +**isWorkingInFreePort** | **bool** | Flag indicating the employee is employed in a Freeport | [optional] +**isWorkingInInvestmentZone** | **bool** | Flag indicating the employee is employed in an Investment Zone | [optional] +**veteranDetails** | [**\SynergiTech\Staffology\Model\ContractVeteranDetails**](ContractVeteranDetails.md) | | [optional] +**continuousEmploymentDate** | **\DateTime** | Date of continuous employment | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractEmploymentDetailsResponse.md b/docs/Model/ContractEmploymentDetailsResponse.md new file mode 100644 index 0000000..ad0bff3 --- /dev/null +++ b/docs/Model/ContractEmploymentDetailsResponse.md @@ -0,0 +1,36 @@ +# # ContractEmploymentDetailsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cis** | [**\SynergiTech\Staffology\Model\ContractCisDetailsResponse**](ContractCisDetailsResponse.md) | | [optional] +**department** | [**\SynergiTech\Staffology\Model\ContractDepartmentResponse**](ContractDepartmentResponse.md) | | [optional] +**includeSecondedInfoOnStarter** | **bool** | | [optional] +**cisSubContractor** | **bool** | Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information | [optional] +**payrollCode** | **string** | The Employees Payroll Code. Must be unique within the Employer. | +**jobTitle** | **string** | Job Title of Primary role of the Employee | [optional] +**onHold** | **bool** | Set to true to temporarily exclude the employee from payruns | [optional] +**onFurlough** | **bool** | Set to true if the employee is on furlough. | [optional] +**furloughStart** | **\DateTime** | Furlough Start Date. | [optional] +**furloughEnd** | **\DateTime** | Furlough End Date. | [optional] +**furloughCalculationBasis** | [**\SynergiTech\Staffology\Model\FurloughCalculationBasis**](FurloughCalculationBasis.md) | | [optional] +**furloughCalculationBasisAmount** | **float** | | [optional] +**partialFurlough** | **bool** | Set to true if the employee is partially furloughed. | [optional] +**furloughHoursNormallyWorked** | **float** | | [optional] +**furloughHoursOnFurlough** | **float** | | [optional] +**isApprentice** | **bool** | Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage | [optional] +**apprenticeshipStartDate** | **\DateTime** | | [optional] +**apprenticeshipEndDate** | **\DateTime** | | [optional] +**workingPattern** | **string** | Used when calculating payments for Leave. If null then the default Working Pattern is used | [optional] +**forcePreviousPayrollCode** | **string** | If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. | [optional] +**starterDetails** | [**\SynergiTech\Staffology\Model\ContractStarterDetails**](ContractStarterDetails.md) | | [optional] +**directorshipDetails** | [**\SynergiTech\Staffology\Model\ContractDirectorshipDetails**](ContractDirectorshipDetails.md) | | [optional] +**leaverDetails** | [**\SynergiTech\Staffology\Model\ContractLeaverDetails**](ContractLeaverDetails.md) | | [optional] +**roles** | [**\SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]**](ContractEmployeeRoleItem.md) | List of Roles held by Employee | [optional] +**isWorkingInFreePort** | **bool** | Flag indicating the employee is employed in a Freeport | [optional] +**isWorkingInInvestmentZone** | **bool** | Flag indicating the employee is employed in an Investment Zone | [optional] +**veteranDetails** | [**\SynergiTech\Staffology\Model\ContractVeteranDetails**](ContractVeteranDetails.md) | | [optional] +**continuousEmploymentDate** | **\DateTime** | Date of continuous employment | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractFpsFields.md b/docs/Model/ContractFpsFields.md new file mode 100644 index 0000000..ed199de --- /dev/null +++ b/docs/Model/ContractFpsFields.md @@ -0,0 +1,13 @@ +# # ContractFpsFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**offPayrollWorker** | **bool** | | [optional] +**irregularPaymentPattern** | **bool** | True if employee is currently on an irregular payment patter | [optional] +**nonIndividual** | **bool** | True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative) | [optional] +**excludeFromRtiSubmissions** | **bool** | True if Employee is excluded from RTI submissions | [optional] +**hoursNormallyWorked** | [**\SynergiTech\Staffology\Model\HoursNormallyWorked**](HoursNormallyWorked.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractGrossToNetReportRequest.md b/docs/Model/ContractGrossToNetReportRequest.md new file mode 100644 index 0000000..666bc78 --- /dev/null +++ b/docs/Model/ContractGrossToNetReportRequest.md @@ -0,0 +1,17 @@ +# # ContractGrossToNetReportRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**fromPeriod** | **int** | The start Tax Month of report data. | [optional] +**toPeriod** | **int** | The end Tax Month of report data. | [optional] +**reportFormat** | [**\SynergiTech\Staffology\Model\ReportFormat**](ReportFormat.md) | | [optional] +**sortBy** | [**\SynergiTech\Staffology\Model\ReportSortBy**](ReportSortBy.md) | | [optional] +**sortDescending** | **bool** | Defines whether to sort the data in descending order. Defaults to false. | [optional] +**ordinal** | **int** | Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod. | [optional] +**forCis** | **bool** | If true then CIS Subcontractors are reported on. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractHolidayEntitlementRequest.md b/docs/Model/ContractHolidayEntitlementRequest.md new file mode 100644 index 0000000..05d5e72 --- /dev/null +++ b/docs/Model/ContractHolidayEntitlementRequest.md @@ -0,0 +1,12 @@ +# # ContractHolidayEntitlementRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effectiveDate** | **\DateTime** | PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required | [optional] +**baseHolidayEntitlement** | **float** | PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required | [optional] +**yearsServiceEntitlementBasis** | [**\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis**](PaySpineYearsServiceEntitlementBasis.md) | | [optional] +**yearsServiceEntitlements** | [**\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementRequest[]**](ContractYearsServiceEntitlementRequest.md) | Holiday Entitlement Years Service Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractHolidayEntitlementResponse.md b/docs/Model/ContractHolidayEntitlementResponse.md new file mode 100644 index 0000000..3310670 --- /dev/null +++ b/docs/Model/ContractHolidayEntitlementResponse.md @@ -0,0 +1,13 @@ +# # ContractHolidayEntitlementResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique identifier for the Holiday Entitlement | [optional] +**effectiveDate** | **\DateTime** | PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required | [optional] +**baseHolidayEntitlement** | **float** | PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required | [optional] +**yearsServiceEntitlementBasis** | [**\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis**](PaySpineYearsServiceEntitlementBasis.md) | | [optional] +**yearsServiceEntitlements** | [**\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementResponse[]**](ContractYearsServiceEntitlementResponse.md) | Holiday Entitlement Years Service Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractHolidayEntitlementUpdateRequest.md b/docs/Model/ContractHolidayEntitlementUpdateRequest.md new file mode 100644 index 0000000..4c463d8 --- /dev/null +++ b/docs/Model/ContractHolidayEntitlementUpdateRequest.md @@ -0,0 +1,13 @@ +# # ContractHolidayEntitlementUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique identifier for the PaySpine Holiday Entitlement. | [optional] +**effectiveDate** | **\DateTime** | PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required | [optional] +**baseHolidayEntitlement** | **float** | PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required | [optional] +**yearsServiceEntitlementBasis** | [**\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis**](PaySpineYearsServiceEntitlementBasis.md) | | [optional] +**yearsServiceEntitlements** | [**\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementUpdateRequest[]**](ContractYearsServiceEntitlementUpdateRequest.md) | Holiday Entitlement Years Service Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractHolidaySchemeRequest.md b/docs/Model/ContractHolidaySchemeRequest.md new file mode 100644 index 0000000..d1bff60 --- /dev/null +++ b/docs/Model/ContractHolidaySchemeRequest.md @@ -0,0 +1,18 @@ +# # ContractHolidaySchemeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Holiday scheme name | +**averageCalculationWeeks** | **int** | The number of weeks that the average holiday pay calculation is to be calculated over (Default 52) | [optional] +**useOnlyPaidWeeks** | **bool** | If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True) | [optional] +**ignoreSxp** | **bool** | Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True). | [optional] +**calculationDurationUnit** | [**\SynergiTech\Staffology\Model\HolidaySchemeDurationType**](HolidaySchemeDurationType.md) | | [optional] +**useNiPay** | **bool** | If use National insurance gross taxable pay. (Default - True). | [optional] +**useWorkingPattern** | **bool** | If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate. | [optional] +**payCodeSetForPayId** | **string** | the Paycode set that they want to use for the Values to enable the calculation. | [optional] +**payCodeSetForHoursId** | **string** | the Paycode set that they want to use for the Hours to enable the calculation. | [optional] +**useFallbackRate** | **bool** | Indicates to use employee base hourly rate where the calculated average hourly rate is less | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractHolidaySchemeResponse.md b/docs/Model/ContractHolidaySchemeResponse.md new file mode 100644 index 0000000..018bb13 --- /dev/null +++ b/docs/Model/ContractHolidaySchemeResponse.md @@ -0,0 +1,19 @@ +# # ContractHolidaySchemeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Holiday scheme identifier | [optional] +**name** | **string** | Holiday scheme name | +**averageCalculationWeeks** | **int** | The number of weeks that the average holiday pay calculation is to be calculated over (Default 52) | [optional] +**useOnlyPaidWeeks** | **bool** | If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True) | [optional] +**ignoreSxp** | **bool** | Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True). | [optional] +**calculationDurationUnit** | [**\SynergiTech\Staffology\Model\HolidaySchemeDurationType**](HolidaySchemeDurationType.md) | | [optional] +**useNiPay** | **bool** | If use National insurance gross taxable pay. (Default - True). | [optional] +**useWorkingPattern** | **bool** | If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate. | [optional] +**payCodeSetForPayId** | **string** | the Paycode set that they want to use for the Values to enable the calculation. | [optional] +**payCodeSetForHoursId** | **string** | the Paycode set that they want to use for the Hours to enable the calculation. | [optional] +**useFallbackRate** | **bool** | Indicates to use employee base hourly rate where the calculated average hourly rate is less | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJobErrorResponse.md b/docs/Model/ContractJobErrorResponse.md new file mode 100644 index 0000000..586cbb9 --- /dev/null +++ b/docs/Model/ContractJobErrorResponse.md @@ -0,0 +1,13 @@ +# # ContractJobErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier of the job error. | [optional] +**jobId** | **string** | Job public Id | [optional] +**errorMessage** | **string** | Error Message | [optional] +**errorType** | **string** | Type of job error | [optional] +**createdDate** | **\DateTime** | Date the job error was created | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJobResponse.md b/docs/Model/ContractJobResponse.md new file mode 100644 index 0000000..813d1e4 --- /dev/null +++ b/docs/Model/ContractJobResponse.md @@ -0,0 +1,22 @@ +# # ContractJobResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Job public Id. | [optional] +**employerId** | **string** | Employer public Id. | [optional] +**employerName** | **string** | Employer name. | [optional] +**type** | [**\SynergiTech\Staffology\Model\JobType**](JobType.md) | | [optional] +**name** | **string** | The Job name, e.g. uploaded file for Import, or report display name for Report | [optional] +**outputFormat** | **string** | The Job output format, e.g. json/csv/pdf for Report, or something else for other Job types. | [optional] +**status** | [**\SynergiTech\Staffology\Model\JobStatus**](JobStatus.md) | | [optional] +**executionStartTime** | **\DateTime** | The Job excution start time. | [optional] +**timeInQueue** | **int** | The time the Job spent in the queue before execution in seconds. | [optional] +**executionTime** | **int** | The time it took the Job to execute in seconds. | [optional] +**result** | [**\SynergiTech\Staffology\Model\ContractJobResultResponse**](ContractJobResultResponse.md) | | [optional] +**createdDate** | **\DateTime** | Job Created date. | [optional] +**updatedDate** | **\DateTime** | Job Updated date where applicable. | [optional] +**requestedByName** | **string** | The name of the user that requested this job | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJobResultFileResponse.md b/docs/Model/ContractJobResultFileResponse.md new file mode 100644 index 0000000..605f2d6 --- /dev/null +++ b/docs/Model/ContractJobResultFileResponse.md @@ -0,0 +1,10 @@ +# # ContractJobResultFileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fileName** | **string** | Result File name | [optional] +**uri** | **string** | Api method URI that can be used to download the result file | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJobResultResponse.md b/docs/Model/ContractJobResultResponse.md new file mode 100644 index 0000000..c6204eb --- /dev/null +++ b/docs/Model/ContractJobResultResponse.md @@ -0,0 +1,11 @@ +# # ContractJobResultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**\SynergiTech\Staffology\Model\ContractJobResultFileResponse**](ContractJobResultFileResponse.md) | | [optional] +**metadata** | **array** | Job result metadata, e.g. Employee Import stats | [optional] +**errors** | **string[]** | Job execution's errors. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJournalTemplateRequest.md b/docs/Model/ContractJournalTemplateRequest.md new file mode 100644 index 0000000..5ae9e29 --- /dev/null +++ b/docs/Model/ContractJournalTemplateRequest.md @@ -0,0 +1,11 @@ +# # ContractJournalTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**header** | **string** | Header of Journal Template | [optional] +**content** | **string** | Content of Journal Template | [optional] +**useColumnHeaders** | **bool** | Indicates whether content is empty or not | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJournalTemplateResponse.md b/docs/Model/ContractJournalTemplateResponse.md new file mode 100644 index 0000000..d94f500 --- /dev/null +++ b/docs/Model/ContractJournalTemplateResponse.md @@ -0,0 +1,12 @@ +# # ContractJournalTemplateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Journal Template identifier | [optional] +**header** | **string** | Header of Journal Template | [optional] +**content** | **string** | Content of Journal Template | [optional] +**useColumnHeaders** | **bool** | Indicates whether content is empty or not | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJournalTokenRequest.md b/docs/Model/ContractJournalTokenRequest.md new file mode 100644 index 0000000..2133015 --- /dev/null +++ b/docs/Model/ContractJournalTokenRequest.md @@ -0,0 +1,11 @@ +# # ContractJournalTokenRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\JournalTokenType**](JournalTokenType.md) | | [optional] +**name** | **string** | Name of Journal Tokens | [optional] +**description** | **string** | Description of Journal Tokens | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJournalTokenResponse.md b/docs/Model/ContractJournalTokenResponse.md new file mode 100644 index 0000000..8d54903 --- /dev/null +++ b/docs/Model/ContractJournalTokenResponse.md @@ -0,0 +1,12 @@ +# # ContractJournalTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Journal Token identifier | [optional] +**type** | [**\SynergiTech\Staffology\Model\JournalTokenType**](JournalTokenType.md) | | [optional] +**name** | **string** | Name of Journal Tokens | [optional] +**description** | **string** | Description of Journal Tokens | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractJournalTokenResponseItem.md b/docs/Model/ContractJournalTokenResponseItem.md new file mode 100644 index 0000000..cdaa926 --- /dev/null +++ b/docs/Model/ContractJournalTokenResponseItem.md @@ -0,0 +1,12 @@ +# # ContractJournalTokenResponseItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLeaveImportRequest.md b/docs/Model/ContractLeaveImportRequest.md new file mode 100644 index 0000000..0ca67e9 --- /dev/null +++ b/docs/Model/ContractLeaveImportRequest.md @@ -0,0 +1,21 @@ +# # ContractLeaveImportRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | Payroll Code | [optional] +**type** | [**\SynergiTech\Staffology\Model\LeaveType**](LeaveType.md) | | [optional] +**pay** | [**\SynergiTech\Staffology\Model\LeavePayType**](LeavePayType.md) | | [optional] +**openEndedAbsence** | **bool** | Open Ended Absence | [optional] +**from** | **\DateTime** | The first day of Leave. | [optional] +**to** | **\DateTime** | The last day of Leave. | [optional] +**historicLeaveRequiresProcessing** | **bool** | Only used during the creation of historical SSP. When creating historical SSP, this will determine whether to pay that leave in the next PayRun. | [optional] +**averageWeeklyEarnings** | **float** | The employees average weekly earnings. | [optional] +**automaticAWECalculation** | **bool** | Automatic Average Weekly Earnings. | [optional] +**offsetPay** | **bool** | Top-up pay to usual amongst (offsetting) | [optional] +**calculationType** | [**\SynergiTech\Staffology\Model\LeaveCalculationType**](LeaveCalculationType.md) | | [optional] +**percentOfPay** | **float** | Only provided when the leave type is 'Sick' and the payment type is 'Custom'. | [optional] +**strikeHoursToDeduct** | **float** | Only provided when the leave type is 'StrikeAction' and the calculation type is 'SpecifyHours'. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLeaveSettingsRequest.md b/docs/Model/ContractLeaveSettingsRequest.md new file mode 100644 index 0000000..00ca4ae --- /dev/null +++ b/docs/Model/ContractLeaveSettingsRequest.md @@ -0,0 +1,40 @@ +# # ContractLeaveSettingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**useDefaultHolidayType** | **bool** | If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowanceResetDate** | **bool** | If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowance** | **bool** | If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieu** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuRate** | **bool** | If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuAllGrossPay** | **bool** | [Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead. This filed will be removed in a later release. | [optional] +**useDefaultHolidayAccrualBasis** | **bool** | If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuPayAutomatically** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccrueHoursPerDay** | **bool** | If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultMaximumAccruePeriod** | **bool** | If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**allowanceResetDate** | **\DateTime** | The date that the holiday allowance resets. Only the day/month part of the value is relevant. | [optional] +**allowance** | **float** | The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset | [optional] +**adjustment** | **float** | Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**holidayType** | [**\SynergiTech\Staffology\Model\HolidayType**](HolidayType.md) | | [optional] +**accrueSetAmount** | **bool** | If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. | [optional] +**accrueHoursPerDay** | **float** | If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued | [optional] +**showAllowanceOnPayslip** | **bool** | If true then the remaining Allowance will be shown on the employees payslip. | [optional] +**showAhpOnPayslip** | **bool** | If true then the AHP balance will be shown on the employees payslip. | [optional] +**accruePaymentInLieuRate** | **float** | The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. | [optional] +**accruePaymentInLieuAllGrossPay** | **bool** | [Deprecated] Please use HolidayAccrualBasis instead. This filed will be removed in a later release. | [optional] +**accruePaymentInLieuPayAutomatically** | **bool** | Set to true if you want employees to be automatically paid any outstanding holiday pay | [optional] +**occupationalSicknessUniqueId** | **string** | | [optional] +**accruedPaymentAdjustment** | **float** | Any manual adjustment to the total accrued | [optional] +**accruedHoursAdjustment** | **float** | Any manual adjustment to the total hours accrued | [optional] +**holidayAccrualBasis** | [**\SynergiTech\Staffology\Model\HolidayAccrual**](HolidayAccrual.md) | | [optional] +**holidayAccrualDefaultRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**useAggregatedServiceDate** | **bool** | | [optional] +**accruePayCodeSetUniqueId** | **string** | Pay code set to use for accruing holiday pay | [optional] +**maximumAccruePeriod** | **float** | The maximum number of hours capable of being accrued in a single period | [optional] +**holidayLeaveAccrualCustomRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**useDefaultHolidayAccrualDefaultRateType** | **bool** | If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLeaveSettingsResponse.md b/docs/Model/ContractLeaveSettingsResponse.md new file mode 100644 index 0000000..50bbd17 --- /dev/null +++ b/docs/Model/ContractLeaveSettingsResponse.md @@ -0,0 +1,49 @@ +# # ContractLeaveSettingsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowanceUsed** | **float** | [readonly] The number of days used from the allowance since last reset | [optional] +**allowanceUsedPreviousPeriod** | **float** | [readonly] The number of days used in the 12 months prior to the last reset | [optional] +**allowanceRemaining** | **float** | [readonly] The number of days remaining of the allowance until next reset | [optional] [readonly] +**accruedPaymentLiability** | **float** | [readonly] The total accrued payments for this employee over the lifetime of their employment so far | [optional] +**accruedPaymentPaid** | **float** | [readonly] The Total amount paid to this employee in lieu of holidays | [optional] +**accruedPaymentBalance** | **float** | [readonly] The balance of what is owed to this employee in lieu of holidays | [optional] +**accruedHoursAmount** | **float** | [readonly] The total accrued hours for this employee over the lifetime of their employment so far | [optional] +**accruedHoursPaid** | **float** | [readonly] The Total amount of hours paid to this employee in lieu of holidays | [optional] +**accruedHoursBalance** | **float** | [readonly] The balance of hours owed to this employee in lieu of holidays | [optional] [readonly] +**useDefaultHolidayType** | **bool** | If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowanceResetDate** | **bool** | If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowance** | **bool** | If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieu** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuRate** | **bool** | If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuAllGrossPay** | **bool** | [Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead. This filed will be removed in a later release. | [optional] +**useDefaultHolidayAccrualBasis** | **bool** | If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuPayAutomatically** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccrueHoursPerDay** | **bool** | If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultMaximumAccruePeriod** | **bool** | If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**allowanceResetDate** | **\DateTime** | The date that the holiday allowance resets. Only the day/month part of the value is relevant. | [optional] +**allowance** | **float** | The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset | [optional] +**adjustment** | **float** | Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**holidayType** | [**\SynergiTech\Staffology\Model\HolidayType**](HolidayType.md) | | [optional] +**accrueSetAmount** | **bool** | If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. | [optional] +**accrueHoursPerDay** | **float** | If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued | [optional] +**showAllowanceOnPayslip** | **bool** | If true then the remaining Allowance will be shown on the employees payslip. | [optional] +**showAhpOnPayslip** | **bool** | If true then the AHP balance will be shown on the employees payslip. | [optional] +**accruePaymentInLieuRate** | **float** | The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. | [optional] +**accruePaymentInLieuAllGrossPay** | **bool** | [Deprecated] Please use HolidayAccrualBasis instead. This filed will be removed in a later release. | [optional] +**accruePaymentInLieuPayAutomatically** | **bool** | Set to true if you want employees to be automatically paid any outstanding holiday pay | [optional] +**occupationalSicknessUniqueId** | **string** | | [optional] +**accruedPaymentAdjustment** | **float** | Any manual adjustment to the total accrued | [optional] +**accruedHoursAdjustment** | **float** | Any manual adjustment to the total hours accrued | [optional] +**holidayAccrualBasis** | [**\SynergiTech\Staffology\Model\HolidayAccrual**](HolidayAccrual.md) | | [optional] +**holidayAccrualDefaultRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**useAggregatedServiceDate** | **bool** | | [optional] +**accruePayCodeSetUniqueId** | **string** | Pay code set to use for accruing holiday pay | [optional] +**maximumAccruePeriod** | **float** | The maximum number of hours capable of being accrued in a single period | [optional] +**holidayLeaveAccrualCustomRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**useDefaultHolidayAccrualDefaultRateType** | **bool** | If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLeaverDetails.md b/docs/Model/ContractLeaverDetails.md new file mode 100644 index 0000000..bebeb5a --- /dev/null +++ b/docs/Model/ContractLeaverDetails.md @@ -0,0 +1,15 @@ +# # ContractLeaverDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasLeft** | **bool** | | [optional] +**leaveDate** | **\DateTime** | | [optional] +**isDeceased** | **bool** | | [optional] +**paymentAfterLeaving** | **bool** | | [optional] +**p45Sent** | **bool** | | [optional] +**payAccruedBalance** | **bool** | If set to true then new PayLine will be added into the PayRunEntry to pay the accrued balance | [optional] +**paymentMethodAfterLeaving** | [**\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving**](PaymentMethodAfterLeaving.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLondonAllowanceRequest.md b/docs/Model/ContractLondonAllowanceRequest.md new file mode 100644 index 0000000..0adacdf --- /dev/null +++ b/docs/Model/ContractLondonAllowanceRequest.md @@ -0,0 +1,11 @@ +# # ContractLondonAllowanceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\LondonAllowanceType**](LondonAllowanceType.md) | | [optional] +**valueType** | [**\SynergiTech\Staffology\Model\LondonAllowanceValueType**](LondonAllowanceValueType.md) | | [optional] +**value** | **float** | Value of London Allowance | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractLondonAllowanceResponse.md b/docs/Model/ContractLondonAllowanceResponse.md new file mode 100644 index 0000000..1c8ecff --- /dev/null +++ b/docs/Model/ContractLondonAllowanceResponse.md @@ -0,0 +1,12 @@ +# # ContractLondonAllowanceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\LondonAllowanceType**](LondonAllowanceType.md) | | [optional] +**valueType** | [**\SynergiTech\Staffology\Model\LondonAllowanceValueType**](LondonAllowanceValueType.md) | | [optional] +**value** | **float** | Value of London Allowance | [optional] +**uniqueId** | **string** | London Allowance identifier | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractNetOfOnCostsResponse.md b/docs/Model/ContractNetOfOnCostsResponse.md new file mode 100644 index 0000000..4de76c7 --- /dev/null +++ b/docs/Model/ContractNetOfOnCostsResponse.md @@ -0,0 +1,19 @@ +# # ContractNetOfOnCostsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**salary** | **float** | | [optional] +**holidayPay** | **float** | | [optional] +**employersPensionContribution** | **float** | | [optional] +**employeesPensionContribution** | **float** | | [optional] +**employersNi** | **float** | | [optional] +**apprenticeshipLevy** | **float** | | [optional] +**grossDailyRate** | **float** | | [optional] +**totalFees** | **float** | | [optional] +**numberOfDays** | **float** | | [optional] +**simulation** | [**\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse**](ContractNetOfOnCostsSimulationResponse.md) | | [optional] +**holInclusiveSimulation** | [**\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse**](ContractNetOfOnCostsSimulationResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractNetOfOnCostsSimulationResponse.md b/docs/Model/ContractNetOfOnCostsSimulationResponse.md new file mode 100644 index 0000000..913ed2a --- /dev/null +++ b/docs/Model/ContractNetOfOnCostsSimulationResponse.md @@ -0,0 +1,13 @@ +# # ContractNetOfOnCostsSimulationResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**grossPay** | **float** | | [optional] +**employeePension** | **float** | | [optional] +**taxDue** | **float** | | [optional] +**niDue** | **float** | | [optional] +**netPay** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractOverseasEmployerDetails.md b/docs/Model/ContractOverseasEmployerDetails.md new file mode 100644 index 0000000..cc21b72 --- /dev/null +++ b/docs/Model/ContractOverseasEmployerDetails.md @@ -0,0 +1,12 @@ +# # ContractOverseasEmployerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overseasEmployer** | **bool** | | [optional] +**overseasSecondmentStatus** | [**\SynergiTech\Staffology\Model\OverseasSecondmentStatus**](OverseasSecondmentStatus.md) | | [optional] +**eeaCitizen** | **bool** | | [optional] +**epm6Scheme** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractP11HistoryRequest.md b/docs/Model/ContractP11HistoryRequest.md new file mode 100644 index 0000000..da48e51 --- /dev/null +++ b/docs/Model/ContractP11HistoryRequest.md @@ -0,0 +1,13 @@ +# # ContractP11HistoryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**periodNumber** | **int** | | [optional] +**niablePay** | **float** | | [optional] +**payDate** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractP11HistoryResponse.md b/docs/Model/ContractP11HistoryResponse.md new file mode 100644 index 0000000..de09df2 --- /dev/null +++ b/docs/Model/ContractP11HistoryResponse.md @@ -0,0 +1,14 @@ +# # ContractP11HistoryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**periodNumber** | **int** | | [optional] +**niablePay** | **float** | | [optional] +**payDate** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPartnerDetails.md b/docs/Model/ContractPartnerDetails.md new file mode 100644 index 0000000..8b11445 --- /dev/null +++ b/docs/Model/ContractPartnerDetails.md @@ -0,0 +1,12 @@ +# # ContractPartnerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **string** | | [optional] +**initials** | **string** | | [optional] +**lastName** | **string** | | [optional] +**niNumber** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayHistoryRequest.md b/docs/Model/ContractPayHistoryRequest.md new file mode 100644 index 0000000..5b2be37 --- /dev/null +++ b/docs/Model/ContractPayHistoryRequest.md @@ -0,0 +1,17 @@ +# # ContractPayHistoryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeId** | **string** | Employee unique Id | [optional] +**employeeRoleId** | **string** | Employee role unique Id | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYearTypes**](TaxYearTypes.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriodTypes**](PayPeriodTypes.md) | | [optional] +**periodNumber** | **int** | Tax Week or Tax Month number this PayRunEntry relates to | [optional] +**payAmount** | **float** | monetary amount for given period, if not provided then 0 | [optional] +**hours** | **float** | decimal amount of hours worked, if not provided then 0 | [optional] +**isStatutoryPayOnly** | **bool** | optional boolean flag, if the period only had SXP present | [optional] +**paymentDate** | **\DateTime** | The date payment was made for respective period | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayHistoryResponse.md b/docs/Model/ContractPayHistoryResponse.md new file mode 100644 index 0000000..bb5abde --- /dev/null +++ b/docs/Model/ContractPayHistoryResponse.md @@ -0,0 +1,18 @@ +# # ContractPayHistoryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Average Holiday Pay History identifier | [optional] +**employeeId** | **string** | Employee unique Id | [optional] +**employeeRoleId** | **string** | Employee role unique Id | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYearTypes**](TaxYearTypes.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriodTypes**](PayPeriodTypes.md) | | [optional] +**periodNumber** | **int** | Tax Week or Tax Month number this PayRunEntry relates to | [optional] +**payAmount** | **float** | monetary amount for given period, if not provided then 0 | [optional] +**hours** | **float** | decimal amount of hours worked, if not provided then 0 | [optional] +**isStatutoryPayOnly** | **bool** | optional boolean flag, if the period only had SXP present | [optional] +**paymentDate** | **\DateTime** | The date payment was made for respective period | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayHistoryUpdateRequest.md b/docs/Model/ContractPayHistoryUpdateRequest.md new file mode 100644 index 0000000..435cb91 --- /dev/null +++ b/docs/Model/ContractPayHistoryUpdateRequest.md @@ -0,0 +1,18 @@ +# # ContractPayHistoryUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Average Holiday Pay History identifier | [optional] +**employeeId** | **string** | Employee unique Id | [optional] +**employeeRoleId** | **string** | Employee role unique Id | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYearTypes**](TaxYearTypes.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriodTypes**](PayPeriodTypes.md) | | [optional] +**periodNumber** | **int** | Tax Week or Tax Month number this PayRunEntry relates to | [optional] +**payAmount** | **float** | monetary amount for given period, if not provided then 0 | [optional] +**hours** | **float** | decimal amount of hours worked, if not provided then 0 | [optional] +**isStatutoryPayOnly** | **bool** | optional boolean flag, if the period only had SXP present | [optional] +**paymentDate** | **\DateTime** | The date payment was made for respective period | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayLineRequest.md b/docs/Model/ContractPayLineRequest.md new file mode 100644 index 0000000..16bef80 --- /dev/null +++ b/docs/Model/ContractPayLineRequest.md @@ -0,0 +1,45 @@ +# # ContractPayLineRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysisCategoryCodesJson** | **string** | Analysis category id and analysiscategoryCode json | [optional] +**value** | **float** | The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. | [optional] +**rate** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used | [optional] +**multiplier** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours | [optional] +**description** | **string** | A freeform description to accompany this line. It will be displayed on the payslip. | [optional] +**code** | **string** | The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. | [optional] +**tags** | **string[]** | | [optional] +**childId** | **string** | | [optional] +**isNetToGross** | **bool** | If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. | [optional] +**targetNetToGrossValue** | **float** | The orginal net fixed addition amount that is considered to be a take home pay target. | [optional] +**netToGrossDiscrepancy** | **float** | The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation. | [optional] +**effectiveFrom** | **\DateTime** | The date the payline starts being calculated in payrun | [optional] +**effectiveTo** | **\DateTime** | The date the payline stops being calculated in payrun | [optional] +**isAutoGeneratedBasicPayLine** | **bool** | | [optional] +**percentageOfEffectiveDays** | **float** | The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun | [optional] +**totalWorkingDays** | **float** | | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**isAutomaticBackPay** | **bool** | Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. | [optional] +**ignoreInitialBackPay** | **bool** | Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. | [optional] +**contributesToBasicPay** | **bool** | Indicates whether this PayLine contributes to the basic pay of the Employee. | [optional] +**calculateAsWhenPaid** | **bool** | Indicates whether this pay line should be treated as When Paid rather than When Earned | [optional] +**totalPaidDays** | **float** | | [optional] +**roleId** | **string** | The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. | [optional] +**earnedFrom** | **\DateTime** | | [optional] +**earnedTo** | **\DateTime** | | [optional] +**annualValue** | **float** | The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not To recalculate set to null with annual amount recorded in Value | [optional] +**department** | **string** | Department code which we want to override in payline | [optional] +**costCentre** | **string** | CostCentre code which we want to override in payline | [optional] +**departmentId** | **string** | Department uniqueId which we want to override in payline | [optional] +**costCentreId** | **string** | CostCentre uniqueId which we want to override in payline | [optional] +**analysisCategoriesCodes** | [**\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]**](ContractPaylineAnalysisCategoriesCodes.md) | List of analysiscategory id and analysiscategoryCode id | [optional] +**analysisCategoryCodeIds** | **string[]** | Array of analysiscategoryCode uniqueId | [optional] +**paySpineId** | **string** | [readonly] The Id of the associated pay spine. | [optional] +**paySpineGradeId** | **string** | [readonly] The Id of the associated pay spine grade. | [optional] +**spinalPointId** | **string** | [readonly] The Id of the associated spinal point. | [optional] +**londonAllowanceId** | **int** | Used to set London allowance id for payline | [optional] +**fullTimeAnnualValue** | **float** | Used to set Full Time Annual Value for payline | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayLineResponse.md b/docs/Model/ContractPayLineResponse.md new file mode 100644 index 0000000..16599ad --- /dev/null +++ b/docs/Model/ContractPayLineResponse.md @@ -0,0 +1,52 @@ +# # ContractPayLineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**attachmentOrderId** | **string** | [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO | [optional] +**pensionId** | **string** | [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS | [optional] +**leaveId** | **string** | [readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay | [optional] +**loanId** | **string** | [readonly] The Id of the associated Loan, if any. | [optional] +**leaveStatutoryDaysPaid** | **float** | [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern). | [optional] +**leaveStatutoryWeeksPaid** | **float** | [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern). | [optional] +**initialBackPayPublicPayRunId** | **string** | [readonly] Used to mark the first payrun where this payline has been payrolled for backpay | [optional] +**value** | **float** | The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. | [optional] +**rate** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used | [optional] +**multiplier** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours | [optional] +**description** | **string** | A freeform description to accompany this line. It will be displayed on the payslip. | [optional] +**code** | **string** | The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. | [optional] +**tags** | **string[]** | | [optional] +**childId** | **string** | | [optional] +**isNetToGross** | **bool** | If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. | [optional] +**targetNetToGrossValue** | **float** | The orginal net fixed addition amount that is considered to be a take home pay target. | [optional] +**netToGrossDiscrepancy** | **float** | The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation. | [optional] +**effectiveFrom** | **\DateTime** | The date the payline starts being calculated in payrun | [optional] +**effectiveTo** | **\DateTime** | The date the payline stops being calculated in payrun | [optional] +**isAutoGeneratedBasicPayLine** | **bool** | | [optional] +**percentageOfEffectiveDays** | **float** | The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun | [optional] +**totalWorkingDays** | **float** | | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**isAutomaticBackPay** | **bool** | Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. | [optional] +**ignoreInitialBackPay** | **bool** | Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. | [optional] +**contributesToBasicPay** | **bool** | Indicates whether this PayLine contributes to the basic pay of the Employee. | [optional] +**calculateAsWhenPaid** | **bool** | Indicates whether this pay line should be treated as When Paid rather than When Earned | [optional] +**totalPaidDays** | **float** | | [optional] +**roleId** | **string** | The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. | [optional] +**earnedFrom** | **\DateTime** | | [optional] +**earnedTo** | **\DateTime** | | [optional] +**annualValue** | **float** | The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not To recalculate set to null with annual amount recorded in Value | [optional] +**department** | **string** | Department code which we want to override in payline | [optional] +**costCentre** | **string** | CostCentre code which we want to override in payline | [optional] +**departmentId** | **string** | Department uniqueId which we want to override in payline | [optional] +**costCentreId** | **string** | CostCentre uniqueId which we want to override in payline | [optional] +**analysisCategoriesCodes** | [**\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]**](ContractPaylineAnalysisCategoriesCodes.md) | List of analysiscategory id and analysiscategoryCode id | [optional] +**analysisCategoryCodeIds** | **string[]** | Array of analysiscategoryCode uniqueId | [optional] +**paySpineId** | **string** | [readonly] The Id of the associated pay spine. | [optional] +**paySpineGradeId** | **string** | [readonly] The Id of the associated pay spine grade. | [optional] +**spinalPointId** | **string** | [readonly] The Id of the associated spinal point. | [optional] +**londonAllowanceId** | **int** | Used to set London allowance id for payline | [optional] +**fullTimeAnnualValue** | **float** | Used to set Full Time Annual Value for payline | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayOptionsBaseResponse.md b/docs/Model/ContractPayOptionsBaseResponse.md new file mode 100644 index 0000000..a161a3a --- /dev/null +++ b/docs/Model/ContractPayOptionsBaseResponse.md @@ -0,0 +1,20 @@ +# # ContractPayOptionsBaseResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**regularPayLines** | [**\SynergiTech\Staffology\Model\ContractPayLineResponse[]**](ContractPayLineResponse.md) | These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**nationalMinimumWage** | **bool** | | [optional] +**payCode** | **string** | If you want the Employees pay to be allocated to a code other than BASIC, specify it here | [optional] +**mileageVehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**mapsMiles** | **int** | The number of miles to pay for as Mileage Allowance Payments | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**niTable** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayOptionsImportRequest.md b/docs/Model/ContractPayOptionsImportRequest.md new file mode 100644 index 0000000..f4ce37a --- /dev/null +++ b/docs/Model/ContractPayOptionsImportRequest.md @@ -0,0 +1,31 @@ +# # ContractPayOptionsImportRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysisCategoriesCodes** | [**\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]**](ContractPaylineAnalysisCategoriesCodes.md) | | [optional] +**autoAdjustForLeave** | **bool** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**contributesToBasicPay** | **bool** | | [optional] +**costCentre** | **string** | | [optional] +**department** | **string** | | [optional] +**effectiveFrom** | **\DateTime** | | [optional] +**effectiveTo** | **\DateTime** | | [optional] +**employerIdentifier** | **string** | | [optional] +**ignoreInitialBackPay** | **bool** | | [optional] +**isAutomaticBackPay** | **bool** | | [optional] +**isNetToGross** | **bool** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\ContractPaylineRequest[]**](ContractPaylineRequest.md) | | [optional] +**note** | **string** | | [optional] +**payAmount** | **float** | | [optional] +**payAmountMultiplier** | **float** | | [optional] +**payCode** | **string** | | [optional] +**payGrade** | **string** | | [optional] +**payrollCode** | **string** | | [optional] +**paySpine** | **string** | | [optional] +**roleReference** | **string** | | [optional] +**spinePoint** | **string** | | [optional] +**tags** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayOptionsRequest.md b/docs/Model/ContractPayOptionsRequest.md new file mode 100644 index 0000000..ca37f51 --- /dev/null +++ b/docs/Model/ContractPayOptionsRequest.md @@ -0,0 +1,27 @@ +# # ContractPayOptionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**regularPayLines** | [**\SynergiTech\Staffology\Model\ContractPayLineRequest[]**](ContractPayLineRequest.md) | These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. | [optional] +**period** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. | [optional] +**method** | [**\SynergiTech\Staffology\Model\PayMethod**](PayMethod.md) | | [optional] +**withholdTaxRefundIfPayIsZero** | **bool** | If you don't want negative PAYE values when the Gross pay is zero, set this to true | [optional] +**taxAndNi** | [**\SynergiTech\Staffology\Model\ContractTaxAndNi**](ContractTaxAndNi.md) | | [optional] +**fpsFields** | [**\SynergiTech\Staffology\Model\ContractFpsFields**](ContractFpsFields.md) | | [optional] +**tags** | **string[]** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**nationalMinimumWage** | **bool** | | [optional] +**payCode** | **string** | If you want the Employees pay to be allocated to a code other than BASIC, specify it here | [optional] +**mileageVehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**mapsMiles** | **int** | The number of miles to pay for as Mileage Allowance Payments | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**niTable** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayOptionsResponse.md b/docs/Model/ContractPayOptionsResponse.md new file mode 100644 index 0000000..ac03bea --- /dev/null +++ b/docs/Model/ContractPayOptionsResponse.md @@ -0,0 +1,28 @@ +# # ContractPayOptionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**regularPayLines** | [**\SynergiTech\Staffology\Model\ContractPayLineResponse[]**](ContractPayLineResponse.md) | These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. | [optional] +**basicPay** | **float** | The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay | [optional] +**period** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. | [optional] +**method** | [**\SynergiTech\Staffology\Model\PayMethod**](PayMethod.md) | | [optional] +**withholdTaxRefundIfPayIsZero** | **bool** | If you don't want negative PAYE values when the Gross pay is zero, set this to true | [optional] +**taxAndNi** | [**\SynergiTech\Staffology\Model\ContractTaxAndNi**](ContractTaxAndNi.md) | | [optional] +**fpsFields** | [**\SynergiTech\Staffology\Model\ContractFpsFields**](ContractFpsFields.md) | | [optional] +**tags** | **string[]** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**nationalMinimumWage** | **bool** | | [optional] +**payCode** | **string** | If you want the Employees pay to be allocated to a code other than BASIC, specify it here | [optional] +**mileageVehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**mapsMiles** | **int** | The number of miles to pay for as Mileage Allowance Payments | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**niTable** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayRunStateHistoryResponse.md b/docs/Model/ContractPayRunStateHistoryResponse.md new file mode 100644 index 0000000..8cb6ef9 --- /dev/null +++ b/docs/Model/ContractPayRunStateHistoryResponse.md @@ -0,0 +1,10 @@ +# # ContractPayRunStateHistoryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | [**\SynergiTech\Staffology\Model\PayRunState**](PayRunState.md) | | [optional] +**createdDate** | **\DateTime** | Date in which the State was changed | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaySpineGradeRequest.md b/docs/Model/ContractPaySpineGradeRequest.md new file mode 100644 index 0000000..7473e5f --- /dev/null +++ b/docs/Model/ContractPaySpineGradeRequest.md @@ -0,0 +1,14 @@ +# # ContractPaySpineGradeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Pay spine grade name | [optional] +**lowerPointUniqueId** | **string** | Id of lower spinal point to be used. | [optional] +**upperPointUniqueId** | **string** | Id of upper spinal point to be used. | [optional] +**upperPointUseMax** | **bool** | Use the Alt Max Value of the Upper Point. (Default false) | [optional] +**effectiveDate** | **\DateTime** | Date that this configuration is effective from. | [optional] +**holidayEntitlement** | **float** | The number of holiday days entitled for this pay spine grade. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaySpineGradeResponse.md b/docs/Model/ContractPaySpineGradeResponse.md new file mode 100644 index 0000000..5265178 --- /dev/null +++ b/docs/Model/ContractPaySpineGradeResponse.md @@ -0,0 +1,15 @@ +# # ContractPaySpineGradeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Pay spine grade name | [optional] +**lowerPointUniqueId** | **string** | Id of lower spinal point used. | [optional] +**upperPointUniqueId** | **string** | Id of upper spinal point used. | [optional] +**upperPointUseMax** | **bool** | Use the Alt Max Value of the Upper Point. (Default false) | [optional] +**effectiveDate** | **\DateTime** | Date that this configuration is effective from. | [optional] +**uniqueId** | **string** | Pay spine grade Id | [optional] +**holidayEntitlement** | **float** | The number of holiday days entitled for this pay spine grade. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaySpineRequest.md b/docs/Model/ContractPaySpineRequest.md new file mode 100644 index 0000000..ddb1043 --- /dev/null +++ b/docs/Model/ContractPaySpineRequest.md @@ -0,0 +1,24 @@ +# # ContractPaySpineRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the Pay Spine | [optional] +**fullTimeHours** | **float** | Maximum Full Time Hours on this Pay Spine | [optional] +**fullTimeWeeks** | **float** | Maximum Full Time Weeks on this Pay Spine | [optional] +**salaryFormula** | **string** | Formula used to derive annual salary <remarks> The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) </remarks><example> For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" </example> | [optional] +**hourlyDivisor** | **float** | Hours used to determine Hourly Rate | [optional] +**hourlyDecimals** | **int** | Number of decimal places to calculate Hourly Rates | [optional] +**dailyDivisor** | **float** | Days used to determine Full time Daily Rate | [optional] +**dailyDecimals** | **int** | Number of decimal places to calculate Daily Rates | [optional] +**annualDecimals** | **int** | Number of decimal places to calculate Annual Salaries | [optional] +**annualRoundingRule** | [**\SynergiTech\Staffology\Model\AnnualRoundingRule**](AnnualRoundingRule.md) | | [optional] +**incrementRule** | [**\SynergiTech\Staffology\Model\IncrementRule**](IncrementRule.md) | | [optional] +**requiresLondonAllowance** | **bool** | Requires LA column to be completed on the spine | [optional] +**gradeEffectiveDate** | **\DateTime** | Effective date for applicable grades | [optional] +**pointEffectiveDate** | **\DateTime** | Effective date for applicable spinal points | [optional] +**useSpineHolidayRules** | **bool** | Flag to include holiday entitlements in Payspine (Default false) | [optional] +**holidayEntitlements** | [**\SynergiTech\Staffology\Model\ContractHolidayEntitlementRequest[]**](ContractHolidayEntitlementRequest.md) | PaySpine Holiday Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaySpineResponse.md b/docs/Model/ContractPaySpineResponse.md new file mode 100644 index 0000000..9454ed4 --- /dev/null +++ b/docs/Model/ContractPaySpineResponse.md @@ -0,0 +1,25 @@ +# # ContractPaySpineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Pay Spine identifier | [optional] +**name** | **string** | Name of the Pay Spine | [optional] +**fullTimeHours** | **float** | Maximum Full Time Hours on this Pay Spine | [optional] +**fullTimeWeeks** | **float** | Maximum Full Time Weeks on this Pay Spine | [optional] +**salaryFormula** | **string** | Formula used to derive annual salary <remarks> The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) </remarks><example> For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" </example> | [optional] +**hourlyDivisor** | **float** | Hours used to determine Hourly Rate | [optional] +**hourlyDecimals** | **int** | Number of decimal places to calculate Hourly Rates | [optional] +**dailyDivisor** | **float** | Days used to determine Full time Daily Rate | [optional] +**dailyDecimals** | **int** | Number of decimal places to calculate Daily Rates | [optional] +**annualDecimals** | **int** | Number of decimal places to calculate Annual Salaries | [optional] +**annualRoundingRule** | [**\SynergiTech\Staffology\Model\AnnualRoundingRule**](AnnualRoundingRule.md) | | [optional] +**incrementRule** | [**\SynergiTech\Staffology\Model\IncrementRule**](IncrementRule.md) | | [optional] +**requiresLondonAllowance** | **bool** | Requires LA column to be completed on the spine | [optional] +**gradeEffectiveDate** | **\DateTime** | Effective date for applicable grades | [optional] +**pointEffectiveDate** | **\DateTime** | Effective date for applicable spinal points | [optional] +**useSpineHolidayRules** | **bool** | Flag to include holiday entitlements in Payspine (Default false) | [optional] +**holidayEntitlements** | [**\SynergiTech\Staffology\Model\ContractHolidayEntitlementResponse[]**](ContractHolidayEntitlementResponse.md) | PaySpine Years Service Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaySpineUpdateRequest.md b/docs/Model/ContractPaySpineUpdateRequest.md new file mode 100644 index 0000000..7b1c6ac --- /dev/null +++ b/docs/Model/ContractPaySpineUpdateRequest.md @@ -0,0 +1,24 @@ +# # ContractPaySpineUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the Pay Spine | [optional] +**fullTimeHours** | **float** | Maximum Full Time Hours on this Pay Spine | [optional] +**fullTimeWeeks** | **float** | Maximum Full Time Weeks on this Pay Spine | [optional] +**salaryFormula** | **string** | Formula used to derive annual salary <remarks> The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) </remarks><example> For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" </example> | [optional] +**hourlyDivisor** | **float** | Hours used to determine Hourly Rate | [optional] +**hourlyDecimals** | **int** | Number of decimal places to calculate Hourly Rates | [optional] +**dailyDivisor** | **float** | Days used to determine Full time Daily Rate | [optional] +**dailyDecimals** | **int** | Number of decimal places to calculate Daily Rates | [optional] +**annualDecimals** | **int** | Number of decimal places to calculate Annual Salaries | [optional] +**annualRoundingRule** | [**\SynergiTech\Staffology\Model\AnnualRoundingRule**](AnnualRoundingRule.md) | | [optional] +**incrementRule** | [**\SynergiTech\Staffology\Model\IncrementRule**](IncrementRule.md) | | [optional] +**requiresLondonAllowance** | **bool** | Requires LA column to be completed on the spine | [optional] +**gradeEffectiveDate** | **\DateTime** | Effective date for applicable grades | [optional] +**pointEffectiveDate** | **\DateTime** | Effective date for applicable spinal points | [optional] +**useSpineHolidayRules** | **bool** | Flag to include holiday entitlements in Payspine (Default false) | [optional] +**holidayEntitlements** | [**\SynergiTech\Staffology\Model\ContractHolidayEntitlementUpdateRequest[]**](ContractHolidayEntitlementUpdateRequest.md) | PaySpine Holiday Entitlements | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaylineAnalysisCategoriesCodes.md b/docs/Model/ContractPaylineAnalysisCategoriesCodes.md new file mode 100644 index 0000000..f92f72d --- /dev/null +++ b/docs/Model/ContractPaylineAnalysisCategoriesCodes.md @@ -0,0 +1,12 @@ +# # ContractPaylineAnalysisCategoriesCodes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysisCategory** | **string** | AnalysisCategory Model | [optional] +**analysisCategoryCode** | **string** | AnalysisCategoryCode Model | [optional] +**analysisCategoryId** | **string** | AnalysisCategory Identifier | [optional] +**analysisCategoryCodeId** | **string** | AnalysisCategoryCode Identifier | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPaylineRequest.md b/docs/Model/ContractPaylineRequest.md new file mode 100644 index 0000000..5be3d8c --- /dev/null +++ b/docs/Model/ContractPaylineRequest.md @@ -0,0 +1,49 @@ +# # ContractPaylineRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**analysisCategoryCodeIds** | **string[]** | List of analysis category code unique ids. | [optional] +**analysisCategoriesCodes** | [**\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]**](ContractPaylineAnalysisCategoriesCodes.md) | List of analysis category ids and analysis category code ids. | [optional] +**annualValue** | **float** | The original value from the PayLine before we modify it. Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not. To recalculate set to null with annual amount recorded in Value. | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling midway through a PayRun. | [optional] +**calculateAsWhenPaid** | **bool** | Indicates whether this pay line should be treated as When Paid rather than When Earned. | [optional] +**childId** | **string** | The child id. | [optional] +**code** | **string** | The PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. | [optional] +**contributesToBasicPay** | **bool** | Indicates whether this PayLine contributes to the basic pay of the Employee. | [optional] +**costCentre** | **string** | CostCentre code which we want to override in the payline. | [optional] +**costCentreId** | **string** | CostCentre uniqueId which we want to override in the payline. | [optional] +**department** | **string** | Department code which we want to override in the payline. | [optional] +**departmentId** | **string** | Department uniqueId which we want to override in the payline. | [optional] +**description** | **string** | A description to accompany this line. It will be displayed on the payslip. | [optional] +**earnedFrom** | **\DateTime** | The earned from date. | [optional] +**earnedTo** | **\DateTime** | The earned to date. | [optional] +**effectiveFrom** | **\DateTime** | The date the payline starts being calculated in the payrun. | [optional] +**effectiveTo** | **\DateTime** | The date the payline stops being calculated in the payrun. | [optional] +**employeeRoleReference** | **string** | The employee role reference. | [optional] +**fullTimeAnnualValue** | **float** | Used to set the Full Time Annual Value for the payline. | [optional] +**ignoreInitialBackPay** | **bool** | Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside of Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. | [optional] +**isAutoGeneratedBasicPayLine** | **bool** | If the PayLine is an auto-generated basic payline. | [optional] +**isAutomaticBackPay** | **bool** | Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. | [optional] +**isNetToGross** | **bool** | If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. | [optional] +**isZeroHoursTeachersBackPayLine** | **bool** | If the PayLine is a zero-hours teachers back-pay line. | [optional] +**londonAllowanceId** | **int** | Used to set London allowance id for payline. | [optional] +**multiplier** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours. | [optional] +**netToGrossDiscrepancy** | **float** | The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation. | [optional] +**payGrade** | **string** | PayGrade for imported pay lines | [optional] +**paySpine** | **string** | PaySpine for imported pay lines | [optional] +**paySpineGradeId** | **string** | The Id of the associated pay spine grade. | [optional] +**paySpineId** | **string** | The Id of the associated pay spine. | [optional] +**percentageOfEffectiveDays** | **float** | The percentage of working days the effective dates span for pro-rata values, calculated and set during each payrun. | [optional] +**rate** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used. | [optional] +**roleId** | **string** | The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. | [optional] +**spinePoint** | **string** | SpinePoint for imported pay lines | [optional] +**spinalPointId** | **string** | The Id of the associated spinal point. | [optional] +**tags** | **string[]** | Tags related to this line. | [optional] +**targetNetToGrossValue** | **float** | The orginal net fixed addition amount that is considered to be a take home pay target. | [optional] +**totalPaidDays** | **float** | The total paid days. | [optional] +**totalWorkingDays** | **float** | The total working days. | [optional] +**value** | **float** | The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadEmployerRequest.md b/docs/Model/ContractPayrollSquadEmployerRequest.md new file mode 100644 index 0000000..93c7023 --- /dev/null +++ b/docs/Model/ContractPayrollSquadEmployerRequest.md @@ -0,0 +1,10 @@ +# # ContractPayrollSquadEmployerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollSquadId** | **string** | UniqueId of Payroll Squad | [optional] +**employerIds** | **string[]** | UniqueIds of Employers | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadEmployerResponse.md b/docs/Model/ContractPayrollSquadEmployerResponse.md new file mode 100644 index 0000000..3733085 --- /dev/null +++ b/docs/Model/ContractPayrollSquadEmployerResponse.md @@ -0,0 +1,10 @@ +# # ContractPayrollSquadEmployerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Payroll Squad Employer Id | [optional] +**employerId** | **string** | Employer Id | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadMemberRequest.md b/docs/Model/ContractPayrollSquadMemberRequest.md new file mode 100644 index 0000000..dc7cc86 --- /dev/null +++ b/docs/Model/ContractPayrollSquadMemberRequest.md @@ -0,0 +1,11 @@ +# # ContractPayrollSquadMemberRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userId** | **string** | Payroll Squad Selected UserId | [optional] +**payrollSquadId** | **string** | UniqueId of Payroll Squad | [optional] +**role** | [**\SynergiTech\Staffology\Model\UserRole**](UserRole.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadMemberResponse.md b/docs/Model/ContractPayrollSquadMemberResponse.md new file mode 100644 index 0000000..ca3ba4a --- /dev/null +++ b/docs/Model/ContractPayrollSquadMemberResponse.md @@ -0,0 +1,14 @@ +# # ContractPayrollSquadMemberResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Payroll Squad Member Identifier | [optional] +**userId** | **string** | Payroll Squad User Identifier | [optional] +**displayName** | **string** | Payroll Squad Member DisplayName | [optional] +**emailAddress** | **string** | Payroll Squad Member EmailAddress | [optional] +**lastLogin** | **\DateTime** | Payroll Squad Member LastLogin | [optional] +**role** | [**\SynergiTech\Staffology\Model\UserRole**](UserRole.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadRequest.md b/docs/Model/ContractPayrollSquadRequest.md new file mode 100644 index 0000000..9f5c322 --- /dev/null +++ b/docs/Model/ContractPayrollSquadRequest.md @@ -0,0 +1,10 @@ +# # ContractPayrollSquadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of Payroll Squad | [optional] +**employerIds** | **string[]** | Employer ids of Payroll Squad | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPayrollSquadResponse.md b/docs/Model/ContractPayrollSquadResponse.md new file mode 100644 index 0000000..b79c887 --- /dev/null +++ b/docs/Model/ContractPayrollSquadResponse.md @@ -0,0 +1,13 @@ +# # ContractPayrollSquadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Payroll Squad Identifier | [optional] +**tenantId** | **string** | Current Tenant Id | [optional] +**members** | [**\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse[]**](ContractPayrollSquadMemberResponse.md) | List of all Members | [optional] +**employers** | [**\SynergiTech\Staffology\Model\ContractEmployerBase[]**](ContractEmployerBase.md) | List of all Employers | [optional] +**name** | **string** | Name of Payroll Squad | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPendingLettersCountResponse.md b/docs/Model/ContractPendingLettersCountResponse.md new file mode 100644 index 0000000..15314b1 --- /dev/null +++ b/docs/Model/ContractPendingLettersCountResponse.md @@ -0,0 +1,10 @@ +# # ContractPendingLettersCountResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pendingLettersCount** | **int** | | [optional] +**requiringAePostponementLettersCount** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPensionerPayroll.md b/docs/Model/ContractPensionerPayroll.md new file mode 100644 index 0000000..7a3c103 --- /dev/null +++ b/docs/Model/ContractPensionerPayroll.md @@ -0,0 +1,12 @@ +# # ContractPensionerPayroll + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inReceiptOfPension** | **bool** | If set to true then the FPS will have the OccPenInd flag set to 'yes' | [optional] +**bereaved** | **bool** | Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner | [optional] +**amount** | **float** | Annual amount of occupational pension | [optional] +**startDate** | **\DateTime** | Start date of occupational Pension | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPersonalDetailsRequest.md b/docs/Model/ContractPersonalDetailsRequest.md new file mode 100644 index 0000000..f87034a --- /dev/null +++ b/docs/Model/ContractPersonalDetailsRequest.md @@ -0,0 +1,30 @@ +# # ContractPersonalDetailsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\SynergiTech\Staffology\Model\ContractAddress**](ContractAddress.md) | | [optional] +**maritalStatus** | [**\SynergiTech\Staffology\Model\MaritalStatus**](MaritalStatus.md) | | +**title** | **string** | | [optional] +**firstName** | **string** | | [optional] +**middleName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**alternativeEmail** | **string** | | [optional] +**previousSurName** | **string** | | [optional] +**email** | **string** | | [optional] +**emailPayslip** | **bool** | If set to true then the employees Payslip will be sent by email when a PayRun is finalised. | [optional] +**pdfPassword** | **string** | Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. | [optional] +**pdfPasswordType** | [**\SynergiTech\Staffology\Model\PdfPasswordType**](PdfPasswordType.md) | | [optional] +**emailStatement** | **bool** | Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. | [optional] +**photoUrl** | **string** | | [optional] +**telephone** | **string** | | [optional] +**photoSasUrl** | **string** | | [optional] +**mobile** | **string** | | [optional] +**dateOfBirth** | **\DateTime** | | +**gender** | [**\SynergiTech\Staffology\Model\Gender**](Gender.md) | | +**niNumber** | **string** | | [optional] +**passportNumber** | **string** | | [optional] +**partnerDetails** | [**\SynergiTech\Staffology\Model\ContractPartnerDetails**](ContractPartnerDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractPersonalDetailsResponse.md b/docs/Model/ContractPersonalDetailsResponse.md new file mode 100644 index 0000000..8e5d75e --- /dev/null +++ b/docs/Model/ContractPersonalDetailsResponse.md @@ -0,0 +1,31 @@ +# # ContractPersonalDetailsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**statePensionAge** | **int** | Automatically calculated. | [optional] +**address** | [**\SynergiTech\Staffology\Model\ContractAddress**](ContractAddress.md) | | [optional] +**maritalStatus** | [**\SynergiTech\Staffology\Model\MaritalStatus**](MaritalStatus.md) | | +**title** | **string** | | [optional] +**firstName** | **string** | | [optional] +**middleName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**alternativeEmail** | **string** | | [optional] +**previousSurName** | **string** | | [optional] +**email** | **string** | | [optional] +**emailPayslip** | **bool** | If set to true then the employees Payslip will be sent by email when a PayRun is finalised. | [optional] +**pdfPassword** | **string** | Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. | [optional] +**pdfPasswordType** | [**\SynergiTech\Staffology\Model\PdfPasswordType**](PdfPasswordType.md) | | [optional] +**emailStatement** | **bool** | Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. | [optional] +**photoUrl** | **string** | | [optional] +**telephone** | **string** | | [optional] +**photoSasUrl** | **string** | | [optional] +**mobile** | **string** | | [optional] +**dateOfBirth** | **\DateTime** | | +**gender** | [**\SynergiTech\Staffology\Model\Gender**](Gender.md) | | +**niNumber** | **string** | | [optional] +**passportNumber** | **string** | | [optional] +**partnerDetails** | [**\SynergiTech\Staffology\Model\ContractPartnerDetails**](ContractPartnerDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractReapplyDpsNoticeResponse.md b/docs/Model/ContractReapplyDpsNoticeResponse.md new file mode 100644 index 0000000..c35b824 --- /dev/null +++ b/docs/Model/ContractReapplyDpsNoticeResponse.md @@ -0,0 +1,10 @@ +# # ContractReapplyDpsNoticeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**numberOfAppliedNotices** | **int** | | [optional] +**numberOfFailedNotices** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractRightToWork.md b/docs/Model/ContractRightToWork.md new file mode 100644 index 0000000..d33a4f5 --- /dev/null +++ b/docs/Model/ContractRightToWork.md @@ -0,0 +1,13 @@ +# # ContractRightToWork + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**checked** | **bool** | | [optional] +**documentType** | [**\SynergiTech\Staffology\Model\RightToWorkDocumentType**](RightToWorkDocumentType.md) | | [optional] +**documentRef** | **string** | | [optional] +**documentExpiry** | **\DateTime** | | [optional] +**note** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractRtiEmployeeAddress.md b/docs/Model/ContractRtiEmployeeAddress.md new file mode 100644 index 0000000..461a5f9 --- /dev/null +++ b/docs/Model/ContractRtiEmployeeAddress.md @@ -0,0 +1,14 @@ +# # ContractRtiEmployeeAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line** | **string[]** | | [optional] +**postcode** | **string** | | [optional] +**postCode** | **string** | | [optional] +**ukPostcode** | **string** | | [optional] +**country** | **string** | | [optional] +**foreignCountry** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractRtiEmployeeName.md b/docs/Model/ContractRtiEmployeeName.md new file mode 100644 index 0000000..5e5d8b5 --- /dev/null +++ b/docs/Model/ContractRtiEmployeeName.md @@ -0,0 +1,12 @@ +# # ContractRtiEmployeeName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ttl** | **string** | | [optional] +**fore** | **string[]** | | [optional] +**initials** | **string** | | [optional] +**sur** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractShiftWorkingPatternDayRequest.md b/docs/Model/ContractShiftWorkingPatternDayRequest.md new file mode 100644 index 0000000..fe51a17 --- /dev/null +++ b/docs/Model/ContractShiftWorkingPatternDayRequest.md @@ -0,0 +1,12 @@ +# # ContractShiftWorkingPatternDayRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **int** | | [optional] +**isWorkingDay** | **bool** | | [optional] +**hours** | **float** | | [optional] +**workingPatternHoursType** | [**\SynergiTech\Staffology\Model\WorkingPatternHoursType**](WorkingPatternHoursType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractShiftWorkingPatternDayResponse.md b/docs/Model/ContractShiftWorkingPatternDayResponse.md new file mode 100644 index 0000000..2633f8e --- /dev/null +++ b/docs/Model/ContractShiftWorkingPatternDayResponse.md @@ -0,0 +1,11 @@ +# # ContractShiftWorkingPatternDayResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **int** | | [optional] +**isWorkingDay** | **bool** | | [optional] +**hours** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpinalPointRequest.md b/docs/Model/ContractSpinalPointRequest.md new file mode 100644 index 0000000..bd62a91 --- /dev/null +++ b/docs/Model/ContractSpinalPointRequest.md @@ -0,0 +1,20 @@ +# # ContractSpinalPointRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the Spinal Point | [optional] +**number** | **int** | Number of Spinal Point within the Scale | [optional] +**annualValue** | **float** | Annual Value for the Spinal Point | [optional] +**annualValueAltMax** | **float** | Annual Value for the Spinal Point (Alternative Max Value) | [optional] +**annualValueLAInner** | **float** | Annual Value for the Spinal Point Inner London Allowance | [optional] +**annualValueLAInnerAltMax** | **float** | Annual Value for the Spinal Point Inner LA (Alt Max Value) | [optional] +**annualValueLAOuter** | **float** | Annual Value for the Spinal Point Outer London Allowance | [optional] +**annualValueLAOuterAltMax** | **float** | Annual Value for the Spinal Point Outer LA (Alt Max Value) | [optional] +**annualValueLAFringe** | **float** | Annual Value for the Spinal Point Fringe London Allowance | [optional] +**annualValueLAFringeAltMax** | **float** | Annual Value for the Spinal Point Fringe LA (Alt Max Value) | [optional] +**effectiveDate** | **\DateTime** | Date these rates became effective | [optional] +**predecessorId** | **string** | Spinal point predecessorId | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpinalPointResponse.md b/docs/Model/ContractSpinalPointResponse.md new file mode 100644 index 0000000..c8fd04a --- /dev/null +++ b/docs/Model/ContractSpinalPointResponse.md @@ -0,0 +1,21 @@ +# # ContractSpinalPointResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Spinal Point identifier | [optional] +**name** | **string** | Name of the Spinal Point | [optional] +**number** | **int** | Number of Spinal Point within the Scale | [optional] +**annualValue** | **float** | Annual Value for the Spinal Point | [optional] +**annualValueAltMax** | **float** | Annual Value for the Spinal Point (Alternative Max Value) | [optional] +**annualValueLAInner** | **float** | Annual Value for the Spinal Point Inner London Allowance | [optional] +**annualValueLAInnerAltMax** | **float** | Annual Value for the Spinal Point Inner LA (Alt Max Value) | [optional] +**annualValueLAOuter** | **float** | Annual Value for the Spinal Point Outer London Allowance | [optional] +**annualValueLAOuterAltMax** | **float** | Annual Value for the Spinal Point Outer LA (Alt Max Value) | [optional] +**annualValueLAFringe** | **float** | Annual Value for the Spinal Point Fringe London Allowance | [optional] +**annualValueLAFringeAltMax** | **float** | Annual Value for the Spinal Point Fringe LA (Alt Max Value) | [optional] +**effectiveDate** | **\DateTime** | Date these rates became effective | [optional] +**predecessorId** | **string** | Spinal point predecessorId | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpinalPointUpdateRequest.md b/docs/Model/ContractSpinalPointUpdateRequest.md new file mode 100644 index 0000000..cfceaa5 --- /dev/null +++ b/docs/Model/ContractSpinalPointUpdateRequest.md @@ -0,0 +1,21 @@ +# # ContractSpinalPointUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | | [optional] +**name** | **string** | Name of the Spinal Point | [optional] +**number** | **int** | Number of Spinal Point within the Scale | [optional] +**annualValue** | **float** | Annual Value for the Spinal Point | [optional] +**annualValueAltMax** | **float** | Annual Value for the Spinal Point (Alternative Max Value) | [optional] +**annualValueLAInner** | **float** | Annual Value for the Spinal Point Inner London Allowance | [optional] +**annualValueLAInnerAltMax** | **float** | Annual Value for the Spinal Point Inner LA (Alt Max Value) | [optional] +**annualValueLAOuter** | **float** | Annual Value for the Spinal Point Outer London Allowance | [optional] +**annualValueLAOuterAltMax** | **float** | Annual Value for the Spinal Point Outer LA (Alt Max Value) | [optional] +**annualValueLAFringe** | **float** | Annual Value for the Spinal Point Fringe London Allowance | [optional] +**annualValueLAFringeAltMax** | **float** | Annual Value for the Spinal Point Fringe LA (Alt Max Value) | [optional] +**effectiveDate** | **\DateTime** | Date these rates became effective | [optional] +**predecessorId** | **string** | Spinal point predecessorId | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpineAllowanceRequest.md b/docs/Model/ContractSpineAllowanceRequest.md new file mode 100644 index 0000000..690b5f4 --- /dev/null +++ b/docs/Model/ContractSpineAllowanceRequest.md @@ -0,0 +1,17 @@ +# # ContractSpineAllowanceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowanceName** | **string** | Name of Allowance | [optional] +**allowanceType** | [**\SynergiTech\Staffology\Model\AllowanceType**](AllowanceType.md) | | [optional] +**allowanceUsualAnnualValue** | **float** | Value of Allowance Usual Annual | [optional] +**allowanceRangeLowerValue** | **float** | Value of Allowance Range Lower | [optional] +**allowanceRangeUpperValue** | **float** | Value of Allowance Range Upper | [optional] +**allowanceEffectiveDate** | **\DateTime** | Allowance Effective Date | [optional] +**allowanceAlwaysFTE** | **bool** | Allowance Always FTE or Not | [optional] +**payCode** | **string** | Pay Code | [optional] +**payCodeTitle** | **string** | Pay Code Title | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpineAllowanceResponse.md b/docs/Model/ContractSpineAllowanceResponse.md new file mode 100644 index 0000000..9a43b60 --- /dev/null +++ b/docs/Model/ContractSpineAllowanceResponse.md @@ -0,0 +1,18 @@ +# # ContractSpineAllowanceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowanceName** | **string** | Name of Allowance | [optional] +**allowanceType** | [**\SynergiTech\Staffology\Model\AllowanceType**](AllowanceType.md) | | [optional] +**allowanceUsualAnnualValue** | **float** | Value of Allowance Usual Annual | [optional] +**allowanceRangeLowerValue** | **float** | Value of Allowance Range Lower | [optional] +**allowanceRangeUpperValue** | **float** | Value of Allowance Range Upper | [optional] +**allowanceEffectiveDate** | **\DateTime** | Allowance Effective Date | [optional] +**allowanceAlwaysFTE** | **bool** | Allowance Always FTE or Not | [optional] +**uniqueId** | **string** | Spine Allowance identifier | [optional] +**payCode** | **string** | Pay Code | [optional] +**payCodeTitle** | **string** | Pay Code Title | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractSpineAllowanceUpdateRequest.md b/docs/Model/ContractSpineAllowanceUpdateRequest.md new file mode 100644 index 0000000..50dbaaa --- /dev/null +++ b/docs/Model/ContractSpineAllowanceUpdateRequest.md @@ -0,0 +1,18 @@ +# # ContractSpineAllowanceUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Spine Allowance identifier | [optional] +**allowanceName** | **string** | Name of Allowance | [optional] +**allowanceType** | [**\SynergiTech\Staffology\Model\AllowanceType**](AllowanceType.md) | | [optional] +**allowanceUsualAnnualValue** | **float** | Value of Allowance Usual Annual | [optional] +**allowanceRangeLowerValue** | **float** | Value of Allowance Range Lower | [optional] +**allowanceRangeUpperValue** | **float** | Value of Allowance Range Upper | [optional] +**allowanceEffectiveDate** | **\DateTime** | Allowance Effective Date | [optional] +**allowanceAlwaysFTE** | **bool** | Allowance Always FTE or Not | [optional] +**payCode** | **string** | Pay Code | [optional] +**payCodeTitle** | **string** | Pay Code Title | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractStarterDetails.md b/docs/Model/ContractStarterDetails.md new file mode 100644 index 0000000..564e5c8 --- /dev/null +++ b/docs/Model/ContractStarterDetails.md @@ -0,0 +1,12 @@ +# # ContractStarterDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startDate** | **\DateTime** | | +**starterDeclaration** | [**\SynergiTech\Staffology\Model\StarterDeclaration**](StarterDeclaration.md) | | +**overseasEmployerDetails** | [**\SynergiTech\Staffology\Model\ContractOverseasEmployerDetails**](ContractOverseasEmployerDetails.md) | | [optional] +**pensionerPayroll** | [**\SynergiTech\Staffology\Model\ContractPensionerPayroll**](ContractPensionerPayroll.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractTaxAndNi.md b/docs/Model/ContractTaxAndNi.md new file mode 100644 index 0000000..078e7e7 --- /dev/null +++ b/docs/Model/ContractTaxAndNi.md @@ -0,0 +1,19 @@ +# # ContractTaxAndNi + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**niTable** | **string** | The appropriate NI letter for this Employee | +**secondaryClass1NotPayable** | **bool** | If set to true then no Employer NI will be paid for this Employee | [optional] +**postgradLoan** | **bool** | Set to true if the Employee needs to make Post Graduate Loan repayments | [optional] +**postgraduateLoanStartDate** | **\DateTime** | | [optional] +**postgraduateLoanEndDate** | **\DateTime** | | [optional] +**studentLoan** | [**\SynergiTech\Staffology\Model\StudentLoan**](StudentLoan.md) | | [optional] +**studentLoanStartDate** | **\DateTime** | | [optional] +**studentLoanEndDate** | **\DateTime** | | [optional] +**taxCode** | **string** | The Tax Code for this Employee | [optional] +**week1Month1** | **bool** | Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis. This is automatically set to false for any existing Employees when you start a new Tax Year. | [optional] +**foreignTaxCredit** | **bool** | If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractTermCalendarRequest.md b/docs/Model/ContractTermCalendarRequest.md new file mode 100644 index 0000000..caf9a56 --- /dev/null +++ b/docs/Model/ContractTermCalendarRequest.md @@ -0,0 +1,10 @@ +# # ContractTermCalendarRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | Title of the Term Calendar | [optional] +**academicYearStartMonth** | [**\SynergiTech\Staffology\Model\CalendarMonth**](CalendarMonth.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractTermCalendarResponse.md b/docs/Model/ContractTermCalendarResponse.md new file mode 100644 index 0000000..57ecc55 --- /dev/null +++ b/docs/Model/ContractTermCalendarResponse.md @@ -0,0 +1,11 @@ +# # ContractTermCalendarResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Term Calendar identifier | [optional] +**title** | **string** | Title of the Term Calendar | [optional] +**academicYearStartMonth** | [**\SynergiTech\Staffology\Model\CalendarMonth**](CalendarMonth.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractTermCalendarYearRequest.md b/docs/Model/ContractTermCalendarYearRequest.md new file mode 100644 index 0000000..329c1ba --- /dev/null +++ b/docs/Model/ContractTermCalendarYearRequest.md @@ -0,0 +1,14 @@ +# # ContractTermCalendarYearRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**autumnTermStartDate** | **\DateTime** | Autumn Term Start Date of Term Calendar Year View | [optional] +**autumnTermEndDate** | **\DateTime** | Autumn Term End Date of Term Calendar Year View | [optional] +**springTermStartDate** | **\DateTime** | Spring Term Start Date of Term Calendar Year View | [optional] +**springTermEndDate** | **\DateTime** | Spring Term End Date of Term Calendar Year View | [optional] +**summerTermStartDate** | **\DateTime** | Summer Term Start Date of Term Calendar Year View | [optional] +**summerTermEndDate** | **\DateTime** | Summer Term End Date of Term Calendar Year View | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractTermCalendarYearResponse.md b/docs/Model/ContractTermCalendarYearResponse.md new file mode 100644 index 0000000..7787e3e --- /dev/null +++ b/docs/Model/ContractTermCalendarYearResponse.md @@ -0,0 +1,15 @@ +# # ContractTermCalendarYearResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Term Calendar Year identifier | [optional] +**autumnTermStartDate** | **\DateTime** | Autumn Term Start Date of Term Calendar Year View | [optional] +**autumnTermEndDate** | **\DateTime** | Autumn Term End Date of Term Calendar Year View | [optional] +**springTermStartDate** | **\DateTime** | Spring Term Start Date of Term Calendar Year View | [optional] +**springTermEndDate** | **\DateTime** | Spring Term End Date of Term Calendar Year View | [optional] +**summerTermStartDate** | **\DateTime** | Summer Term Start Date of Term Calendar Year View | [optional] +**summerTermEndDate** | **\DateTime** | Summer Term End Date of Term Calendar Year View | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractUpdateEmployeeRequest.md b/docs/Model/ContractUpdateEmployeeRequest.md new file mode 100644 index 0000000..592bbfe --- /dev/null +++ b/docs/Model/ContractUpdateEmployeeRequest.md @@ -0,0 +1,21 @@ +# # ContractUpdateEmployeeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique id of the object | [optional] +**personalDetails** | [**\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest**](ContractPersonalDetailsRequest.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest**](ContractEmploymentDetailsRequest.md) | | [optional] +**autoEnrolment** | [**\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest**](ContractAutoEnrolmentRequest.md) | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest**](ContractLeaveSettingsRequest.md) | | [optional] +**rightToWork** | [**\SynergiTech\Staffology\Model\ContractRightToWork**](ContractRightToWork.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\ContractBankDetails**](ContractBankDetails.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\ContractPayOptionsRequest**](ContractPayOptionsRequest.md) | | [optional] +**tags** | **string[]** | | [optional] +**holidaySchemeUniqueId** | **string** | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**evcId** | **string** | If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. | [optional] +**sourceSystemId** | **string** | Used by external systems so they can store an immutable reference. Once this property is set it cannot be changed. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractVeteranDetails.md b/docs/Model/ContractVeteranDetails.md new file mode 100644 index 0000000..729262f --- /dev/null +++ b/docs/Model/ContractVeteranDetails.md @@ -0,0 +1,10 @@ +# # ContractVeteranDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isVeteran** | **bool** | Set to true if the employee is a veteran | [optional] +**firstCivilianEmploymentDate** | **\DateTime** | Date of Veteran's first civilian employment | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractWorkingPatternRequest.md b/docs/Model/ContractWorkingPatternRequest.md new file mode 100644 index 0000000..e2d8c75 --- /dev/null +++ b/docs/Model/ContractWorkingPatternRequest.md @@ -0,0 +1,35 @@ +# # ContractWorkingPatternRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**title** | **string** | | +**mon** | **float** | | [optional] +**tue** | **float** | | [optional] +**wed** | **float** | | [optional] +**thu** | **float** | | [optional] +**fri** | **float** | | [optional] +**sat** | **float** | | [optional] +**sun** | **float** | | [optional] +**monIsWorkingDay** | **bool** | | [optional] +**tueIsWorkingDay** | **bool** | | [optional] +**wedIsWorkingDay** | **bool** | | [optional] +**thuIsWorkingDay** | **bool** | | [optional] +**friIsWorkingDay** | **bool** | | [optional] +**satIsWorkingDay** | **bool** | | [optional] +**sunIsWorkingDay** | **bool** | | [optional] +**totalHours** | **float** | | [optional] +**contractedWeeks** | **float** | The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. | [optional] +**fullTimeContractedWeeks** | **float** | The amount of weeks an employee works (Full Time). If Null then the default is used. | [optional] +**fullTimeContractedHours** | **float** | The amount of hours an employee works (Full Time). If Null then the default is used. | [optional] +**bankHolidays** | [**\SynergiTech\Staffology\Model\BankHolidayCollection**](BankHolidayCollection.md) | | [optional] +**proRataRule** | [**\SynergiTech\Staffology\Model\ProRataRule**](ProRataRule.md) | | [optional] +**workingPatternHoursType** | [**\SynergiTech\Staffology\Model\WorkingPatternHoursType**](WorkingPatternHoursType.md) | | [optional] +**isDefault** | **bool** | | [optional] +**workingPatternType** | [**\SynergiTech\Staffology\Model\WorkingPatternType**](WorkingPatternType.md) | | [optional] +**effectiveFrom** | **\DateTime** | | [optional] +**shiftWorkingPatternDays** | [**\SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayRequest[]**](ContractShiftWorkingPatternDayRequest.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractWorkingPatternResponse.md b/docs/Model/ContractWorkingPatternResponse.md new file mode 100644 index 0000000..9b2ecf3 --- /dev/null +++ b/docs/Model/ContractWorkingPatternResponse.md @@ -0,0 +1,30 @@ +# # ContractWorkingPatternResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**title** | **string** | | +**mon** | **float** | | [optional] +**tue** | **float** | | [optional] +**wed** | **float** | | [optional] +**thu** | **float** | | [optional] +**fri** | **float** | | [optional] +**sat** | **float** | | [optional] +**sun** | **float** | | [optional] +**contractedWeeks** | **float** | The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. | [optional] +**fullTimeContractedWeeks** | **float** | The amount of weeks an employee works (Full Time). If Null then the default is used. | [optional] +**fullTimeContractedHours** | **float** | The amount of hours an employee works (Full Time). If Null then the default is used. | [optional] +**bankHolidays** | [**\SynergiTech\Staffology\Model\BankHolidayCollection**](BankHolidayCollection.md) | | [optional] +**proRataRule** | [**\SynergiTech\Staffology\Model\ProRataRule**](ProRataRule.md) | | [optional] +**bankHolidayDates** | **\DateTime[]** | [readonly] The dates that are classed as Bank Holidays for this Working Pattern | [optional] +**workingPatternHoursType** | [**\SynergiTech\Staffology\Model\WorkingPatternHoursType**](WorkingPatternHoursType.md) | | [optional] +**isDefault** | **bool** | | [optional] +**displayName** | **string** | | [optional] [readonly] +**totalHours** | **float** | | [optional] [readonly] +**workingPatternType** | [**\SynergiTech\Staffology\Model\WorkingPatternType**](WorkingPatternType.md) | | [optional] +**effectiveFrom** | **\DateTime** | | [optional] +**shiftWorkingPatternDays** | [**\SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayResponse[]**](ContractShiftWorkingPatternDayResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractYearsServiceEntitlementRequest.md b/docs/Model/ContractYearsServiceEntitlementRequest.md new file mode 100644 index 0000000..18e4263 --- /dev/null +++ b/docs/Model/ContractYearsServiceEntitlementRequest.md @@ -0,0 +1,10 @@ +# # ContractYearsServiceEntitlementRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**yearsService** | **int** | Number of years of service. | [optional] +**totalAdditionalDaysHoliday** | **float** | Total additional days of holiday entitlement. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractYearsServiceEntitlementResponse.md b/docs/Model/ContractYearsServiceEntitlementResponse.md new file mode 100644 index 0000000..68c1a2a --- /dev/null +++ b/docs/Model/ContractYearsServiceEntitlementResponse.md @@ -0,0 +1,11 @@ +# # ContractYearsServiceEntitlementResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique identifier for the Years Service Entitlement. | [optional] +**yearsService** | **int** | Number of years of service. | [optional] +**totalAdditionalDaysHoliday** | **float** | Total additional days of holiday entitlement. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ContractYearsServiceEntitlementUpdateRequest.md b/docs/Model/ContractYearsServiceEntitlementUpdateRequest.md new file mode 100644 index 0000000..bbd3abb --- /dev/null +++ b/docs/Model/ContractYearsServiceEntitlementUpdateRequest.md @@ -0,0 +1,11 @@ +# # ContractYearsServiceEntitlementUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uniqueId** | **string** | Unique identifier for the request. | [optional] +**yearsService** | **int** | Number of years of service. | [optional] +**totalAdditionalDaysHoliday** | **float** | Total additional days of holiday entitlement. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostAnalysisReport.md b/docs/Model/CostAnalysisReport.md new file mode 100644 index 0000000..f1b4d60 --- /dev/null +++ b/docs/Model/CostAnalysisReport.md @@ -0,0 +1,34 @@ +# # CostAnalysisReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**singlePayrun** | [**\SynergiTech\Staffology\Model\PayRun**](PayRun.md) | | [optional] +**totalPay** | **float** | | [optional] [readonly] +**pension** | **float** | | [optional] +**aeoFees** | **float** | | [optional] +**totalCost** | **float** | | [optional] [readonly] +**employerNic** | **float** | | [optional] +**netPayrollCost** | **float** | | [optional] +**maleCount** | **int** | | [optional] +**femaleCount** | **int** | | [optional] +**leaverCount** | **int** | | [optional] +**joinerCount** | **int** | | [optional] +**paymentAfterLeavingCount** | **int** | | [optional] +**recoverableAmounts** | [**\SynergiTech\Staffology\Model\RecoverableAmounts**](RecoverableAmounts.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostAnalysisReportReportResponse.md b/docs/Model/CostAnalysisReportReportResponse.md new file mode 100644 index 0000000..d8d6afa --- /dev/null +++ b/docs/Model/CostAnalysisReportReportResponse.md @@ -0,0 +1,12 @@ +# # CostAnalysisReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\CostAnalysisReport**](CostAnalysisReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostCentre.md b/docs/Model/CostCentre.md new file mode 100644 index 0000000..d69e2bc --- /dev/null +++ b/docs/Model/CostCentre.md @@ -0,0 +1,14 @@ +# # CostCentre + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The unique code for this Cost Centre | +**title** | **string** | The name of this Cost Centre | +**color** | **string** | A color to used to represent this Cost Centre, in hex format. ie 'ff0000' | [optional] +**accountingCode** | **string** | | [optional] +**employeeCount** | **int** | [readonly] The number of employees with this set as their primary cost centre | [optional] +**hasJournalOverrides** | **bool** | Has Journal Overrides | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostOfEmploymentReport.md b/docs/Model/CostOfEmploymentReport.md new file mode 100644 index 0000000..0685acb --- /dev/null +++ b/docs/Model/CostOfEmploymentReport.md @@ -0,0 +1,23 @@ +# # CostOfEmploymentReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasDepartments** | **bool** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\CostOfEmploymentReportLine[]**](CostOfEmploymentReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostOfEmploymentReportLine.md b/docs/Model/CostOfEmploymentReportLine.md new file mode 100644 index 0000000..d3c36b7 --- /dev/null +++ b/docs/Model/CostOfEmploymentReportLine.md @@ -0,0 +1,17 @@ +# # CostOfEmploymentReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay** | **float** | | [optional] +**employerNic** | **float** | | [optional] +**pension** | **float** | | [optional] +**aeoFees** | **float** | | [optional] +**statPayReclaim** | **float** | | [optional] +**totalCost** | **float** | | [optional] [readonly] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CostOfEmploymentReportReportResponse.md b/docs/Model/CostOfEmploymentReportReportResponse.md new file mode 100644 index 0000000..8811c71 --- /dev/null +++ b/docs/Model/CostOfEmploymentReportReportResponse.md @@ -0,0 +1,12 @@ +# # CostOfEmploymentReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\CostOfEmploymentReport**](CostOfEmploymentReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Country.md b/docs/Model/Country.md new file mode 100644 index 0000000..11fd8e1 --- /dev/null +++ b/docs/Model/Country.md @@ -0,0 +1,8 @@ +# # Country + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CsvFileFormat.md b/docs/Model/CsvFileFormat.md new file mode 100644 index 0000000..4428dd7 --- /dev/null +++ b/docs/Model/CsvFileFormat.md @@ -0,0 +1,8 @@ +# # CsvFileFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DayOfWeek.md b/docs/Model/DayOfWeek.md new file mode 100644 index 0000000..791a823 --- /dev/null +++ b/docs/Model/DayOfWeek.md @@ -0,0 +1,8 @@ +# # DayOfWeek + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DecimalTaxYearConfigPrimitiveValue.md b/docs/Model/DecimalTaxYearConfigPrimitiveValue.md new file mode 100644 index 0000000..8470f0c --- /dev/null +++ b/docs/Model/DecimalTaxYearConfigPrimitiveValue.md @@ -0,0 +1,11 @@ +# # DecimalTaxYearConfigPrimitiveValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | | [optional] +**effectiveFrom** | **\DateTime** | The date when these period values are effective | [optional] +**midYearChanges** | [**\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue[]**](DecimalTaxYearConfigPrimitiveValue.md) | Any optional changes to the period values that are effective from a specified date in the middle of a tax year | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeferalPeriodType.md b/docs/Model/DeferalPeriodType.md new file mode 100644 index 0000000..9559576 --- /dev/null +++ b/docs/Model/DeferalPeriodType.md @@ -0,0 +1,8 @@ +# # DeferalPeriodType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Department.md b/docs/Model/Department.md new file mode 100644 index 0000000..ac0caa8 --- /dev/null +++ b/docs/Model/Department.md @@ -0,0 +1,14 @@ +# # Department + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The unique code for this Department | +**title** | **string** | The name of this Department | +**color** | **string** | A color to used to represent this Department, in hex format. ie 'ff0000' | [optional] +**employeeCount** | **int** | [readonly] The number of employees with this set as their primary department | [optional] +**accountingCode** | **string** | | [optional] +**hasJournalOverrides** | **bool** | Has Overrides | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DepartmentMembership.md b/docs/Model/DepartmentMembership.md new file mode 100644 index 0000000..dbe6443 --- /dev/null +++ b/docs/Model/DepartmentMembership.md @@ -0,0 +1,14 @@ +# # DepartmentMembership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The Code for the Department | +**color** | **string** | [readonly] The Color for the Department | [optional] +**title** | **string** | [readonly] The Title for the Department | [optional] +**primary** | **bool** | Set to true if this is the primary Department for the Employee. Only one department can be set as the primary. | [optional] +**weighting** | **float** | If there is more than one Department Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two departments you might set the primary as 0.8 and the secondary as 0.2; | [optional] +**employeeRoleUniqueId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DirectDebitMandate.md b/docs/Model/DirectDebitMandate.md new file mode 100644 index 0000000..9ebe5c9 --- /dev/null +++ b/docs/Model/DirectDebitMandate.md @@ -0,0 +1,14 @@ +# # DirectDebitMandate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isCompleted** | **bool** | | [optional] +**mandateLink** | **string** | | [optional] +**customerLink** | **string** | | [optional] +**bankName** | **string** | | [optional] +**accountNumberEnding** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DirectorshipDetails.md b/docs/Model/DirectorshipDetails.md new file mode 100644 index 0000000..74a226b --- /dev/null +++ b/docs/Model/DirectorshipDetails.md @@ -0,0 +1,12 @@ +# # DirectorshipDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isDirector** | **bool** | | [optional] +**startDate** | **\DateTime** | | [optional] +**leaveDate** | **\DateTime** | | [optional] +**niAlternativeMethod** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DpsDataType.md b/docs/Model/DpsDataType.md new file mode 100644 index 0000000..966afa5 --- /dev/null +++ b/docs/Model/DpsDataType.md @@ -0,0 +1,8 @@ +# # DpsDataType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DpsNotice.md b/docs/Model/DpsNotice.md new file mode 100644 index 0000000..967d956 --- /dev/null +++ b/docs/Model/DpsNotice.md @@ -0,0 +1,26 @@ +# # DpsNotice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**issueDate** | **\DateTime** | | [optional] +**effectiveDate** | **\DateTime** | | [optional] +**taxYear** | **int** | | [optional] [readonly] +**sequenceNumber** | **int** | | [optional] +**type** | [**\SynergiTech\Staffology\Model\DpsDataType**](DpsDataType.md) | | [optional] +**formType** | **string** | | [optional] +**forename** | **string** | | [optional] +**surname** | **string** | | [optional] +**niNo** | **string** | | [optional] +**worksNumber** | **string** | | [optional] +**taxCode** | **string** | | [optional] +**week1Month1** | **bool** | | [optional] +**previousTax** | **float** | | [optional] +**previousPay** | **float** | | [optional] +**planType** | [**\SynergiTech\Staffology\Model\StudentLoan**](StudentLoan.md) | | [optional] +**appliedOn** | **\DateTime** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DpsSettings.md b/docs/Model/DpsSettings.md new file mode 100644 index 0000000..b6dd9e3 --- /dev/null +++ b/docs/Model/DpsSettings.md @@ -0,0 +1,13 @@ +# # DpsSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | If enabled, we'll automatically retrieve DPS notices from HMRC for you | [optional] +**retrieveFrom** | **\DateTime** | The date from which notices should be retrieved | [optional] +**autoApply** | **bool** | If enabled, we'll automatically apply DPSNotices before starting a payrun that covers the EffectiveDate | [optional] +**lastChecked** | **\DateTime** | [readonly] The time we last checked for notices | [optional] +**error** | **string** | [readonly] If we received an error from HMRC when checking for notices, it'll be displayed here | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmailAttachment.md b/docs/Model/EmailAttachment.md new file mode 100644 index 0000000..6928b35 --- /dev/null +++ b/docs/Model/EmailAttachment.md @@ -0,0 +1,12 @@ +# # EmailAttachment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **string** | | +**filename** | **string** | | +**pdfPasswordType** | [**\SynergiTech\Staffology\Model\PdfPasswordType**](PdfPasswordType.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmpRefs.md b/docs/Model/EmpRefs.md new file mode 100644 index 0000000..7d8d6e8 --- /dev/null +++ b/docs/Model/EmpRefs.md @@ -0,0 +1,14 @@ +# # EmpRefs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**officeNo** | **string** | | [optional] +**payeRef** | **string** | | [optional] +**aoRef** | **string** | | [optional] +**econ** | **string** | | [optional] +**cotaxRef** | **string** | | [optional] +**sautr** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Employee.md b/docs/Model/Employee.md new file mode 100644 index 0000000..69d0cc4 --- /dev/null +++ b/docs/Model/Employee.md @@ -0,0 +1,24 @@ +# # Employee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**holidaySchemeUniqueId** | **string** | | [optional] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**leaveHolidayAccrualDefaultRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] +**personalDetails** | [**\SynergiTech\Staffology\Model\PersonalDetails**](PersonalDetails.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\EmploymentDetails**](EmploymentDetails.md) | | [optional] +**autoEnrolment** | [**\SynergiTech\Staffology\Model\AutoEnrolment**](AutoEnrolment.md) | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\LeaveSettings**](LeaveSettings.md) | | [optional] +**rightToWork** | [**\SynergiTech\Staffology\Model\RightToWork**](RightToWork.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**tags** | **string[]** | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\PayOptions**](PayOptions.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\EmployeeStatus**](EmployeeStatus.md) | | [optional] +**aeNotEnroledWarning** | **bool** | [readonly] If true then the employee should be enrolled in an Auto Enrolment Qualifying pension but isn't | [optional] [readonly] +**sourceSystemId** | **string** | [readonly] Can only be given a value when the employee is created. It can then never be changed. Used by external systems so they can store an immutable reference | [optional] +**evcId** | **string** | If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeBenefitsReport.md b/docs/Model/EmployeeBenefitsReport.md new file mode 100644 index 0000000..accbc59 --- /dev/null +++ b/docs/Model/EmployeeBenefitsReport.md @@ -0,0 +1,12 @@ +# # EmployeeBenefitsReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeBenefitsReportReportResponse.md b/docs/Model/EmployeeBenefitsReportReportResponse.md new file mode 100644 index 0000000..e209442 --- /dev/null +++ b/docs/Model/EmployeeBenefitsReportReportResponse.md @@ -0,0 +1,12 @@ +# # EmployeeBenefitsReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\EmployeeBenefitsReport**](EmployeeBenefitsReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeCostCentre.md b/docs/Model/EmployeeCostCentre.md new file mode 100644 index 0000000..62f5c26 --- /dev/null +++ b/docs/Model/EmployeeCostCentre.md @@ -0,0 +1,15 @@ +# # EmployeeCostCentre + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The Code for the Cost Centre | +**color** | **string** | [readonly] The Color for the Cost Centre | [optional] +**title** | **string** | [readonly] The Title for the Cost Centre | [optional] +**isPrimary** | **bool** | Set to true if this is the primary Cost Centre for the Employee. Only one Cost Centre can be set as the primary. | [optional] +**weighting** | **float** | If there is more than one Cost Centre Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two Cost Centre you might set the primary as 0.8 and the secondary as 0.2; | [optional] +**employeeRoleUniqueId** | **string** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeLeaveReport.md b/docs/Model/EmployeeLeaveReport.md new file mode 100644 index 0000000..4bbece2 --- /dev/null +++ b/docs/Model/EmployeeLeaveReport.md @@ -0,0 +1,13 @@ +# # EmployeeLeaveReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\EmployeeLeaveReportLine[]**](EmployeeLeaveReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeLeaveReportLine.md b/docs/Model/EmployeeLeaveReportLine.md new file mode 100644 index 0000000..08b180d --- /dev/null +++ b/docs/Model/EmployeeLeaveReportLine.md @@ -0,0 +1,38 @@ +# # EmployeeLeaveReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**type** | [**\SynergiTech\Staffology\Model\LeaveType**](LeaveType.md) | | [optional] +**payment** | [**\SynergiTech\Staffology\Model\LeavePayType**](LeavePayType.md) | | [optional] +**payrollCode** | **string** | | [optional] +**openEndedAbsence** | **bool** | | [optional] +**percentOfPay** | **float** | | [optional] +**paySSPInAddition** | **bool** | | [optional] +**payFrequency** | [**\SynergiTech\Staffology\Model\StatPayFrequency**](StatPayFrequency.md) | | [optional] +**occupationalPolicy** | **string** | | [optional] +**from** | **\DateTime** | | [optional] +**to** | **\DateTime** | | [optional] +**useOpeningPay** | **bool** | | [optional] +**openingPay** | **float** | | [optional] +**openingOmpPay** | **float** | | [optional] +**babyDueDate** | **\DateTime** | | [optional] +**babyBirthDate** | **\DateTime** | | [optional] +**matchingDate** | **\DateTime** | | [optional] +**expectedPlacementDate** | **\DateTime** | | [optional] +**placementDate** | **\DateTime** | | [optional] +**deathDate** | **\DateTime** | | [optional] +**averageWeeklyEarnings** | **float** | | [optional] +**automaticAWECalculation** | **bool** | | [optional] +**calculationType** | [**\SynergiTech\Staffology\Model\LeaveCalculationType**](LeaveCalculationType.md) | | [optional] +**strikeHoursToDeduct** | **float** | | [optional] +**historicLeaveRequiresProcessing** | **bool** | | [optional] +**offsetPay** | **bool** | | [optional] +**useAssumedPensionablePay** | **bool** | | [optional] +**automaticAPPCalculation** | **bool** | | [optional] +**assumedPensionablePay** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeLeaveReportReportResponse.md b/docs/Model/EmployeeLeaveReportReportResponse.md new file mode 100644 index 0000000..a196312 --- /dev/null +++ b/docs/Model/EmployeeLeaveReportReportResponse.md @@ -0,0 +1,12 @@ +# # EmployeeLeaveReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\EmployeeLeaveReport**](EmployeeLeaveReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeNiYtdValues.md b/docs/Model/EmployeeNiYtdValues.md new file mode 100644 index 0000000..aa7fe0f --- /dev/null +++ b/docs/Model/EmployeeNiYtdValues.md @@ -0,0 +1,14 @@ +# # EmployeeNiYtdValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**niTable** | **string** | | [optional] +**values** | [**\SynergiTech\Staffology\Model\NiYtdValue[]**](NiYtdValue.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeePayRunTotal.md b/docs/Model/EmployeePayRunTotal.md new file mode 100644 index 0000000..e7ca609 --- /dev/null +++ b/docs/Model/EmployeePayRunTotal.md @@ -0,0 +1,20 @@ +# # EmployeePayRunTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | Payroll code of the employee | [optional] +**grossForNi** | **float** | The amount of the Gross that is subject to NI | [optional] +**grossPensionPay** | **float** | The amount of the Gross that is subject to PensionPay | [optional] +**employerPensionContribution** | **float** | The value of the Pension Contribution being made by the Employer for this Employee | [optional] +**employerNi** | **float** | The Employer NI Contribution amount | [optional] +**grossTaxablePay** | **float** | The amount of the Gross that is subject to TaxablePay | [optional] +**employeeNi** | **float** | The Employee NI Contribution amount | [optional] +**tax** | **float** | The Employee Tax amount | [optional] +**studentLoanRecovered** | **float** | The Employee Student Loan recovered amount | [optional] +**employeePension** | **float** | The value of the Pension Contribution(PENSION) being made by the Employee as a Net Pay Arrangement | [optional] +**employeePensionContributionReliefAtSource** | **float** | The value of employee pension contributions Relief At Source(PENSIONRAS) that are not paid under 'net pay arrangements' | [optional] +**employeePensionContributionSalarySacrifice** | **float** | The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee as a Salary Sacrifice | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeRole.md b/docs/Model/EmployeeRole.md new file mode 100644 index 0000000..ba6bda2 --- /dev/null +++ b/docs/Model/EmployeeRole.md @@ -0,0 +1,21 @@ +# # EmployeeRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**jobTitle** | **string** | Job Title of the Role | [optional] +**isPrimary** | **bool** | Set to True if this is Primary role of the Employee | [optional] +**reference** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\RoleBasis**](RoleBasis.md) | | [optional] +**type** | [**\SynergiTech\Staffology\Model\RoleType**](RoleType.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\EmployeeRolePayOptions**](EmployeeRolePayOptions.md) | | [optional] +**workingPatternId** | **string** | Used when calculating payments for Leave. If null then the default Working Pattern is used | [optional] +**occupationalMaternityPolicyUniqueId** | **string** | Used for assigning occupational maternity policy | [optional] +**occupationalSicknessPolicyUniqueId** | **string** | Used for assigning occupational sickness policy | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeRoleAnalysisCategoryCode.md b/docs/Model/EmployeeRoleAnalysisCategoryCode.md new file mode 100644 index 0000000..728ce90 --- /dev/null +++ b/docs/Model/EmployeeRoleAnalysisCategoryCode.md @@ -0,0 +1,17 @@ +# # EmployeeRoleAnalysisCategoryCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The Code for the AnalysisCategoryCode | +**color** | **string** | [readonly] The Color for the AnalysisCategoryCode | [optional] +**title** | **string** | [readonly] The Title for the AnalysisCategoryCode | [optional] +**isPrimary** | **bool** | Set to true if this is the primary AnalysisCategoryCode for the Employee. Only one AnalysisCategoryCode can be set as the primary. | [optional] +**weighting** | **float** | If there is more than one AnalysisCategoryCode Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two AnalysisCategoryCode you might set the primary as 0.8 and the secondary as 0.2; | [optional] +**analysisCategoryName** | **string** | Analysis Category Name | [optional] +**analysisCategoryPublicId** | **string** | Analysis Category Public Id | [optional] +**employeeRolePublicId** | **string** | Employee Role Public Id | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeRolePayItem.md b/docs/Model/EmployeeRolePayItem.md new file mode 100644 index 0000000..6c87ef6 --- /dev/null +++ b/docs/Model/EmployeeRolePayItem.md @@ -0,0 +1,13 @@ +# # EmployeeRolePayItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roleId** | **string** | | [optional] +**isPrimary** | **bool** | | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**weight** | **float** | This property is used to calculate values for the relative weight of the usual pay for each role compared to the sum of all roles' usual pay Usual pay for the purpose of the current value's calculation is based on the employee's permanent pay items including employee basic pay and permanent addition and deduction pay lines subject to NI or Tax | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeRolePayOptions.md b/docs/Model/EmployeeRolePayOptions.md new file mode 100644 index 0000000..963305a --- /dev/null +++ b/docs/Model/EmployeeRolePayOptions.md @@ -0,0 +1,23 @@ +# # EmployeeRolePayOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**nationalMinimumWage** | **bool** | | [optional] +**payCode** | **string** | If you want the Employees pay to be allocated to a code other than BASIC, specify it here | [optional] +**mileageVehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**mapsMiles** | **int** | The number of miles to pay for as Mileage Allowance Payments | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**basicPay** | **float** | The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**niTable** | **string** | | [optional] +**regularPayLines** | [**\SynergiTech\Staffology\Model\PayLine[]**](PayLine.md) | These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. | [optional] +**excludedRegularPayLines** | [**\SynergiTech\Staffology\Model\PayLine[]**](PayLine.md) | These used to store the PayLines that have been excluded from RegularPaylines. | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeSortBy.md b/docs/Model/EmployeeSortBy.md new file mode 100644 index 0000000..a86ae4f --- /dev/null +++ b/docs/Model/EmployeeSortBy.md @@ -0,0 +1,8 @@ +# # EmployeeSortBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeStatus.md b/docs/Model/EmployeeStatus.md new file mode 100644 index 0000000..b6ae53f --- /dev/null +++ b/docs/Model/EmployeeStatus.md @@ -0,0 +1,8 @@ +# # EmployeeStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeYtdValues.md b/docs/Model/EmployeeYtdValues.md new file mode 100644 index 0000000..cbc0f85 --- /dev/null +++ b/docs/Model/EmployeeYtdValues.md @@ -0,0 +1,13 @@ +# # EmployeeYtdValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**values** | [**\SynergiTech\Staffology\Model\YtdValue[]**](YtdValue.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Employer.md b/docs/Model/Employer.md new file mode 100644 index 0000000..309aa58 --- /dev/null +++ b/docs/Model/Employer.md @@ -0,0 +1,60 @@ +# # Employer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**crn** | **string** | Company Registration Number | [optional] +**logoUrl** | **string** | | [optional] +**logoSasUrl** | **string** | | [optional] +**alternativeId** | **string** | | [optional] +**bankPaymentsCsvFormat** | [**\SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat**](BankPaymentInstructionsCsvFormat.md) | | [optional] +**bacsServiceUserNumber** | **string** | | [optional] +**bacsBureauNumber** | **string** | | [optional] +**rejectInvalidBankDetails** | **bool** | | [optional] +**bankPaymentsReferenceFormat** | **string** | | [optional] +**bacsIncludeAEO** | **bool** | | [optional] +**bacsIncludeDeductions** | **bool** | | [optional] +**bacsIncludeHmrc** | **bool** | | [optional] +**bacsIncludePensions** | **bool** | | [optional] +**useTenantRtiSubmissionSettings** | **bool** | If the Tenant for this employer has Bureau Features enabled then they can set RtiSubmissionSettings to be used across multiple employers. If this is set to true then those settings will be used instead of any set at the Employer level | [optional] +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**defaultPayOptions** | [**\SynergiTech\Staffology\Model\PayOptions**](PayOptions.md) | | [optional] +**hmrcDetails** | [**\SynergiTech\Staffology\Model\HmrcDetails**](HmrcDetails.md) | | [optional] +**defaultPension** | [**\SynergiTech\Staffology\Model\PensionSelection**](PensionSelection.md) | | [optional] +**rtiSubmissionSettings** | [**\SynergiTech\Staffology\Model\RtiSubmissionSettings**](RtiSubmissionSettings.md) | | [optional] +**autoEnrolmentSettings** | [**\SynergiTech\Staffology\Model\AutoEnrolmentSettings**](AutoEnrolmentSettings.md) | | [optional] +**accruePayCodeSetUniqueId** | **string** | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\LeaveSettings**](LeaveSettings.md) | | [optional] +**settings** | [**\SynergiTech\Staffology\Model\EmployerSettings**](EmployerSettings.md) | | [optional] +**umbrellaSettings** | [**\SynergiTech\Staffology\Model\UmbrellaSettings**](UmbrellaSettings.md) | | [optional] +**employeeCount** | **int** | [readonly] The number of Employees this Employer has, including CIS Subcontractors. | [optional] +**subcontractorCount** | **int** | [readonly] The number of CIS Subcontractors this Employer has. | [optional] +**startYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**currentYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**supportAccessEnabled** | **bool** | If set to true then the support team can access this employer to help resolve support queries | [optional] +**archived** | **bool** | A flag to indicate whather or not the employer is Archived, ie no longer actively used | [optional] +**canUseBureauFeatures** | **bool** | | [optional] +**multiRoleEnabled** | **bool** | | [optional] +**educationPayrollEnabled** | **bool** | | [optional] +**effectiveDateWorkingPatternsEnabled** | **bool** | | [optional] +**backPayEnabled** | **bool** | | [optional] [readonly] +**isOptedInToEvc** | **bool** | [readonly] Indicates whether or not the Employer is opted in to the Employee Verification Programme. Value can only be changed by its dedicated API end point. | [optional] +**evcId** | **string** | If set then this will be used as the Employer ID sent to EVC in place of the standard EmployerId. | [optional] +**holidayAccrualBasis** | [**\SynergiTech\Staffology\Model\HolidayAccrual**](HolidayAccrual.md) | | [optional] +**holidayAccrualDefaultRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**mfaEnabled** | **bool** | if set to true requires all users to setup MFA support queries | [optional] +**departmentJournalOverridesEnabled** | **bool** | Enables the journal overrides for departments, if set to true. | [optional] +**costCentreJournalOverridesEnabled** | **bool** | Enables the journal overrides for cost centre, if set to true. | [optional] +**settingsSortPayrollNumbersAlphanumerically** | **bool** | Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied | [optional] +**unauthorisedLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**holidayLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**sickLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**parentalLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**bereavementLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] +**sourceSystemId** | **string** | [readonly] Can only be given a value when the employer is created. It can then never be changed. Used by external systems so they can store an immutable reference | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerDefaults.md b/docs/Model/EmployerDefaults.md new file mode 100644 index 0000000..38a7d34 --- /dev/null +++ b/docs/Model/EmployerDefaults.md @@ -0,0 +1,21 @@ +# # EmployerDefaults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employer** | [**\SynergiTech\Staffology\Model\EmployerItem**](EmployerItem.md) | | [optional] +**payCodes** | **bool** | If true then PayCodes and PayCodeSets will be copied from the specified Employer | [optional] +**csvMappings** | **bool** | If true then CSV Mappings will be copied from the specified Employer | [optional] +**departments** | **bool** | If true then Departments, Cost Centres and Analysis Categories will be copied from the specified Employer | [optional] +**rti** | **bool** | If true then RTI Settings will be copied from the specified Employer | [optional] +**users** | **bool** | If true then Users will be copied from the specified Employer | [optional] +**hmrcNoticeSettings** | **bool** | If true then HMRC Notice Settings will be copied from the specified Employer | [optional] +**payOptions** | **bool** | If true then Default Pay Options will be copied from the specified Employer. | [optional] +**workingPatterns** | **bool** | If true then WorkingPatterns will be copied from the specified Employer | [optional] +**occupationalPolicies** | **bool** | If true then Occupational Absence Schemes will be copied from the specified Employer. | [optional] +**pensionSchemes** | **bool** | If true then PensionSchemes will be copied from the specified Employer | [optional] +**payees** | **bool** | If true then Payees will be copied from the specified Employer | [optional] +**reportPacks** | **bool** | If true then ReportPacks will be copied from the specified Employer | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerEmail.md b/docs/Model/EmployerEmail.md new file mode 100644 index 0000000..33ee0cc --- /dev/null +++ b/docs/Model/EmployerEmail.md @@ -0,0 +1,23 @@ +# # EmployerEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toName** | **string** | | +**toEmail** | **string** | | +**subject** | **string** | | +**buttonText** | **string** | | [optional] +**buttonLink** | **string** | | [optional] +**bodyPreview** | **string** | | [optional] +**body** | **string** | | [optional] +**afterBtnBody** | **string** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusDate** | **\DateTime** | | [optional] +**statusMessage** | **string** | | [optional] +**sendAttempts** | **int** | | [optional] +**webAppBaseUrl** | **string** | | [optional] +**attachments** | [**\SynergiTech\Staffology\Model\EmailAttachment[]**](EmailAttachment.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerEvcOptInHistory.md b/docs/Model/EmployerEvcOptInHistory.md new file mode 100644 index 0000000..eccb6fb --- /dev/null +++ b/docs/Model/EmployerEvcOptInHistory.md @@ -0,0 +1,11 @@ +# # EmployerEvcOptInHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optIn** | **bool** | | [optional] +**date** | **\DateTime** | | [optional] +**userEmail** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerGroup.md b/docs/Model/EmployerGroup.md new file mode 100644 index 0000000..0c3baf0 --- /dev/null +++ b/docs/Model/EmployerGroup.md @@ -0,0 +1,12 @@ +# # EmployerGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The unique code for this EmployerGroup | +**employerCount** | **int** | | [optional] +**color** | **string** | A color to used to represent this EmployerGroup, in hex format. ie 'ff0000' | [optional] +**name** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerGroupMembership.md b/docs/Model/EmployerGroupMembership.md new file mode 100644 index 0000000..8db6b49 --- /dev/null +++ b/docs/Model/EmployerGroupMembership.md @@ -0,0 +1,12 @@ +# # EmployerGroupMembership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The Code for the EmployerGroup | +**color** | **string** | [readonly] The Color for the EmployerGroup | [optional] +**title** | **string** | [readonly] The Title for the EmployerGroup | [optional] +**primary** | **bool** | Set to true if this is the primary EmployerGroup for the Employer. Only one EmployerGroup can be set as the primary. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerItem.md b/docs/Model/EmployerItem.md new file mode 100644 index 0000000..b8bb2d8 --- /dev/null +++ b/docs/Model/EmployerItem.md @@ -0,0 +1,14 @@ +# # EmployerItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isOwner** | **bool** | | [optional] +**role** | [**\SynergiTech\Staffology\Model\UserRole**](UserRole.md) | | [optional] +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerOpeningBalances.md b/docs/Model/EmployerOpeningBalances.md new file mode 100644 index 0000000..6369cbb --- /dev/null +++ b/docs/Model/EmployerOpeningBalances.md @@ -0,0 +1,21 @@ +# # EmployerOpeningBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smpRecovered** | **float** | Value of Statutory Maternity Pay recovered year to date | [optional] +**sppRecovered** | **float** | Value of Statutory Paternity Pay recovered year to date | [optional] +**sapRecovered** | **float** | Value of Statutory Adoption Pay recovered year to date | [optional] +**shPPRecovered** | **float** | Value of Shared Parental Pay recovered year to date | [optional] +**spbpRecovered** | **float** | Value of Statutory Parental Bereavment Pay recovered year to date | [optional] +**nicCompensationOnSMP** | **float** | Value of NIC compensation on SMP year to date | [optional] +**nicCompensationOnSPP** | **float** | Value of NIC compensation on Statutory Paternity Pay year to date | [optional] +**nicCompensationOnSAP** | **float** | Value of NIC compensation on Statutory Adoption Pay year to date | [optional] +**nicCompensationOnShPP** | **float** | Value of NIC compensation on Shared Parental Pay year to date | [optional] +**nicCompensationOnSPBP** | **float** | Value of NIC compensation on Statutory Parental Bereavement Pay year to date | [optional] +**cisDeductionsSuffered** | **float** | Value of CIS deductions suffered year to date | [optional] +**apprenticeshipLevy** | **float** | Value of Apprenticeship levy paid year to date | [optional] +**employmentAllowance** | **float** | Value of Employment Allowance claimed year to date | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerPensionContribution.md b/docs/Model/EmployerPensionContribution.md new file mode 100644 index 0000000..276586a --- /dev/null +++ b/docs/Model/EmployerPensionContribution.md @@ -0,0 +1,12 @@ +# # EmployerPensionContribution + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionName** | **string** | | [optional] +**contributionAmount** | **float** | | [optional] +**contributionPercentage** | **float** | | [optional] +**isPercentage** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerSettings.md b/docs/Model/EmployerSettings.md new file mode 100644 index 0000000..51bf504 --- /dev/null +++ b/docs/Model/EmployerSettings.md @@ -0,0 +1,23 @@ +# # EmployerSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowNegativePay** | **bool** | | [optional] +**manualStatutoryPayLinesEnabled** | **bool** | | [optional] +**mergeMatchingNominalsEnabled** | **bool** | | [optional] +**autoCalcBackPayForNewStarters** | **bool** | | [optional] +**payCodeValidationEnabled** | **bool** | | [optional] +**calculateEffectiveDateSalaryChanges** | **bool** | | [optional] +**groupPayLinesEnabled** | **bool** | A flag to indicate whether paylines should be grouped. The grouping is done based on the following PayLine properties: Rate, Multiplier, Code, Description and RoleId | [optional] +**contractedWeeks** | **float** | The amount of weeks an employee works, utilise for employees who aren't working full time. This value is the default which can be inherited when creating/updating a WorkingPattern. | [optional] +**fullTimeContractedWeeks** | **float** | The amount of weeks an employee works (Full Time). This value is the default which can be inherited when creating/updating a WorkingPattern. | [optional] +**fullTimeContractedHours** | **float** | The amount of hours an employee works (Full Time). This value is the default which can be inherited when creating/updating a WorkingPattern. | [optional] +**disabledPayRunWarningsList** | [**\SynergiTech\Staffology\Model\PayRunEntryWarningType[]**](PayRunEntryWarningType.md) | Pay run warnings that the user has opted to ignore. | [optional] +**journalCsvFormat** | [**\SynergiTech\Staffology\Model\JournalCsvFormat**](JournalCsvFormat.md) | | [optional] +**preferAsyncPayrunApiCalls** | **bool** | This setting is only available temporarily and is only setable by users with access to beta features enabled. If set to true the the web applicaiton will use new async API calls for managing payruns | [optional] +**nominalMappingsEnabled** | **bool** | Enables the nominal mappings(Custom Codes,System Codes,Control Codes,Employer Codes) for the employer, if set to true. | [optional] +**sortPayrollNumbersAlphanumerically** | **bool** | Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerTemplate.md b/docs/Model/EmployerTemplate.md new file mode 100644 index 0000000..9efc42c --- /dev/null +++ b/docs/Model/EmployerTemplate.md @@ -0,0 +1,19 @@ +# # EmployerTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\EmployerTemplateType**](EmployerTemplateType.md) | | [optional] +**description** | **string** | Explains the purpose of this template | [optional] +**isCustom** | **bool** | Indicates whether or not this template has been changed from the default content. | [optional] [readonly] +**content** | **string** | | [optional] +**subject** | **string** | | [optional] +**defaultContent** | **string** | [readonly] The default content for this template | [optional] +**defaultSubject** | **string** | [readonly] The default subject for this template | [optional] +**hasSubject** | **bool** | [readonly] If false then the Subject property is not relevant for this template type | [optional] +**tokens** | **string[]** | [readonly] A list of tokens that can be used with this template. For example, if 'Employee.FirstName' is in the list then use '{Employee.FirstName}' in the Content or Subject and it'll be replaced with the relevant value when the template is parsed. | [optional] +**tokensExpanded** | **bool** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployerTemplateType.md b/docs/Model/EmployerTemplateType.md new file mode 100644 index 0000000..f5c2710 --- /dev/null +++ b/docs/Model/EmployerTemplateType.md @@ -0,0 +1,8 @@ +# # EmployerTemplateType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmploymentDetails.md b/docs/Model/EmploymentDetails.md new file mode 100644 index 0000000..ec8f7b9 --- /dev/null +++ b/docs/Model/EmploymentDetails.md @@ -0,0 +1,36 @@ +# # EmploymentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cisSubContractor** | **bool** | Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information | [optional] +**payrollCode** | **string** | The Employees Payroll Code. Must be unique within the Employer. | +**jobTitle** | **string** | Job Title of Primary role of the Employee | [optional] +**onHold** | **bool** | Set to true to temporarily exclude the employee from payruns | [optional] +**onFurlough** | **bool** | Set to true if the employee is on furlough. | [optional] +**furloughStart** | **\DateTime** | Furlough Start Date. | [optional] +**furloughEnd** | **\DateTime** | Furlough End Date. | [optional] +**furloughCalculationBasis** | [**\SynergiTech\Staffology\Model\FurloughCalculationBasis**](FurloughCalculationBasis.md) | | [optional] +**furloughCalculationBasisAmount** | **float** | | [optional] +**partialFurlough** | **bool** | Set to true if the employee is partially furloughed. | [optional] +**furloughHoursNormallyWorked** | **float** | | [optional] +**furloughHoursOnFurlough** | **float** | | [optional] +**isApprentice** | **bool** | Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage | [optional] +**apprenticeshipStartDate** | **\DateTime** | | [optional] +**apprenticeshipEndDate** | **\DateTime** | | [optional] +**workingPattern** | **string** | Used when calculating payments for Leave. If null then the default Working Pattern is used | [optional] +**forcePreviousPayrollCode** | **string** | If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. | [optional] +**starterDetails** | [**\SynergiTech\Staffology\Model\StarterDetails**](StarterDetails.md) | | [optional] +**directorshipDetails** | [**\SynergiTech\Staffology\Model\DirectorshipDetails**](DirectorshipDetails.md) | | [optional] +**leaverDetails** | [**\SynergiTech\Staffology\Model\LeaverDetails**](LeaverDetails.md) | | [optional] +**cis** | [**\SynergiTech\Staffology\Model\CisDetails**](CisDetails.md) | | [optional] +**department** | [**\SynergiTech\Staffology\Model\Department**](Department.md) | | [optional] +**roles** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | List of Roles held by Employee | [optional] +**isWorkingInFreePort** | **bool** | Flag indicating the employee is employed in a Freeport | [optional] +**veteranDetails** | [**\SynergiTech\Staffology\Model\VeteranDetails**](VeteranDetails.md) | | [optional] +**continuousEmploymentDate** | **\DateTime** | [readonly] Continuous employment date for the occupational scheme. | [optional] +**includeSecondedInfoOnStarter** | **bool** | [readonly] If true then include seconded information on starter of FPS | [optional] +**isWorkingInInvestmentZone** | **bool** | Flag indicating the employee is employed in an Investment Zone | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EntitlementBand.md b/docs/Model/EntitlementBand.md new file mode 100644 index 0000000..7486165 --- /dev/null +++ b/docs/Model/EntitlementBand.md @@ -0,0 +1,13 @@ +# # EntitlementBand + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**percentOfPay** | **float** | | [optional] +**period** | **int** | | [optional] +**paySspInAddition** | **bool** | | [optional] +**order** | **int** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EntityType.md b/docs/Model/EntityType.md new file mode 100644 index 0000000..a710db0 --- /dev/null +++ b/docs/Model/EntityType.md @@ -0,0 +1,8 @@ +# # EntityType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Eps.md b/docs/Model/Eps.md new file mode 100644 index 0000000..7e77a13 --- /dev/null +++ b/docs/Model/Eps.md @@ -0,0 +1,22 @@ +# # Eps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**periodOfInactivity** | [**\SynergiTech\Staffology\Model\FromToDates**](FromToDates.md) | | [optional] +**noPaymentForPeriod** | [**\SynergiTech\Staffology\Model\FromToDates**](FromToDates.md) | | [optional] +**finalSubmission** | [**\SynergiTech\Staffology\Model\EpsFinalSubmission**](EpsFinalSubmission.md) | | [optional] +**recoverableAmounts** | [**\SynergiTech\Staffology\Model\RecoverableAmounts**](RecoverableAmounts.md) | | [optional] +**apprenticeshipLevy** | [**\SynergiTech\Staffology\Model\EpsApprenticeshipLevy**](EpsApprenticeshipLevy.md) | | [optional] +**account** | [**\SynergiTech\Staffology\Model\EpsAccount**](EpsAccount.md) | | [optional] +**eligibleForEmploymentAllowance** | **bool** | | [optional] +**deMinimisStateAid** | [**\SynergiTech\Staffology\Model\EpsDeMinimisStateAid**](EpsDeMinimisStateAid.md) | | [optional] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EpsAccount.md b/docs/Model/EpsAccount.md new file mode 100644 index 0000000..73c86dd --- /dev/null +++ b/docs/Model/EpsAccount.md @@ -0,0 +1,12 @@ +# # EpsAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountHoldersName** | **string** | | [optional] +**accountNo** | **string** | | [optional] +**sortCode** | **string** | | [optional] +**buildingSocRef** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EpsApprenticeshipLevy.md b/docs/Model/EpsApprenticeshipLevy.md new file mode 100644 index 0000000..9dd356b --- /dev/null +++ b/docs/Model/EpsApprenticeshipLevy.md @@ -0,0 +1,11 @@ +# # EpsApprenticeshipLevy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxMonth** | **int** | | [optional] +**levyDueYTD** | **float** | | [optional] +**annualAllce** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EpsDeMinimisStateAid.md b/docs/Model/EpsDeMinimisStateAid.md new file mode 100644 index 0000000..29a5a21 --- /dev/null +++ b/docs/Model/EpsDeMinimisStateAid.md @@ -0,0 +1,12 @@ +# # EpsDeMinimisStateAid + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agri** | **bool** | | [optional] +**fisheriesAqua** | **bool** | | [optional] +**roadTrans** | **bool** | | [optional] +**indust** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EpsFinalSubmission.md b/docs/Model/EpsFinalSubmission.md new file mode 100644 index 0000000..e03e72d --- /dev/null +++ b/docs/Model/EpsFinalSubmission.md @@ -0,0 +1,11 @@ +# # EpsFinalSubmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isFinalSubmission** | **bool** | | [optional] +**becauseSchemeCeased** | **bool** | | [optional] +**dateCeased** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Establishment.md b/docs/Model/Establishment.md new file mode 100644 index 0000000..a7d04ff --- /dev/null +++ b/docs/Model/Establishment.md @@ -0,0 +1,12 @@ +# # Establishment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**localAuthorityNumber** | **string** | | [optional] +**schoolEmployerType** | **string** | | [optional] +**establishmentCode** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EvcSettings.md b/docs/Model/EvcSettings.md new file mode 100644 index 0000000..3231eff --- /dev/null +++ b/docs/Model/EvcSettings.md @@ -0,0 +1,12 @@ +# # EvcSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rightToRestrict** | **bool** | If set to True then this employee shouldn't be included in data sent to EVC | [optional] +**rightToDelete** | **bool** | If set to True then the EVC service will be informed that the employee has invoked their GDPR Right To Delete | [optional] +**subjectAccessRequest** | **bool** | If set to True then the EVC service will be informed that the employee has made a Subject Access Request | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Exb.md b/docs/Model/Exb.md new file mode 100644 index 0000000..f59ec9b --- /dev/null +++ b/docs/Model/Exb.md @@ -0,0 +1,24 @@ +# # Exb + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionsAmount** | **float** | | [optional] +**additionsDescription** | **string** | | [optional] +**deductionsAmount** | **float** | | [optional] +**deductionsDescription** | **string** | | [optional] +**employeeCount** | **int** | [readonly] The number of employees with a P11D | [optional] +**totalBenefits** | **float** | [readonly] Total value of benefits, not including any deductions or additions | [optional] +**totalAdjustedBenefits** | **float** | [readonly] Total value of benefits | [optional] [readonly] +**nicsRate** | **float** | [readonly] The Class 1A NICS Rate | [optional] +**nicsPayable** | **float** | [readonly] NICs Payable | [optional] [readonly] +**expensesAndBenefits** | [**\SynergiTech\Staffology\Model\ExpensesAndBenefits**](ExpensesAndBenefits.md) | | [optional] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbDeclarations.md b/docs/Model/ExbDeclarations.md new file mode 100644 index 0000000..3270c22 --- /dev/null +++ b/docs/Model/ExbDeclarations.md @@ -0,0 +1,10 @@ +# # ExbDeclarations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p11Dincluded** | **string** | | [optional] +**p46CarDeclaration** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbEmployer.md b/docs/Model/ExbEmployer.md new file mode 100644 index 0000000..a565776 --- /dev/null +++ b/docs/Model/ExbEmployer.md @@ -0,0 +1,9 @@ +# # ExbEmployer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11d.md b/docs/Model/ExbP11d.md new file mode 100644 index 0000000..cb7e274 --- /dev/null +++ b/docs/Model/ExbP11d.md @@ -0,0 +1,23 @@ +# # ExbP11d + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\ExbP11dEmployee**](ExbP11dEmployee.md) | | [optional] +**transferred** | [**\SynergiTech\Staffology\Model\P11DAssetTransferredCollection**](P11DAssetTransferredCollection.md) | | [optional] +**payments** | [**\SynergiTech\Staffology\Model\P11DPaymentCollection**](P11DPaymentCollection.md) | | [optional] +**vouchersOrCCs** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**livingAccom** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**mileageAllow** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**cars** | [**\SynergiTech\Staffology\Model\P11DCarCollection**](P11DCarCollection.md) | | [optional] +**vans** | [**\SynergiTech\Staffology\Model\P11dVans**](P11dVans.md) | | [optional] +**loans** | [**\SynergiTech\Staffology\Model\P11DLoanCollection**](P11DLoanCollection.md) | | [optional] +**medical** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**relocation** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**services** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**assetsAvail** | [**\SynergiTech\Staffology\Model\P11DAssetAvailableCollection**](P11DAssetAvailableCollection.md) | | [optional] +**other** | [**\SynergiTech\Staffology\Model\P11DOther**](P11DOther.md) | | [optional] +**expPaid** | [**\SynergiTech\Staffology\Model\P11dExpenses**](P11dExpenses.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11dEmployee.md b/docs/Model/ExbP11dEmployee.md new file mode 100644 index 0000000..a716e92 --- /dev/null +++ b/docs/Model/ExbP11dEmployee.md @@ -0,0 +1,15 @@ +# # ExbP11dEmployee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeUniqueId** | **string** | | [optional] +**dirInd** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] +**wksNo** | **string** | | [optional] +**nino** | **string** | | [optional] +**birthDate** | **string** | | [optional] +**gender** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11db.md b/docs/Model/ExbP11db.md new file mode 100644 index 0000000..f20039b --- /dev/null +++ b/docs/Model/ExbP11db.md @@ -0,0 +1,9 @@ +# # ExbP11db + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class1AcontributionsDue** | [**\SynergiTech\Staffology\Model\ExbP11dbClass1A**](ExbP11dbClass1A.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11dbClass1A.md b/docs/Model/ExbP11dbClass1A.md new file mode 100644 index 0000000..5ea4ccd --- /dev/null +++ b/docs/Model/ExbP11dbClass1A.md @@ -0,0 +1,12 @@ +# # ExbP11dbClass1A + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**niCsRate** | **string** | | [optional] +**totalBenefit** | [**\SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit**](ExbP11dbClass1ATotalBenefit.md) | | [optional] +**adjustments** | [**\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments**](ExbP11dbClass1AAdjustments.md) | | [optional] +**niCpayable** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11dbClass1AAdjustment.md b/docs/Model/ExbP11dbClass1AAdjustment.md new file mode 100644 index 0000000..a3ea308 --- /dev/null +++ b/docs/Model/ExbP11dbClass1AAdjustment.md @@ -0,0 +1,10 @@ +# # ExbP11dbClass1AAdjustment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] +**adjustment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11dbClass1AAdjustments.md b/docs/Model/ExbP11dbClass1AAdjustments.md new file mode 100644 index 0000000..7156fd2 --- /dev/null +++ b/docs/Model/ExbP11dbClass1AAdjustments.md @@ -0,0 +1,13 @@ +# # ExbP11dbClass1AAdjustments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalBenefit** | **string** | | [optional] +**amountDue** | [**\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment**](ExbP11dbClass1AAdjustment.md) | | [optional] +**amountNotDue** | [**\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment**](ExbP11dbClass1AAdjustment.md) | | [optional] +**total** | **string** | | [optional] +**payable** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbP11dbClass1ATotalBenefit.md b/docs/Model/ExbP11dbClass1ATotalBenefit.md new file mode 100644 index 0000000..415dad2 --- /dev/null +++ b/docs/Model/ExbP11dbClass1ATotalBenefit.md @@ -0,0 +1,10 @@ +# # ExbP11dbClass1ATotalBenefit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjustmentRequired** | **string** | | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExbReportResponse.md b/docs/Model/ExbReportResponse.md new file mode 100644 index 0000000..2b786f8 --- /dev/null +++ b/docs/Model/ExbReportResponse.md @@ -0,0 +1,12 @@ +# # ExbReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\Exb**](Exb.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExpensesAndBenefits.md b/docs/Model/ExpensesAndBenefits.md new file mode 100644 index 0000000..02b635f --- /dev/null +++ b/docs/Model/ExpensesAndBenefits.md @@ -0,0 +1,15 @@ +# # ExpensesAndBenefits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employer** | [**\SynergiTech\Staffology\Model\ExbEmployer**](ExbEmployer.md) | | [optional] +**declarations** | [**\SynergiTech\Staffology\Model\ExbDeclarations**](ExbDeclarations.md) | | [optional] +**p11Db** | [**\SynergiTech\Staffology\Model\ExbP11db**](ExbP11db.md) | | [optional] +**p11DrecordCount** | **int** | | [optional] +**p46CarRecordCount** | **int** | | [optional] +**p11D** | [**\SynergiTech\Staffology\Model\ExbP11d[]**](ExbP11d.md) | | [optional] +**relatedTaxYear** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalDataCompany.md b/docs/Model/ExternalDataCompany.md new file mode 100644 index 0000000..30ba4d2 --- /dev/null +++ b/docs/Model/ExternalDataCompany.md @@ -0,0 +1,11 @@ +# # ExternalDataCompany + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**schemeName** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalDataProvider.md b/docs/Model/ExternalDataProvider.md new file mode 100644 index 0000000..5ad4479 --- /dev/null +++ b/docs/Model/ExternalDataProvider.md @@ -0,0 +1,18 @@ +# # ExternalDataProvider + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [readonly] +**id** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](ExternalDataProviderId.md) | | [optional] +**authScheme** | [**\SynergiTech\Staffology\Model\AuthScheme**](AuthScheme.md) | | [optional] +**logoUrl** | **string** | | [optional] +**iconUrl** | **string** | | [optional] +**connected** | **bool** | | [optional] +**connectedAs** | **string** | | [optional] +**requiresConfig** | **bool** | | [optional] +**deferralUrl** | **string** | | [optional] +**types** | [**\SynergiTech\Staffology\Model\ExternalDataProviderType[]**](ExternalDataProviderType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalDataProviderId.md b/docs/Model/ExternalDataProviderId.md new file mode 100644 index 0000000..21c273b --- /dev/null +++ b/docs/Model/ExternalDataProviderId.md @@ -0,0 +1,8 @@ +# # ExternalDataProviderId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalDataProviderType.md b/docs/Model/ExternalDataProviderType.md new file mode 100644 index 0000000..35bfef7 --- /dev/null +++ b/docs/Model/ExternalDataProviderType.md @@ -0,0 +1,8 @@ +# # ExternalDataProviderType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalEmployeeMapping.md b/docs/Model/ExternalEmployeeMapping.md new file mode 100644 index 0000000..82edd15 --- /dev/null +++ b/docs/Model/ExternalEmployeeMapping.md @@ -0,0 +1,14 @@ +# # ExternalEmployeeMapping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**externalId** | **string** | [readonly] The id for the employee in the external system | [optional] +**providerId** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](ExternalDataProviderId.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus**](ExternalEmployeeMappingStatus.md) | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**externalEmployee** | [**\SynergiTech\Staffology\Model\Employee**](Employee.md) | | [optional] +**lastSyncDate** | **\DateTime** | [readonly] The date and time this mapping was last synchronised | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalEmployeeMappingStatus.md b/docs/Model/ExternalEmployeeMappingStatus.md new file mode 100644 index 0000000..68b05e4 --- /dev/null +++ b/docs/Model/ExternalEmployeeMappingStatus.md @@ -0,0 +1,8 @@ +# # ExternalEmployeeMappingStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExternalProviderConversation.md b/docs/Model/ExternalProviderConversation.md new file mode 100644 index 0000000..fffcabe --- /dev/null +++ b/docs/Model/ExternalProviderConversation.md @@ -0,0 +1,15 @@ +# # ExternalProviderConversation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | [optional] +**contentType** | **string** | | [optional] +**url** | **string** | | [optional] +**request** | **string** | | [optional] +**response** | **string** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusMessage** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldModification.md b/docs/Model/FieldModification.md new file mode 100644 index 0000000..3f75b79 --- /dev/null +++ b/docs/Model/FieldModification.md @@ -0,0 +1,12 @@ +# # FieldModification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fieldName** | **string** | | [optional] +**isSignificant** | **bool** | | [optional] +**oldValue** | **string** | | [optional] +**newValue** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FixedCode.md b/docs/Model/FixedCode.md new file mode 100644 index 0000000..5eb3374 --- /dev/null +++ b/docs/Model/FixedCode.md @@ -0,0 +1,10 @@ +# # FixedCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | [readonly] | [optional] +**rate** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FlexibleDrawdown.md b/docs/Model/FlexibleDrawdown.md new file mode 100644 index 0000000..2186fc6 --- /dev/null +++ b/docs/Model/FlexibleDrawdown.md @@ -0,0 +1,8 @@ +# # FlexibleDrawdown + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Fps.md b/docs/Model/Fps.md new file mode 100644 index 0000000..a07a717 --- /dev/null +++ b/docs/Model/Fps.md @@ -0,0 +1,23 @@ +# # Fps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lateReason** | [**\SynergiTech\Staffology\Model\FpsLateReason**](FpsLateReason.md) | | [optional] +**paymentDate** | **\DateTime** | | [optional] +**overridePaymentDate** | **\DateTime** | If a value if provided here then it will be used in place of the actual PaymentDate on the FPS. The value must fall in to the same Tax Period as the PaymentDate | [optional] +**employeeCount** | **int** | | [optional] +**isCorrection** | **bool** | | [optional] +**supersededCount** | **int** | The number of payments on this FPS that have been superseded by later versions | [optional] +**fullPaymentSubmission** | [**\SynergiTech\Staffology\Model\FullPaymentSubmission**](FullPaymentSubmission.md) | | [optional] +**versions** | [**\SynergiTech\Staffology\Model\FpsPriorVersion[]**](FpsPriorVersion.md) | If any of the payments on this FPS appear on another FPS then then there will be an entry here for each of them. If there is an entry where the FpsId matches this FPS then that means the FpsEmployee on this Fps is itself a prior version (ie, it's been superseded) | [optional] +**validationWarnings** | [**\SynergiTech\Staffology\Model\RtiValidationWarning[]**](RtiValidationWarning.md) | | [optional] [readonly] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsBenefit.md b/docs/Model/FpsBenefit.md new file mode 100644 index 0000000..d8da23b --- /dev/null +++ b/docs/Model/FpsBenefit.md @@ -0,0 +1,9 @@ +# # FpsBenefit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**car** | [**\SynergiTech\Staffology\Model\FpsCar[]**](FpsCar.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsCar.md b/docs/Model/FpsCar.md new file mode 100644 index 0000000..4b6f222 --- /dev/null +++ b/docs/Model/FpsCar.md @@ -0,0 +1,20 @@ +# # FpsCar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**make** | **string** | | [optional] +**firstRegd** | **string** | | [optional] +**cO2** | **string** | | [optional] +**zeroEmissionsMileage** | **string** | | [optional] +**fuel** | **string** | | [optional] +**id** | **string** | | [optional] +**amendment** | **string** | | [optional] +**price** | **string** | | [optional] +**availFrom** | **string** | | [optional] +**cashEquiv** | **string** | | [optional] +**availTo** | **string** | | [optional] +**freeFuel** | [**\SynergiTech\Staffology\Model\FpsCarFuel**](FpsCarFuel.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsCarFuel.md b/docs/Model/FpsCarFuel.md new file mode 100644 index 0000000..28b9055 --- /dev/null +++ b/docs/Model/FpsCarFuel.md @@ -0,0 +1,11 @@ +# # FpsCarFuel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provided** | **string** | | [optional] +**cashEquiv** | **string** | | [optional] +**withdrawn** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployee.md b/docs/Model/FpsEmployee.md new file mode 100644 index 0000000..e383fe8 --- /dev/null +++ b/docs/Model/FpsEmployee.md @@ -0,0 +1,14 @@ +# # FpsEmployee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrunEntryId** | **string** | | [optional] +**employeeUniqueId** | **string** | | [optional] +**item** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**employeeDetails** | [**\SynergiTech\Staffology\Model\FpsEmployeeDetails**](FpsEmployeeDetails.md) | | [optional] +**employment** | [**\SynergiTech\Staffology\Model\FpsEmployment**](FpsEmployment.md) | | [optional] +**validationWarnings** | [**\SynergiTech\Staffology\Model\RtiValidationWarning[]**](RtiValidationWarning.md) | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeDetails.md b/docs/Model/FpsEmployeeDetails.md new file mode 100644 index 0000000..88472c2 --- /dev/null +++ b/docs/Model/FpsEmployeeDetails.md @@ -0,0 +1,15 @@ +# # FpsEmployeeDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nino** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] +**address** | [**\SynergiTech\Staffology\Model\RtiEmployeeAddress**](RtiEmployeeAddress.md) | | [optional] +**birthDate** | **string** | | [optional] +**gender** | **string** | | [optional] +**passportNumber** | **string** | | [optional] +**partnerDetails** | [**\SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails**](FpsEmployeeDetailsPartnerDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeDetailsPartnerDetails.md b/docs/Model/FpsEmployeeDetailsPartnerDetails.md new file mode 100644 index 0000000..8beaa61 --- /dev/null +++ b/docs/Model/FpsEmployeeDetailsPartnerDetails.md @@ -0,0 +1,10 @@ +# # FpsEmployeeDetailsPartnerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nino** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeFigsToDate.md b/docs/Model/FpsEmployeeFigsToDate.md new file mode 100644 index 0000000..28c1657 --- /dev/null +++ b/docs/Model/FpsEmployeeFigsToDate.md @@ -0,0 +1,38 @@ +# # FpsEmployeeFigsToDate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxablePay** | **string** | | [optional] +**totalTax** | **string** | | [optional] +**studentLoansTD** | **string** | | [optional] +**postgradLoansTD** | **string** | | [optional] +**benefitsTaxedViaPayrollYTD** | **string** | | [optional] +**empeePenContribnsPaidYTD** | **string** | | [optional] +**empeePenContribnsNotPaidYTD** | **string** | | [optional] +**smpytd** | **string** | | [optional] +**sppytd** | **string** | | [optional] +**sapytd** | **string** | | [optional] +**shppytd** | **string** | | [optional] +**spbpytd** | **string** | | [optional] +**sspytd** | **string** | | [optional] +**gross** | **string** | | [optional] +**netPay** | **string** | | [optional] +**additions** | **string** | | [optional] +**deductions** | **string** | | [optional] +**takeHomePay** | **string** | | [optional] +**adjustments** | **string** | | [optional] +**mapsMiles** | **string** | | [optional] +**foreignTaxAmount** | **string** | | [optional] +**foreignTaxAmountReclaimed** | **string** | | [optional] +**pensionableEarnings** | **string** | | [optional] +**pensionablePay** | **string** | | [optional] +**employerPensionContribution** | **string** | | [optional] +**employeePensionContribution** | **string** | | [optional] +**employeePensionContributionAvc** | **string** | | [optional] +**paymentAfterLeaving** | **string** | | [optional] +**taxOnPaymentAfterLeaving** | **string** | | [optional] +**nonTaxOrNICPmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeFlexibleDrawdown.md b/docs/Model/FpsEmployeeFlexibleDrawdown.md new file mode 100644 index 0000000..a628fb7 --- /dev/null +++ b/docs/Model/FpsEmployeeFlexibleDrawdown.md @@ -0,0 +1,13 @@ +# # FpsEmployeeFlexibleDrawdown + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**flexiblyAccessingPensionRights** | **string** | | [optional] +**pensionDeathBenefit** | **string** | | [optional] +**seriousIllHealthLumpSum** | **string** | | [optional] +**taxablePayment** | **string** | | [optional] +**nontaxablePayment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeNIlettersAndValues.md b/docs/Model/FpsEmployeeNIlettersAndValues.md new file mode 100644 index 0000000..d3a2ee9 --- /dev/null +++ b/docs/Model/FpsEmployeeNIlettersAndValues.md @@ -0,0 +1,18 @@ +# # FpsEmployeeNIlettersAndValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nIletter** | **string** | | [optional] +**grossEarningsForNICsInPd** | **string** | | [optional] +**grossEarningsForNICsYTD** | **string** | | [optional] +**atLELYTD** | **string** | | [optional] +**leLtoPTYTD** | **string** | | [optional] +**pTtoUELYTD** | **string** | | [optional] +**totalEmpNICInPd** | **string** | | [optional] +**totalEmpNICYTD** | **string** | | [optional] +**empeeContribnsInPd** | **string** | | [optional] +**empeeContribnsYTD** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeePayment.md b/docs/Model/FpsEmployeePayment.md new file mode 100644 index 0000000..a3ab286 --- /dev/null +++ b/docs/Model/FpsEmployeePayment.md @@ -0,0 +1,41 @@ +# # FpsEmployeePayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bacsHashCode** | **string** | | [optional] +**payFreq** | **string** | | [optional] +**pmtDate** | **string** | | [optional] +**lateReason** | **string** | | [optional] +**weekNo** | **string** | | [optional] +**monthNo** | **string** | | [optional] +**periodsCovered** | **int** | | [optional] +**aggregatedEarnings** | **string** | | [optional] +**pmtAfterLeaving** | **string** | | [optional] +**hoursWorked** | **string** | | [optional] +**taxCode** | [**\SynergiTech\Staffology\Model\FpsEmployeeTaxCode**](FpsEmployeeTaxCode.md) | | [optional] +**taxablePay** | **string** | | [optional] +**nonTaxOrNICPmt** | **string** | | [optional] +**dednsFromNetPay** | **string** | | [optional] +**payAfterStatDedns** | **string** | | [optional] +**benefitsTaxedViaPayroll** | **string** | | [optional] +**class1ANICsYTD** | **string** | | [optional] +**benefits** | [**\SynergiTech\Staffology\Model\FpsBenefit**](FpsBenefit.md) | | [optional] +**empeePenContribnsPaid** | **string** | | [optional] +**itemsSubjectToClass1NIC** | **string** | | [optional] +**empeePenContribnsNotPaid** | **string** | | [optional] +**studentLoanRecovered** | [**\SynergiTech\Staffology\Model\StudentLoanRecovered**](StudentLoanRecovered.md) | | [optional] +**postgradLoanRecovered** | **string** | | [optional] +**taxDeductedOrRefunded** | **string** | | [optional] +**onStrike** | **string** | | [optional] +**unpaidAbsence** | **string** | | [optional] +**smpytd** | **string** | | [optional] +**sppytd** | **string** | | [optional] +**sapytd** | **string** | | [optional] +**shPPYTD** | **string** | | [optional] +**spbpytd** | **string** | | [optional] +**trivialCommutationPayment** | [**\SynergiTech\Staffology\Model\FpsEmployeeTrivialCommutationPayment[]**](FpsEmployeeTrivialCommutationPayment.md) | | [optional] +**flexibleDrawdown** | [**\SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown**](FpsEmployeeFlexibleDrawdown.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeSeconded.md b/docs/Model/FpsEmployeeSeconded.md new file mode 100644 index 0000000..4687516 --- /dev/null +++ b/docs/Model/FpsEmployeeSeconded.md @@ -0,0 +1,13 @@ +# # FpsEmployeeSeconded + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inOutUK** | **string** | | [optional] +**stay183DaysOrMore** | **string** | | [optional] +**stayLessThan183Days** | **string** | | [optional] +**eeaCitizen** | **string** | | [optional] +**epM6** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeStarter.md b/docs/Model/FpsEmployeeStarter.md new file mode 100644 index 0000000..d05efde --- /dev/null +++ b/docs/Model/FpsEmployeeStarter.md @@ -0,0 +1,14 @@ +# # FpsEmployeeStarter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startDate** | **string** | | [optional] +**startDec** | **string** | | [optional] +**studentLoan** | **string** | | [optional] +**postgradLoan** | **string** | | [optional] +**occPension** | [**\SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension**](FpsEmployeeStarterOccPension.md) | | [optional] +**seconded** | [**\SynergiTech\Staffology\Model\FpsEmployeeSeconded**](FpsEmployeeSeconded.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeStarterOccPension.md b/docs/Model/FpsEmployeeStarterOccPension.md new file mode 100644 index 0000000..09b78c6 --- /dev/null +++ b/docs/Model/FpsEmployeeStarterOccPension.md @@ -0,0 +1,10 @@ +# # FpsEmployeeStarterOccPension + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bereaved** | **string** | | [optional] +**amount** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeTaxCode.md b/docs/Model/FpsEmployeeTaxCode.md new file mode 100644 index 0000000..d0f7399 --- /dev/null +++ b/docs/Model/FpsEmployeeTaxCode.md @@ -0,0 +1,11 @@ +# # FpsEmployeeTaxCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basisNonCumulative** | **string** | | [optional] +**taxRegime** | **string** | | [optional] +**taxCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployeeTrivialCommutationPayment.md b/docs/Model/FpsEmployeeTrivialCommutationPayment.md new file mode 100644 index 0000000..f4e4e63 --- /dev/null +++ b/docs/Model/FpsEmployeeTrivialCommutationPayment.md @@ -0,0 +1,10 @@ +# # FpsEmployeeTrivialCommutationPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployerPayIdChanged.md b/docs/Model/FpsEmployerPayIdChanged.md new file mode 100644 index 0000000..74fcc8e --- /dev/null +++ b/docs/Model/FpsEmployerPayIdChanged.md @@ -0,0 +1,10 @@ +# # FpsEmployerPayIdChanged + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollIdChangedIndicator** | **string** | | [optional] +**oldPayrollId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsEmployment.md b/docs/Model/FpsEmployment.md new file mode 100644 index 0000000..2aa4252 --- /dev/null +++ b/docs/Model/FpsEmployment.md @@ -0,0 +1,22 @@ +# # FpsEmployment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeCurrentNiLetter** | **string** | | [optional] +**offPayrollWorker** | **string** | | [optional] +**occPenInd** | **string** | | [optional] +**directorsNIC** | **string** | | [optional] +**taxWkOfApptOfDirector** | **string** | | [optional] +**starter** | [**\SynergiTech\Staffology\Model\FpsEmployeeStarter**](FpsEmployeeStarter.md) | | [optional] +**payId** | **string** | | [optional] +**payIdChgd** | [**\SynergiTech\Staffology\Model\FpsEmployerPayIdChanged**](FpsEmployerPayIdChanged.md) | | [optional] +**paymentToANonIndividual** | **string** | | [optional] +**irrEmp** | **string** | | [optional] +**leavingDate** | **string** | | [optional] +**figuresToDate** | [**\SynergiTech\Staffology\Model\FpsEmployeeFigsToDate**](FpsEmployeeFigsToDate.md) | | [optional] +**payment** | [**\SynergiTech\Staffology\Model\FpsEmployeePayment**](FpsEmployeePayment.md) | | [optional] +**nIlettersAndValues** | [**\SynergiTech\Staffology\Model\FpsEmployeeNIlettersAndValues[]**](FpsEmployeeNIlettersAndValues.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsFields.md b/docs/Model/FpsFields.md new file mode 100644 index 0000000..79462fc --- /dev/null +++ b/docs/Model/FpsFields.md @@ -0,0 +1,13 @@ +# # FpsFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**offPayrollWorker** | **bool** | | [optional] +**irregularPaymentPattern** | **bool** | True if employee is currently on an irregular payment patter | [optional] +**nonIndividual** | **bool** | True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative) | [optional] +**hoursNormallyWorked** | [**\SynergiTech\Staffology\Model\HoursNormallyWorked**](HoursNormallyWorked.md) | | [optional] +**excludeFromRtiSubmissions** | **bool** | True if Employee is excluded from RTI submissions | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsLateReason.md b/docs/Model/FpsLateReason.md new file mode 100644 index 0000000..3466201 --- /dev/null +++ b/docs/Model/FpsLateReason.md @@ -0,0 +1,8 @@ +# # FpsLateReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsPriorVersion.md b/docs/Model/FpsPriorVersion.md new file mode 100644 index 0000000..cf0e7a9 --- /dev/null +++ b/docs/Model/FpsPriorVersion.md @@ -0,0 +1,10 @@ +# # FpsPriorVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payRunEntryId** | **string** | | [optional] +**fpsId** | **string** | The Id of the FPS that contains an earlier version of the PayRunEntry | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FpsReportResponse.md b/docs/Model/FpsReportResponse.md new file mode 100644 index 0000000..40f4a8e --- /dev/null +++ b/docs/Model/FpsReportResponse.md @@ -0,0 +1,12 @@ +# # FpsReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\Fps**](Fps.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FromToDates.md b/docs/Model/FromToDates.md new file mode 100644 index 0000000..5639dbc --- /dev/null +++ b/docs/Model/FromToDates.md @@ -0,0 +1,10 @@ +# # FromToDates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | **\DateTime** | | [optional] +**to** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullPaymentSubmission.md b/docs/Model/FullPaymentSubmission.md new file mode 100644 index 0000000..32d326d --- /dev/null +++ b/docs/Model/FullPaymentSubmission.md @@ -0,0 +1,10 @@ +# # FullPaymentSubmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\FpsEmployee[]**](FpsEmployee.md) | | [optional] +**relatedTaxYear** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullSummaryOfPayReport.md b/docs/Model/FullSummaryOfPayReport.md new file mode 100644 index 0000000..7c75aca --- /dev/null +++ b/docs/Model/FullSummaryOfPayReport.md @@ -0,0 +1,23 @@ +# # FullSummaryOfPayReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]**](FullSummaryOfPayReportLine.md) | | [optional] +**deductionLines** | [**\SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]**](FullSummaryOfPayReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullSummaryOfPayReportLine.md b/docs/Model/FullSummaryOfPayReportLine.md new file mode 100644 index 0000000..e1f283d --- /dev/null +++ b/docs/Model/FullSummaryOfPayReportLine.md @@ -0,0 +1,13 @@ +# # FullSummaryOfPayReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payCode** | [**\SynergiTech\Staffology\Model\PayCode**](PayCode.md) | | [optional] +**value** | **float** | | [optional] +**erValue** | **float** | | [optional] +**qty** | **float** | | [optional] +**headCount** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullSummaryOfPayReportReportResponse.md b/docs/Model/FullSummaryOfPayReportReportResponse.md new file mode 100644 index 0000000..6d23c8a --- /dev/null +++ b/docs/Model/FullSummaryOfPayReportReportResponse.md @@ -0,0 +1,12 @@ +# # FullSummaryOfPayReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\FullSummaryOfPayReport**](FullSummaryOfPayReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FurloughCalculationBasis.md b/docs/Model/FurloughCalculationBasis.md new file mode 100644 index 0000000..4658c26 --- /dev/null +++ b/docs/Model/FurloughCalculationBasis.md @@ -0,0 +1,8 @@ +# # FurloughCalculationBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FurloughReport.md b/docs/Model/FurloughReport.md new file mode 100644 index 0000000..e45ec70 --- /dev/null +++ b/docs/Model/FurloughReport.md @@ -0,0 +1,47 @@ +# # FurloughReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxClaimPerEmployee** | **float** | | [optional] +**percentageOfNIAndPensionToClaim** | **float** | | [optional] +**govtContribRate** | **float** | | [optional] +**companyName** | **string** | | [optional] +**employerReference** | **string** | | [optional] +**companyCrn** | **string** | | [optional] +**ctUtr** | **string** | | [optional] +**saUtr** | **string** | | [optional] +**claimPeriodStartDate** | **\DateTime** | | [optional] [readonly] +**claimPeriodEndDate** | **\DateTime** | | [optional] [readonly] +**numberOfEmployeesBeingFurloughed** | **int** | | [optional] +**totalClaimAmount** | **float** | | [optional] [readonly] +**totalGrossPay** | **float** | | [optional] +**amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod** | **float** | | [optional] +**amountClaimedForEmployerNICsContributionsForFurloughedEmployees** | **float** | | [optional] +**amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees** | **float** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\FurloughReportLine[]**](FurloughReportLine.md) | | [optional] +**bankAccountNumber** | **string** | | [optional] +**bankSortCode** | **string** | | [optional] +**bankAccountHoldersFirstName** | **string** | | [optional] +**bankAccountHoldersLastName** | **string** | | [optional] +**bankAccountHoldersAddress** | **string** | | [optional] +**buildingSocietyRollNumber** | **string** | | [optional] +**companyAddress** | **string** | | [optional] +**contactName** | **string** | | [optional] +**contactNumber** | **string** | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FurloughReportLine.md b/docs/Model/FurloughReportLine.md new file mode 100644 index 0000000..bfbe88a --- /dev/null +++ b/docs/Model/FurloughReportLine.md @@ -0,0 +1,25 @@ +# # FurloughReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**employeesFullName** | **string** | | [optional] +**employeesNINO** | **string** | | [optional] +**employeesPayrollReferenceNumber** | **string** | | [optional] +**furloughedDays** | **int** | | [optional] +**daysInPeriod** | **int** | | [optional] +**hoursNormallyWorked** | **float** | | [optional] +**hoursFurloughed** | **float** | | [optional] +**percentageOfFurloughedDaysWorked** | **float** | | [optional] +**grossPay** | **float** | | [optional] +**grossPayClaim** | **float** | | [optional] +**niClaim** | **float** | | [optional] +**pensionClaim** | **float** | | [optional] +**totalClaim** | **float** | | [optional] [readonly] +**furloughStart** | **\DateTime** | | [optional] +**furloughEnd** | **\DateTime** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FurloughReportReportResponse.md b/docs/Model/FurloughReportReportResponse.md new file mode 100644 index 0000000..dc5aac8 --- /dev/null +++ b/docs/Model/FurloughReportReportResponse.md @@ -0,0 +1,12 @@ +# # FurloughReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\FurloughReport**](FurloughReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Gender.md b/docs/Model/Gender.md new file mode 100644 index 0000000..b87452c --- /dev/null +++ b/docs/Model/Gender.md @@ -0,0 +1,8 @@ +# # Gender + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenderPayGapLine.md b/docs/Model/GenderPayGapLine.md new file mode 100644 index 0000000..91ccdf6 --- /dev/null +++ b/docs/Model/GenderPayGapLine.md @@ -0,0 +1,18 @@ +# # GenderPayGapLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | | [optional] +**forename** | **string** | | [optional] +**surname** | **string** | | [optional] +**gender** | [**\SynergiTech\Staffology\Model\Gender**](Gender.md) | | [optional] +**fullPay** | **string** | | [optional] +**ordinaryPay** | **float** | | [optional] +**periodBonus** | **float** | | [optional] +**bonusRbp** | **float** | | [optional] +**weeklyHours** | **float** | | [optional] +**hourlyRate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenderPayGapReport.md b/docs/Model/GenderPayGapReport.md new file mode 100644 index 0000000..72c0af5 --- /dev/null +++ b/docs/Model/GenderPayGapReport.md @@ -0,0 +1,13 @@ +# # GenderPayGapReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**genderPayGapLines** | [**\SynergiTech\Staffology\Model\GenderPayGapLine[]**](GenderPayGapLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenderPayGapReportReportResponse.md b/docs/Model/GenderPayGapReportReportResponse.md new file mode 100644 index 0000000..257c761 --- /dev/null +++ b/docs/Model/GenderPayGapReportReportResponse.md @@ -0,0 +1,12 @@ +# # GenderPayGapReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\GenderPayGapReport**](GenderPayGapReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenderPayGapSnapShotDate.md b/docs/Model/GenderPayGapSnapShotDate.md new file mode 100644 index 0000000..14b2c6d --- /dev/null +++ b/docs/Model/GenderPayGapSnapShotDate.md @@ -0,0 +1,8 @@ +# # GenderPayGapSnapShotDate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GovTalk.md b/docs/Model/GovTalk.md new file mode 100644 index 0000000..74e9782 --- /dev/null +++ b/docs/Model/GovTalk.md @@ -0,0 +1,17 @@ +# # GovTalk + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fullPaymentSubmissionNamespace** | **string** | [readonly] | [optional] +**fullPaymentSubmissionNamespaceVersion** | **string** | [readonly] | [optional] +**employerPaymentSummaryNamespace** | **string** | [readonly] | [optional] +**employerPaymentSummaryNamespaceVersion** | **string** | [readonly] | [optional] +**niNoVerificationRequestNameSpace** | **string** | [readonly] | [optional] +**cisVerificationRequestNameSpace** | **string** | [readonly] | [optional] +**cis300NameSpace** | **string** | [readonly] | [optional] +**expensesAndBenefitsNameSpace** | **string** | [readonly] | [optional] +**expensesAndBenefitsNameSpaceVersion** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GovTalkError.md b/docs/Model/GovTalkError.md new file mode 100644 index 0000000..1b3a8b0 --- /dev/null +++ b/docs/Model/GovTalkError.md @@ -0,0 +1,13 @@ +# # GovTalkError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**raisedBy** | **string** | | [optional] +**number** | **string** | | [optional] +**type** | **string** | | [optional] +**text** | **string** | | [optional] +**location** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GovTalkSubmission.md b/docs/Model/GovTalkSubmission.md new file mode 100644 index 0000000..4e010d7 --- /dev/null +++ b/docs/Model/GovTalkSubmission.md @@ -0,0 +1,21 @@ +# # GovTalkSubmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rawResponse** | **string** | | [optional] +**messageClass** | **string** | | [optional] +**pollInterval** | **int** | | [optional] +**lastPoll** | **\DateTime** | | [optional] +**correlationId** | **string** | | [optional] +**url** | **string** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\SubmissionStatus**](SubmissionStatus.md) | | [optional] +**message** | **string** | | [optional] +**iRmark** | **string** | | [optional] +**errorsJson** | **string** | | [optional] +**errors** | [**\SynergiTech\Staffology\Model\GovTalkError[]**](GovTalkError.md) | | [optional] +**submittedAt** | **\DateTime** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GrossToNetReport.md b/docs/Model/GrossToNetReport.md new file mode 100644 index 0000000..d107033 --- /dev/null +++ b/docs/Model/GrossToNetReport.md @@ -0,0 +1,24 @@ +# # GrossToNetReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**forCis** | **bool** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\GrossToNetReportLine[]**](GrossToNetReportLine.md) | | [optional] +**cisLines** | [**\SynergiTech\Staffology\Model\GrossToNetReportCisLine[]**](GrossToNetReportCisLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GrossToNetReportCisLine.md b/docs/Model/GrossToNetReportCisLine.md new file mode 100644 index 0000000..b331408 --- /dev/null +++ b/docs/Model/GrossToNetReportCisLine.md @@ -0,0 +1,20 @@ +# # GrossToNetReportCisLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] +**totalGross** | **float** | | [optional] +**labour** | **float** | | [optional] +**materials** | **float** | | [optional] +**taxableGross** | **float** | | [optional] +**cisDeduction** | **float** | | [optional] +**umbrellaFee** | **float** | | [optional] +**vat** | **float** | | [optional] +**payment** | **float** | | [optional] +**lastName** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GrossToNetReportLine.md b/docs/Model/GrossToNetReportLine.md new file mode 100644 index 0000000..cc74d5b --- /dev/null +++ b/docs/Model/GrossToNetReportLine.md @@ -0,0 +1,27 @@ +# # GrossToNetReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**niNumber** | **string** | | [optional] +**totalGross** | **float** | | [optional] +**taxableGross** | **float** | | [optional] +**netPay** | **float** | | [optional] +**tax** | **float** | | [optional] +**employeeNi** | **float** | | [optional] +**employerNi** | **float** | | [optional] +**employeePension** | **float** | | [optional] +**employerPension** | **float** | | [optional] +**studentOrPgLoan** | **float** | | [optional] +**statutoryPayments** | **float** | | [optional] +**attachments** | **float** | | [optional] +**otherDeductions** | **float** | | [optional] +**lastName** | **string** | | [optional] +**isNewStarter** | **bool** | | [optional] +**isLeaver** | **bool** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GrossToNetReportReportResponse.md b/docs/Model/GrossToNetReportReportResponse.md new file mode 100644 index 0000000..0b64113 --- /dev/null +++ b/docs/Model/GrossToNetReportReportResponse.md @@ -0,0 +1,12 @@ +# # GrossToNetReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\GrossToNetReport**](GrossToNetReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HmrcDetails.md b/docs/Model/HmrcDetails.md new file mode 100644 index 0000000..cb3aee6 --- /dev/null +++ b/docs/Model/HmrcDetails.md @@ -0,0 +1,25 @@ +# # HmrcDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**officeNumber** | **string** | | [optional] +**payeReference** | **string** | | [optional] +**accountsOfficeReference** | **string** | | [optional] +**econ** | **string** | | [optional] +**utr** | **string** | | [optional] +**coTax** | **string** | | [optional] +**employmentAllowance** | **bool** | | [optional] +**employmentAllowanceMaxClaim** | **float** | You might reduce this from the default if you've made/are making a claim in another system | [optional] +**smallEmployersRelief** | **bool** | | [optional] +**apprenticeshipLevy** | **bool** | | [optional] +**apprenticeshipLevyAllowance** | **float** | | [optional] +**quarterlyPaymentSchedule** | **bool** | Set to true if the employer pays HMRC on a quarterly schedule. A value of false implies a monthly schedule. <b>Warning:</b> Changing this value after starting PayRuns will delete any existing payments or adjustments you may have entered. | [optional] +**includeEmploymentAllowanceOnMonthlyJournal** | **bool** | If the employer is not on a QuarterlyPaymentSchedule and is claiming EmploymentAllowance, then set this to true to include a line for Employment Allowance on the journal for the monthly schedule. | [optional] +**carryForwardUnpaidLiabilities** | **bool** | If set to true then any unpaid amounts from previous periods will be brought forward to work out the liability for the current period. You'd set this to false if you don't want to track payments. | [optional] +**paymentDateRule** | [**\SynergiTech\Staffology\Model\PaymentDateRule**](PaymentDateRule.md) | | [optional] +**paymentDateDayOfMonth** | **int** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HmrcLiability.md b/docs/Model/HmrcLiability.md new file mode 100644 index 0000000..68a7af8 --- /dev/null +++ b/docs/Model/HmrcLiability.md @@ -0,0 +1,52 @@ +# # HmrcLiability + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | [readonly] A descriptive name for the Period | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**periodEnding** | **\DateTime** | [readonly] | [optional] +**periodComplete** | **bool** | [readonly] Indicates whether or not all PayRuns for this period have been completed | [optional] +**recoverableAmountsEpsCreated** | **bool** | [readonly] If there are recoverable amount present (ie, SMP) and the Period is complete then this field Indicates whether or not an EPS has been created up to the final tax month of this period to declare the recoverable amounts | [optional] +**apprenticeshipLevyEpsCreated** | **bool** | [readonly] If there is an Apprenticeship LEvy amount present and the Period is complete then this field Indicates whether or not an EPS has been created up to the final tax month of this period to declare the amount | [optional] +**payRuns** | [**\SynergiTech\Staffology\Model\PayRun[]**](PayRun.md) | | [optional] +**tax** | **float** | [readonly] Amount due to HMRC for PAYE in period | [optional] +**cisDeductions** | **float** | [readonly] Amount due to HMRC for CIS Deductions made in period | [optional] +**postgradLoanDeductions** | **float** | [readonly] Amount due to HMRC for Postgrad Loan Deductions made in period | [optional] +**studentLoanDeductions** | **float** | [readonly] Amount due to HMRC for Student Loan Deductions made in period | [optional] +**employeeNic** | **float** | [readonly] Amount due to HMRC for Employee NIC Contributions withheld in period | [optional] +**employerNic** | **float** | [readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period | [optional] +**realTimeClass1ANic** | **float** | [readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period | [optional] +**smp** | **float** | [readonly] SMP recovered from payments in period | [optional] +**smpNic** | **float** | [readonly] SMP NIC Compensation for period | [optional] +**spp** | **float** | [readonly] SPP recovered from payments in period | [optional] +**sppNic** | **float** | [readonly] SPP Nic Compensation for period | [optional] +**sap** | **float** | [readonly] SAP recovered from payments in period | [optional] +**sapNic** | **float** | [readonly] SAP Nic Compensation for period | [optional] +**shpp** | **float** | [readonly] ShPP recovered from payments in period | [optional] +**shppNic** | **float** | [readonly] ShPP Nic Compensation for period | [optional] +**spbp** | **float** | [readonly] SPBP recovered from payments in period | [optional] +**spbpNic** | **float** | [readonly] SPBP Nic Compensation for period | [optional] +**eligibleForEmploymentAllowance** | **bool** | [readonly] Indicates whether the Employer settings say the Employer is eligible for Employment Allowance | [optional] +**employmentAllowanceClaim** | **float** | Amount to claim with respect to the Employment Allowance | [optional] +**employmentAllowanceClaimAuto** | **bool** | If set to true, we'll automatically claim the maximum allowed. If set to false then you can enter your own value. If EligibleForEmploymentAllowance is false then the EmploymentAllowanceClaim will always be overwritten with a zero value regardless of this property | [optional] +**liableForApprenticeshipLevy** | **bool** | [readonly] Indicates whether the Employer settings say the Employer is liable for the Apprenticeship Levy | [optional] +**apprenticeshipLevy** | **float** | Amount due with respect to the Apprenticeship Levy | [optional] +**apprenticeshipLevyAuto** | **bool** | If set to true, we'll automatically calculate your liability If set to false then you can enter your own value. If LiableForApprenticeshipLevy is false then the ApprenticeshipLevy will always be overwritten with a zero value regardless of this property | [optional] +**liabilityArisingInPeriod** | **float** | [readonly] Total Liability (before any deductions) arising in this Period | [optional] [readonly] +**dueInPreviousPeriods** | **float** | [readonly] Amount due to HMRC in previous periods for this Tax Year | [optional] +**paidInPreviousPeriods** | **float** | [readonly] Amount paid to HMRC in previous periods for this Tax Year | [optional] +**employmentAllowanceClaimInPreviousPeriods** | **float** | [readonly] The amount of Employment Allowance claimed in previous periods for this Tax Year | [optional] +**receivedFromHMRCToRefundTax** | **float** | Any amount received from HMRC to refund Tax in Period | [optional] +**receivedFromHMRCToPayStatutoryPay** | **float** | Any amount received from HMRC to pay Statutory Pay Period | [optional] +**cisDeductionsSuffered** | **float** | CIS Deductions Suffered in Period | [optional] +**adjustment** | **float** | Any manual adjustment for Period | [optional] +**netLiabilityForPeriod** | **float** | [readonly] Net Liability (including any deductions/additions) arising in this Period | [optional] [readonly] +**totalPaid** | **float** | [readonly] The total value of all payments in this period | [optional] +**payments** | [**\SynergiTech\Staffology\Model\HmrcPayment[]**](HmrcPayment.md) | | [optional] +**fpsList** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | | [optional] +**allowLinkedEps** | **bool** | If true this will allow you to submit a combined Employer Payment Summary | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HmrcPayment.md b/docs/Model/HmrcPayment.md new file mode 100644 index 0000000..f84536a --- /dev/null +++ b/docs/Model/HmrcPayment.md @@ -0,0 +1,11 @@ +# # HmrcPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [optional] +**date** | **\DateTime** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayAccrual.md b/docs/Model/HolidayAccrual.md new file mode 100644 index 0000000..0d54bb7 --- /dev/null +++ b/docs/Model/HolidayAccrual.md @@ -0,0 +1,8 @@ +# # HolidayAccrual + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayAccrualDefaultRateType.md b/docs/Model/HolidayAccrualDefaultRateType.md new file mode 100644 index 0000000..5de9696 --- /dev/null +++ b/docs/Model/HolidayAccrualDefaultRateType.md @@ -0,0 +1,8 @@ +# # HolidayAccrualDefaultRateType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayReport.md b/docs/Model/HolidayReport.md new file mode 100644 index 0000000..7e043e7 --- /dev/null +++ b/docs/Model/HolidayReport.md @@ -0,0 +1,16 @@ +# # HolidayReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accrualsReport** | **bool** | | [optional] +**accrualsHrsReport** | **bool** | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\HolidayReportLine[]**](HolidayReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayReportLine.md b/docs/Model/HolidayReportLine.md new file mode 100644 index 0000000..2768fd9 --- /dev/null +++ b/docs/Model/HolidayReportLine.md @@ -0,0 +1,13 @@ +# # HolidayReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] +**dayRate** | **float** | | [optional] +**leaveSettings** | [**\SynergiTech\Staffology\Model\LeaveSettings**](LeaveSettings.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayReportReportResponse.md b/docs/Model/HolidayReportReportResponse.md new file mode 100644 index 0000000..d3d3a54 --- /dev/null +++ b/docs/Model/HolidayReportReportResponse.md @@ -0,0 +1,12 @@ +# # HolidayReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\HolidayReport**](HolidayReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidaySchemeDurationType.md b/docs/Model/HolidaySchemeDurationType.md new file mode 100644 index 0000000..9a0c319 --- /dev/null +++ b/docs/Model/HolidaySchemeDurationType.md @@ -0,0 +1,8 @@ +# # HolidaySchemeDurationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HolidayType.md b/docs/Model/HolidayType.md new file mode 100644 index 0000000..a4742a5 --- /dev/null +++ b/docs/Model/HolidayType.md @@ -0,0 +1,8 @@ +# # HolidayType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HourlyPayReport.md b/docs/Model/HourlyPayReport.md new file mode 100644 index 0000000..9c364fd --- /dev/null +++ b/docs/Model/HourlyPayReport.md @@ -0,0 +1,22 @@ +# # HourlyPayReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\HourlyPayReportLine[]**](HourlyPayReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HourlyPayReportLine.md b/docs/Model/HourlyPayReportLine.md new file mode 100644 index 0000000..47b2873 --- /dev/null +++ b/docs/Model/HourlyPayReportLine.md @@ -0,0 +1,15 @@ +# # HourlyPayReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**payCode** | **string** | | [optional] +**period** | **int** | | [optional] +**hours** | **float** | | [optional] +**rate** | **float** | | [optional] +**total** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HourlyPayReportReportResponse.md b/docs/Model/HourlyPayReportReportResponse.md new file mode 100644 index 0000000..4fcdf34 --- /dev/null +++ b/docs/Model/HourlyPayReportReportResponse.md @@ -0,0 +1,12 @@ +# # HourlyPayReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\HourlyPayReport**](HourlyPayReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HoursNormallyWorked.md b/docs/Model/HoursNormallyWorked.md new file mode 100644 index 0000000..4a74c6d --- /dev/null +++ b/docs/Model/HoursNormallyWorked.md @@ -0,0 +1,8 @@ +# # HoursNormallyWorked + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HtmlEmailSettings.md b/docs/Model/HtmlEmailSettings.md new file mode 100644 index 0000000..c37f64b --- /dev/null +++ b/docs/Model/HtmlEmailSettings.md @@ -0,0 +1,13 @@ +# # HtmlEmailSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bodyCssStyle** | **string** | | [optional] +**fontCssStyle** | **string** | | [optional] +**buttonCssStyle** | **string** | | [optional] +**headerHtml** | **string** | | [optional] +**footerHtml** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HtmlInsertionPoint.md b/docs/Model/HtmlInsertionPoint.md new file mode 100644 index 0000000..a7bf5c1 --- /dev/null +++ b/docs/Model/HtmlInsertionPoint.md @@ -0,0 +1,8 @@ +# # HtmlInsertionPoint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IncrementRule.md b/docs/Model/IncrementRule.md new file mode 100644 index 0000000..dc14abd --- /dev/null +++ b/docs/Model/IncrementRule.md @@ -0,0 +1,8 @@ +# # IncrementRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Invitation.md b/docs/Model/Invitation.md new file mode 100644 index 0000000..edb318d --- /dev/null +++ b/docs/Model/Invitation.md @@ -0,0 +1,16 @@ +# # Invitation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**emailAddress** | **string** | The email address of the user that is being invited to access the Employer | +**message** | **string** | An optional message to include in the email sent to the EmailAddress | [optional] +**role** | [**\SynergiTech\Staffology\Model\UserRole**](UserRole.md) | | [optional] +**emailId** | **string** | | [optional] +**emailStatus** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**invitedBy** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Item.md b/docs/Model/Item.md new file mode 100644 index 0000000..82c611a --- /dev/null +++ b/docs/Model/Item.md @@ -0,0 +1,12 @@ +# # Item + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ItemListReportResponse.md b/docs/Model/ItemListReportResponse.md new file mode 100644 index 0000000..ecdf524 --- /dev/null +++ b/docs/Model/ItemListReportResponse.md @@ -0,0 +1,12 @@ +# # ItemListReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JobStatus.md b/docs/Model/JobStatus.md new file mode 100644 index 0000000..699aefa --- /dev/null +++ b/docs/Model/JobStatus.md @@ -0,0 +1,8 @@ +# # JobStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JobType.md b/docs/Model/JobType.md new file mode 100644 index 0000000..96a9b52 --- /dev/null +++ b/docs/Model/JobType.md @@ -0,0 +1,8 @@ +# # JobType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JournalCsvFormat.md b/docs/Model/JournalCsvFormat.md new file mode 100644 index 0000000..ccf87ce --- /dev/null +++ b/docs/Model/JournalCsvFormat.md @@ -0,0 +1,8 @@ +# # JournalCsvFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JournalTemplate.md b/docs/Model/JournalTemplate.md new file mode 100644 index 0000000..89afb8f --- /dev/null +++ b/docs/Model/JournalTemplate.md @@ -0,0 +1,12 @@ +# # JournalTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**header** | **string** | Header of Journal Template | [optional] +**content** | **string** | Content of Journal Template | [optional] +**useColumnHeaders** | **bool** | Use Column Headers indicates whether to use column headers while parsing the content in CSV format | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JournalTokenType.md b/docs/Model/JournalTokenType.md new file mode 100644 index 0000000..4eb2115 --- /dev/null +++ b/docs/Model/JournalTokenType.md @@ -0,0 +1,8 @@ +# # JournalTokenType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Leave.md b/docs/Model/Leave.md new file mode 100644 index 0000000..bbc131b --- /dev/null +++ b/docs/Model/Leave.md @@ -0,0 +1,54 @@ +# # Leave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](ExternalDataProviderId.md) | | [optional] +**externalId** | **string** | If the Leave comes from an ExternalDataProvider, then this is its Id in the ExternalDataProvider | [optional] +**type** | [**\SynergiTech\Staffology\Model\LeaveType**](LeaveType.md) | | [optional] +**pay** | [**\SynergiTech\Staffology\Model\LeavePayType**](LeavePayType.md) | | [optional] +**payFrequency** | [**\SynergiTech\Staffology\Model\StatPayFrequency**](StatPayFrequency.md) | | [optional] +**payRunExistsWithStatPay** | **bool** | | [optional] +**from** | **\DateTime** | The first day of Leave. If it's a half day PM then set the time portion to 12:00:00, otherwise leave it blank or set it to 00:00:00 | [optional] +**to** | **\DateTime** | The last day of Leave. If it's a half day AM then set the time portion to 11:59:59, otherwise set it to 23:59:59 | [optional] +**notes** | **string** | A free-form text field to record any comments | [optional] +**averageWeeklyEarnings** | **float** | The employees average weekly earnings. Only relevant for Statutory Pay It's advised that you don't try to calculate this yourself. | [optional] +**automaticAWECalculation** | **bool** | If set to True then we'll automatically calculate the AverageWeeklyEarnings. Set it to false if you want to manually provide a figure that overrides our calculations | [optional] +**babyDate** | **\DateTime** | Only required for Parental Leave with Statutory Pay If Type is Maternity or Paternity then this is the date the baby is due. For Adoption this is the Matching Date. | [optional] +**secondaryBabyDate** | **\DateTime** | Only used for Parental Leave with Statutory Pay If Type is Maternity, Paternity, SharedParental (Birth) then this is the the Baby Born Date. For Adoption or SharedParental (Adoption) this is the Expected Placement Date. | [optional] +**tertiaryBabyDate** | **\DateTime** | Only used for Parental Leave with Statutory Pay If Type is Adoption this is the Placement Date. | [optional] +**overridePaymentDescription** | **bool** | If Pay is StatutoryPay and you want to override our description that goes with the payment then set this to true | [optional] +**overridenPaymentDescription** | **string** | If OverridePaymentDescription is true and Pay is set to StatutoryPay then we'll use this as the description for the payment amount. | [optional] +**workingDays** | **float** | [readonly] The number of working days covered by this leave. This is calculated based on the employees Working Pattern. | [optional] +**workingDaysOverride** | **float** | If a value is provided here then this will be used in place of the calculated WorkingDays value | [optional] +**totalDays** | **float** | [readonly] The number of days covered by this leave, regardless of whether or not they're working days. This is calculated based on the employees Working Pattern. | [optional] +**totalDaysOverride** | **float** | If a value is provided here then this will be used in place of the calculated TotalDays value | [optional] +**useAssumedPensionablePay** | **bool** | If this Leave has Statutory Pay then if this is set to True we will use the value set in AssumedPensionablePay to work out the employer pension contributions | [optional] +**assumedPensionablePays** | [**\SynergiTech\Staffology\Model\LeaveAssumedPensionablePay[]**](LeaveAssumedPensionablePay.md) | if UseAssumedPensionablePay is True, then this is the value used to calculate the employer pension contributions | [optional] +**offsetPay** | **bool** | If this Leave has Statutory Pay and this is set to True and the employe eis paid a fixed amoutn per period with Leave Adjustments set to automatic, then we'll reduce their pay for the period by the statutory amount so the employee still gets paid the full amount. | [optional] +**sspPayFromDayOne** | **bool** | If this is Sick Leave with Statutory Pay then setting this to true will force SSP to be paid from day one rather than the usual rule of the first Working Day after 3 Qualifying Days | [optional] +**linkedPiw** | [**\SynergiTech\Staffology\Model\LinkedPiw**](LinkedPiw.md) | | [optional] +**kitSplitDays** | **\DateTime[]** | If the LeaveType supports KIT/SPLIT days then use this property to store the list of dates | [optional] +**historicSspRequiresProcessing** | **bool** | Only used during the creation of historical SSP. When creating historical SSP, this will determine whether to pay that leave in the next PayRun. | [optional] +**historicSxpRequiresProcessing** | **bool** | Used during to determine whether to back pay before current payrun | [optional] +**openingPay** | **float** | Opening pay which has already been paid to the employee in another system | [optional] +**useOpeningPay** | **bool** | Use the OpeningPay which has already been paid in another system | [optional] +**historicOspRequiresProcessing** | **bool** | Only used during the creation of sickness Occupational Policy. When creating historical SOP, this will determine whether to pay that leave in the next PayRun. | [optional] +**historicOmpRequiresProcessing** | **bool** | Only used during the creation and update of occupational maternity leaves. When creating or updating historical occupational leaves, this will determine whether to pay the historic payments or correction in the next PayRun. | [optional] +**historicSmpRequiresProcessing** | **bool** | Only used during the creation and update of statutory maternity leaves. When creating or updating historical statutory maternity leaves, this will determine whether to pay the historic payments or correction in the next PayRun. | [optional] +**occupationalMaternityPolicyUniqueId** | **string** | Occupational Maternity Policy Id when leave type is Maternity and payment type is occupational policy | [optional] +**openingOmpPay** | **float** | Opening occupational pay which has already been paid to the employee | [optional] +**payRunExistsWithOccMaternityPay** | **bool** | Indicates whether there is occupational maternity payment associated with a leave in the current pay run. | [optional] +**calculationType** | [**\SynergiTech\Staffology\Model\LeaveCalculationType**](LeaveCalculationType.md) | | [optional] +**strikeHoursToDeduct** | **float** | The number of hours to be deducted at the employee's contractual rate This property is valid for strike deducted hours | [optional] +**customPayments** | [**\SynergiTech\Staffology\Model\LeaveCustomPayment[]**](LeaveCustomPayment.md) | If this is Sick Leave with Custom Payment, then this stores the RoleId, PercentOfPay and PaySSPInAddition for each role assigned to an employee that did not end before the start date of the absence. | [optional] +**customProRataRules** | [**\SynergiTech\Staffology\Model\LeaveCustomProRataRule[]**](LeaveCustomProRataRule.md) | If this is a Leave that supports changing the pro rata at leave level, This stores the RoleId and ProRataMethod for each role assigned to an employee that did not end before the start date of the absence. | [optional] +**lastProcessedFrom** | **\DateTime** | [readonly] Last Processed From Date If this Leave has already been processed, this will be the original leave from date | [optional] +**isReversed** | **bool** | If the reversal of this Leave has already been processed, this will be set to true | [optional] +**documentCount** | **int** | [readonly] The number of attachments associated with this model | [optional] +**documents** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The attachments associated with this model | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveAssumedPensionablePay.md b/docs/Model/LeaveAssumedPensionablePay.md new file mode 100644 index 0000000..e8fcddb --- /dev/null +++ b/docs/Model/LeaveAssumedPensionablePay.md @@ -0,0 +1,14 @@ +# # LeaveAssumedPensionablePay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roleReference** | **string** | Employee role reference | [optional] +**roleId** | **string** | Employee role unique Id | [optional] +**isPrimary** | **bool** | Boolean flag indicates if the role is primary | [optional] +**assumedPensionablePay** | **float** | Assumed Pensionable Pay (APP) is an average figure, calculated as the average pay in the 3 months (or 12 weeks if weekly/fortnightly/fourweekly paid) before the absence | [optional] +**automaticAPPCalculation** | **bool** | If set to True then we'll automatically calculate the AssumedPensionablePay. Set it to false if you want to manually provide a figure that overrides our calculations | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveCalculationType.md b/docs/Model/LeaveCalculationType.md new file mode 100644 index 0000000..2e1c85c --- /dev/null +++ b/docs/Model/LeaveCalculationType.md @@ -0,0 +1,8 @@ +# # LeaveCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveCustomPayment.md b/docs/Model/LeaveCustomPayment.md new file mode 100644 index 0000000..6ed6063 --- /dev/null +++ b/docs/Model/LeaveCustomPayment.md @@ -0,0 +1,11 @@ +# # LeaveCustomPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roleId** | **string** | | [optional] +**percentOfPay** | **float** | If this is Sick Leave with Custom Payment, the user will input the desired impact on the employee’s pay, per role. This will be via an amount between 0-100 in 'Pay for Absence'. The employees pay will be fully reduced for the absence, and the % paid will be added back using the OSP pay code. | [optional] +**paySSPInAddition** | **bool** | If this is Sick Leave with Custom Payment, If true, then reduce the OSP by the amount of SSP paid (and apportioned according to role weighting) If false, then do not reduce the OSP at all. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveCustomProRataRule.md b/docs/Model/LeaveCustomProRataRule.md new file mode 100644 index 0000000..7e5d89b --- /dev/null +++ b/docs/Model/LeaveCustomProRataRule.md @@ -0,0 +1,10 @@ +# # LeaveCustomProRataRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roleId** | **string** | | [optional] +**proRataMethod** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeavePayType.md b/docs/Model/LeavePayType.md new file mode 100644 index 0000000..9c8ff10 --- /dev/null +++ b/docs/Model/LeavePayType.md @@ -0,0 +1,8 @@ +# # LeavePayType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveProRataRule.md b/docs/Model/LeaveProRataRule.md new file mode 100644 index 0000000..6b0b282 --- /dev/null +++ b/docs/Model/LeaveProRataRule.md @@ -0,0 +1,8 @@ +# # LeaveProRataRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveSettings.md b/docs/Model/LeaveSettings.md new file mode 100644 index 0000000..3c829ba --- /dev/null +++ b/docs/Model/LeaveSettings.md @@ -0,0 +1,54 @@ +# # LeaveSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**useDefaultHolidayType** | **bool** | If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowanceResetDate** | **bool** | If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAllowance** | **bool** | If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieu** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuRate** | **bool** | If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultHolidayAccrualBasis** | **bool** | If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccruePaymentInLieuPayAutomatically** | **bool** | If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultAccrueHoursPerDay** | **bool** | If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**useDefaultMaximumAccruePeriod** | **bool** | If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**allowanceResetDate** | **\DateTime** | The date that the holiday allowance resets. Only the day/month part of the value is relevant. | [optional] +**allowance** | **float** | The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset | [optional] +**adjustment** | **float** | Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) | [optional] +**allowanceUsed** | **float** | [readonly] The number of days used from the allowance since last reset | [optional] +**allowanceUsedPreviousPeriod** | **float** | [readonly] The number of days used in the 12 months prior to the last reset | [optional] +**allowanceRemaining** | **float** | [readonly] The number of days remaining of the allowance until next reset | [optional] [readonly] +**holidayType** | [**\SynergiTech\Staffology\Model\HolidayType**](HolidayType.md) | | [optional] +**accrueSetAmount** | **bool** | If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. | [optional] +**accrueHoursPerDay** | **float** | If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued | [optional] +**showAllowanceOnPayslip** | **bool** | If true then the remaining Allowance will be shown on the employees payslip. | [optional] +**showAhpOnPayslip** | **bool** | If true then the AHP balance will be shown on the employees payslip. | [optional] +**accruePaymentInLieuRate** | **float** | The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. | [optional] +**accruePaymentInLieuAllGrossPay** | **bool** | Set to true if you want accrued holiday payments to be calculated on the total gross pay for the employee or just on the single regular pay element | [optional] +**accruePaymentInLieuPayAutomatically** | **bool** | Set to true if you want employees to be automatically paid any outstanding holiday pay | [optional] +**accruePayCodeSetUniqueId** | **string** | | [optional] +**maximumAccruePeriod** | **float** | The maximum number of hours capable of being accrued in a single period | [optional] +**holidayAccrualBasis** | [**\SynergiTech\Staffology\Model\HolidayAccrual**](HolidayAccrual.md) | | [optional] +**holidayAccrualDefaultRateType** | [**\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType**](HolidayAccrualDefaultRateType.md) | | [optional] +**occupationalSicknessUniqueId** | **string** | | [optional] +**accruedPaymentLiability** | **float** | [readonly] The total accrued payments for this employee over the lifetime of their employment so far | [optional] +**accruedPaymentAdjustment** | **float** | Any manual adjustment to the total accrued | [optional] +**accruedPaymentPaid** | **float** | [readonly] The Total amount paid to this employee in lieu of holidays | [optional] +**accruedPaymentBalance** | **float** | [readonly] The balance of what is owed to this employee in lieu of holidays | [optional] [readonly] +**accruedHoursAmount** | **float** | [readonly] The total accrued hours for this employee over the lifetime of their employment so far | [optional] +**accruedHoursAdjustment** | **float** | Any manual adjustment to the total hours accrued | [optional] +**accruedHoursPaid** | **float** | [readonly] The Total amount of hours paid to this employee in lieu of holidays | [optional] +**accruedHoursAmountLastPeriod** | **float** | [readonly] The total accrued hours for this employee in the last pay period | [optional] +**paidHoursAmountLastPeriod** | **float** | [readonly] The number of hours paid against the pay code | [optional] +**accruedHoursBalance** | **float** | [readonly] The balance of hours owed to this employee in lieu of holidays | [optional] [readonly] +**aggregatedServiceDate** | **\DateTime** | | [optional] +**useAggregatedServiceDate** | **bool** | | [optional] +**useDefaultHolidayAccrualDefaultRateType** | **bool** | If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. | [optional] +**unauthorisedLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**holidayLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**sickLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**parentalLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] +**bereavementLeaveProRataRule** | [**\SynergiTech\Staffology\Model\LeaveProRataRule**](LeaveProRataRule.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaveType.md b/docs/Model/LeaveType.md new file mode 100644 index 0000000..10de1f7 --- /dev/null +++ b/docs/Model/LeaveType.md @@ -0,0 +1,8 @@ +# # LeaveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeaverDetails.md b/docs/Model/LeaverDetails.md new file mode 100644 index 0000000..9bdaa8d --- /dev/null +++ b/docs/Model/LeaverDetails.md @@ -0,0 +1,15 @@ +# # LeaverDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasLeft** | **bool** | | [optional] +**leaveDate** | **\DateTime** | | [optional] +**isDeceased** | **bool** | | [optional] +**paymentAfterLeaving** | **bool** | | [optional] +**p45Sent** | **bool** | | [optional] +**payAccruedBalance** | **bool** | | [optional] +**paymentMethodAfterLeaving** | [**\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving**](PaymentMethodAfterLeaving.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsCivicaCasualHours.md b/docs/Model/LgpsCivicaCasualHours.md new file mode 100644 index 0000000..ddd0995 --- /dev/null +++ b/docs/Model/LgpsCivicaCasualHours.md @@ -0,0 +1,8 @@ +# # LgpsCivicaCasualHours + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsCivicaPayrollNumber.md b/docs/Model/LgpsCivicaPayrollNumber.md new file mode 100644 index 0000000..cbec927 --- /dev/null +++ b/docs/Model/LgpsCivicaPayrollNumber.md @@ -0,0 +1,8 @@ +# # LgpsCivicaPayrollNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsFund.md b/docs/Model/LgpsFund.md new file mode 100644 index 0000000..c352fb0 --- /dev/null +++ b/docs/Model/LgpsFund.md @@ -0,0 +1,8 @@ +# # LgpsFund + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsIConnectFileType.md b/docs/Model/LgpsIConnectFileType.md new file mode 100644 index 0000000..93c04ea --- /dev/null +++ b/docs/Model/LgpsIConnectFileType.md @@ -0,0 +1,8 @@ +# # LgpsIConnectFileType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsIConnectPayrollReference.md b/docs/Model/LgpsIConnectPayrollReference.md new file mode 100644 index 0000000..96c1808 --- /dev/null +++ b/docs/Model/LgpsIConnectPayrollReference.md @@ -0,0 +1,8 @@ +# # LgpsIConnectPayrollReference + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsIConnectSalaryType.md b/docs/Model/LgpsIConnectSalaryType.md new file mode 100644 index 0000000..9a31639 --- /dev/null +++ b/docs/Model/LgpsIConnectSalaryType.md @@ -0,0 +1,8 @@ +# # LgpsIConnectSalaryType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LgpsPayCategory.md b/docs/Model/LgpsPayCategory.md new file mode 100644 index 0000000..c9340b4 --- /dev/null +++ b/docs/Model/LgpsPayCategory.md @@ -0,0 +1,8 @@ +# # LgpsPayCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LinkedPiw.md b/docs/Model/LinkedPiw.md new file mode 100644 index 0000000..2de10da --- /dev/null +++ b/docs/Model/LinkedPiw.md @@ -0,0 +1,15 @@ +# # LinkedPiw + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | [**\SynergiTech\Staffology\Model\LinkedPiwResult**](LinkedPiwResult.md) | | [optional] +**id** | **string** | [readonly] The Id of the linked Leave | [optional] +**averageWeeklyEarnings** | **float** | [readonly] Average weekly earnings from linked Leave | [optional] +**workingDays** | **float** | [readonly] The number of working days in the linked Leave. | [optional] +**totalDays** | **float** | [readonly] The number of days covered by the linked Leave. | [optional] +**sspFirstPayDay** | **\DateTime** | [readonly] The SspFirstPayDay from the linked Leave, if set | [optional] +**sspFirstDay** | **\DateTime** | [readonly] The SspFirstDay from the linked Leave, if set | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LinkedPiwResult.md b/docs/Model/LinkedPiwResult.md new file mode 100644 index 0000000..1df96da --- /dev/null +++ b/docs/Model/LinkedPiwResult.md @@ -0,0 +1,8 @@ +# # LinkedPiwResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Loan.md b/docs/Model/Loan.md new file mode 100644 index 0000000..3b0df7f --- /dev/null +++ b/docs/Model/Loan.md @@ -0,0 +1,22 @@ +# # Loan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**issueDate** | **\DateTime** | The date the Loan was made | [optional] +**reference** | **string** | An optional reference for this Loan | [optional] +**payCode** | **string** | The Code of the PayCode used for recording payments. The PayCode must have a CalculationType of FixedAmount and not be a multiplier code | [optional] +**loanAmount** | **float** | The initial amount that the loan was for | [optional] +**periodAmount** | **float** | The amount to deduct per PayPeriod | [optional] +**amountRepaid** | **float** | [readonly] The amount repaid so far due to deductions in Payruns | [optional] +**previouslyPaid** | **float** | [readonly] Any amount by which to adjust the Balance, perhaps due to repayments made elsewhere | [optional] +**balance** | **float** | [readonly] The Balance of the Loan | [optional] [readonly] +**isSettled** | **bool** | [readonly] | [optional] [readonly] +**isPaused** | **bool** | If set to true then deductions will not be made | [optional] +**documentCount** | **int** | [readonly] The number of attachments associated with this model | [optional] +**documents** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The attachments associated with this model | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanBalancesReport.md b/docs/Model/LoanBalancesReport.md new file mode 100644 index 0000000..cf837bb --- /dev/null +++ b/docs/Model/LoanBalancesReport.md @@ -0,0 +1,13 @@ +# # LoanBalancesReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\LoanBalancesReportLine[]**](LoanBalancesReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanBalancesReportLine.md b/docs/Model/LoanBalancesReportLine.md new file mode 100644 index 0000000..8f48cf4 --- /dev/null +++ b/docs/Model/LoanBalancesReportLine.md @@ -0,0 +1,16 @@ +# # LoanBalancesReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeName** | **string** | | [optional] +**payrollCode** | **string** | | [optional] +**issueDate** | **\DateTime** | | [optional] +**reference** | **string** | | [optional] +**payCode** | **string** | | [optional] +**loanAmount** | **float** | | [optional] +**paidAmount** | **float** | | [optional] +**outstandingBalance** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanBalancesReportReportResponse.md b/docs/Model/LoanBalancesReportReportResponse.md new file mode 100644 index 0000000..59add04 --- /dev/null +++ b/docs/Model/LoanBalancesReportReportResponse.md @@ -0,0 +1,12 @@ +# # LoanBalancesReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\LoanBalancesReport**](LoanBalancesReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoanCharge.md b/docs/Model/LoanCharge.md new file mode 100644 index 0000000..e9c447d --- /dev/null +++ b/docs/Model/LoanCharge.md @@ -0,0 +1,10 @@ +# # LoanCharge + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**threshhold** | **float** | | [optional] +**officialInterestRate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LogEntry.md b/docs/Model/LogEntry.md new file mode 100644 index 0000000..b020a4b --- /dev/null +++ b/docs/Model/LogEntry.md @@ -0,0 +1,10 @@ +# # LogEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LondonAllowance.md b/docs/Model/LondonAllowance.md new file mode 100644 index 0000000..1be0e97 --- /dev/null +++ b/docs/Model/LondonAllowance.md @@ -0,0 +1,13 @@ +# # LondonAllowance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\LondonAllowanceType**](LondonAllowanceType.md) | | [optional] +**valueType** | [**\SynergiTech\Staffology\Model\LondonAllowanceValueType**](LondonAllowanceValueType.md) | | [optional] +**value** | **float** | Value of London Allowance | [optional] +**paySpineId** | **int** | foreign key with pay spine table | +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LondonAllowanceType.md b/docs/Model/LondonAllowanceType.md new file mode 100644 index 0000000..5a52554 --- /dev/null +++ b/docs/Model/LondonAllowanceType.md @@ -0,0 +1,8 @@ +# # LondonAllowanceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LondonAllowanceValueType.md b/docs/Model/LondonAllowanceValueType.md new file mode 100644 index 0000000..4cad046 --- /dev/null +++ b/docs/Model/LondonAllowanceValueType.md @@ -0,0 +1,8 @@ +# # LondonAllowanceValueType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailSettings.md b/docs/Model/MailSettings.md new file mode 100644 index 0000000..1be7fa0 --- /dev/null +++ b/docs/Model/MailSettings.md @@ -0,0 +1,17 @@ +# # MailSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**senderName** | **string** | | +**senderEmail** | **string** | | +**useSystemFromAddress** | **bool** | If set to true then the SenderEmail provided will only be used in the ReplyTo fields. The system defaults will be used for the From address. | [optional] +**senderEmailVerified** | **bool** | [readonly] The SenderEmail must be verified before you can send email using that address | [optional] +**customiseSmtpSettings** | **bool** | | +**smtpSettings** | [**\SynergiTech\Staffology\Model\SmtpSettings**](SmtpSettings.md) | | [optional] +**customiseHtmlEmailSettings** | **bool** | | +**htmlEmailSettings** | [**\SynergiTech\Staffology\Model\HtmlEmailSettings**](HtmlEmailSettings.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MaritalStatus.md b/docs/Model/MaritalStatus.md new file mode 100644 index 0000000..652b4b6 --- /dev/null +++ b/docs/Model/MaritalStatus.md @@ -0,0 +1,8 @@ +# # MaritalStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/McrPayCategory.md b/docs/Model/McrPayCategory.md new file mode 100644 index 0000000..6320d04 --- /dev/null +++ b/docs/Model/McrPayCategory.md @@ -0,0 +1,8 @@ +# # McrPayCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MileageAllowancePaymentsRate.md b/docs/Model/MileageAllowancePaymentsRate.md new file mode 100644 index 0000000..2dd77eb --- /dev/null +++ b/docs/Model/MileageAllowancePaymentsRate.md @@ -0,0 +1,12 @@ +# # MileageAllowancePaymentsRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**rate** | **float** | | [optional] +**threshold** | **int** | | [optional] +**aboveThresholdRate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MileageVehicleType.md b/docs/Model/MileageVehicleType.md new file mode 100644 index 0000000..884ba96 --- /dev/null +++ b/docs/Model/MileageVehicleType.md @@ -0,0 +1,8 @@ +# # MileageVehicleType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MonthlyMinimum.md b/docs/Model/MonthlyMinimum.md new file mode 100644 index 0000000..8839ad8 --- /dev/null +++ b/docs/Model/MonthlyMinimum.md @@ -0,0 +1,13 @@ +# # MonthlyMinimum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [optional] +**amount** | **float** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**billPastEndDate** | **bool** | If set to true then this user should still be billed even after the End Date | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NationalInsuranceCalculation.md b/docs/Model/NationalInsuranceCalculation.md new file mode 100644 index 0000000..ec33892 --- /dev/null +++ b/docs/Model/NationalInsuranceCalculation.md @@ -0,0 +1,27 @@ +# # NationalInsuranceCalculation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breakdown** | [**\SynergiTech\Staffology\Model\NationalInsuranceCalculationBase[]**](NationalInsuranceCalculationBase.md) | [readonly] List of calculations that make up this calculation | [optional] +**niCategory** | **string** | Calculated on NI table letter | [optional] +**asDirector** | **bool** | Calculated as a Director | [optional] +**earningsUptoIncludingLEL** | **float** | Earnings up to and including LEL | [optional] +**earningsAboveLELUptoIncludingPT** | **float** | Earnings above LEL up to PT | [optional] +**earningsAbovePTUptoIncludingST** | **float** | Earnings above PT up to ST | [optional] +**earningsAbovePTUptoIncludingUEL** | **float** | Earnings above PT up to UEL | [optional] +**earningsAboveSTUptoIncludingUEL** | **float** | Earnings above ST up to UEL | [optional] +**earningsAboveSTUptoIncludingFUST** | **float** | Earnings above ST up to FUST | [optional] +**earningsAboveFUSTUptoIncludingUEL** | **float** | Earnings above FUST up to UEL | [optional] +**earningsAboveUEL** | **float** | Earnings above UEL | [optional] +**employeeNiGross** | **float** | Employee National Insurance Gross Value | [optional] +**employeeNiRebate** | **float** | Employee National Insurance Rebate Value | [optional] +**employerNiGross** | **float** | Employer National Insurance Gross Value | [optional] +**employerNiRebate** | **float** | Employer National Insurance Rebate Value | [optional] +**employeeNi** | **float** | [readonly] Net Employee National Insurance | [optional] [readonly] +**employerNi** | **float** | [readonly] Net Employer National Insurance | [optional] [readonly] +**netNi** | **float** | [readonly] Net National Insurance (Employer + Employee) | [optional] [readonly] +**niablePay** | **float** | Niable pay value, required for payrun overrides | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NationalInsuranceCalculationBase.md b/docs/Model/NationalInsuranceCalculationBase.md new file mode 100644 index 0000000..ae7a6f2 --- /dev/null +++ b/docs/Model/NationalInsuranceCalculationBase.md @@ -0,0 +1,26 @@ +# # NationalInsuranceCalculationBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**niCategory** | **string** | Calculated on NI table letter | [optional] +**asDirector** | **bool** | Calculated as a Director | [optional] +**earningsUptoIncludingLEL** | **float** | Earnings up to and including LEL | [optional] +**earningsAboveLELUptoIncludingPT** | **float** | Earnings above LEL up to PT | [optional] +**earningsAbovePTUptoIncludingST** | **float** | Earnings above PT up to ST | [optional] +**earningsAbovePTUptoIncludingUEL** | **float** | Earnings above PT up to UEL | [optional] +**earningsAboveSTUptoIncludingUEL** | **float** | Earnings above ST up to UEL | [optional] +**earningsAboveSTUptoIncludingFUST** | **float** | Earnings above ST up to FUST | [optional] +**earningsAboveFUSTUptoIncludingUEL** | **float** | Earnings above FUST up to UEL | [optional] +**earningsAboveUEL** | **float** | Earnings above UEL | [optional] +**employeeNiGross** | **float** | Employee National Insurance Gross Value | [optional] +**employeeNiRebate** | **float** | Employee National Insurance Rebate Value | [optional] +**employerNiGross** | **float** | Employer National Insurance Gross Value | [optional] +**employerNiRebate** | **float** | Employer National Insurance Rebate Value | [optional] +**employeeNi** | **float** | [readonly] Net Employee National Insurance | [optional] [readonly] +**employerNi** | **float** | [readonly] Net Employer National Insurance | [optional] [readonly] +**netNi** | **float** | [readonly] Net National Insurance (Employer + Employee) | [optional] [readonly] +**niablePay** | **float** | Niable pay value, required for payrun overrides | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NationalInsuranceCalculationPeriodValues.md b/docs/Model/NationalInsuranceCalculationPeriodValues.md new file mode 100644 index 0000000..4c4e268 --- /dev/null +++ b/docs/Model/NationalInsuranceCalculationPeriodValues.md @@ -0,0 +1,17 @@ +# # NationalInsuranceCalculationPeriodValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lel** | **float** | [readonly] Lower Earnings Limit | [optional] +**pt** | **float** | [readonly] Primary Threshold | [optional] +**st** | **float** | [readonly] Secondary Threshold | [optional] +**fust** | **float** | [readonly] Freeports Upper Accrual Threshold | [optional] +**uap** | **float** | [readonly] Upper Accrual Point | [optional] +**ust** | **float** | [readonly] Upper Secondary Threshold (under 21) | [optional] +**aust** | **float** | [readonly] Apprentice Upper Secondary Threshold (apprentice under 25) | [optional] +**uel** | **float** | [readonly] Upper Earnings Limit | [optional] +**vust** | **float** | [readonly] Veterian Upper Secondary Threshold | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NationalInsuranceCode.md b/docs/Model/NationalInsuranceCode.md new file mode 100644 index 0000000..633b6f0 --- /dev/null +++ b/docs/Model/NationalInsuranceCode.md @@ -0,0 +1,22 @@ +# # NationalInsuranceCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | [readonly] NI Table Letter | [optional] +**description** | **string** | [readonly] Description of Employees that would use this NI Letter | [optional] +**eeB** | **float** | [readonly] Earnings at or above LEL up to and including PT (Employee Contribution) | [optional] +**eeC** | **float** | [readonly] Earnings above the PT up to and including UEL (Employee Contribution) | [optional] +**eeD** | **float** | [readonly] Balance of earnings above UEL (Employee Contribution) | [optional] +**eeE** | **float** | [readonly] | [optional] +**eeF** | **float** | [readonly] | [optional] +**erB** | **float** | [readonly] Earnings at or above LEL up to and including PT (Employer Contribution) | [optional] +**erC** | **float** | [readonly] Earnings above the PT up to and including UEL (Employer Contribution) | [optional] +**erD** | **float** | [readonly] Balance of earnings above UEL (Employer Contribution) | [optional] +**erE** | **float** | [readonly] | [optional] +**erF** | **float** | [readonly] | [optional] +**effectiveFrom** | **\DateTime** | The date when these period values are effective | [optional] +**midYearChanges** | [**\SynergiTech\Staffology\Model\NationalInsuranceCode[]**](NationalInsuranceCode.md) | Any optional changes to the period values that are effective from a specified date in the middle of a tax year | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NationalMinimumWage.md b/docs/Model/NationalMinimumWage.md new file mode 100644 index 0000000..ca82bc8 --- /dev/null +++ b/docs/Model/NationalMinimumWage.md @@ -0,0 +1,11 @@ +# # NationalMinimumWage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apprentice** | **bool** | | [optional] +**maxAge** | **int** | | [optional] +**hourlyAmount** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiLetterError.md b/docs/Model/NiLetterError.md new file mode 100644 index 0000000..48b3367 --- /dev/null +++ b/docs/Model/NiLetterError.md @@ -0,0 +1,8 @@ +# # NiLetterError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiLetterValidationReport.md b/docs/Model/NiLetterValidationReport.md new file mode 100644 index 0000000..20b2eb2 --- /dev/null +++ b/docs/Model/NiLetterValidationReport.md @@ -0,0 +1,24 @@ +# # NiLetterValidationReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basedOnPayrun** | **bool** | If false, then any payrun related information (Tax year, etc) should be ignored. | [optional] +**errorLines** | [**\SynergiTech\Staffology\Model\NiLetterValidationReportLine[]**](NiLetterValidationReportLine.md) | | [optional] [readonly] +**paymentDate** | **\DateTime** | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiLetterValidationReportLine.md b/docs/Model/NiLetterValidationReportLine.md new file mode 100644 index 0000000..b56694a --- /dev/null +++ b/docs/Model/NiLetterValidationReportLine.md @@ -0,0 +1,18 @@ +# # NiLetterValidationReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeId** | **string** | | [optional] +**payrollCode** | **string** | | [optional] +**name** | **string** | | [optional] +**niNumber** | **string** | | [optional] +**gender** | [**\SynergiTech\Staffology\Model\Gender**](Gender.md) | | [optional] +**dateOfBirth** | **\DateTime** | | [optional] +**niLetterError** | [**\SynergiTech\Staffology\Model\NiLetterError**](NiLetterError.md) | | [optional] +**errorDetails** | **string** | | [optional] [readonly] +**niLetter** | **string** | | [optional] +**suggestedLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiLetterValidationReportReportResponse.md b/docs/Model/NiLetterValidationReportReportResponse.md new file mode 100644 index 0000000..61eb2c9 --- /dev/null +++ b/docs/Model/NiLetterValidationReportReportResponse.md @@ -0,0 +1,12 @@ +# # NiLetterValidationReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\NiLetterValidationReport**](NiLetterValidationReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiYtdReport.md b/docs/Model/NiYtdReport.md new file mode 100644 index 0000000..9c62881 --- /dev/null +++ b/docs/Model/NiYtdReport.md @@ -0,0 +1,14 @@ +# # NiYtdReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrun** | [**\SynergiTech\Staffology\Model\PayRun**](PayRun.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\EmployeeNiYtdValues[]**](EmployeeNiYtdValues.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiYtdReportReportResponse.md b/docs/Model/NiYtdReportReportResponse.md new file mode 100644 index 0000000..b5c5d43 --- /dev/null +++ b/docs/Model/NiYtdReportReportResponse.md @@ -0,0 +1,12 @@ +# # NiYtdReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\NiYtdReport**](NiYtdReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NiYtdValue.md b/docs/Model/NiYtdValue.md new file mode 100644 index 0000000..897b7e8 --- /dev/null +++ b/docs/Model/NiYtdValue.md @@ -0,0 +1,12 @@ +# # NiYtdValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] +**broughtForward** | **float** | | [optional] +**period** | **float** | | [optional] +**value** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NicSummary.md b/docs/Model/NicSummary.md new file mode 100644 index 0000000..a88ac4c --- /dev/null +++ b/docs/Model/NicSummary.md @@ -0,0 +1,31 @@ +# # NicSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**paymentDate** | **\DateTime** | | [optional] +**niTable** | **string** | | [optional] +**asDirector** | **bool** | | [optional] +**grossEarningsForNics** | **float** | | [optional] +**earningsAtLel** | **float** | | [optional] +**earningsAboveLelToPt** | **float** | | [optional] +**earningsAbovePtToSt** | **float** | | [optional] +**earningsAbovePtToUap** | **float** | | [optional] +**earningsAboveStToUel** | **float** | | [optional] +**earningsAboveStToFust** | **float** | | [optional] +**earningsAboveFustToUel** | **float** | | [optional] +**earningsAboveUapToUel** | **float** | | [optional] +**earningsAboveUel** | **float** | | [optional] +**employeeNics** | **float** | | [optional] +**employeeNiRebate** | **float** | | [optional] +**employerNics** | **float** | | [optional] +**employerNiRebate** | **float** | | [optional] +**hasValues** | **bool** | | [optional] [readonly] +**id** | **string** | | [optional] [readonly] +**isNiYtdOverride** | **bool** | | [optional] +**childId** | **string** | This is nothing but the UniqueId of the model. | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NominalCodeMapping.md b/docs/Model/NominalCodeMapping.md new file mode 100644 index 0000000..b3f0302 --- /dev/null +++ b/docs/Model/NominalCodeMapping.md @@ -0,0 +1,14 @@ +# # NominalCodeMapping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nominalCode** | **string** | | [optional] +**nominalName** | **string** | | [optional] +**externalId** | **string** | If you will be using the API to post journals to an ExternalDataProvider, then this is the Id of the nominal code in the external system. If there's no mapping then this will have a value of \"0\" | [optional] +**payCode** | **string** | | [optional] +**nominalMapping** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Note.md b/docs/Model/Note.md new file mode 100644 index 0000000..d5c88ed --- /dev/null +++ b/docs/Model/Note.md @@ -0,0 +1,17 @@ +# # Note + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**noteDate** | **\DateTime** | The date of the note | [optional] +**noteText** | **string** | Note text | [optional] +**createdBy** | **string** | [readonly] The email address of the user that create the Note | [optional] +**updatedBy** | **string** | [readonly] The email address of the user that last updated the Note | [optional] +**type** | [**\SynergiTech\Staffology\Model\NoteType**](NoteType.md) | | [optional] +**documentCount** | **int** | [readonly] The number of attachments associated with this model | [optional] +**documents** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The attachments associated with this model | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NoteType.md b/docs/Model/NoteType.md new file mode 100644 index 0000000..b8eeb1c --- /dev/null +++ b/docs/Model/NoteType.md @@ -0,0 +1,8 @@ +# # NoteType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Nvr.md b/docs/Model/Nvr.md new file mode 100644 index 0000000..6b3b53e --- /dev/null +++ b/docs/Model/Nvr.md @@ -0,0 +1,17 @@ +# # Nvr + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employees** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | | [optional] +**employeeCount** | **int** | | [optional] +**nvrRequest** | [**\SynergiTech\Staffology\Model\NvrRequest**](NvrRequest.md) | | [optional] +**iRmark** | **string** | | [optional] +**xml** | **string** | This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**employerReferences** | [**\SynergiTech\Staffology\Model\EmpRefs**](EmpRefs.md) | | [optional] +**govTalkSubmission** | [**\SynergiTech\Staffology\Model\GovTalkSubmission**](GovTalkSubmission.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NvrEmployee.md b/docs/Model/NvrEmployee.md new file mode 100644 index 0000000..1181a96 --- /dev/null +++ b/docs/Model/NvrEmployee.md @@ -0,0 +1,12 @@ +# # NvrEmployee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeUniqueId** | **string** | | [optional] +**item** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**employeeDetails** | [**\SynergiTech\Staffology\Model\NvrEmployeeDetails**](NvrEmployeeDetails.md) | | [optional] +**employment** | [**\SynergiTech\Staffology\Model\NvrEmployment**](NvrEmployment.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NvrEmployeeDetails.md b/docs/Model/NvrEmployeeDetails.md new file mode 100644 index 0000000..e2f4837 --- /dev/null +++ b/docs/Model/NvrEmployeeDetails.md @@ -0,0 +1,13 @@ +# # NvrEmployeeDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nino** | **string** | | [optional] +**name** | [**\SynergiTech\Staffology\Model\RtiEmployeeName**](RtiEmployeeName.md) | | [optional] +**address** | [**\SynergiTech\Staffology\Model\RtiEmployeeAddress**](RtiEmployeeAddress.md) | | [optional] +**birthDate** | **string** | | [optional] +**gender** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NvrEmployment.md b/docs/Model/NvrEmployment.md new file mode 100644 index 0000000..c40c1b9 --- /dev/null +++ b/docs/Model/NvrEmployment.md @@ -0,0 +1,9 @@ +# # NvrEmployment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NvrRequest.md b/docs/Model/NvrRequest.md new file mode 100644 index 0000000..260f4e4 --- /dev/null +++ b/docs/Model/NvrRequest.md @@ -0,0 +1,10 @@ +# # NvrRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\NvrEmployee[]**](NvrEmployee.md) | | [optional] +**relatedTaxYear** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicy.md b/docs/Model/OccupationalPolicy.md new file mode 100644 index 0000000..bec5c96 --- /dev/null +++ b/docs/Model/OccupationalPolicy.md @@ -0,0 +1,20 @@ +# # OccupationalPolicy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**policyName** | **string** | The unique policy name | +**type** | [**\SynergiTech\Staffology\Model\OccupationalPolicyType**](OccupationalPolicyType.md) | | +**entitlement** | [**\SynergiTech\Staffology\Model\OccupationalPolicyEntitlement**](OccupationalPolicyEntitlement.md) | | +**sicknessYear** | [**\SynergiTech\Staffology\Model\OccupationalPolicySicknessYear**](OccupationalPolicySicknessYear.md) | | +**policyStartMonth** | [**\SynergiTech\Staffology\Model\CalendarMonth**](CalendarMonth.md) | | [optional] +**serviceBands** | [**\SynergiTech\Staffology\Model\ServiceBand[]**](ServiceBand.md) | Service Bands Json | [optional] +**payCalculatedOn** | [**\SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn**](OccupationalPolicyPayCalculatedOn.md) | | [optional] +**payCodeSetUniqueId** | **string** | | [optional] +**useAggregatedServiceDate** | **bool** | | [optional] +**daysOrWeeksBeforeRecalculatingEntitlement** | **int** | How many days or weeks an employee needs to return to work before new entitlements are used in calculations | [optional] +**entitlementRecalculationBasis** | [**\SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis**](OccupationalPolicyEntitlementRecalculationBasis.md) | | [optional] +**ignorePreviousYearsSickness** | **bool** | Defines whether any sickness that relates to a previous year's sickness entitlement should be included in the entitlement calculation, or whether only sickness that is relevant to the current year's entitlement is taken into consideration | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicyEntitlement.md b/docs/Model/OccupationalPolicyEntitlement.md new file mode 100644 index 0000000..3237e72 --- /dev/null +++ b/docs/Model/OccupationalPolicyEntitlement.md @@ -0,0 +1,8 @@ +# # OccupationalPolicyEntitlement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md b/docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md new file mode 100644 index 0000000..6e02597 --- /dev/null +++ b/docs/Model/OccupationalPolicyEntitlementRecalculationBasis.md @@ -0,0 +1,8 @@ +# # OccupationalPolicyEntitlementRecalculationBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicyPayCalculatedOn.md b/docs/Model/OccupationalPolicyPayCalculatedOn.md new file mode 100644 index 0000000..07aa09e --- /dev/null +++ b/docs/Model/OccupationalPolicyPayCalculatedOn.md @@ -0,0 +1,8 @@ +# # OccupationalPolicyPayCalculatedOn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicySicknessYear.md b/docs/Model/OccupationalPolicySicknessYear.md new file mode 100644 index 0000000..e833976 --- /dev/null +++ b/docs/Model/OccupationalPolicySicknessYear.md @@ -0,0 +1,8 @@ +# # OccupationalPolicySicknessYear + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalPolicyType.md b/docs/Model/OccupationalPolicyType.md new file mode 100644 index 0000000..23e6918 --- /dev/null +++ b/docs/Model/OccupationalPolicyType.md @@ -0,0 +1,8 @@ +# # OccupationalPolicyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OccupationalSickLeaveHistory.md b/docs/Model/OccupationalSickLeaveHistory.md new file mode 100644 index 0000000..d6214d5 --- /dev/null +++ b/docs/Model/OccupationalSickLeaveHistory.md @@ -0,0 +1,16 @@ +# # OccupationalSickLeaveHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | | [optional] +**leaveDate** | **\DateTime** | | +**payPercent** | **float** | | +**serviceBandFrom** | **int** | | +**serviceBandTo** | **int** | | +**roleReference** | **string** | | [optional] +**occupationalPolicy** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OpeningBalances.md b/docs/Model/OpeningBalances.md new file mode 100644 index 0000000..769d162 --- /dev/null +++ b/docs/Model/OpeningBalances.md @@ -0,0 +1,32 @@ +# # OpeningBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notNewStarter** | **bool** | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**previousEmployerGross** | **float** | | [optional] +**previousEmployerTax** | **float** | | [optional] +**currentEmployerGross** | **float** | | [optional] +**currentEmployerTax** | **float** | | [optional] +**currentEmployerNet** | **float** | | [optional] +**studentLoanDeductions** | **float** | | [optional] +**postgradLoanDeductions** | **float** | | [optional] +**empeePenContribnsPaid** | **float** | | [optional] +**empeePenContribnsNotPaid** | **float** | | [optional] +**smp** | **float** | | [optional] +**spp** | **float** | | [optional] +**sap** | **float** | | [optional] +**shpp** | **float** | | [optional] +**spbp** | **float** | | [optional] +**realTimeClass1ANi** | **float** | | [optional] +**terminationPayments** | **float** | | [optional] +**mapsMiles** | **int** | | [optional] +**benefitsTaxedViaPayroll** | **float** | | [optional] +**nicSummaries** | [**\SynergiTech\Staffology\Model\NicSummary[]**](NicSummary.md) | | [optional] +**foreignTaxCredit** | **float** | | [optional] +**foreignTaxCreditReclaimed** | **float** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OpeningBalancesTotals.md b/docs/Model/OpeningBalancesTotals.md new file mode 100644 index 0000000..1791f48 --- /dev/null +++ b/docs/Model/OpeningBalancesTotals.md @@ -0,0 +1,32 @@ +# # OpeningBalancesTotals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeesWithOpeningBalancesCount** | **int** | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**previousEmployerGross** | **float** | | [optional] +**previousEmployerTax** | **float** | | [optional] +**currentEmployerGross** | **float** | | [optional] +**currentEmployerTax** | **float** | | [optional] +**currentEmployerNet** | **float** | | [optional] +**studentLoanDeductions** | **float** | | [optional] +**postgradLoanDeductions** | **float** | | [optional] +**empeePenContribnsPaid** | **float** | | [optional] +**empeePenContribnsNotPaid** | **float** | | [optional] +**smp** | **float** | | [optional] +**spp** | **float** | | [optional] +**sap** | **float** | | [optional] +**shpp** | **float** | | [optional] +**spbp** | **float** | | [optional] +**realTimeClass1ANi** | **float** | | [optional] +**terminationPayments** | **float** | | [optional] +**mapsMiles** | **int** | | [optional] +**benefitsTaxedViaPayroll** | **float** | | [optional] +**nicSummaries** | [**\SynergiTech\Staffology\Model\NicSummary[]**](NicSummary.md) | | [optional] +**foreignTaxCredit** | **float** | | [optional] +**foreignTaxCreditReclaimed** | **float** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OverseasEmployerDetails.md b/docs/Model/OverseasEmployerDetails.md new file mode 100644 index 0000000..c6f6746 --- /dev/null +++ b/docs/Model/OverseasEmployerDetails.md @@ -0,0 +1,12 @@ +# # OverseasEmployerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overseasEmployer** | **bool** | | [optional] +**overseasSecondmentStatus** | [**\SynergiTech\Staffology\Model\OverseasSecondmentStatus**](OverseasSecondmentStatus.md) | | [optional] +**eeaCitizen** | **bool** | | [optional] +**epm6Scheme** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OverseasSecondmentStatus.md b/docs/Model/OverseasSecondmentStatus.md new file mode 100644 index 0000000..2c481c6 --- /dev/null +++ b/docs/Model/OverseasSecondmentStatus.md @@ -0,0 +1,8 @@ +# # OverseasSecondmentStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11.md b/docs/Model/P11.md new file mode 100644 index 0000000..6eed711 --- /dev/null +++ b/docs/Model/P11.md @@ -0,0 +1,24 @@ +# # P11 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employerName** | **string** | [readonly] | [optional] +**payrollCode** | **string** | [readonly] | [optional] +**employerOfficeNo** | **string** | [readonly] | [optional] +**employerPayeRef** | **string** | [readonly] | [optional] +**firstname** | **string** | [readonly] | [optional] +**surname** | **string** | [readonly] | [optional] +**niNumber** | **string** | [readonly] | [optional] +**taxCode** | **string** | [readonly] | [optional] +**dateOfBirth** | **\DateTime** | [readonly] | [optional] +**joinDate** | **\DateTime** | [readonly] | [optional] +**leaveDate** | **\DateTime** | [readonly] | [optional] +**lines** | [**\SynergiTech\Staffology\Model\P11Line[]**](P11Line.md) | [readonly] | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DAssetAvailable.md b/docs/Model/P11DAssetAvailable.md new file mode 100644 index 0000000..20ae60b --- /dev/null +++ b/docs/Model/P11DAssetAvailable.md @@ -0,0 +1,15 @@ +# # P11DAssetAvailable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**desc** | **string** | | [optional] +**other** | **string** | | [optional] +**annValProRata** | **string** | | [optional] +**grossOrAmtForgone** | **string** | | [optional] +**costOrAmtForgone** | **string** | | [optional] +**madeGood** | **string** | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DAssetAvailableCollection.md b/docs/Model/P11DAssetAvailableCollection.md new file mode 100644 index 0000000..3ee0337 --- /dev/null +++ b/docs/Model/P11DAssetAvailableCollection.md @@ -0,0 +1,10 @@ +# # P11DAssetAvailableCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | [**\SynergiTech\Staffology\Model\P11DAssetAvailable[]**](P11DAssetAvailable.md) | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DAssetTransferredCollection.md b/docs/Model/P11DAssetTransferredCollection.md new file mode 100644 index 0000000..d880655 --- /dev/null +++ b/docs/Model/P11DAssetTransferredCollection.md @@ -0,0 +1,10 @@ +# # P11DAssetTransferredCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | [**\SynergiTech\Staffology\Model\P11DDescOther[]**](P11DDescOther.md) | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DCar.md b/docs/Model/P11DCar.md new file mode 100644 index 0000000..5c79758 --- /dev/null +++ b/docs/Model/P11DCar.md @@ -0,0 +1,24 @@ +# # P11DCar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**make** | **string** | | [optional] +**registered** | **string** | | [optional] +**availFrom** | **string** | | [optional] +**availTo** | **string** | | [optional] +**cc** | **string** | | [optional] +**fuel** | **string** | | [optional] +**cO2** | **string** | | [optional] +**zeroEmissionMileage** | **string** | | [optional] +**noAppCO2Fig** | **string** | | [optional] +**list** | **string** | | [optional] +**accs** | **string** | | [optional] +**capCont** | **string** | | [optional] +**privUsePmt** | **string** | | [optional] +**fuelWithdrawn** | [**\SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn**](P11dCarFreeFuelWithdrawn.md) | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] +**fuelCashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DCarCollection.md b/docs/Model/P11DCarCollection.md new file mode 100644 index 0000000..a1060c4 --- /dev/null +++ b/docs/Model/P11DCarCollection.md @@ -0,0 +1,12 @@ +# # P11DCarCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**car** | [**\SynergiTech\Staffology\Model\P11DCar[]**](P11DCar.md) | | [optional] +**totalCarsOrRelevantAmt** | **string** | | [optional] +**totalFuelOrRelevantAmt** | **string** | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DDescOther.md b/docs/Model/P11DDescOther.md new file mode 100644 index 0000000..6f903ef --- /dev/null +++ b/docs/Model/P11DDescOther.md @@ -0,0 +1,15 @@ +# # P11DDescOther + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**desc** | **string** | | [optional] +**other** | **string** | | [optional] +**annValProRata** | **string** | | [optional] +**grossOrAmtForgone** | **string** | | [optional] +**costOrAmtForgone** | **string** | | [optional] +**madeGood** | **string** | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DLoan.md b/docs/Model/P11DLoan.md new file mode 100644 index 0000000..c4be067 --- /dev/null +++ b/docs/Model/P11DLoan.md @@ -0,0 +1,16 @@ +# # P11DLoan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**joint** | **string** | | [optional] +**initOS** | **string** | | [optional] +**finalOS** | **string** | | [optional] +**maxOS** | **string** | | [optional] +**intPaid** | **string** | | [optional] +**date** | **string** | | [optional] +**discharge** | **string** | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DLoanCollection.md b/docs/Model/P11DLoanCollection.md new file mode 100644 index 0000000..f586762 --- /dev/null +++ b/docs/Model/P11DLoanCollection.md @@ -0,0 +1,10 @@ +# # P11DLoanCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loan** | [**\SynergiTech\Staffology\Model\P11DLoan[]**](P11DLoan.md) | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DOther.md b/docs/Model/P11DOther.md new file mode 100644 index 0000000..294b257 --- /dev/null +++ b/docs/Model/P11DOther.md @@ -0,0 +1,12 @@ +# # P11DOther + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class1A** | [**\SynergiTech\Staffology\Model\P11DDescOther[]**](P11DDescOther.md) | | [optional] +**nonClass1A** | [**\SynergiTech\Staffology\Model\P11DDescOther[]**](P11DDescOther.md) | | [optional] +**taxPaid** | **string** | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DPaymentCollection.md b/docs/Model/P11DPaymentCollection.md new file mode 100644 index 0000000..836df2d --- /dev/null +++ b/docs/Model/P11DPaymentCollection.md @@ -0,0 +1,11 @@ +# # P11DPaymentCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment** | [**\SynergiTech\Staffology\Model\P11DDescOther[]**](P11DDescOther.md) | | [optional] +**tax** | **string** | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DSingleItem.md b/docs/Model/P11DSingleItem.md new file mode 100644 index 0000000..5f3db87 --- /dev/null +++ b/docs/Model/P11DSingleItem.md @@ -0,0 +1,20 @@ +# # P11DSingleItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**typeLetter** | **string** | | [optional] +**taxablePmt** | **string** | | [optional] +**excess** | **string** | | [optional] +**taxablePmtOrRelevantAmt** | **string** | | [optional] +**tradingOrgInd** | **string** | | [optional] +**desc** | **string** | | [optional] +**other** | **string** | | [optional] +**annValProRata** | **string** | | [optional] +**grossOrAmtForgone** | **string** | | [optional] +**costOrAmtForgone** | **string** | | [optional] +**madeGood** | **string** | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11Detailed.md b/docs/Model/P11Detailed.md new file mode 100644 index 0000000..5cbec71 --- /dev/null +++ b/docs/Model/P11Detailed.md @@ -0,0 +1,31 @@ +# # P11Detailed + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employerName** | **string** | [readonly] | [optional] +**payrollCode** | **string** | [readonly] | [optional] +**employerOfficeNo** | **string** | [readonly] | [optional] +**employerPayeRef** | **string** | [readonly] | [optional] +**firstname** | **string** | [readonly] | [optional] +**middlename** | **string** | [readonly] | [optional] +**surname** | **string** | [readonly] | [optional] +**niNumber** | **string** | [readonly] | [optional] +**taxCode** | **string** | [readonly] | [optional] +**dateOfBirth** | **\DateTime** | [readonly] | [optional] +**joinDate** | **\DateTime** | [readonly] | [optional] +**leaveDate** | **\DateTime** | [readonly] | [optional] +**isDirector** | **bool** | [readonly] | [optional] +**niAndStatPaymentsLines** | [**\SynergiTech\Staffology\Model\P11NiAndStatPaymentsLine[]**](P11NiAndStatPaymentsLine.md) | [readonly] | [optional] +**totalsLine** | [**\SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine**](P11NiAndStatPaymentsTotalsLine.md) | | [optional] +**niSummary** | [**\SynergiTech\Staffology\Model\P11DetailedNiValues[]**](P11DetailedNiValues.md) | [readonly] | [optional] +**payeLines** | [**\SynergiTech\Staffology\Model\P11PayeLine[]**](P11PayeLine.md) | [readonly] | [optional] +**payeTotalsLine** | [**\SynergiTech\Staffology\Model\P11PayeTotalsLine**](P11PayeTotalsLine.md) | | [optional] +**payeSummary** | [**\SynergiTech\Staffology\Model\P11PayeSummary**](P11PayeSummary.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DetailedNiValues.md b/docs/Model/P11DetailedNiValues.md new file mode 100644 index 0000000..f3939c1 --- /dev/null +++ b/docs/Model/P11DetailedNiValues.md @@ -0,0 +1,17 @@ +# # P11DetailedNiValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**table** | **string** | [readonly] | [optional] +**earningsAtLel** | **float** | [readonly] | [optional] +**earningsAboveLelToPt** | **float** | [readonly] | [optional] +**earningsAbovePtToUap** | **float** | [readonly] | [optional] +**earningsAboveUapToUel** | **float** | [readonly] | [optional] +**earningsAbovePtToUel** | **float** | [readonly] | [optional] +**employeeNics** | **float** | [readonly] | [optional] +**employerNics** | **float** | [readonly] | [optional] +**employeeAndEmployerNics** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11DetailedReportResponse.md b/docs/Model/P11DetailedReportResponse.md new file mode 100644 index 0000000..ddc7f1e --- /dev/null +++ b/docs/Model/P11DetailedReportResponse.md @@ -0,0 +1,12 @@ +# # P11DetailedReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\P11Detailed**](P11Detailed.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11Line.md b/docs/Model/P11Line.md new file mode 100644 index 0000000..1c20e1c --- /dev/null +++ b/docs/Model/P11Line.md @@ -0,0 +1,22 @@ +# # P11Line + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | [readonly] | [optional] +**period** | **string** | [readonly] | [optional] +**grossTaxablePay** | **float** | [readonly] | [optional] +**grossTaxablePayYTD** | **float** | [readonly] | [optional] +**tax** | **float** | [readonly] | [optional] +**taxYTD** | **float** | [readonly] | [optional] +**smpYTD** | **float** | [readonly] | [optional] +**sppYTD** | **float** | [readonly] | [optional] +**sapYTD** | **float** | [readonly] | [optional] +**shppYTD** | **float** | [readonly] | [optional] +**spbpYTD** | **float** | [readonly] | [optional] +**studentLoanYTD** | **float** | [readonly] | [optional] +**postgradLoanYTD** | **float** | [readonly] | [optional] +**niValues** | [**\SynergiTech\Staffology\Model\P11NiValues[]**](P11NiValues.md) | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11NiAndStatPaymentsLine.md b/docs/Model/P11NiAndStatPaymentsLine.md new file mode 100644 index 0000000..376ada0 --- /dev/null +++ b/docs/Model/P11NiAndStatPaymentsLine.md @@ -0,0 +1,21 @@ +# # P11NiAndStatPaymentsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | [readonly] | [optional] +**period** | **string** | [readonly] | [optional] +**monthNumber** | **string** | [readonly] | [optional] +**weekNumber** | **string** | [readonly] | [optional] +**smp** | **float** | [readonly] | [optional] +**spp** | **float** | [readonly] | [optional] +**sap** | **float** | [readonly] | [optional] +**shpp** | **float** | [readonly] | [optional] +**ssp** | **float** | [readonly] | [optional] +**spbp** | **float** | [readonly] | [optional] +**class1a** | **float** | [readonly] | [optional] +**niValues** | [**\SynergiTech\Staffology\Model\P11DetailedNiValues**](P11DetailedNiValues.md) | | [optional] +**taxCode** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11NiAndStatPaymentsTotalsLine.md b/docs/Model/P11NiAndStatPaymentsTotalsLine.md new file mode 100644 index 0000000..d6b686e --- /dev/null +++ b/docs/Model/P11NiAndStatPaymentsTotalsLine.md @@ -0,0 +1,20 @@ +# # P11NiAndStatPaymentsTotalsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toLel** | **float** | [readonly] | [optional] +**lelToPt** | **float** | [readonly] | [optional] +**ptToUel** | **float** | [readonly] | [optional] +**eesAndErs** | **float** | [readonly] | [optional] +**ees** | **float** | [readonly] | [optional] +**class1A** | **float** | [readonly] | [optional] +**ssp** | **float** | [readonly] | [optional] +**smp** | **float** | [readonly] | [optional] +**spp** | **float** | [readonly] | [optional] +**shpp** | **float** | [readonly] | [optional] +**sap** | **float** | [readonly] | [optional] +**spbp** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11NiValues.md b/docs/Model/P11NiValues.md new file mode 100644 index 0000000..83b7ad5 --- /dev/null +++ b/docs/Model/P11NiValues.md @@ -0,0 +1,11 @@ +# # P11NiValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**table** | **string** | [readonly] | [optional] +**period** | **float** | [readonly] | [optional] +**ytd** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11PayeLine.md b/docs/Model/P11PayeLine.md new file mode 100644 index 0000000..f02873a --- /dev/null +++ b/docs/Model/P11PayeLine.md @@ -0,0 +1,19 @@ +# # P11PayeLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | [readonly] | [optional] +**period** | **string** | [readonly] | [optional] +**monthNumber** | **string** | [readonly] | [optional] +**weekNumber** | **string** | [readonly] | [optional] +**grossTaxablePay** | **float** | [readonly] | [optional] +**grossTaxablePayYTD** | **float** | [readonly] | [optional] +**tax** | **float** | [readonly] | [optional] +**taxYTD** | **float** | [readonly] | [optional] +**studentLoan** | **float** | [readonly] | [optional] +**postgradLoan** | **float** | [readonly] | [optional] +**taxCode** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11PayeSummary.md b/docs/Model/P11PayeSummary.md new file mode 100644 index 0000000..db5e853 --- /dev/null +++ b/docs/Model/P11PayeSummary.md @@ -0,0 +1,14 @@ +# # P11PayeSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previousEmploymentPay** | **float** | [readonly] | [optional] +**previousEmploymentTax** | **float** | [readonly] | [optional] +**thisEmploymentPay** | **float** | [readonly] | [optional] +**thisEmploymentTax** | **float** | [readonly] | [optional] +**totalPayForYear** | **float** | [readonly] | [optional] +**totalTaxForYear** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11PayeTotalsLine.md b/docs/Model/P11PayeTotalsLine.md new file mode 100644 index 0000000..bb8342a --- /dev/null +++ b/docs/Model/P11PayeTotalsLine.md @@ -0,0 +1,14 @@ +# # P11PayeTotalsLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**studentLoan** | **float** | [readonly] | [optional] +**postgradLoan** | **float** | [readonly] | [optional] +**pay** | **float** | [readonly] | [optional] +**totalPayToDate** | **float** | [readonly] | [optional] +**taxDueToDate** | **float** | [readonly] | [optional] +**taxDue** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11ReportResponse.md b/docs/Model/P11ReportResponse.md new file mode 100644 index 0000000..037aed6 --- /dev/null +++ b/docs/Model/P11ReportResponse.md @@ -0,0 +1,12 @@ +# # P11ReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\P11**](P11.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11dCarFreeFuelWithdrawn.md b/docs/Model/P11dCarFreeFuelWithdrawn.md new file mode 100644 index 0000000..e687eaf --- /dev/null +++ b/docs/Model/P11dCarFreeFuelWithdrawn.md @@ -0,0 +1,10 @@ +# # P11dCarFreeFuelWithdrawn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reinstated** | **string** | | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11dExpenses.md b/docs/Model/P11dExpenses.md new file mode 100644 index 0000000..8d57401 --- /dev/null +++ b/docs/Model/P11dExpenses.md @@ -0,0 +1,14 @@ +# # P11dExpenses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**travAndSub** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**ent** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**homeTel** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**nonQualRel** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**other** | [**\SynergiTech\Staffology\Model\P11DSingleItem**](P11DSingleItem.md) | | [optional] +**typeLetter** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P11dVans.md b/docs/Model/P11dVans.md new file mode 100644 index 0000000..c75fe91 --- /dev/null +++ b/docs/Model/P11dVans.md @@ -0,0 +1,21 @@ +# # P11dVans + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fuelCashEquivOrRelevantAmt** | **string** | | [optional] +**typeLetter** | **string** | | [optional] +**taxablePmt** | **string** | | [optional] +**excess** | **string** | | [optional] +**taxablePmtOrRelevantAmt** | **string** | | [optional] +**tradingOrgInd** | **string** | | [optional] +**desc** | **string** | | [optional] +**other** | **string** | | [optional] +**annValProRata** | **string** | | [optional] +**grossOrAmtForgone** | **string** | | [optional] +**costOrAmtForgone** | **string** | | [optional] +**madeGood** | **string** | | [optional] +**cashEquivOrRelevantAmt** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P32.md b/docs/Model/P32.md new file mode 100644 index 0000000..2d31105 --- /dev/null +++ b/docs/Model/P32.md @@ -0,0 +1,16 @@ +# # P32 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isQuarterly** | **bool** | [readonly] | [optional] +**hmrcLiabilities** | [**\SynergiTech\Staffology\Model\HmrcLiability[]**](HmrcLiability.md) | [readonly] | [optional] +**employerOpeningBalances** | [**\SynergiTech\Staffology\Model\EmployerOpeningBalances**](EmployerOpeningBalances.md) | | [optional] +**openingBalancesTotals** | [**\SynergiTech\Staffology\Model\OpeningBalancesTotals**](OpeningBalancesTotals.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/P32ReportResponse.md b/docs/Model/P32ReportResponse.md new file mode 100644 index 0000000..37543c1 --- /dev/null +++ b/docs/Model/P32ReportResponse.md @@ -0,0 +1,12 @@ +# # P32ReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\P32**](P32.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisDocument.md b/docs/Model/PapdisDocument.md new file mode 100644 index 0000000..509cdd7 --- /dev/null +++ b/docs/Model/PapdisDocument.md @@ -0,0 +1,16 @@ +# # PapdisDocument + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageFunctionCode** | [**\SynergiTech\Staffology\Model\PapdisMessageFunctionCode**](PapdisMessageFunctionCode.md) | | [optional] +**version** | [**\SynergiTech\Staffology\Model\PapdisVersion**](PapdisVersion.md) | | [optional] +**messageFunctionCodeInt** | **int** | [readonly] | [optional] +**pensionProvider** | [**\SynergiTech\Staffology\Model\PapdisPensionProvider**](PapdisPensionProvider.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisDocumentReportResponse.md b/docs/Model/PapdisDocumentReportResponse.md new file mode 100644 index 0000000..d9cea60 --- /dev/null +++ b/docs/Model/PapdisDocumentReportResponse.md @@ -0,0 +1,12 @@ +# # PapdisDocumentReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PapdisDocument**](PapdisDocument.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployee.md b/docs/Model/PapdisEmployee.md new file mode 100644 index 0000000..5e45aa7 --- /dev/null +++ b/docs/Model/PapdisEmployee.md @@ -0,0 +1,29 @@ +# # PapdisEmployee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | [readonly] | [optional] +**employeeId** | **string** | [readonly] | [optional] +**name** | [**\SynergiTech\Staffology\Model\PapdisEmployeeName**](PapdisEmployeeName.md) | | [optional] +**identity** | [**\SynergiTech\Staffology\Model\PapdisEmployeeIdentity**](PapdisEmployeeIdentity.md) | | [optional] +**contact** | [**\SynergiTech\Staffology\Model\PapdisEmployeeContact**](PapdisEmployeeContact.md) | | [optional] +**pay** | [**\SynergiTech\Staffology\Model\PapdisEmployeePay**](PapdisEmployeePay.md) | | [optional] +**assessment** | [**\SynergiTech\Staffology\Model\PapdisEmployeeAssessment**](PapdisEmployeeAssessment.md) | | [optional] +**contribution** | [**\SynergiTech\Staffology\Model\PapdisEmployeeContribution**](PapdisEmployeeContribution.md) | | [optional] +**exit** | [**\SynergiTech\Staffology\Model\PapdisEmployeeExit**](PapdisEmployeeExit.md) | | [optional] +**payrollCode** | **string** | [readonly] | [optional] +**aeStateDate** | **\DateTime** | | [optional] +**leaveDate** | **\DateTime** | | [optional] +**statePensionAge** | **int** | | [optional] +**contractualJoinerIndicator** | **bool** | | [optional] +**jobTitle** | **string** | | [optional] +**pensionMemberReference** | **string** | | [optional] +**pensionUniqueId** | **string** | | [optional] +**employeeRoleUniqueId** | **string** | | [optional] +**lastPaymentDate** | **\DateTime** | The last time the employee was paid | [optional] +**hasPrevioulyLeftPension** | **bool** | Flag indicating the employee has previously left the pension | [optional] +**pensionablePayDefinition** | [**\SynergiTech\Staffology\Model\PensionablePayDefinition**](PensionablePayDefinition.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeAssessment.md b/docs/Model/PapdisEmployeeAssessment.md new file mode 100644 index 0000000..e37f52b --- /dev/null +++ b/docs/Model/PapdisEmployeeAssessment.md @@ -0,0 +1,20 @@ +# # PapdisEmployeeAssessment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assessmentCode** | **int** | [readonly] | [optional] +**eventCode** | **int** | [readonly] | [optional] +**eventDate** | **\DateTime** | [readonly] | [optional] +**statutoryLetterCode** | **string** | [readonly] | [optional] +**isIndividualAlreadyMemberOfQPS** | **bool** | [readonly] | [optional] +**deferralDate** | **\DateTime** | [readonly] | [optional] +**enrolmentCommunicationsIssuedDate** | **\DateTime** | [readonly] | [optional] +**workerExclusionCode** | **string** | [readonly] | [optional] +**reenrolmentIndicator** | **bool** | [readonly] | [optional] +**optOutWindowEndDate** | **\DateTime** | [readonly] | [optional] +**pensionJoinReason** | [**\SynergiTech\Staffology\Model\PensionJoinReason**](PensionJoinReason.md) | | [optional] +**pensionStartDate** | **\DateTime** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeContact.md b/docs/Model/PapdisEmployeeContact.md new file mode 100644 index 0000000..9e089ac --- /dev/null +++ b/docs/Model/PapdisEmployeeContact.md @@ -0,0 +1,13 @@ +# # PapdisEmployeeContact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**postalAddress** | [**\SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress**](PapdisEmployeeContactPostalAddress.md) | | [optional] +**emailAddress** | **string** | [readonly] | [optional] +**secondaryEmailAddress** | **string** | [readonly] | [optional] +**telephone** | **string** | [readonly] | [optional] +**mobile** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeContactPostalAddress.md b/docs/Model/PapdisEmployeeContactPostalAddress.md new file mode 100644 index 0000000..af6075c --- /dev/null +++ b/docs/Model/PapdisEmployeeContactPostalAddress.md @@ -0,0 +1,14 @@ +# # PapdisEmployeeContactPostalAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address1** | **string** | [readonly] | [optional] +**address2** | **string** | [readonly] | [optional] +**address3** | **string** | [readonly] | [optional] +**address4** | **string** | [readonly] | [optional] +**postcode** | **string** | [readonly] | [optional] +**country** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeContribution.md b/docs/Model/PapdisEmployeeContribution.md new file mode 100644 index 0000000..41cd4b6 --- /dev/null +++ b/docs/Model/PapdisEmployeeContribution.md @@ -0,0 +1,30 @@ +# # PapdisEmployeeContribution + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employerContributionsAmount** | **float** | [readonly] | [optional] +**employerContributionsPercent** | **float** | [readonly] | [optional] +**employeeContributionsAmount** | **float** | [readonly] | [optional] +**employeeContributionsPercent** | **float** | [readonly] | [optional] +**additionalVoluntaryContributionsAmount** | **float** | [readonly] | [optional] +**additionalVoluntaryContributionsPercent** | **float** | [readonly] | [optional] +**salarySacrificeIndicator** | **bool** | [readonly] | [optional] +**contributionStartDate** | **\DateTime** | [readonly] | [optional] +**employeeContributionIsPercentage** | **bool** | [readonly] | [optional] +**employerContributionIsPercentage** | **bool** | [readonly] | [optional] +**unadjustedEmployeeContributionsAmount** | **float** | [readonly] | [optional] +**unadjustedEmployerContributionsAmount** | **float** | [readonly] | [optional] +**unadjustedAdditionalVoluntaryContributionsAmount** | **float** | [readonly] | [optional] +**employerContributionNiSavings** | **float** | [readonly] | [optional] +**contributionLevelType** | [**\SynergiTech\Staffology\Model\PensionContributionLevelType**](PensionContributionLevelType.md) | | [optional] +**isAvcOnly** | **bool** | [readonly] | [optional] +**employerContributionIncludesNiSaving** | **bool** | [readonly] | [optional] +**unadjustedAdditionalVoluntaryContributionsPercent** | **float** | [readonly] | [optional] +**isHalfContributionMember** | **bool** | [readonly] | [optional] +**assumedPensionablePay** | **float** | [readonly] | [optional] +**isPensionRefund** | **bool** | [readonly] | [optional] +**lowerLimit** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeExit.md b/docs/Model/PapdisEmployeeExit.md new file mode 100644 index 0000000..6ac3336 --- /dev/null +++ b/docs/Model/PapdisEmployeeExit.md @@ -0,0 +1,13 @@ +# # PapdisEmployeeExit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exitDate** | **\DateTime** | [readonly] | [optional] +**exitReasonCode** | **int** | [readonly] | [optional] +**aeOptOutDate** | **\DateTime** | [readonly] | [optional] +**aeOptOutReference** | **string** | [readonly] | [optional] +**reasonForLeaving** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeIdentity.md b/docs/Model/PapdisEmployeeIdentity.md new file mode 100644 index 0000000..ca71fd9 --- /dev/null +++ b/docs/Model/PapdisEmployeeIdentity.md @@ -0,0 +1,14 @@ +# # PapdisEmployeeIdentity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeId** | **string** | [readonly] | [optional] +**birthDate** | **\DateTime** | [readonly] | [optional] +**gender** | **string** | [readonly] | [optional] +**nationalInsuranceNumber** | **string** | [readonly] | [optional] +**employmentStartDate** | **\DateTime** | [readonly] | [optional] +**maritalStatus** | [**\SynergiTech\Staffology\Model\MaritalStatus**](MaritalStatus.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeeName.md b/docs/Model/PapdisEmployeeName.md new file mode 100644 index 0000000..ab4467c --- /dev/null +++ b/docs/Model/PapdisEmployeeName.md @@ -0,0 +1,12 @@ +# # PapdisEmployeeName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | [readonly] | [optional] +**forename1** | **string** | [readonly] | [optional] +**forename2** | **string** | [readonly] | [optional] +**surname** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployeePay.md b/docs/Model/PapdisEmployeePay.md new file mode 100644 index 0000000..7a32943 --- /dev/null +++ b/docs/Model/PapdisEmployeePay.md @@ -0,0 +1,14 @@ +# # PapdisEmployeePay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionableEarningsAmount** | **float** | [readonly] | [optional] +**totalGrossQualifyingEarningsAmount** | **float** | [readonly] | [optional] +**annualSalary** | **float** | [readonly] | [optional] +**annualPensionableEarningsAmount** | **float** | [readonly] | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**payAmountMultiplier** | **float** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployer.md b/docs/Model/PapdisEmployer.md new file mode 100644 index 0000000..713f40e --- /dev/null +++ b/docs/Model/PapdisEmployer.md @@ -0,0 +1,21 @@ +# # PapdisEmployer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionRule** | [**\SynergiTech\Staffology\Model\PensionRule**](PensionRule.md) | | [optional] +**employerId** | **string** | [readonly] Taken from the papdisEmployerId property of the PensionProvider | [optional] +**group** | **string** | [readonly] Taken from the papdisGroup property of the WorkerGroup | [optional] +**subGroup** | **string** | [readonly] Taken from the papdisSubGroup property of the WorkerGroup | [optional] +**payrollPeriod** | [**\SynergiTech\Staffology\Model\PapdisPayrollPeriod**](PapdisPayrollPeriod.md) | | [optional] +**stagingDate** | **\DateTime** | [readonly] | [optional] +**cyclicalReenrolmentDate** | **\DateTime** | [readonly] | [optional] +**name** | **string** | [readonly] | [optional] +**postalAddress** | [**\SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress**](PapdisEmployerContactPostalAddress.md) | | [optional] +**fullTimeContractedHours** | **float** | [readonly] | [optional] +**fullTimeContractedWeeks** | **float** | [readonly] | [optional] +**contractedWeeks** | **float** | [readonly] | [optional] +**id** | **int** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisEmployerContactPostalAddress.md b/docs/Model/PapdisEmployerContactPostalAddress.md new file mode 100644 index 0000000..aaaaf4e --- /dev/null +++ b/docs/Model/PapdisEmployerContactPostalAddress.md @@ -0,0 +1,14 @@ +# # PapdisEmployerContactPostalAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address1** | **string** | [readonly] | [optional] +**address2** | **string** | [readonly] | [optional] +**address3** | **string** | [readonly] | [optional] +**address4** | **string** | [readonly] | [optional] +**postcode** | **string** | [readonly] | [optional] +**country** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisMessageFunctionCode.md b/docs/Model/PapdisMessageFunctionCode.md new file mode 100644 index 0000000..22872c4 --- /dev/null +++ b/docs/Model/PapdisMessageFunctionCode.md @@ -0,0 +1,8 @@ +# # PapdisMessageFunctionCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisPayrollPeriod.md b/docs/Model/PapdisPayrollPeriod.md new file mode 100644 index 0000000..f3c85cd --- /dev/null +++ b/docs/Model/PapdisPayrollPeriod.md @@ -0,0 +1,16 @@ +# # PapdisPayrollPeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payPeriodStartDate** | **\DateTime** | [readonly] | [optional] +**payPeriodEndDate** | **\DateTime** | [readonly] | [optional] +**contributionDeductionDate** | **\DateTime** | [readonly] | [optional] +**frequencyCode** | **string** | [readonly] | [optional] +**taxPeriod** | **int** | [readonly] | [optional] +**payReferenceStartDate** | **\DateTime** | [readonly] | [optional] +**payReferenceEndDate** | **\DateTime** | [readonly] | [optional] +**employees** | [**\SynergiTech\Staffology\Model\PapdisEmployee[]**](PapdisEmployee.md) | [readonly] Employees and contributions made in this period | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisPensionProvider.md b/docs/Model/PapdisPensionProvider.md new file mode 100644 index 0000000..04d7cc6 --- /dev/null +++ b/docs/Model/PapdisPensionProvider.md @@ -0,0 +1,11 @@ +# # PapdisPensionProvider + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionProviderId** | **string** | [readonly] Taken from the papdisProviderId property of the PensionProvider | [optional] +**employers** | [**\SynergiTech\Staffology\Model\PapdisEmployer[]**](PapdisEmployer.md) | | [optional] +**accountNo** | **string** | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PapdisVersion.md b/docs/Model/PapdisVersion.md new file mode 100644 index 0000000..866d5cc --- /dev/null +++ b/docs/Model/PapdisVersion.md @@ -0,0 +1,8 @@ +# # PapdisVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerDetails.md b/docs/Model/PartnerDetails.md new file mode 100644 index 0000000..641d646 --- /dev/null +++ b/docs/Model/PartnerDetails.md @@ -0,0 +1,12 @@ +# # PartnerDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **string** | | [optional] +**initials** | **string** | | [optional] +**lastName** | **string** | | [optional] +**niNumber** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayBasis.md b/docs/Model/PayBasis.md new file mode 100644 index 0000000..83eca66 --- /dev/null +++ b/docs/Model/PayBasis.md @@ -0,0 +1,8 @@ +# # PayBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayCode.md b/docs/Model/PayCode.md new file mode 100644 index 0000000..b14963b --- /dev/null +++ b/docs/Model/PayCode.md @@ -0,0 +1,33 @@ +# # PayCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | +**code** | **string** | | +**defaultValue** | **float** | If a non-zero value is provided then when this code is selected in our UI the value will be automatically filled. | [optional] +**isDeduction** | **bool** | If set to true then a PayLine using this code will be treated as a deduction as opposed to an addition. | [optional] +**isNiable** | **bool** | Determines whether or not the value of PayLines using this code should be taken into consideration when calculating National Insurance Contributions. | [optional] +**isTaxable** | **bool** | Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the PAYE liability. | [optional] +**isPensionable** | **bool** | Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the total pensionable pay. | [optional] +**isAttachable** | **bool** | Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the attachable pay for AttachmentOrders. | [optional] +**isRealTimeClass1aNiable** | **bool** | Determines whether or not the value of PayLines using this code are subject to real time Class 1A NIC. | [optional] +**isNotContributingToHolidayPay** | **bool** | If true then any payments made using this code will not contribute towards holiday pay calculations. | [optional] +**isQualifyingEarningsForAe** | **bool** | If true then any payments made using this code will be used as the basis for calculating QualifyingEarnings for AutoEnrolment assessments. If it is set to null then when it's next retrieved it'll have the same value as PensionablePay | [optional] +**isNotTierable** | **bool** | If true then any payments made using this code will not be included when calculating the tier an employee should be on for a Tiered Pension. | [optional] +**isTcpTcls** | **bool** | If true then any payments made using this code will be reported as a Trivial Commutation Payment (A - TCLS) | [optional] +**isTcpPp** | **bool** | If true then any payments made using this code will be reported as a Trivial Commutation Payment (B - Personal Pension) | [optional] +**isTcpOp** | **bool** | If true then any payments made using this code will be reported as a Trivial Commutation Payment (C - Occupational Pension) | [optional] +**flexibleDrawdown** | [**\SynergiTech\Staffology\Model\FlexibleDrawdown**](FlexibleDrawdown.md) | | [optional] +**isAutoAdjust** | **bool** | Can be used to inform a User to what default value to set for PayLine.autoAdjustForLeave for new lines created. | [optional] +**calculationType** | [**\SynergiTech\Staffology\Model\PayCodeCalculationType**](PayCodeCalculationType.md) | | [optional] +**multiplierType** | [**\SynergiTech\Staffology\Model\PayCodeMultiplierType**](PayCodeMultiplierType.md) | | [optional] +**dailyRateMultiplier** | **float** | If the MultiplierType is MultipleOfDailyRate then this sets the multiple to be used, ie 1.5 | [optional] +**hourlyRateMultiplier** | **float** | If the MultiplierType is MultipleOfHourlyRate then this sets the multiple to be used, ie 1.5 | [optional] +**isSystemCode** | **bool** | [readonly] System Codes cannot be deleted or edited | [optional] +**isControlCode** | **bool** | [readonly] Control Codes cannot be deleted or edited nor can PayLines be assigned to them. | [optional] +**isNotional** | **bool** | Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance. | [optional] +**payee** | **string** | The Id of the Payee, if any, that deductions are to be paid to. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayCodeCalculationType.md b/docs/Model/PayCodeCalculationType.md new file mode 100644 index 0000000..32d9ff8 --- /dev/null +++ b/docs/Model/PayCodeCalculationType.md @@ -0,0 +1,8 @@ +# # PayCodeCalculationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayCodeMultiplierType.md b/docs/Model/PayCodeMultiplierType.md new file mode 100644 index 0000000..8e6d084 --- /dev/null +++ b/docs/Model/PayCodeMultiplierType.md @@ -0,0 +1,8 @@ +# # PayCodeMultiplierType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayCodeSet.md b/docs/Model/PayCodeSet.md new file mode 100644 index 0000000..a95426f --- /dev/null +++ b/docs/Model/PayCodeSet.md @@ -0,0 +1,15 @@ +# # PayCodeSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of this PayCodeSet | +**payCodes** | **string[]** | The Code of any PayCodes included in this PayCodeSet | [optional] +**useForMcr** | **bool** | | [optional] +**mcrPayCategory** | [**\SynergiTech\Staffology\Model\McrPayCategory**](McrPayCategory.md) | | [optional] +**useForLgps** | **bool** | Flag indicating if this PayCodeSet will be used for LGPS pay categorisation | [optional] +**lgpsPayCategory** | [**\SynergiTech\Staffology\Model\LgpsPayCategory**](LgpsPayCategory.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayCodeVarianceLine.md b/docs/Model/PayCodeVarianceLine.md new file mode 100644 index 0000000..cbc92a9 --- /dev/null +++ b/docs/Model/PayCodeVarianceLine.md @@ -0,0 +1,11 @@ +# # PayCodeVarianceLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [optional] +**primaryValue** | **float** | | [optional] +**secondaryValue** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayElementReport.md b/docs/Model/PayElementReport.md new file mode 100644 index 0000000..8cbc839 --- /dev/null +++ b/docs/Model/PayElementReport.md @@ -0,0 +1,23 @@ +# # PayElementReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PayElementReportLine[]**](PayElementReportLine.md) | | [optional] +**payCodeTotals** | **array** | | [optional] [readonly] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayElementReportLine.md b/docs/Model/PayElementReportLine.md new file mode 100644 index 0000000..e11b9d7 --- /dev/null +++ b/docs/Model/PayElementReportLine.md @@ -0,0 +1,14 @@ +# # PayElementReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**niNumber** | **string** | | [optional] +**payElements** | **array** | | [optional] +**hasPay** | **bool** | | [optional] [readonly] +**totalPay** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayElementReportReportResponse.md b/docs/Model/PayElementReportReportResponse.md new file mode 100644 index 0000000..7df848c --- /dev/null +++ b/docs/Model/PayElementReportReportResponse.md @@ -0,0 +1,12 @@ +# # PayElementReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayElementReport**](PayElementReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayGradesReport.md b/docs/Model/PayGradesReport.md new file mode 100644 index 0000000..115abc4 --- /dev/null +++ b/docs/Model/PayGradesReport.md @@ -0,0 +1,13 @@ +# # PayGradesReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\AveragePayGradesReportLine[]**](AveragePayGradesReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayGradesReportReportResponse.md b/docs/Model/PayGradesReportReportResponse.md new file mode 100644 index 0000000..7a146a8 --- /dev/null +++ b/docs/Model/PayGradesReportReportResponse.md @@ -0,0 +1,12 @@ +# # PayGradesReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayGradesReport**](PayGradesReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayLine.md b/docs/Model/PayLine.md new file mode 100644 index 0000000..eb6bd0e --- /dev/null +++ b/docs/Model/PayLine.md @@ -0,0 +1,60 @@ +# # PayLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. | [optional] +**rate** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used | [optional] +**multiplier** | **float** | If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours | [optional] +**description** | **string** | A free form description to accompany this line. It will be displayed on the payslip. | [optional] +**attachmentOrderId** | **string** | [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO | [optional] +**pensionId** | **string** | [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS | [optional] +**leaveId** | **string** | [readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay | [optional] +**loanId** | **string** | [readonly] The Id of the associated Loan, if any. | [optional] +**leaveStatutoryDaysPaid** | **float** | [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern). | [optional] +**leaveStatutoryWeeksPaid** | **float** | [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern). | [optional] +**code** | **string** | The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. | [optional] +**tags** | **string[]** | | [optional] +**childId** | **string** | This is nothing but the UniqueId of the model. | [optional] +**isNetToGross** | **bool** | If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. | [optional] +**targetNetToGrossValue** | **float** | The original net fixed addition amount that is considered to be a take home pay target. | [optional] +**netToGrossDiscrepancy** | **float** | The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation. | [optional] +**effectiveFrom** | **\DateTime** | The date the pay line starts being calculated in payrun | [optional] +**effectiveTo** | **\DateTime** | The date the pay line stops being calculated in payrun | [optional] +**department** | **string** | | [optional] +**costCentre** | **string** | | [optional] +**departmentId** | **string** | | [optional] +**costCentreId** | **string** | | [optional] +**isAutoGeneratedBasicPayLine** | **bool** | | [optional] +**percentageOfEffectiveDays** | **float** | The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun | [optional] +**totalWorkingDays** | **float** | | [optional] +**isAutomaticBackPay** | **bool** | Automatically calculate back pay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of back pay lines. | [optional] +**ignoreInitialBackPay** | **bool** | Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. | [optional] +**initialBackPayPublicPayRunId** | **string** | Used to mark the first payrun where this payline has been payrolled for backpay | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**contributesToBasicPay** | **bool** | Indicates whether this pay line contributes to the basic pay of the employee. Will be set to true by default when IsAutoGeneratedBasicPayLine is true. | [optional] +**calculateAsWhenPaid** | **bool** | Indicates whether this pay line should be treated as When Paid rather than When Earned | [optional] +**totalPaidDays** | **float** | | [optional] +**roleId** | **string** | The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. | [optional] +**employeeRoleReference** | **string** | | [optional] +**earnedFrom** | **\DateTime** | Nullable DateTime property \"EarnedFrom\" in the PayLine model to store the start date of the PayLine's 'earned' period in a PayRun. | [optional] +**earnedTo** | **\DateTime** | Nullable DateTime property \"EarnedTo\" in the PayLine model to store the end date of the PayLine's 'earned' period in a PayRun. | [optional] +**periodFrom** | **\DateTime** | Nullable DateTime property \"PeriodFrom\" in the PayLine model to store the start date of the PayRun period the current PayLine is part of. | [optional] +**periodTo** | **\DateTime** | Nullable DateTime property \"PeriodTo\" in the PayLine model to store the end date of the PayRun period the current PayLine is part of. | [optional] +**annualValue** | **float** | The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the pay line value needs calculating or not To recalculate set to null with annual amount recorded in Value | [optional] +**parentId** | **string** | [readonly] The Id of the associated employee level pay line, if the current line is a back pay line. | [optional] +**isAutoCalculatedBackPayLine** | **bool** | | [optional] [readonly] +**isZeroHoursTeachersBackPayLine** | **bool** | [readonly] Indicates whether this pay line is a backdated pay claim line belonging to a zero hours contract teacher. | [optional] +**analysisCategoriesCodes** | [**\SynergiTech\Staffology\Model\AnalysisCategoryCodes[]**](AnalysisCategoryCodes.md) | List of analysis Category Codes | [optional] +**analysisCategoryCodeIds** | **string[]** | List of analysis Category Codes uniqueId | [optional] +**paySpineId** | **string** | [readonly] The Id of the associated pay spine. | [optional] +**paySpineGradeId** | **string** | [readonly] The Id of the associated pay spine grade. | [optional] +**spinalPointId** | **string** | [readonly] The Id of the associated spinal point. | [optional] +**londonAllowanceId** | **int** | Used to set London allowance id for payline | [optional] +**fullTimeAnnualValue** | **float** | Used to set Full Time Annual Value for payline | [optional] +**paySpine** | **string** | PaySpine name based on PaySpineId | [optional] +**payGrade** | **string** | PayGrade name based on PayGradeId | [optional] +**spinePoint** | **string** | SpinePoint name based on SpinePointId | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayMethod.md b/docs/Model/PayMethod.md new file mode 100644 index 0000000..9272183 --- /dev/null +++ b/docs/Model/PayMethod.md @@ -0,0 +1,8 @@ +# # PayMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayOptions.md b/docs/Model/PayOptions.md new file mode 100644 index 0000000..d74733d --- /dev/null +++ b/docs/Model/PayOptions.md @@ -0,0 +1,29 @@ +# # PayOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. | [optional] +**method** | [**\SynergiTech\Staffology\Model\PayMethod**](PayMethod.md) | | [optional] +**withholdTaxRefundIfPayIsZero** | **bool** | If you don't want negative PAYE values when the Gross pay is zero, set this to true | [optional] +**taxAndNi** | [**\SynergiTech\Staffology\Model\TaxAndNi**](TaxAndNi.md) | | [optional] +**fpsFields** | [**\SynergiTech\Staffology\Model\FpsFields**](FpsFields.md) | | [optional] +**tags** | **string[]** | | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**nationalMinimumWage** | **bool** | | [optional] +**payCode** | **string** | If you want the Employees pay to be allocated to a code other than BASIC, specify it here | [optional] +**mileageVehicleType** | [**\SynergiTech\Staffology\Model\MileageVehicleType**](MileageVehicleType.md) | | [optional] +**mapsMiles** | **int** | The number of miles to pay for as Mileage Allowance Payments | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**baseHourlyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**baseDailyRate** | **float** | This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields | [optional] +**basicPay** | **float** | The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay | [optional] +**autoAdjustForLeave** | **bool** | This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun | [optional] +**niTable** | **string** | | [optional] +**regularPayLines** | [**\SynergiTech\Staffology\Model\PayLine[]**](PayLine.md) | These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. | [optional] +**excludedRegularPayLines** | [**\SynergiTech\Staffology\Model\PayLine[]**](PayLine.md) | These used to store the PayLines that have been excluded from RegularPaylines. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayOptionsImport.md b/docs/Model/PayOptionsImport.md new file mode 100644 index 0000000..9692e23 --- /dev/null +++ b/docs/Model/PayOptionsImport.md @@ -0,0 +1,31 @@ +# # PayOptionsImport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employerIdentifier** | **string** | Optional. But if one entry has it then all must. Allows you to import to multiple employers by specifying the Employers AlternativeIdentifier | [optional] +**payrollCode** | **string** | The payroll code of the employee to update | [optional] +**payAmount** | **float** | The amount the Employee is regularly paid each period | [optional] +**basis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**payCode** | **string** | If you want to override the PayCode used for the Basic Pay then set the code here, otherwise leave this blank and the default will be used. | [optional] +**roleReference** | **string** | This is the unique reference of the Role that the employee is assigned to. | [optional] +**payAmountMultiplier** | **float** | This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. | [optional] +**note** | **string** | Any note that you'd like to appear on the payslip | [optional] +**tags** | **string[]** | | [optional] +**isNetToGross** | **bool** | | [optional] +**department** | **string** | Any Department that you'd like to appear on the payslip | [optional] +**costCentre** | **string** | Any CostCentre that you'd like to appear on the payslip | [optional] +**analysisCategoryCodes** | [**\SynergiTech\Staffology\Model\AnalysisCategoryCodes[]**](AnalysisCategoryCodes.md) | List of Analysis Category Codes associated with this item on the payslip. | [optional] +**lines** | [**\SynergiTech\Staffology\Model\PayLine[]**](PayLine.md) | | [optional] +**effectiveFrom** | **\DateTime** | EffectiveFrom date for imported pay lines | [optional] +**effectiveTo** | **\DateTime** | EffectiveTo date for imported pay lines | [optional] +**isAutomaticBackPay** | **bool** | IsAutomaticBackPay for imported pay lines | [optional] +**ignoreInitialBackPay** | **bool** | IgnoreInitialBackPay for imported pay lines | [optional] +**contributesToBasicPay** | **bool** | ContributesToBasicPay for imported pay lines | [optional] +**autoAdjustForLeave** | **bool** | AutoAdjustForLeave for imported pay lines | [optional] +**paySpine** | **string** | PaySpine for imported pay lines | [optional] +**payGrade** | **string** | PayGrade for imported pay lines | [optional] +**spinePoint** | **string** | SpinePoint for imported pay lines | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayPeriodEventType.md b/docs/Model/PayPeriodEventType.md new file mode 100644 index 0000000..c1908e4 --- /dev/null +++ b/docs/Model/PayPeriodEventType.md @@ -0,0 +1,8 @@ +# # PayPeriodEventType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayPeriodTypes.md b/docs/Model/PayPeriodTypes.md new file mode 100644 index 0000000..b3df921 --- /dev/null +++ b/docs/Model/PayPeriodTypes.md @@ -0,0 +1,8 @@ +# # PayPeriodTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayPeriods.md b/docs/Model/PayPeriods.md new file mode 100644 index 0000000..7402c12 --- /dev/null +++ b/docs/Model/PayPeriods.md @@ -0,0 +1,8 @@ +# # PayPeriods + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRun.md b/docs/Model/PayRun.md new file mode 100644 index 0000000..04b5f42 --- /dev/null +++ b/docs/Model/PayRun.md @@ -0,0 +1,27 @@ +# # PayRun + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**taxMonth** | **int** | [readonly] The Tax Month that the Payment Date falls in | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | [readonly] Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod. | [optional] +**period** | **int** | [readonly] The period (i.e, Tax Week or Tax Month) that this PayRun is for. | [optional] +**startDate** | **\DateTime** | [readonly] The start date of the period this PayRun covers | [optional] +**endDate** | **\DateTime** | [readonly] The end date of the period this PayRun covers | [optional] +**paymentDate** | **\DateTime** | [readonly] The intended date that Employees will be paid, although this can be changed on a per PayRunEntry basis | [optional] +**employeeCount** | **int** | [readonly] The number of Employees included in this PayRun (including any CIS Subcontractors) | [optional] +**subContractorCount** | **int** | [readonly] The number of CIS Subcontractors included in this PayRun | [optional] +**nonRtiEmployeeCount** | **int** | [readonly] The number of employees excluded from the RTI submission in this PayRun | [optional] +**totals** | [**\SynergiTech\Staffology\Model\PayRunTotals**](PayRunTotals.md) | | [optional] +**payslipScheduledDateTime** | **\DateTime** | The scheduled date time for sending payslips by email. | [optional] +**state** | [**\SynergiTech\Staffology\Model\PayRunState**](PayRunState.md) | | [optional] +**isClosed** | **bool** | [readonly] Set to True if the PayRun is Finalised and changes can no longer be made | [optional] [readonly] +**isRolledBack** | **bool** | [readonly] Set to True if the PayRun is currently rolled back | [optional] +**dateClosed** | **\DateTime** | | [optional] +**autoPilotCloseDate** | **\DateTime** | [readonly] If AutoPilot is enabled in the AutomationSettings for the Employer then this property will tell you when the payrun will be automatically closed | [optional] +**entries** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The PayRunEntries that make up this PayRun. This is populate automatically when you start a PayRun. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunChanges.md b/docs/Model/PayRunChanges.md new file mode 100644 index 0000000..88a93e8 --- /dev/null +++ b/docs/Model/PayRunChanges.md @@ -0,0 +1,9 @@ +# # PayRunChanges + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payRunEntries** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | A list of PayRunEntries where the PayRunEntry itself has been modified and.or the related Employee record was changed | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunCsvType.md b/docs/Model/PayRunCsvType.md new file mode 100644 index 0000000..334d120 --- /dev/null +++ b/docs/Model/PayRunCsvType.md @@ -0,0 +1,8 @@ +# # PayRunCsvType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunEntry.md b/docs/Model/PayRunEntry.md new file mode 100644 index 0000000..b4dcc96 --- /dev/null +++ b/docs/Model/PayRunEntry.md @@ -0,0 +1,57 @@ +# # PayRunEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**taxMonth** | **int** | [readonly] The Tax Month that the Payment Date falls in | [optional] +**startDate** | **\DateTime** | [readonly] | [optional] +**endDate** | **\DateTime** | [readonly] | [optional] +**note** | **string** | Any note that you'd like to appear on the payslip | [optional] +**bacsSubReference** | **string** | [readonly] A randomly generated string for use with the RTI Hash Cross Reference | [optional] +**bacsHashCode** | **string** | [readonly] A Hash Code used for RTI BACS Hash Cross Reference | [optional] +**percentageOfWorkingDaysPaidAsNormal** | **float** | [readonly] If the employee is paid a set amount per period (ie, not an hourly or daily rate) and there is any Leave that is either Not Paid or Statutory Pay then this value will give the percentage of working days (based on the Working Pattern) that should be paid as normal. If there is no Leave in the period or PayOptions.AutoAdjustForLeave is false, then this will be 1. | [optional] +**workingDaysNotPaidAsNormal** | **float** | [readonly] If PercentageOfWorkingDaysPaidAsNormal has a value other than 1 then this property will tell you how many working days have been deducted from the basic pay due to either being Not Paid or Statutory Pay | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | [readonly] Indicates whether this uses the first, second, third (etc) PaySchedule for this PayPeriod. | [optional] +**period** | **int** | [readonly] The Tax Week or Tax Month number this PayRunEntry relates to | [optional] +**isNewStarter** | **bool** | Determines whether or not this Employee will be declared as a new starter on the resulting FPS | [optional] +**unpaidAbsence** | **bool** | [readonly] Indicates that there was unpaid absence in the pay period | [optional] +**hasAttachmentOrders** | **bool** | [readonly] Indicates that there are AttachmentOrders for this Employee in this entry | [optional] +**paymentDate** | **\DateTime** | The date this payment was or will be made | [optional] +**priorPayrollCode** | **string** | [readonly] If the FPS needs to declare a change of PayId then this will contain the previous code It's worked out automatically but can also be set from the Employees EmploymentDetails property. | [optional] +**pensionSummary** | [**\SynergiTech\Staffology\Model\PensionSummary**](PensionSummary.md) | | [optional] +**pensionSummaries** | [**\SynergiTech\Staffology\Model\PensionSummary[]**](PensionSummary.md) | [readonly] A summary of the details for the Pensions (if any) that the Employee is assigned to. | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**totals** | [**\SynergiTech\Staffology\Model\PayRunTotals**](PayRunTotals.md) | | [optional] +**periodOverrides** | [**\SynergiTech\Staffology\Model\ValueOverride[]**](ValueOverride.md) | Any calculated values for this period that should be overridden with a different value | [optional] +**totalsYtd** | [**\SynergiTech\Staffology\Model\PayRunTotals**](PayRunTotals.md) | | [optional] +**totalsYtdOverrides** | [**\SynergiTech\Staffology\Model\ValueOverride[]**](ValueOverride.md) | Any values of TotalsYtd that should be overridden with a different value | [optional] +**forcedCisVatAmount** | **float** | If this employee is a CIS Subcontractor registered for VAT, we'll automatically work out VAT at the set rate. If you want to override this calculations then set this property to anything other than null. | [optional] +**holidayAccrued** | **float** | The amount of holiday days or hours accrued in the period. | [optional] +**state** | [**\SynergiTech\Staffology\Model\PayRunState**](PayRunState.md) | | [optional] +**isClosed** | **bool** | [readonly] Set to True if the PayRun is Finalised and changes can no longer be made to the PayRunEntries | [optional] [readonly] +**manualNi** | **bool** | If set to true then you must provide your own value for NationalInsuranceCalculation. You'd normally leave this set to false and let us automatically calculate NI amounts. | [optional] +**niSplit** | **bool** | If set to true Ni calculations are done for backdated pay for each pay period separately and then summed up | [optional] +**nationalInsuranceCalculation** | [**\SynergiTech\Staffology\Model\NationalInsuranceCalculation**](NationalInsuranceCalculation.md) | | [optional] +**payrollCodeChanged** | **bool** | [readonly] Indicates whether or not the Payroll Code for this Employee has changed since the last FPS | [optional] [readonly] +**aeNotEnroledWarning** | **bool** | [readonly] If true then this Employee needs to be on an Auto Enrolment pension but isn't yet. | [optional] +**fps** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**emailId** | **string** | If the Payslip for this PayRunEntry has been emailed to the employee then the Id for an EmployerEmail will be provided here. if the value is all zeroes then the email is in the process of being created. | [optional] +**recievingOffsetPay** | **bool** | If the pay is being topped up due to an applied Leave having the offset value set to true then this will be set to true | [optional] +**paymentAfterLeaving** | **bool** | [readonly] If this payment is for an employee that has left then this is set to true. | [optional] +**umbrellaPayment** | [**\SynergiTech\Staffology\Model\UmbrellaPayment**](UmbrellaPayment.md) | | [optional] +**isRemoved** | **bool** | Has the entry been removed from the payrun | [optional] +**isRolledBack** | **bool** | [readonly] Set to True if the Pay Run Entry is currently rolled back | [optional] +**periodsCovered** | **int** | [readonly] The amount of periods that the Pay Run Entry covers. This can be > 1 when back pay for previous periods is paid in the current period | [optional] +**employeeRolePayItems** | [**\SynergiTech\Staffology\Model\EmployeeRolePayItem[]**](EmployeeRolePayItem.md) | [readonly] Automatically populated. Array of base hourly and daily rates for the employee roles | [optional] +**warnings** | [**\SynergiTech\Staffology\Model\PayRunEntryWarningType**](PayRunEntryWarningType.md) | | [optional] +**niLetterError** | [**\SynergiTech\Staffology\Model\NiLetterError**](NiLetterError.md) | | [optional] +**teachersPensionAgeWarning** | [**\SynergiTech\Staffology\Model\TeachersPensionAgeWarning**](TeachersPensionAgeWarning.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] +**personalDetails** | [**\SynergiTech\Staffology\Model\PersonalDetails**](PersonalDetails.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\EmploymentDetails**](EmploymentDetails.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\PayOptions**](PayOptions.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunEntrySortBy.md b/docs/Model/PayRunEntrySortBy.md new file mode 100644 index 0000000..b0c2a9b --- /dev/null +++ b/docs/Model/PayRunEntrySortBy.md @@ -0,0 +1,8 @@ +# # PayRunEntrySortBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunEntryWarningType.md b/docs/Model/PayRunEntryWarningType.md new file mode 100644 index 0000000..e034adf --- /dev/null +++ b/docs/Model/PayRunEntryWarningType.md @@ -0,0 +1,8 @@ +# # PayRunEntryWarningType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunJournal.md b/docs/Model/PayRunJournal.md new file mode 100644 index 0000000..dbd74aa --- /dev/null +++ b/docs/Model/PayRunJournal.md @@ -0,0 +1,20 @@ +# # PayRunJournal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PayRunSummaryLine[]**](PayRunSummaryLine.md) | | [optional] +**date** | **\DateTime** | [readonly] The PaymentDate from the PayRun | [optional] +**title** | **string** | [readonly] The status of the task for posting this journal to an ExternalDataProvider | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusMessage** | **string** | [readonly] A message to elaborate on the Status | [optional] +**link** | **string** | [readonly] If available, a link to the journal in the ExternalDataProvider | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | [readonly] | [optional] +**period** | **int** | [readonly] | [optional] +**mergeMatchingNominals** | **bool** | [readonly] | [optional] +**csvFormat** | [**\SynergiTech\Staffology\Model\JournalCsvFormat**](JournalCsvFormat.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunPayment.md b/docs/Model/PayRunPayment.md new file mode 100644 index 0000000..30b36c4 --- /dev/null +++ b/docs/Model/PayRunPayment.md @@ -0,0 +1,19 @@ +# # PayRunPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\PayeeType**](PayeeType.md) | | [optional] +**payee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**date** | **\DateTime** | [readonly] The date the payment is to be made | [optional] +**method** | [**\SynergiTech\Staffology\Model\PayMethod**](PayMethod.md) | | [optional] +**amount** | **float** | [readonly] The amount to pay | [optional] +**reference** | **string** | [readonly] The period the payment is for | [optional] +**employerPaymentReference** | **string** | The employer's payment reference, formatted as per the employer settings | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**bacsHash** | **string** | [readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsHash included on the FPS | [optional] +**bacsSubReference** | **string** | [readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsSubReference included on the FPS | [optional] +**isBankDetailValid** | **bool** | [readonly] for checking if bank details are valid | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunState.md b/docs/Model/PayRunState.md new file mode 100644 index 0000000..698e07d --- /dev/null +++ b/docs/Model/PayRunState.md @@ -0,0 +1,8 @@ +# # PayRunState + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunStateChange.md b/docs/Model/PayRunStateChange.md new file mode 100644 index 0000000..b6ed6d4 --- /dev/null +++ b/docs/Model/PayRunStateChange.md @@ -0,0 +1,12 @@ +# # PayRunStateChange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**state** | [**\SynergiTech\Staffology\Model\PayRunState**](PayRunState.md) | | [optional] +**reason** | [**\SynergiTech\Staffology\Model\PayRunStateChangeReason**](PayRunStateChangeReason.md) | | [optional] +**reasonText** | **string** | A free-form text field for a reason for the change of state. | [optional] +**employeeUniqueIds** | **string[]** | List of employee unique ids, whose PayRunEntries to be re-opened during a Payrun rollback operation. Will be used only during a transition to a rolled back pay run state | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunStateChangeReason.md b/docs/Model/PayRunStateChangeReason.md new file mode 100644 index 0000000..2d74007 --- /dev/null +++ b/docs/Model/PayRunStateChangeReason.md @@ -0,0 +1,8 @@ +# # PayRunStateChangeReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunSummaryLine.md b/docs/Model/PayRunSummaryLine.md new file mode 100644 index 0000000..da470f1 --- /dev/null +++ b/docs/Model/PayRunSummaryLine.md @@ -0,0 +1,23 @@ +# # PayRunSummaryLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nominalCode** | **string** | [readonly] If you've set up NominalCodeMapping then the relevant Nominal code for the PayCode will be shown here. | [optional] +**departmentCode** | **string** | [readonly] If the journal is split by department then the relevant department code is shown here. | [optional] +**nominalName** | **string** | [readonly] As above | [optional] +**description** | **string** | [readonly] A description of what this line summarises. | [optional] +**qty** | **float** | [readonly] If the PayCode is a Multiplier code then this will contain the number of days/hours | [optional] +**value** | **float** | [readonly] The total value for this line. | [optional] +**payCode** | [**\SynergiTech\Staffology\Model\PayCode**](PayCode.md) | | [optional] +**costCentreCode** | **string** | [readonly] If the journal is split by cost centre then the relevant cost centre code is shown here. | [optional] +**analysisCategories** | [**\SynergiTech\Staffology\Model\AnalysisCategory[]**](AnalysisCategory.md) | [readonly] If the journal is split by analysis categories | [optional] +**analysisCategoryCodes** | [**\SynergiTech\Staffology\Model\AnalysisCategoryCode[]**](AnalysisCategoryCode.md) | [readonly] If the journal is split by analysis categories then the relevant analysis categories code is shown here. | [optional] +**employeeUniqueId** | **string** | [readonly] The EmployeeId this summary line relates to. | [optional] +**journalNarrative** | **string** | [readonly] Gets the journal narrative for the pension, if defined. | [optional] +**pensionId** | **string** | [readonly] The PensionId of the pension associated with this summary line, only present for pension summary lines. | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Employee**](Employee.md) | | [optional] +**unMappedNominalCode** | **string** | [readonly] Unmapped Nominal Code is the Nominal Code without the Nominal Mapping. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunSummaryLineIEnumerableReportResponse.md b/docs/Model/PayRunSummaryLineIEnumerableReportResponse.md new file mode 100644 index 0000000..8b817f2 --- /dev/null +++ b/docs/Model/PayRunSummaryLineIEnumerableReportResponse.md @@ -0,0 +1,12 @@ +# # PayRunSummaryLineIEnumerableReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayRunSummaryLine[]**](PayRunSummaryLine.md) | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayRunTotals.md b/docs/Model/PayRunTotals.md new file mode 100644 index 0000000..a9cf2bf --- /dev/null +++ b/docs/Model/PayRunTotals.md @@ -0,0 +1,86 @@ +# # PayRunTotals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basicPay** | **float** | [readonly] The amount to be paid to this Employee as a result of the PayOptions that have been set | [optional] +**gross** | **float** | [readonly] Gross pay | [optional] +**grossForNi** | **float** | [readonly] The amount of the Gross that is subject to NI | [optional] +**grossForNiNonRti** | **float** | [readonly] The amount of the Gross that is subject to NI but excluded from RTI | [optional] +**grossNotSubjectToEmployersNi** | **float** | [readonly] The amount of the Gross that is not subject to Employers NI. This is the same as GrossForNI where the employees NI Table has an Er contribution | [optional] +**grossNotSubjectToEmployersNiNonRti** | **float** | [readonly] The amount of the Gross that is not subject to Employers NI. This is the same as GrossForNI where the employees NI Table has an Er contribution This is the amount that is excluded from RTI | [optional] +**grossForTax** | **float** | [readonly] The amount of the Gross that is subject to PAYE | [optional] +**employerNi** | **float** | [readonly] | [optional] +**employerNiNonRti** | **float** | [readonly] Employer NI excluded from RTI | [optional] +**employeeNi** | **float** | [readonly] | [optional] +**employeeNiNonRti** | **float** | [readonly] Employee NI excluded from RTI | [optional] +**employerNiOffPayroll** | **float** | [readonly] The amount included in EmployerNi that is in relation to Off-Payroll Workers | [optional] +**realTimeClass1ANi** | **float** | [readonly] | [optional] +**realTimeClass1ANiNonRti** | **float** | [readonly] Real Time Class 1A NI excluded from RTI | [optional] +**tax** | **float** | [readonly] | [optional] +**taxNonRti** | **float** | [readonly] Tax excluded from RTI | [optional] +**netPay** | **float** | [readonly] The Net Pay for this Employee | [optional] +**adjustments** | **float** | [readonly] The value of adjustments made to the Net Pay (Non taxable/NIable additions/deductions) | [optional] +**notionalPay** | **float** | [readonly] The value of adjustments that are of type notional. | [optional] +**additions** | **float** | The value of all additions. This minus Deductions should equal TakeHomePay | [optional] +**deductions** | **float** | The value of all deductions. Additions minus This value should equal TakeHomePay | [optional] +**takeHomePay** | **float** | [readonly] The amount this Employee takes home | [optional] +**nonTaxOrNICPmt** | **float** | [readonly] The value of any payments being made to this Employee that aren't being subjected to PAYE or NI | [optional] +**itemsSubjectToClass1NIC** | **float** | [readonly] Items subject to Class 1 NIC but not taxed under PAYE regulations excluding pension contributions | [optional] +**dednsFromNetPay** | **float** | [readonly] The value of any deductions being made to the Net Pay for this Employee | [optional] +**tcpTcls** | **float** | [readonly] Value of payments marked as Trivial Commutation Payment (A - TCLS) | [optional] +**tcpPp** | **float** | [readonly] Value of payments marked as Trivial Commutation Payment (B - Personal Pension) | [optional] +**tcpOp** | **float** | [readonly] Value of payments marked as Trivial Commutation Payment (C - Occupational Pension) | [optional] +**flexiDdDeath** | **float** | [readonly] Value of payments marked as flexibly accessing death benefit (taxable) | [optional] +**flexiDdDeathNonTax** | **float** | [readonly] Value of payments marked as flexibly accessing death benefit (non taxable) | [optional] +**flexiDdPension** | **float** | [readonly] Value of payments marked as flexibly accessing pension (taxable) | [optional] +**flexiDdPensionNonTax** | **float** | [readonly] Value of payments marked as flexibly accessing pension (non taxable) | [optional] +**flexiDdSeriousIllHealth** | **float** | [readonly] Value of payments marked as flexibly accessing serious ill health lump sum (taxable) | [optional] +**flexiDdSeriousIllHealthNonTax** | **float** | [readonly] Value of payments marked as flexibly accessing serious ill health lump sum (non taxable) | [optional] +**smp** | **float** | [readonly] Statutory Maternity Pay | [optional] +**smpNonRti** | **float** | [readonly] Statutory Maternity Pay excluded from RTI | [optional] +**spp** | **float** | [readonly] Statutory Paternity Pay | [optional] +**sppNonRti** | **float** | [readonly] Statutory Paternity Pay excluded from RTI | [optional] +**sap** | **float** | [readonly] Statutory Adoption Pay | [optional] +**sapNonRti** | **float** | [readonly] Statutory Adoption Pay excluded from RTI | [optional] +**shpp** | **float** | [readonly] Statutory Shared Parental Pay | [optional] +**shppNonRti** | **float** | [readonly] Statutory Shared Parental Pay excluded from RTI | [optional] +**spbp** | **float** | [readonly] Statutory Parental Bereavement Pay | [optional] +**spbpNonRti** | **float** | [readonly] Statutory Parental Bereavement Pay excluded from RTI | [optional] +**ssp** | **float** | [readonly] Statutory Sick Pay | [optional] +**sspNonRti** | **float** | [readonly] Statutory Sick Pay excluded from RTI | [optional] +**studentLoanRecovered** | **float** | [readonly] | [optional] +**studentLoanRecoveredNonRti** | **float** | [readonly] Student Loan recovered excluded from RTI | [optional] +**postgradLoanRecovered** | **float** | [readonly] | [optional] +**postgradLoanRecoveredNonRti** | **float** | [readonly] Postgrad Loan recovered excluded from RTI | [optional] +**pensionableEarnings** | **float** | [readonly] The amount of the Gross that is subject to Pension Deductions. If the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied | [optional] +**pensionablePay** | **float** | [readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. | [optional] +**nonTierablePay** | **float** | [readonly] The value of any pay that shouldn't count towards determining a pension tier. | [optional] +**employeePensionContribution** | **float** | [readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions | [optional] +**employeePensionContributionAvc** | **float** | [readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution | [optional] +**employerPensionContribution** | **float** | [readonly] The value of the Pension Contribution being made by the Employer for this Employee | [optional] +**empeePenContribnsNotPaid** | **float** | [readonly] Value of employee pension contributions that are not paid under 'net pay arrangements', including any AVC | [optional] +**empeePenContribnsPaid** | **float** | [readonly] Value of employee pension contributions paid under 'net pay arrangements', including any AVC | [optional] +**attachmentOrderDeductions** | **float** | [readonly] Value of deductions made due to AttachmentOrders | [optional] +**cisDeduction** | **float** | [readonly] Value of any CIS Deduction made | [optional] +**cisVat** | **float** | [readonly] Value of any VAT paid to CIS Subcontractor | [optional] +**cisUmbrellaFee** | **float** | [readonly] Value of any pre-tax fee charged to the CIS Subcontractor for processing the payment | [optional] +**cisUmbrellaFeePostTax** | **float** | [readonly] Value of any post-tax fee charged to the CIS Subcontractor for processing the payment | [optional] +**pbik** | **float** | [readonly] Value of any Payrolled Benefits In Kind | [optional] +**mapsMiles** | **int** | [readonly] The number of miles paid for Mileage Allowance Payments | [optional] +**foreignTaxAmount** | **float** | [readonly] The amount paid for Foreign Tax Credits in this period | [optional] +**foreignTaxAmountReclaimed** | **float** | [readonly] The amount of Foreign Tax Credits that you actually reclaimed | [optional] +**umbrellaFee** | **float** | [readonly] Value of any Umbrella fee charged for processing the payment | [optional] +**appLevyDeduction** | **float** | [readonly] Value of any Apprenticeship Levy fee deducted for processing the umbrella payment | [optional] +**paymentAfterLeaving** | **float** | [readonly] Payment After Leaving | [optional] +**taxOnPaymentAfterLeaving** | **float** | [readonly] Tax On Payment After Leaving | [optional] +**nilPaid** | **int** | [readonly] The number of employees with NilPaid on the PayRun | [optional] +**leavers** | **int** | [readonly] The number of Leavers on ths PayRun | [optional] +**starters** | **int** | [readonly] The number of Starters on this PayRun | [optional] +**p45Gross** | **float** | [readonly] The value P45 Gross which is held on the Employees Opening Balance | [optional] +**p45Tax** | **float** | [readonly] The value of P45 Tax which is held on the Employees Opening Balance | [optional] +**totalCost** | **float** | | [optional] [readonly] +**recoverableAmounts** | [**\SynergiTech\Staffology\Model\RecoverableAmounts**](RecoverableAmounts.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySchedule.md b/docs/Model/PaySchedule.md new file mode 100644 index 0000000..5b6ad2f --- /dev/null +++ b/docs/Model/PaySchedule.md @@ -0,0 +1,32 @@ +# # PaySchedule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A descriptive name for this PaySchedule | [optional] +**ordinal** | **int** | [readonly] Indicates whether this is first, second, third (etc) PaySchedule for this PayPeriod. | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**firstPeriodEndDate** | **\DateTime** | The last day of the first pay period | [optional] +**firstPaymentDate** | **\DateTime** | The first payment date | [optional] +**paymentDateType** | [**\SynergiTech\Staffology\Model\PaymentDateType**](PaymentDateType.md) | | [optional] +**periodEndDateType** | [**\SynergiTech\Staffology\Model\PaymentDateType**](PaymentDateType.md) | | [optional] +**periodLengths** | **int[]** | Only applicable for PayPeriod of Custom. Defines the length of each period | [optional] +**highGrossPay** | **float** | A gross pay amount considered high for this PaySchedule | [optional] +**highNetPay** | **float** | A net pay amount considered high for this PaySchedule | [optional] +**periodEventsConfig** | [**\SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig**](PaySchedulePeriodEventsConfig.md) | | [optional] +**hasOpenPayRunPeriod** | **bool** | [readonly] Will be true if the employer currently has an open PayRun for this PayPeriod | [optional] +**lastPeriodEndDate** | **\DateTime** | [readonly] The end date of the most recent PayRun on this schedule | [optional] +**lastPeriodNumber** | **int** | [readonly] The period number of the most recent PayRun on this schedule | [optional] +**employeeCount** | **int** | [readonly] The number of employees paid with this PaySchedule | [optional] +**isRequired** | **bool** | [readonly] Whether or not this PaySchedule is required for the employer, ie: they have employees to be paid on this PaySchedule | [optional] [readonly] +**isConfigured** | **bool** | [readonly] Whether or not this PaySchedule has been configured and is ready for use | [optional] +**isYearCompleted** | **bool** | [readonly] Returns true if all PayRuns for this PaySchedule in the TaxYear have been completed | [optional] +**yearEndTasks** | **string[]** | [readonly] A list of actions that need to be completed for this PaySchedule before this TaxYear can be finalised | [optional] +**payRuns** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] Details of PayRuns for this PaySchedule | [optional] +**currentPayRun** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**nextPayRun** | [**\SynergiTech\Staffology\Model\PayRun**](PayRun.md) | | [optional] +**publicCreatedDate** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySchedulePeriod.md b/docs/Model/PaySchedulePeriod.md new file mode 100644 index 0000000..b00909e --- /dev/null +++ b/docs/Model/PaySchedulePeriod.md @@ -0,0 +1,15 @@ +# # PaySchedulePeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paySchedulePeriodEvents** | [**\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]**](PaySchedulePeriodEvent.md) | [readonly] List of all the events in this PaySchedulePeriod | [optional] +**period** | **int** | [readonly] The Period number of the PaySchedulePeriod. | [optional] +**startDate** | **\DateTime** | [readonly] The start date of the PaySchedulePeriod | [optional] +**endDate** | **\DateTime** | [readonly] The end date of the PaySchedulePeriod | [optional] +**paymentDate** | **\DateTime** | The payment date of the PaySchedulePeriod. | [optional] +**unadjustedPaymentDate** | **\DateTime** | The payment date of the PaySchedulePeriod when not accounting for weekends, bank hols or ad-hoc alterations to the pay schedule | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySchedulePeriodEvent.md b/docs/Model/PaySchedulePeriodEvent.md new file mode 100644 index 0000000..68591d0 --- /dev/null +++ b/docs/Model/PaySchedulePeriodEvent.md @@ -0,0 +1,13 @@ +# # PaySchedulePeriodEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payPeriodEventType** | [**\SynergiTech\Staffology\Model\PayPeriodEventType**](PayPeriodEventType.md) | | [optional] +**eventDate** | **\DateTime** | The expected date and time of the event. | [optional] +**actualEventDate** | **\DateTime** | The actual date and time when the event was completed. | [optional] +**isOverDue** | **bool** | Returns true if its past the event date. | [optional] [readonly] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySchedulePeriodEventsConfig.md b/docs/Model/PaySchedulePeriodEventsConfig.md new file mode 100644 index 0000000..3cf51b1 --- /dev/null +++ b/docs/Model/PaySchedulePeriodEventsConfig.md @@ -0,0 +1,14 @@ +# # PaySchedulePeriodEventsConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**submitForProcessing** | **int** | | [optional] +**sendForApproval** | **int** | | [optional] +**approval** | **int** | | [optional] +**finalise** | **int** | | [optional] +**sendPaySlip** | **int** | | [optional] +**submitRti** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySpineReport.md b/docs/Model/PaySpineReport.md new file mode 100644 index 0000000..1f9a691 --- /dev/null +++ b/docs/Model/PaySpineReport.md @@ -0,0 +1,13 @@ +# # PaySpineReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PaySpineReportLine[]**](PaySpineReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySpineReportLine.md b/docs/Model/PaySpineReportLine.md new file mode 100644 index 0000000..bcc3ca5 --- /dev/null +++ b/docs/Model/PaySpineReportLine.md @@ -0,0 +1,25 @@ +# # PaySpineReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spineName** | **string** | Name of the Pay Spine | [optional] +**fullTimeHours** | **float** | Maximum Full Time Hours on this Pay Spine | [optional] +**fullTimeWeeks** | **float** | Maximum Full Time Weeks on this Pay Spine | [optional] +**salaryFormula** | **string** | Formula used to derive annual salary | [optional] +**hourlyDivisor** | **float** | Hours used to determine Hourly Rate | [optional] +**hourlyDecimals** | **int** | Number of decimal places to calculate Hourly Rates | [optional] +**dailyDivisor** | **float** | Days used to determine Full time Daily Rate | [optional] +**dailyDecimals** | **int** | Number of decimal places to calculate Daily Rates | [optional] +**annualDecimals** | **int** | Number of decimal places to calculate Annual Salaries | [optional] +**annualRoundingRule** | [**\SynergiTech\Staffology\Model\AnnualRoundingRule**](AnnualRoundingRule.md) | | [optional] +**incrementRule** | [**\SynergiTech\Staffology\Model\IncrementRule**](IncrementRule.md) | | [optional] +**requiresLondonAllowance** | **bool** | Requires LA column to be completed on the spine | [optional] +**gradeEffectiveDate** | **\DateTime** | Effective date for applicable grades | [optional] +**pointEffectiveDate** | **\DateTime** | Effective date for applicable spinal points | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySpineReportReportResponse.md b/docs/Model/PaySpineReportReportResponse.md new file mode 100644 index 0000000..a78485b --- /dev/null +++ b/docs/Model/PaySpineReportReportResponse.md @@ -0,0 +1,12 @@ +# # PaySpineReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PaySpineReport**](PaySpineReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaySpineYearsServiceEntitlementBasis.md b/docs/Model/PaySpineYearsServiceEntitlementBasis.md new file mode 100644 index 0000000..c68a6e8 --- /dev/null +++ b/docs/Model/PaySpineYearsServiceEntitlementBasis.md @@ -0,0 +1,8 @@ +# # PaySpineYearsServiceEntitlementBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Payee.md b/docs/Model/Payee.md new file mode 100644 index 0000000..ed3ebdb --- /dev/null +++ b/docs/Model/Payee.md @@ -0,0 +1,15 @@ +# # Payee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The name of this Payee | +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**paymentDateRule** | [**\SynergiTech\Staffology\Model\PaymentDateRule**](PaymentDateRule.md) | | [optional] +**paymentDateDayOfWeek** | [**\SynergiTech\Staffology\Model\DayOfWeek**](DayOfWeek.md) | | [optional] +**paymentDateDayOfMonth** | **int** | | [optional] +**hasMinimumBankDetails** | **bool** | Denotes whether the payee has the minimum bank details to receive a payment | [optional] [readonly] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayeeType.md b/docs/Model/PayeeType.md new file mode 100644 index 0000000..4f59f90 --- /dev/null +++ b/docs/Model/PayeeType.md @@ -0,0 +1,8 @@ +# # PayeeType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaylineCalculationData.md b/docs/Model/PaylineCalculationData.md new file mode 100644 index 0000000..95d7646 --- /dev/null +++ b/docs/Model/PaylineCalculationData.md @@ -0,0 +1,15 @@ +# # PaylineCalculationData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fixedAnnualValue** | **float** | PaySpine full time annual value | [optional] +**contractedHours** | **float** | PaySpine contracted hours | [optional] +**contractedWeeks** | **float** | PaySpine contracted weeks | [optional] +**fullTimeEquivalent** | **float** | PaySpine full time equivalent value | [optional] +**fullTimeHours** | **float** | PaySpine full time hours | [optional] +**fullTimeWeeks** | **float** | PaySpine full time weeks | [optional] +**fullTimeSalary** | **float** | PaySpine full time salary | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentDateRule.md b/docs/Model/PaymentDateRule.md new file mode 100644 index 0000000..e173a77 --- /dev/null +++ b/docs/Model/PaymentDateRule.md @@ -0,0 +1,8 @@ +# # PaymentDateRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentDateType.md b/docs/Model/PaymentDateType.md new file mode 100644 index 0000000..55c7837 --- /dev/null +++ b/docs/Model/PaymentDateType.md @@ -0,0 +1,8 @@ +# # PaymentDateType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethodAfterLeaving.md b/docs/Model/PaymentMethodAfterLeaving.md new file mode 100644 index 0000000..ec2c900 --- /dev/null +++ b/docs/Model/PaymentMethodAfterLeaving.md @@ -0,0 +1,8 @@ +# # PaymentMethodAfterLeaving + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentsCsvMapping.md b/docs/Model/PaymentsCsvMapping.md new file mode 100644 index 0000000..7dd4749 --- /dev/null +++ b/docs/Model/PaymentsCsvMapping.md @@ -0,0 +1,36 @@ +# # PaymentsCsvMapping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**type** | [**\SynergiTech\Staffology\Model\PaymentsCsvMappingType**](PaymentsCsvMappingType.md) | | [optional] +**importBehaviour** | **int** | | [optional] +**payBasis** | [**\SynergiTech\Staffology\Model\PayBasis**](PayBasis.md) | | [optional] +**hasHeader** | **bool** | | [optional] +**payrollCodeIndex** | **int** | | [optional] +**employerIdIndex** | **int** | | [optional] +**roleReferenceIndex** | **int** | | [optional] +**payAmountIndex** | **int** | | [optional] +**payAmountMultiplierIndex** | **int** | | [optional] +**noteIndex** | **int** | | [optional] +**payCodeIndex** | **int** | | [optional] +**hasPaylineCosting** | **bool** | | [optional] +**departmentIndex** | **int** | | [optional] +**costCentreIndex** | **int** | | [optional] +**effectiveFromIndex** | **int** | | [optional] +**effectiveToIndex** | **int** | | [optional] +**isAutomaticBackPayIndex** | **int** | | [optional] +**ignoreInitialBackPayIndex** | **int** | | [optional] +**contributesToBasicPayIndex** | **int** | | [optional] +**autoAdjustForLeaveIndex** | **int** | | [optional] +**analysisCategoryIndexesJson** | **string** | | [optional] +**paySpineIndex** | **int** | | [optional] +**payGradeIndex** | **int** | | [optional] +**spinePointIndex** | **int** | | [optional] +**analysisCategoryIndexes** | [**\SynergiTech\Staffology\Model\AnalysisCategoryIndex[]**](AnalysisCategoryIndex.md) | | [optional] +**columns** | [**\SynergiTech\Staffology\Model\PaymentsCsvMappingColumn[]**](PaymentsCsvMappingColumn.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentsCsvMappingColumn.md b/docs/Model/PaymentsCsvMappingColumn.md new file mode 100644 index 0000000..a184000 --- /dev/null +++ b/docs/Model/PaymentsCsvMappingColumn.md @@ -0,0 +1,16 @@ +# # PaymentsCsvMappingColumn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | +**code** | **string** | | [optional] +**isReferenceOnly** | **bool** | If set to true then no PayCode is mapped and this column is just for on-screen refernece only | [optional] +**colIndex** | **int** | | [optional] +**isMultiplier** | **bool** | | [optional] +**isNetToGross** | **bool** | | [optional] +**rateColIndex** | **int** | If the mapping IsMultiplier, then this optionally specifies another column from which to get the value | [optional] +**shouldSerializeRateColIndex** | **bool** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentsCsvMappingType.md b/docs/Model/PaymentsCsvMappingType.md new file mode 100644 index 0000000..bd23136 --- /dev/null +++ b/docs/Model/PaymentsCsvMappingType.md @@ -0,0 +1,8 @@ +# # PaymentsCsvMappingType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisCostBreakdownReport.md b/docs/Model/PayrollAnalysisCostBreakdownReport.md new file mode 100644 index 0000000..eee77f7 --- /dev/null +++ b/docs/Model/PayrollAnalysisCostBreakdownReport.md @@ -0,0 +1,24 @@ +# # PayrollAnalysisCostBreakdownReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportLine[]**](PayrollAnalysisCostBreakdownReportLine.md) | | [optional] +**payCodes** | [**\SynergiTech\Staffology\Model\PayCode[]**](PayCode.md) | | [optional] +**employeesPayRunTotals** | [**\SynergiTech\Staffology\Model\EmployeePayRunTotal[]**](EmployeePayRunTotal.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisCostBreakdownReportLine.md b/docs/Model/PayrollAnalysisCostBreakdownReportLine.md new file mode 100644 index 0000000..6887ae5 --- /dev/null +++ b/docs/Model/PayrollAnalysisCostBreakdownReportLine.md @@ -0,0 +1,32 @@ +# # PayrollAnalysisCostBreakdownReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | | [optional] +**lastName** | **string** | | [optional] +**department** | [**\SynergiTech\Staffology\Model\StringDecimalKeyValuePair**](StringDecimalKeyValuePair.md) | | [optional] +**costCentre** | [**\SynergiTech\Staffology\Model\StringDecimalKeyValuePair**](StringDecimalKeyValuePair.md) | | [optional] +**employeeRoleAnalysisCategory** | [**array**](StringDecimalKeyValuePair.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportValue[]**](PayrollAnalysisCostBreakdownReportValue.md) | | [optional] +**totalPay** | **float** | | [optional] +**niablePay** | **float** | | [optional] +**pensionPay** | **float** | | [optional] +**niPercent** | **float** | | [optional] +**ersNi** | **float** | | [optional] +**pensionPercent** | **float** | | [optional] +**ersPension** | **float** | | [optional] +**taxablePay** | **float** | | [optional] +**taxablePercent** | **float** | | [optional] +**employeeNi** | **float** | | [optional] +**taxPaid** | **float** | | [optional] +**studentLoan** | **float** | | [optional] +**employeePension** | **float** | The value of the Pension Contribution(PENSION) being made by the Employee | [optional] +**employeePensionContributionSalarySacrifice** | **float** | The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee | [optional] +**employeePensionContributionReliefAtSource** | **float** | The value of the Pension Contribution Relief At Source(PENSIONRAS) being made by the Employee | [optional] +**pensionSummaryCostBreakdowns** | [**\SynergiTech\Staffology\Model\PensionSummaryCostBreakdown[]**](PensionSummaryCostBreakdown.md) | List of pension summaries, each representing a breakdown of various pension components | [optional] +**roleId** | **string** | RoleId of that particular line entry | [optional] +**roleWeightage** | **float** | Weightage value of the given employee role | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md b/docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md new file mode 100644 index 0000000..17e3753 --- /dev/null +++ b/docs/Model/PayrollAnalysisCostBreakdownReportReportResponse.md @@ -0,0 +1,12 @@ +# # PayrollAnalysisCostBreakdownReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport**](PayrollAnalysisCostBreakdownReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisCostBreakdownReportValue.md b/docs/Model/PayrollAnalysisCostBreakdownReportValue.md new file mode 100644 index 0000000..aa6affa --- /dev/null +++ b/docs/Model/PayrollAnalysisCostBreakdownReportValue.md @@ -0,0 +1,11 @@ +# # PayrollAnalysisCostBreakdownReportValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qty** | **float** | | [optional] +**code** | **string** | | [optional] +**value** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md new file mode 100644 index 0000000..a40ae6b --- /dev/null +++ b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReport.md @@ -0,0 +1,23 @@ +# # PayrollAnalysisEmployeeRoleBreakdownReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLine[]**](PayrollAnalysisEmployeeRoleBreakdownReportLine.md) | | [optional] +**payCodes** | [**\SynergiTech\Staffology\Model\PayCode[]**](PayCode.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md new file mode 100644 index 0000000..b2041fb --- /dev/null +++ b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.md @@ -0,0 +1,20 @@ +# # PayrollAnalysisEmployeeRoleBreakdownReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**fullEmployee** | [**\SynergiTech\Staffology\Model\Employee**](Employee.md) | | [optional] +**employeeRole** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**department** | [**\SynergiTech\Staffology\Model\DepartmentMembership**](DepartmentMembership.md) | | [optional] +**gross** | **float** | | [optional] +**niableGross** | **float** | | [optional] +**net** | **float** | | [optional] +**takeHome** | **float** | | [optional] +**employerNic** | **float** | | [optional] +**showQtyColumn** | **bool** | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLineValue[]**](PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md) | | [optional] +**ersPension** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md new file mode 100644 index 0000000..fb59b5f --- /dev/null +++ b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.md @@ -0,0 +1,11 @@ +# # PayrollAnalysisEmployeeRoleBreakdownReportLineValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qty** | **float** | | [optional] +**code** | **string** | | [optional] +**value** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md new file mode 100644 index 0000000..7d86498 --- /dev/null +++ b/docs/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.md @@ -0,0 +1,12 @@ +# # PayrollAnalysisEmployeeRoleBreakdownReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport**](PayrollAnalysisEmployeeRoleBreakdownReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrollValueType.md b/docs/Model/PayrollValueType.md new file mode 100644 index 0000000..c130864 --- /dev/null +++ b/docs/Model/PayrollValueType.md @@ -0,0 +1,8 @@ +# # PayrollValueType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrunEmail.md b/docs/Model/PayrunEmail.md new file mode 100644 index 0000000..e2246c6 --- /dev/null +++ b/docs/Model/PayrunEmail.md @@ -0,0 +1,29 @@ +# # PayrunEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isActive** | **bool** | If false then this email won't be sent | [optional] +**name** | **string** | Only used for reference, not included in the email | +**templateType** | [**\SynergiTech\Staffology\Model\EmployerTemplateType**](EmployerTemplateType.md) | | [optional] +**recipientAddress** | **string** | The address to which the email should be sent | +**pdfPassword** | **string** | If a value is provided, then all PDFs attached to the email will be encrypted using this password | [optional] +**attachPayslips** | **bool** | If set to true then Payslips will be attached to the email | [optional] +**payslipsUnemailed** | **bool** | If AttachPayslips is true and this property is also true then only payslips that haven't already been sent directly to employees will be attached. | [optional] +**payslipsSingleFile** | **bool** | If AttachPayslips is true and this property is also true then the payslips will be attached as a single file rather than as separate PDFs, | [optional] +**attachPaymentSummary** | **bool** | If set to True then the PaymentSummary report will be attached to the Email | [optional] +**attachP32** | **bool** | If set to True then the P32 report will be attached to the email | [optional] +**attachP30** | **bool** | If set to True then the P30 report will be attached to the email | [optional] +**attachGrossToNet** | **bool** | If set to True then the GrossToNet report will be attached to the email | [optional] +**attachPensionContributions** | **bool** | If set to True then the Pensions Contributions report will be attached to the email | [optional] +**attachCostAnalysis** | **bool** | If set to True then the Cost Analysis report will be attached to the email | [optional] +**attachCostOfEmployment** | **bool** | If set to True then the Cost of Employment report will be attached to the email | [optional] +**attachFullSummaryOfPay** | **bool** | If set to True then the Full Summary Of Payment report will be attached to the email | [optional] +**attachBankPayments** | **bool** | If set to True then the Bank Payments CSV file will be attached to the email | [optional] +**customSubject** | **string** | If TemplateType is null then you can provide a subject line here to be used for the email | [optional] +**customBody** | **string** | If TemplateType is null then you can provide the body text here to be used for the email | [optional] +**customBodyIsHtml** | **bool** | If the CustomBody is in HTML format, set this to true. | [optional] +**childId** | **string** | This is nothing but the UniqueId of the model. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrunPaymentsReport.md b/docs/Model/PayrunPaymentsReport.md new file mode 100644 index 0000000..e99ba1c --- /dev/null +++ b/docs/Model/PayrunPaymentsReport.md @@ -0,0 +1,26 @@ +# # PayrunPaymentsReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payments** | [**\SynergiTech\Staffology\Model\PayRunPayment[]**](PayRunPayment.md) | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusMessage** | **string** | [readonly] A message to elaborate on the Status | [optional] +**link** | **string** | [readonly] If available, a link to the payments in an ExternalDataProvider | [optional] +**connectedExternalDataProvider** | [**\SynergiTech\Staffology\Model\ExternalDataProvider**](ExternalDataProvider.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayrunPaymentsReportReportResponse.md b/docs/Model/PayrunPaymentsReportReportResponse.md new file mode 100644 index 0000000..b587565 --- /dev/null +++ b/docs/Model/PayrunPaymentsReportReportResponse.md @@ -0,0 +1,12 @@ +# # PayrunPaymentsReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PayrunPaymentsReport**](PayrunPaymentsReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Payslip.md b/docs/Model/Payslip.md new file mode 100644 index 0000000..6084f9f --- /dev/null +++ b/docs/Model/Payslip.md @@ -0,0 +1,39 @@ +# # Payslip + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isClosed** | **bool** | [readonly] Indicates if the Payrun has been finalised | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**periodNumber** | **int** | | [optional] +**period** | **string** | [readonly] A description of the period that Payslip relates to. | [optional] +**from** | **\DateTime** | [readonly] The start date of the period this Payslip covers. | [optional] +**to** | **\DateTime** | [readonly] The end date of the period this Payslip covers. | [optional] +**paymentDate** | **\DateTime** | [readonly] The date the Employee will be paid on | [optional] +**note** | **string** | [readonly] Any note that should appear on the payslip | [optional] +**allowanceNote** | **string** | [readonly] Details of remaining allowance to show on payslip | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**logoUrl** | **string** | [readonly] The Logo to include on the payslip | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**employerAddress** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**hmrcDetails** | [**\SynergiTech\Staffology\Model\HmrcDetails**](HmrcDetails.md) | | [optional] +**payOptions** | [**\SynergiTech\Staffology\Model\PayOptions**](PayOptions.md) | | [optional] +**employmentDetails** | [**\SynergiTech\Staffology\Model\EmploymentDetails**](EmploymentDetails.md) | | [optional] +**personalDetails** | [**\SynergiTech\Staffology\Model\PersonalDetails**](PersonalDetails.md) | | [optional] +**totals** | [**\SynergiTech\Staffology\Model\PayRunTotals**](PayRunTotals.md) | | [optional] +**totalsYtd** | [**\SynergiTech\Staffology\Model\PayRunTotals**](PayRunTotals.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\PayslipLine[]**](PayslipLine.md) | [readonly] The lines to display on the Payslip | [optional] +**employerNi** | **float** | [readonly] The Employer NI Contribution amount | [optional] +**employerPensionContribs** | **float** | [readonly] The Employer Pension Contribution Amount | [optional] +**depts** | [**\SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]**](StringDecimalKeyValuePair.md) | The employees Department Membership(s) at the time the payrun was finalised | [optional] +**umbrellaPayment** | [**\SynergiTech\Staffology\Model\UmbrellaPayment**](UmbrellaPayment.md) | | [optional] +**costCentres** | [**\SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]**](StringDecimalKeyValuePair.md) | The employees Cost Centre Membership(s) only populated when creating journals | [optional] +**employeeRoleAnalysisCategoryCodes** | [**\SynergiTech\Staffology\Model\EmployeeRoleAnalysisCategoryCode[]**](EmployeeRoleAnalysisCategoryCode.md) | The EmployeeRoleAnalysisCategoryCodes only populated when creating journals | [optional] +**employeeCostCentres** | [**\SynergiTech\Staffology\Model\EmployeeCostCentre[]**](EmployeeCostCentre.md) | The Employee Cost Centre Membership(s) by role only populated when creating journals | [optional] +**departmentMemberships** | [**\SynergiTech\Staffology\Model\DepartmentMembership[]**](DepartmentMembership.md) | The Employee Department Membership(s) by role only populated when creating journals | [optional] +**pensionContributionsByRole** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | The Pension Employer contribution by role only populated when creating journals | [optional] +**employerPensionContributions** | [**\SynergiTech\Staffology\Model\EmployerPensionContribution[]**](EmployerPensionContribution.md) | [readonly] The list of Employer Pension Contribution(s) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayslipCustomisation.md b/docs/Model/PayslipCustomisation.md new file mode 100644 index 0000000..9020814 --- /dev/null +++ b/docs/Model/PayslipCustomisation.md @@ -0,0 +1,23 @@ +# # PayslipCustomisation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom** | **bool** | Whether or not you are customising the Payslip. This should always be true if you are providing any other values. | [optional] +**includeLogo** | **bool** | Whether or not to include the employer logo on the payslip. | [optional] +**customCssOption** | [**\SynergiTech\Staffology\Model\ReportCustomCssOption**](ReportCustomCssOption.md) | | [optional] +**customCss** | **string** | | [optional] +**removeYtd** | **bool** | Whether or not to remove the YTD column | [optional] +**includeEmployerAddress** | **bool** | Whether or not to include the employer address | [optional] +**useUmbrellaFormat** | **bool** | If true then the format the payslip will include details of the Umbrella Payment as well as employer costs | [optional] +**filename** | **string** | | [optional] +**includeDepartment** | **bool** | Whether or not to include the primary department of the employee on the payslip | [optional] +**includeHealthAndSocialCareMessage** | **bool** | Whether or not to include health and social car message | [optional] +**includeBenefits** | **bool** | Whether or not to include any payrolled benefits | [optional] +**paperSize** | [**\SynergiTech\Staffology\Model\PdfPaperSize**](PdfPaperSize.md) | | [optional] +**orientation** | [**\SynergiTech\Staffology\Model\PdfPaperOrientation**](PdfPaperOrientation.md) | | [optional] +**margins** | [**\SynergiTech\Staffology\Model\PdfPaperMargins**](PdfPaperMargins.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayslipLine.md b/docs/Model/PayslipLine.md new file mode 100644 index 0000000..7d1f69e --- /dev/null +++ b/docs/Model/PayslipLine.md @@ -0,0 +1,28 @@ +# # PayslipLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\PayslipLineType**](PayslipLineType.md) | | [optional] +**code** | **string** | | [optional] +**description** | **string** | | [optional] +**secondaryDescription** | **string** | | [optional] +**value** | **float** | | [optional] +**multiplier** | **float** | [readonly] If the Code is a multiplier code then this is the multiplier. Value has already been calculated so this is just for reference | [optional] +**attachmentOrderId** | **string** | [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO | [optional] +**pensionId** | **string** | [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS | [optional] +**loanId** | **string** | [readonly] The Id of the associated Loan, if any. | [optional] +**currencySymbol** | **string** | | [optional] +**formattedValue** | **string** | | [optional] [readonly] +**isNetToGross** | **bool** | If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. | [optional] +**targetNetToGrossValue** | **float** | The orginal net fixed addition amount that is considered to be a take home pay target. | [optional] +**leaveId** | **string** | | [optional] +**roleId** | **string** | The employee role which is associated with this payslip line. If set to null, the payslip line is not related with a role. | [optional] +**isAutoCalculatedBackPayLine** | **bool** | | [optional] +**isAutomaticBackPay** | **bool** | | [optional] +**hasSecondaryDescription** | **bool** | | [optional] [readonly] +**contributesToBasicPay** | **bool** | | [optional] +**isNotional** | **bool** | Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayslipLineType.md b/docs/Model/PayslipLineType.md new file mode 100644 index 0000000..84b723f --- /dev/null +++ b/docs/Model/PayslipLineType.md @@ -0,0 +1,8 @@ +# # PayslipLineType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayslipReleaseType.md b/docs/Model/PayslipReleaseType.md new file mode 100644 index 0000000..da48b13 --- /dev/null +++ b/docs/Model/PayslipReleaseType.md @@ -0,0 +1,8 @@ +# # PayslipReleaseType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PayslipReportResponse.md b/docs/Model/PayslipReportResponse.md new file mode 100644 index 0000000..398b39e --- /dev/null +++ b/docs/Model/PayslipReportResponse.md @@ -0,0 +1,12 @@ +# # PayslipReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\Payslip**](Payslip.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PdfPaperMargins.md b/docs/Model/PdfPaperMargins.md new file mode 100644 index 0000000..cf034f9 --- /dev/null +++ b/docs/Model/PdfPaperMargins.md @@ -0,0 +1,12 @@ +# # PdfPaperMargins + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**top** | **float** | | [optional] +**right** | **float** | | [optional] +**bottom** | **float** | | [optional] +**left** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PdfPaperOrientation.md b/docs/Model/PdfPaperOrientation.md new file mode 100644 index 0000000..29b1a27 --- /dev/null +++ b/docs/Model/PdfPaperOrientation.md @@ -0,0 +1,8 @@ +# # PdfPaperOrientation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PdfPaperSize.md b/docs/Model/PdfPaperSize.md new file mode 100644 index 0000000..e7a1f11 --- /dev/null +++ b/docs/Model/PdfPaperSize.md @@ -0,0 +1,8 @@ +# # PdfPaperSize + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PdfPasswordType.md b/docs/Model/PdfPasswordType.md new file mode 100644 index 0000000..fb3df10 --- /dev/null +++ b/docs/Model/PdfPasswordType.md @@ -0,0 +1,8 @@ +# # PdfPasswordType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Pension.md b/docs/Model/Pension.md new file mode 100644 index 0000000..c6def8f --- /dev/null +++ b/docs/Model/Pension.md @@ -0,0 +1,47 @@ +# # Pension + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**contributionLevelType** | [**\SynergiTech\Staffology\Model\PensionContributionLevelType**](PensionContributionLevelType.md) | | [optional] +**endDate** | **\DateTime** | The date the employee left the scheme | [optional] +**endReason** | [**\SynergiTech\Staffology\Model\PensionEndReason**](PensionEndReason.md) | | [optional] +**joinReason** | [**\SynergiTech\Staffology\Model\PensionJoinReason**](PensionJoinReason.md) | | [optional] +**startPayRunEntryId** | **int** | [readonly] Holds the Id for the payroll that the employee joined the scheme | [optional] +**endPayRunEntryId** | **int** | [readonly] Holds the Id for the payroll that the employee left the scheme | [optional] +**startReportingType** | [**\SynergiTech\Staffology\Model\PensionReportingType**](PensionReportingType.md) | | [optional] +**endReportingType** | [**\SynergiTech\Staffology\Model\PensionReportingType**](PensionReportingType.md) | | [optional] +**pensionOpeningBalances** | [**\SynergiTech\Staffology\Model\PensionOpeningBalances**](PensionOpeningBalances.md) | | [optional] +**reasonForLeaving** | **string** | If a value is provided for EndDate then this is the reason for leaving the employee left the scheme | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] +**pensionSchemeId** | **string** | | [optional] +**pensionScheme** | [**\SynergiTech\Staffology\Model\PensionScheme**](PensionScheme.md) | | [optional] +**workerGroupId** | **string** | | [optional] +**workerGroup** | [**\SynergiTech\Staffology\Model\WorkerGroup**](WorkerGroup.md) | | [optional] +**startDate** | **\DateTime** | | [optional] +**memberReferenceNumber** | **string** | | [optional] +**overrideContributions** | **bool** | If this is set to true then the Contributions levels set for the WorkerGroup will be replaced with the values provided here | [optional] +**employeeContribution** | **float** | The amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on EmployeeContributionIsPercentage. This is read-only if OverrideContributions is false | [optional] +**employeeContributionIsPercentage** | **bool** | Determines whether the Value of the EmployeeContribution is a fixed amount or a percentage, | [optional] +**employerContribution** | **float** | The amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on EmployerContributionIsPercentage. This is read-only if OverrideContributions is false | [optional] +**employerContributionIsPercentage** | **bool** | Determines whether the Value of the EmployerContribution is a fixed amount or a percentage, | [optional] +**employerContributionTopUpPercentage** | **float** | Increase Employer Contribution by this percentage of the Employee Contribution | [optional] +**isAeQualifyingScheme** | **bool** | [readonly] Whether or not the associated PensionScheme is a Qualifying Scheme for AutoEnrolment | [optional] +**isTeachersPension** | **bool** | [readonly] Whether or not the associated PensionScheme is a Teachers' Pension (determined by its CsvFormat) | [optional] +**aeStatusAtJoining** | [**\SynergiTech\Staffology\Model\AeStatus**](AeStatus.md) | | [optional] +**externalEmployeeId** | **string** | [readonly] | [optional] +**additionalVoluntaryContribution** | **float** | Any additional voluntary amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage. | [optional] +**avcIsPercentage** | **bool** | Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, | [optional] +**exitViaProvider** | **bool** | | [optional] [readonly] +**teachersPensionDetails** | [**\SynergiTech\Staffology\Model\TeachersPensionDetails**](TeachersPensionDetails.md) | | [optional] +**forcedTier** | **string** | If the WorkerGroup ContributionLevelType is a Tiered Scheme then you can specify the name of the tier to force the employee on to. If none is specified then the Tier is determined by the earnings in the period | [optional] +**forceEnrolment** | **bool** | If the PensionScheme is connected to an ExternalDataProvider that supports enrolment then setting this to true will force this employee to be enrolled with the next submission. | [optional] +**employerContributionIncludesNiSaving** | **bool** | Employer Contribution includes the Employers NI saving | [optional] +**employerContributionNiSavingPercentage** | **float** | Increase Employer Contribution by this percentage of the Employers NI saving | [optional] +**fiftyFiftySchemeMember** | **bool** | if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions. | [optional] +**associatedEmployeeRoles** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | The list of employee roles associated with the pension membership | [optional] +**autoEnrolled** | **bool** | [readonly] Is True if the employee joined this Pension due to an AutoEnrolment action | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionAdministrator.md b/docs/Model/PensionAdministrator.md new file mode 100644 index 0000000..72a742b --- /dev/null +++ b/docs/Model/PensionAdministrator.md @@ -0,0 +1,13 @@ +# # PensionAdministrator + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**email** | **string** | | [optional] +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**telephone** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionContributionLevelType.md b/docs/Model/PensionContributionLevelType.md new file mode 100644 index 0000000..b377276 --- /dev/null +++ b/docs/Model/PensionContributionLevelType.md @@ -0,0 +1,8 @@ +# # PensionContributionLevelType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionContributionsSubmission.md b/docs/Model/PensionContributionsSubmission.md new file mode 100644 index 0000000..d882ec4 --- /dev/null +++ b/docs/Model/PensionContributionsSubmission.md @@ -0,0 +1,20 @@ +# # PensionContributionsSubmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employerId** | **int** | | [optional] +**payRunId** | **int** | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**schemeId** | **int** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**externalId** | **string** | | [optional] +**statusMessage** | **string** | | [optional] +**submissionData** | **mixed** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionCsvFormat.md b/docs/Model/PensionCsvFormat.md new file mode 100644 index 0000000..37e3eba --- /dev/null +++ b/docs/Model/PensionCsvFormat.md @@ -0,0 +1,8 @@ +# # PensionCsvFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionEndReason.md b/docs/Model/PensionEndReason.md new file mode 100644 index 0000000..2a926e3 --- /dev/null +++ b/docs/Model/PensionEndReason.md @@ -0,0 +1,8 @@ +# # PensionEndReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionJoinReason.md b/docs/Model/PensionJoinReason.md new file mode 100644 index 0000000..1247e7b --- /dev/null +++ b/docs/Model/PensionJoinReason.md @@ -0,0 +1,8 @@ +# # PensionJoinReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionMembershipReportLine.md b/docs/Model/PensionMembershipReportLine.md new file mode 100644 index 0000000..09377af --- /dev/null +++ b/docs/Model/PensionMembershipReportLine.md @@ -0,0 +1,39 @@ +# # PensionMembershipReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | Payroll code of the employee | [optional] +**pensionScheme** | **string** | Employee pension scheme | [optional] +**workerGroup** | **string** | The WorkerGroup of the employee pension scheme | [optional] +**joinDate** | **string** | The Join Date of the employee | [optional] +**joinReason** | [**\SynergiTech\Staffology\Model\PensionJoinReason**](PensionJoinReason.md) | | [optional] +**isPensionJoinerActionReported** | **bool** | Indicates whether the pension joiner action is reported. | [optional] +**endDate** | **string** | Pension End Date | [optional] +**endReason** | [**\SynergiTech\Staffology\Model\PensionEndReason**](PensionEndReason.md) | | [optional] +**isPensionLeaverActionReported** | **bool** | Indicates whether the pension leaver action is reported. | [optional] +**aeStatusAtJoining** | [**\SynergiTech\Staffology\Model\AeStatus**](AeStatus.md) | | [optional] +**roleRefs** | **string** | role references of employee | [optional] +**pensionEmployeeContribution** | **float** | Pension Employee Contribution | [optional] +**isEmployeeContributionPercentage** | **bool** | Indicates whether the EmployeeContribution is expressed as a percentage. | [optional] +**pensionTiers** | **string** | Pension Tiers of the employee | [optional] +**pensionAVCContribution** | **float** | Pension AVC Contribution of employee | [optional] +**isAvcPercentage** | **bool** | Indicates whether the AvcContribution is expressed as a percentage. | [optional] +**pensionEmployerContribution** | **float** | Employer Pension Contribution | [optional] +**isEmployerContributionPercentage** | **bool** | Indicates whether the EmployerContribution is expressed as a percentage. | [optional] +**pensionMembershipNo** | **string** | Pension Membership Number | [optional] +**mcrRoleID1** | **string** | MCR Role ID1 for teachers pension | [optional] +**mcrRoleID2** | **string** | MCR Role ID2 for teachers pension | [optional] +**isHalfContributionMember** | **bool** | 50/50 membership | [optional] +**tpAdminNino** | **string** | Teachers Pension Admin Ni Number | [optional] +**pensionableEarningsYTD** | **float** | Pensionable earning year to date | [optional] +**pensionablePayYTD** | **float** | Pensionable Pay year to date | [optional] +**employeePensionYTD** | **float** | Employee pension year to date | [optional] +**avcPensionYTD** | **float** | Additional Voluntary Contribution YTD | [optional] +**employerPensionYTD** | **float** | Employer pension year to date | [optional] +**assumedPensionablePayYTD** | **float** | Assumed pensionable pay year to date | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionMembershipsReport.md b/docs/Model/PensionMembershipsReport.md new file mode 100644 index 0000000..6020656 --- /dev/null +++ b/docs/Model/PensionMembershipsReport.md @@ -0,0 +1,22 @@ +# # PensionMembershipsReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\PensionMembershipReportLine[]**](PensionMembershipReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionMembershipsReportReportResponse.md b/docs/Model/PensionMembershipsReportReportResponse.md new file mode 100644 index 0000000..480976a --- /dev/null +++ b/docs/Model/PensionMembershipsReportReportResponse.md @@ -0,0 +1,12 @@ +# # PensionMembershipsReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\PensionMembershipsReport**](PensionMembershipsReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionOpeningBalances.md b/docs/Model/PensionOpeningBalances.md new file mode 100644 index 0000000..a0879f1 --- /dev/null +++ b/docs/Model/PensionOpeningBalances.md @@ -0,0 +1,14 @@ +# # PensionOpeningBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionableEarnings** | **float** | Opening balances for pensionable earnings | [optional] +**pensionablePay** | **float** | Opening balances for pensionable pay | [optional] +**employeePensionContribution** | **float** | Opening balances for employee pension contribution | [optional] +**employeePensionContributionAvc** | **float** | Opening balances for employee pension contribution avc | [optional] +**employerPensionContribution** | **float** | Opening balances for employer pension contribution | [optional] +**assumedPensionablePay** | **float** | Opening balances for assumed pensionable pay | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionPayCode.md b/docs/Model/PensionPayCode.md new file mode 100644 index 0000000..005a832 --- /dev/null +++ b/docs/Model/PensionPayCode.md @@ -0,0 +1,8 @@ +# # PensionPayCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionProvider.md b/docs/Model/PensionProvider.md new file mode 100644 index 0000000..c78c5f2 --- /dev/null +++ b/docs/Model/PensionProvider.md @@ -0,0 +1,27 @@ +# # PensionProvider + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**accountNo** | **string** | | [optional] +**portal** | **string** | | [optional] +**website** | **string** | | [optional] +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**telephone** | **string** | | [optional] +**papdisVersion** | [**\SynergiTech\Staffology\Model\PapdisVersion**](PapdisVersion.md) | | [optional] +**papdisProviderId** | **string** | | [optional] +**papdisEmployerId** | **string** | | [optional] +**csvFormat** | [**\SynergiTech\Staffology\Model\PensionCsvFormat**](PensionCsvFormat.md) | | [optional] +**excludeNilPaidFromContributions** | **bool** | If we're sending contributions to an external provider then we'll include all employees that were on the payrun. If you want to exclude employees that don't have any contributions to report then set this to true. | [optional] +**payPeriodDateAdjustment** | **int** | If you need to adjust the reported dates of the contributions then you can do so by setting a non-zero value here. A negative value of will move the date back in time. | [optional] +**miscBoolean1** | **bool** | This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it indicates whether or not contributions are reported as \"Tax Weekly/Monthly\" rather than just \"Weekly/Monthly\" | [optional] +**miscBoolean2** | **bool** | This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it indicates whether or not to approve payments after submitting contributions | [optional] +**miscString1** | **string** | This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it dictates the PaymentSource. | [optional] +**miscString2** | **string** | This field has different uses dependent on the ExternalDataProvider, if any. | [optional] +**optOutWindow** | **int** | The number of days or months that an employee has to Opt out after being enrolled | [optional] +**optOutWindowIsMonths** | **bool** | Determines whether the value given for OptOutWindow is in Months (true) or days (false) | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionRefund.md b/docs/Model/PensionRefund.md new file mode 100644 index 0000000..d0ccb07 --- /dev/null +++ b/docs/Model/PensionRefund.md @@ -0,0 +1,22 @@ +# # PensionRefund + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeRefund** | **float** | | +**employerRefund** | **float** | | +**pensionSchemeUniqueId** | **string** | | [optional] +**pensionUniqueId** | **string** | | [optional] +**payInCurrentPayRun** | **bool** | | [optional] +**payRun** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**pensionableEarning** | **float** | | +**pensionablePay** | **float** | | +**additionalVoluntaryContribution** | **float** | | +**assumedPensionablePay** | **float** | | +**tierName** | **string** | | [optional] +**tierRate** | **float** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionReportingType.md b/docs/Model/PensionReportingType.md new file mode 100644 index 0000000..c6dde17 --- /dev/null +++ b/docs/Model/PensionReportingType.md @@ -0,0 +1,8 @@ +# # PensionReportingType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionRule.md b/docs/Model/PensionRule.md new file mode 100644 index 0000000..cd256ea --- /dev/null +++ b/docs/Model/PensionRule.md @@ -0,0 +1,8 @@ +# # PensionRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionScheme.md b/docs/Model/PensionScheme.md new file mode 100644 index 0000000..6fa28c5 --- /dev/null +++ b/docs/Model/PensionScheme.md @@ -0,0 +1,39 @@ +# # PensionScheme + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**provider** | [**\SynergiTech\Staffology\Model\PensionProvider**](PensionProvider.md) | | [optional] +**administrator** | [**\SynergiTech\Staffology\Model\PensionAdministrator**](PensionAdministrator.md) | | [optional] +**pensionRule** | [**\SynergiTech\Staffology\Model\PensionRule**](PensionRule.md) | | [optional] +**qualifyingScheme** | **bool** | Set to true if this is a Qualifying Scheme for Auto Enrolment | [optional] +**disableAeLetters** | **bool** | Set to true if the provider deals with AutoEnrolment Letters and therefore the system should not generate them | [optional] +**subtractBasicRateTax** | **bool** | | [optional] +**payMethod** | [**\SynergiTech\Staffology\Model\PayMethod**](PayMethod.md) | | [optional] +**bankDetails** | [**\SynergiTech\Staffology\Model\BankDetails**](BankDetails.md) | | [optional] +**useCustomPayCodes** | **bool** | If set to true then rather than using the setting on the PayCode to determine if the pay is pensionable we'll instead treat it as pensionable if the Code is included in CustomPayCodes | [optional] +**useCustomPayCodesForTierablePay** | **bool** | If set to true then rather than using the setting on the PayCode to determine if the pay is tierable we'll instead treat it as tierable if the Code is included in TierablePayCustomPayCodes | [optional] +**customPayCodes** | **string[]** | If UseCustomPayCodes is set to true then this contains a list of PayCodes.Code that we'll treat as being pensionable. | [optional] +**tierablePayCustomPayCodes** | **string[]** | If UseCustomPayCodesForTierablePay is set to true then this contains a list of PayCodes.Code that we'll treat as being tierable. | [optional] +**workerGroups** | [**\SynergiTech\Staffology\Model\WorkerGroup[]**](WorkerGroup.md) | A list of WorkerGroups for this Pension. There must always be at least one WorkerGroup | [optional] +**externalDataProviderId** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId**](ExternalDataProviderId.md) | | [optional] +**externalDataCompany** | [**\SynergiTech\Staffology\Model\ExternalDataCompany**](ExternalDataCompany.md) | | [optional] +**payCodeType** | [**\SynergiTech\Staffology\Model\PensionPayCode**](PensionPayCode.md) | | [optional] +**tierablePayPayCodeType** | [**\SynergiTech\Staffology\Model\PensionPayCode**](PensionPayCode.md) | | [optional] +**payCodeSetUniqueId** | **string** | | [optional] +**tierablePayPayCodeSetUniqueId** | **string** | | [optional] +**paymentDateRule** | [**\SynergiTech\Staffology\Model\PaymentDateRule**](PaymentDateRule.md) | | [optional] +**paymentDateDayOfWeek** | [**\SynergiTech\Staffology\Model\DayOfWeek**](DayOfWeek.md) | | [optional] +**paymentDateDayOfMonth** | **int** | | [optional] +**reportOptionsLgpsIConnect** | [**\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect**](PensionSchemeReportOptionsLgpsIConnect.md) | | [optional] +**reportOptionsLgpsCivicaUpm** | [**\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm**](PensionSchemeReportOptionsLgpsCivicaUpm.md) | | [optional] +**deficitValueOrdinal** | **int** | The Ordinal used to identify the PaySchedule which the Deficit will be against | [optional] +**deficitValue** | **float** | The Defict value that will be deducted in a PaySchedule | [optional] +**includeDeficitValue** | **bool** | Set to true if this a Deficit Payment needs to be assigned to a PaySchedule | [optional] +**deficitValuePayPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**nominalCodeMappings** | [**\SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]**](PensionSchemeNominalCodeMapping.md) | The PensionSchemeNominalCodeMappings used to map the PayCodes to a PensionScheme for the journal configuration | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSchemeNominalCodeMapping.md b/docs/Model/PensionSchemeNominalCodeMapping.md new file mode 100644 index 0000000..04a9f71 --- /dev/null +++ b/docs/Model/PensionSchemeNominalCodeMapping.md @@ -0,0 +1,12 @@ +# # PensionSchemeNominalCodeMapping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nominalCode** | **string** | Nominal Code for pension scheme | [optional] +**nominalName** | **string** | Nominal Name | [optional] +**journalNarrative** | **string** | Journal narrative description. | [optional] +**payCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md b/docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md new file mode 100644 index 0000000..d43884c --- /dev/null +++ b/docs/Model/PensionSchemeReportOptionsLgpsCivicaUpm.md @@ -0,0 +1,17 @@ +# # PensionSchemeReportOptionsLgpsCivicaUpm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollNumber** | [**\SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber**](LgpsCivicaPayrollNumber.md) | | [optional] +**casualHours** | [**\SynergiTech\Staffology\Model\LgpsCivicaCasualHours**](LgpsCivicaCasualHours.md) | | [optional] +**omitHeaderLine** | **bool** | | [optional] +**includeFolderNo** | **bool** | | [optional] +**excludeSchoolEmployerName** | **bool** | | [optional] +**addressesForNewJoinersOnly** | **bool** | | [optional] +**proRatePtHoursWeeksWorked** | **bool** | | [optional] +**fullTimeHoursAsOneHundred** | **bool** | | [optional] +**includeWeeksWorkedColumns** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSchemeReportOptionsLgpsIConnect.md b/docs/Model/PensionSchemeReportOptionsLgpsIConnect.md new file mode 100644 index 0000000..67f559a --- /dev/null +++ b/docs/Model/PensionSchemeReportOptionsLgpsIConnect.md @@ -0,0 +1,31 @@ +# # PensionSchemeReportOptionsLgpsIConnect + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fileType** | [**\SynergiTech\Staffology\Model\LgpsIConnectFileType**](LgpsIConnectFileType.md) | | [optional] +**payrollReference1** | [**\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference**](LgpsIConnectPayrollReference.md) | | [optional] +**payrollReference2** | [**\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference**](LgpsIConnectPayrollReference.md) | | [optional] +**payrollReference3** | [**\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference**](LgpsIConnectPayrollReference.md) | | [optional] +**populateEmailAddress** | **bool** | | [optional] +**populateTelephoneNumber** | **bool** | | [optional] +**populateMobileNumber** | **bool** | | [optional] +**populateWorksPlaceName** | **bool** | | [optional] +**populateWorksAddress** | **bool** | | [optional] +**populateWorksEmailAddress** | **bool** | | [optional] +**includeEmploymentBreaks** | **bool** | | [optional] +**breakReasonSmpIndicatorOnly** | **bool** | | [optional] +**populateMaritalStatus** | **bool** | | [optional] +**includeAeQualifyingEarnings** | **bool** | | [optional] +**proRatePtHoursByTermTimeWeeks** | **bool** | | [optional] +**ignoreTermTimeWeeksForFteFinalPay** | **bool** | | [optional] +**showFteAnnualSalaryForFteFinalPay** | **bool** | | [optional] +**casualStaffHoursAsOne** | **bool** | | [optional] +**casualStaffIndicatorAsY** | **bool** | | [optional] +**ignoreHours** | **bool** | | [optional] +**forceUpperCase** | **bool** | | [optional] +**salaryType** | [**\SynergiTech\Staffology\Model\LgpsIConnectSalaryType**](LgpsIConnectSalaryType.md) | | [optional] +**customText** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSelection.md b/docs/Model/PensionSelection.md new file mode 100644 index 0000000..3d96c3d --- /dev/null +++ b/docs/Model/PensionSelection.md @@ -0,0 +1,12 @@ +# # PensionSelection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] +**pensionSchemeId** | **string** | | [optional] +**pensionScheme** | [**\SynergiTech\Staffology\Model\PensionScheme**](PensionScheme.md) | | [optional] +**workerGroupId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSummary.md b/docs/Model/PensionSummary.md new file mode 100644 index 0000000..0f377fb --- /dev/null +++ b/docs/Model/PensionSummary.md @@ -0,0 +1,58 @@ +# # PensionSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionId** | **string** | [readonly] The Id of the Pension. | [optional] +**name** | **string** | [readonly] The name of the PensionScheme to which contributions have been made. | [optional] +**pensionSchemeId** | **string** | [readonly] The Id of the PensionScheme. | [optional] +**startDate** | **\DateTime** | [readonly] Pension Start Date | [optional] +**endDate** | **\DateTime** | Pension End Date | [optional] +**workerGroupId** | **string** | [readonly] The Id of the WorkerGroup. | [optional] +**pensionRule** | [**\SynergiTech\Staffology\Model\PensionRule**](PensionRule.md) | | [optional] +**subtractedBasicRateTax** | **bool** | [readonly] The SubtractedBasicRateTax applied from the PensionScheme SubtractBasicRateTax. | [optional] +**papdisPensionProviderId** | **string** | [readonly] Papdis information from the PensionScheme | [optional] +**papdisEmployerId** | **string** | [readonly] Papdis information from the PensionScheme | [optional] +**employeePensionContributionMultiplier** | **float** | [readonly] If the PensionScheme is set to SubtractBasicRateTax then this value is used to reduce the contribution amount. Otherwise it is set as 1. | [optional] +**additionalVoluntaryContribution** | **float** | [readonly] Any Additional Voluntary Contribution the Employee has chosen to make Otherwise it is set as 1. | [optional] +**avcIsPercentage** | **bool** | [readonly] Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, | [optional] +**autoEnrolled** | **bool** | [readonly] Any Additional Voluntary Contribution the Employee has chosen to make Otherwise it is set as 1. | [optional] +**workerGroup** | [**\SynergiTech\Staffology\Model\WorkerGroup**](WorkerGroup.md) | | [optional] +**forcedTier** | **string** | [readonly] If the WorkerGroup ContributionLevelType is a Tiered Scheme then the name of the tier to force the employee on to may be specified. If none is specified then the Tier is determined by the earnings in the period | [optional] +**tiers** | [**\SynergiTech\Staffology\Model\TieredPensionRate[]**](TieredPensionRate.md) | | [optional] +**assumedPensionablePay** | **float** | [readonly] Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set then it'll be shown here. | [optional] +**pensionablePayCodes** | **string[]** | [readonly] If the pension scheme is set to override the Pensionale PayCodes, then this is what they've been set to. | [optional] +**tierablePayPayCodes** | **string[]** | [readonly] If the pension scheme is set to override the TierablePay PayCodes, then this is what they've been set to. | [optional] +**isHalfContributionMember** | **bool** | if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions. | [optional] +**pensionableEarnings** | **float** | [readonly] The amount of the Gross that is subject to Pension Deductions. If the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied Applied only if an employee has more than one pension assigned to them | [optional] +**pensionablePay** | **float** | [readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. Applied only if an employee has more than one pension assigned to them | [optional] +**nonTierablePay** | **float** | [readonly] The value of any pay that shouldn't count towards determining a pension tier. | [optional] +**employeePensionContribution** | **float** | [readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions | [optional] +**employeePensionContributionAvc** | **float** | [readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution | [optional] +**employerPensionContribution** | **float** | [readonly] The value of the Pension Contribution being made by the Employer for this Employee | [optional] +**isForEndedPension** | **bool** | [readonly] Determines whether the pension summary is related to a pension that has ended or not | [optional] +**associatedEmployeeRoles** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | | [optional] +**notionalPay** | **float** | Pay value based on regular pay lines and the pension's associated roles Set before any adjustments for things like stat payments | [optional] +**pensionableEarningsBfd** | **float** | [readonly] The brought forward Year to Date amount of the Gross that is subject to Pension Deductions. Applied only if an employee has more than one pension assigned to them | [optional] +**pensionablePayBfd** | **float** | [readonly] The brought forward Year to Date amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. Applied only if an employee has more than one pension assigned to them | [optional] +**employeePensionContributionBfd** | **float** | [readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions | [optional] +**assumedPensionablePayBfd** | **float** | [readonly] The brought forward Year to Date value of Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set then it'll be shown here. | [optional] +**employerPensionContributionBfd** | **float** | [readonly] The brought forward Year to Date value of the Pension Contribution being made by the Employer for this Employee | [optional] +**employeePensionContributionAvcBfd** | **float** | [readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution | [optional] +**whenEarnedPensionSummaries** | [**\SynergiTech\Staffology\Model\PensionSummary[]**](PensionSummary.md) | The list of pension summaries created on the base of when earned additions' and deductions' pension calculations for back paid periods | [optional] +**periodFrom** | **\DateTime** | Nullable DateTime property \"PeriodFrom\" to store the start date of the PayPeriod the current PensionSummary is attributable to. Applicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods | [optional] +**periodTo** | **\DateTime** | Nullable DateTime property \"PeriodTo\" to store the start date of the PayPeriod the current PensionSummary is attributable to. Applicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods | [optional] +**whenEarnedPensionableEarningsCorrection** | **float** | [readonly] The when earned amount correction to the Gross that is subject to Pension Deductions. | [optional] +**whenEarnedPensionablePayCorrection** | **float** | [readonly] The when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. | [optional] +**whenEarnedEmployeePensionContributionCorrection** | **float** | [readonly] The when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions | [optional] +**whenEarnedEmployerPensionContributionCorrection** | **float** | [readonly] The when earned amount correction to the Pension Contribution being made by the Employer for this Employee | [optional] +**whenEarnedEmployeePensionContributionAvcCorrection** | **float** | [readonly] The when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution | [optional] +**whenEarnedPensionableEarningsCorrectionBfd** | **float** | [readonly] The brought forward Year to Date when earned amount correction to the Gross that is subject to Pension Deductions. | [optional] +**whenEarnedPensionablePayCorrectionBfd** | **float** | [readonly] The brought forward Year to Date when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. | [optional] +**whenEarnedEmployeePensionContributionCorrectionBfd** | **float** | [readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions | [optional] +**whenEarnedEmployerPensionContributionCorrectionBfd** | **float** | [readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by the Employer for this Employee | [optional] +**whenEarnedEmployeePensionContributionAvcCorrectionBfd** | **float** | [readonly] The brought forward Year to Date when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution | [optional] +**nominalCodeMappings** | [**\SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]**](PensionSchemeNominalCodeMapping.md) | List of Nominal Code Mappings of the Pension | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionSummaryCostBreakdown.md b/docs/Model/PensionSummaryCostBreakdown.md new file mode 100644 index 0000000..bdf18de --- /dev/null +++ b/docs/Model/PensionSummaryCostBreakdown.md @@ -0,0 +1,14 @@ +# # PensionSummaryCostBreakdown + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pensionRule** | [**\SynergiTech\Staffology\Model\PensionRule**](PensionRule.md) | | [optional] +**payCodes** | **string[]** | The list of pay codes associated with this pension rule. | [optional] +**amount** | **float** | The amount associated with this pension entry. | [optional] +**pensionableEarnings** | **float** | The total pensionable earnings relevant to this pension rule. | [optional] +**employeePensionContribution** | **float** | The contribution amount made by the employee towards the pension. | [optional] +**employerPensionContribution** | **float** | The contribution amount made by the employer towards the pension. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionablePayDefinition.md b/docs/Model/PensionablePayDefinition.md new file mode 100644 index 0000000..9bc4dd7 --- /dev/null +++ b/docs/Model/PensionablePayDefinition.md @@ -0,0 +1,8 @@ +# # PensionablePayDefinition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PensionerPayroll.md b/docs/Model/PensionerPayroll.md new file mode 100644 index 0000000..8b78886 --- /dev/null +++ b/docs/Model/PensionerPayroll.md @@ -0,0 +1,12 @@ +# # PensionerPayroll + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inReceiptOfPension** | **bool** | If set to true then the FPS will have the OccPenInd flag set to 'yes' | [optional] +**bereaved** | **bool** | Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner | [optional] +**amount** | **float** | Annual amount of occupational pension | [optional] +**startDate** | **\DateTime** | Start date of occupational Pension | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PeriodValue.md b/docs/Model/PeriodValue.md new file mode 100644 index 0000000..b99aef1 --- /dev/null +++ b/docs/Model/PeriodValue.md @@ -0,0 +1,12 @@ +# # PeriodValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effectiveFrom** | **\DateTime** | The date when these period values are effective | [optional] +**annualValue** | **float** | The Annual value | [optional] +**periodValues** | [**\SynergiTech\Staffology\Model\PeriodValuePeriodValues**](PeriodValuePeriodValues.md) | | [optional] +**midYearChanges** | [**\SynergiTech\Staffology\Model\PeriodValue[]**](PeriodValue.md) | Any optional changes to the period values that are effective from a specified date in the middle of a tax year | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PeriodValuePeriodValues.md b/docs/Model/PeriodValuePeriodValues.md new file mode 100644 index 0000000..9186cbb --- /dev/null +++ b/docs/Model/PeriodValuePeriodValues.md @@ -0,0 +1,14 @@ +# # PeriodValuePeriodValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom** | **float** | | [optional] +**monthly** | **float** | | [optional] +**fourWeekly** | **float** | | [optional] +**fortnightly** | **float** | | [optional] +**weekly** | **float** | | [optional] +**daily** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonalDetails.md b/docs/Model/PersonalDetails.md new file mode 100644 index 0000000..96bc6ba --- /dev/null +++ b/docs/Model/PersonalDetails.md @@ -0,0 +1,31 @@ +# # PersonalDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**maritalStatus** | [**\SynergiTech\Staffology\Model\MaritalStatus**](MaritalStatus.md) | | +**title** | **string** | | [optional] +**firstName** | **string** | | [optional] +**middleName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**alternativeEmail** | **string** | | [optional] +**previousSurName** | **string** | | [optional] +**email** | **string** | | [optional] +**emailPayslip** | **bool** | If set to true then the employees Payslip will be sent by email when a PayRun is finalised. | [optional] +**pdfPassword** | **string** | Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. | [optional] +**pdfPasswordType** | [**\SynergiTech\Staffology\Model\PdfPasswordType**](PdfPasswordType.md) | | [optional] +**emailStatement** | **bool** | Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. | [optional] +**photoUrl** | **string** | | [optional] +**photoSasUrl** | **string** | | [optional] +**telephone** | **string** | | [optional] +**mobile** | **string** | | [optional] +**dateOfBirth** | **\DateTime** | | +**statePensionAge** | **int** | [readonly] Automatically calculated. | [optional] +**gender** | [**\SynergiTech\Staffology\Model\Gender**](Gender.md) | | +**niNumber** | **string** | | [optional] +**passportNumber** | **string** | | [optional] +**partnerDetails** | [**\SynergiTech\Staffology\Model\PartnerDetails**](PartnerDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PricingBand.md b/docs/Model/PricingBand.md new file mode 100644 index 0000000..b039a2c --- /dev/null +++ b/docs/Model/PricingBand.md @@ -0,0 +1,13 @@ +# # PricingBand + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] +**from** | **int** | | [optional] +**to** | **int** | | [optional] +**price** | **float** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PricingTable.md b/docs/Model/PricingTable.md new file mode 100644 index 0000000..759bf62 --- /dev/null +++ b/docs/Model/PricingTable.md @@ -0,0 +1,15 @@ +# # PricingTable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**minimumCharge** | **float** | | [optional] +**bands** | [**\SynergiTech\Staffology\Model\PricingBand[]**](PricingBand.md) | | [optional] +**isDefault** | **bool** | | [optional] +**netSuiteItemCode** | **string** | | [optional] +**netSuiteDescription** | **string** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProRataRule.md b/docs/Model/ProRataRule.md new file mode 100644 index 0000000..a2fe6c6 --- /dev/null +++ b/docs/Model/ProRataRule.md @@ -0,0 +1,8 @@ +# # ProRataRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProcessingNote.md b/docs/Model/ProcessingNote.md new file mode 100644 index 0000000..aad4783 --- /dev/null +++ b/docs/Model/ProcessingNote.md @@ -0,0 +1,19 @@ +# # ProcessingNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payRunEntryId** | **string** | The Id of the payrunEntry this ProcessingNote relates to, if any | [optional] +**note** | **string** | | +**user** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payRun** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**date** | **\DateTime** | | [optional] +**documentCount** | **int** | [readonly] The number of attachments associated with this model | [optional] +**documents** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] The attachments associated with this model | [optional] +**status** | [**\SynergiTech\Staffology\Model\ProcessingNoteStatus**](ProcessingNoteStatus.md) | | [optional] +**updatedByName** | **string** | Name of the user who was last to update the record | [optional] +**completedDate** | **\DateTime** | UpdatedDate is assigned to this to get around the base implementation of UpdatedDate having [JsonIgnore] tag | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProcessingNoteStatus.md b/docs/Model/ProcessingNoteStatus.md new file mode 100644 index 0000000..06e2c79 --- /dev/null +++ b/docs/Model/ProcessingNoteStatus.md @@ -0,0 +1,8 @@ +# # ProcessingNoteStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecoverableAmounts.md b/docs/Model/RecoverableAmounts.md new file mode 100644 index 0000000..2df0563 --- /dev/null +++ b/docs/Model/RecoverableAmounts.md @@ -0,0 +1,21 @@ +# # RecoverableAmounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxMonth** | **int** | | [optional] +**smpRecovered** | **float** | Value of Statutory Maternity Pay recovered year to date | [optional] +**sppRecovered** | **float** | Value of Statutory Paternity Pay recovered year to date | [optional] +**sapRecovered** | **float** | Value of Statutory Adoption Pay recovered year to date | [optional] +**shPPRecovered** | **float** | Value of Shared Parental Pay recovered year to date | [optional] +**spbpRecovered** | **float** | Value of Statutory Parental Bereavement Pay recovered year to date | [optional] +**nicCompensationOnSMP** | **float** | Value of NIC compensation on SMP year to date | [optional] +**nicCompensationOnSPP** | **float** | Value of NIC compensation on Statutory Paternity Pay year to date | [optional] +**nicCompensationOnSAP** | **float** | Value of NIC compensation on Statutory Adoption Pay year to date | [optional] +**nicCompensationOnShPP** | **float** | Value of NIC compensation on Shared Parental Pay year to date | [optional] +**nicCompensationOnSPBP** | **float** | Value of NIC compensation on Statutory Parental Bereavement Pay year to date | [optional] +**cisDeductionsSuffered** | **float** | Value of CIS deductions suffered year to date | [optional] +**total** | **float** | The total value of the reclaimed amounts | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Report.md b/docs/Model/Report.md new file mode 100644 index 0000000..87d2943 --- /dev/null +++ b/docs/Model/Report.md @@ -0,0 +1,8 @@ +# # Report + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportCustomCssOption.md b/docs/Model/ReportCustomCssOption.md new file mode 100644 index 0000000..11a1a89 --- /dev/null +++ b/docs/Model/ReportCustomCssOption.md @@ -0,0 +1,8 @@ +# # ReportCustomCssOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportFormat.md b/docs/Model/ReportFormat.md new file mode 100644 index 0000000..f1df09b --- /dev/null +++ b/docs/Model/ReportFormat.md @@ -0,0 +1,8 @@ +# # ReportFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportPack.md b/docs/Model/ReportPack.md new file mode 100644 index 0000000..94f6664 --- /dev/null +++ b/docs/Model/ReportPack.md @@ -0,0 +1,11 @@ +# # ReportPack + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The name of this ReportPack | +**reports** | [**\SynergiTech\Staffology\Model\Report[]**](Report.md) | The Reports included in this ReportPack | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportResponse.md b/docs/Model/ReportResponse.md new file mode 100644 index 0000000..287b051 --- /dev/null +++ b/docs/Model/ReportResponse.md @@ -0,0 +1,12 @@ +# # ReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | **mixed** | [readonly] If the type is application.json then this will contain a JSON representation of the relevant model | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportSortBy.md b/docs/Model/ReportSortBy.md new file mode 100644 index 0000000..1ba06f9 --- /dev/null +++ b/docs/Model/ReportSortBy.md @@ -0,0 +1,8 @@ +# # ReportSortBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReportTemplate.md b/docs/Model/ReportTemplate.md new file mode 100644 index 0000000..79c956c --- /dev/null +++ b/docs/Model/ReportTemplate.md @@ -0,0 +1,12 @@ +# # ReportTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templateName** | **string** | | +**userName** | **string** | | [optional] +**lastUpdated** | **\DateTime** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RightToWork.md b/docs/Model/RightToWork.md new file mode 100644 index 0000000..3ace735 --- /dev/null +++ b/docs/Model/RightToWork.md @@ -0,0 +1,13 @@ +# # RightToWork + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**checked** | **bool** | | [optional] +**documentType** | [**\SynergiTech\Staffology\Model\RightToWorkDocumentType**](RightToWorkDocumentType.md) | | [optional] +**documentRef** | **string** | | [optional] +**documentExpiry** | **\DateTime** | | [optional] +**note** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RightToWorkDocumentType.md b/docs/Model/RightToWorkDocumentType.md new file mode 100644 index 0000000..a763716 --- /dev/null +++ b/docs/Model/RightToWorkDocumentType.md @@ -0,0 +1,8 @@ +# # RightToWorkDocumentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RightToWorkReport.md b/docs/Model/RightToWorkReport.md new file mode 100644 index 0000000..e228179 --- /dev/null +++ b/docs/Model/RightToWorkReport.md @@ -0,0 +1,14 @@ +# # RightToWorkReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\RightToWorkReportLine[]**](RightToWorkReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RightToWorkReportLine.md b/docs/Model/RightToWorkReportLine.md new file mode 100644 index 0000000..6851d31 --- /dev/null +++ b/docs/Model/RightToWorkReportLine.md @@ -0,0 +1,12 @@ +# # RightToWorkReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] +**rightToWork** | [**\SynergiTech\Staffology\Model\RightToWork**](RightToWork.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RightToWorkReportReportResponse.md b/docs/Model/RightToWorkReportReportResponse.md new file mode 100644 index 0000000..9e8b18d --- /dev/null +++ b/docs/Model/RightToWorkReportReportResponse.md @@ -0,0 +1,12 @@ +# # RightToWorkReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\RightToWorkReport**](RightToWorkReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RoleBasis.md b/docs/Model/RoleBasis.md new file mode 100644 index 0000000..7b776f1 --- /dev/null +++ b/docs/Model/RoleBasis.md @@ -0,0 +1,8 @@ +# # RoleBasis + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RoleType.md b/docs/Model/RoleType.md new file mode 100644 index 0000000..f385c0b --- /dev/null +++ b/docs/Model/RoleType.md @@ -0,0 +1,8 @@ +# # RoleType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiAgent.md b/docs/Model/RtiAgent.md new file mode 100644 index 0000000..6b4a221 --- /dev/null +++ b/docs/Model/RtiAgent.md @@ -0,0 +1,12 @@ +# # RtiAgent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agentId** | **string** | | [optional] +**company** | **string** | | [optional] +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**contact** | [**\SynergiTech\Staffology\Model\RtiContact**](RtiContact.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiContact.md b/docs/Model/RtiContact.md new file mode 100644 index 0000000..5a12640 --- /dev/null +++ b/docs/Model/RtiContact.md @@ -0,0 +1,12 @@ +# # RtiContact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**email** | **string** | | [optional] +**telephone** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiEmployeeAddress.md b/docs/Model/RtiEmployeeAddress.md new file mode 100644 index 0000000..db7b2bc --- /dev/null +++ b/docs/Model/RtiEmployeeAddress.md @@ -0,0 +1,14 @@ +# # RtiEmployeeAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line** | **string[]** | | [optional] +**postcode** | **string** | | [optional] +**postCode** | **string** | | [optional] +**ukPostcode** | **string** | | [optional] +**country** | **string** | | [optional] +**foreignCountry** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiEmployeeName.md b/docs/Model/RtiEmployeeName.md new file mode 100644 index 0000000..6c29db7 --- /dev/null +++ b/docs/Model/RtiEmployeeName.md @@ -0,0 +1,12 @@ +# # RtiEmployeeName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ttl** | **string** | | [optional] +**fore** | **string[]** | | [optional] +**initials** | **string** | | [optional] +**sur** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiSenderType.md b/docs/Model/RtiSenderType.md new file mode 100644 index 0000000..e585706 --- /dev/null +++ b/docs/Model/RtiSenderType.md @@ -0,0 +1,8 @@ +# # RtiSenderType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiSubmissionSettings.md b/docs/Model/RtiSubmissionSettings.md new file mode 100644 index 0000000..327c778 --- /dev/null +++ b/docs/Model/RtiSubmissionSettings.md @@ -0,0 +1,22 @@ +# # RtiSubmissionSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**senderType** | [**\SynergiTech\Staffology\Model\RtiSenderType**](RtiSenderType.md) | | [optional] +**senderId** | **string** | The SenderId used to submit RTI documents to HMRC | [optional] +**password** | **string** | The Password used to submit RTI documents to HMRC | [optional] +**excludeNilPaid** | **bool** | Whether or not to include Employees paid a zero amount on your FPS | [optional] +**includeHashCrossRef** | **bool** | [readonly] Whether or not the Bacs Cross Ref field is included on your FPS submissions This is automatically set to true if you use a bank payments CSV format that supports it or set to false if not | [optional] +**autoSubmitFps** | **bool** | If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun | [optional] +**testInLive** | **bool** | Used for testing the RTI gateway. If set to true then the Document Type name will have \"-TIL\" appended to it | [optional] +**useTestGateway** | **bool** | If set to true then your RTI documents will be sent to HMRCs test services instead of the live service | [optional] +**overrideTimestampValue** | **string** | If a value is provided then it will be used as the timestamp on the RTI submission. This would normally only be used for testing purposes. | [optional] +**contact** | [**\SynergiTech\Staffology\Model\RtiContact**](RtiContact.md) | | [optional] +**agent** | [**\SynergiTech\Staffology\Model\RtiAgent**](RtiAgent.md) | | [optional] +**allowLinkedEps** | **bool** | If set to true this will allow you to submit a combined Employer Payment Summary | [optional] +**shouldCompressFps** | **bool** | If set to true this will compress the FPS before submitting to HMRC | [optional] +**autoSubmitEps** | **bool** | If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiValidationWarning.md b/docs/Model/RtiValidationWarning.md new file mode 100644 index 0000000..01fe988 --- /dev/null +++ b/docs/Model/RtiValidationWarning.md @@ -0,0 +1,10 @@ +# # RtiValidationWarning + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\RtiValidationWarningType**](RtiValidationWarningType.md) | | [optional] +**employeeId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RtiValidationWarningType.md b/docs/Model/RtiValidationWarningType.md new file mode 100644 index 0000000..5e88ebd --- /dev/null +++ b/docs/Model/RtiValidationWarningType.md @@ -0,0 +1,8 @@ +# # RtiValidationWarningType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServiceBand.md b/docs/Model/ServiceBand.md new file mode 100644 index 0000000..b4fe91c --- /dev/null +++ b/docs/Model/ServiceBand.md @@ -0,0 +1,13 @@ +# # ServiceBand + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] +**from** | **int** | | [optional] +**to** | **int** | | [optional] +**entitlementBands** | [**\SynergiTech\Staffology\Model\EntitlementBand[]**](EntitlementBand.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShiftWorkingPatternDay.md b/docs/Model/ShiftWorkingPatternDay.md new file mode 100644 index 0000000..9076c30 --- /dev/null +++ b/docs/Model/ShiftWorkingPatternDay.md @@ -0,0 +1,12 @@ +# # ShiftWorkingPatternDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **int** | | [optional] +**isWorkingDay** | **bool** | | [optional] +**hours** | **float** | | [optional] +**workingPatternHoursType** | [**\SynergiTech\Staffology\Model\WorkingPatternHoursType**](WorkingPatternHoursType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SmtpEncryption.md b/docs/Model/SmtpEncryption.md new file mode 100644 index 0000000..13cd12d --- /dev/null +++ b/docs/Model/SmtpEncryption.md @@ -0,0 +1,8 @@ +# # SmtpEncryption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SmtpSettings.md b/docs/Model/SmtpSettings.md new file mode 100644 index 0000000..a5f4980 --- /dev/null +++ b/docs/Model/SmtpSettings.md @@ -0,0 +1,13 @@ +# # SmtpSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smtpServer** | **string** | | [optional] +**smtpPort** | **int** | | [optional] +**encryption** | [**\SynergiTech\Staffology\Model\SmtpEncryption**](SmtpEncryption.md) | | [optional] +**smtpUsername** | **string** | | [optional] +**smtpPassword** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpinePointReport.md b/docs/Model/SpinePointReport.md new file mode 100644 index 0000000..efd323b --- /dev/null +++ b/docs/Model/SpinePointReport.md @@ -0,0 +1,13 @@ +# # SpinePointReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\SpinePointReportLine[]**](SpinePointReportLine.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpinePointReportLine.md b/docs/Model/SpinePointReportLine.md new file mode 100644 index 0000000..aa4c355 --- /dev/null +++ b/docs/Model/SpinePointReportLine.md @@ -0,0 +1,23 @@ +# # SpinePointReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spineName** | **string** | Spine Name | [optional] +**spinePointName** | **string** | Spine Point Name | [optional] +**number** | **int** | Spine Point Number | [optional] +**effectiveDate** | **\DateTime** | Effective Date of spine point | [optional] +**annualValue** | **float** | Annual Value of spine point | [optional] +**annualValueAltMax** | **float** | Alt Max Annual Value of spine point | [optional] +**annualValueLAInner** | **float** | Annual Value LA Inner of spine point | [optional] +**annualValueLAInnerAltMax** | **float** | Annual Value LA Inner Alt Max of spine point | [optional] +**annualValueLAOuter** | **float** | Annual Value LA Outer of spine point | [optional] +**annualValueLAOuterAltMax** | **float** | Annual Value LA Outer Alt Max of spine point | [optional] +**annualValueLAFringe** | **float** | Annual Value LA Fringe of spine point | [optional] +**annualValueLAFringeAltMax** | **float** | Annual Value LA Fringe Alt Max of spine point | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpinePointReportReportResponse.md b/docs/Model/SpinePointReportReportResponse.md new file mode 100644 index 0000000..dfb1198 --- /dev/null +++ b/docs/Model/SpinePointReportReportResponse.md @@ -0,0 +1,12 @@ +# # SpinePointReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\SpinePointReport**](SpinePointReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StarterDeclaration.md b/docs/Model/StarterDeclaration.md new file mode 100644 index 0000000..475ecd8 --- /dev/null +++ b/docs/Model/StarterDeclaration.md @@ -0,0 +1,8 @@ +# # StarterDeclaration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StarterDetails.md b/docs/Model/StarterDetails.md new file mode 100644 index 0000000..868f24e --- /dev/null +++ b/docs/Model/StarterDetails.md @@ -0,0 +1,12 @@ +# # StarterDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startDate** | **\DateTime** | | +**starterDeclaration** | [**\SynergiTech\Staffology\Model\StarterDeclaration**](StarterDeclaration.md) | | +**overseasEmployerDetails** | [**\SynergiTech\Staffology\Model\OverseasEmployerDetails**](OverseasEmployerDetails.md) | | [optional] +**pensionerPayroll** | [**\SynergiTech\Staffology\Model\PensionerPayroll**](PensionerPayroll.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StartersLeaversFilter.md b/docs/Model/StartersLeaversFilter.md new file mode 100644 index 0000000..58ad61a --- /dev/null +++ b/docs/Model/StartersLeaversFilter.md @@ -0,0 +1,8 @@ +# # StartersLeaversFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatPayFrequency.md b/docs/Model/StatPayFrequency.md new file mode 100644 index 0000000..7b48251 --- /dev/null +++ b/docs/Model/StatPayFrequency.md @@ -0,0 +1,8 @@ +# # StatPayFrequency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatutoryPay.md b/docs/Model/StatutoryPay.md new file mode 100644 index 0000000..4133834 --- /dev/null +++ b/docs/Model/StatutoryPay.md @@ -0,0 +1,11 @@ +# # StatutoryPay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**weeklyParentalLeaveAmount** | **float** | [readonly] | [optional] +**weeklySickPayAmount** | **float** | [readonly] | [optional] +**aweEligibilityThreshold** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatutoryPayReport.md b/docs/Model/StatutoryPayReport.md new file mode 100644 index 0000000..7f06846 --- /dev/null +++ b/docs/Model/StatutoryPayReport.md @@ -0,0 +1,22 @@ +# # StatutoryPayReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\StatutoryPayReportLine[]**](StatutoryPayReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatutoryPayReportLine.md b/docs/Model/StatutoryPayReportLine.md new file mode 100644 index 0000000..08afc14 --- /dev/null +++ b/docs/Model/StatutoryPayReportLine.md @@ -0,0 +1,19 @@ +# # StatutoryPayReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] +**ssp** | **float** | | [optional] +**smp** | **float** | | [optional] +**spp** | **float** | | [optional] +**sap** | **float** | | [optional] +**shpp** | **float** | | [optional] +**spbp** | **float** | | [optional] +**hasStatPay** | **bool** | | [optional] [readonly] +**totalStatPay** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatutoryPayReportReportResponse.md b/docs/Model/StatutoryPayReportReportResponse.md new file mode 100644 index 0000000..06112b1 --- /dev/null +++ b/docs/Model/StatutoryPayReportReportResponse.md @@ -0,0 +1,12 @@ +# # StatutoryPayReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\StatutoryPayReport**](StatutoryPayReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StringDecimalKeyValuePair.md b/docs/Model/StringDecimalKeyValuePair.md new file mode 100644 index 0000000..23ca592 --- /dev/null +++ b/docs/Model/StringDecimalKeyValuePair.md @@ -0,0 +1,10 @@ +# # StringDecimalKeyValuePair + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | | [optional] +**value** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StringStringKeyValuePair.md b/docs/Model/StringStringKeyValuePair.md new file mode 100644 index 0000000..3132446 --- /dev/null +++ b/docs/Model/StringStringKeyValuePair.md @@ -0,0 +1,10 @@ +# # StringStringKeyValuePair + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StudentLoan.md b/docs/Model/StudentLoan.md new file mode 100644 index 0000000..fe04fc4 --- /dev/null +++ b/docs/Model/StudentLoan.md @@ -0,0 +1,8 @@ +# # StudentLoan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StudentLoanRecovered.md b/docs/Model/StudentLoanRecovered.md new file mode 100644 index 0000000..3f38d90 --- /dev/null +++ b/docs/Model/StudentLoanRecovered.md @@ -0,0 +1,10 @@ +# # StudentLoanRecovered + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**planType** | **string** | | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubmissionStatus.md b/docs/Model/SubmissionStatus.md new file mode 100644 index 0000000..2f35832 --- /dev/null +++ b/docs/Model/SubmissionStatus.md @@ -0,0 +1,8 @@ +# # SubmissionStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Tag.md b/docs/Model/Tag.md new file mode 100644 index 0000000..f05799f --- /dev/null +++ b/docs/Model/Tag.md @@ -0,0 +1,11 @@ +# # Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The unique code for this Tag | +**title** | **string** | The title for this Tag | +**color** | **string** | A color to used to represent this Tag, in hex format. ie 'ff0000' | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxAndNi.md b/docs/Model/TaxAndNi.md new file mode 100644 index 0000000..657b7c5 --- /dev/null +++ b/docs/Model/TaxAndNi.md @@ -0,0 +1,19 @@ +# # TaxAndNi + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**niTable** | **string** | The appropriate NI letter for this Employee | +**secondaryClass1NotPayable** | **bool** | If set to true then no Employer NI will be paid for this Employee | [optional] +**postgradLoan** | **bool** | Set to true if the Employee needs to make Post Graduate Loan repayments | [optional] +**postgraduateLoanStartDate** | **\DateTime** | | [optional] +**postgraduateLoanEndDate** | **\DateTime** | | [optional] +**studentLoan** | [**\SynergiTech\Staffology\Model\StudentLoan**](StudentLoan.md) | | [optional] +**studentLoanStartDate** | **\DateTime** | | [optional] +**studentLoanEndDate** | **\DateTime** | | [optional] +**taxCode** | **string** | The Tax Code for this Employee | [optional] +**week1Month1** | **bool** | Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis. This is automatically set to false for any existing Employees when you start a new Tax Year. | [optional] +**foreignTaxCredit** | **bool** | If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxBracket.md b/docs/Model/TaxBracket.md new file mode 100644 index 0000000..015f74d --- /dev/null +++ b/docs/Model/TaxBracket.md @@ -0,0 +1,11 @@ +# # TaxBracket + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | **float** | [readonly] The starting point for applying this tax rate | [optional] +**to** | **float** | [readonly] The end point for applying this tax rate | [optional] +**multiplier** | **float** | [readonly] The tax rate to apply | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxCodeChange.md b/docs/Model/TaxCodeChange.md new file mode 100644 index 0000000..71cc67e --- /dev/null +++ b/docs/Model/TaxCodeChange.md @@ -0,0 +1,10 @@ +# # TaxCodeChange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**suffix** | **string** | [readonly] The suffix of the Tax Code that needs to be incremented for this Tax Year | [optional] +**increment** | **int** | [readonly] The amount by which to increment Tax Codes with the given suffix | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxCodeChangeReport.md b/docs/Model/TaxCodeChangeReport.md new file mode 100644 index 0000000..c05d184 --- /dev/null +++ b/docs/Model/TaxCodeChangeReport.md @@ -0,0 +1,13 @@ +# # TaxCodeChangeReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\TaxCodeChangeValues[]**](TaxCodeChangeValues.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxCodeChangeReportReportResponse.md b/docs/Model/TaxCodeChangeReportReportResponse.md new file mode 100644 index 0000000..7298f4b --- /dev/null +++ b/docs/Model/TaxCodeChangeReportReportResponse.md @@ -0,0 +1,12 @@ +# # TaxCodeChangeReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\TaxCodeChangeReport**](TaxCodeChangeReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxCodeChangeValues.md b/docs/Model/TaxCodeChangeValues.md new file mode 100644 index 0000000..14099c1 --- /dev/null +++ b/docs/Model/TaxCodeChangeValues.md @@ -0,0 +1,17 @@ +# # TaxCodeChangeValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employeeId** | **int** | | [optional] +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payrollCode** | **string** | | [optional] +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**niNumber** | **string** | | [optional] +**periodChange** | **int** | | [optional] +**previousTaxCode** | **string** | | [optional] +**currentTaxCode** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxYear.md b/docs/Model/TaxYear.md new file mode 100644 index 0000000..dd4d3d7 --- /dev/null +++ b/docs/Model/TaxYear.md @@ -0,0 +1,8 @@ +# # TaxYear + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxYearConfig.md b/docs/Model/TaxYearConfig.md new file mode 100644 index 0000000..6940b3c --- /dev/null +++ b/docs/Model/TaxYearConfig.md @@ -0,0 +1,54 @@ +# # TaxYearConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taxYear** | **int** | [readonly] The TaxYear for which this configuration applies | [optional] +**isPreview** | **bool** | [readonly] Indicates that this is a preview of the given years configuration and it shouldn't yet be used for live processing of payroll data. | [optional] +**defaultTaxCode** | **string** | [readonly] | [optional] +**class1ANicsRate** | [**\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue**](DecimalTaxYearConfigPrimitiveValue.md) | | [optional] +**lowerEarningsLimit** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**upperEarningsLimit** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**primaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**secondaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**upperAccrualPoint** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**upperSecondaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**apprenticeUpperSecondaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**freeportsUpperSecondaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**veteransUpperSecondaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**directorsProratePrimaryThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**plan1StudentLoanThreshold** | **float** | [readonly] | [optional] +**plan1StudentLoanRate** | **float** | [readonly] | [optional] +**plan2StudentLoanThreshold** | **float** | [readonly] | [optional] +**plan2StudentLoanRate** | **float** | [readonly] | [optional] +**plan4StudentLoanThreshold** | **float** | [readonly] | [optional] +**plan4StudentLoanRate** | **float** | [readonly] | [optional] +**postGradLoanThreshold** | **float** | [readonly] | [optional] +**postGradLoanRate** | **float** | [readonly] | [optional] +**deaProtectedEarnings** | **float** | [readonly] | [optional] +**pensionLowerThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**pensionAutomaticEnrolment** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**pensionUpperThreshold** | [**\SynergiTech\Staffology\Model\PeriodValue**](PeriodValue.md) | | [optional] +**pensionAeEmployerContribution** | **float** | [readonly] | [optional] +**pensionAeEmployeeContribution** | **float** | [readonly] | [optional] +**employmentAllowancePreviousYear** | **float** | [readonly] | [optional] +**employmentAllowance** | **float** | [readonly] | [optional] +**fixedCodes** | [**\SynergiTech\Staffology\Model\FixedCode[]**](FixedCode.md) | [readonly] | [optional] +**scottishFixedCodes** | [**\SynergiTech\Staffology\Model\FixedCode[]**](FixedCode.md) | [readonly] | [optional] +**welshFixedCodes** | [**\SynergiTech\Staffology\Model\FixedCode[]**](FixedCode.md) | [readonly] | [optional] +**niRates** | [**\SynergiTech\Staffology\Model\NationalInsuranceCode[]**](NationalInsuranceCode.md) | [readonly] | [optional] +**directorsNiRates** | [**\SynergiTech\Staffology\Model\NationalInsuranceCode[]**](NationalInsuranceCode.md) | [readonly] | [optional] +**brackets** | [**\SynergiTech\Staffology\Model\TaxBracket[]**](TaxBracket.md) | [readonly] | [optional] +**scottishBrackets** | [**\SynergiTech\Staffology\Model\TaxBracket[]**](TaxBracket.md) | [readonly] | [optional] +**welshBrackets** | [**\SynergiTech\Staffology\Model\TaxBracket[]**](TaxBracket.md) | [readonly] | [optional] +**taxCodeChanges** | [**\SynergiTech\Staffology\Model\TaxCodeChange[]**](TaxCodeChange.md) | [readonly] | [optional] +**minimumWage** | [**\SynergiTech\Staffology\Model\NationalMinimumWage[]**](NationalMinimumWage.md) | [readonly] | [optional] +**statutoryPay** | [**\SynergiTech\Staffology\Model\StatutoryPay**](StatutoryPay.md) | | [optional] +**loanCharge** | [**\SynergiTech\Staffology\Model\LoanCharge**](LoanCharge.md) | | [optional] +**carCharge** | [**\SynergiTech\Staffology\Model\CarCharge**](CarCharge.md) | | [optional] +**govTalk** | [**\SynergiTech\Staffology\Model\GovTalk**](GovTalk.md) | | [optional] +**mileageAllowancePaymentsRates** | [**\SynergiTech\Staffology\Model\MileageAllowancePaymentsRate[]**](MileageAllowancePaymentsRate.md) | [readonly] | [optional] +**tieredPensions** | [**\SynergiTech\Staffology\Model\TieredPension[]**](TieredPension.md) | [readonly] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxYearTypes.md b/docs/Model/TaxYearTypes.md new file mode 100644 index 0000000..593d025 --- /dev/null +++ b/docs/Model/TaxYearTypes.md @@ -0,0 +1,8 @@ +# # TaxYearTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionAgeWarning.md b/docs/Model/TeachersPensionAgeWarning.md new file mode 100644 index 0000000..08ccac8 --- /dev/null +++ b/docs/Model/TeachersPensionAgeWarning.md @@ -0,0 +1,8 @@ +# # TeachersPensionAgeWarning + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionDetails.md b/docs/Model/TeachersPensionDetails.md new file mode 100644 index 0000000..ed67e64 --- /dev/null +++ b/docs/Model/TeachersPensionDetails.md @@ -0,0 +1,14 @@ +# # TeachersPensionDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employmentType** | [**\SynergiTech\Staffology\Model\TeachersPensionEmploymentType**](TeachersPensionEmploymentType.md) | | [optional] +**fullTimeSalary** | **int** | Up to 7 digits, in pounds. eg 24000 | [optional] +**partTimeSalaryPaid** | **int** | Up to 7 digits, in pounds. eg 24000 | [optional] +**mcrRoleId1** | **string** | Data field for the Contract used for Teachers pension administration | [optional] +**mcrRoleId2** | **string** | The Job role within the contract used for Teachers pension administration | [optional] +**teachersPensionAdminNiNumber** | **string** | Where an employee does not have an NI number yet (or doesn't know their NI number) Teachers Pensions will issue an administrative NI number | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionEmploymentType.md b/docs/Model/TeachersPensionEmploymentType.md new file mode 100644 index 0000000..d6a99da --- /dev/null +++ b/docs/Model/TeachersPensionEmploymentType.md @@ -0,0 +1,8 @@ +# # TeachersPensionEmploymentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionEoyLineItem.md b/docs/Model/TeachersPensionEoyLineItem.md new file mode 100644 index 0000000..d538f7b --- /dev/null +++ b/docs/Model/TeachersPensionEoyLineItem.md @@ -0,0 +1,13 @@ +# # TeachersPensionEoyLineItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tier** | **float** | | [optional] +**percentageRate** | **float** | | [optional] [readonly] +**contributorySalary** | **float** | | [optional] [readonly] +**teachersContributions** | **float** | | [optional] [readonly] +**employersContributions** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionEoyReport.md b/docs/Model/TeachersPensionEoyReport.md new file mode 100644 index 0000000..b4b886d --- /dev/null +++ b/docs/Model/TeachersPensionEoyReport.md @@ -0,0 +1,30 @@ +# # TeachersPensionEoyReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pdfFileName** | **string** | | [optional] [readonly] +**establishment** | [**\SynergiTech\Staffology\Model\Establishment**](Establishment.md) | | [optional] +**lineItems** | [**\SynergiTech\Staffology\Model\TeachersPensionEoyLineItem[]**](TeachersPensionEoyLineItem.md) | | [optional] [readonly] +**careerAverageFlexibilities** | **float** | | [optional] [readonly] +**additionalPensionPayments** | **float** | | [optional] [readonly] +**additionalContributions** | **float** | | [optional] [readonly] +**teachersContributions** | **float** | | [optional] [readonly] +**employersContributions** | **float** | | [optional] [readonly] +**totalContributions** | **float** | | [optional] [readonly] +**efeArrears** | **float** | | [optional] [readonly] +**prestonContributions** | **float** | | [optional] [readonly] +**tr22ElectionAmounts** | **float** | | [optional] [readonly] +**totalExtraContributions** | **float** | | [optional] [readonly] +**overallBalance** | **float** | | [optional] [readonly] +**employersContributionPercentage** | **float** | | [optional] [readonly] +**totalContributorySalary** | **float** | | [optional] [readonly] +**totalTeachersContributions** | **float** | | [optional] [readonly] +**totalEmployersContributions** | **float** | | [optional] [readonly] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TeachersPensionEoyReportReportResponse.md b/docs/Model/TeachersPensionEoyReportReportResponse.md new file mode 100644 index 0000000..7276444 --- /dev/null +++ b/docs/Model/TeachersPensionEoyReportReportResponse.md @@ -0,0 +1,12 @@ +# # TeachersPensionEoyReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\TeachersPensionEoyReport**](TeachersPensionEoyReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Tenant.md b/docs/Model/Tenant.md new file mode 100644 index 0000000..dc7736a --- /dev/null +++ b/docs/Model/Tenant.md @@ -0,0 +1,36 @@ +# # Tenant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**brandCode** | **string** | [readonly] | [optional] +**appName** | **string** | | [optional] +**homeUrl** | **string** | | [optional] +**headContent** | **string** | | [optional] +**logOutUrl** | **string** | | [optional] +**loginImgUrl** | **string** | [readonly] | [optional] +**homeImgUrl** | **string** | [readonly] | [optional] +**favIcon** | **string** | [readonly] | [optional] +**cssColorsFile** | **string** | [readonly] | [optional] +**cssFile** | **string** | [readonly] | [optional] +**mailingList** | **bool** | | [optional] +**htmlInsertions** | [**\SynergiTech\Staffology\Model\TenantHtmlInsertion[]**](TenantHtmlInsertion.md) | | [optional] +**mailSettings** | [**\SynergiTech\Staffology\Model\MailSettings**](MailSettings.md) | | [optional] +**signupUrl** | **string** | | [optional] +**termsUrl** | **string** | | [optional] +**helpUrl** | **string** | | [optional] +**supportEmail** | **string** | | [optional] +**newUserSignupEmail** | **string** | | [optional] +**approveNewUsers** | **bool** | | [optional] +**enableBureauFeatures** | **bool** | | [optional] +**requireDdMandateBeforeAllowingBillableActivity** | **bool** | | [optional] +**whiteLabelMode** | **bool** | | [optional] +**enableReportWriterFeature** | **bool** | Indicates if the Report Writer feature is enabled for the tenant. | [optional] +**disableEvc** | **bool** | Indicates whether FPS should be submitted to EVC for employees/employers under this tenant. | [optional] +**tenantOwnsBilling** | **bool** | [readonly] | [optional] +**billingSettings** | [**\SynergiTech\Staffology\Model\TenantBillingSettings**](TenantBillingSettings.md) | | [optional] +**usersCanManageAccountSecuritySettings** | **bool** | If the users are allowed manage their own account security settings through a page or portal defined by their current authentication provider | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantBillingSettings.md b/docs/Model/TenantBillingSettings.md new file mode 100644 index 0000000..471240f --- /dev/null +++ b/docs/Model/TenantBillingSettings.md @@ -0,0 +1,15 @@ +# # TenantBillingSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**discount** | **float** | | [optional] +**monthlyMinimum** | **float** | | [optional] +**aggregatedPricing** | **bool** | | [optional] +**billTo** | **string** | If all activity for a Tenant is being biulled to a specifc user, set the email address here | [optional] +**pricingTable** | **string** | If BillTo is set, then specify a Pricing Table to use from the Staffology tenant, otherwise the default Staffology Pricing Table will be used | [optional] +**netSuiteDefaultItemCode** | **string** | [readonly] The item code used in the NetSuite billing if not specified in the pricing table | [optional] +**netSuiteDefaultDescription** | **string** | [readonly] The product description used in the NetSuite billing if not specified in the pricing table | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantEmail.md b/docs/Model/TenantEmail.md new file mode 100644 index 0000000..f69a950 --- /dev/null +++ b/docs/Model/TenantEmail.md @@ -0,0 +1,23 @@ +# # TenantEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toName** | **string** | | +**toEmail** | **string** | | +**subject** | **string** | | +**buttonText** | **string** | | [optional] +**buttonLink** | **string** | | [optional] +**bodyPreview** | **string** | | [optional] +**body** | **string** | | [optional] +**afterBtnBody** | **string** | | [optional] +**status** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusDate** | **\DateTime** | | [optional] +**statusMessage** | **string** | | [optional] +**sendAttempts** | **int** | | [optional] +**webAppBaseUrl** | **string** | | [optional] +**attachments** | [**\SynergiTech\Staffology\Model\EmailAttachment[]**](EmailAttachment.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantHtmlInsertion.md b/docs/Model/TenantHtmlInsertion.md new file mode 100644 index 0000000..ddbabed --- /dev/null +++ b/docs/Model/TenantHtmlInsertion.md @@ -0,0 +1,10 @@ +# # TenantHtmlInsertion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**insertionPoint** | [**\SynergiTech\Staffology\Model\HtmlInsertionPoint**](HtmlInsertionPoint.md) | | [optional] +**content** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TenantItem.md b/docs/Model/TenantItem.md new file mode 100644 index 0000000..c856325 --- /dev/null +++ b/docs/Model/TenantItem.md @@ -0,0 +1,12 @@ +# # TenantItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**metadata** | **mixed** | | [optional] +**url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TieredPension.md b/docs/Model/TieredPension.md new file mode 100644 index 0000000..f855b10 --- /dev/null +++ b/docs/Model/TieredPension.md @@ -0,0 +1,11 @@ +# # TieredPension + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\PensionContributionLevelType**](PensionContributionLevelType.md) | | [optional] +**rates** | [**\SynergiTech\Staffology\Model\TieredPensionRate[]**](TieredPensionRate.md) | | [optional] +**employerContribRate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TieredPensionRate.md b/docs/Model/TieredPensionRate.md new file mode 100644 index 0000000..070b60c --- /dev/null +++ b/docs/Model/TieredPensionRate.md @@ -0,0 +1,12 @@ +# # TieredPensionRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**rangeStart** | **float** | | [optional] +**rate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UmbrellaPayment.md b/docs/Model/UmbrellaPayment.md new file mode 100644 index 0000000..5f935f1 --- /dev/null +++ b/docs/Model/UmbrellaPayment.md @@ -0,0 +1,17 @@ +# # UmbrellaPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | When importing multiple UmbrellaPayments this field is used to identify the employee | [optional] +**chargePerTimesheet** | **float** | Override the settings for this employer by specifying a ChargePerTimeSheet. Or leave it as null to use the settings from the Employer | [optional] +**invoiceValue** | **float** | | [optional] +**mapsMiles** | **int** | | [optional] +**otherExpenses** | **float** | | [optional] +**numberOfTimesheets** | **int** | | [optional] +**hoursWorked** | **float** | | [optional] +**grossDeduction** | **float** | | [optional] +**grossAddition** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UmbrellaReconciliationReport.md b/docs/Model/UmbrellaReconciliationReport.md new file mode 100644 index 0000000..9263b96 --- /dev/null +++ b/docs/Model/UmbrellaReconciliationReport.md @@ -0,0 +1,22 @@ +# # UmbrellaReconciliationReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\UmbrellaReconciliationReportLine[]**](UmbrellaReconciliationReportLine.md) | | [optional] +**employer** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**payPeriod** | [**\SynergiTech\Staffology\Model\PayPeriods**](PayPeriods.md) | | [optional] +**ordinal** | **int** | | [optional] +**period** | **int** | | [optional] +**periodTo** | **int** | | [optional] +**startPeriodName** | **string** | | [optional] +**endPeriodName** | **string** | | [optional] +**startDate** | **\DateTime** | | [optional] +**endDate** | **\DateTime** | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UmbrellaReconciliationReportLine.md b/docs/Model/UmbrellaReconciliationReportLine.md new file mode 100644 index 0000000..7d5dca1 --- /dev/null +++ b/docs/Model/UmbrellaReconciliationReportLine.md @@ -0,0 +1,26 @@ +# # UmbrellaReconciliationReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**period** | **string** | | [optional] +**payrollCode** | **string** | | [optional] +**department** | **string** | | [optional] +**totalGross** | **float** | | [optional] +**netPay** | **float** | | [optional] +**tax** | **float** | | [optional] +**employeeNi** | **float** | | [optional] +**employerNi** | **float** | | [optional] +**employeePension** | **float** | | [optional] +**employerPension** | **float** | | [optional] +**expenses** | **float** | | [optional] +**fee** | **float** | | [optional] +**appLevy** | **float** | | [optional] +**invoiceValue** | **float** | | [optional] +**employeeCosts** | **float** | | [optional] [readonly] +**employerCosts** | **float** | | [optional] [readonly] +**total** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UmbrellaReconciliationReportReportResponse.md b/docs/Model/UmbrellaReconciliationReportReportResponse.md new file mode 100644 index 0000000..1ff919a --- /dev/null +++ b/docs/Model/UmbrellaReconciliationReportReportResponse.md @@ -0,0 +1,12 @@ +# # UmbrellaReconciliationReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\UmbrellaReconciliationReport**](UmbrellaReconciliationReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UmbrellaSettings.md b/docs/Model/UmbrellaSettings.md new file mode 100644 index 0000000..94d59dd --- /dev/null +++ b/docs/Model/UmbrellaSettings.md @@ -0,0 +1,18 @@ +# # UmbrellaSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | [optional] +**chargePerTimesheet** | **float** | | [optional] +**apprenticeshipLevyDednRate** | **float** | | [optional] +**holidayRate** | **float** | | [optional] +**dpsbCode** | **string** | | [optional] +**expensesCode** | **string** | | [optional] +**grossDeductionCode** | **string** | | [optional] +**holidayCode** | **string** | | [optional] +**cisFeeCode** | **string** | | [optional] +**detailFeeInComment** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UsageBill.md b/docs/Model/UsageBill.md new file mode 100644 index 0000000..cefe82f --- /dev/null +++ b/docs/Model/UsageBill.md @@ -0,0 +1,24 @@ +# # UsageBill + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**year** | **int** | | [optional] +**month** | **int** | | [optional] +**payslipCount** | **int** | | [optional] +**previouslyBilledPayslipCount** | **int** | The number of payslips that appear in the usage, but were billed in a previous period | [optional] +**netCost** | **float** | Net cost of any payslips, or the Pricing Table minimum, whichever is greater. | [optional] +**discount** | **float** | | [optional] +**partnerDiscountAmount** | **float** | | [optional] +**monthlyMinimum** | **float** | This is actually an offset against the NetCost and doesn't contain the full MonthlyMinimum. | [optional] +**total** | **float** | | [optional] [readonly] +**paid** | **bool** | | [optional] +**usage** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | | [optional] +**accountingCustomerId** | **string** | | [optional] +**accountingInvoiceId** | **string** | | [optional] +**accountingInvoiceLink** | **string** | | [optional] +**useNetSuite** | **bool** | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/User.md b/docs/Model/User.md new file mode 100644 index 0000000..69e438a --- /dev/null +++ b/docs/Model/User.md @@ -0,0 +1,57 @@ +# # User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**\SynergiTech\Staffology\Model\UserCategory**](UserCategory.md) | | [optional] +**emailAddress** | **string** | | [optional] +**pendingEmailAddress** | **string** | If the user has requested to change their email address then the address it'll be changed to after verification will be shown here. | [optional] +**firstName** | **string** | | [optional] +**lastName** | **string** | | [optional] +**salutation** | **string** | | [optional] +**userIdentifier** | **string** | | [optional] +**photo** | **string** | | [optional] +**photoSasUrl** | **string** | | [optional] +**role** | [**\SynergiTech\Staffology\Model\UserRole**](UserRole.md) | | [optional] +**jobType** | [**\SynergiTech\Staffology\Model\UserJobType**](UserJobType.md) | | [optional] +**jobTitle** | **string** | | [optional] +**telephoneNumber** | **string** | | [optional] +**businessName** | **string** | | [optional] +**industry** | [**\SynergiTech\Staffology\Model\UserIndustry**](UserIndustry.md) | | [optional] +**address** | [**\SynergiTech\Staffology\Model\Address**](Address.md) | | [optional] +**statedEmployeeCount** | **int** | | [optional] +**emailVerified** | **bool** | | [optional] +**emailVerificationKey** | **string** | | [optional] +**gdprOptin** | **bool** | | [optional] +**inviteCode** | **string** | | [optional] +**registrationIp** | **string** | | [optional] +**registrationDate** | **\DateTime** | | [optional] +**lastLogin** | **\DateTime** | | [optional] +**isActivated** | **bool** | | [optional] +**authorization** | [**\SynergiTech\Staffology\Model\UserAuthorization**](UserAuthorization.md) | | [optional] +**isSuperAdmin** | **bool** | | [optional] +**canUseBureauFeatures** | **bool** | | [optional] +**canUseBetaFeatures** | **bool** | | [optional] +**canUseReportWriter** | **bool** | Indicates whether the user has permission to use the report writer feature. | [optional] +**isBilledInNetSuite** | **bool** | | [optional] +**tenant** | [**\SynergiTech\Staffology\Model\Tenant**](Tenant.md) | | [optional] +**requestDdSetup** | **bool** | [readonly] If true then the user is required to set up a direct debit mandate | [optional] +**disabled** | **bool** | [readonly] If true then any employers the owner managed will not be able to run new payruns. DisabledReason will give a reason why the account is disabled | [optional] +**canCreateEmployers** | **bool** | [readonly] If false then the user cannot create new employers. This can be turned on or off by the tenant admin. | [optional] +**disabledReason** | **string** | | [optional] +**directDebitMandate** | [**\SynergiTech\Staffology\Model\DirectDebitMandate**](DirectDebitMandate.md) | | [optional] +**displayPrefs** | [**\SynergiTech\Staffology\Model\UserDisplayPreferences**](UserDisplayPreferences.md) | | [optional] +**showBills** | **bool** | [readonly] Whether or not the user can see bills. This will be false if the Tenant manages billing and the user is not an admin for the Tenant | [optional] +**accountingCustomerId** | **string** | [readonly] Used internally to manage billing | [optional] +**pricingTableId** | **string** | | [optional] +**utmInfo** | [**\SynergiTech\Staffology\Model\UtmInfo**](UtmInfo.md) | | [optional] +**firstBillableActivityDate** | **\DateTime** | | [optional] +**bureauNotificationEmailAddress** | **string** | If an email address is provided here then Bureau-related notifications will go to this address instead of the EmailAddress | [optional] +**monthlyMinimum** | [**\SynergiTech\Staffology\Model\MonthlyMinimum**](MonthlyMinimum.md) | | [optional] +**apiMailingEnabled** | **bool** | Flag to keep the user up-to-date with any API changes and inform about upcoming breaking changes. | [optional] +**loginDisabled** | **bool** | [readonly] If true then the user will not have login permissions | [optional] +**isBureauMember** | **bool** | Indicates whether the user is a bureau member. | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserAuthorization.md b/docs/Model/UserAuthorization.md new file mode 100644 index 0000000..2103de3 --- /dev/null +++ b/docs/Model/UserAuthorization.md @@ -0,0 +1,10 @@ +# # UserAuthorization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employers** | [**\SynergiTech\Staffology\Model\EmployerItem[]**](EmployerItem.md) | [readonly] A list of any Employers that the user can access | [optional] +**tenants** | [**\SynergiTech\Staffology\Model\TenantItem[]**](TenantItem.md) | [readonly] A list of any Tenants that the user can administrate | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserCategory.md b/docs/Model/UserCategory.md new file mode 100644 index 0000000..1605e5e --- /dev/null +++ b/docs/Model/UserCategory.md @@ -0,0 +1,8 @@ +# # UserCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserDisplayPreferences.md b/docs/Model/UserDisplayPreferences.md new file mode 100644 index 0000000..d5fa807 --- /dev/null +++ b/docs/Model/UserDisplayPreferences.md @@ -0,0 +1,24 @@ +# # UserDisplayPreferences + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startPage** | [**\SynergiTech\Staffology\Model\UserstartPage**](UserstartPage.md) | | [optional] +**showZeroes** | **bool** | | [optional] +**showTaxCodeWhenViewingPayrunEntry** | **bool** | | [optional] +**allowJournalResubmit** | **bool** | | [optional] +**hideSalaryOnEmployeeIndexPage** | **bool** | | [optional] +**enableMultiEmployerImport** | **bool** | | [optional] +**enableCovid19Features** | **bool** | | [optional] +**hidePayslipCheckboxes** | **bool** | | [optional] +**hidePayslipSearchAndSort** | **bool** | | [optional] +**showYtdInPayslipView** | **bool** | | [optional] +**enableDpsXmlUpload** | **bool** | | [optional] +**enableRtiTimestampOverride** | **bool** | | [optional] +**enablePayrunWarnings** | **bool** | | [optional] +**enableWorkingDaysOverrides** | **bool** | | [optional] +**enablePayrunPagination** | **bool** | | [optional] +**dontHideFpsEmployeeList** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserIndustry.md b/docs/Model/UserIndustry.md new file mode 100644 index 0000000..bfacbdd --- /dev/null +++ b/docs/Model/UserIndustry.md @@ -0,0 +1,8 @@ +# # UserIndustry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserJobType.md b/docs/Model/UserJobType.md new file mode 100644 index 0000000..9abff97 --- /dev/null +++ b/docs/Model/UserJobType.md @@ -0,0 +1,8 @@ +# # UserJobType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserRole.md b/docs/Model/UserRole.md new file mode 100644 index 0000000..63e6501 --- /dev/null +++ b/docs/Model/UserRole.md @@ -0,0 +1,8 @@ +# # UserRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserstartPage.md b/docs/Model/UserstartPage.md new file mode 100644 index 0000000..ec562f8 --- /dev/null +++ b/docs/Model/UserstartPage.md @@ -0,0 +1,8 @@ +# # UserstartPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UtmInfo.md b/docs/Model/UtmInfo.md new file mode 100644 index 0000000..4526722 --- /dev/null +++ b/docs/Model/UtmInfo.md @@ -0,0 +1,13 @@ +# # UtmInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | **string** | | [optional] +**medium** | **string** | | [optional] +**term** | **string** | | [optional] +**content** | **string** | | [optional] +**campaign** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ValueOverride.md b/docs/Model/ValueOverride.md new file mode 100644 index 0000000..db5787e --- /dev/null +++ b/docs/Model/ValueOverride.md @@ -0,0 +1,15 @@ +# # ValueOverride + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\PayrollValueType**](PayrollValueType.md) | | [optional] +**value** | **float** | The value to use in place of the original value | [optional] +**originalValue** | **float** | [readonly] The original value | [optional] +**note** | **string** | The reason given for the override | [optional] +**attachmentOrderId** | **string** | The Id of the AttachmentOrder. Only relevant if the Type is set to AttachmentOrderDeductions | [optional] +**pensionId** | **string** | The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS | [optional] +**leaveId** | **string** | The Id of the associated Leave. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VarianceReport.md b/docs/Model/VarianceReport.md new file mode 100644 index 0000000..2a4a042 --- /dev/null +++ b/docs/Model/VarianceReport.md @@ -0,0 +1,21 @@ +# # VarianceReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**showDifferenceAsPercentage** | **bool** | | [optional] +**minimumChangePercentage** | **float** | | [optional] +**primary** | [**\SynergiTech\Staffology\Model\GrossToNetReport**](GrossToNetReport.md) | | [optional] +**secondary** | [**\SynergiTech\Staffology\Model\GrossToNetReport**](GrossToNetReport.md) | | [optional] +**joiners** | [**\SynergiTech\Staffology\Model\GrossToNetReportLine[]**](GrossToNetReportLine.md) | | [optional] [readonly] +**leavers** | [**\SynergiTech\Staffology\Model\GrossToNetReportLine[]**](GrossToNetReportLine.md) | | [optional] [readonly] +**hasDepartments** | **bool** | | [optional] [readonly] +**commonLines** | [**\SynergiTech\Staffology\Model\GrossToNetReportLine[]**](GrossToNetReportLine.md) | | [optional] [readonly] +**hasVariances** | **bool** | | [optional] [readonly] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VarianceReportReportResponse.md b/docs/Model/VarianceReportReportResponse.md new file mode 100644 index 0000000..29e8711 --- /dev/null +++ b/docs/Model/VarianceReportReportResponse.md @@ -0,0 +1,12 @@ +# # VarianceReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\VarianceReport**](VarianceReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VeteranDetails.md b/docs/Model/VeteranDetails.md new file mode 100644 index 0000000..5ce2938 --- /dev/null +++ b/docs/Model/VeteranDetails.md @@ -0,0 +1,10 @@ +# # VeteranDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**isVeteran** | **bool** | Set to true if the employee is a veteran | [optional] +**firstCivilianEmploymentDate** | **\DateTime** | Date of Veteran's first civilian employment | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WarningsReport.md b/docs/Model/WarningsReport.md new file mode 100644 index 0000000..d74cfc4 --- /dev/null +++ b/docs/Model/WarningsReport.md @@ -0,0 +1,10 @@ +# # WarningsReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lines** | [**\SynergiTech\Staffology\Model\WarningsReportLine[]**](WarningsReportLine.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WarningsReportLine.md b/docs/Model/WarningsReportLine.md new file mode 100644 index 0000000..104d9b7 --- /dev/null +++ b/docs/Model/WarningsReportLine.md @@ -0,0 +1,12 @@ +# # WarningsReportLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrollCode** | **string** | | [optional] +**employeeName** | **string** | | [optional] +**warningType** | [**\SynergiTech\Staffology\Model\PayRunEntryWarningType**](PayRunEntryWarningType.md) | | [optional] +**warningMessage** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WarningsReportReportResponse.md b/docs/Model/WarningsReportReportResponse.md new file mode 100644 index 0000000..354645f --- /dev/null +++ b/docs/Model/WarningsReportReportResponse.md @@ -0,0 +1,12 @@ +# # WarningsReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\WarningsReport**](WarningsReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Webhook.md b/docs/Model/Webhook.md new file mode 100644 index 0000000..002b83a --- /dev/null +++ b/docs/Model/Webhook.md @@ -0,0 +1,14 @@ +# # Webhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**webhookEvent** | [**\SynergiTech\Staffology\Model\WebhookEvent**](WebhookEvent.md) | | [optional] +**url** | **string** | The Url to which the payload should be sent | +**active** | **bool** | If set to false then this Webhook will not be triggered | [optional] +**eventCount** | **int** | The number of times this webhook has been triggered | [optional] +**lastPayload** | [**\SynergiTech\Staffology\Model\WebhookPayload**](WebhookPayload.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhookEvent.md b/docs/Model/WebhookEvent.md new file mode 100644 index 0000000..5603a1d --- /dev/null +++ b/docs/Model/WebhookEvent.md @@ -0,0 +1,8 @@ +# # WebhookEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhookPayload.md b/docs/Model/WebhookPayload.md new file mode 100644 index 0000000..603182a --- /dev/null +++ b/docs/Model/WebhookPayload.md @@ -0,0 +1,17 @@ +# # WebhookPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | [readonly] A descriptive name for this payload | [optional] +**url** | **string** | [readonly] The Url that payload will be sent to | +**attempts** | **int** | [readonly] The number of attempts that have been made to deliver this payload | [optional] +**statusCode** | **int** | [readonly] The status code received from the Url | [optional] +**taskStatus** | [**\SynergiTech\Staffology\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | | [optional] +**statusMessage** | **string** | [readonly] A message to accompany the status | [optional] +**created** | **\DateTime** | [readonly] The date and time this payload was created | [optional] [readonly] +**payload** | **mixed** | [readonly] the JSON payload that will be sent to the URl | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WorkerGroup.md b/docs/Model/WorkerGroup.md new file mode 100644 index 0000000..dd5f402 --- /dev/null +++ b/docs/Model/WorkerGroup.md @@ -0,0 +1,37 @@ +# # WorkerGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**contributionLevelType** | [**\SynergiTech\Staffology\Model\PensionContributionLevelType**](PensionContributionLevelType.md) | | [optional] +**employeeContribution** | **float** | | [optional] +**employeeContributionIsPercentage** | **bool** | | [optional] +**employerContribution** | **float** | | [optional] +**employerContributionIsPercentage** | **bool** | | [optional] +**employerContributionTopUpPercentage** | **float** | Increase Employer Contribution by this percentage of the Employee Contribution | [optional] +**employerContributionIncludesNiSaving** | **bool** | Employer Contribution includes the Employers NI saving | [optional] +**employerContributionNiSavingPercentage** | **float** | Increase Employer Contribution by this percentage of the Employers NI saving | [optional] +**isAvc** | **bool** | Determines whether the workergroup uses additonal voluntary contributions. This property will automatically be set to true for the following Contribution Level Types: TpFasterAccrual, TpAdditionalPensionContributions, TpActuariallyAdjustedBenefits, TpFamilyBenefits, tpPastAddedYears, tpHigherSalaries, tpPreston, tpElectedFurtherEmployment, LgpsAdditionalPensionContributions, LgpsSharedAdditionalPensionContributions, LgpsAdditionalRegularContributions, LgpsAddedYearsContributions, LgpsSharedAdditionalPensionLumpSump, LgpsPartTimeBuyBack, PrudentialAVC. | [optional] +**additionalVoluntaryContribution** | **float** | Any additional voluntary amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage. | [optional] +**avcIsPercentage** | **bool** | Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, | [optional] +**employerContributionNiSaving** | **float** | Employers NI Saving | [optional] +**customThreshold** | **bool** | | [optional] +**lowerLimit** | **float** | | [optional] +**upperLimit** | **float** | | [optional] +**papdisGroup** | **string** | | [optional] +**papdisSubGroup** | **string** | | [optional] +**localAuthorityNumber** | **string** | Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales | [optional] +**schoolEmployerType** | **string** | Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales | [optional] +**matIdentifier** | **string** | Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales | [optional] +**matUniqueNumber** | **string** | Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales | [optional] +**employerReference** | **string** | | [optional] +**lgpsFund** | [**\SynergiTech\Staffology\Model\LgpsFund**](LgpsFund.md) | | [optional] +**workerGroupId** | **string** | [readonly] | [optional] +**assumedPensionablePay** | [**\SynergiTech\Staffology\Model\AssumedPensionablePay**](AssumedPensionablePay.md) | | [optional] +**pensionablePayDefinition** | [**\SynergiTech\Staffology\Model\PensionablePayDefinition**](PensionablePayDefinition.md) | | [optional] +**payslipDescription** | **string** | Used for overwriting the pension description that is displayed on the payslip | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WorkingPattern.md b/docs/Model/WorkingPattern.md new file mode 100644 index 0000000..b621a9b --- /dev/null +++ b/docs/Model/WorkingPattern.md @@ -0,0 +1,28 @@ +# # WorkingPattern + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | +**mon** | **float** | | [optional] +**tue** | **float** | | [optional] +**wed** | **float** | | [optional] +**thu** | **float** | | [optional] +**fri** | **float** | | [optional] +**sat** | **float** | | [optional] +**sun** | **float** | | [optional] +**contractedWeeks** | **float** | The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. | [optional] +**fullTimeContractedWeeks** | **float** | The amount of weeks an employee works (Full Time). If Null then the default is used. | [optional] +**fullTimeContractedHours** | **float** | The amount of hours an employee works (Full Time). If Null then the default is used. | [optional] +**bankHolidays** | [**\SynergiTech\Staffology\Model\BankHolidayCollection**](BankHolidayCollection.md) | | [optional] +**proRataRule** | [**\SynergiTech\Staffology\Model\ProRataRule**](ProRataRule.md) | | [optional] +**bankHolidayDates** | **\DateTime[]** | [readonly] The dates that are classed as Bank Holidays for this WorkingPattern | [optional] +**workingPatternHoursType** | [**\SynergiTech\Staffology\Model\WorkingPatternHoursType**](WorkingPatternHoursType.md) | | [optional] +**isDefault** | **bool** | | [optional] +**effectiveFrom** | **\DateTime** | The date when the assignment of the Working Pattern becomes effective. Required for a Shift WorkingPattern to determine when it starts | [optional] +**workingPatternType** | [**\SynergiTech\Staffology\Model\WorkingPatternType**](WorkingPatternType.md) | | [optional] +**shiftWorkingPatternDays** | [**\SynergiTech\Staffology\Model\ShiftWorkingPatternDay[]**](ShiftWorkingPatternDay.md) | | [optional] +**id** | **string** | [readonly] The unique id of the object | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WorkingPatternHoursType.md b/docs/Model/WorkingPatternHoursType.md new file mode 100644 index 0000000..d42535d --- /dev/null +++ b/docs/Model/WorkingPatternHoursType.md @@ -0,0 +1,8 @@ +# # WorkingPatternHoursType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WorkingPatternType.md b/docs/Model/WorkingPatternType.md new file mode 100644 index 0000000..b92ef9c --- /dev/null +++ b/docs/Model/WorkingPatternType.md @@ -0,0 +1,8 @@ +# # WorkingPatternType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/YearEnd.md b/docs/Model/YearEnd.md new file mode 100644 index 0000000..e0ed95f --- /dev/null +++ b/docs/Model/YearEnd.md @@ -0,0 +1,19 @@ +# # YearEnd + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endingYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**startingYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**createEpsForFinalSubmission** | **bool** | [readonly] Whether or not the system will automatically create an EPS to tell HMRC the year has ended. | [optional] +**createEpsForEmploymentAllowance** | **bool** | [readonly] Whether or not the system will automatically create an EPS to tell HMRC you qualify for Employment Allowance. | [optional] +**createExb** | **bool** | [readonly] Whether or not the system will automatically create an EXB to inform HMRC of Expenses and Benefits | [optional] +**setEmploymentAllowance** | **float** | [readonly] If the Employment Allowance needs to be changed, this indicates the new value | [optional] +**taxCodeChanges** | [**\SynergiTech\Staffology\Model\YearEndTaxCodeChange[]**](YearEndTaxCodeChange.md) | [readonly] Details of changes that wil be made to Tax Codes | [optional] +**removeWeek1Month1** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] Employees that will have the Week1Month1 flag removed from their tax code | [optional] +**emailP60** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] Employees who will be automatically emailed P60s | [optional] +**pushP60** | [**\SynergiTech\Staffology\Model\ExternalDataProviderId[]**](ExternalDataProviderId.md) | [readonly] ExternalDataProviderIds to which P60s can be pushed | [optional] +**emailCisStatement** | [**\SynergiTech\Staffology\Model\Item[]**](Item.md) | [readonly] Subcontractors who will be automatically sent an annual CIS Statement | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/YearEndTaxCodeChange.md b/docs/Model/YearEndTaxCodeChange.md new file mode 100644 index 0000000..3dd71ba --- /dev/null +++ b/docs/Model/YearEndTaxCodeChange.md @@ -0,0 +1,11 @@ +# # YearEndTaxCodeChange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee** | [**\SynergiTech\Staffology\Model\Item**](Item.md) | | [optional] +**currentCode** | **string** | [readonly] The Employees current tax code | [optional] +**newCode** | **string** | [readonly] The new TaxCode for the employee | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/YtdReport.md b/docs/Model/YtdReport.md new file mode 100644 index 0000000..52e9635 --- /dev/null +++ b/docs/Model/YtdReport.md @@ -0,0 +1,14 @@ +# # YtdReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payrun** | [**\SynergiTech\Staffology\Model\PayRun**](PayRun.md) | | [optional] +**lines** | [**\SynergiTech\Staffology\Model\EmployeeYtdValues[]**](EmployeeYtdValues.md) | | [optional] +**report** | [**\SynergiTech\Staffology\Model\Report**](Report.md) | | [optional] +**taxYear** | [**\SynergiTech\Staffology\Model\TaxYear**](TaxYear.md) | | [optional] +**title** | **string** | | [optional] +**isDraft** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/YtdReportReportResponse.md b/docs/Model/YtdReportReportResponse.md new file mode 100644 index 0000000..0867799 --- /dev/null +++ b/docs/Model/YtdReportReportResponse.md @@ -0,0 +1,12 @@ +# # YtdReportReportResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report | [optional] +**content** | **string** | [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. | [optional] +**model** | [**\SynergiTech\Staffology\Model\YtdReport**](YtdReport.md) | | [optional] +**stream** | **string** | byte array | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/YtdValue.md b/docs/Model/YtdValue.md new file mode 100644 index 0000000..5206f43 --- /dev/null +++ b/docs/Model/YtdValue.md @@ -0,0 +1,12 @@ +# # YtdValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\SynergiTech\Staffology\Model\PayrollValueType**](PayrollValueType.md) | | [optional] +**broughtForward** | **float** | | [optional] +**period** | **float** | | [optional] +**value** | **float** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ZeroPaidFilter.md b/docs/Model/ZeroPaidFilter.md new file mode 100644 index 0000000..b74d427 --- /dev/null +++ b/docs/Model/ZeroPaidFilter.md @@ -0,0 +1,8 @@ +# # ZeroPaidFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/generate/README.md b/generate/README.md new file mode 100644 index 0000000..b74effa --- /dev/null +++ b/generate/README.md @@ -0,0 +1,16 @@ +# Generate The Library From YAML + +We've cached a copy of the swagger.yaml to avoid annoying their API so you can do something like this. + +```sh +docker run --rm -v "$(pwd):/local" openapitools/openapi-generator-cli generate \ + --input-spec /local/generate/swagger.json \ + --config /local/generate/config.yaml \ + --generator-name php-nextgen \ + --git-user-id synergitech \ + --git-repo-id staffology-php \ + --global-property apiTests=false,modelTests=false \ + --output /local +``` + +You will need to edit the README.md back to something which makes sense. You will also need to exclude the generate directory and find/replace `http://localhost` with `https://api.iplicit.com` and `new GuzzleHttp\Client()` with `config: $config` diff --git a/generate/config.yaml b/generate/config.yaml new file mode 100644 index 0000000..f12c2d0 --- /dev/null +++ b/generate/config.yaml @@ -0,0 +1,9 @@ +additionalProperties: + artifactVersion: 1.0.0 + composerPackageName: synergitech/staffology-php + developerOrganization: "Synergi Tech" + developerOrganizationUrl: https://synergi.tech + invokerPackage: SynergiTech\Staffology + licenseName: MIT + packageName: Staffology-PHP + variableNamingConvention: camelCase diff --git a/generate/swagger.json b/generate/swagger.json new file mode 100644 index 0000000..f85fba9 --- /dev/null +++ b/generate/swagger.json @@ -0,0 +1,70561 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Staffology Payroll API", + "contact": { + "name": "D Jackson", + "url": "http://www.staffology.co.uk", + "email": "duane@staffology.co.uk" + }, + "version": "v1" + }, + "paths": { + "/account/activate": { + "post": { + "tags": [ + "Account" + ], + "summary": "Activate an Account", + "description": "New accounts need to be activated to confirm Terms and Conditions have been accepted.", + "operationId": "ActivateAccount", + "parameters": [ + { + "name": "brandCode", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "autoActivate", + "in": "query", + "description": "If autoActivate is set to true, the account activation should be automatically performed without any user interaction", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Your account has been activated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/account/demo": { + "post": { + "tags": [ + "Account" + ], + "summary": "Create Demo Employer", + "description": "Creates a demo employer for the user", + "operationId": "CreateDemoEmployerAccount", + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/account/emailaddress": { + "post": { + "tags": [ + "Account" + ], + "summary": "Change Email Address", + "description": "The user.PendingEmailAddress will be set to the give address and a new verification email will be sent.\r\nOnce the link in the email is clicked on then the user account will be updated to use the new email address", + "operationId": "ChangeEmailAddressAccount", + "parameters": [ + { + "name": "emailAddress", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Your account has been activated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/account": { + "get": { + "tags": [ + "Account" + ], + "summary": "Get Account Details", + "description": "Returns the details for the authorised account.", + "operationId": "GetAccount", + "parameters": [ + { + "name": "defaults", + "in": "query", + "description": "You can leave this empty, it's for internal use only.", + "schema": { + "type": "string" + } + }, + { + "name": "defaultsKey", + "in": "query", + "description": "You can leave this empty, it's for internal use only.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/account/photo": { + "post": { + "tags": [ + "Account" + ], + "summary": "Update Photo", + "description": "Submit an image here and we'll upload it, resize it to 200px squared and set it as the image for your account.", + "operationId": "UpdatePhotoAccount", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/account/profile": { + "post": { + "tags": [ + "Account" + ], + "summary": "Update Profile", + "description": "Updates your profile. Only Salutation, FirstName, LastName, JobType, JobTitle, TelephoneNumber, BusinessName, Industry, Address and DisplayPrefs fields are updated.", + "operationId": "ProfileAccount", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/account/invitations": { + "get": { + "tags": [ + "Account" + ], + "summary": "Get Invitations", + "description": "Returns any pending Invitations for the authorised user.\r\nIf the email address isn't yet verified then the Name displayed in the Item will be the users email address instead of the company name.\r\nInvitations cannot be accepted until the email address for the user is verified.", + "operationId": "GetInvitationsAccount", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/account/verify": { + "post": { + "tags": [ + "Account" + ], + "summary": "Re-send Verification Email", + "description": "Users should receive an email to verify their email address when they first register or if they change their email address.\r\nHowever, this API endpoint can be used to re-send the email.", + "operationId": "VerifyAccount", + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/account/verify/respond": { + "put": { + "tags": [ + "Account" + ], + "summary": "Verify Email Address", + "description": "Used to process the link sent in an email to verify an email address.", + "operationId": "VerifyResponseAccount", + "parameters": [ + { + "name": "u", + "in": "query", + "description": "The value from the link in the email.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "k", + "in": "query", + "description": "The value from the link in the email.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/account/Tenant": { + "get": { + "tags": [ + "Account" + ], + "summary": "Get Tenant", + "description": "Returns branding details for the specified tenant. This is used by the web app and is unlikely to be used by third-parties.", + "operationId": "GetTenantAccount", + "parameters": [ + { + "name": "tenantId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + } + } + } + }, + "/account/employerdefaults": { + "get": { + "tags": [ + "Account" + ], + "summary": "Get EmployerDefaults", + "description": "Get the EmployerDefaults for the currently authorised User.", + "operationId": "GetEmployerDefaultsAccount", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + } + } + } + } + }, + "put": { + "tags": [ + "Account" + ], + "summary": "Set EmployerDefaults", + "description": "Set the EmployerDefaults for the currently authorised User.", + "operationId": "SetEmployerDefaultsAccount", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerDefaults" + } + } + } + } + } + } + }, + "/account/useremployers": { + "get": { + "tags": [ + "Account" + ], + "summary": "List User Employers", + "description": "Returns a list of Employers that are associated to the given User", + "operationId": "GetUserEmployersAccount", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The Id of the user you want a list of employers for.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerItem" + } + } + } + } + } + } + } + }, + "/account/keys": { + "get": { + "tags": [ + "Account" + ], + "summary": "List ApiKeys", + "description": "", + "operationId": "ListApiKeysAccount", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Account" + ], + "summary": "Create ApiKey", + "description": "Creates a new APIKey. The only property that's required or used is Name.\r\nA new ApiKey will be generated and returned to you.", + "operationId": "CreateApiKeyAccount", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "/account/keys/{id}": { + "get": { + "tags": [ + "Account" + ], + "summary": "Get ApiKey", + "description": "", + "operationId": "GetApiKeyAccount", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Account" + ], + "summary": "Delete ApiKey", + "description": "", + "operationId": "DeleteApiKeyAccount", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/analysiscategories": { + "get": { + "tags": [ + "AnalysisCategory" + ], + "summary": "List AnalysisCategories", + "description": "Lists all AnalysisCategories for an Employer.", + "operationId": "IndexAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list AnalysisCategories", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "404": { + "description": "Employer or AnalysisCategories Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Create AnalysisCategory", + "description": "Create a new AnalysisCategory for the Employer.", + "operationId": "CreateAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/analysiscategories/{id}": { + "get": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Get AnalysisCategory", + "description": "Gets the AnalysisCategory specified.", + "operationId": "GetAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the AnalysisCategory belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the AnalysisCategory which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + } + } + }, + "404": { + "description": "Employer or AnalysisCategory Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Update AnalysisCategory", + "description": "Updates a AnalysisCategory for the Employer.", + "operationId": "UpdateAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Delete AnalysisCategory", + "description": "Deletes the specified AnalysisCategory.", + "operationId": "DeleteAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes": { + "get": { + "tags": [ + "AnalysisCategory" + ], + "summary": "List AnalysisCategoryCodes", + "description": "Lists all AnalysisCategoryCodes for an Category.", + "operationId": "GetCodesAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Id of the Category for which you want to list Codes", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Create AnalysisCategoryCode", + "description": "Create the details of an existing AnalysisCategoryCode.", + "operationId": "CreateAnalysisCategoryCodeAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Analysis category belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Analysis category id for which you want to create code", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code}": { + "get": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Get AnalysisCategoryCode", + "description": "Gets the AnalysisCategoryCode specified.", + "operationId": "GetAnalysisCategoryCodeAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Id of the AnalysisCategory to which the Code belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the AnalysisCategoryCode you want to retrieve.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Delete AnalysisCategoryCode", + "description": "Deletes the specified AnalysisCategoryCode.", + "operationId": "DeleteAnalysisCategoryCodeAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Id of the AnalysisCategory to which the Code belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the AnalysisCategoryCode you want to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "AnalysisCategory" + ], + "summary": "Update AnalysisCategoryCode", + "description": "Updates the details of an existing AnalysisCategoryCode.", + "operationId": "UpdateAnalysisCategoryCodeAnalysisCategory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Analysis category belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Analysis category id for which you want to update Analysis code", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the Analysis category code you want to update.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AnalysisCategoryCodeResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/attachmentorders": { + "post": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Create AttachmentOrder", + "description": "Creates an AttachmentOrder for the Employee", + "operationId": "CreateAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "get": { + "tags": [ + "AttachmentOrder" + ], + "summary": "List AttachmentOrders", + "description": "Lists all AttachmentOrders for the Employee", + "operationId": "IndexAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}": { + "get": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Get AttachmentOrder", + "description": "Gets the AttachmentOrder specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the AttachmentOrder you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Update AttachmentOrder", + "operationId": "UpdateAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the AttachmentOrder you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrder" + } + } + } + } + } + }, + "delete": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Delete AttachmentOrder", + "description": "Deletes the AttachmentOrder specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeleteAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the AttachmentOrder you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/attachmentorders/payments/{taxYear}": { + "get": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Get Payments", + "description": "Lists all Payments made to AttachmentOrders for the Employee in the given TaxYear", + "operationId": "PaymentsAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AttachmentOrderPayment" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents": { + "post": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Add Document", + "description": "Adds document to the AttachmentOrder", + "operationId": "AddDocumentAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the AttachmentOrder you want to attach documents to", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId}": { + "delete": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Delete AttachmentOrder Document", + "description": "Deletes the document specified by the documentId for the AttachmentOrder specified by the Id", + "operationId": "DeleteDocumentAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "AttachmentOrder" + ], + "summary": "Get AttachmentOrder Document", + "description": "Gets the document specified by the documentId for the AttachmentOrder specified by the Id", + "operationId": "GetDocumentAttachmentOrder", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/audit": { + "get": { + "tags": [ + "Audit" + ], + "summary": "Employer Audit Log", + "operationId": "EmployerAuditListAudit", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Audit logs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "entity", + "in": "query", + "description": "Entity type name for which audit log should be retrieved", + "schema": { + "$ref": "#/components/schemas/EntityType" + } + }, + { + "name": "entityId", + "in": "query", + "description": "Id of the entity for which audit log should be retrieved", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fromDate", + "in": "query", + "description": "Date from which records should be retrieved", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "toDate", + "in": "query", + "description": "Date till records should be retrieved", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Get AE Assessments", + "description": "Returns all AE Assessments for the Employee specified.", + "operationId": "ListAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve AE Assessments", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments": { + "post": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Assess Employee for AutoEnrolment", + "description": "Asseses an Employee for AutoEnrolment", + "operationId": "AssessAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to assess", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Get AE Assessment", + "description": "Returns the specified AeAssessment for the specified Employee", + "operationId": "GetAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Assessment.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + } + } + } + } + }, + "delete": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Delete AE Assessment", + "description": "Deletes the AeAssessment specified by the Id for the Employee specified by the EmployeeId.", + "operationId": "DeleteAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Assessment.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/last": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Get Last AE Assessment", + "description": "Returns the most recent AeAssessment for an Employee", + "operationId": "GetLastAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Get Letter", + "description": "Returns either a PDF or HTML (depending on accept header) of the letter that needs to be sent to an employee as a result of the assessment.\r\nThe same ReportResponse model that is used for reports is used here.", + "operationId": "GetLetterAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Assessment", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/email": { + "post": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Email Letter", + "description": "Send via email letter that needs to be sent to an employee as a result of the assessment.\r\nThe letter is then marked as having been sent.", + "operationId": "EmailLetterAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Assessment", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + } + } + } + } + } + }, + "/employers/{employerId}/autoenrolment/letters/email": { + "post": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Email All Letters", + "description": "", + "operationId": "EmailAllLettersAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/sent": { + "put": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Mark Letter as Sent", + "description": "Update an Assessment to mark the letter as sent.\r\nThis is done automatically if you send the letter via email so you'd\r\nonly need to use this is you are printing/posting the letter.", + "operationId": "MarkLetterAsSentAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee the assessment is for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Assessment", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/autoenrolment/letters/sent": { + "put": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Mark All Letters as Sent", + "description": "Update an Assessments to mark all the letter as sent.\r\nThis is done automatically if you send the letter via email so you'd\r\nonly need to use this is you are printing/posting the letter.", + "operationId": "MarkLettersAsSentAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/autoenrolment/state": { + "put": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Update State", + "description": "Updates the AutoEnrolment state for an Employee. \r\nYou would use this API call to process notices such as Opt Out, Opt In, etc.\r\nA new assessment is returned showing the result of the state change.", + "operationId": "SetStateAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to set the status for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "state", + "in": "query", + "description": "The AutoEnrolment State to set for the Employee", + "schema": { + "$ref": "#/components/schemas/AeEmployeeState" + } + }, + { + "name": "status", + "in": "query", + "schema": { + "$ref": "#/components/schemas/AeStatus" + } + }, + { + "name": "stateDate", + "in": "query", + "description": "Optional. Will default to the current date", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "pensionId", + "in": "query", + "description": "Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "workerGroupId", + "in": "query", + "description": "Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startActionAlreadyReported", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "endActionAlreadyReported", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AeAssessment" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/autoenrolment/letters/pending/count": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Pending Letters Count", + "description": "Returns the count of AE Assessments that are awaiting a letter to be sent\r\nand the count of the employees that are awaiting a postponement letter to be sent.", + "operationId": "PendingLettersCountAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.PendingLettersCountResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PendingLettersCountResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PendingLettersCountResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/autoenrolment/letters/pending": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Pending Letters", + "description": "Returns all AE Assessments that are awaiting a letter to be sent", + "operationId": "PendingLettersAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/autoenrolment/letters/pending/postponement": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Pending Postponement Letters", + "description": "Returns all employees that are awaiting a postponement letter to be sent.\r\nBecause there is no associated AeAssessment they can't be returned with the other pending letters", + "operationId": "PendingPostponementLettersAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/autoenrolment/renrol": { + "get": { + "tags": [ + "AutoEnrolment" + ], + "summary": "Cyclical Re-enrolment", + "description": "Performs a Cyclical Re-enrolment. All employees that have opted-out or ceased membership \r\nwill be re-assessed and auto-enrolled if necessary.\r\nThe employers cyclical re-enrolment date will then be updated to the date provided.", + "operationId": "ReenrolAutoEnrolment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "cyclicalReenrolmentDate", + "in": "query", + "description": "The new Cyclical Re-enrolment Date for the Employer", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/{employerId}/employees/AverageHolidayPay/PayHistory": { + "post": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Create multiple AverageHolidayPayHistory for an Employer", + "operationId": "CreateAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryRequest" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success" + } + } + }, + "get": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Get AverageHolidayPayHistory for Employer", + "operationId": "GetByEmployerAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryResponse" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Update multiple AverageHolidayPayHistory for an Employer", + "operationId": "UpdateAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryUpdateRequest" + } + } + } + } + }, + "responses": { + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success" + } + } + } + }, + "/{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory/{taxYear}": { + "get": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "List AverageHolidayPayHistory for Employee", + "description": "List AverageHistoryPayHistory for the given Employee in the specified TaxYear", + "operationId": "GetByEmployeeAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear for which you want the history.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayHistoryResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/{employerId}/employees/AverageHolidayPay/PayHistory/{id}": { + "delete": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Delete an AverageHolidayPayHistory record", + "operationId": "DeleteAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The pay history unique id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory": { + "delete": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Delete all AverageHolidayPayHistory for an Employee", + "operationId": "DeleteByEmployeeIdAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/{employerId}/employees/AverageHolidayPay/PayHistory/import": { + "post": { + "tags": [ + "AverageHolidayPayHistory" + ], + "summary": "Import AverageHistoryPayHistory from csv file", + "description": "Import Pay History from a CSV file.", + "operationId": "ImportCsvAverageHolidayPayHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "previewOnly", + "in": "query", + "description": "Set to true and nothing will be imported but you'll be shown a preview of the data.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/benefits": { + "post": { + "tags": [ + "Benefits" + ], + "summary": "Create Benefit", + "description": "Creates a Benefit for the Employee", + "operationId": "CreateBenefits", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "get": { + "tags": [ + "Benefits" + ], + "summary": "List Benefits", + "description": "Lists all Benefits for the Employee", + "operationId": "IndexBenefits", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/benefits/{id}": { + "get": { + "tags": [ + "Benefits" + ], + "summary": "Get Benefit", + "description": "Gets the Benefit specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetBenefits", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Benefit you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "Benefits" + ], + "summary": "Update Benefit", + "operationId": "UpdateBenefits", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Benefit you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benefit" + } + } + } + }, + "409": { + "description": "Conflict" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Benefits" + ], + "summary": "Delete Benefit", + "description": "Deletes the Benefit specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeleteBenefits", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Benefit you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/billing/directdebit": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Get DirectDebitMandate", + "description": "Returns the DirectDebitMandate for the authenticated account", + "operationId": "DirectDebitMandateBilling", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DirectDebitMandate" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Billing" + ], + "summary": "Delete DirectDebitMandate", + "description": "Cancels and deletes the Direct Debit Mandate for the account", + "operationId": "DeleteDirectDebitMandateBilling", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/billing/directdebit/setup": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Setup DirectDebitMandate", + "description": "Returns a Url to redirect a user to in order to start the process of setting up a Direct Debit Mandate.\r\nOnce the process is complete then the user is sent to the URL specified.", + "operationId": "SetupDirectDebitMandateBilling", + "parameters": [ + { + "name": "returnUrl", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/billing/directdebit/confirm": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Confirm Direct Debit Setup", + "description": "This endpoint is called by an external provider. You will never have to call this endpoint yourself.", + "operationId": "ConfirmDirectDebitMandateBilling", + "parameters": [ + { + "name": "redirect_flow_id", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/billing/bills": { + "get": { + "tags": [ + "Billing" + ], + "summary": "List Bills", + "description": "Returns a list of UsageBills for the authenticated account", + "operationId": "BillsBilling", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/billing/bill/{id}": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Get Bill", + "description": "Returns the specified UsageBill", + "operationId": "BillBilling", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + } + } + } + } + } + }, + "/billing/bill/{id}/csv": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Get Bill CSV", + "description": "Returns the specified UsageBill as a CSV file", + "operationId": "BillCsvBilling", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/billing/usage-stats": { + "get": { + "tags": [ + "Billing" + ], + "summary": "Get UsageStats Report", + "description": "Returns usage statistics data for all employers the logged in user has access to for the given date range.\r\nIf either of the dates are not provided then the values are defaulted to the first and last date of the previous calendar month.", + "operationId": "GetUsageStatsBilling", + "parameters": [ + { + "name": "fromDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "toDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/bureau/processors": { + "get": { + "tags": [ + "Bureau" + ], + "summary": "List Allocated Processors", + "description": "Returns a list of Users that have one or more Employers allocated to them as the Processor", + "operationId": "ProcessorUsersBureau", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/bureau/employers": { + "get": { + "tags": [ + "Bureau" + ], + "summary": "List Employers", + "description": "Returns a list of Employers.\r\nThis differs from the main Employer list end point in that the metadata included is more relevant to Bureau activities\r\nIt also gives you the ability to filter based on the allocated Processor.\r\nNote: an entry is returned for each PaySchedule. So if the employer has both a Monthly and a Weekly PaySchedule then they'll appear twice", + "operationId": "EmployersBureau", + "parameters": [ + { + "name": "processor", + "in": "query", + "description": "The Id of the Processor (User) you want to restrict the list to.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/bureau/settings": { + "get": { + "tags": [ + "Bureau" + ], + "summary": "Get BureauSettings", + "description": "Returns the BureauSettings for the Employer", + "operationId": "GetSettingsBureau", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Bureau" + ], + "summary": "Update BureauSettings", + "description": "Updates the BureauSettings for the Employer", + "operationId": "UpdateSettingsBureau", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BureauSettings" + } + } + } + } + } + } + }, + "/employers/{employerId}/bureau/settings/reportpack": { + "get": { + "tags": [ + "Bureau" + ], + "summary": "Get BureauSettings ReportPack", + "description": "If a ReportPack is specified in the BureauSettings then it is returned, otherwise an empty ReportPAck is returned", + "operationId": "GetReportPackBureau", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + } + } + } + }, + "/employers/{employerId}/bureau/settings/processor": { + "get": { + "tags": [ + "Bureau" + ], + "summary": "Get Processor", + "description": "If a Processor is specified in the BureauSettings then it is returned as a User, otherwise a 404 is returned", + "operationId": "GetProcessorUserBureau", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis300/{taxYear}": { + "get": { + "tags": [ + "Cis300" + ], + "summary": "List Cis300", + "description": "Returns all Cis300s for the given tax year.", + "operationId": "ListCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Cis300" + ], + "summary": "Create Cis300", + "description": "A Cis300 is automatically created for each Tax Month that you pay a Subcontractor.\r\nYou would only manually create one if you are intending to submit a nil return.", + "operationId": "CreateCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis300/{taxYear}/{id}": { + "put": { + "tags": [ + "Cis300" + ], + "summary": "Update Cis300", + "description": "Updates an existing Cis300.", + "operationId": "UpdateCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + } + } + }, + "get": { + "tags": [ + "Cis300" + ], + "summary": "Get Cis300", + "description": "Retrieves a Cis300", + "operationId": "GetCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Cis300" + ], + "summary": "Delete Cis300", + "description": "Not implemented, CIS300s cannot be deleted", + "operationId": "DeleteCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/cis300/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "Cis300" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis300/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "Cis300" + ], + "summary": "Submit Cis300", + "description": "Submits an existing Cis300 to HMRC.", + "operationId": "SubmitCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "description": "If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis300/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "Cis300" + ], + "summary": "Mark as Sent", + "description": "Marks a Cis300 as having been sent to HMRC and accepted by them\r\nYou only use this method if the request has been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis300/requiringattention": { + "get": { + "tags": [ + "Cis300" + ], + "summary": "Cis300 Requiring Attention", + "description": "Returns all Cis300 that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionCis300", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/{taxYear}": { + "get": { + "tags": [ + "CisVerification" + ], + "summary": "List CisVerificationRequest", + "description": "Returns all CIS Verification Requests for the given tax year.", + "operationId": "ListCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "CisVerification" + ], + "summary": "Create CisVerificationRequest", + "description": "Creates a new CIS Verification Request.", + "operationId": "CreateCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/{taxYear}/{id}": { + "put": { + "tags": [ + "CisVerification" + ], + "summary": "Update CisVerificationRequest", + "description": "Updates an existing CIS Verification Request.", + "operationId": "UpdateCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + } + } + }, + "get": { + "tags": [ + "CisVerification" + ], + "summary": "Get CisVerificationRequest", + "description": "Retrieves the CIS Verification Request.", + "operationId": "GetCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + } + } + }, + "delete": { + "tags": [ + "CisVerification" + ], + "summary": "Delete CisVerificationRequest", + "description": "Deletes the CIS Verification Request.", + "operationId": "DeleteCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "CisVerification" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "CisVerification" + ], + "summary": "Submit CisVerificationRequest", + "description": "Submits an existing CIS Verification Request to HMRC.", + "operationId": "SubmitCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "description": "If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "CisVerification" + ], + "summary": "Mark as Sent", + "description": "Marks a CIS Verification Request as having been sent to HMRC and accepted by them\r\nYou only use this method if the request has been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisVerification" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/cis-verification/requiringattention": { + "get": { + "tags": [ + "CisVerification" + ], + "summary": "CisVerificationRequest Requiring Attention", + "description": "Returns all CIS Verification Requests that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionCisVerification", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/costcentres": { + "get": { + "tags": [ + "CostCentre" + ], + "summary": "List Cost Centres", + "description": "Lists all Cost Centres for an Employer.", + "operationId": "IndexCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Cost Centres", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "CostCentre" + ], + "summary": "Create Cost Centre", + "description": "Creates a new CostCentre for the Employer.", + "operationId": "CreateCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + } + } + }, + "put": { + "tags": [ + "CostCentre" + ], + "summary": "Update Cost Centre", + "description": "Updates a Cost Centre for the Employer.", + "operationId": "UpdateCostCentreCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Cost Centre belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The existing code of the Cost Centre you want to get.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The new values for the Cost Centre you want to update", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + } + } + }, + "delete": { + "tags": [ + "CostCentre" + ], + "summary": "Delete Cost Centre", + "description": "Deletes the specified Cost Centre.", + "operationId": "DeleteCostCentreCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Cost Centre belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The code of the Cost Centre you want to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/costcentres/{code}": { + "get": { + "tags": [ + "CostCentre" + ], + "summary": "Get Cost Centre (deprecated)", + "description": "Gets the Cost Centres specified.\r\nUse the other GET endpoint that supports non-alphanumeric characters for a cost centre code", + "operationId": "GetCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Department belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + } + } + }, + "put": { + "tags": [ + "CostCentre" + ], + "summary": "Update Cost Centre (deprecated)", + "description": "Updates a Cost Centre for the Employer.\r\nUse the other Update endpoint that supports non-alphanumeric characters for a cost centre code", + "operationId": "UpdateCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + } + } + }, + "delete": { + "tags": [ + "CostCentre" + ], + "summary": "Delete Cost Centre (deprecated)", + "description": "Deletes the specified Cost Centre.\r\nUse the other Delete endpoint that supports non-alphanumeric characters for a cost centre code", + "operationId": "DeleteCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/costcentres/costcentre": { + "get": { + "tags": [ + "CostCentre" + ], + "summary": "Get Cost Centre", + "description": "Gets the Cost Centres specified.", + "operationId": "GetCostCentreCostCentre", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Department belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The existing code of the Cost Centre you want to get.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostCentre" + } + } + } + } + } + } + }, + "/employers/{employerId}/departments": { + "get": { + "tags": [ + "Department" + ], + "summary": "List Departments", + "description": "Lists all Departments for an Employer.", + "operationId": "IndexDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Departments", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Department" + ], + "summary": "Create Department", + "description": "Creates a new Department for the Employer.", + "operationId": "CreateDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/departments/{code}": { + "get": { + "tags": [ + "Department" + ], + "summary": "Get Department (deprecated)", + "description": "Gets the Department specified.\r\nUse the other GET endpoint that supports non-alphanumeric characters for a department code", + "operationId": "GetDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Department belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + } + } + }, + "put": { + "tags": [ + "Department" + ], + "summary": "Update Department (deprecated)", + "description": "Updates a Department for the Employer.", + "operationId": "UpdateDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "delete": { + "tags": [ + "Department" + ], + "summary": "Delete Department (deprecated)", + "description": "Deletes the specified Department.", + "operationId": "DeleteDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/departments/Department": { + "get": { + "tags": [ + "Department" + ], + "summary": "Get Department", + "description": "Gets the Department specified.", + "operationId": "GetDepartmentDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Department belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The code of the Department you want to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/departments/department": { + "put": { + "tags": [ + "Department" + ], + "summary": "Update Department", + "description": "Updates the details of an existing Department.", + "operationId": "UpdateDepartmentDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Department" + ], + "summary": "Delete Department", + "description": "Deletes the specified Department.", + "operationId": "DeleteDepartmentDepartment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/dps/notices": { + "post": { + "tags": [ + "Dps" + ], + "summary": "Check for new Notices", + "description": "Checks with HMRC for new notices. Returns an integer showing how many new notices were found", + "operationId": "CheckForNoticesDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "get": { + "tags": [ + "Dps" + ], + "summary": "List Notices", + "description": "Lists DPS Notices.", + "operationId": "ListNoticesDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "Dps" + ], + "summary": "Delete All Notices", + "operationId": "DeleteAllDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer that you want to delete all notices for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/dps/notices/xml": { + "post": { + "tags": [ + "Dps" + ], + "summary": "Parse notices from XML", + "description": "Checks the supplied XML string for notices. They're then processed in the same was as if received from HMRC.\r\nOnly used for testing the parsing of DPS XML.\r\nReturns an integer showing how many new notices were found", + "operationId": "ParseXmlDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "text/json": { + "schema": { + "type": "string" + } + }, + "application/*+json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + }, + "/employers/{employerId}/dps/notices/{id}": { + "get": { + "tags": [ + "Dps" + ], + "summary": "Get Notice", + "description": "Returns the specified DPS Notice.", + "operationId": "GetDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the DpsNotice you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DpsNotice" + } + } + } + } + } + }, + "put": { + "tags": [ + "Dps" + ], + "summary": "Apply Notice", + "description": "Applies the specified DPS Notice.", + "operationId": "ApplyDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the DpsNotice you want to apply.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DpsNotice" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Dps" + ], + "summary": "Delete Notice", + "operationId": "DeleteDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the DpsNotice belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the DsNotice you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/dps/settings": { + "get": { + "tags": [ + "Dps" + ], + "summary": "Get DPS Settings", + "description": "Returns the DpsSettings for the Employer", + "operationId": "GetDpsSettingsDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Dps" + ], + "summary": "Update DPS Settings", + "description": "Updates the DpsSettings for the Employer", + "operationId": "UpdateDpsSettingsDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DpsSettings" + } + } + } + } + } + } + }, + "/employers/{employerId}/dps/reapply": { + "put": { + "tags": [ + "Dps" + ], + "summary": "Reapply DpsNotices", + "description": "From a specified date onwards, reapply DpsNotices", + "operationId": "ReapplyNoticesDps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "appliedFromDate", + "in": "query", + "description": "The date from which to apply DpsNotices", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.ReapplyDpsNoticeResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/email": { + "get": { + "tags": [ + "Email" + ], + "summary": "List Emails", + "description": "Returns a list of all emails sent for this Employer.", + "operationId": "IndexEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/email/{emailId}": { + "get": { + "tags": [ + "Email" + ], + "summary": "Get Email", + "description": "Returns the email along with its status.", + "operationId": "GetEmailEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "emailId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + } + } + } + } + }, + "post": { + "tags": [ + "Email" + ], + "summary": "Re-send Email", + "description": "Re-send an existing email.", + "operationId": "ResendEmailEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "emailId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + } + } + } + } + } + }, + "/employers/{employerId}/email/settings": { + "get": { + "tags": [ + "Email" + ], + "summary": "Get MailSettings", + "description": "Returns the MailSettings for an Employer.", + "operationId": "GetMailSettingsEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Email" + ], + "summary": "Update MailSettings", + "description": "Updates the MailSettings for an Employer.", + "operationId": "UpdateMailSettingsEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + } + } + } + }, + "/employers/{employerId}/email/settings/test": { + "post": { + "tags": [ + "Email" + ], + "summary": "Send Test Email", + "description": "This API call will generate a test email based on your MailSettings.", + "operationId": "TestMailSettingsEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "email", + "in": "query", + "description": "The address to send a test email to", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + } + } + } + } + } + }, + "/employers/{employerId}/email/settings/verify": { + "post": { + "tags": [ + "Email" + ], + "summary": "Email Verification (Request)", + "description": "If the user attempts to use a non-verified email address in their MailSettings then we'll send them a verification email.\r\nThis API endpoint can be used to re-send the email.", + "operationId": "VerifyMailSettingsEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + }, + "put": { + "tags": [ + "Email" + ], + "summary": "Email Verification (Respond)", + "description": "Used to process the link sent in an email to verify an email address that's being used in MailSettings.", + "operationId": "VerifyMailSettingsResponseEmail", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The employer Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "u", + "in": "query", + "description": "The value from the link in the email.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "k", + "in": "query", + "description": "The value from the link in the email.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees": { + "post": { + "tags": [ + "Employee" + ], + "summary": "Create a new Employee", + "description": "Creates an Employee for the Employer specified.\r\nIf you don't provide PayOptions then the DefaultPayOptions from the Employer will be used", + "operationId": "CreateEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer you are creating the Employee for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.CreateEmployeeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.CreateEmployeeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.CreateEmployeeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.CreateEmployeeRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "get": { + "tags": [ + "Employee" + ], + "summary": "List Employees", + "operationId": "IndexEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to see Employees", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "description": "Zero-based page number, used in conjunction with pageSize", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The number of items per page", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Restrict the results to employees with the given status", + "schema": { + "$ref": "#/components/schemas/EmployeeStatus" + } + }, + { + "name": "deptCode", + "in": "query", + "description": "If specified then only employees assigned to this department code will be listed", + "schema": { + "type": "string" + } + }, + { + "name": "pensionSchemeId", + "in": "query", + "description": "If specified then only employees enrolled into the given pension scheme will be listed.\r\n If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Specifies the field by which to sort the employees. Default is EmployeeSortBy.None.", + "schema": { + "$ref": "#/components/schemas/EmployeeSortBy" + } + }, + { + "name": "sortDescending", + "in": "query", + "description": "Specifies whether the sorting should be in descending order. Default is false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/import": { + "post": { + "tags": [ + "Employee" + ], + "summary": "Import CSV", + "description": "Import employee data from a CSV file.", + "operationId": "ImportCsvEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the CSV file.", + "schema": { + "$ref": "#/components/schemas/CsvFileFormat" + } + }, + { + "name": "previewOnly", + "in": "query", + "description": "Set to true and nothing will be imported but you'll be shown a preview of the data.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "allowUpdates", + "in": "query", + "description": "Set to true and if the payroll code matches an existing employee then that employee will be updated.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/{id}": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Get an Employee", + "operationId": "GetEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Employee" + ], + "summary": "Update an Employee", + "operationId": "UpdateEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.UpdateEmployeeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.UpdateEmployeeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.UpdateEmployeeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.UpdateEmployeeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "delete": { + "tags": [ + "Employee" + ], + "summary": "Delete an Employee", + "operationId": "DeleteEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{id}/rehire": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Rehire an Employee", + "description": "If an employee has left and you want to rehire him/her, then this method will create a copy of the employee record but with a new payroll code", + "operationId": "ReHireEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to rehire.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/employers/{employerId}/employees/delete": { + "post": { + "tags": [ + "Employee" + ], + "summary": "Delete Employees", + "description": "Used to delete multiple employees.\r\nThe body should contain an array of Ids to identify the employees to delete.", + "operationId": "DeleteMultipleEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employees belong", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/leavers": { + "put": { + "tags": [ + "Employee" + ], + "summary": "Mark as Leavers", + "description": "Used to mark multiple employees as leavers.\r\nThe body should contain an array of Ids to identify the employees to update.", + "operationId": "MarkAsLeaversEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employees belong", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "date", + "in": "query", + "description": "The date the employees left or are leaving", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "emailP45", + "in": "query", + "description": "If set to true, the employee will be email a P45 if they have an email address", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + }, + "get": { + "tags": [ + "Employee" + ], + "summary": "List Leavers", + "description": "Returns a list of all Employees that have a leaving date set", + "operationId": "LeaversEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to see Leavers", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "onlyUnsentP45s", + "in": "query", + "description": "If set to true then only employees that don't have the P45Sent set to true will be returned", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/onhold": { + "put": { + "tags": [ + "Employee" + ], + "summary": "Mark as On Hold", + "description": "Used to mark multiple employees as On Hold or not On Hold.\r\nThe body should contain an array of Ids to identify the employees to update.", + "operationId": "SetOnHoldEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employees belong", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "onHold", + "in": "query", + "description": "The OnHold status to set", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/{id}/photo": { + "post": { + "tags": [ + "Employee" + ], + "summary": "Update Photo", + "description": "If you already have a URL for the employee photo then you can just set the PhotoUrl property of the Employee.\r\nAlternatively, submit an image here and we'll upload it, resize it to 200px squared and set the PhotoUrl for you.", + "operationId": "UpdatePhotoEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Employee" + ], + "summary": "Delete Photo", + "operationId": "DeletePhotoEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/search": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Search Employer for Employees", + "description": "Search for an employee of the specified employer based on their name or payroll code.\r\nEnsure your query is at least 3 characters long or you wont get any results.", + "operationId": "SearchEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to search.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "query", + "in": "query", + "description": "The search string (at least 3 characters).", + "schema": { + "type": "string" + } + }, + { + "name": "exludeCisSubContactors", + "in": "query", + "description": "If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/expiring-rtw": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Expiring RightToWork", + "description": "Returns a list of Item representing Employees that have a RightToWork with a DocumentExpiring date within the next numberOfDays days.", + "operationId": "ExpiringRtwEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to search.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "numberOfDays", + "in": "query", + "description": "The number of days in the future to look got expiry dates.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/search/payrollcode": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Get Employee by Payroll Code", + "description": "Get an employee by their payroll code. Will return an Item that contains the Id for you to retrieve the full Employee record", + "operationId": "SearchByPayrollCodeEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The payroll code to look for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/payrunentries/{taxYear}": { + "get": { + "tags": [ + "Employee" + ], + "summary": "PayRunEntries for Employee", + "description": "List PayRunEntries for the given Employee in the specified TaxYear", + "operationId": "PayRunEntriesEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to search.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear for which you want to list PayRunEntries.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/awe": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Average Weekly Earnings", + "description": "Calculates the Average Weekly Earnings for an Employee at the given date.\r\nYou can optionally include a LeaveType and we'll adjust the given date accordingly\r\nFor example if you specify Maternity then it'll be moved back by 15 weeks", + "operationId": "AverageWeeklyEarningsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "date", + "in": "query", + "description": "The date at which you want to calculate the earnings from.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "leaveType", + "in": "query", + "description": "", + "schema": { + "$ref": "#/components/schemas/LeaveType" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AverageWeeklyEarnings" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/basehourlyrate": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Calculate Base Hourly Rate (deprecated)", + "operationId": "BaseHourlyRateEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The frequency that this Employee is paid.", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "payBasis", + "in": "query", + "description": "", + "schema": { + "$ref": "#/components/schemas/PayBasis" + } + }, + { + "name": "payAmount", + "in": "query", + "description": "The amount the Employee is regularly paid each period.", + "schema": { + "type": "number", + "format": "double" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/basedailyrate": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Calculate Base Daily Rate (deprecated)", + "operationId": "BaseDailyRateEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The frequency that this Employee is paid.", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "payBasis", + "in": "query", + "description": "", + "schema": { + "$ref": "#/components/schemas/PayBasis" + } + }, + { + "name": "payAmount", + "in": "query", + "description": "The amount the Employee is regularly paid each period.", + "schema": { + "type": "number", + "format": "double" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/{taxYear}/minimum-wage": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Minimum Wage", + "description": "Calculates the National Minimum Wage for this employee for the given TaxYear and based on\r\ntheir age at the given date", + "operationId": "MinimumWageEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Employee Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "date", + "in": "query", + "description": "The date for which we should calculate the employees age, for not provided we'll use today's date.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/payoptions": { + "put": { + "tags": [ + "Employee" + ], + "summary": "Apply PayOptions", + "description": "Overwrite the PayOptions for all employees with the values provided.\r\nCurrently only the following fields are updated: period, payAmount, basis, payamountMultiplier, nationalMinimumWage and regularPaylines.", + "operationId": "ApplyPayOptionsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the employees belong.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayOptions" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayOptions" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayOptions" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayOptions" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/payincrease": { + "put": { + "tags": [ + "Employee" + ], + "summary": "Apply Pay Increase", + "description": "Increases the PayOptions.PayAmount and PayOptions.BaseHourlyRate by the percentage given.", + "operationId": "ApplyPayIncreaseEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the employees belong.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "percentage", + "in": "query", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "allEmployees", + "in": "query", + "description": "Set this to true", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/{id}/departments": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Get Employee Departments", + "operationId": "GetDepartmentMembershipsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to retrieve Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "Employee" + ], + "summary": "Set Employee Departments", + "operationId": "SetDepartmentMembershipsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to set Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/evcsettings": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Get EvcSettings", + "operationId": "GetEvcSettingsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve EvcSettings.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Employee" + ], + "summary": "Update EvcSettings", + "operationId": "UpdateEvcSettingsEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee for who you want to update EvcSettings.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvcSettings" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{id}/costcentres": { + "get": { + "tags": [ + "Employee" + ], + "summary": "Get Employee Cost Centres", + "operationId": "GetEmployeeCostCentresEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to retrieve CostCenntres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "Employee" + ], + "summary": "Set Employee Cost Centres", + "operationId": "SetEmployeeCostCentresEmployee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee you want to set CostCentres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "List Employee Roles", + "description": "Lists all Roles for an Employee.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "IndexEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee which you want to list Roles.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "EmployeeRole" + ], + "summary": "Create Employee Role", + "description": "Creates a new Role for the Employee.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "CreateEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Get Employee Role", + "description": "Gets the Role specified.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "GetEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The id of the Role you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleResponse" + } + } + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "EmployeeRole" + ], + "summary": "Update Employee Role", + "description": "Updates a Role for the Employee.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "UpdateEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Role to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeRole" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "EmployeeRole" + ], + "summary": "Delete Employee Role", + "description": "Deletes the specified Role.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "DeleteEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Role to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/departments": { + "put": { + "tags": [ + "EmployeeRole" + ], + "summary": "Set Employee Role Departments", + "description": "Assigns Departments to an Employee Role.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "SetDepartmentMembershipsEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to set Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to set Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Get Employee Role Departments", + "description": "Gets Departments that are Assigned to an Employee Role.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "GetDepartmentMembershipsEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to retrieve Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to retrieve Departments for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{roleId}/basehourlyrate": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Calculate Base Hourly Rate", + "operationId": "GetBaseHourlyRateEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleId", + "in": "path", + "description": "The Employee Role Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The frequency that this Employee Role is paid.", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "payBasis", + "in": "query", + "description": "", + "schema": { + "$ref": "#/components/schemas/PayBasis" + } + }, + { + "name": "payAmount", + "in": "query", + "description": "The amount the Employee Role is regularly paid each period.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "workingPatternId", + "in": "query", + "description": "The Id of the Working Pattern that we want the calculations against.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{roleId}/basedailyrate": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Calculate Base Daily Rate", + "operationId": "GetBaseDailyRateEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleId", + "in": "path", + "description": "The Employee Role Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The frequency that this Employee Role is paid.", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "payBasis", + "in": "query", + "description": "", + "schema": { + "$ref": "#/components/schemas/PayBasis" + } + }, + { + "name": "payAmount", + "in": "query", + "description": "The amount the Employee Role is regularly paid each period.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "workingPatternId", + "in": "query", + "description": "The Id of the Working Pattern that we want the calculations against.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Get Employee Role Cost Centres", + "description": "Gets Cost Centres that are Assigned to an Employee Role.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "GetCostCentreMembershipsEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to retrieve Cost Centres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to retrieve Cost Centres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "EmployeeRole" + ], + "summary": "Set Employee Role Cost Centres", + "description": "Assigns Cost Centres to an Employee Role.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "SetCostCentreMembershipsEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to set Cost Centres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to set Cost Centres for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId}": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Get Employee Role Working Pattern", + "description": "Gets the Employee Role Working Pattern specified.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "GetRoleWorkingPatternEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to retrieve a Role Working Pattern for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleWorkingPatternId", + "in": "path", + "description": "The Id of the Employee Role Working Pattern you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternResponse" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "EmployeeRole" + ], + "summary": "Delete Employee Role Working Pattern", + "description": "Deletes the specified Employee Role Working Pattern.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "DeleteRoleWorkingPatternEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role to which the Role Working Pattern belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleWorkingPatternId", + "in": "path", + "description": "The Id of the Employee Role Working Pattern you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "List Working Patterns for an Employee Role", + "description": "Lists all Working Patterns for an Employee Role.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "ListRoleWorkingPatternsEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to retrieve Employee Role Working Patterns for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternResponseItem" + } + } + } + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "EmployeeRole" + ], + "summary": "Create Employee Role Working Pattern", + "description": "Creates a new Role Working Pattern for the Employee Role.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "CreateRoleWorkingPatternEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to create a Role Working Pattern for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/workingPatterns/{roleWorkingPatternId}": { + "put": { + "tags": [ + "EmployeeRole" + ], + "summary": "Update Employee Role Working Pattern", + "description": "Updates a Working Pattern for the Employee Role.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "UpdateRoleWorkingPatternEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Role belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Role to which the Employee Role Working Pattern belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleWorkingPatternId", + "in": "path", + "description": "The Id of the Employee Role Working Pattern you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.EmployeeRoleWorkingPatternResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategories/{analysisCategoryId}/analysiscategorycodes": { + "put": { + "tags": [ + "EmployeeRole" + ], + "summary": "Set Employee Role AnalysisCategorycode", + "description": "Assigns AnalysisCategoryCode to an Employee Role.\r\nYou must have the multi-role feature enabled.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "SetEmployeeRoleAnalysisCategoryCodesEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to set AnalysisCategoryCode for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to set AnalysisCategoryCode for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "analysisCategoryId", + "in": "path", + "description": "The Id of the Analysis Category you want to set AnalysisCategoryCode for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategorycodes": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Get Employee Role AnalysisCategoryCode", + "description": "Gets AnalysisCategoryCode that are Assigned to an Employee Role.\r\nYou must have the multi-role feature enabled.", + "operationId": "GetEmployeeRoleAnalysisCategoryCodesEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to retrieve AnalysisCategoryCode for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Employee Role you want to retrieve AnalysisCategoryCode for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleAnalysisCategoryCodeResponse" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/roles/{roleId}/assumedpensionablepay": { + "get": { + "tags": [ + "EmployeeRole" + ], + "summary": "Calculate Assumed Pensionable Pay", + "operationId": "GetRoleAssumedPensionablePayEmployeeRole", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "roleId", + "in": "path", + "description": "The Employee Role Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The frequency that this Employee Role is paid.", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "leaveType", + "in": "query", + "description": "The type of the Leave.", + "schema": { + "$ref": "#/components/schemas/LeaveType" + } + }, + { + "name": "leavePayType", + "in": "query", + "description": "The pay type of the Leave.", + "schema": { + "$ref": "#/components/schemas/LeavePayType" + } + }, + { + "name": "from", + "in": "query", + "description": "The date from which the Assumed Pensionable Pay is calculated.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers": { + "post": { + "tags": [ + "Employer" + ], + "summary": "Create an Employer", + "description": "Use this method to create a new Employer\r\nThe only required field is the Employer name.", + "operationId": "CreateEmployer", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + }, + "responses": { + "201": { + "description": "Success - the employer has been created and is returned in the body.\r\nThe unique URL for this employer is returned in the Location header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "Employer" + ], + "summary": "List Employers", + "operationId": "IndexEmployer", + "parameters": [ + { + "name": "employerGroupCode", + "in": "query", + "description": "Optionally specify the code of an EmployerGroup to only see employers that are a member of that group.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/import": { + "post": { + "tags": [ + "Employer" + ], + "summary": "Import CSV", + "description": "Import employers from a CSV file.", + "operationId": "ImportCsvEmployer", + "parameters": [ + { + "name": "previewOnly", + "in": "query", + "description": "Set to true and nothing will be imported but you'll be shown a preview of the data.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/search": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Search Employers", + "operationId": "SearchEmployer", + "parameters": [ + { + "name": "query", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/employees/search": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Search Employees", + "description": "Search all employers for an employee based on their name or payroll code.\r\nEnsure your query is at least 3 characters long or you wont get any results.", + "operationId": "SearchEmployeesEmployer", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "The search string (at least 3 characters).", + "schema": { + "type": "string" + } + }, + { + "name": "exludeCisSubContactors", + "in": "query", + "description": "If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{id}": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get an Employer", + "operationId": "GetEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + } + } + }, + "put": { + "tags": [ + "Employer" + ], + "summary": "Update an Employer", + "operationId": "UpdateEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Employer" + ], + "summary": "Delete an Employer", + "operationId": "DeleteEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{id}/calendar": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get Employer Calendar", + "description": "Get a list of upcoming CalendarEntry for the Employer.", + "operationId": "CalendarEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "from", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CalendarEntry" + } + } + } + } + } + } + } + }, + "/employers/{id}/users": { + "get": { + "tags": [ + "Employer" + ], + "summary": "List Users", + "description": "Returns a list of Users that have access to the given Employer", + "operationId": "ListUsersEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want a list of Users for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{id}/users/owner": { + "put": { + "tags": [ + "Employer" + ], + "summary": "Set Owner", + "description": "Sets the owner for the employer. You must be the owner of the Employer to set this value.\r\nThe user you are setting as the owner must already have the role Admin.\r\nYou can get a list of users from the ListUsers endpoint.", + "operationId": "SetOwnerEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to change the ownership of.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them.", + "content": { + "application/json-patch+json": { + "schema": { + "type": "string", + "format": "uuid" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "uuid" + } + }, + "text/json": { + "schema": { + "type": "string", + "format": "uuid" + } + }, + "application/*+json": { + "schema": { + "type": "string", + "format": "uuid" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{id}/users/{userId}": { + "delete": { + "tags": [ + "Employer" + ], + "summary": "Remove User", + "description": "Removes a User from an Employer.\r\nYou cannot remove Users that are marked as the owner of the Employer.\r\nYou must be the owner of the Employer in order to remove other Users.", + "operationId": "RemoveUserEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to remove the User from.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User you want to remove.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{id}/suggestPayrollCode": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Suggest Payroll Code", + "description": "This helper method returns a unique code for the next Employee that you create for the specified Employer.\r\nYou don't have to use the value provided, you can use any value that is unique across Employees for the Employer.", + "operationId": "SuggestPayCodeEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want a suggestion for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{id}/logo": { + "post": { + "tags": [ + "Employer" + ], + "summary": "Update Employer Logo", + "description": "If you already have a URL for the employer Logo then you can just set the LogoUrl property of the Employer.\r\nAlternatively, submit a logo here and we'll upload it and set the LogoUrl for you.", + "operationId": "UpdateLogoEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employer" + } + } + } + } + } + } + }, + "/employers/{id}/custompayslip": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get Payslip Customisations", + "description": "Get the settings used to customise PaySlips for this Employer", + "operationId": "CustomPayslipEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want customisations for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + } + } + } + } + }, + "post": { + "tags": [ + "Employer" + ], + "summary": "Update Payslip Customisations", + "description": "Set the settings used to customise PaySlips for this Employer", + "operationId": "UpdateCustomPayslipEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want customisations for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + } + } + } + } + } + }, + "/employers/{id}/YearEnd": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Review Year End Changes", + "description": "View the changes that will be made when you start the next tax year for the employer", + "operationId": "ReviewYearEndEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/YearEnd" + } + } + } + }, + "404": { + "description": "NotFound -\r\nWe don't yet support the tax year following the employers current tax year" + } + } + }, + "put": { + "tags": [ + "Employer" + ], + "summary": "Make Year End Changes", + "description": "Apply the changes for the year end and start the next tax year for the employer.", + "operationId": "ApplyYearEndEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements", + "content": { + "application/json-patch+json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "text/json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "application/*+json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/YearEnd" + } + } + } + }, + "404": { + "description": "NotFound -\r\nWe don't yet support the tax year following the employers current tax year" + } + } + } + }, + "/employers/{id}/rti/requiringattention": { + "get": { + "tags": [ + "Employer" + ], + "summary": "RTI Documents Requiring Attention", + "description": "Returns all RTI documents that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RtiRequiringAttentionEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{id}/automation": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get Automation Settings", + "description": "Returns the AutomationSettings for the Employer", + "operationId": "GetAutomationSettingsEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Employer" + ], + "summary": "Update Automation Settings", + "description": "Updates the AutomationSettings for the Employer", + "operationId": "UpdateAutomationSettingsEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AutomationSettings" + } + } + } + } + } + } + }, + "/employers/{id}/groups": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get Employer Groups", + "operationId": "GetGroupMembershipsEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to retrieve Groups for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "Employer" + ], + "summary": "Set Employer Groups", + "operationId": "SetGroupMembershipsEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer you want to set Groups for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerGroupMembership" + } + } + } + } + } + } + } + }, + "/employers/{id}/openingbalances": { + "get": { + "tags": [ + "Employer" + ], + "summary": "Get EmployerOpeningBalances", + "description": "Returns the EmployerOpeningBalances for the Employer", + "operationId": "GetEmployerOpeningBalancesEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + } + } + } + } + }, + "put": { + "tags": [ + "Employer" + ], + "summary": "Update EmployerOpeningBalances", + "description": "Updates the EmployerOpeningBalances for the Employer for their StartYear", + "operationId": "UpdateEmployerOpeningBalancesEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + } + } + } + } + } + } + }, + "/employers/{id}/evc": { + "put": { + "tags": [ + "Employer" + ], + "summary": "Update EVC OptIn", + "description": "Sets the EVC OptIn setting for the employer.\r\nA boolean value needs to be sent in the body to indicate if the employer is opted in.\r\nSo sending false would result in the employer being opted out.", + "operationId": "SetEvcOptInEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + }, + "application/*+json": { + "schema": { + "type": "boolean" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + }, + "get": { + "tags": [ + "Employer" + ], + "summary": "Get EVC OptIn History", + "description": "Gets the history of changes to the EVC OptIn setting for the employer.", + "operationId": "GetEvcOptInHistoryEmployer", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerEvcOptInHistory" + } + } + } + } + } + } + } + }, + "/employers/groups": { + "get": { + "tags": [ + "EmployerGroup" + ], + "summary": "List EmployerGroups", + "description": "Lists all EmployerGroups for the user.", + "operationId": "IndexEmployerGroup", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "EmployerGroup" + ], + "summary": "Create EmployerGroup", + "description": "Creates a new EmployerGroup for the user.", + "operationId": "CreateEmployerGroup", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + } + } + } + } + } + }, + "/employers/groups/{code}": { + "get": { + "tags": [ + "EmployerGroup" + ], + "summary": "Get EmployerGroup", + "description": "Gets the EmployerGroup specified.", + "operationId": "GetEmployerGroup", + "parameters": [ + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + } + } + }, + "404": { + "description": "EmployerGroup Not Found" + } + } + }, + "put": { + "tags": [ + "EmployerGroup" + ], + "summary": "Update EmployerGroup", + "description": "Updates a EmployerGroup for the user.", + "operationId": "UpdateEmployerGroup", + "parameters": [ + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerGroup" + } + } + } + }, + "404": { + "description": "EmployerGroup Not Found" + } + } + }, + "delete": { + "tags": [ + "EmployerGroup" + ], + "summary": "Delete EmployerGroup", + "description": "Deletes the specified EmployerGroup.", + "operationId": "DeleteEmployerGroup", + "parameters": [ + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/templates": { + "get": { + "tags": [ + "EmployerTemplate" + ], + "summary": "List EmployerTemplates", + "description": "Lists all EmployerTemplates for the Employer specified.", + "operationId": "IndexEmployerTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Pay Codes", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/templates/{type}": { + "get": { + "tags": [ + "EmployerTemplate" + ], + "summary": "Get EmployerTemplate", + "description": "Gets the EmployerTemplate specified by the Type.", + "operationId": "GetEmployerTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the EmployerTemplate belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "path", + "description": "The EmployerTemplateType you want to retrieve.", + "required": true, + "schema": { + "$ref": "#/components/schemas/EmployerTemplateType" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + } + } + } + } + }, + "put": { + "tags": [ + "EmployerTemplate" + ], + "summary": "Update EmployerTemplate", + "description": "Updates the EmployerTemplate specified by the Type.\r\nThe only values need to supply are ```Content```\r\nand (if applicable) ```Subject```.\r\nIf these values are empty strings or not provided then the template will revert to the default values.", + "operationId": "UpdateEmployerTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the EmployerTemplate belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/EmployerTemplateType" + } + } + ], + "requestBody": { + "description": "The EmployerTemplateType you want to retrieve.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerTemplate" + } + } + } + } + } + } + }, + "/engine/config": { + "get": { + "tags": [ + "Engine" + ], + "summary": "Get Configuration", + "description": "Returns the raw configuration data that is used as the basis for any calculations for the given tax year.\r\nYou would never need to use this configuration values yourself in any API calls. It is provided just for information purposes", + "operationId": "ConfigEngine", + "parameters": [ + { + "name": "taxYear", + "in": "query", + "description": "The year that you want to retrieve details for. If not provided then current tax year will be used.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxYearConfig" + } + } + } + } + } + } + }, + "/engine/config/{taxYear}/ni/{payPeriod}": { + "get": { + "tags": [ + "Engine" + ], + "summary": "Get National Insurance Thresholds", + "description": "Returns the National Insurance thresholds for the given PayPeriod", + "operationId": "GetNationalInsuranceThresholdsEngine", + "parameters": [ + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, monthly) that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodStart", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "periodEnd", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "effectiveDate", + "in": "query", + "description": "The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NationalInsuranceCalculationPeriodValues" + } + } + } + } + } + } + }, + "/engine/tax": { + "get": { + "tags": [ + "Engine" + ], + "summary": "Calculate Tax due", + "description": "Calculates tax amount due, given the values specified.\r\nYou would never need to use this API call. It is provided just for information and testing purposes.\r\nAccess is limited so you'll probably receive a 401 response if you try to use it.", + "operationId": "CalculateTaxEngine", + "parameters": [ + { + "name": "taxYear", + "in": "query", + "description": "If not provided then current tax year will be used.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "taxCode", + "in": "query", + "description": "If not provided then the default code for the tax year will be used.", + "schema": { + "type": "string" + } + }, + { + "name": "gross", + "in": "query", + "description": "The gross amount for which tax should be calculated.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "periodStart", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "periodEnd", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The PayPeriod (Weekly, Monthly, etc)", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "period", + "in": "query", + "description": "The period that this payment is being made for", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "week1", + "in": "query", + "description": "If set to true then tax will be calculated in a Week1/Month1 basis", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "grossToDate", + "in": "query", + "description": "Gross pay to date", + "schema": { + "type": "number", + "format": "double", + "default": 0 + } + }, + { + "name": "taxToDate", + "in": "query", + "description": "Tax paid to date", + "schema": { + "type": "number", + "format": "double", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/engine/ni": { + "get": { + "tags": [ + "Engine" + ], + "summary": "Calculate NI due.", + "description": "Calculates National Insurance Contributions due given the values specified.\r\nYou would never need to use this API call in practice. It is provided just for information and testing purposes.\r\nAccess is limited so you'll probably receive a 401 response if you try to use it.", + "operationId": "CalculateNiEngine", + "parameters": [ + { + "name": "taxYear", + "in": "query", + "description": "If not provided then current tax year will be used.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "gross", + "in": "query", + "description": "The gross amount for which tax should be calculated.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "niCategory", + "in": "query", + "description": "The letter from the NI table", + "schema": { + "type": "string" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The PayPeriod (Weekly, Monthly, etc)", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NationalInsuranceCalculation" + } + } + } + } + } + } + }, + "/engine/branding/{brandCode}": { + "get": { + "tags": [ + "Engine" + ], + "summary": "Tenant Branding", + "description": "Returns Tenant Branding. Not for public use, will return 401", + "operationId": "GetTenantBrandingEngine", + "parameters": [ + { + "name": "brandCode", + "in": "path", + "description": "The Id of the Tenant you want to retrieve.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}": { + "get": { + "tags": [ + "Eps" + ], + "summary": "List EPS", + "description": "Returns all Employment Payment Summaries for the given tax year.\r\nIf the 'Linked EPS' is enabled by the employer, Employment Payment Summaries\r\nfor employer as well as for any linked employers with 'Linked EPS' enabled\r\nand with the same PAYE scheme are returned.", + "operationId": "ListEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Eps" + ], + "summary": "Create EPS", + "description": "Creates a new Employer Payment Summary", + "operationId": "CreateEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{id}": { + "put": { + "tags": [ + "Eps" + ], + "summary": "Update EPS", + "description": "Updates an existing Employment Payment Summary.", + "operationId": "UpdateEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + }, + "get": { + "tags": [ + "Eps" + ], + "summary": "Get EPS", + "description": "Retrieves the Employer Payment Summary specified", + "operationId": "GetEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Eps" + ], + "summary": "Delete Eps", + "description": "Deletes the Eps.", + "operationId": "DeleteEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "Eps" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "Eps" + ], + "summary": "Submit EPS", + "description": "Submits an existing Employment Payment Summary to HMRC.", + "operationId": "SubmitEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "description": "If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "Eps" + ], + "summary": "Mark as Sent", + "description": "Marks an Employer Payment Summary as having been sent to HMRC and accepted by them.\r\nYou would only use this method if the EPS had been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/requiringattention": { + "get": { + "tags": [ + "Eps" + ], + "summary": "EPS Requiring Attention", + "description": "Returns all Employer Payment Summaries that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/recoverableamounts": { + "get": { + "tags": [ + "Eps" + ], + "summary": "Recoverable Amounts", + "description": "Get all recoverable amounts (SMP, etc) for a given tax year, up to the given tax month, and if the 'Linked EPS'\r\nis enabled by the employer, recoverable amounts as well as the recoverable amounts for any employers with 'Linked EPS' enabled and with the same PAYE scheme\r\nis returned as a sum.", + "operationId": "RecoverableAmountsEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "taxMonth", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecoverableAmounts" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/apprenticeshipLevytodate": { + "get": { + "tags": [ + "Eps" + ], + "summary": "Apprenticeship Levy", + "description": "Get all Apprenticeship Levy (SMP, etc) for a given tax year, up to the given tax month, and if the 'Linked EPS'\r\nis enabled by the employer, apprenticeship levy as well as the apprenticeship levy for any employers with 'Linked EPS' enabled and with the same PAYE scheme\r\nis returned as a sum.", + "operationId": "ApprenticeshipLevyEps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "taxMonth", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EpsApprenticeshipLevy" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}": { + "get": { + "tags": [ + "Exb" + ], + "summary": "List EXB", + "description": "Returns all ExpensesAndBenefits for the given tax year.", + "operationId": "ListExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Exb" + ], + "summary": "Create EXB", + "description": "Creates a new Expenses And Benefits submission", + "operationId": "CreateExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}/{id}": { + "put": { + "tags": [ + "Exb" + ], + "summary": "Update EXB", + "description": "Updates an existing Expenses And Benefits submission.", + "operationId": "UpdateExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + } + } + }, + "get": { + "tags": [ + "Exb" + ], + "summary": "Get EXB", + "description": "Retrieves the Expenses And Benefits submission specified", + "operationId": "GetExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Exb" + ], + "summary": "Delete EXB", + "description": "Deletes the EXB.", + "operationId": "DeleteExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "Exb" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "Exb" + ], + "summary": "Submit EXB", + "description": "Submits an existing Expenses And Benefits submission to HMRC.", + "operationId": "SubmitExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "description": "If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "Exb" + ], + "summary": "Mark as Sent", + "description": "Marks an Expenses And Benefits submission as having been sent to HMRC and accepted by them.\r\nYou would only use this method if the EXB had been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/requiringattention": { + "get": { + "tags": [ + "Exb" + ], + "summary": "EXB Requiring Attention", + "description": "Returns all Expenses And Benefits submissions that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/exb/{taxYear}/values": { + "get": { + "tags": [ + "Exb" + ], + "summary": "Annual Values", + "description": "Returns an empty Exb showing the number of employees and total benefits for the year provided", + "operationId": "AnnualValuesExb", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Exb" + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "List Providers", + "description": "Returns a list of External Data Providers and indicates which the Employer has successfully authenticated with.", + "operationId": "ListExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalDataProvider" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/companies": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "List Companies", + "description": "Return a list of companies from the external data provider", + "operationId": "CompaniesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalDataCompany" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/nominals": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "List Nominal Codes", + "description": "Return a list of Nominal Codes from the external data provider", + "operationId": "NominalCodesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/journal": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Post Journal", + "description": "Post a Journal for a payrun to the ExternalDataProvider\r\nA 200 response does not mean the journal was necessarily successfully posted.\r\nThe PayRunJournal is returned (without the Lines) so that you can inspect the status to determine success", + "operationId": "PostJournalExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "force", + "in": "query", + "description": "Set to true if you want to force the journal to be posted even if it already has been", + "schema": { + "type": "boolean" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunJournal" + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/payments": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Post Payments", + "description": "Post Payments for a payrun to the ExternalDataProvider\r\nA 200 response does not mean the payments were necessarily successfully posted.\r\nThe BankPaymentInstruction is returned (without the payments) so that you can inspect the status to determine success", + "operationId": "PostPaymentsExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "To identify the PayRun", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "incEmployees", + "in": "query", + "description": "Include payments for employees", + "schema": { + "type": "boolean" + } + }, + { + "name": "incHmrc", + "in": "query", + "description": "Include payments for HMRC (if any)", + "schema": { + "type": "boolean" + } + }, + { + "name": "incPensions", + "in": "query", + "description": "Include payments for Pension Providers (if any)", + "schema": { + "type": "boolean" + } + }, + { + "name": "incAeos", + "in": "query", + "description": "Include any payment due as a result of AttachmentOrders (if any)", + "schema": { + "type": "boolean" + } + }, + { + "name": "incDeductions", + "in": "query", + "description": "Include any payment due to Deductions that are set to be paid to a Payee (if any)", + "schema": { + "type": "boolean" + } + }, + { + "name": "force", + "in": "query", + "description": "Set to true if you want to force the payments to be posted even if it already has been", + "schema": { + "type": "boolean" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "paymentDate", + "in": "query", + "description": "Optional. If a value is provided then it'll be used in place of the payment date for the payment.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstruction" + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "List Employees", + "description": "Return a list of ExternalEmployeeMapping for Employees in the external data provider.\r\nThe metadata of the Item contains a field called externalId. This can be used to retrieve the full employee record.", + "operationId": "EmployeesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Import Employees", + "description": "Import Employees from the external data provider.", + "operationId": "ImportEmployeesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The externalIds to import", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees/push": { + "put": { + "tags": [ + "ExternalData" + ], + "summary": "Push Employees", + "description": "Push employees to the ExternalDataProvider.", + "operationId": "PushEmployeesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/payslips": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push Payslips", + "description": "Push payslips to the ExternalDataProvider.", + "operationId": "PushPayslipsExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "force", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p45": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P45", + "description": "Push a P45 to the ExternalDataProvider.", + "operationId": "PushP45ExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p45s": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P45s", + "description": "Push P45s to the ExternalDataProvider.", + "operationId": "PushP45sExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the External Provider to which you want to send P45s", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to send P45s", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "description": "The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "query", + "description": "The Period (i.e, Tax Month, Tax Week) for which you want to send P45s", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "query", + "description": "The Tax Year for which you want to send P45s", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "description": "Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p60": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P60", + "description": "Pushes a P60 to the ExternalDataProvider.", + "operationId": "PushP60ExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p60s": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P60s", + "description": "Pushes P60s to the ExternalDataProvider for all employees paid for a given tax year, provided they were paid during that tax year.", + "operationId": "PushP60sExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p11d": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P11D", + "description": "Pushes a P11D for the given employee to the ExternalDataProvider.", + "operationId": "PushP11DExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/p11ds": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push P11Ds", + "description": "Pushes all P11Ds for the given TaxYear to the ExternalDataProvider.", + "operationId": "PushP11DsExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/pension-letter": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push Pension Letter", + "description": "Pushes a Pension Letter for the given employee to the ExternalDataProvider.", + "operationId": "PushPensionLetterExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "assessmentId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/pension-letters": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Push Pension Letters", + "description": "Pushes a Pension Letters for the given employees to the ExternalDataProvider.", + "operationId": "PushPensionLettersExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees/{employeeId}": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Get Employee", + "description": "Return an ExternalEmployeeMapping for the specified Employee from the external data provider", + "operationId": "EmployeeExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the employee in the external data provider", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + } + } + } + } + }, + "put": { + "tags": [ + "ExternalData" + ], + "summary": "Update Employee", + "description": "Update an ExternalEmployeeMapping to map/unmap/import/ignore an employee from an external data provider", + "operationId": "UpdateEmployeeExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the employee in the external data provider", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalEmployeeMapping" + } + } + } + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees/i/sync-all": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Sync Employees", + "description": "Syncs data from the ExternalDataProvider to update all mapped employees", + "operationId": "SyncAllEmployeesExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees/{employeeId}/sync": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Sync Employee", + "description": "Syncs data from the ExternalDataProvider to update the specified mapped employee.\r\nAny changes made as a result of the sync are show in the metadata.logs property.", + "operationId": "SyncEmployeeExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the employee in the external data provider", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/employees/{employeeId}/logs": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Get Employee Logs", + "description": "Return a list of changes made locally to this employee based on changes in the external data provider", + "operationId": "EmployeeLogsExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the employee in the external data provider", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogEntry" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/leave": { + "post": { + "tags": [ + "ExternalData" + ], + "summary": "Sync Leave", + "description": "Sync Leave from the ExternalDataProvider for the specified PayRun.\r\nReturns a JSON object indicating how many Leaves have been created, updated or deleted, etc.", + "operationId": "SyncLeaveExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber}": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Contributions CSV File", + "description": "Returns a CSV file containing contributions for the specified payrun in a format specific to the ExternalDataProvider", + "operationId": "PensionContributionsCsvExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "schemeId", + "in": "query", + "description": "The Id of the Pension Scheme you want a file for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/time-and-attendance": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Get Time And Attendance Data", + "description": "Return a list of PayOptionsImport representing Time and Attendance data from the specified ExternalDataProvider, for to specified date range", + "operationId": "TimeAndAttendanceExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "from", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/authorize": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Get Authorization Url", + "description": "For ExternalDataProviders with an AuthScheme of OAuth1 or OAuth2.\r\nReturns a Url to redirect a user to in order to start the authorization process with the given ExternalDataProvider.\r\nOur API handles the response from the OAuth provider and processes it to obtain a token.\r\nThe user is then sent to the URL specified.", + "operationId": "AuthorizeExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ExternalDataProvider you want to authorize with.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "returnUrl", + "in": "query", + "description": "The URL to send the user to once the process is complete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "ExternalData" + ], + "summary": "Set Credentials", + "description": "For ExternalDataProviders with an AuthScheme of Basic.\r\nSets the username and password for the service.", + "operationId": "SetCredentialsExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ExternalDataProvider you want to authorize with.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "username", + "in": "query", + "description": "The username for the ExternalDataProvider.", + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password for the ExternalDataProvider.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Any additional data that is needed (optional)", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/external-data/{id}/config": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Get Config Data", + "description": "Returns any additional configuration data for the connection to the ExternalDataProvider.", + "operationId": "GetConfigDataExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ExternalDataProvider you want configuration data for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { } + } + } + } + } + }, + "put": { + "tags": [ + "ExternalData" + ], + "summary": "Set Config Data", + "description": "Sets the additional configuration data for the connection to the ExternalDataProvider.\r\nOnly the value set in the userData field is updated", + "operationId": "SetConfigDataExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ExternalDataProvider you want configuration data for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { } + }, + "application/json": { + "schema": { } + }, + "text/json": { + "schema": { } + }, + "application/*+json": { + "schema": { } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { } + } + } + } + } + } + }, + "/employers/{employerId}/external-data/{id}/disconnect": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "Disconnect", + "description": "Disconnect from the external provider and revoke any OAuth token that has been received.", + "operationId": "DisconnectExternalData", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ExternalDataProvider you want to disconnect from.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/external-data/{id}/respond": { + "get": { + "tags": [ + "ExternalData" + ], + "summary": "3rd Party Response", + "description": "This endpoint is used by third parties to respond to an oAuth authorization request. You do not need to use this", + "operationId": "RespondExternalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "error", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}": { + "post": { + "tags": [ + "Fps" + ], + "summary": "Create FPS", + "description": "Creates a new Full Payment Submission. This is limited to corrections, to a previous year, for a single employee.", + "operationId": "CreateFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + } + } + }, + "get": { + "tags": [ + "Fps" + ], + "summary": "List FPS", + "description": "Returns all Full Payment Submissions for the given tax year.", + "operationId": "ListFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}/{id}": { + "put": { + "tags": [ + "Fps" + ], + "summary": "Update FPS", + "description": "Updates an existing Full Payment Submission.", + "operationId": "UpdateFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + } + } + }, + "get": { + "tags": [ + "Fps" + ], + "summary": "Get FPS", + "description": "Retrieves the Full Payment Submission specified", + "operationId": "GetFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Fps" + ], + "summary": "Delete FPS", + "description": "Not implemented, FPSes cannot be deleted", + "operationId": "DeleteFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "Fps" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "compressed", + "in": "query", + "description": "Indicates whether the FPS XML should be in compressed format.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}/mostrecentforemployee/{employeeId}": { + "get": { + "tags": [ + "Fps" + ], + "summary": "Get most recent FPS for Employee", + "description": "Returns the most recent Full Payment Submission that includes the specified employee", + "operationId": "MostRecentForEmployeeFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "correction", + "in": "query", + "description": "Only search for FPS's submitted as a correction to a previous year", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "Fps" + ], + "summary": "Submit FPS", + "description": "Submits an existing Full Payment Submission to HMRC.", + "operationId": "SubmitFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "description": "If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/fps/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "Fps" + ], + "summary": "Mark as Sent", + "description": "Marks an Full Payment Submission as having been sent to HMRC and accepted by them.\r\nYou only use this method if the FPS has been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fps" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/fps/requiringattention": { + "get": { + "tags": [ + "Fps" + ], + "summary": "FPS Requiring Attention", + "description": "Returns all Full Payment Submissions that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionFps", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/hmrcpayment/{taxYear}": { + "get": { + "tags": [ + "HmrcPayment" + ], + "summary": "List HmrcLiabilities", + "description": "Lists all periods for which a payment is due to HMRC in the given TaxYear", + "operationId": "IndexHmrcPayment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list HMRC Payments", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}": { + "get": { + "tags": [ + "HmrcPayment" + ], + "summary": "Get HmrcLiability", + "description": "Gets the HmrcLiability record for the period ending on the date specified.", + "operationId": "GetHmrcPayment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodEnding", + "in": "path", + "description": "The final date of the month or quarter that the HmrcLiability is for.", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + } + } + } + } + }, + "put": { + "tags": [ + "HmrcPayment" + ], + "summary": "Update HmrcLiability", + "description": "Updates the editable fields of a HmrcLiability (ie, Adjustment, CISDeductionsSuffered, etc)", + "operationId": "UpdateHmrcPayment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodEnding", + "in": "path", + "description": "The final date of the month or quarter that the HmrcLiability is for.", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HmrcLiability" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}/bankpayment": { + "get": { + "tags": [ + "HmrcPayment" + ], + "summary": "HMRC Bank Payment", + "description": "Returns a payments file for the HMRC payment that needs to be made", + "operationId": "BankPaymentHmrcPayment", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodEnding", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstructionReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstructionReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/holidayscheme": { + "get": { + "tags": [ + "HolidayScheme" + ], + "summary": "Get holiday scheme", + "operationId": "GetHolidayScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.HolidaySchemeResponse" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "HolidayScheme" + ], + "summary": "Create holiday scheme", + "operationId": "CreateHolidayScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/holidayscheme/{id}": { + "get": { + "tags": [ + "HolidayScheme" + ], + "summary": "Get holiday scheme by Id", + "operationId": "GetByIdHolidayScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "HolidayScheme" + ], + "summary": "Update holiday scheme", + "operationId": "UpdateHolidayScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.HolidaySchemeResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "HolidayScheme" + ], + "summary": "Delete holiday scheme", + "operationId": "DeleteHolidayScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + }, + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/import/payments/mappings": { + "get": { + "tags": [ + "Import" + ], + "summary": "List PaymentsCsvMappings", + "description": "Lists all PaymentsCsvMappings for an Employer.", + "operationId": "ListPaymentsCsvMappingsImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list mappings", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Import" + ], + "summary": "Create PaymentsCsvMapping", + "description": "Creates a new PaymentsCsvMapping for the Employer.", + "operationId": "CreatePaymentsCsvMappingImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created" + } + } + } + }, + "/employers/{employerId}/import/payments/mappings/{id}": { + "get": { + "tags": [ + "Import" + ], + "summary": "Get PaymentsCsvMapping", + "description": "Gets the PaymentsCsvMapping specified.", + "operationId": "PaymentsCsvMappingImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PaymentCsvMapping belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + } + } + } + } + }, + "put": { + "tags": [ + "Import" + ], + "summary": "Update PaymentsCsvMapping", + "description": "Updates the PaymentsCsvMapping specified.", + "operationId": "UpdatePaymentsCsvMappingImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PaymentsCsvMapping belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCsvMapping" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Import" + ], + "summary": "Delete PaymentsCsvMapping", + "description": "Deletes the specified PaymentsCsvMapping.", + "operationId": "DeletePaymentCsvMappingImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/import/payments/mappings/{id}/csv": { + "get": { + "tags": [ + "Import" + ], + "summary": "Get PaymentsCsvMapping CSV File", + "description": "Gets a CSV file in the format needed to import for the specified PaymentsCsvMapping\r\nThis is only available for PaymentsCsvMapping with a Type of ColumnBased", + "operationId": "PaymentsCsvMappingCsvFileImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PaymentCsvMapping belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/import/pay": { + "post": { + "tags": [ + "Import" + ], + "summary": "Import Pay To Employee", + "description": "Takes a list PayOptionsImport and updates employees PayOptions to use the values provided.", + "operationId": "ImportEmployeePayImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "linesOnly", + "in": "query", + "description": "If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "append", + "in": "query", + "description": "If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "updateExisting", + "in": "query", + "description": "If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateOnly", + "in": "query", + "description": "If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/import/employees/async": { + "post": { + "tags": [ + "Import" + ], + "summary": "Import Employees Asynchronously (Beta)", + "description": "This endpoint is currently being beta tested and subject to unannounced breaking changes.\r\nAllows the import of employees asynchronously from a CSV file.", + "operationId": "EmployeeImportCsvImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The employer id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "format", + "in": "query", + "description": "The CSV format.", + "schema": { + "$ref": "#/components/schemas/CsvFileFormat" + } + }, + { + "name": "allowUpdates", + "in": "query", + "description": "If set to true, and if the payroll code matches an existing employee, then that employee will be updated.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/import/import": { + "post": { + "tags": [ + "Import" + ], + "summary": "Import EmployeeRoles from csv file", + "description": "Import Employee Roles from a CSV file.", + "operationId": "ImportRolesImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "previewOnly", + "in": "query", + "description": "Set to true and nothing will be imported but you'll be shown a preview of the data.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "allowUpdates", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/import/pensionmemberships": { + "post": { + "tags": [ + "Import" + ], + "summary": "Import PensionMemberships from csv file", + "description": "Import Pension Memberships from a CSV file.", + "operationId": "ImportPensionMembershipsImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "previewOnly", + "in": "query", + "description": "Set to true and nothing will be imported but you'll be shown a preview of the data.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "allowUpdates", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/import/leave": { + "post": { + "tags": [ + "Import" + ], + "summary": "Import Leave Asynchronously", + "operationId": "ImportLeaveImport", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The employer id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The import leave items.", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.LeaveImportRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.LeaveImportRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.LeaveImportRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.LeaveImportRequest" + } + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/invitation": { + "get": { + "tags": [ + "Invitation" + ], + "summary": "List Invitations", + "description": "Lists all Invitations for an Employer.\r\nOnly unaccepted Invitations are listed as they are deleted once they've been accepted.", + "operationId": "IndexInvitation", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Pay Codes", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Invitation" + ], + "summary": "Create Invitation", + "description": "Creates a new Invitation for the Employer.", + "operationId": "CreateInvitation", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "autoAccept", + "in": "query", + "description": "This is useful for when you want to invite a user to an employer and automatically accept the invitation.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/invitation/{id}": { + "get": { + "tags": [ + "Invitation" + ], + "summary": "Get Invitation", + "description": "Gets the Invitation specified.", + "operationId": "GetInvitation", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Invitation belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Invitation" + ], + "summary": "Delete Invitation", + "description": "Deletes the specified Invitation.", + "operationId": "DeleteInvitation", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/invitations/{id}": { + "post": { + "tags": [ + "Invitation" + ], + "summary": "Accept Invitation", + "description": "Accepts the Invitation.\r\nThe user making this API call must have the email address that the invite was created for and the email address must be verified.", + "operationId": "AcceptInvitation", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "acceptInvitation", + "in": "query", + "description": "Set to true to accept the invitation or false to decline it.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/jobs/{jobId}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Get Job", + "description": "Returns a job.", + "operationId": "GetJobJob", + "parameters": [ + { + "name": "jobId", + "in": "path", + "description": "The job identifier.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/jobs": { + "get": { + "tags": [ + "Job" + ], + "summary": "List Jobs", + "description": "Returns a list of Jobs for all Employers that belong to the User with pagination.", + "operationId": "GetJobsListJob", + "parameters": [ + { + "name": "employerId", + "in": "query", + "description": "The employer identifier.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "jobType", + "in": "query", + "description": "Type of the job.", + "schema": { + "$ref": "#/components/schemas/JobType" + } + }, + { + "name": "pageNum", + "in": "query", + "description": "The page number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Size of the page.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/jobs/{jobId}/document": { + "get": { + "tags": [ + "Job" + ], + "summary": "Get Job file", + "description": "Returns the file generated for a successfully completed Job of type Report as a string representing a filestream.", + "operationId": "GetReportJobResultJob", + "parameters": [ + { + "name": "jobId", + "in": "path", + "description": "The job identifier.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/jobs/completed": { + "delete": { + "tags": [ + "Job" + ], + "summary": "Delete Completed Jobs", + "description": "Deletes the users completed Jobs.", + "operationId": "DeleteCompletedJobsJob", + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/jobs/{jobId}/errors": { + "get": { + "tags": [ + "Job" + ], + "summary": "Get Job Errors", + "description": "Returns a list of errors for a job.", + "operationId": "GetJobErrorsByJobIdJob", + "parameters": [ + { + "name": "jobId", + "in": "path", + "description": "The job identifier.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.JobErrorResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/journaltemplate": { + "get": { + "tags": [ + "JournalTemplate" + ], + "summary": "Get Journal Template", + "description": "Get Journal Template for an Employer.", + "operationId": "GetJournalTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get Journal Template", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "JournalTemplate" + ], + "summary": "Create Journal Template", + "description": "Create Journal Template for an Employer.", + "operationId": "CreateJournalTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Journal Template", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/JournalTemplate" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/JournalTemplate" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/JournalTemplate" + } + } + } + } + } + } + }, + "/employers/{employerId}/journaltemplate/{id}": { + "put": { + "tags": [ + "JournalTemplate" + ], + "summary": "Update Journal Template", + "description": "Updates Specified Journal Template for the Employer.", + "operationId": "UpdateJournalTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Journal Template", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTemplateResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/journaltokens": { + "get": { + "tags": [ + "JournalToken" + ], + "summary": "List Journal Tokens", + "description": "List Journal Tokens for an Employer.", + "operationId": "IndexJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of Journal Tokens", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.JournalTokenResponseItem" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.JournalTokenResponseItem" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.JournalTokenResponseItem" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "JournalToken" + ], + "summary": "Create Journal Token", + "description": "Create Journal Token for an Employer.", + "operationId": "CreateJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Journal Token", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/journaltokens/{id}": { + "get": { + "tags": [ + "JournalToken" + ], + "summary": "Get Journal Token", + "description": "Get Specified Journal Token for an Employer.", + "operationId": "GetJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get Journal Token", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Journal Tokens for which you want to get Journal Token", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "JournalToken" + ], + "summary": "Update Journal Token", + "description": "Updates Specified Journal Token for the Employer.", + "operationId": "UpdateJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JournalTokenResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "JournalToken" + ], + "summary": "Delete Journal Token", + "description": "Deletes the specified Journal Token.", + "operationId": "DeleteJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides": { + "get": { + "tags": [ + "JournalToken" + ], + "summary": "List Department Journal Overrides", + "description": "List Journal Overrides for an Department.", + "operationId": "GetDepartmentJournalOverridesListJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "departmentId", + "in": "path", + "description": "The Id of the Department for which you want list of Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or Department Not Found" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponseItem" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponseItem" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponseItem" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "JournalToken" + ], + "summary": "Create Department Journal Overrides", + "description": "Create Journal Overrides for an Department.", + "operationId": "CreateDepartmentJournalOverridesJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "departmentId", + "in": "path", + "description": "The Id of the Department for which you want to create Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesRequest" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or Department Not Found" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "JournalToken" + ], + "summary": "Update Department Journal Overrides", + "description": "Updates Journal Overrides for the Department.", + "operationId": "UpdateDepartmentJournalOverridesJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "departmentId", + "in": "path", + "description": "The Id of the Department for which you want to update Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesUpdateRequest" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or Department Not Found" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.DepartmentJournalOverridesResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides": { + "get": { + "tags": [ + "JournalToken" + ], + "summary": "List CostCentre Journal Overrides", + "description": "List Journal Overrides for an CostCentre.", + "operationId": "GetCostCentreJournalOverridesListJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "costCentreId", + "in": "path", + "description": "The Id of the CostCentre for which you want list of Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or CostCentre Not Found" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponseItem" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponseItem" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponseItem" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "JournalToken" + ], + "summary": "Create CostCentre Journal Overrides", + "description": "Create Journal Overrides for an CostCentre.", + "operationId": "CreateCostCentreJournalOverridesJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "costCentreId", + "in": "path", + "description": "The Id of the CostCentre for which you want to create Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesRequest" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or CostCentre Not Found" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "JournalToken" + ], + "summary": "Update CostCentre Journal Overrides", + "description": "Updates Journal Overrides for the CostCentre.", + "operationId": "UpdateCostCentreJournalOverridesJournalToken", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "costCentreId", + "in": "path", + "description": "The Id of the CostCentre for which you want to update Journal Overrides", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesUpdateRequest" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or CostCentre Not Found" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.CostCentreJournalOverridesResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave": { + "post": { + "tags": [ + "Leave" + ], + "summary": "Create Leave", + "description": "Creates Leave for the Employee", + "operationId": "CreateLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + } + } + }, + "responses": { + "409": { + "description": "Conflict" + }, + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "get": { + "tags": [ + "Leave" + ], + "summary": "List Leave", + "description": "Lists all Leave for the Employee", + "operationId": "IndexLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/{id}": { + "get": { + "tags": [ + "Leave" + ], + "summary": "Get Leave", + "description": "Gets the Leave specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Leave you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "Leave" + ], + "summary": "Update Leave", + "operationId": "UpdateLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Leave you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Leave" + ], + "summary": "Delete Leave", + "description": "Deletes the Leave specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeleteLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Leave you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "409": { + "description": "Conflict" + }, + "400": { + "description": "Bad Request" + }, + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/findlinkedpiw": { + "get": { + "tags": [ + "Leave" + ], + "summary": "Find Linked Piw", + "description": "Finds the linked piw the supplied leave would linked to, or null if none found", + "operationId": "FindLinkedPiwLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "leaveType", + "in": "query", + "description": "The type of leave to you want to find a linked Piw for.", + "schema": { + "$ref": "#/components/schemas/LeaveType" + } + }, + { + "name": "leavePayType", + "in": "query", + "description": "The type of leave pay to you want to find a linked Piw for.", + "schema": { + "$ref": "#/components/schemas/LeavePayType" + } + }, + { + "name": "from", + "in": "query", + "description": "The leave from date you want to find a linked Piw for.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "description": "The leave to date you want to find a linked Piw for.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkedPiw" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/{id}/documents": { + "post": { + "tags": [ + "Leave" + ], + "summary": "Add Document", + "description": "Adds document to the leave", + "operationId": "AddDocumentLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the leave you want to attach documents to", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId}": { + "delete": { + "tags": [ + "Leave" + ], + "summary": "Delete Leave Document", + "description": "Deletes the document specified by the documentId for the Leave specified by the Id", + "operationId": "DeleteDocumentLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "Leave" + ], + "summary": "Get Leave Document", + "description": "Gets the document specified by the documentId for the Leave specified by the Id", + "operationId": "GetDocumentLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/statutorymaternityschedule": { + "get": { + "tags": [ + "Leave" + ], + "summary": "List Statutory Maternity Leave History", + "description": "Lists all Statutory Maternity leave history specified for an Employee.", + "operationId": "GetMaternityLeaveScheduleLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "babyDueDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "leaveFrom", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "leaveTo", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "leaveType", + "in": "query", + "schema": { + "$ref": "#/components/schemas/LeaveType" + } + }, + { + "name": "leavePayType", + "in": "query", + "schema": { + "$ref": "#/components/schemas/LeavePayType" + } + }, + { + "name": "payFrequency", + "in": "query", + "schema": { + "$ref": "#/components/schemas/StatPayFrequency" + } + }, + { + "name": "averageWeeklyEarnings", + "in": "query", + "schema": { + "type": "number", + "format": "double", + "default": 0 + } + }, + { + "name": "isReversed", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/leave/occupationalmaternityschedule/{id}": { + "get": { + "tags": [ + "Leave" + ], + "summary": "List occupational Maternity Leave History", + "description": "Lists all occupational Maternity leave history specified for an Employee.", + "operationId": "GetOccupationalMaternityScheduleLeave", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/loans": { + "post": { + "tags": [ + "Loan" + ], + "summary": "Create Loan", + "description": "Creates a Loan for the Employee", + "operationId": "CreateLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "get": { + "tags": [ + "Loan" + ], + "summary": "List Loans", + "description": "Lists all AttachmentOrders for the Employee", + "operationId": "IndexLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/loans/{id}": { + "get": { + "tags": [ + "Loan" + ], + "summary": "Get Loan", + "description": "Gets the Loan specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Loan you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "Loan" + ], + "summary": "Update Loan", + "operationId": "UpdateLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Loan you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Loan" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Loan" + ], + "summary": "Delete Loan", + "description": "Deletes the Loan specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeleteLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Loan you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/loans/{id}/documents": { + "post": { + "tags": [ + "Loan" + ], + "summary": "Add Document", + "description": "Adds document to the Loan", + "operationId": "AddDocumentLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Loan you want to attach documents to", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId}": { + "delete": { + "tags": [ + "Loan" + ], + "summary": "Delete Loan Document", + "description": "Deletes the document specified by the documentId for the Loan specified by the Id", + "operationId": "DeleteDocumentLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "Loan" + ], + "summary": "Get Loan Document", + "description": "Gets the document specified by the documentId for the Loan specified by the Id", + "operationId": "GetDocumentLoan", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/notes": { + "post": { + "tags": [ + "Note" + ], + "summary": "Create Note", + "description": "Creates a Note for the Employee", + "operationId": "CreateNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "get": { + "tags": [ + "Note" + ], + "summary": "List Notes", + "description": "Lists all Note for the Employee", + "operationId": "IndexNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/notes/{id}": { + "get": { + "tags": [ + "Note" + ], + "summary": "Get Note", + "description": "Gets the Note specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Note you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "Note" + ], + "summary": "Update Note", + "operationId": "UpdateNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Note you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Note" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Note" + ], + "summary": "Delete Note", + "description": "Deletes the Note specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeleteNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Note you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/notes/{id}/documents": { + "post": { + "tags": [ + "Note" + ], + "summary": "Add Document", + "description": "Adds document to the Note", + "operationId": "AddDocumentNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Note you want to attach documents to", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId}": { + "delete": { + "tags": [ + "Note" + ], + "summary": "Delete Note Document", + "description": "Deletes the document specified by the documentId for the Note specified by the Id", + "operationId": "DeleteDocumentNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "Note" + ], + "summary": "Get Note Document", + "description": "Gets the document specified by the documentId for the Note specified by the Id", + "operationId": "GetDocumentNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/rti/nvr/{taxYear}": { + "get": { + "tags": [ + "Nvr" + ], + "summary": "List NVR", + "description": "Returns all NiNo Verification Requests for the given tax year.", + "operationId": "ListNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Nvr" + ], + "summary": "Create NVR", + "description": "Creates a new NiNo Verification Request.", + "operationId": "CreateNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/nvr/{taxYear}/{id}": { + "put": { + "tags": [ + "Nvr" + ], + "summary": "Update NVR", + "description": "Updates an existing NiNo Verification Request.", + "operationId": "UpdateNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + } + } + }, + "get": { + "tags": [ + "Nvr" + ], + "summary": "Get NVR", + "description": "Retrieves the NiNo Verification Request.", + "operationId": "GetNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Nvr" + ], + "summary": "Delete NVR", + "description": "Deletes the NVR.", + "operationId": "DeleteNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employers/{employerId}/rti/nvr/{taxYear}/{id}/xml/request": { + "get": { + "tags": [ + "Nvr" + ], + "summary": "Get XML Request", + "description": "Returns the XML request that was or will be sent to HMRC for this RTI document.\r\nAlthough the value is XML, it is returned as a JSON string.", + "operationId": "GetXmlRequestNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/nvr/{taxYear}/{id}/submit": { + "post": { + "tags": [ + "Nvr" + ], + "summary": "Submit an existing NVR", + "description": "Submits an existing NiNo Verification Request to HMRC.", + "operationId": "SubmitNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "force", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/nvr/{taxYear}/{id}/markasaccepted": { + "post": { + "tags": [ + "Nvr" + ], + "summary": "Mark as Sent", + "description": "Marks a NiNo Verification Request as having been sent to HMRC and accepted by them\r\nYou only use this method if the NVR has been submitted via an external system.\r\nIt will automatically be updated as Sent and/or Accepted if it's submitted via this API.", + "operationId": "MarkAsAcceptedNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Nvr" + } + } + } + } + } + } + }, + "/employers/{employerId}/rti/nvr/requiringattention": { + "get": { + "tags": [ + "Nvr" + ], + "summary": "NVR Requiring Attention", + "description": "Returns all NiNo Verification Requests that have a Submission Status of NotSubmitted or ErrorResponse", + "operationId": "RequiringAttentionNvr", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/occupationalpolicies": { + "get": { + "tags": [ + "OccupationalPolicy" + ], + "summary": "List Occupational Policies", + "description": "Lists all Occupational Policies for an Employer.", + "operationId": "IndexOccupationalPolicy", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "404": { + "description": "Employer or Occupational Policy Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "OccupationalPolicy" + ], + "summary": "Create Occupational Policy", + "description": "Creates a new Occupational Policy for the Employer.", + "operationId": "CreateOccupationalPolicy", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "404": { + "description": "Employer or Occupational Policy Not Found" + } + } + } + }, + "/employers/{employerId}/occupationalpolicies/{id}": { + "get": { + "tags": [ + "OccupationalPolicy" + ], + "summary": "Get Occupational Policy", + "description": "Gets the Occupational Policy specified.", + "operationId": "GetOccupationalPolicy", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Occupational Policy belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational Policy which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "404": { + "description": "Employer or Occupational Policy Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "OccupationalPolicy" + ], + "summary": "Update Occupational Policy", + "description": "Updates a Occupational Policy for the Employer.", + "operationId": "UpdateOccupationalPolicy", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Occupational Policy belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational Policy which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "404": { + "description": "Employer or Occupational Policy Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "OccupationalPolicy" + ], + "summary": "Delete Occupational Policy", + "description": "Deletes the specified Occupational Policy.", + "operationId": "DeleteOccupationalPolicy", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Occupational Policy belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational Policy which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or Occupational Policy Not Found" + } + } + } + }, + "/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}": { + "get": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "List OccupationalSickLeaveHistory", + "description": "Lists all OccupationalSickLeaveHistory for the Employee specified", + "operationId": "OccupationalSickLeaveHistoryOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Create OccupationalSickLeaveHistory", + "description": "Creates Occupational sick leave history for the Employee.", + "operationId": "CreateOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee to which the Occupational sick leave history belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + } + } + } + }, + "/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id}": { + "get": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Get OccupationalSickLeaveHistory", + "description": "Gets a occupational sick leave for the employee and employer.", + "operationId": "GetOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational leave history which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + } + } + }, + "put": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Update OccupationalSickLeaveHistory", + "description": "Updates a occupational sick leave for the employee and employer.", + "operationId": "UpdateOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational leave history which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Delete OccupationalSickLeaveHistory", + "description": "Deletes the specified Occupational leave history record.", + "operationId": "DeleteOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Occupational sick leave which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/occupationalsickleavehistory/import": { + "post": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Upload OccupationalSickLeaveHistory", + "description": "Uploads new Occupational sick leave history for the Employer against specific occupational policy.", + "operationId": "UploadOSPHistoryOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the occupational sick leave history is to be uploaded.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OccupationalSickLeaveHistory" + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/occupationalsickleavehistory/importfile": { + "post": { + "tags": [ + "OccupationalSickLeaveHistory" + ], + "summary": "Import OccupationalSickLeaveHistory from csv file", + "description": "Import Occupational Sick Leave History from a CSV file.", + "operationId": "ImportOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/openingBalances": { + "get": { + "tags": [ + "OpeningBalances" + ], + "summary": "Get Opening Balances", + "description": "Returns the Opening Balances for an Employee", + "operationId": "GetOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve Opening Balances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "OpeningBalances" + ], + "summary": "Update Opening Balances", + "description": "Updates the Opening Balances for an Employee.", + "operationId": "UpdateOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update Opening Balances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "404": { + "description": "Not Found" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}": { + "post": { + "tags": [ + "OpeningBalances" + ], + "summary": "Create NicSummary", + "description": "Creates a NicSummary for for an Employee.", + "operationId": "CreateNicSummaryOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to create the Nic Summary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummary applies to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "OpeningBalances" + ], + "summary": "Get NicSummaries", + "description": "Returns the NicSummaries for an Employee for a given TaxYear.\r\nIf the TaxYear is the same as on their OpeningBalances then the NicSummaries will be the same as shown there.", + "operationId": "GetNicSummariesOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve Opening Balances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummaries apply to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "openingBalancesOnly", + "in": "query", + "description": "Limit the results to opening balance year to date", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "OpeningBalances" + ], + "summary": "Update NicSummaries", + "description": "Updates the NicSummaries for an Employee for a given TaxYear.\r\nIf the TaxYear is the same as on their OpeningBalances then the NicSummaries there will also be updated.", + "operationId": "UpdateNicSummariesOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve Opening Balances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummaries apply to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId}": { + "get": { + "tags": [ + "OpeningBalances" + ], + "summary": "Get NicSummary", + "description": "Returns a NicSummary for a Unique Id for an Employee.", + "operationId": "GetNicSummaryOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve the Nic Summary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummary applies to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "uniqueId", + "in": "path", + "description": "The Id of the NicSummary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "OpeningBalances" + ], + "summary": "Update NicSummary", + "description": "Update a NicSummary for a Unique Id for an Employee.", + "operationId": "UpdateNicSummaryOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update the Nic Summary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummary applies to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "uniqueId", + "in": "path", + "description": "The Id of the NicSummary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NicSummary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "OpeningBalances" + ], + "summary": "Delete NicSummary", + "description": "Delete a NicSummary for a Unique Id for an Employee.", + "operationId": "DeleteNicSummaryOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to delete the Nic Summary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the NicSummary applies to", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "uniqueId", + "in": "path", + "description": "The Id of the NicSummary", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/openingBalances/p45": { + "put": { + "tags": [ + "OpeningBalances" + ], + "summary": "Update P45 Value", + "description": "Updates the P45 Values on the Opening Balances for an Employee.\r\nThis would ideally be done when the Opening Balances are updated but if payruns have already been started for the employee then Opening Balances can't be updated - hence this API call just to update the P45 values.\r\nThere must be a currently open PayRun for the employee.\r\nOnly the PreviousEmployerGross and PreviousEmployerTax properties of the submitted OpeningBalances model are updated.", + "operationId": "UpdateP45OpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update P45 figures", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/openingBalances/terminationpayments": { + "put": { + "tags": [ + "OpeningBalances" + ], + "summary": "Update Termination Pay", + "description": "Updates the Termination Pay value on the Opening Balances for an Employee.\r\nThis would ideally be done when the Opening Balances are updated but if payruns have already been started for the employee then Opening Balances can't be updated - hence this API call just to update the Termination Pay value.\r\nOnly the TerminationPayments property of the submitted OpeningBalances model is updated.", + "operationId": "UpdateTerminationPaymentsOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update Termination Payments", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalances" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/openingbalances/{taxYear}": { + "get": { + "tags": [ + "OpeningBalances" + ], + "summary": "Totals of employee opening balances for a tax year", + "description": "Totals of Employee Opening Balances in the specified TaxYear", + "operationId": "GetOpeningBalancesTotalsOpeningBalances", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to search.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear for which you want to Opening Balances totals.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/OpeningBalancesTotals" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalancesTotals" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/OpeningBalancesTotals" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/p11history": { + "post": { + "tags": [ + "P11History" + ], + "summary": "Create P11 Historical data", + "operationId": "CreateP11History", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "", + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "P11History" + ], + "summary": "Retrieve P11 Historical data", + "operationId": "ListPagedP11History", + "parameters": [ + { + "name": "pageNum", + "in": "query", + "description": "", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.P11HistoryResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/p11history/{id}": { + "delete": { + "tags": [ + "P11History" + ], + "summary": "Delete P11 Historical data", + "operationId": "DeleteP11History", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + }, + "put": { + "tags": [ + "P11History" + ], + "summary": "Update P11 Historical entry", + "operationId": "UpdateP11History", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The unique id of the record", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.P11HistoryResponse" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/paycodes": { + "get": { + "tags": [ + "PayCode" + ], + "summary": "List PayCodes", + "description": "Lists all PayCodes for the Employer specified.", + "operationId": "IndexPayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Pay Codes", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "verbose", + "in": "query", + "description": "If provided and set to true then full details of all Pay Codes will be returned instead of just a summary", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "PayCode" + ], + "summary": "Create PayCode", + "description": "Creates a new PayCode for the Employer.", + "operationId": "CreatePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/paycodes/{code}": { + "get": { + "tags": [ + "PayCode" + ], + "summary": "Get PayCode (deprecated)", + "description": "Gets the PayCode specified.\r\nUse the other GET endpoint that supports non-alphanumeric characters for a pay code", + "operationId": "GetPayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Pay Code belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the Pay Code you want to retrieve.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "PayCode" + ], + "summary": "Update PayCode (deprecated)", + "description": "Updates the details of an existing PayCode.\r\nUse the other Update endpoint that supports non-alphanumeric characters for a pay code", + "operationId": "UpdatePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "PayCode" + ], + "summary": "Delete PayCode (deprecated)", + "description": "Deletes the specified PayCode.\r\nUse the other Delete endpoint that supports non-alphanumeric characters for a pay code", + "operationId": "DeletePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/paycodes/paycode": { + "get": { + "tags": [ + "PayCode" + ], + "summary": "Get PayCode", + "description": "Gets the PayCode specified.", + "operationId": "GetPayCodePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Pay Code belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The code of the Pay Code you want to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "PayCode" + ], + "summary": "Update PayCode", + "description": "Updates the details of an existing PayCode.", + "operationId": "UpdatePayCodePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCode" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "PayCode" + ], + "summary": "Delete PayCode", + "description": "Deletes the specified PayCode.", + "operationId": "DeletePayCodePayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/paycodes/nominalcodes": { + "get": { + "tags": [ + "PayCode" + ], + "summary": "Get Nominal Code Mappings", + "description": "Returns the list of mappings of PayCodes to NominalCodes", + "operationId": "NominalCodeMappingsPayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the mapping", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "PayCode" + ], + "summary": "Updates Nominal Code Mappings", + "description": "Updates the list of mappings of PayCodes to NominalCodes", + "operationId": "UpdateNominalCodeMappingsPayCode", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NominalCodeMapping" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/paycodesets": { + "get": { + "tags": [ + "PayCodeSet" + ], + "summary": "List PayCodeSets", + "description": "Lists all PayCodeSets for an Employer.", + "operationId": "IndexPayCodeSet", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list PayCodeSets", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "PayCodeSet" + ], + "summary": "Create PayCodeSet", + "description": "Creates a new PayCodeSet for the Employer.", + "operationId": "CreatePayCodeSet", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + } + } + } + } + } + }, + "/employers/{employerId}/paycodesets/{id}": { + "get": { + "tags": [ + "PayCodeSet" + ], + "summary": "Get PayCodeSet", + "description": "Gets the PayCodeSet specified.", + "operationId": "GetPayCodeSet", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Pay Code Set belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + } + } + } + } + }, + "put": { + "tags": [ + "PayCodeSet" + ], + "summary": "Update PayCodeSet", + "description": "Updates the details of an existing PayCodeSet.", + "operationId": "UpdatePayCodeSet", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayCodeSet" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "PayCodeSet" + ], + "summary": "Delete PayCodeSet", + "description": "Deletes the specified PayCodeSet.", + "operationId": "DeletePayCodeSet", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/payees": { + "get": { + "tags": [ + "Payee" + ], + "summary": "List Payees", + "description": "Lists all Payees for an Employer.", + "operationId": "IndexPayee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Payees", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Payee" + ], + "summary": "Create Payee", + "description": "Creates a new Payee for the Employer.", + "operationId": "CreatePayee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/payees/{id}": { + "get": { + "tags": [ + "Payee" + ], + "summary": "Get Payee", + "description": "Gets the Payee specified.", + "operationId": "GetPayee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Payee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + } + } + } + } + }, + "put": { + "tags": [ + "Payee" + ], + "summary": "Update Payee", + "description": "Updates a Payee for the Employer.", + "operationId": "UpdatePayee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Payee" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "delete": { + "tags": [ + "Payee" + ], + "summary": "Delete Payee", + "description": "Deletes the specified Payee.", + "operationId": "DeletePayee", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List PayRuns", + "operationId": "GetPayRunsPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "PayRun" + ], + "summary": "Starts the next PayRun", + "description": "Starts the next PayRun and returns a 201 if successful", + "operationId": "CreateNextPayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "201": { + "description": "Success - the PayRun has been created.\r\nThe unique URL for this PayRun is returned in the Location header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PayRun" + ], + "summary": "Starts the next PayRun (deprecated)", + "description": "This PUT will be removed in Jan 2022. You should instead use a POST to this URL", + "operationId": "StartNextPayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "201": { + "description": "Success - the PayRun has been created.\r\nThe unique URL for this PayRun is returned in the Location header." + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get a PayRun", + "operationId": "GetPayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "pageNum", + "in": "query", + "description": "Zero-based page number, used in conjunction with pageSize", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The number of items per page", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The option to filter on a search term", + "schema": { + "type": "string" + } + }, + { + "name": "zeroPaid", + "in": "query", + "description": "The option to filter pay run entries by negative paid, zero paid and non-zero paid", + "schema": { + "$ref": "#/components/schemas/ZeroPaidFilter" + } + }, + { + "name": "departmentCode", + "in": "query", + "description": "The option to filter on department code", + "schema": { + "type": "string" + } + }, + { + "name": "startersLeavers", + "in": "query", + "description": "The option to filter on whether the employee is a starter or leaver", + "schema": { + "$ref": "#/components/schemas/StartersLeaversFilter" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "The option to sort by a certain field. Default is Payroll Code", + "schema": { + "$ref": "#/components/schemas/PayRunEntrySortBy" + } + }, + { + "name": "sortDescending", + "in": "query", + "description": "Whether to sort in ascending or descending order", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PayRun" + ], + "summary": "Delete a PayRun", + "operationId": "DeletePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PayRun" + ], + "summary": "Update PayRun", + "description": "Updates a PayRun to the state provided along with the reason (optional) for the change.", + "operationId": "UpdatePayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "sendPayslipEmails", + "in": "query", + "description": "Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "payslipReleaseType", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayslipReleaseType" + } + }, + { + "name": "payslipScheduledDateTime", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "description": "Specify the PayRun state you want to change to and the reason for the change.\r\nOnly Open and Finalised states are available at the moment.\r\nOther states are used with Bureau functionality which isn't currently generally available.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + } + } + }, + "responses": { + "200": { + "description": "Success - the PayRun has been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/warnings": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get PayRun Warnings", + "description": "Returns a list of Item detailing any Warnings for PayRunEntries on the specified PayRun", + "operationId": "GetPayRunWarningsPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/events": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get PayPeriodEvents", + "operationId": "GetPayRunEventsPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaySchedulePeriodEvent" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/ytd": { + "put": { + "tags": [ + "PayRun" + ], + "summary": "Update YTD", + "description": "Upload a CSV to override the YTD values on a Pay Run.\r\nThe CSV should have the same headings as the YTD report", + "operationId": "YtdPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeYtdValues" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/leave": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List Leave related to a PayRun", + "description": "Returns a List of Items representing any Leave within the PayRun date range for Employees that are included in the given PayRun.\r\nNote that if Leave was added after the PayRun was closed, but the Leave is within the PayRun period then it'll be returned here even though it wouldn't have been processed with the PayRun.", + "operationId": "LeavePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/aeo": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List AttachmentOrders related to a PayRun", + "description": "Returns a List of Items representing any AttachmentOrders within the PayRun date range for Employees that are included in the given PayRun.", + "operationId": "AeoPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/changes": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List PayRun Changes", + "description": "Returns a of changes made to a payrun since it was created.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "ChangesPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunChanges" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/changes": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List PayRun Changes for PayRunEntry", + "description": "Returns a list of AuditEntry reflecting changes made to a PayRunEntry and related employee record for a given PayRun\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "ChangesForPayRunEntryPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "significantChangesOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChangeSummary" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/journal": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get Journal for PayRun", + "description": "Returns values that can be used to create accounting entries for this PayRun.", + "operationId": "GetPayRunJournalPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptBreakdown", + "in": "query", + "description": "Set to true and the journal will be split between any relevant Departments", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunJournal" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/finalise": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Finalise a PayRun (deprecated)", + "description": "This endpoint is now deprecated and will be removed in Jan 2022.\r\nYou should instead use the Update method and set the State to Finalised.\r\n \r\nReturns True if the resulting FPS has been automatically submitted due to the Employers RTISubmissionSettings, otherwise returns false.\r\nYou can suppress the emailing of payslips to employees by adding a key named dontEmailEmployeePayslips with a value of true to the body. See the related guides for more information.", + "operationId": "FinalisePayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "text/json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + }, + "application/*+json": { + "schema": { + "type": "object", + "additionalProperties": { } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/reopen": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Re-open a PayRun (deprecated)", + "description": "This endpoint is now deprecated and will be removed in Jan 2022.\r\nYou should instead use the Update method and set the State to Open.\r\n \r\nRe-opens a PayRun so that it can be edited.\r\nOnly the most recent PayRun can be re-opened, and only if the Employer is still in the same TaxYear as the PayRun and there are no open PayRuns.", + "operationId": "ReOpenPayRunPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/email": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "(Re)send Payslip Emails", + "description": "Payslips are usually emailed automatically when a PayRun is finalised. But if you suppressed them or need to re-send them then you can do so with this API call.\r\nProviding a pay run entry id will send a single email, otherwise all emails will be sent.", + "operationId": "SendPayslipEmailsPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The ID of the employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The pay period of the pay run.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "description": "The period number of the pay run.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The tax year of the pay run.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "description": "The ordinal number of the pay run.", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "id", + "in": "query", + "description": "The UniqueId of the pay run entry (optional).", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/p45/email": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "(Re)send P45 Emails", + "operationId": "EmailMultipleP45sPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paycodes": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get PayCodes for a PayRun", + "operationId": "GetPayRunPayCodesPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Get a PayRunEntry", + "operationId": "GetPayRunEntryPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + } + } + }, + "post": { + "tags": [ + "PayRun" + ], + "summary": "Update a PayRunEntry", + "operationId": "UpdatePayRunEntryPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "forceSyncEmployeePayOptions", + "in": "query", + "description": "If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/umbrella": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "PayRunEntry Umbrella Payment", + "description": "Automatically sets the values on the PayRunEntry based on an UmbrellaPayment.\r\nUsing this method overwrites any existing values for the PayRunEntry.", + "operationId": "PayRunEntryUmbrellaPaymentPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{payPeriod}/importpay": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Import Pay", + "description": "Takes a list PayOptionsImport and updates the currently open payrun to use the amounts given.\r\nYou must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun.\r\nAny lines imported for a PayRunEntry will replace existing lines for that PayRunEntry.", + "operationId": "ImportPayPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "linesOnly", + "in": "query", + "description": "If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "append", + "in": "query", + "description": "If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "updateExisting", + "in": "query", + "description": "If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateOnly", + "in": "query", + "description": "If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payrun/{payPeriod}/importumbrellapay": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Import Umbrella Pay", + "description": "Takes a list UmbrellaPayment and updates the currently open payrun to use the amounts given.\r\nYou must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun.\r\nYou should have also set the UmbrellaSettings for the Employer", + "operationId": "ImportUmbrellaPayPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UmbrellaPayment" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{payPeriod}/importtimeandattendance": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Import Time And Attendance", + "description": "If the employer is connected to an ExternalDataProvider that provides Time and Attendance data then this API\r\ncall will update the currently open payrun for the PayPeriod specified with data from the specified provider.\r\nReturns a list of PayOptionsImport to show what's been imported.", + "operationId": "ImportTimeAndAttendancePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "providerId", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ExternalDataProviderId" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayOptionsImport" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paymentdate": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Set PaymentDate", + "description": "Sets the PaymentDate for a PayRun.\r\nIf the date given is outside of the TaxPeriod that the payrun is for then only the payment date for the individual\r\nPayRunEntries is updated, the PayRun will retain it's current PaymentDate", + "operationId": "UpdatePaymentDatePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "string", + "format": "date-time" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "date-time" + } + }, + "text/json": { + "schema": { + "type": "string", + "format": "date-time" + } + }, + "application/*+json": { + "schema": { + "type": "string", + "format": "date-time" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/zeroise": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Zeroise PayRunEntries", + "description": "Zeroises the payrun entries specified in the ids property", + "operationId": "ZeroisePayRunEntriesPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/removepayrunentries": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Remove PayRunEntries (deprecated)", + "description": "Removes the payrun entries specified in the ids property", + "operationId": "RemovePayRunEntriesPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/addpayrunentries": { + "post": { + "tags": [ + "PayRun" + ], + "summary": "Add PayRunEntries (deprecated)", + "description": "Adds the payrun entries specified in the ids property", + "operationId": "AddPayRunEntriesPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/employees/{employeeId}/Last": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Gets the last closed pay run entry for an employee.", + "operationId": "LastPayRunEntryForEmployeePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to get last pay run entry for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isClosed", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/employees/{employeeId}/averageholidaypayrate": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Calculate Average Holiday Pay Rate", + "description": "Calculates the average holiday pay rate for an employee based on their holiday scheme configuration", + "operationId": "CalculateAverageHolidayPayPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startDate", + "in": "query", + "description": "The date we used to calculate average holiday pay from", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/stateHistory": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "List PayRunStateHistory", + "description": "Returns the state history of a pay run.", + "operationId": "GetPayRunStateHistoryPayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "description": "The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The Tax Year for which you want to get the Pay Run history", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "description": "Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayRunStateHistoryResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayRunStateHistoryResponse" + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayRunStateHistoryResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/employees/{employeeId}/pension/{pensionUniqueId}/pensionytd": { + "get": { + "tags": [ + "PayRun" + ], + "summary": "Gets last PayRunEntry for a Pension", + "operationId": "LastPayRunEntryWithPensionYtdValuesForEmployeePayRun", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to get pay run entry for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pensionUniqueId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber}": { + "delete": { + "tags": [ + "PayRunAsync" + ], + "summary": "Registers a request to delete a PayRun (beta)", + "description": "Registers a request to delete a PayRun and returns a 202 if successful.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "QueueDeletePayRunPayRunAsync", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + }, + "put": { + "tags": [ + "PayRunAsync" + ], + "summary": "Registers a request to update the PayRun (beta)", + "description": "Queues a request to update a PayRun to the state provided along with the reason (optional) for the change.", + "operationId": "QueueUpdatePayRunPayRunAsync", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "sendPayslipEmails", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "payslipReleaseType", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayslipReleaseType" + } + }, + { + "name": "payslipScheduledDateTime", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayRunStateChange" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + }, + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRun" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/payrun-async/{taxYear}/{payPeriod}": { + "post": { + "tags": [ + "PayRunAsync" + ], + "summary": "Registers a request to start the next PayRun (beta)", + "description": "Registers the request to start the next PayRun and returns a 202 if successful\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "QueueCreatePayRunPayRunAsync", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "202": { + "description": "Success - the request to start a PayRun has been accepted.\r\nThe unique URL for this PayRun is returned in the Location header." + }, + "400": { + "description": "Bad Request" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/payrun-async/{payPeriod}/importpay": { + "post": { + "tags": [ + "PayRunAsync" + ], + "summary": "Import Pay (beta)", + "description": "Takes a list PayOptionsImport and updates the currently open payrun to use the amounts given.\r\nYou must have an open payrun for the PayPeriod specified and all payroll codes submitted must match an employee on the payrun.\r\nAny lines imported for a PayRunEntry will replace existing lines for that PayRunEntry.", + "operationId": "ImportPayPayRunAsync", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinal", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "LinesOnly", + "in": "query", + "description": "If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "Append", + "in": "query", + "description": "If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "UpdateExisting", + "in": "query", + "description": "If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "throwOnError", + "in": "query", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayOptionsImportRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayOptionsImportRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayOptionsImportRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayOptionsImportRequest" + } + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/schedules/{taxYear}": { + "get": { + "tags": [ + "PaySchedule" + ], + "summary": "Get PaySchedules", + "description": "Get all PaySchedules for the given TaxYear.", + "operationId": "GetAllPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/schedules/{taxYear}/{payPeriod}": { + "get": { + "tags": [ + "PaySchedule" + ], + "summary": "Get PaySchedule (deprecated)", + "description": "Get the PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided).", + "operationId": "GetWithOptionalOrdinalPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + } + } + }, + "post": { + "tags": [ + "PaySchedule" + ], + "summary": "Create a PaySchedule (deprecated)", + "description": "Create PaySchedule using a certain pay frequency and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided).", + "operationId": "CreateWithOptionalOrdinalPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to update details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that the PaySchedule is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySchedule" + ], + "summary": "Update PaySchedule (deprecated)", + "description": "Update PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided).", + "operationId": "SaveWithOptionalOrdinalPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to update details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that the PaySchedule is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PaySchedule" + ], + "summary": "Delete PaySchedule (deprecated)", + "description": "Delete the PaySchedule for the PayPeriod and TaxYear specified (and an optional ordinal. 1 will be used if ordinal is not provided).", + "operationId": "DeleteWithOptionalOrdinalPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}": { + "get": { + "tags": [ + "PaySchedule" + ], + "summary": "Get PaySchedule", + "description": "Get the PaySchedule for the PayPeriod and TaxYear specified.", + "operationId": "GetPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc.", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + } + } + }, + "post": { + "tags": [ + "PaySchedule" + ], + "summary": "Create a PaySchedule", + "description": "Create PaySchedule using a certain pay frequency.", + "operationId": "CreatePaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to update details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that the PaySchedule is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc.", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySchedule" + ], + "summary": "Update PaySchedule", + "description": "Update PaySchedule for the PayPeriod.", + "operationId": "SavePaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to update details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that the PaySchedule is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc.", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedule" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PaySchedule" + ], + "summary": "Delete PaySchedule", + "description": "Delete the PaySchedule for the PayPeriod and TaxYear specified.", + "operationId": "DeletePaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc.", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods": { + "get": { + "tags": [ + "PaySchedule" + ], + "summary": "Get PaySchedulePeriods", + "description": "Get the PaySchedulePeriods for PaySchedule specified.", + "operationId": "GetPeriodsPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the PaySchedule periods", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to retrieve details for", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that you want to retrieve details for", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first)", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "periodNumber", + "in": "query", + "description": "Optionally specify a period number to get a result just for that period", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "includeEvents", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods/{periodNumber}": { + "put": { + "tags": [ + "PaySchedule" + ], + "summary": "Update PaySchedulePeriod", + "description": "Update the PaymentDate for a PaySchedulePeriod.", + "operationId": "UpdatePaySchedulePeriodPaySchedule", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update the PaySchedulePeriod", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "description": "The PayPeriod (ie, Monthly) that you want to update details for", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The year that the PaySchedule is for", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "path", + "description": "Specify the first, second, third (etc) PaySchedule for this PayPeriod.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "periodNumber", + "in": "path", + "description": "Specify the number of the period that you want to update the PaymentDate for", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySchedulePeriod" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/payspines": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List PaySpine", + "description": "Lists all PaySpine for an Employer.", + "operationId": "IndexPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list PaySpine", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "404": { + "description": "Employer or PaySpine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create PaySpine", + "description": "Create a new PaySpine for the Employer.", + "operationId": "CreatePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineResponse" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/payspines/{id}": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get PaySpine", + "description": "Gets the PaySpine specified.", + "operationId": "GetPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PaySpine belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PaySpine which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineResponse" + } + } + } + }, + "404": { + "description": "Employer or PaySpine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update PaySpine", + "description": "Updates a PaySpine for the Employer.", + "operationId": "UpdatePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineUpdateRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineUpdateRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineUpdateRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineUpdateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete PaySpine", + "description": "Deletes the specified PaySpine.", + "operationId": "DeletePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/import": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Import PaySpine from csv file", + "description": "Import PaySpine from a CSV file.", + "operationId": "ImportCsvPaySpinePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/spinalpoints": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List SpinalPoints", + "description": "List SpinalPoints for an Employer and Payspine.", + "operationId": "GetSpinalPointListPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Spinal Point for which you want Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create SpinalPoint", + "description": "Create SpinalPoint for an Employer and Payspine.", + "operationId": "CreateSpinalPointPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay spine for which you want to create Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete All SpinalPoints Associated with a PaySpine", + "description": "Delete all SpinalPoints associated with the specified PaySpine.", + "operationId": "DeleteAllSpinalPointsPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId}": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get SpinalPoint", + "description": "Get SpinalPoint for an Employer and Payspine.", + "operationId": "GetSpinalPointPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "spinalPointId", + "in": "path", + "description": "The Id of the Spinal Point for which you want Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update SpinalPoint", + "description": "Update SpinalPoint for the Employer and PaySpine.", + "operationId": "UpdateSpinalPointPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "spinalPointId", + "in": "path", + "description": "The Id of the Spinal Point for which you want to update Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete SpinalPoint", + "description": "Delete the specified SpinalPoint.", + "operationId": "DeleteSpinalPointPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "spinalPointId", + "in": "path", + "description": "The Id of the Spinal Point for which you want to update Spinal Point List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create Multiple SpinalPoints", + "description": "Create multiple SpinalPoints for the specified PaySpine.", + "operationId": "CreateMultiplePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create multiple Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to create multiple Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointRequest" + } + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + } + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update Multiple SpinalPoints", + "description": "Update an array of SpinalPoints for the specified PaySpine.", + "operationId": "UpdateMultiplePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update multiple Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update multiple Spinal Point", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointUpdateRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpinalPointResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/spinalpoints/import": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Import SpinalPoints from csv file", + "description": "Import SpinalPoints from a CSV file.", + "operationId": "ImportCsvPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create SpineAllowance", + "description": "Create Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "CreateSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay spine for which you want to create Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List SpineAllowances", + "description": "List Spine Allowances for a Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetSpineAllowanceListPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of Spine Allowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want list of Spine Allowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete All SpineAllowances Associated with a PaySpine", + "description": "Delete all Allowances associated with the specified Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "DeleteAllSpineAllowancesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete SpineAllowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete SpineAllowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid}": { + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update SpineAllowance", + "description": "Update Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "UpdateSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceid", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to update Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get SpineAllowance", + "description": "Get Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to get Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceid", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to get Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete SpineAllowance", + "description": "Delete Allowance for a Pay Spine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "DeleteSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceid", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to delete Spine Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/create/bulk": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create Multiple SpineAllowances", + "description": "Creates multiple Spine Allowance for the specified PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "CreateMultipleSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create multiple SpineAllowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to create multiple SpineAllowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceRequest" + } + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/update/bulk": { + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update Multiple SpineAllowances", + "description": "Updates an array of Spine Allowance for the specified PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "UpdateMultipleSpineAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update multiple SpineAllowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update multiple SpineAllowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceUpdateRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.SpineAllowanceResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/londonallowances": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List LondonAllowances", + "description": "List LondonAllowances for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetLondonAllowanceListPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of London Allowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want list of London Allowances", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LondonAllowance" + } + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create LondonAllowance", + "description": "Create LondonAllowance for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "CreateLondonAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay spine for which you want to create London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId}": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get LondonAllowance", + "description": "Get LondonAllowance for an Employer and Payspine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetLondonAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to get London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "londonAllowanceId", + "in": "path", + "description": "The Id of the London Allowance for which you want to get London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceResponse" + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update LondonAllowance", + "description": "Update LondonAllowance for the Employer and PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "UpdateLondonAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "londonAllowanceId", + "in": "path", + "description": "The Id of the London Allowance for which you want to update London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.LondonAllowanceResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete LondonAllowance", + "description": "Delete the specified London Allowance. [This endpoint is in beta for future development work and should not be used]", + "operationId": "DeleteLondonAllowancePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "londonAllowanceId", + "in": "path", + "description": "The Id of the Spinal Point for which you want to delete London Allowance", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/paygrades": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List PaySpine Grade", + "description": "Lists PaySpine Grade for an Employer and PaySpine Grade.", + "operationId": "GetPaySpineGradeListPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want PaySpine Grade List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the PaySpine Grade for which you want PaySpine Grade List", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaySpineGradeResponse" + } + } + } + } + }, + "404": { + "description": "Employer or PaySpine Grade Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create PaySpine Grade", + "description": "create PaySpine Grade for an Employer and Payspine.", + "operationId": "CreatePaySpineGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay spine for which you want to create PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId}": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get PaySpine Grade", + "description": "PaySpine Grade for an Employer and Payspine.", + "operationId": "GetPaySpineGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payGradeId", + "in": "path", + "description": "The Id of the PaySpine Grade for which you want PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeResponse" + } + } + } + }, + "404": { + "description": "Employer or PaySpine Grade Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update PaySpine Grade", + "description": "Updates a PaySpine Grade for the Employer and PaySpine.", + "operationId": "UpdatePayGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payGradeId", + "in": "path", + "description": "The Id of the PaySpine Grade for which you want to update PaySpine Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PaySpineGradeResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete PaySpine Grade", + "description": "Deletes the specified PaySpine Grade.", + "operationId": "DeletePaySpineGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payGradeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId}": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get AllowanceGrade", + "description": "Get AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetAllowanceGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceGradeId", + "in": "path", + "description": "The Id of the Allowance Grade for which you want Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + }, + "404": { + "description": "Employer or PaySpine Grade Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update AllowanceGrade", + "description": "Update AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "UpdateAllowanceGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to update Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceGradeId", + "in": "path", + "description": "The Id of the Allowance Grade for which you want to update Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete AllowanceGrade", + "description": "Delete AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "DeleteAllowanceGradePaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to delete Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceGradeId", + "in": "path", + "description": "The Id of the Allowance Grade for which you want to delete Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create AllowanceGrade", + "description": "Create AllowanceGrade for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "CreateAllowanceGradesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay spine for which you want to create Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to create Allowance Grade", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "PaySpine" + ], + "summary": "List AllowanceGrades", + "description": "List AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "GetAllowanceGradesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want list of Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want list of Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want list of Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + } + }, + "404": { + "description": "Employer or Pay Spine Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "PaySpine" + ], + "summary": "Delete All AllowanceGrades Associated with a PaySpine", + "description": "Delete all AllowanceGrades associated with a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "DeleteAllAllowanceGradesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to delete Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to delete Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to delete Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/create/bulk": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Create Multiple AllowanceGrades", + "description": "Create multiple AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "CreateMultipleAllowanceGradesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to create multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to create multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to create multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesRequest" + } + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/update/bulk": { + "put": { + "tags": [ + "PaySpine" + ], + "summary": "Update Multiple AllowanceGrades", + "description": "Update multiple AllowanceGrades for a PaySpine. [This endpoint is in beta for future development work and should not be used]", + "operationId": "UpdateMultipleAllowanceGradesPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to update multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "path", + "description": "The Id of the Pay Spine for which you want to update multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "allowanceId", + "in": "path", + "description": "The Id of the Spine Allowance for which you want to update multiple Allowance Grades", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesUpdateRequest" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesUpdateRequest" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesUpdateRequest" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesUpdateRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.AllowanceGradesResponse" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/paygrades/import": { + "post": { + "tags": [ + "PaySpine" + ], + "summary": "Import SpineGrades from csv file", + "description": "Import Spine Grades from a CSV file.", + "operationId": "ImportPayspineGradeCsvPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payspines/{id}/annualsalarybypayspines": { + "get": { + "tags": [ + "PaySpine" + ], + "summary": "Get Annual Value from pay spines formula", + "operationId": "GetAnnualValueFromSalaryFormulaPaySpine", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Employer id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "description": "The Employee id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The selected PaySpine Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineGradeId", + "in": "query", + "description": "The selected PaySpineGrade Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "spinalPointId", + "in": "query", + "description": "The selected SpinalPoint Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "londonAllowanceType", + "in": "query", + "description": "The London Allowance Id of PayLine.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "effectiveFrom", + "in": "query", + "description": "The PayLine effective from.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "workingPatternId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaylineCalculationData" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pension/list": { + "get": { + "tags": [ + "Pension" + ], + "summary": "List Pensions", + "description": "Returns a list of Item representing any Pensions for the given employee", + "operationId": "ListPension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to list Pensions", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pension/{id}": { + "get": { + "tags": [ + "Pension" + ], + "summary": "Get Pension", + "description": "Returns a Pension for an Employee", + "operationId": "GetPension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + } + } + }, + "put": { + "tags": [ + "Pension" + ], + "summary": "Update Pension", + "description": "Updates the Pension for an Employee.", + "operationId": "UpdatePension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Pension" + ], + "summary": "Remove Pension", + "description": "Removes a Pension for an Employee.", + "operationId": "RemovePension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to remove the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pension": { + "post": { + "tags": [ + "Pension" + ], + "summary": "Create Pension", + "description": "Creates a Pension for an Employee.", + "operationId": "CreatePension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to create a Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "get": { + "tags": [ + "Pension" + ], + "summary": "Get Pension (deprecated)", + "description": "This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified.\r\nUntil it is removed, this endpoint will work only for employees with a single pension\r\n\r\nReturns the Pension, if any, for an Employee", + "operationId": "Get_DeprecatedPension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to retrieve the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + } + } + }, + "put": { + "tags": [ + "Pension" + ], + "summary": "Update Pension (deprecated)", + "description": "This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified.\r\nUntil it is removed, this endpoint will work only for employees with a single pension\r\n\r\nUpdates the Pension for an Employee.", + "operationId": "Update_DeprecatedPension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to update the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Pension" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Pension" + ], + "summary": "Remove Pension (deprecated)", + "description": "This endpoint is now deprecated. You should use the alternative end points that require an ID to be specified.\r\nUntil it is removed, this endpoint will work only for employees with a single pension\r\n\r\nRemoves the Pension for an Employee.\r\nFor AE Pensions this will remove the employee from the pension and delete any associated AeAssessments", + "operationId": "Remove_DeprecatedPension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee for which you want to remove the Pension", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pension/{pensionUniqueId}/{taxYear}/pensionytd": { + "get": { + "tags": [ + "Pension" + ], + "summary": "Get last PayRunEntry for a Pension (deprecated)", + "description": "This endpoint is now deprecated. You should use the alternative GET end point from PayRun\r\n \r\nGets a last PayRunEntry for a Pension.", + "operationId": "LastPayRunEntryWithPensionYtdValuesForEmployeePension", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Employee belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want to get pay run entry for", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pensionUniqueId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayRunEntry" + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pensionrefund": { + "post": { + "tags": [ + "PensionRefund" + ], + "summary": "Create Pension Refund", + "description": "Creates a Pension Refund for the Employee", + "operationId": "CreatePensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "get": { + "tags": [ + "PensionRefund" + ], + "summary": "List Pension Refunds", + "description": "Lists all Pension Refunds for the Employee", + "operationId": "IndexPensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pensionrefund/{id}": { + "get": { + "tags": [ + "PensionRefund" + ], + "summary": "Get Pension Refund", + "description": "Gets the Pension Refund specified by the Id for the Employee specified by the EmployeeId", + "operationId": "GetPensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension Refund you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "PensionRefund" + ], + "summary": "Update Pension Refund", + "operationId": "UpdatePensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension Refund you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + }, + "delete": { + "tags": [ + "PensionRefund" + ], + "summary": "Delete Pension Refund", + "description": "Deletes the Pension Refund specified by the Id for the Employee specified by the EmployeeId", + "operationId": "DeletePensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Pension Refund you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pensionrefund/autocalculated": { + "post": { + "tags": [ + "PensionRefund" + ], + "summary": "Issue Pension Refund (deprecated)", + "description": "Creates a pension refund for full contribution amount for the current tax year for the current pensionScheme", + "operationId": "IssueRefundForCurrentPensionSchemePensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/employees/{employeeId}/pensionrefund/{pensionId}/autocalculated": { + "post": { + "tags": [ + "PensionRefund" + ], + "summary": "Issue Pension Refund", + "description": "Creates a pension refund for full contribution amount for the current tax year for the current pension", + "operationId": "IssueRefundForPensionPensionRefund", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pensionId", + "in": "path", + "description": "The Id of the pension for which you want to issue a refund.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionRefund" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/pensionschemes": { + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "List PensionSchemes", + "operationId": "IndexPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list PensionSchemes", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "PensionScheme" + ], + "summary": "Create a PensionScheme", + "operationId": "CreatePensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}": { + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "Get a PensionScheme", + "operationId": "GetPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + } + } + } + } + }, + "put": { + "tags": [ + "PensionScheme" + ], + "summary": "Update a PensionScheme", + "operationId": "UpdatePensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionScheme" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "PensionScheme" + ], + "summary": "Delete a PensionScheme", + "operationId": "DeletePensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}/employees": { + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "Get Employees", + "description": "Returns the employees that are enrolled in the specified scheme", + "operationId": "EmployeesPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme you want to retrieve Employees for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}": { + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "List Contributions", + "description": "Returns a list of Items that tell you which PayRuns contain contributions to this scheme and the Url to the relevant report.\r\nIF the scheme is connected to an ExternalDataProvider then the status of the submission will also be included.", + "operationId": "ListContributionsPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear to query", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber}": { + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "Contributions for Payrun", + "description": "Returns contributions for a specific scheme and payrun", + "operationId": "ContributionsForPayrunPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear to query", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "404": { + "description": "Not Found" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionContributionsSubmission" + } + } + } + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}": { + "post": { + "tags": [ + "PensionScheme" + ], + "summary": "Re-submit Contributions", + "description": "Re-submits previously failed Contributions to a Pension Scheme.", + "operationId": "ResubmitContributionsPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear of the submission", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "submissionId", + "in": "path", + "description": "The Id of the Submission to re-submit.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + }, + "get": { + "tags": [ + "PensionScheme" + ], + "summary": "Contributions Data", + "description": "Returns an ExternalProviderConversation showing data sent to and received from the ExternalDataProvider for the pension contribution submission.", + "operationId": "ContributionsPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear of the submission", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "submissionId", + "in": "path", + "description": "The Id of the Submission.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalProviderConversation" + } + } + } + } + } + } + }, + "/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}/markassent": { + "post": { + "tags": [ + "PensionScheme" + ], + "summary": "Mark as Sent", + "description": "Marks the Pension Contributions as sent", + "operationId": "MarkAsSentPensionScheme", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the PensionScheme belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PensionScheme.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear of the submission", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "submissionId", + "in": "path", + "description": "The Id of the Submission.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalProviderConversation" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes": { + "post": { + "tags": [ + "ProcessingNote" + ], + "summary": "Create ProcessingNote", + "description": "Creates a Processing Note for the PayRun.\r\nYou must have Bureau Features enabled and the payrun must be editable.", + "operationId": "CreateProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + } + } + }, + "responses": { + "201": { + "description": "Success - the ProcessingNote has has been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "get": { + "tags": [ + "ProcessingNote" + ], + "summary": "List ProcessingNotes for a PayRun", + "operationId": "ListProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "payrunEntryId", + "in": "query", + "description": "Optionally filter ProcessingNotes to just those for the specified PayRunEntry", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}": { + "get": { + "tags": [ + "ProcessingNote" + ], + "summary": "Get a ProcessingNote", + "operationId": "GetProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + } + } + } + } + } + }, + "/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}/status": { + "put": { + "tags": [ + "ProcessingNote" + ], + "summary": "Set a ProcessingNote status", + "description": "Set a ProcessingNote status.\r\nYou must have Bureau Features enabled and the payrun must be editable.", + "operationId": "SetStatusProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNoteStatus" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNoteStatus" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNoteStatus" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNoteStatus" + } + } + } + }, + "responses": { + "200": { + "description": "Success - the ProcessingNote status has been updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessingNote" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/payrun/{id}/documents": { + "post": { + "tags": [ + "ProcessingNote" + ], + "summary": "Add Document", + "description": "Adds document to the ProcessingNote", + "operationId": "AddDocumentProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the ProcessingNote you want to attach documents to", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/payrun/{id}/documents/{documentId}": { + "delete": { + "tags": [ + "ProcessingNote" + ], + "summary": "Delete ProcessingNote Document", + "description": "Deletes the document specified by the documentId for the ProcessingNote specified by the Id", + "operationId": "DeleteDocumentProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to delete.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + }, + "get": { + "tags": [ + "ProcessingNote" + ], + "summary": "Get ProcessingNote Document", + "description": "Gets the document specified by the documentId for the ProcessingNote specified by the Id", + "operationId": "GetDocumentProcessingNote", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "documentId", + "in": "path", + "description": "The Id of the Document you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/reports/packs": { + "get": { + "tags": [ + "ReportPack" + ], + "summary": "List ReportPacks", + "description": "Lists all ReportPacks for an Employer.", + "operationId": "IndexReportPack", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list ReportPacks", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ReportPack" + ], + "summary": "Create ReportPack", + "description": "Creates a new ReportPack for the Employer.", + "operationId": "CreateReportPack", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/reports/packs/{id}": { + "get": { + "tags": [ + "ReportPack" + ], + "summary": "Get ReportPack", + "description": "Gets the ReportPack specified.", + "operationId": "GetReportPack", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the ReportPack belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + } + } + }, + "put": { + "tags": [ + "ReportPack" + ], + "summary": "Update ReportPack", + "description": "Updates a ReportPack for the Employer.", + "operationId": "UpdateReportPack", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPack" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "delete": { + "tags": [ + "ReportPack" + ], + "summary": "Delete ReportPack", + "description": "Deletes the specified ReportPack.", + "operationId": "DeleteReportPack", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/apprenticeshiplevy": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Apprenticeship Levy Details", + "operationId": "ApprenticeshipLevyDetailsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear that the Apprenticeship Levy is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p60/{employeeId}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P60 For Employee", + "description": "Gets a P60 in PDF format for the TaxYear and Employee specified. A URL is returned which points to the PDF file.", + "operationId": "P60Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the P60 is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p60": { + "get": { + "tags": [ + "Reports" + ], + "summary": "All P60s For TaxYear", + "description": "Returns all P60s in a single PDF file for the TaxYear and Employer specified\r\nIf you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field.\r\nAs there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field.", + "operationId": "P60MultipleReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear you want P60s for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "excludeEmployeesWithP60EmailSent", + "in": "query", + "description": "Exclude Employees with Already Sent P60 Emails.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/p60/email/{employeeId}": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Email P60 to an Employee", + "description": "Email a P60 to an Employee", + "operationId": "EmailP60Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want the email a P60 to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "description": "The TaxYear you want P60s for.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/reports/p60/email": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Email P60 to all Employees", + "description": "Email P60 to all Employee", + "operationId": "EmailP60MultipleReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "description": "The TaxYear you want P60s for.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "excludeEmployeesWithP60EmailSent", + "in": "query", + "description": "Exclude Employees with Already Sent P60 Emails.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p11d/{employeeId}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P11D For Employee", + "description": "Gets a P11D in PDF format for the TaxYear and Employee specified. A URL is returned which points to the PDF file.", + "operationId": "P11DReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear the P60 is for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p11d": { + "get": { + "tags": [ + "Reports" + ], + "summary": "All P11Ds For TaxYear", + "description": "Returns all P11Ds in a single PDF file for the TaxYear and Employer specified\r\nIf you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field.\r\nAs there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field.", + "operationId": "P11DMultipleReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The TaxYear you want P11Ds for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "excludeEmployeesWithP11dEmailSent", + "in": "query", + "description": "Exclude Employees with Already Sent P11Ds Emails.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/p11d/email/{employeeId}": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Email P11D to an Employee", + "description": "Email a P11D to an Employee", + "operationId": "EmailP11DReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The Id of the Employee you want the email a P11D to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "description": "The TaxYear you want P11Ds for.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/reports/p11d/email": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Email P11D to all Employees", + "description": "Email P11D to all Employee", + "operationId": "EmailP11DMultipleReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "description": "The TaxYear you want P11Ds for.", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "excludeEmployeesWithP11DEmailSent", + "in": "query", + "description": "Exclude Employees with Already Sent P11D Emails.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/papdis": { + "get": { + "tags": [ + "Reports" + ], + "summary": "PAPDIS File", + "description": "Returns a PAPDIS compliant file for the PayRun and Pension Provider PAPDIS Id specified", + "operationId": "PapdisFileReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "schemeId", + "in": "query", + "description": "The Id of the Pension Scheme you want a file for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "csvFormat", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PensionCsvFormat" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/PapdisDocumentReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PapdisDocumentReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PapdisDocumentReportResponse" + } + }, + "text/xml": { + "schema": { + "$ref": "#/components/schemas/PapdisDocumentReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PapdisDocumentReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/cis300/{id}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "CIS300", + "description": "Returns a CIS300 as a CSV or human-readable report", + "operationId": "Cis300Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of CIS300.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cis300ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/Cis300ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/Cis300ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/Cis300ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/fps/{id}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "FPS", + "description": "Returns an FPS as a CSV file", + "operationId": "FpsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of FPS.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "incAllEmployees", + "in": "query", + "description": "If true, then any employees that were paid earlier in the year but not on this FPS will also be included", + "schema": { + "type": "boolean" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FpsReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/FpsReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/exb/{id}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "EXB", + "description": "Returns an EXB as a CSV file", + "operationId": "ExbReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of EXB.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExbReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ExbReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/AeAssessments": { + "get": { + "tags": [ + "Reports" + ], + "summary": "AutoEnrolment Assessments", + "description": "Returns a list of Items representing your current Employees along with their most recent Auto Enrolment Assessment in the metadata field.", + "operationId": "AeAssessmentsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemListReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ItemListReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/p45": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P45 For Employee", + "description": "Get a P45 for an Employee you've marked as a leaver", + "operationId": "P45Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "description": "The Id of the Employee you want a P45 for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/p45/email": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Email P45 to Employee", + "description": "Email a P45 to an Employee you've marked as a leaver", + "operationId": "EmailP45Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "description": "The Id of the Employee you want the email a P45 to.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{employeeId}/p11detailed": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P11 (Detailed)", + "description": "Returns a detailed P11 Report for the given employee.", + "operationId": "P11DetailedReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The employee Id of the employee you want to report on", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The tax year you want to report on.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/P11DetailedReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/P11DetailedReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/P11DetailedReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p11detailed": { + "get": { + "tags": [ + "Reports" + ], + "summary": "All Detailed P11s For TaxYear", + "description": "Returns all detailed P11s in a single PDF file for the TaxYear and Employer specified\r\nIf you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field.\r\nAs there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field.", + "operationId": "P11DetailedMultipleReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the employer you want to report on", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The tax year you want to report on.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{employeeId}/p11": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P11", + "description": "Returns a P11 Report, detailing all payments and deductions for the given employee", + "operationId": "P11Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "description": "The employee Id of the employee you want to report on", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "description": "The tax year you want to report on.", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/P11ReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/P11ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/P11ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/P11ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p30/{periodEnding}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P30", + "description": "Returns a P30 Report summarising the employers HMRC liabilities for the period.\r\nFor available periods retrieve a list of HmrcLiability and examine the metadata.\r\nIf the accept header is set to \"text/csv\" then the periodEnding parameter is ignored and you'll receive a CSV for the entire TaxYear.", + "operationId": "P30Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodEnding", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/p32": { + "get": { + "tags": [ + "Reports" + ], + "summary": "P32", + "description": "Returns a P32 Report detailing the employers HMRC liabilities for the year.", + "operationId": "P32Reports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/P32ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/P32ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/P32ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/P32ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee": { + "get": { + "tags": [ + "Reports" + ], + "summary": "PayRun Payments", + "description": "Returns a list of all employee payments that need to be made as a result of a Payrun.\r\nIf you specifically want just bank payments (employees where PayMethod is Credit) then you\r\nmay find the Bank Payment Instructions API call more useful", + "operationId": "PayRunPaymentsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "bankHoliday", + "in": "query", + "description": "Specifies the region whose bank holidays are to be considered in the operation.", + "schema": { + "$ref": "#/components/schemas/BankHolidayCollection" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "includeNonEmployeePayments", + "in": "query", + "description": "If set to true then we'll also include payments that need to be made to HMRC and PensionProviders", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayrunPaymentsReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayrunPaymentsReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PayrunPaymentsReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/PayrunPaymentsReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrun-csv": { + "get": { + "tags": [ + "Reports" + ], + "summary": "PayRun CSV (deprecated)", + "description": "Download the lines of a PayRun to a CSV file.\r\nPlease use Get PayRun CSV that now accepts a parameter for CSV type", + "operationId": "PayRunCsvReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "summary", + "in": "query", + "description": "If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payruncsv": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Get PayRun CSV", + "description": "Download the lines of a PayRun to a CSV file.", + "operationId": "GetPayRunCsvReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "csvType", + "in": "query", + "description": "Choose the type of CSV you want to generate", + "schema": { + "$ref": "#/components/schemas/PayRunCsvType" + } + }, + { + "name": "mappingId", + "in": "query", + "description": "If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string", + "default": "application/json" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/aeo/{employeeId}/{id}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "AEO Statement", + "description": "Returns a statement for an Attachment Order, listing payments that have been made.", + "operationId": "AeoStatementReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The id of the AttachmentOrder", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrderReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrderReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrderReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrderReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/gross-to-net": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Gross To Net", + "description": "Returns a report comparing employees' gross pay with their net pay for one or more pay periods.", + "operationId": "GrossToNetReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Defines the way to sort the data. Defaults to sorting by PayrollCode.", + "schema": { + "$ref": "#/components/schemas/ReportSortBy" + } + }, + { + "name": "sortDescending", + "in": "query", + "description": "Defines whether to sort the data in descending order. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "forCis", + "in": "query", + "description": "If true then CIS Subcontractors are reported on.\r\n If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GrossToNetReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/GrossToNetReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/GrossToNetReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/GrossToNetReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/ytd": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Year To Date Values", + "description": "Returns a CSV file containing YTD values for all Employees on the payrun.", + "operationId": "PayrunYtdReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/YtdReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/YtdReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/YtdReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/YtdReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/niytd": { + "get": { + "tags": [ + "Reports" + ], + "summary": "NI Year To Date Values", + "description": "Returns a CSV file containing NI YTD values for all Employees on the payrun.", + "operationId": "PayrunNiYtdReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NiYtdReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/NiYtdReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/NiYtdReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/NiYtdReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/teachersPensionEoy": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Teachers Pension Eoy Report", + "description": "Returns a report response containing the Teachers Pension EOYC Report", + "operationId": "TeachersPensionEoyReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "localAuthorityNumber", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "schoolEmployerType", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeachersPensionEoyReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/TeachersPensionEoyReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/TeachersPensionEoyReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/TeachersPensionEoyReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/costanalysis": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Cost Analysis", + "description": "Returns a report analysing the costs of a payrun or range of payruns.", + "operationId": "CostAnalysisReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostAnalysisReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/CostAnalysisReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/CostAnalysisReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/costofemployment": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Cost Of Employment", + "description": "Returns a report detailing the employment cost per employee for a payrun or range of payruns.", + "operationId": "CostOfEmploymentReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostOfEmploymentReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/CostOfEmploymentReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/CostOfEmploymentReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/fullsummaryofpay": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Cost Of Employment", + "description": "Returns a report detailing the employment cost per employee for a payrun or range of payruns.", + "operationId": "FullSummaryOfPayReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "period", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FullSummaryOfPayReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/FullSummaryOfPayReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/FullSummaryOfPayReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/statutory-pay": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Statutory Pay", + "description": "Returns a report detailing statutory pay for one or more pay periods.", + "operationId": "StatutoryPayReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "statutoryPayTypes", + "in": "query", + "description": "Comma separated values from (SAP, SHPP, SMP, SPBP, SPP)", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatutoryPayReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/StatutoryPayReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/StatutoryPayReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/StatutoryPayReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/variance": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Variance Report", + "description": "Returns a report comparing two pay periods or two ranges of pay periods.", + "operationId": "VarianceReportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "payPeriodCompare", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinalCompare", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYearCompare", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriodCompare", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriodCompare", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "showPercentage", + "in": "query", + "description": "If true then any variations will be shown as a percentage.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minChange", + "in": "query", + "description": "Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VarianceReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/VarianceReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/VarianceReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/VarianceReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/umbrella-reconciliation": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Umbrella Reconciliation", + "description": "Returns an Umbrella Reconciliation report.", + "operationId": "UmbrellaReconciliationReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "employeeId", + "in": "query", + "description": "Specify an employee id to report on just that employee, otherwise all employees will be included.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UmbrellaReconciliationReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/UmbrellaReconciliationReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/UmbrellaReconciliationReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/UmbrellaReconciliationReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/furlough": { + "get": { + "tags": [ + "Reports" + ], + "summary": "FurloughReport", + "description": "Returns a Furlough Report.", + "operationId": "FurloughReportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FurloughReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/FurloughReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/FurloughReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/FurloughReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/hourly-pay": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Hourly Pay", + "description": "Returns a report summarising the hourly pay for employees for one or more pay periods.", + "operationId": "HourlyPayReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HourlyPayReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/HourlyPayReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/HourlyPayReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/HourlyPayReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/holiday": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Holiday", + "description": "Returns a report summarising holiday usage for all employees.", + "operationId": "HolidayReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "accruals", + "in": "query", + "description": "If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "accrualsHrs", + "in": "query", + "description": "If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HolidayReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/HolidayReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/HolidayReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/HolidayReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/right-to-work": { + "get": { + "tags": [ + "Reports" + ], + "summary": "RightToWork", + "description": "Returns a report summarising RightToWork information for all employees.", + "operationId": "RightToWorkReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RightToWorkReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/RightToWorkReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/RightToWorkReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/RightToWorkReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee/credit": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Bank Payment Instructions", + "description": "Returns a list of bank payments that need to be made to employees as a result of a Payrun.\r\nYou can optionally provide a PaymentDate and only payments for that date will be returned.", + "operationId": "BankPaymentInstructionsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "paymentDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "bankHoliday", + "in": "query", + "description": "Specifies the region whose bank holidays are to be considered in the operation.", + "schema": { + "$ref": "#/components/schemas/BankHolidayCollection" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "incPensions", + "in": "query", + "description": "Set to true and we'll include any payment due to Pension Providers", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "incHmrc", + "in": "query", + "description": "Set to true and we'll include any payment due to HMRC", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "incAeos", + "in": "query", + "description": "Set to true and we'll include any payment due as a result of AttachmentOrders", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "incDeductions", + "in": "query", + "description": "Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstructionReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstructionReportResponse" + } + }, + "application/zip": { + "schema": { + "$ref": "#/components/schemas/BankPaymentInstructionReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/cisstatement/{taxMonth}": { + "get": { + "tags": [ + "Reports" + ], + "summary": "CIS Statement", + "description": "Returns a CIS Statement for the employee specified.", + "operationId": "CisStatementReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "taxMonth", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "employeeId", + "in": "query", + "description": "Specify an employeeId to get a single statement.\r\n If you don't provide a value then all Subcontractors will be included.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/CisStatementListReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisStatementListReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/cissummary": { + "get": { + "tags": [ + "Reports" + ], + "summary": "CIS Subcontractor Summary", + "description": "Returns a list of all CIS Subcontractors along with verification details", + "operationId": "CisSubContractorSummaryReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/CisSubContractorSummaryListReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/CisSubContractorSummaryListReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/CisSubContractorSummaryListReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CisSubContractorSummaryListReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/payrunsummary": { + "get": { + "tags": [ + "Reports" + ], + "summary": "PayRunSummary", + "description": "Returns an array of PayRunSummaryLine for one or multiple periods. Similar to a PayRunJournal except that it can cover multiple periods.", + "operationId": "PayRunSummaryReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptCode", + "in": "query", + "description": "If specified then only employees assigned to this department code at the time of the payrun will be included", + "schema": { + "type": "string" + } + }, + { + "name": "includeQty", + "in": "query", + "description": "If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayRunSummaryLineIEnumerableReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayRunSummaryLineIEnumerableReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysis": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Analysis", + "description": "Returns an AnalysisReport for one or multiple periods.", + "operationId": "AnalysisReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptCode", + "in": "query", + "description": "If specified then only employees assigned to this department code at the time of the payrun will be included", + "schema": { + "type": "string" + } + }, + { + "name": "showPayPeriodBreakdown", + "in": "query", + "description": "If set to true, then the report will show a breakdown of each period for each employee", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnalysisReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/AnalysisReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysiscostbreakdown": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Analysis Cost Breakdown", + "description": "Returns an AnalysisCostBreakdownReport for one or multiple periods.", + "operationId": "PayrollAnalysisCostBreakdownReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptCode", + "in": "query", + "description": "If specified then only employees assigned to this department code at the time of the payrun will be included", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayrollAnalysisCostBreakdownReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayrollAnalysisCostBreakdownReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysisemployeerolebreakdown": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Payroll Analysis with Employee Role Breakdown", + "description": "Return a Payroll Analysis Report with Employee Role Breakdown for a specified pay period.\r\nIf a department code is specified, only employees assigned to this department at the time of the payrun will be included.", + "operationId": "PayrollAnalysisEmployeeRoleBreakdownReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptCode", + "in": "query", + "description": "Optional. Filters employees by department code.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/{id}/payslip": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Payslip", + "description": "Returns a single Payslip for the given PayRunEntry of a PayRun. The type of response depends on the accept header.", + "operationId": "PayslipReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the PayRunEntry.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/PayslipReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayslipReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PayslipReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/PayslipReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payslips": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Payslips", + "description": "Returns all Payslips for the given PayRun\r\nIf you set the accept header to \"text/html\" then unlike other reports the html is NOT in the ```Content``` field.\r\nAs there are multiple HTML documents they are encoded as a JSON array of strings in the ```Model``` field.", + "operationId": "PayslipsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "unemailed", + "in": "query", + "description": "Set this to True if you only want the Payslips that haven't been sent by email", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "deptCode", + "in": "query", + "description": "Set if you want to filter by department", + "schema": { + "type": "string" + } + }, + { + "name": "startersLeaversFilter", + "in": "query", + "schema": { + "$ref": "#/components/schemas/StartersLeaversFilter" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortBy", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayRunEntrySortBy" + } + }, + { + "name": "sortDescending", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/payslip/example/pdf": { + "post": { + "tags": [ + "Reports" + ], + "summary": "Example Payslip", + "description": "Use this operation to test your PayslipCustomisation.\r\nWe'll use dummy date and create a Payslip PDF or HTML document based on the customisation that you submit", + "operationId": "ExamplePayslipReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Your PayslipCustomisation.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PayslipCustomisation" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employees": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Employee Export Details", + "description": "Returns a CSV file containing details for all Employees.", + "operationId": "EmployeeExportReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "includeBankAccountDetails", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "includeYtd", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "incPensionInfo", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "includePayInfo", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "includeNotes", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/ytd": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Year To Date Values", + "description": "Returns a CSV file containing YTD values for all Employees.", + "operationId": "YtdReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/niytd": { + "get": { + "tags": [ + "Reports" + ], + "summary": "NI Year To Date Values", + "description": "Returns a CSV file containing NI YTD values for all Employees.", + "operationId": "NiYtdReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/taxcode": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Taxcode Change", + "description": "Returns a CSV file containing Tax Code Changes values for all Employees.", + "operationId": "TaxCodeChangesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxCodeChangeReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/TaxCodeChangeReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/TaxCodeChangeReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/TaxCodeChangeReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/employers": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Employer Export", + "description": "Returns a CSV file containing details for all Employers.", + "operationId": "EmployerExportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of any employer to which you have access. It wont affect the report results.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/NiLetterValidationReport": { + "get": { + "tags": [ + "Reports" + ], + "summary": "NI Letter Validation (Payrun)", + "description": "Checks the NI Letters allocated to employees on a specific payrun", + "operationId": "NiLetterValidationReportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/NiLetterValidationReport": { + "get": { + "tags": [ + "Reports" + ], + "summary": "NI Letter Validation (Employees)", + "description": "Checks the NI Letters allocated to your employees. If no pay date is provided, the checks are based on today's date.", + "operationId": "NiLetterValidationReportEmployeesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "payDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "payPeriod", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/NiLetterValidationReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/EmployeeBenefits": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Employee Benefits", + "description": "Returns a output containing details for employee benefits.", + "operationId": "EmployeeBenefitsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "reportType", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeBenefitsReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/EmployeeBenefitsReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/EmployeeBenefitsReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/attachmentorders": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Attachment Orders", + "description": "Returns a report detailing attachment of earning order deductions for one or multiple periods.", + "operationId": "AttachmentOrdersReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrdersReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrdersReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/AttachmentOrdersReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/changes": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Gets audit changes of all employees within a company.", + "operationId": "ChangesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of any employer to which you have access.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fromDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "toDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeSummaryListReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ChangeSummaryListReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/employerchanges": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Gets audit changes for a company.", + "operationId": "EmployerChangesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of any employer to which you have access.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fromDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "toDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeSummaryListReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ChangeSummaryListReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/paycodes": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Pay Code Export Details", + "description": "Returns details for all Pay Codes.", + "operationId": "PayCodeExportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/payGrades": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Pay Grade", + "description": "Returns a report for Pay Grade.", + "operationId": "PayGradesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "effectiveDateFrom", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "effectiveDateTo", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "paySpineId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayGradesReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayGradesReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PayGradesReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/spinepoints": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Spine Point", + "description": "Returns a report for Spine Point.", + "operationId": "SpinePointReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "effectiveDateFrom", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "effectiveDateTo", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpinePointReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/SpinePointReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/SpinePointReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/payspines": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Pay Spine", + "description": "Returns a report for Pay Spine.", + "operationId": "PaySpineReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "paySpineId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaySpineReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PaySpineReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PaySpineReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/averageholidaypayrate": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Average Holiday Pay Rate", + "description": "Returns a report for average holiday pay rate.", + "operationId": "AverageHolidayPayRateReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "period", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AverageHolidayPayRateReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/AverageHolidayPayRateReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/AverageHolidayPayRateReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/AverageHolidayPayRateReportReportResponse" + } + } + } + } + } + } + }, + "/employeeroles": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Employee Export Roles Details", + "description": "Returns a CSV file containing details for all Employee Roles.", + "operationId": "EmployeeRoleExportReports", + "parameters": [ + { + "name": "employerId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/downloadmaternityschedules": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Download Maternity Payment Schedule", + "description": "Returns a Maternity Pay schedule for employee", + "operationId": "DownloadMaternitySchedulesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Leave" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/GenderPayGap": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Gender Pay Gap", + "description": "Returns a report containing details for gender pay gap analysis.", + "operationId": "GenderPayGapReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "genderPayGapSnapShotDate", + "in": "query", + "schema": { + "$ref": "#/components/schemas/GenderPayGapSnapShotDate" + } + }, + { + "name": "ordinaryPayCodeSetId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "bonusPayCodeSetId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenderPayGapReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/GenderPayGapReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/GenderPayGapReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/pensionmemberships": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Export Multiple Pension Memberships Report", + "description": "Returns a report for Multiple Pension Memberships", + "operationId": "PensionMembershipsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PensionMembershipsReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PensionMembershipsReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PensionMembershipsReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/PensionMembershipsReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/pay-element": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Pay Element", + "description": "Returns a report detailing pay elements for one or more pay periods.", + "operationId": "PayElementReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "fromPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "toPeriod", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "payCodes", + "in": "query", + "description": "Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY)", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayElementReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/PayElementReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/PayElementReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/PayElementReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{payPeriod}/loanbalances": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Loan Balances", + "description": "Returns the Loan Balances report for the given pay schedule", + "operationId": "LoanBalancesReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoanBalancesReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/LoanBalancesReportReportResponse" + } + }, + "text/html": { + "schema": { + "$ref": "#/components/schemas/LoanBalancesReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/LoanBalancesReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/PayrollRunWarnings": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Export Payroll Run Warnings", + "description": "Returns a report for payroll warnings", + "operationId": "WarningsReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WarningsReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/WarningsReportReportResponse" + } + }, + "application/pdf": { + "schema": { + "$ref": "#/components/schemas/WarningsReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrolljournalcsv": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Payroll Journal CSV", + "description": "Download the lines of Payroll Journal to CSV file.", + "operationId": "PayrollJournalCsvReportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "periodNumber", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "deptBreakdown", + "in": "query", + "description": "Set to true and the journal will be split between any relevant Departments", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/employeeleave": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Employee Leave", + "description": "Returns the Employee Leave report for the selected tax year. If the tax year is not selected, returns the Employee Leave report for all the leave entries.", + "operationId": "EmployeeLeaveReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployeeLeaveReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/EmployeeLeaveReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports/advancedvariance": { + "get": { + "tags": [ + "Reports" + ], + "summary": "Advanced Variance Report", + "description": "Returns a report comparing one period to another period.", + "operationId": "AdvancedVarianceReportReports", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payPeriod", + "in": "query", + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "ordinal", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYear", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "period", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "taxYearCompare", + "in": "query", + "schema": { + "$ref": "#/components/schemas/TaxYear" + } + }, + { + "name": "periodCompare", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "payCodes", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdvancedVarianceReportReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/AdvancedVarianceReportReportResponse" + } + } + } + } + } + } + }, + "/employers/{employerId}/reports-async/gross-to-net": { + "post": { + "tags": [ + "ReportsAsync" + ], + "summary": "Gross To Net async (beta)", + "description": "Returns a job that is created to process a report comparing employees' gross pay with their net pay for one or more pay periods.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.\r\nUse the GET of Jobs to get the status and response of the job.", + "operationId": "QueueGrossToNetReportReportsAsync", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The request payload for the gross to net report", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.GrossToNetReportRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.GrossToNetReportRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.GrossToNetReportRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.GrossToNetReportRequest" + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.JobResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/employers/{employerId}/reporttemplates": { + "get": { + "tags": [ + "ReportTemplate" + ], + "summary": "List Report Templates (beta)", + "description": "Lists all Report Templates for an Employer.", + "operationId": "IndexReportTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Report Template belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "ReportTemplate" + ], + "summary": "Create Report Template (beta)", + "description": "Creates a new Report Template for the Employer.", + "operationId": "CreateReportTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Report Template belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + } + } + } + } + } + }, + "/employers/{employerId}/reporttemplates/{id}": { + "get": { + "tags": [ + "ReportTemplate" + ], + "summary": "Get Report Template (beta)", + "description": "Gets the Report Template specified.", + "operationId": "GetReportTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Report Template belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Report Template which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + } + } + }, + "404": { + "description": "Employer or Report Template Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "ReportTemplate" + ], + "summary": "Update Report Template (beta)", + "description": "Updates a Report Template for the Employer.", + "operationId": "UpdateReportTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Report Template belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Report Template which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ReportTemplate" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OccupationalPolicy" + } + } + } + }, + "404": { + "description": "Employer or Report Template Not Found" + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "ReportTemplate" + ], + "summary": "Delete Report Template (beta)", + "description": "Deletes the specified Report Template.", + "operationId": "DeleteReportTemplate", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Report Template belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Report Template which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Employer or Report Template Not Found" + } + } + } + }, + "/employers/{employerId}/tags": { + "get": { + "tags": [ + "Tag" + ], + "summary": "List Tags", + "description": "Lists all Tags for an Employer.", + "operationId": "IndexTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Tags", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Tag" + ], + "summary": "Create Tag", + "description": "Creates a new Tag for the Employer.", + "operationId": "CreateTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new values for the Tag you want to update.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/tags/{code}": { + "get": { + "tags": [ + "Tag" + ], + "summary": "Get Tag (deprecated)", + "description": "Gets the Tag specified.", + "operationId": "GetTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the Tag you want to retrieve.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + } + } + }, + "put": { + "tags": [ + "Tag" + ], + "summary": "Update Tag (deprecated)", + "description": "Updates a Tag for the Employer.", + "operationId": "UpdateTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The existing code of the Tag you want to update.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The new values for the Tag you want to update.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "delete": { + "tags": [ + "Tag" + ], + "summary": "Delete Tag (deprecated)", + "description": "Deletes the specified Tag.", + "operationId": "DeleteTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "path", + "description": "The code of the Tag you want to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/tags/Tag": { + "get": { + "tags": [ + "Tag" + ], + "summary": "Get Tag", + "description": "Gets the Tag specified.", + "operationId": "GetTagTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The code of the Tag you want to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/tags/tag": { + "put": { + "tags": [ + "Tag" + ], + "summary": "Update Tag", + "description": "Updates the details of an existing Tag.", + "operationId": "UpdateTagTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The existing code of the Tag you want to update.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The new values for the Tag you want to update.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tag" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Tag" + ], + "summary": "Delete Tag", + "description": "Deletes the specified Tag.", + "operationId": "DeleteTagTag", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Tag belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "code", + "in": "query", + "description": "The code of the Tag you want to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/tenants": { + "post": { + "tags": [ + "Tenant" + ], + "summary": "Create a Tenant", + "description": "Use this method to create a new Tenant\r\nOnly available to SuperAdmins", + "operationId": "CreateTenant", + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + }, + "responses": { + "201": { + "description": "Success - \r\nthe Tenant has been created and is returned in the body.\r\nThe unique URL for this Tenant is returned in the Location header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/tenants/{id}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get a Tenant", + "description": "If you are an administrator for a Tenant then you can retrieve the settings for it using this API call", + "operationId": "GetTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + } + } + }, + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update a Tenant", + "description": "If you are an administrator for a Tenant then you can update the settings for it using this API call", + "operationId": "UpdateTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/css": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update CSS", + "description": "Update the custom CSS for a Tenant", + "operationId": "UpdateCssTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "text/json": { + "schema": { + "type": "string" + } + }, + "application/*+json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/tenants/{id}/css/colors": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update CSS Colors", + "description": "Update the colors for a Tenant", + "operationId": "UpdateCssColorsTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringStringKeyValuePair" + } + } + } + } + } + } + } + }, + "/tenants/{id}/logo": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Upload Logo", + "description": "Upload an image to use as your main logo. We'll upload it and set the URL on the HomeImgUrl property of the Tenant.", + "operationId": "UpdateLogoTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + } + } + } + }, + "/tenants/{id}/favicon": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Upload Favicon", + "description": "Upload an image to use as favicon. We'll upload it and set the URL on the FavIcon property of the Tenant.", + "operationId": "UpdateFavIconTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tenant" + } + } + } + } + } + } + }, + "/tenants/{id}/users": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "List Users", + "description": "Returns a list of users for the Tenant", + "operationId": "UsersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to list Users for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortByLastLogin", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "category", + "in": "query", + "schema": { + "$ref": "#/components/schemas/UserCategory" + } + }, + { + "name": "isBureauMember", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/users/admins": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "List Admin Users", + "description": "Returns a list of admin users for the Tenant", + "operationId": "AdminUsersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to list admin Users for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "Tenant" + ], + "summary": "Remove Admin User", + "description": "Removes the specified admin user for the Tenant", + "operationId": "RemoveAdminUserTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to remove the admin User from.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "text/json": { + "schema": { + "type": "string" + } + }, + "application/*+json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + }, + "post": { + "tags": [ + "Tenant" + ], + "summary": "Add Admin User", + "description": "Adds the specified user as an admin for the Tenant", + "operationId": "AddAdminUserTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to remove the admin User from.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "text/json": { + "schema": { + "type": "string" + } + }, + "application/*+json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/tenants/{id}/users/search": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Search Users", + "description": "Returns a list of users for the Tenant that match the search", + "operationId": "UsersSearchTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to search Users for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "q", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/users/{userId}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get a User", + "description": "Returns details of a User that belongs to the Tenant", + "operationId": "UserTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to get a User for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + }, + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update a User", + "description": "Set the details of a User that belongs to the Tenant", + "operationId": "UpdateUserTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to update a User for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The User details.", + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/bills": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get User Bills", + "description": "Returns all UsageBills for a User", + "operationId": "UserBillsTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to get a Users UsageBills for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/users/{userId}/employers": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get User Employers", + "description": "Returns Employer details for a User that belongs to the Tenant", + "operationId": "UserEmployersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to get User Employers for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/users/{userId}/disabled": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Disable User Account", + "description": "Disables (or re-enabled) a user account", + "operationId": "DisabledTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "disabled", + "in": "query", + "description": "Whether or not the account should be disabled.", + "schema": { + "type": "boolean" + } + }, + { + "name": "loginDisabled", + "in": "query", + "description": "Whether or not the account should have log in permissions.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "A message to show the user explaining why the account is disabled.", + "content": { + "application/json-patch+json": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "text/json": { + "schema": { + "type": "string" + } + }, + "application/*+json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/tenants/{id}/users/{userId}/employercreation": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Enable Employer Creation", + "description": "Enable (or disable) a user accounts ability to create new employers", + "operationId": "EmployerCreationTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enabled", + "in": "query", + "description": "Whether or not the account can create employers.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/tenant": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set User Tenant", + "description": "Changes the Tenant for a User. Only applicable if you manage two or more Tenants", + "operationId": "SetTenantTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant the user is currently assigned to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "newTenantId", + "in": "query", + "description": "The Id of the Tenant the user is to be assigned to.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/accounting": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set User Accounting Id", + "description": "Updates the Customer Accounting Id for a user", + "operationId": "SetAccountingIdTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "accountingId", + "in": "query", + "description": "The CustomerAccountingId for the user.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/pricingtable": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set User PricingTableId", + "description": "Updates the Customer Accounting Id for a user", + "operationId": "SetPricingTableIdTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pricingTableId", + "in": "query", + "description": "The PricingTable Id for the user. Provide null and the user will use the Tenant default", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/monthlyminimum": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Monthly Minimum", + "description": "Updates the MonthlyMinimum subscription charge for a user", + "operationId": "SetMonthlyMinimumTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/MonthlyMinimum" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MonthlyMinimum" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MonthlyMinimum" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/MonthlyMinimum" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/bureauredir": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Bureau Redirect", + "description": "Sets or removes the redirect email address for a users Bureau-related notifications", + "operationId": "SetBureauRedirectEmailAddressTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "emailAddress", + "in": "query", + "description": "The email address to redirect to, or an empty string to remove the redirect.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/bills/{year}/{month}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Bills", + "description": "Returns a list of UsageBill for Users of this Tenant, for the Year and Month supplied", + "operationId": "BillsTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant you want to list bills for.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "year", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "month", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "includeNetSuiteBills", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/bills/{year}/{month}/{billId}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Bill", + "description": "Returns details of a UsageBill for a User of this Tenant", + "operationId": "BillTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant the bill belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "year", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "month", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "billId", + "in": "path", + "description": "The Id of the UsageBill.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + } + } + } + } + }, + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update Bill", + "description": "Updates the UsageBill.", + "operationId": "UpdateBillTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant the bill belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "year", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "month", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "billId", + "in": "path", + "description": "The Id of the UsageBill.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageBill" + } + } + } + } + } + } + }, + "/tenants/{id}/usage/{year}/{month}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Usage", + "description": "Returns activity for Users of this Tenant, for the Year and Month supplied", + "operationId": "UsageTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "year", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "month", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/employers/{employerId}/usage": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Employer Usage", + "description": "Returns all activity for the given Employer", + "operationId": "EmployerUsageTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/employers/{employerId}/users": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Employer Users", + "description": "Returns all users for the given Employer", + "operationId": "EmployerUsersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/reports/users/nobillableactivity": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Users with no Billable Activity.", + "description": "Returns a .csv file containing users created in or before the given month that do not have billable activity.", + "operationId": "GetUsersWithNoBillableActivityTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "month", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "year", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/tenants/{id}/reports/weeklyactivity": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Weekly Activity Report", + "description": "Returns a report detailing User activity, summarised by week, for the given date range", + "operationId": "WeeklyActivityTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fromDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "toDate", + "in": "query", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "allTenants", + "in": "query", + "description": "If set to true then the report will include all Tenants to which you have access", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/tenants/{id}/reports/netsuitebills": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "NetSuite Billing Report", + "description": "Returns a report detailing billing, for NetSuite, for the given year and month\r\nOnly available to SuperAdmins", + "operationId": "NetSuiteBillingTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "year", + "in": "query", + "description": "The year of the billing period", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "month", + "in": "query", + "description": "The month of the billing period", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "accept", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "allTenants", + "in": "query", + "description": "If set to true then the report will include all Tenants to which you have access", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/tenants/bills": { + "post": { + "tags": [ + "Tenant" + ], + "summary": "Create Bills for Period", + "description": "Generates usage and creates bills for all Tenants\r\nOnly available to SuperAdmins", + "operationId": "CreateBillsTenant", + "parameters": [ + { + "name": "month", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "year", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "202": { + "description": "Started generating bills" + } + } + } + }, + "/tenants/ritsubmissionsettings": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get RtiSubmissionSettings", + "description": "If the Tenant has BureauFeaturesEnabled then they can store RtiSubmissionSettings for use across multiple employers.\r\nThis end point returns them RtiSubmissionSettings.", + "operationId": "GetRtiSubmissionSettingsTenant", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The Id of the Tenant.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update RtiSubmissionSettings", + "description": "If the Tenant has BureauFeaturesEnabled then they can store RtiSubmissionSettings for use across multiple employers.\r\nThis end point updates the RtiSubmissionSettings.", + "operationId": "UpdateRtiSubmissionSettingsTenant", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The Id of the Tenant.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + } + } + } + } + } + } + }, + "/tenants/{id}/pricingtables": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get PricingTables", + "description": "Returns all PricingTables for the Tenant", + "operationId": "GetPricingTablesTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Tenant" + ], + "summary": "Create PricingTable", + "description": "Create a PricingTable", + "operationId": "CreatePricingTableTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/tenants/{id}/pricingtables/{pricingTableId}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get PricingTable", + "description": "Get a PricingTable", + "operationId": "GetPricingTableTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pricingTableId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "put": { + "tags": [ + "Tenant" + ], + "summary": "Update PricingTable", + "description": "Update a PricingTables", + "operationId": "UpdatePricingTableTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pricingTableId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PricingTable" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "Tenant" + ], + "summary": "Delete PricingTable", + "description": "Delete a PricingTable", + "operationId": "DeletePricingTableTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pricingTableId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/tenants/{id}/users/{userId}/businessname": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set User Business Name", + "description": "Updates the Business Name for a User", + "operationId": "SetBusinessNameTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "businessName", + "in": "query", + "description": "The Business Name for the User.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/industry": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Industry", + "description": "Updates the Industry for a User", + "operationId": "SetIndustryTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "industry", + "in": "query", + "description": "The Industry for the User.", + "schema": { + "$ref": "#/components/schemas/UserIndustry" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/employeecount": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Employee Count", + "description": "Updates the Employee Count for a User", + "operationId": "SetEmployeeCountTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "employeeCount", + "in": "query", + "description": "The Employee Count for the User.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/country": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Country", + "description": "Updates the Country for a User", + "operationId": "SetCountryTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "country", + "in": "query", + "description": "The Country for the User.", + "schema": { + "$ref": "#/components/schemas/Country" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/users/{userId}/address": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Address", + "description": "Updates the Address for a User", + "operationId": "SetAddressTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The Id of the User.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/reports/apimailinglist": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Api Mailing List Report", + "description": "Returns a report of active users that have asked to be updated about API across all tenants.", + "operationId": "GetApiMailingListReportTenant", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/tenants/{id}/reports/apimailinglist": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Api Mailing List Report", + "description": "Returns a report of active users that have asked to be updated about API for specific tenant.", + "operationId": "GetApiMailingListReportByIdTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/ReportResponse" + } + } + } + } + } + } + }, + "/tenants/{id}/users/employers": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Employers", + "description": "Returns all the employers of all the users of the Tenant", + "operationId": "GetEmployersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/payrollsquad": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Payroll Squads", + "description": "Returns all Payroll Squad for the Tenant", + "operationId": "GetPayrollSquadsTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Tenant" + ], + "summary": "Create Payroll Squad", + "description": "Create a Payroll Squad", + "operationId": "CreatePayrollSquadTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/payrollsquad/{payrollSquadId}": { + "get": { + "tags": [ + "Tenant" + ], + "summary": "Get Payroll Squad", + "description": "Get a Payroll Squad", + "operationId": "GetPayrollSquadTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payrollSquadId", + "in": "path", + "description": "The id of payroll squad", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + } + } + }, + "delete": { + "tags": [ + "Tenant" + ], + "summary": "Delete Payroll Squad and it's Members and Employers.", + "description": "Delete Payroll Squad with it's Members and Employers.", + "operationId": "DeletePayrollSquadTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payrollSquadId", + "in": "path", + "description": "The id of payroll squad", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/payrollsquad/employers": { + "post": { + "tags": [ + "Tenant" + ], + "summary": "Update Payroll Squad Employers", + "description": "Update Payroll Squad Employers", + "operationId": "PayrollSquadUpdateEmployersTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadEmployerRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadEmployerRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadEmployerRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadEmployerRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayrollSquadEmployerResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/payrollsquad/member": { + "post": { + "tags": [ + "Tenant" + ], + "summary": "Add Payroll Squad Member", + "description": "Add Payroll Squad Member", + "operationId": "PayrollSquadAddMemberTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/payrollsquad/{payrollSquadId}/member/{payrollSquadMemberId}": { + "delete": { + "tags": [ + "Tenant" + ], + "summary": "Delete Payroll Squad Member", + "description": "Delete a Payroll Squad Member", + "operationId": "DeletePayrollSquadMemberTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Current tenant id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payrollSquadId", + "in": "path", + "description": "The id of payroll squad", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payrollSquadMemberId", + "in": "path", + "description": "The id of payroll squad member", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/admin/evc": { + "put": { + "tags": [ + "Tenant" + ], + "summary": "Set Evc", + "description": "Disables or enables EVC for a tenant.", + "operationId": "SetEvcTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "disableEvc", + "in": "query", + "description": "A boolean value indicating whether to disable or enable EVC at tenant level.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/tenants/{id}/email": { + "get": { + "tags": [ + "TenantEmail" + ], + "summary": "List Emails", + "description": "Returns a list of all emails sent for this Tenant.", + "operationId": "IndexTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/tenants/{id}/email/{emailId}": { + "get": { + "tags": [ + "TenantEmail" + ], + "summary": "Get Email", + "description": "Returns the email along with its status.", + "operationId": "GetEmailTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "emailId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TenantEmail" + } + } + } + } + } + }, + "post": { + "tags": [ + "TenantEmail" + ], + "summary": "Re-send Email", + "description": "Re-sends an existing email.", + "operationId": "ResendEmailTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "emailId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TenantEmail" + } + } + } + } + } + } + }, + "/tenants/{id}/email/settings": { + "get": { + "tags": [ + "TenantEmail" + ], + "summary": "Get MailSettings", + "description": "Returns the MailSettings for a Tenant.", + "operationId": "GetMailSettingsTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + } + } + }, + "put": { + "tags": [ + "TenantEmail" + ], + "summary": "Update MailSettings", + "description": "Updates the MailSettings for a Tenant.", + "operationId": "UpdateMailSettingsTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MailSettings" + } + } + } + } + } + } + }, + "/tenants/{id}/email/settings/test": { + "post": { + "tags": [ + "TenantEmail" + ], + "summary": "Send test email", + "description": "This API call will generate a test email based on your MailSettings.", + "operationId": "TestMailSettingsTenantEmail", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Id of the Tenant", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "email", + "in": "query", + "description": "The address to send a test email to", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmployerEmail" + } + } + } + } + } + } + }, + "/employers/{employerId}/termcalendars": { + "get": { + "tags": [ + "TermCalendar" + ], + "summary": "List Term Calendars", + "description": "Lists all Term Calendars for an Employer.", + "operationId": "IndexTermCalendar", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get the Term Calendar list", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.TermCalendarResponse" + } + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "TermCalendar" + ], + "summary": "Create Term Calendar", + "description": "Creates a new Term Calendar for the Employer.", + "operationId": "CreateTermCalendar", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which new Term Calendar will be created.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/termcalendars/{id}": { + "get": { + "tags": [ + "TermCalendar" + ], + "summary": "Get Term Calendar", + "description": "Gets a specified Term Calendar.", + "operationId": "GetTermCalendar", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "TermCalendar" + ], + "summary": "Update Term Calendar", + "description": "Updates a Term Calendar for the Employer.", + "operationId": "UpdateTermCalendar", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar which you want to update", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "TermCalendar" + ], + "summary": "Delete Term Calendar", + "description": "Deletes a specified Term Calendar.", + "operationId": "DeleteTermCalendar", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar which you want to delete", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/termcalendaryears/{termCalendarId}": { + "get": { + "tags": [ + "TermCalendarYear" + ], + "summary": "List Term Calendar Years", + "description": "Lists all Years for an Employer and given Term Calendar.", + "operationId": "IndexTermCalendarYear", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to get Term Calendar Year list", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "termCalendarId", + "in": "path", + "description": "The Id of the Term Calendar for which you want to list Years", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.TermCalendarYearResponse" + } + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "TermCalendarYear" + ], + "summary": "Create Term Calendar Year", + "description": "Creates a new Year data for the Employer and given Term Calendar.", + "operationId": "CreateTermCalendarYear", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar Year belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "termCalendarId", + "in": "path", + "description": "The Id of the Term Calendar which you want to add a new year", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/termcalendaryears/{termCalendarId}/{id}": { + "get": { + "tags": [ + "TermCalendarYear" + ], + "summary": "Get Term Calendar Year", + "description": "Gets a specified Term Calendar Year.", + "operationId": "GetTermCalendarYear", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar Year belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "termCalendarId", + "in": "path", + "description": "The Id of the Term Calendar to which the Year belongs", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar Year which you want to fetch", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "TermCalendarYear" + ], + "summary": "Update Term Calendar Year", + "description": "Updates Year data for the Employer and given Term Calendar.", + "operationId": "UpdateTermCalendarYear", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar Year belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "termCalendarId", + "in": "path", + "description": "The Id of the Term Calendar which you want to update existing year", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar Year which you want to update data", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.TermCalendarYearResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "TermCalendarYear" + ], + "summary": "Delete Term Calendar Year", + "description": "Deletes a specified Term Calendar Year.", + "operationId": "DeleteTermCalendarYear", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Term Calendar Year belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "termCalendarId", + "in": "path", + "description": "The Id of the Term Calendar which you want to delete a year", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The Id of the Term Calendar Year which you want to delete", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/employers/{employerId}/tierablepay/{payrunEntryId}": { + "get": { + "tags": [ + "TierablePay" + ], + "summary": "Calculate tierable pay", + "operationId": "GetTierablePay", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "Employer ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payrunEntryId", + "in": "path", + "description": "Payrun entry ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "400": { + "description": "Bad Request" + }, + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "number", + "format": "double" + } + } + } + } + } + } + }, + "/tools/calculate-net-of-on-costs": { + "get": { + "tags": [ + "Tools" + ], + "summary": "Calculate Net of On Costs", + "description": "Calculate the Gross Daily Pay and typical Net Costs for an employee.\r\nThis endpoint is currently being beta tested and subject to un-announced breaking changes.", + "operationId": "CalculateNetOfOnCostsTools", + "parameters": [ + { + "name": "NotionalDayRate", + "in": "query", + "description": "The total chargeable rate per day.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "CalculationDate", + "in": "query", + "description": "Used to find associated legislative values, default Today.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "Fee", + "in": "query", + "description": "The charge for providing this service, per pay period.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "FeeIsPercentage", + "in": "query", + "description": "If true, 'Fee' will be treated as a percentage.", + "required": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "ApprenticeshipLevyRateOverride", + "in": "query", + "description": "Override the Apprenticeship Levy Rate. 0.50 for 0.5%.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "EmployersPensionContribution", + "in": "query", + "description": "The employers pension contributions, per pay period.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "EmployersPensionContributionIsPercentage", + "in": "query", + "description": "If true, EmployersPensionContribution will be treated as a percentage.", + "required": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "EmployeesPensionContribution", + "in": "query", + "description": "The employees pension contributions, per pay period.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "EmployeesPensionContributionIsPercentage", + "in": "query", + "description": "If true, EmployeesPensionContribution will be used as a percentage.", + "required": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "UseAeBandings", + "in": "query", + "description": "If true, legislative Ae Bandings will be applied during calculation.", + "required": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "HolidayWeeks", + "in": "query", + "description": "The holiday weeks to use for the calculation.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "DaysWorkedPerWeek", + "in": "query", + "description": "Number of days the employee works per week.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "PayPeriod", + "in": "query", + "description": "The pay frequency to be used for the calculation.", + "required": true, + "schema": { + "$ref": "#/components/schemas/PayPeriods" + } + }, + { + "name": "PensionRule", + "in": "query", + "description": "The type of pension scheme being enrolled into, default SalarySacrifice.", + "schema": { + "$ref": "#/components/schemas/PensionRule" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.NetOfOnCostsResponse" + } + } + } + }, + "400": { + "description": "Bad Request" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/employers/{employerId}/webhooks": { + "get": { + "tags": [ + "Webhook" + ], + "summary": "List Webhooks", + "description": "Lists all Webhooks for an Employer.", + "operationId": "IndexWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list Webhooks", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Webhook" + ], + "summary": "Create Webhook", + "description": "Creates a new Webhook for the Employer.", + "operationId": "CreateWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created" + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/webhooks/{id}": { + "get": { + "tags": [ + "Webhook" + ], + "summary": "Get Webhook", + "description": "Gets the Webhook specified.", + "operationId": "GetWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Webhook belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + } + } + }, + "put": { + "tags": [ + "Webhook" + ], + "summary": "Update Webhook", + "description": "Updates a Webhook for the Employer.", + "operationId": "UpdateWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + }, + "delete": { + "tags": [ + "Webhook" + ], + "summary": "Delete Webhook", + "description": "Deletes the specified Webhook.", + "operationId": "DeleteWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/employers/{employerId}/webhooks/samples/{webhookEvent}": { + "get": { + "tags": [ + "Webhook" + ], + "summary": "Sample Value", + "description": "Returns an example of the data you can expect your end point to receive when a webhook is fired.", + "operationId": "SampleWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the Webhook belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "webhookEvent", + "in": "path", + "description": "The WebhookEvent that you want a sample value for.", + "required": true, + "schema": { + "$ref": "#/components/schemas/WebhookEvent" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { } + } + } + } + } + } + }, + "/employers/{employerId}/webhooks/{id}/payloads": { + "get": { + "tags": [ + "Webhook" + ], + "summary": "List WebhookPayloads", + "description": "Returns a list of all WebhookPayloads for this webhook", + "operationId": "PayloadsWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageNum", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "/employers/{employerId}/webhooks/{id}/payloads/{payloadId}": { + "get": { + "tags": [ + "Webhook" + ], + "summary": "Get WebhookPayload", + "description": "Returns the specified WebhookPayload for this webhook", + "operationId": "PayloadWebhook", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "payloadId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookPayload" + } + } + } + } + } + } + }, + "/employers/{employerId}/workingpatterns": { + "get": { + "tags": [ + "WorkingPattern" + ], + "summary": "List WorkingPatterns", + "description": "Lists all WorkingPattern for the Employer specified.", + "operationId": "IndexAsyncWorkingPattern", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer for which you want to list WorkingPattern", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "WorkingPattern" + ], + "summary": "Create WorkingPattern", + "description": "Creates a new WorkingPattern for the Employer.", + "operationId": "CreateWorkingPattern", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request" + }, + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkingPattern" + } + } + } + }, + "404": { + "description": "Employer Not Found" + } + } + } + }, + "/employers/{employerId}/workingpatterns/{id}": { + "get": { + "tags": [ + "WorkingPattern" + ], + "summary": "Get WorkingPattern", + "description": "Gets the WorkingPattern specified.", + "operationId": "GetAsyncWorkingPattern", + "parameters": [ + { + "name": "employerId", + "in": "path", + "description": "The Id of the Employer to which the WorkingPattern belongs.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "description": "The id of the WorkingPattern you want to retrieve.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternResponse" + } + } + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "WorkingPattern" + ], + "summary": "Update WorkingPattern", + "description": "Updates the details of an existing WorkingPattern.", + "operationId": "UpdateWorkingPattern", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contract.WorkingPatternResponse" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "WorkingPattern" + ], + "summary": "Delete WorkingPattern", + "description": "Deletes the specified WorkingPattern.", + "operationId": "DeleteWorkingPattern", + "parameters": [ + { + "name": "employerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + } + }, + "components": { + "schemas": { + "Address": { + "type": "object", + "properties": { + "line1": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line2": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line3": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line4": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line5": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "postCode": { + "maxLength": 10, + "type": "string", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country" + }, + "foreignCountry": { + "maxLength": 35, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AdvancedVarianceReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdvancedVarianceReportLine" + }, + "nullable": true + }, + "payCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + }, + "nullable": true + }, + "primaryPeriodName": { + "type": "string", + "nullable": true + }, + "secondaryPeriodName": { + "type": "string", + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AdvancedVarianceReportLine": { + "type": "object", + "properties": { + "employeeCode": { + "type": "string", + "nullable": true + }, + "employeeName": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "costCentre": { + "type": "string", + "nullable": true + }, + "primaryGrossTotal": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryGrossTotal": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryGrossTaxable": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryGrossTaxable": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryNetPay": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryNetPay": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryTax": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryTax": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryEmployeeNi": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryEmployeeNi": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryEmployerNi": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryEmployerNi": { + "type": "number", + "format": "double", + "nullable": true + }, + "primaryStudentOrPgLoan": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryStudentOrPgLoan": { + "type": "number", + "format": "double", + "nullable": true + }, + "payCodeVarianceLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCodeVarianceLine" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "AdvancedVarianceReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/AdvancedVarianceReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "AeAction": { + "enum": [ + "NoChange", + "Enrol", + "Exit", + "Inconclusive", + "Postpone", + "ReEnrol" + ], + "type": "string" + }, + "AeAssessment": { + "type": "object", + "properties": { + "assessmentDate": { + "type": "string", + "format": "date-time" + }, + "employeeState": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "age": { + "type": "integer", + "description": "[readonly] The age of the Employee at the time of the assessment", + "format": "int32" + }, + "ukWorker": { + "$ref": "#/components/schemas/AeUKWorker" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "[readonly] The PaySchedule ordinal for the Employee at the time of the assessment", + "format": "int32" + }, + "earningsInPeriod": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "qualifyingEarningsInPeriod": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "aeExclusionCode": { + "$ref": "#/components/schemas/AeExclusionCode" + }, + "status": { + "$ref": "#/components/schemas/AeStatus" + }, + "reason": { + "type": "string", + "description": "[readonly] The reason for determining the Status given.", + "nullable": true + }, + "action": { + "$ref": "#/components/schemas/AeAssessmentAction" + }, + "startReportingType": { + "$ref": "#/components/schemas/PensionReportingType" + }, + "endReportingType": { + "$ref": "#/components/schemas/PensionReportingType" + }, + "startPayRunEntryId": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "endPayRunEntryId": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "As part of AutoEnrolment we assess your Employees to see if they need to be auto-enroled in a Pension.\r\nThis model shows the result of an assessment." + }, + "AeAssessmentAction": { + "type": "object", + "properties": { + "action": { + "$ref": "#/components/schemas/AeAction" + }, + "employeeState": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "actionCompleted": { + "type": "boolean", + "description": "[readonly] Indicates whether or not the required action was successfully completed" + }, + "actionCompletedMessage": { + "type": "string", + "description": "[readonly] Gives further information about the action taken or the reason if wasn't successfully completed", + "nullable": true + }, + "requiredLetter": { + "$ref": "#/components/schemas/AeStatutoryLetter" + }, + "pensionSchemeId": { + "type": "string", + "description": "[readonly] The PensionSchemeId that a completed action relates to", + "format": "uuid" + }, + "workerGroupId": { + "type": "string", + "description": "[readonly] The WorkerGroupId that a completed action relates to", + "format": "uuid" + }, + "letterNotYetSent": { + "type": "boolean", + "description": "[readonly] Indicates whether or not any required letter has been sent" + } + }, + "additionalProperties": false + }, + "AeEmployeeState": { + "enum": [ + "Automatic", + "OptOut", + "OptIn", + "VoluntaryJoiner", + "ContractualPension", + "CeasedMembership", + "Leaver", + "Excluded", + "Enrol" + ], + "type": "string" + }, + "AeExclusionCode": { + "enum": [ + "NotKnown", + "NotAWorker", + "NotWorkingInUk", + "NoOrdinarilyWorkingInUk", + "OutsideOfAgeRange", + "SingleEmployee", + "CeasedActiveMembershipInPast12Mo", + "CeasedActiveMembership", + "ReceivedWulsInPast12Mo", + "ReceivedWuls", + "Leaving", + "TaxProtection", + "CisSubContractor" + ], + "type": "string" + }, + "AeStatus": { + "enum": [ + "Eligible", + "NonEligible", + "Entitled", + "NoDuties" + ], + "type": "string" + }, + "AeStatutoryLetter": { + "enum": [ + "B1", + "B2", + "B3", + "B4" + ], + "type": "string" + }, + "AeUKWorker": { + "enum": [ + "No", + "Yes", + "Ordinarily" + ], + "type": "string" + }, + "AllowanceType": { + "enum": [ + "Fixed", + "Variable", + "Range", + "Graded" + ], + "type": "string" + }, + "AnalysisCategory": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string", + "description": "The unique Analysis Category Name" + } + }, + "additionalProperties": false + }, + "AnalysisCategoryCode": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Analysis Code" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Analysis Code, in hex format. ie 'ff0000'", + "nullable": true + }, + "accountingCode": { + "maxLength": 50, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AnalysisCategoryCodes": { + "type": "object", + "properties": { + "analysisCategory": { + "type": "string", + "description": "AnalysisCategory Model", + "nullable": true + }, + "analysisCategoryCode": { + "type": "string", + "description": "AnalysisCategoryCode Model", + "nullable": true + }, + "analysisCategoryId": { + "type": "string", + "description": "AnalysisCategory Identifier", + "format": "uuid", + "nullable": true + }, + "analysisCategoryCodeId": { + "type": "string", + "description": "AnalysisCategoryCode Identifier", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "AnalysisCategoryIndex": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "index": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "AnalysisReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisReportLine" + }, + "nullable": true + }, + "payCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + }, + "nullable": true + }, + "showPayPeriodBreakdown": { + "type": "boolean" + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AnalysisReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "taxYear": { + "type": "string", + "nullable": true + }, + "payPeriod": { + "type": "integer", + "format": "int32" + }, + "gross": { + "type": "number", + "format": "double" + }, + "niableGross": { + "type": "number", + "format": "double" + }, + "pensionableGross": { + "type": "number", + "format": "double" + }, + "net": { + "type": "number", + "format": "double" + }, + "takeHome": { + "type": "number", + "format": "double" + }, + "employerNic": { + "type": "number", + "format": "double" + }, + "employerPension": { + "type": "number", + "format": "double" + }, + "showQtyColumn": { + "type": "boolean" + }, + "niSaving": { + "type": "number", + "format": "double" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisReportLineValue" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "AnalysisReportLineValue": { + "type": "object", + "properties": { + "qty": { + "type": "number", + "format": "double", + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "AnalysisReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/AnalysisReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "AnnualRoundingRule": { + "enum": [ + "RoundOff", + "Exact", + "RoundUp", + "RoundDown" + ], + "type": "string" + }, + "AssumedPensionablePay": { + "enum": [ + "AssumedPensionablePay", + "NormalPay", + "HigherOfTheTwo" + ], + "type": "string" + }, + "AttachmentOrder": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/AttachmentOrderType" + }, + "carryForwardShortfall": { + "type": "boolean", + "description": "[ReadOnly] Whether or not shortfalls should be carried forward", + "readOnly": true + }, + "allowProtectedEarnings": { + "type": "boolean", + "description": "[ReadOnly] Whether or not shortfalls should be carried forward", + "readOnly": true + }, + "autoDeduction": { + "type": "boolean", + "description": "[readonly] Whether or not the amount to be deducted is automatically calculated", + "readOnly": true + }, + "reference": { + "maxLength": 100, + "type": "string", + "description": "The reference which appeared on the court paperwork", + "nullable": true + }, + "issueDate": { + "type": "string", + "description": "The date of issue for this Order", + "format": "date" + }, + "applyFrom": { + "type": "string", + "description": "The date from which to apply this Order", + "format": "date" + }, + "applyUntil": { + "type": "string", + "description": "An optional date on which to stop applying this order", + "format": "date", + "nullable": true + }, + "deductionIsPercentage": { + "type": "boolean", + "description": "Whether or not the amount given for Deduction is a percentage rather than a fixed amount" + }, + "deduction": { + "type": "number", + "description": "The percentage or amount (depending on DeductionIsPercentage) to deduct", + "format": "double" + }, + "protectedEarningsIsPercentage": { + "type": "boolean", + "description": "Whether or not the amount for ProtectedEarnings is a percentage rather than a fixed amount." + }, + "protectedEarnings": { + "type": "number", + "description": "The percentage or amount or percentage (depending on ProtectedEarningsIsPercentage) to protect", + "format": "double" + }, + "chargeAdminFee": { + "type": "boolean", + "description": "Whether or not a £1 admin fee should be deducted for this order" + }, + "shortfall": { + "type": "number", + "description": "Any shortfall that is being carried forward", + "format": "double" + }, + "stopWhenTotalPaid": { + "type": "boolean", + "description": "Whether or not this order should be stopped once a total amount has been paid" + }, + "totalAmountToPay": { + "type": "number", + "description": "The Total amount that needs to be paid for this Order", + "format": "double" + }, + "amountPreviouslyPaid": { + "type": "number", + "description": "Any amount that has previously been paid towards this Order", + "format": "double" + }, + "stopped": { + "type": "boolean", + "description": "[readonly] Whether or not this Order has been stopped.\r\nThis is set automatically when either it's paid in full or the ApplyUntil date has been reached." + }, + "notes": { + "maxLength": 300, + "type": "string", + "description": "A free-form text field to record any comments", + "nullable": true + }, + "includeBankDetails": { + "type": "boolean" + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AttachmentOrderPayment" + }, + "description": "[readonly] Payments made towards this order. Only populated when viewed as a report.", + "nullable": true + }, + "payee": { + "type": "string", + "description": "The Id of the Payee, if any, that deductions are to be paid to.", + "format": "uuid", + "nullable": true + }, + "payeeName": { + "type": "string", + "description": "The name of the Payee, if any, that deductions are to be paid to.", + "nullable": true + }, + "documentCount": { + "type": "integer", + "description": "[readonly] The number of attachments associated with this model", + "format": "int32" + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The attachments associated with this model", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent an Attachment of Earnings Order (AEO)" + }, + "AttachmentOrderPayment": { + "type": "object", + "properties": { + "attachmentOrder": { + "$ref": "#/components/schemas/Item" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "date": { + "type": "string", + "description": "[readonly] The date this deduction was made", + "format": "date" + }, + "description": { + "type": "string", + "description": "[readonly] Description of deduction, usually the reference from the AttachmentOrder", + "nullable": true + }, + "attachablePay": { + "type": "number", + "description": "[readonly] The total Attachable pay for the Employee on this PayRun", + "format": "double" + }, + "protectedPay": { + "type": "number", + "description": "[readonly] The amount of the Attachable Pay that must be protected", + "format": "double" + }, + "otherAttachmentOrderDeductions": { + "type": "number", + "description": "[readonly] Deductions made on this PayRun for this employee due to other higher priority AttachmentOrders", + "format": "double" + }, + "desiredDeduction": { + "type": "number", + "description": "[readonly] The amount that should be deducted, if arrestable pay is available.\r\nNot including any shortfall", + "format": "double" + }, + "shortfall": { + "type": "number", + "description": "[readonly] Any shortfall (ie arrears) that existed before this PayRun.", + "format": "double" + }, + "totalPaid": { + "type": "number", + "description": "[readonly] Total amount paid to date, including this deduction.", + "format": "double" + }, + "resultingDeduction": { + "type": "number", + "description": "[readonly] The actual amount deducted", + "format": "double" + }, + "resultingShortfall": { + "type": "number", + "description": "[readonly] The resulting shortfall (including any shortfall from previous periods", + "format": "double" + }, + "adminFee": { + "type": "number", + "description": "[readonly] Any admin fee charged", + "format": "double" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent a payment towards an Attachment of Earnings Order (AEO)" + }, + "AttachmentOrderReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/AttachmentOrder" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "AttachmentOrderType": { + "enum": [ + "AeoP", + "Aeo", + "Csa", + "Csa2012", + "Deo", + "AeoNp", + "CcPre92", + "CcPost92", + "Ctaeo", + "Mcaeo", + "Ea", + "Cma", + "Cao", + "Isd", + "Ea2006", + "Caps", + "Dea", + "DeaHigher", + "DeaFixed", + "CtaeoWales" + ], + "type": "string" + }, + "AttachmentOrdersReport": { + "type": "object", + "properties": { + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AttachmentOrdersReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/AttachmentOrdersReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "AuditEventAction": { + "enum": [ + "Added", + "Edited", + "Deleted" + ], + "type": "string" + }, + "AuthScheme": { + "enum": [ + "OAuth1", + "OAuth2", + "Basic", + "ApiKeyInHeader", + "Hmac", + "OAuth2Cc", + "OAuth2Password", + "DeferToThirdParty" + ], + "type": "string" + }, + "AutoEnrolment": { + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "stateDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "ukWorker": { + "$ref": "#/components/schemas/AeUKWorker" + }, + "daysToDeferAssessment": { + "type": "integer", + "description": "The number of days, if any, to defer assessment of this employee.\r\nYou're allowed to defer assessment of new employees by up to 3 months.", + "format": "int32" + }, + "postponementDate": { + "type": "string", + "description": "[readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date.\r\nThis is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null\r\nThis is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not.", + "format": "date", + "nullable": true + }, + "deferByMonthsNotDays": { + "type": "boolean", + "description": "If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days" + }, + "exempt": { + "type": "boolean" + }, + "aeExclusionCode": { + "$ref": "#/components/schemas/AeExclusionCode" + }, + "aePostponementLetterSent": { + "type": "boolean" + }, + "lastAssessment": { + "$ref": "#/components/schemas/AeAssessment" + } + }, + "additionalProperties": false + }, + "AutoEnrolmentSettings": { + "type": "object", + "properties": { + "stagingDate": { + "type": "string", + "format": "date" + }, + "cyclicalReenrolmentDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "previousCyclicalReenrolmentDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "defaultPension": { + "$ref": "#/components/schemas/PensionSelection" + }, + "pensionSameAsDefault": { + "type": "boolean" + }, + "daysToDeferAssessment": { + "type": "integer", + "description": "The number of days, if any, to defer assessment of new employees.\r\nYou're allowed to defer assessment of new employees by up to 3 months.\r\nThis is the default value used when you create a new employee. It can be changed on a per-employee basis.", + "format": "int32" + }, + "deferByMonthsNotDays": { + "type": "boolean", + "description": "If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days" + }, + "deferEnrolmentBy": { + "type": "integer", + "description": "The number of days )or weeks, or months), if any, to defer enrolment of employees that are Eligible Jobholders.\r\nFor example, if this is set to 30 days then if an employee meets the criteria for enrolment then they'll only be enrolled if they still meet the criteria 30 days later", + "format": "int32" + }, + "deferEnrolmentByPeriodType": { + "$ref": "#/components/schemas/DeferalPeriodType" + }, + "includeNonPensionedEmployeesInSubmission": { + "type": "boolean", + "description": "Whether or not to include details of non-pensioned employees in your submissions to this provider" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "AutoPilotFinaliseTime": { + "enum": [ + "JustAfterMidnight", + "NineAm", + "OnePm", + "FourPm", + "SixPm", + "ElevenPm" + ], + "type": "string" + }, + "AutomationSettings": { + "type": "object", + "properties": { + "enableAutoPilot": { + "type": "boolean", + "description": "IF enabled then payruns will be automatically finalised on the payment date and the next payrun will be started" + }, + "autoPilotTime": { + "$ref": "#/components/schemas/AutoPilotFinaliseTime" + }, + "autoPilotOffset": { + "maximum": 6, + "minimum": 0, + "type": "integer", + "description": "How many days before the payment date a payrun should be finalised.\r\nSet it to 0 if you want the payrun to be automatically finalised on the payment date itself", + "format": "int32" + }, + "enableAutoOpen": { + "type": "boolean", + "description": "IF enabled then whenever you close a payrun, the next one will be started. Automatically set to true if EnableAutoPilot is true" + }, + "autoSubmitFps": { + "type": "boolean", + "description": "If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun.\r\nThis property will always have the same value as the property with the same name on the RtiSubmissionSettings model." + }, + "autoSubmitPayments": { + "type": "boolean", + "description": "If set to true, we'll automatically submit payments whenever you finalise a PayRun.\r\nThe employer must be connected to an ExternalDataProvider supporting Type of 'Payments'." + }, + "autoSubmitJournal": { + "type": "boolean", + "description": "If set to true, we'll automatically submit the payroll journal whenever you finalise a PayRun.\r\nThe employer must be connected to an ExternalDataProvider supporting Type of 'Accounting'." + }, + "autoSubmitPayments_Employee": { + "type": "boolean", + "description": "Used in conjunction with AutoSubmitPayments." + }, + "autoSubmitPayslips": { + "type": "boolean", + "description": "If set to true, we'll automatically submit payslips whenever you finalise a PayRun.\r\nThe employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'." + }, + "autoSubmitP45s": { + "type": "boolean", + "description": "If set to true, we'll automatically submit P45s whenever you finalise a PayRun.\r\nThe employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'." + }, + "autoSubmitPayments_Hmrc": { + "type": "boolean", + "description": "Used in conjunction with AutoSubmitPayments." + }, + "autoSubmitPayments_Deductions": { + "type": "boolean", + "description": "Used in conjunction with AutoSubmitPayments." + }, + "autoSubmitPayments_Aeos": { + "type": "boolean", + "description": "Used in conjunction with AutoSubmitPayments." + }, + "autoSubmitPayments_Pensions": { + "type": "boolean", + "description": "Used in conjunction with AutoSubmitPayments." + }, + "employeesWithoutEmailAddress": { + "type": "integer", + "description": "[readonly] A count of how many employees or subcontractors for this employer do not have email addresses", + "format": "int32" + }, + "employeesWithEmailAddressButNotAutoSending": { + "type": "integer", + "description": "[readonly] A count of how many employees or subcontractors for this employer do have email addresses but don't have the option enabled to auto-email payslips", + "format": "int32" + }, + "subcontractorsNotAutoSendingStatement": { + "type": "integer", + "description": "[readonly] A count of how many subscontractors for this employer do don't have the option enabled to auto-email statement", + "format": "int32" + }, + "codingNoticesAutomaticallyApplied": { + "type": "boolean", + "description": "[readonly] An indicator of whether or not this employer is automatically applying DpsNotices" + }, + "payrunEmails": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayrunEmail" + }, + "description": "Automated emails that will be sent when a PayRun is finalised", + "nullable": true + }, + "autoSubmitPensionLetters": { + "type": "boolean", + "description": "If set to true, we'll automatically submit Pension Letters whenever you finalise a PayRun.\r\nThe employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'." + }, + "autoSubmitEps": { + "type": "boolean", + "description": "If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun." + } + }, + "additionalProperties": false, + "description": "Configures various automation settings for an Employer" + }, + "AverageHolidayPayRateReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AverageHolidayPayRateReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "AverageHolidayPayRateReportLine": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "description": "Payroll code of the employee", + "nullable": true + }, + "firstName": { + "type": "string", + "description": "The First Name of the employee", + "nullable": true + }, + "lastName": { + "type": "string", + "description": "The Last Name of the employee", + "nullable": true + }, + "niNumber": { + "type": "string", + "description": "The NiNumber of the employee", + "nullable": true + }, + "period": { + "type": "integer", + "description": "The Period of the average holiday pay rate", + "format": "int32" + }, + "rate": { + "type": "number", + "description": "The Average holiday pay rate", + "format": "double" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AverageHolidayPayRateReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/AverageHolidayPayRateReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "AveragePayGradesReportLine": { + "type": "object", + "properties": { + "effectiveDate": { + "type": "string", + "description": "Effective date for Pay spine grade", + "format": "date" + }, + "paySpineName": { + "type": "string", + "description": "Name of Pay Spine", + "nullable": true + }, + "payGradeName": { + "type": "string", + "description": "Name of Pay grade name", + "nullable": true + }, + "lowerGradePoint": { + "type": "string", + "description": "Lower grade point of pay spine grade", + "nullable": true + }, + "upperGradePoint": { + "type": "string", + "description": "Upper grade point of pay spine grade", + "nullable": true + }, + "upperPointAltMax": { + "type": "boolean", + "description": "To Check Alt Max of Upper point" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AverageWeeklyEarnings": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/AverageWeeklyEarningsResult" + }, + "resultDescription": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "averageEarnings": { + "type": "number", + "format": "double", + "readOnly": true + }, + "threshold": { + "type": "number", + "format": "double" + }, + "eligibilityThreshold": { + "type": "number", + "format": "double" + }, + "requestedDate": { + "type": "string", + "format": "date" + }, + "relevantPeriodStart": { + "type": "string", + "format": "date" + }, + "relevantPeriodEnd": { + "type": "string", + "format": "date" + }, + "relevantPeriodWeekCount": { + "type": "number", + "format": "double" + }, + "relevantPeriodEarnings": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "AverageWeeklyEarningsResult": { + "enum": [ + "Success", + "EarningsBelowThreshold", + "NotEnoughPayrollData", + "TaxYearNotSupported" + ], + "type": "string" + }, + "BackgroundTaskStatus": { + "enum": [ + "Queued", + "Sent", + "Failed", + "Processing" + ], + "type": "string" + }, + "BankDetails": { + "type": "object", + "properties": { + "bankName": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "bankBranch": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "bankReference": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "accountName": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "accountNumber": { + "pattern": "^\\d{8}$", + "type": "string", + "nullable": true + }, + "sortCode": { + "pattern": "^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$", + "type": "string", + "nullable": true + }, + "note": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "buildingSocietyRollNumber": { + "maxLength": 18, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\s\\/\\.-]+$", + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BankHolidayCollection": { + "enum": [ + "None", + "EnglandAndWales", + "Scotland", + "NorthernIreland" + ], + "type": "string" + }, + "BankPaymentInstruction": { + "type": "object", + "properties": { + "originator": { + "$ref": "#/components/schemas/BankDetails" + }, + "bankPayments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRunPayment" + }, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusMessage": { + "type": "string", + "description": "[readonly] A message to elaborate on the Status", + "nullable": true + }, + "link": { + "type": "string", + "description": "[readonly] If available, a link to the payments in an ExternalDataProvider", + "nullable": true + }, + "serviceUserNumber": { + "type": "string", + "description": "Service user number to be used while sending payment instruction", + "nullable": true + }, + "bureauNumber": { + "type": "string", + "description": "Bureau number to be used if available while sending payment instruction", + "nullable": true + }, + "allowsMultiDate": { + "type": "boolean", + "description": "Allows multiple payment dates in the file" + } + }, + "additionalProperties": false + }, + "BankPaymentInstructionReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/BankPaymentInstruction" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "BankPaymentInstructionsCsvFormat": { + "enum": [ + "StandardCsv", + "Telleroo", + "BarclaysBacs", + "SantanderBacs", + "Sif", + "Revolut", + "Standard18FasterPayments", + "Standard18Bacs", + "Bankline", + "BanklineBulk", + "StandardCsvBacs", + "LloydsMultipleStandardCsvBacs", + "LloydsV11CsvBacs", + "CoOpBulkCsvBacs", + "CoOpFasterPaymentsCsv", + "BankOfAmericaBacs", + "DanskeBankUkLocalPayments", + "DanskeBankUkFasterPayments", + "Standard18BacsMulti" + ], + "type": "string" + }, + "Benefit": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "type": { + "$ref": "#/components/schemas/BenefitType" + }, + "declarationType": { + "$ref": "#/components/schemas/BenefitDeclarationType" + }, + "benefitPayrolled": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BenefitPayrolled" + }, + "nullable": true + }, + "description": { + "maxLength": 120, + "type": "string", + "description": "A description of this benefit", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + }, + "employeeContribution": { + "type": "number", + "format": "double" + }, + "startDate": { + "type": "string", + "description": "The date the benefits starts if different to the start date of the TaxYear", + "format": "date", + "nullable": true + }, + "endDate": { + "type": "string", + "description": "The date the benefits ends if different to the end date of the TaxYear", + "format": "date", + "nullable": true + }, + "useProRata": { + "type": "boolean", + "description": "Benefit calculation should be done on pro rata rules" + }, + "cashEquivalent": { + "type": "number", + "description": "[readonly]", + "format": "double", + "readOnly": true + }, + "assetType": { + "$ref": "#/components/schemas/BenefitDetailsAssetType" + }, + "useOfAssetType": { + "$ref": "#/components/schemas/BenefitDetailsUseOfAssetType" + }, + "class1AType": { + "$ref": "#/components/schemas/BenefitDetailsClass1AType" + }, + "nonClass1AType": { + "$ref": "#/components/schemas/BenefitDetailsNonClass1AType" + }, + "paymentType": { + "$ref": "#/components/schemas/BenefitDetailsPaymentType" + }, + "tradingOrganisation": { + "type": "boolean", + "description": "Only relevant to Benefits with Type Entertainment" + }, + "cashEquivalentFuel": { + "type": "number", + "description": "Only relevant to Benefits with Type Vans", + "format": "double" + }, + "loan": { + "$ref": "#/components/schemas/BenefitDetailsLoan" + }, + "car": { + "$ref": "#/components/schemas/BenefitDetailsCar" + }, + "openingBalance": { + "type": "number", + "description": "The amount of benefit paid YTD when setting up a benefit", + "format": "double" + }, + "paid": { + "type": "number", + "description": "[readonly]", + "format": "double", + "readOnly": true + }, + "bikOutstanding": { + "type": "number", + "description": "[readonly]", + "format": "double", + "readOnly": true + }, + "isPeriodValue": { + "type": "boolean", + "description": "To be used for the benefit period" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent Benefits and Expenses" + }, + "BenefitDeclarationType": { + "enum": [ + "P11D", + "Paye" + ], + "type": "string" + }, + "BenefitDetailsAssetType": { + "enum": [ + "Other", + "Multiple", + "Property", + "Cars", + "PreciousMetals" + ], + "type": "string" + }, + "BenefitDetailsCar": { + "type": "object", + "properties": { + "makeAndModel": { + "type": "string", + "nullable": true + }, + "registration": { + "type": "string", + "nullable": true + }, + "firstRegistered": { + "type": "string", + "format": "date", + "nullable": true + }, + "hasApprovedEmissionsValue": { + "type": "boolean" + }, + "co2Emissions": { + "type": "integer", + "format": "int32" + }, + "engineSize": { + "type": "integer", + "format": "int32" + }, + "zeroEmissionsMileage": { + "type": "integer", + "format": "int32" + }, + "fuelType": { + "$ref": "#/components/schemas/BenefitDetailsCarPowerType" + }, + "availableFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "availableTo": { + "type": "string", + "format": "date", + "nullable": true + }, + "daysUnavailable": { + "type": "integer", + "format": "int32" + }, + "listPrice": { + "type": "number", + "format": "double" + }, + "nonStandardAccessories": { + "type": "number", + "format": "double" + }, + "employeeCapitalContributions": { + "type": "number", + "format": "double" + }, + "employeePrivateContributions": { + "type": "number", + "format": "double" + }, + "freeFuel": { + "type": "boolean" + }, + "fuelAvailableFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "fuelAvailableTo": { + "type": "string", + "format": "date", + "nullable": true + }, + "freeFuelReinstated": { + "type": "boolean" + }, + "registeredPriorTo1998": { + "type": "boolean", + "description": "[readonly]", + "readOnly": true + }, + "rate": { + "type": "number", + "description": "[readonly] The applicable rate based on CO2Emissions and Engine Size", + "format": "double" + }, + "chargeableValue": { + "type": "number", + "description": "[readonly] The chargeable value of the car", + "format": "double", + "readOnly": true + }, + "fullYearCharge": { + "type": "number", + "description": "[readonly] The charge for the car for a full year, not taking in to account available dates or EmployeePrivateContributions", + "format": "double", + "readOnly": true + }, + "cashEquivalent": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "cashEquivalentFuel": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false + }, + "BenefitDetailsCarPowerType": { + "enum": [ + "Diesel6d", + "DieselNon6d", + "Petrol", + "Hybrid", + "Electric" + ], + "type": "string" + }, + "BenefitDetailsClass1AType": { + "enum": [ + "Other", + "Multiple", + "StopLossCharges", + "NonQualifyingRelocationBenefit", + "EducationalAssitance", + "SubscriptionsAndFees" + ], + "type": "string" + }, + "BenefitDetailsLoan": { + "type": "object", + "properties": { + "numberOfJointBorrowers": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "loanMade": { + "type": "string", + "format": "date", + "nullable": true + }, + "loanDischarged": { + "type": "string", + "format": "date", + "nullable": true + }, + "startingBalance": { + "type": "number", + "format": "double" + }, + "closingBalance": { + "type": "number", + "format": "double" + }, + "maxBalanceInYear": { + "type": "number", + "format": "double" + }, + "interestPaid": { + "type": "number", + "format": "double" + }, + "cashEquivalent": { + "type": "number", + "description": "[readonly]", + "format": "double", + "readOnly": true + }, + "fullTaxMonths": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "monthlyValue": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "officialInterest": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false + }, + "BenefitDetailsNonClass1AType": { + "enum": [ + "Other", + "Multiple", + "LoansWrittenOrWaived", + "NurseryPlaces", + "EducationalAssitance", + "SubscriptionsAndFees" + ], + "type": "string" + }, + "BenefitDetailsPaymentType": { + "enum": [ + "Other", + "SeasonTickets", + "PrivateCarExpenses", + "PrivateEducation", + "AccountancyFees", + "DomesticBills", + "Multiple" + ], + "type": "string" + }, + "BenefitDetailsUseOfAssetType": { + "enum": [ + "Other", + "Multiple", + "CorporateHospitality", + "Boat", + "Aircraft", + "TimeshareAccommodation", + "HolidayAccommodation" + ], + "type": "string" + }, + "BenefitPayrolled": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "amount": { + "type": "number", + "format": "double" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "BenefitType": { + "enum": [ + "AssetsTransferred", + "PaymentsOnBehalf", + "UnborneTax", + "Vouchers", + "Accommodation", + "MileageAllowance", + "Car", + "Vans", + "Loan", + "Medical", + "QualifyingRelocationExpenses", + "Services", + "AssetsAtEmployeeDisposal", + "OtherClass1AItems", + "OtherNonClass1AItems", + "DirectorTax", + "TravellingAndSubsistence", + "Entertainment", + "HomeTelephone", + "NonQualifyingRelocationExpenses", + "OtherExpenses" + ], + "type": "string" + }, + "BureauSettings": { + "type": "object", + "properties": { + "enableApprovals": { + "type": "boolean", + "description": "Whether or not Payruns for this employer need to go through an Approval process" + }, + "processorUserId": { + "type": "string", + "description": "The Id of the user, if any, that is the allocated Processor", + "format": "uuid", + "nullable": true + }, + "reportPackId": { + "type": "string", + "description": "The Id of the ReportPack, if any, to present to the Payroll Client", + "format": "uuid", + "nullable": true + }, + "isBacsClient": { + "type": "boolean", + "description": "Indicates that the bureau is responsible for BACS payments of net wages to employees" + }, + "isBacsClientForHmrc": { + "type": "boolean", + "description": "Indicates that the bureau is responsible for BACS payments of HMRC liabilites" + }, + "showContactCard": { + "type": "boolean", + "description": "Show a Contact card with the Processors details on the PayrollClient dashboard" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Represents the BureauSettings for an Employer." + }, + "CISSubContractorType": { + "enum": [ + "SoleTrader", + "Partnership", + "Company", + "Trust" + ], + "type": "string" + }, + "CISTaxStatus": { + "enum": [ + "Gross", + "NetOfStandardDeduction", + "NetOfHigherDeduction" + ], + "type": "string" + }, + "CalendarEntry": { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true + }, + "start": { + "type": "string", + "format": "date" + }, + "end": { + "type": "string", + "format": "date" + }, + "type": { + "$ref": "#/components/schemas/CalendarEntryType" + } + }, + "additionalProperties": false + }, + "CalendarEntryType": { + "enum": [ + "EmployeeStarting", + "EmployeeLeaving", + "EmployeeAbsence", + "PayDay", + "EmployeeBirthday", + "EmployeeWorkAnniversary" + ], + "type": "string" + }, + "CalendarMonth": { + "enum": [ + "None", + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "type": "string" + }, + "CarCharge": { + "type": "object", + "properties": { + "dieselSurcharge": { + "type": "number", + "format": "double" + }, + "maxCharge": { + "type": "number", + "format": "double" + }, + "minCharge": { + "type": "number", + "format": "double" + }, + "fuelCharge": { + "type": "number", + "format": "double" + }, + "newCarRateReductionDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "newCarRateReductionAmount": { + "type": "number", + "format": "double" + }, + "co2Table": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CarChargeRate" + }, + "nullable": true + }, + "engineSizeTable": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CarChargeRate" + }, + "nullable": true + }, + "zeroEmissionsTable": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CarChargeRate" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate charges for a Company Car.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "CarChargeRate": { + "type": "object", + "properties": { + "rangeStart": { + "type": "integer", + "format": "int32" + }, + "rangeStop": { + "type": "integer", + "format": "int32" + }, + "rate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate charges for a Company Car.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "ChangeSummary": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "auditId": { + "type": "string", + "format": "uuid" + }, + "previousAuditId": { + "type": "string", + "description": "This Id is used to delete the previous audit entry once the change summary entry is created\r\nfor the modifications between the current and the previous audit entry.", + "format": "uuid" + }, + "date": { + "type": "string", + "format": "date" + }, + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "actionPerformed": { + "$ref": "#/components/schemas/AuditEventAction" + }, + "entityType": { + "$ref": "#/components/schemas/EntityType" + }, + "entityId": { + "type": "string", + "description": "Id of the underlying entity", + "format": "uuid" + }, + "employeeUniqueId": { + "type": "string", + "description": "Unique id of the employee this operation belongs to", + "format": "uuid" + }, + "employerUniqueId": { + "type": "string", + "description": "Unique id of the employer this operation belongs to", + "format": "uuid" + }, + "actionPerformedBy": { + "type": "string", + "nullable": true + }, + "actionPerformedOn": { + "type": "string", + "nullable": true + }, + "employeeFirstName": { + "type": "string", + "nullable": true + }, + "employeeLastName": { + "type": "string", + "nullable": true + }, + "uniqueId": { + "type": "string", + "description": "Unique id of the owner this request belongs to", + "format": "uuid" + }, + "parentEventType": { + "type": "string", + "nullable": true + }, + "displayName": { + "type": "string", + "nullable": true + }, + "payRunPeriod": { + "type": "integer", + "format": "int32" + }, + "changeType": { + "type": "string", + "nullable": true + }, + "modifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldModification" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ChangeSummaryListReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChangeSummary" + }, + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Cis300": { + "type": "object", + "properties": { + "taxMonth": { + "type": "integer", + "format": "int32" + }, + "employeeCount": { + "type": "integer", + "format": "int32" + }, + "employmentStatusDeclaration": { + "type": "boolean" + }, + "verificationDeclaration": { + "type": "boolean" + }, + "informationCorrectDeclaration": { + "type": "boolean" + }, + "inactivityDeclaration": { + "type": "boolean" + }, + "cisReturn": { + "$ref": "#/components/schemas/CisReturn" + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "Cis300Declarations": { + "type": "object", + "properties": { + "employmentStatus": { + "type": "string", + "nullable": true + }, + "verification": { + "type": "string", + "nullable": true + }, + "informationCorrect": { + "type": "string", + "nullable": true + }, + "inactivity": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Cis300ReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/Cis300" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "CisContractor": { + "type": "object", + "properties": { + "utr": { + "type": "string", + "nullable": true + }, + "aOref": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to represent details of a CIS SubContractor when communicating with the HMRC Gateway" + }, + "CisDetails": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/CISSubContractorType" + }, + "utr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "tradingName": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "companyUtr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "companyNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRegistered": { + "type": "boolean" + }, + "vatNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRate": { + "type": "number", + "format": "double" + }, + "reverseChargeVAT": { + "type": "boolean" + }, + "verification": { + "$ref": "#/components/schemas/CisVerificationDetails" + } + }, + "additionalProperties": false, + "description": "If an Employee is marked as a CIS Subcontractor then this model provides further details specifically related to the CIS details of the Employee." + }, + "CisPartnership": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "utr": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "If an Employee is marked as a CIS Subcontractor and is registered as a Partnership then this model provides further details specifically related to the CIS Partnership." + }, + "CisRequest": { + "type": "object", + "properties": { + "contractor": { + "$ref": "#/components/schemas/CisContractor" + }, + "subcontractor": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CisSubContractor" + }, + "nullable": true + }, + "declaration": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CisReturn": { + "type": "object", + "properties": { + "contractor": { + "$ref": "#/components/schemas/CisContractor" + }, + "subcontractor": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CisSubContractor" + }, + "nullable": true + }, + "nilReturn": { + "type": "string", + "nullable": true + }, + "declarations": { + "$ref": "#/components/schemas/Cis300Declarations" + } + }, + "additionalProperties": false + }, + "CisStatement": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "taxMonth": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "contractorName": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "contractorAddress": { + "$ref": "#/components/schemas/Address" + }, + "contractorOfficeNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "contractorPayeReference": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "subcontractorName": { + "$ref": "#/components/schemas/RtiEmployeeName" + }, + "subContractorUtr": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "verificationNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "grossAmountPaid": { + "type": "number", + "description": "[readonly] Gross Amount Paid (Excl VAT)", + "format": "double" + }, + "costOfMaterials": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "amountLiableToDeduction": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "amountDeducted": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "amountPayable": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "CIS Payment and Deduction Statement (CISOL1)" + }, + "CisStatementListReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CisStatement" + }, + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "CisSubContractor": { + "type": "object", + "properties": { + "employeeUniqueId": { + "type": "string", + "format": "uuid" + }, + "emailStatementTo": { + "type": "string", + "nullable": true + }, + "numberOfPayments": { + "type": "integer", + "format": "int32" + }, + "item": { + "$ref": "#/components/schemas/Item" + }, + "displayName": { + "type": "string", + "nullable": true + }, + "action": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/RtiEmployeeName" + }, + "tradingName": { + "type": "string", + "nullable": true + }, + "worksRef": { + "type": "string", + "nullable": true + }, + "unmatchedRate": { + "type": "string", + "nullable": true + }, + "utr": { + "type": "string", + "nullable": true + }, + "crn": { + "type": "string", + "nullable": true + }, + "nino": { + "type": "string", + "nullable": true + }, + "partnership": { + "$ref": "#/components/schemas/CisPartnership" + }, + "address": { + "$ref": "#/components/schemas/RtiEmployeeAddress" + }, + "telephone": { + "type": "string", + "nullable": true + }, + "totalPaymentsUnrounded": { + "type": "string", + "nullable": true + }, + "costOfMaterialsUnrounded": { + "type": "string", + "nullable": true + }, + "umbrellaFee": { + "type": "string", + "nullable": true + }, + "validationMsg": { + "type": "string", + "nullable": true + }, + "verificationNumber": { + "type": "string", + "nullable": true + }, + "totalPayments": { + "type": "string", + "nullable": true + }, + "costOfMaterials": { + "type": "string", + "nullable": true + }, + "totalDeducted": { + "type": "string", + "nullable": true + }, + "matched": { + "type": "string", + "nullable": true + }, + "taxTreatment": { + "type": "string", + "nullable": true + }, + "netPayment": { + "type": "string", + "nullable": true + }, + "vatAmount": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CisSubContractorSummary": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "nullable": true + }, + "tradingName": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "niNumber": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/CISSubContractorType" + }, + "utr": { + "type": "string", + "nullable": true + }, + "taxStatus": { + "$ref": "#/components/schemas/CISTaxStatus" + }, + "verificationNumber": { + "type": "string", + "nullable": true + }, + "displayName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "validationMessage": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "" + }, + "CisSubContractorSummaryListReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CisSubContractorSummary" + }, + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "CisVerification": { + "type": "object", + "properties": { + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "nullable": true + }, + "employeeCount": { + "type": "integer", + "format": "int32" + }, + "cisRequest": { + "$ref": "#/components/schemas/CisRequest" + }, + "responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CisSubContractor" + }, + "nullable": true + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "If an Employee is marked as a CIS Subcontractor then this model is included ad a child of CisDetails and is used to represent the Verification details of the Subcontractor" + }, + "CisVerificationDetails": { + "type": "object", + "properties": { + "manuallyEntered": { + "type": "boolean" + }, + "matchInsteadOfVerify": { + "type": "boolean" + }, + "number": { + "type": "string", + "nullable": true + }, + "date": { + "type": "string", + "format": "date", + "nullable": true + }, + "taxStatus": { + "$ref": "#/components/schemas/CISTaxStatus" + }, + "verificationRequest": { + "type": "string", + "description": "[readonly] If a Verification request has been made for this employee then this will show its ID", + "format": "uuid", + "nullable": true + }, + "verificationResponse": { + "$ref": "#/components/schemas/CisSubContractor" + } + }, + "additionalProperties": false + }, + "Contract.Address": { + "type": "object", + "properties": { + "line1": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line2": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line3": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line4": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "line5": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "postCode": { + "maxLength": 10, + "type": "string", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country" + }, + "foreignCountry": { + "maxLength": 35, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AeAssessmentAction": { + "type": "object", + "properties": { + "action": { + "$ref": "#/components/schemas/AeAction" + }, + "employeeState": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "actionCompleted": { + "type": "boolean", + "description": "Indicates whether or not the required action was successfully completed" + }, + "actionCompletedMessage": { + "type": "string", + "description": "Gives further information about the action taken or the reason if wasn't successfully completed", + "nullable": true + }, + "requiredLetter": { + "$ref": "#/components/schemas/AeStatutoryLetter" + }, + "pensionSchemeId": { + "type": "string", + "description": "The PensionSchemeId that a completed action relates to", + "format": "uuid" + }, + "workerGroupId": { + "type": "string", + "description": "The WorkerGroupId that a completed action relates to", + "format": "uuid" + }, + "letterNotYetSent": { + "type": "boolean", + "description": "Indicates whether or not any required letter has been sent" + } + }, + "additionalProperties": false + }, + "Contract.AeAssessmentRequest": { + "type": "object", + "properties": { + "assessmentDate": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false, + "description": "As part of AutoEnrolment we assess your Employees to see if they need to be auto-enroled in a Pension.\r\nThis model shows the result of an assessment." + }, + "Contract.AeAssessmentResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique id of the object", + "format": "uuid" + }, + "employeeState": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "age": { + "type": "integer", + "description": "The age of the Employee at the time of the assessment", + "format": "int32" + }, + "ukWorker": { + "$ref": "#/components/schemas/AeUKWorker" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "The PaySchedule ordinal for the Employee at the time of the assessment", + "format": "int32" + }, + "earningsInPeriod": { + "type": "number", + "format": "double" + }, + "qualifyingEarningsInPeriod": { + "type": "number", + "format": "double" + }, + "aeExclusionCode": { + "$ref": "#/components/schemas/AeExclusionCode" + }, + "status": { + "$ref": "#/components/schemas/AeStatus" + }, + "reason": { + "type": "string", + "description": "The reason for determining the Status given.", + "nullable": true + }, + "action": { + "$ref": "#/components/schemas/Contract.AeAssessmentAction" + }, + "employee": { + "$ref": "#/components/schemas/Contract.EmployeeItem" + }, + "assessmentDate": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.AllowanceGradesRequest": { + "type": "object", + "properties": { + "allowanceGradePayslipText": { + "type": "string", + "description": "Alternative text for display on the payslip (i.e. TLR1A)", + "nullable": true + }, + "allowanceGradeAnnualValue": { + "type": "number", + "description": "FTE value of allowance grade", + "format": "double" + }, + "allowanceGradeEffectiveDate": { + "type": "string", + "description": "Effective date of the value", + "format": "date" + }, + "allowanceName": { + "type": "string", + "description": "Spine Allowance Name", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AllowanceGradesResponse": { + "type": "object", + "properties": { + "allowanceGradePayslipText": { + "type": "string", + "description": "Alternative text for display on the payslip (i.e. TLR1A)", + "nullable": true + }, + "allowanceGradeAnnualValue": { + "type": "number", + "description": "FTE value of allowance grade", + "format": "double" + }, + "allowanceGradeEffectiveDate": { + "type": "string", + "description": "Effective date of the value", + "format": "date" + }, + "uniqueId": { + "type": "string", + "description": "Spine Allowance identifier", + "format": "uuid" + }, + "allowanceName": { + "type": "string", + "description": "Spine Allowance Name", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AllowanceGradesUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Allowance Grades identifier", + "format": "uuid" + }, + "allowanceGradePayslipText": { + "type": "string", + "description": "Alternative text for display on the payslip (i.e. TLR1A)", + "nullable": true + }, + "allowanceGradeAnnualValue": { + "type": "number", + "description": "FTE value of allowance grade", + "format": "double" + }, + "allowanceGradeEffectiveDate": { + "type": "string", + "description": "Effective date of the value", + "format": "date" + }, + "allowanceName": { + "type": "string", + "description": "Spine Allowance Name", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AnalysisCategoryCodeRequest": { + "type": "object", + "properties": { + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "color": { + "type": "string", + "nullable": true + }, + "accountingCode": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AnalysisCategoryCodeResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Analysis Category Code identifier", + "format": "uuid" + }, + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "color": { + "type": "string", + "nullable": true + }, + "accountingCode": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AnalysisCategoryRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Analysis Category Name", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AnalysisCategoryResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Analysis Category identifier", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "Analysis Category Name", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.AutoEnrolmentRequest": { + "type": "object", + "properties": { + "lastAssessment": { + "$ref": "#/components/schemas/Contract.AeAssessmentRequest" + }, + "ukWorker": { + "$ref": "#/components/schemas/AeUKWorker" + }, + "daysToDeferAssessment": { + "type": "integer", + "description": "The number of days, if any, to defer assessment of this employee.\r\nYou're allowed to defer assessment of new employees by up to 3 months.", + "format": "int32" + }, + "deferByMonthsNotDays": { + "type": "boolean", + "description": "If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days" + }, + "exempt": { + "type": "boolean" + }, + "aeExclusionCode": { + "$ref": "#/components/schemas/AeExclusionCode" + }, + "aePostponementLetterSent": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.AutoEnrolmentResponse": { + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/AeEmployeeState" + }, + "stateDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "postponementDate": { + "type": "string", + "description": "[readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date.\r\nThis is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null\r\nThis is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not.", + "format": "date", + "nullable": true + }, + "lastAssessment": { + "$ref": "#/components/schemas/Contract.AeAssessmentResponse" + }, + "ukWorker": { + "$ref": "#/components/schemas/AeUKWorker" + }, + "daysToDeferAssessment": { + "type": "integer", + "description": "The number of days, if any, to defer assessment of this employee.\r\nYou're allowed to defer assessment of new employees by up to 3 months.", + "format": "int32" + }, + "deferByMonthsNotDays": { + "type": "boolean", + "description": "If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days" + }, + "exempt": { + "type": "boolean" + }, + "aeExclusionCode": { + "$ref": "#/components/schemas/AeExclusionCode" + }, + "aePostponementLetterSent": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.BankDetails": { + "type": "object", + "properties": { + "bankName": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "bankBranch": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "bankReference": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "accountName": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "accountNumber": { + "pattern": "^\\d{8}$", + "type": "string", + "nullable": true + }, + "sortCode": { + "pattern": "^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$", + "type": "string", + "nullable": true + }, + "note": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "buildingSocietyRollNumber": { + "maxLength": 18, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\s\\/\\.-]+$", + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.CisDetailsRequest": { + "type": "object", + "properties": { + "verification": { + "$ref": "#/components/schemas/Contract.CisVerificationDetailsRequest" + }, + "type": { + "$ref": "#/components/schemas/CISSubContractorType" + }, + "utr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "tradingName": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "companyUtr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "companyNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRegistered": { + "type": "boolean" + }, + "vatNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRate": { + "type": "number", + "format": "double" + }, + "reverseChargeVAT": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.CisDetailsResponse": { + "type": "object", + "properties": { + "verification": { + "$ref": "#/components/schemas/Contract.CisVerificationDetailsResponse" + }, + "type": { + "$ref": "#/components/schemas/CISSubContractorType" + }, + "utr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "tradingName": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "companyUtr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "companyNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRegistered": { + "type": "boolean" + }, + "vatNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "vatRate": { + "type": "number", + "format": "double" + }, + "reverseChargeVAT": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.CisPartnership": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "utr": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "If an Employee is marked as a CIS Subcontractor and is registered as a Partnership then this model provides further details specifically related to the CIS Partnership." + }, + "Contract.CisSubContractor": { + "type": "object", + "properties": { + "employeeUniqueId": { + "type": "string", + "format": "uuid" + }, + "emailStatementTo": { + "type": "string", + "nullable": true + }, + "numberOfPayments": { + "type": "integer", + "format": "int32" + }, + "item": { + "$ref": "#/components/schemas/Contract.CisSubContractorItem" + }, + "displayName": { + "type": "string", + "nullable": true + }, + "action": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/Contract.RtiEmployeeName" + }, + "tradingName": { + "type": "string", + "nullable": true + }, + "worksRef": { + "type": "string", + "nullable": true + }, + "unmatchedRate": { + "type": "string", + "nullable": true + }, + "utr": { + "type": "string", + "nullable": true + }, + "crn": { + "type": "string", + "nullable": true + }, + "nino": { + "type": "string", + "nullable": true + }, + "partnership": { + "$ref": "#/components/schemas/Contract.CisPartnership" + }, + "address": { + "$ref": "#/components/schemas/Contract.RtiEmployeeAddress" + }, + "telephone": { + "type": "string", + "nullable": true + }, + "totalPaymentsUnrounded": { + "type": "string", + "nullable": true + }, + "costOfMaterialsUnrounded": { + "type": "string", + "nullable": true + }, + "umbrellaFee": { + "type": "string", + "nullable": true + }, + "validationMsg": { + "type": "string", + "nullable": true + }, + "verificationNumber": { + "type": "string", + "nullable": true + }, + "totalPayments": { + "type": "string", + "nullable": true + }, + "costOfMaterials": { + "type": "string", + "nullable": true + }, + "totalDeducted": { + "type": "string", + "nullable": true + }, + "matched": { + "type": "string", + "nullable": true + }, + "taxTreatment": { + "type": "string", + "nullable": true + }, + "netPayment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.CisSubContractorItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.CisVerificationDetailsRequest": { + "type": "object", + "properties": { + "manuallyEntered": { + "type": "boolean" + }, + "matchInsteadOfVerify": { + "type": "boolean" + }, + "number": { + "type": "string", + "nullable": true + }, + "date": { + "type": "string", + "format": "date", + "nullable": true + }, + "taxStatus": { + "$ref": "#/components/schemas/CISTaxStatus" + }, + "verificationResponse": { + "$ref": "#/components/schemas/Contract.CisSubContractor" + } + }, + "additionalProperties": false + }, + "Contract.CisVerificationDetailsResponse": { + "type": "object", + "properties": { + "verificationRequest": { + "type": "string", + "description": "If a Verification request has been made for this employee then this will show its ID", + "format": "uuid", + "nullable": true + }, + "manuallyEntered": { + "type": "boolean" + }, + "matchInsteadOfVerify": { + "type": "boolean" + }, + "number": { + "type": "string", + "nullable": true + }, + "date": { + "type": "string", + "format": "date", + "nullable": true + }, + "taxStatus": { + "$ref": "#/components/schemas/CISTaxStatus" + }, + "verificationResponse": { + "$ref": "#/components/schemas/Contract.CisSubContractor" + } + }, + "additionalProperties": false + }, + "Contract.CostCentreJournalOverridesRequest": { + "type": "object", + "properties": { + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "CostCentre Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.CostCentreJournalOverridesResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Cost Centre Journal Overrides identifier", + "format": "uuid" + }, + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "CostCentre Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.CostCentreJournalOverridesResponseItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.CostCentreJournalOverridesUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique Id", + "format": "uuid" + }, + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "CostCentre Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.CreateEmployeeRequest": { + "type": "object", + "properties": { + "personalDetails": { + "$ref": "#/components/schemas/Contract.PersonalDetailsRequest" + }, + "employmentDetails": { + "$ref": "#/components/schemas/Contract.EmploymentDetailsRequest" + }, + "autoEnrolment": { + "$ref": "#/components/schemas/Contract.AutoEnrolmentRequest" + }, + "leaveSettings": { + "$ref": "#/components/schemas/Contract.LeaveSettingsRequest" + }, + "rightToWork": { + "$ref": "#/components/schemas/Contract.RightToWork" + }, + "bankDetails": { + "$ref": "#/components/schemas/Contract.BankDetails" + }, + "payOptions": { + "$ref": "#/components/schemas/Contract.PayOptionsRequest" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "holidaySchemeUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "evcId": { + "type": "string", + "description": "If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId.", + "format": "uuid", + "nullable": true + }, + "sourceSystemId": { + "maxLength": 50, + "type": "string", + "description": "Used by external systems so they can store an immutable reference.\r\nOnce this property is set it cannot be changed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.DepartmentJournalOverridesRequest": { + "type": "object", + "properties": { + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "Department Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.DepartmentJournalOverridesResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Department Journal Overrides identifier", + "format": "uuid" + }, + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "Department Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.DepartmentJournalOverridesResponseItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.DepartmentJournalOverridesUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique Id", + "format": "uuid" + }, + "tokenDescription": { + "type": "string", + "description": "Token Description", + "nullable": true + }, + "mapping": { + "type": "string", + "description": "Department Journal Overrides Mapping", + "nullable": true + }, + "journalTokenPublicId": { + "type": "string", + "description": "Journal Token Public Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.DepartmentRequest": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this Department" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Department" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Department, in hex format. ie 'ff0000'", + "nullable": true + }, + "accountingCode": { + "maxLength": 50, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.DepartmentResponse": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "employeeCount": { + "type": "integer", + "description": "The number of employees with this set as their primary department", + "format": "int32" + }, + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this Department" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Department" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Department, in hex format. ie 'ff0000'", + "nullable": true + }, + "accountingCode": { + "maxLength": 50, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.DirectorshipDetails": { + "type": "object", + "properties": { + "isDirector": { + "type": "boolean" + }, + "startDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "leaveDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "niAlternativeMethod": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.EmployeeItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmployeeResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique id of the object", + "format": "uuid" + }, + "personalDetails": { + "$ref": "#/components/schemas/Contract.PersonalDetailsResponse" + }, + "employmentDetails": { + "$ref": "#/components/schemas/Contract.EmploymentDetailsResponse" + }, + "autoEnrolment": { + "$ref": "#/components/schemas/Contract.AutoEnrolmentResponse" + }, + "leaveSettings": { + "$ref": "#/components/schemas/Contract.LeaveSettingsResponse" + }, + "rightToWork": { + "$ref": "#/components/schemas/Contract.RightToWork" + }, + "bankDetails": { + "$ref": "#/components/schemas/Contract.BankDetails" + }, + "payOptions": { + "$ref": "#/components/schemas/Contract.PayOptionsResponse" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/EmployeeStatus" + }, + "aeNotEnroledWarning": { + "type": "boolean" + }, + "sourceSystemId": { + "type": "string", + "nullable": true + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "holidaySchemeUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "evcId": { + "type": "string", + "description": "If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleAnalysisCategoryCodeRequest": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Analysis Category code", + "nullable": true + }, + "color": { + "type": "string", + "description": "Analysis Category code color", + "nullable": true + }, + "title": { + "type": "string", + "description": "Analysis Category code Title", + "nullable": true + }, + "weighting": { + "type": "number", + "description": "Weightage for analysis category code", + "format": "double" + }, + "analysisCategoryName": { + "type": "string", + "description": "Analysis category name for AnalysisCategory code", + "nullable": true + }, + "analysisCategoryPublicId": { + "type": "string", + "description": "Analysis category identifier", + "format": "uuid" + }, + "isPrimary": { + "type": "boolean", + "description": "Return whether Employee Role is primary for not" + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleAnalysisCategoryCodeResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Employee Role Analysis Category Code identifier", + "format": "uuid" + }, + "code": { + "type": "string", + "description": "Analysis Category code", + "nullable": true + }, + "color": { + "type": "string", + "description": "Analysis Category code color", + "nullable": true + }, + "title": { + "type": "string", + "description": "Analysis Category code Title", + "nullable": true + }, + "weighting": { + "type": "number", + "description": "Weightage for analysis category code", + "format": "double" + }, + "analysisCategoryName": { + "type": "string", + "description": "Analysis category name for AnalysisCategory code", + "nullable": true + }, + "analysisCategoryPublicId": { + "type": "string", + "description": "Analysis category identifier", + "format": "uuid" + }, + "isPrimary": { + "type": "boolean", + "description": "Return whether Employee Role is primary for not" + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "jobTitle": { + "type": "string", + "description": "Job Title of the Role", + "nullable": true + }, + "isPrimary": { + "type": "boolean", + "description": "Set to True if this is Primary role of the Employee" + }, + "reference": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/RoleBasis" + }, + "type": { + "$ref": "#/components/schemas/RoleType" + }, + "displayName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "payOptions": { + "$ref": "#/components/schemas/Contract.PayOptionsBaseResponse" + }, + "workingPattern": { + "$ref": "#/components/schemas/Contract.WorkingPatternResponse" + }, + "occupationalMaternityPolicyUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "occupationalSicknessPolicyUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleWorkingPatternRequest": { + "type": "object", + "properties": { + "effectiveFrom": { + "type": "string", + "description": "The date when the assignment of the Working Pattern becomes effective.", + "format": "date" + }, + "workingPatternUniqueId": { + "type": "string", + "description": "The UniqueId of the Working Pattern.", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleWorkingPatternResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "The UniqueId of the model.", + "format": "uuid" + }, + "effectiveTo": { + "type": "string", + "description": "[readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates.", + "format": "date" + }, + "workingPattern": { + "$ref": "#/components/schemas/Contract.WorkingPatternResponse" + }, + "effectiveFrom": { + "type": "string", + "description": "The date when the assignment of the Working Pattern becomes effective.", + "format": "date" + }, + "workingPatternUniqueId": { + "type": "string", + "description": "The UniqueId of the Working Pattern.", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.EmployeeRoleWorkingPatternResponseItem": { + "type": "object", + "properties": { + "workingPatternId": { + "type": "string", + "description": "The unique id of the working pattern.", + "format": "uuid" + }, + "effectiveFrom": { + "type": "string", + "description": "The date when the assignment of the Working Pattern becomes effective.", + "format": "date" + }, + "effectiveTo": { + "type": "string", + "description": "[readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates.", + "format": "date", + "nullable": true + }, + "totalHours": { + "type": "number", + "description": "[readonly] The amount of hours per working pattern.", + "format": "double" + }, + "contractedWeeks": { + "type": "number", + "description": "[readonly] The amount of weeks an employee works, utilise for employees who aren't working full time.\r\nIf Null then the default is used.", + "format": "double", + "nullable": true + }, + "title": { + "type": "string", + "description": "The title of the working pattern.", + "nullable": true + }, + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmployerBase": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "uniqueId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.EmploymentDetailsRequest": { + "required": [ + "payrollCode" + ], + "type": "object", + "properties": { + "cis": { + "$ref": "#/components/schemas/Contract.CisDetailsRequest" + }, + "department": { + "$ref": "#/components/schemas/Contract.DepartmentRequest" + }, + "cisSubContractor": { + "type": "boolean", + "description": "Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information" + }, + "payrollCode": { + "maxLength": 35, + "minLength": 1, + "type": "string", + "description": "The Employees Payroll Code. Must be unique within the Employer." + }, + "jobTitle": { + "maxLength": 120, + "type": "string", + "description": "Job Title of Primary role of the Employee", + "nullable": true + }, + "onHold": { + "type": "boolean", + "description": "Set to true to temporarily exclude the employee from payruns" + }, + "onFurlough": { + "type": "boolean", + "description": "Set to true if the employee is on furlough." + }, + "furloughStart": { + "type": "string", + "description": "Furlough Start Date.", + "format": "date", + "nullable": true + }, + "furloughEnd": { + "type": "string", + "description": "Furlough End Date.", + "format": "date", + "nullable": true + }, + "furloughCalculationBasis": { + "$ref": "#/components/schemas/FurloughCalculationBasis" + }, + "furloughCalculationBasisAmount": { + "type": "number", + "format": "double" + }, + "partialFurlough": { + "type": "boolean", + "description": "Set to true if the employee is partially furloughed." + }, + "furloughHoursNormallyWorked": { + "type": "number", + "format": "double" + }, + "furloughHoursOnFurlough": { + "type": "number", + "format": "double" + }, + "isApprentice": { + "type": "boolean", + "description": "Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage" + }, + "apprenticeshipStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "apprenticeshipEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "workingPattern": { + "type": "string", + "description": "Used when calculating payments for Leave.\r\nIf null then the default Working Pattern is used", + "format": "uuid", + "nullable": true + }, + "forcePreviousPayrollCode": { + "maxLength": 35, + "type": "string", + "description": "If this property has a non-empty value then a change of Payroll code will be declared on the next FPS.", + "nullable": true + }, + "starterDetails": { + "$ref": "#/components/schemas/Contract.StarterDetails" + }, + "directorshipDetails": { + "$ref": "#/components/schemas/Contract.DirectorshipDetails" + }, + "leaverDetails": { + "$ref": "#/components/schemas/Contract.LeaverDetails" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleItem" + }, + "description": "List of Roles held by Employee", + "nullable": true + }, + "isWorkingInFreePort": { + "type": "boolean", + "description": "Flag indicating the employee is employed in a Freeport" + }, + "isWorkingInInvestmentZone": { + "type": "boolean", + "description": "Flag indicating the employee is employed in an Investment Zone" + }, + "veteranDetails": { + "$ref": "#/components/schemas/Contract.VeteranDetails" + }, + "continuousEmploymentDate": { + "type": "string", + "description": "Date of continuous employment", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.EmploymentDetailsResponse": { + "required": [ + "payrollCode" + ], + "type": "object", + "properties": { + "cis": { + "$ref": "#/components/schemas/Contract.CisDetailsResponse" + }, + "department": { + "$ref": "#/components/schemas/Contract.DepartmentResponse" + }, + "includeSecondedInfoOnStarter": { + "type": "boolean" + }, + "cisSubContractor": { + "type": "boolean", + "description": "Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information" + }, + "payrollCode": { + "maxLength": 35, + "minLength": 1, + "type": "string", + "description": "The Employees Payroll Code. Must be unique within the Employer." + }, + "jobTitle": { + "maxLength": 120, + "type": "string", + "description": "Job Title of Primary role of the Employee", + "nullable": true + }, + "onHold": { + "type": "boolean", + "description": "Set to true to temporarily exclude the employee from payruns" + }, + "onFurlough": { + "type": "boolean", + "description": "Set to true if the employee is on furlough." + }, + "furloughStart": { + "type": "string", + "description": "Furlough Start Date.", + "format": "date", + "nullable": true + }, + "furloughEnd": { + "type": "string", + "description": "Furlough End Date.", + "format": "date", + "nullable": true + }, + "furloughCalculationBasis": { + "$ref": "#/components/schemas/FurloughCalculationBasis" + }, + "furloughCalculationBasisAmount": { + "type": "number", + "format": "double" + }, + "partialFurlough": { + "type": "boolean", + "description": "Set to true if the employee is partially furloughed." + }, + "furloughHoursNormallyWorked": { + "type": "number", + "format": "double" + }, + "furloughHoursOnFurlough": { + "type": "number", + "format": "double" + }, + "isApprentice": { + "type": "boolean", + "description": "Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage" + }, + "apprenticeshipStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "apprenticeshipEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "workingPattern": { + "type": "string", + "description": "Used when calculating payments for Leave.\r\nIf null then the default Working Pattern is used", + "format": "uuid", + "nullable": true + }, + "forcePreviousPayrollCode": { + "maxLength": 35, + "type": "string", + "description": "If this property has a non-empty value then a change of Payroll code will be declared on the next FPS.", + "nullable": true + }, + "starterDetails": { + "$ref": "#/components/schemas/Contract.StarterDetails" + }, + "directorshipDetails": { + "$ref": "#/components/schemas/Contract.DirectorshipDetails" + }, + "leaverDetails": { + "$ref": "#/components/schemas/Contract.LeaverDetails" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployeeRoleItem" + }, + "description": "List of Roles held by Employee", + "nullable": true + }, + "isWorkingInFreePort": { + "type": "boolean", + "description": "Flag indicating the employee is employed in a Freeport" + }, + "isWorkingInInvestmentZone": { + "type": "boolean", + "description": "Flag indicating the employee is employed in an Investment Zone" + }, + "veteranDetails": { + "$ref": "#/components/schemas/Contract.VeteranDetails" + }, + "continuousEmploymentDate": { + "type": "string", + "description": "Date of continuous employment", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.FpsFields": { + "type": "object", + "properties": { + "offPayrollWorker": { + "type": "boolean" + }, + "irregularPaymentPattern": { + "type": "boolean", + "description": "True if employee is currently on an irregular payment patter" + }, + "nonIndividual": { + "type": "boolean", + "description": "True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative)" + }, + "excludeFromRtiSubmissions": { + "type": "boolean", + "description": "True if Employee is excluded from RTI submissions" + }, + "hoursNormallyWorked": { + "$ref": "#/components/schemas/HoursNormallyWorked" + } + }, + "additionalProperties": false + }, + "Contract.GrossToNetReportRequest": { + "type": "object", + "properties": { + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "fromPeriod": { + "type": "integer", + "description": "The start Tax Month of report data.", + "format": "int32" + }, + "toPeriod": { + "type": "integer", + "description": "The end Tax Month of report data.", + "format": "int32" + }, + "reportFormat": { + "$ref": "#/components/schemas/ReportFormat" + }, + "sortBy": { + "$ref": "#/components/schemas/ReportSortBy" + }, + "sortDescending": { + "type": "boolean", + "description": "Defines whether to sort the data in descending order. Defaults to false." + }, + "ordinal": { + "type": "integer", + "description": "Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "forCis": { + "type": "boolean", + "description": "If true then CIS Subcontractors are reported on." + } + }, + "additionalProperties": false + }, + "Contract.HolidayEntitlementRequest": { + "type": "object", + "properties": { + "effectiveDate": { + "type": "string", + "description": "PaySpine Holiday Entitlement Effective Date\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "date", + "nullable": true + }, + "baseHolidayEntitlement": { + "type": "number", + "description": "PaySpine Base Holiday Entitlement\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "double" + }, + "yearsServiceEntitlementBasis": { + "$ref": "#/components/schemas/PaySpineYearsServiceEntitlementBasis" + }, + "yearsServiceEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.YearsServiceEntitlementRequest" + }, + "description": "Holiday Entitlement Years Service Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.HolidayEntitlementResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique identifier for the Holiday Entitlement", + "format": "uuid" + }, + "effectiveDate": { + "type": "string", + "description": "PaySpine Holiday Entitlement Effective Date\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "date", + "nullable": true + }, + "baseHolidayEntitlement": { + "type": "number", + "description": "PaySpine Base Holiday Entitlement\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "double" + }, + "yearsServiceEntitlementBasis": { + "$ref": "#/components/schemas/PaySpineYearsServiceEntitlementBasis" + }, + "yearsServiceEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.YearsServiceEntitlementResponse" + }, + "description": "Holiday Entitlement Years Service Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.HolidayEntitlementUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique identifier for the PaySpine Holiday Entitlement.", + "format": "uuid" + }, + "effectiveDate": { + "type": "string", + "description": "PaySpine Holiday Entitlement Effective Date\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "date", + "nullable": true + }, + "baseHolidayEntitlement": { + "type": "number", + "description": "PaySpine Base Holiday Entitlement\r\nIf UseSpineHolidayRules is true then this field is required", + "format": "double" + }, + "yearsServiceEntitlementBasis": { + "$ref": "#/components/schemas/PaySpineYearsServiceEntitlementBasis" + }, + "yearsServiceEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.YearsServiceEntitlementUpdateRequest" + }, + "description": "Holiday Entitlement Years Service Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.HolidaySchemeRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "minLength": 1, + "type": "string", + "description": "Holiday scheme name" + }, + "averageCalculationWeeks": { + "type": "integer", + "description": "The number of weeks that the average holiday pay calculation is to be calculated over (Default 52)", + "format": "int32" + }, + "useOnlyPaidWeeks": { + "type": "boolean", + "description": "If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True)" + }, + "ignoreSxp": { + "type": "boolean", + "description": "Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True)." + }, + "calculationDurationUnit": { + "$ref": "#/components/schemas/HolidaySchemeDurationType" + }, + "useNiPay": { + "type": "boolean", + "description": "If use National insurance gross taxable pay. (Default - True)." + }, + "useWorkingPattern": { + "type": "boolean", + "description": "If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate." + }, + "payCodeSetForPayId": { + "type": "string", + "description": "the Paycode set that they want to use for the Values to enable the calculation.", + "format": "uuid", + "nullable": true + }, + "payCodeSetForHoursId": { + "type": "string", + "description": "the Paycode set that they want to use for the Hours to enable the calculation.", + "format": "uuid", + "nullable": true + }, + "useFallbackRate": { + "type": "boolean", + "description": "Indicates to use employee base hourly rate where the calculated average hourly rate is less" + } + }, + "additionalProperties": false + }, + "Contract.HolidaySchemeResponse": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Holiday scheme identifier", + "format": "uuid" + }, + "name": { + "minLength": 1, + "type": "string", + "description": "Holiday scheme name" + }, + "averageCalculationWeeks": { + "type": "integer", + "description": "The number of weeks that the average holiday pay calculation is to be calculated over (Default 52)", + "format": "int32" + }, + "useOnlyPaidWeeks": { + "type": "boolean", + "description": "If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True)" + }, + "ignoreSxp": { + "type": "boolean", + "description": "Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True)." + }, + "calculationDurationUnit": { + "$ref": "#/components/schemas/HolidaySchemeDurationType" + }, + "useNiPay": { + "type": "boolean", + "description": "If use National insurance gross taxable pay. (Default - True)." + }, + "useWorkingPattern": { + "type": "boolean", + "description": "If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate." + }, + "payCodeSetForPayId": { + "type": "string", + "description": "the Paycode set that they want to use for the Values to enable the calculation.", + "format": "uuid", + "nullable": true + }, + "payCodeSetForHoursId": { + "type": "string", + "description": "the Paycode set that they want to use for the Hours to enable the calculation.", + "format": "uuid", + "nullable": true + }, + "useFallbackRate": { + "type": "boolean", + "description": "Indicates to use employee base hourly rate where the calculated average hourly rate is less" + } + }, + "additionalProperties": false + }, + "Contract.JobErrorResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the job error.", + "format": "uuid" + }, + "jobId": { + "type": "string", + "description": "Job public Id", + "format": "uuid" + }, + "errorMessage": { + "type": "string", + "description": "Error Message", + "nullable": true + }, + "errorType": { + "type": "string", + "description": "Type of job error", + "nullable": true + }, + "createdDate": { + "type": "string", + "description": "Date the job error was created", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.JobResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Job public Id.", + "format": "uuid" + }, + "employerId": { + "type": "string", + "description": "Employer public Id.", + "format": "uuid" + }, + "employerName": { + "type": "string", + "description": "Employer name.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/JobType" + }, + "name": { + "type": "string", + "description": "The Job name, e.g. uploaded file for Import, or report display name for Report", + "nullable": true + }, + "outputFormat": { + "type": "string", + "description": "The Job output format, e.g. json/csv/pdf for Report, or something else for other Job types.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + }, + "executionStartTime": { + "type": "string", + "description": "The Job excution start time.", + "format": "date", + "nullable": true + }, + "timeInQueue": { + "type": "integer", + "description": "The time the Job spent in the queue before execution in seconds.", + "format": "int32", + "nullable": true + }, + "executionTime": { + "type": "integer", + "description": "The time it took the Job to execute in seconds.", + "format": "int32", + "nullable": true + }, + "result": { + "$ref": "#/components/schemas/Contract.JobResultResponse" + }, + "createdDate": { + "type": "string", + "description": "Job Created date.", + "format": "date" + }, + "updatedDate": { + "type": "string", + "description": "Job Updated date where applicable.", + "format": "date", + "nullable": true + }, + "requestedByName": { + "type": "string", + "description": "The name of the user that requested this job", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.JobResultFileResponse": { + "type": "object", + "properties": { + "fileName": { + "type": "string", + "description": "Result File name", + "nullable": true + }, + "uri": { + "type": "string", + "description": "Api method URI that can be used to download the result file", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.JobResultResponse": { + "type": "object", + "properties": { + "file": { + "$ref": "#/components/schemas/Contract.JobResultFileResponse" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "nullable": true + }, + "description": "Job result metadata, e.g. Employee Import stats", + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Job execution's errors.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.JournalTemplateRequest": { + "type": "object", + "properties": { + "header": { + "type": "string", + "description": "Header of Journal Template", + "nullable": true + }, + "content": { + "type": "string", + "description": "Content of Journal Template", + "nullable": true + }, + "useColumnHeaders": { + "type": "boolean", + "description": "Indicates whether content is empty or not" + } + }, + "additionalProperties": false + }, + "Contract.JournalTemplateResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Journal Template identifier", + "format": "uuid" + }, + "header": { + "type": "string", + "description": "Header of Journal Template", + "nullable": true + }, + "content": { + "type": "string", + "description": "Content of Journal Template", + "nullable": true + }, + "useColumnHeaders": { + "type": "boolean", + "description": "Indicates whether content is empty or not" + } + }, + "additionalProperties": false + }, + "Contract.JournalTokenRequest": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/JournalTokenType" + }, + "name": { + "type": "string", + "description": "Name of Journal Tokens", + "nullable": true + }, + "description": { + "type": "string", + "description": "Description of Journal Tokens", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.JournalTokenResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Journal Token identifier", + "format": "uuid" + }, + "type": { + "$ref": "#/components/schemas/JournalTokenType" + }, + "name": { + "type": "string", + "description": "Name of Journal Tokens", + "nullable": true + }, + "description": { + "type": "string", + "description": "Description of Journal Tokens", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.JournalTokenResponseItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.LeaveImportRequest": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "description": "Payroll Code", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/LeaveType" + }, + "pay": { + "$ref": "#/components/schemas/LeavePayType" + }, + "openEndedAbsence": { + "type": "boolean", + "description": "Open Ended Absence" + }, + "from": { + "type": "string", + "description": "The first day of Leave.", + "format": "date", + "nullable": true + }, + "to": { + "type": "string", + "description": "The last day of Leave.", + "format": "date", + "nullable": true + }, + "historicLeaveRequiresProcessing": { + "type": "boolean", + "description": "Only used during the creation of historical SSP.\r\nWhen creating historical SSP, this will determine whether to pay that leave in the next PayRun." + }, + "averageWeeklyEarnings": { + "type": "number", + "description": "The employees average weekly earnings.", + "format": "double", + "nullable": true + }, + "automaticAWECalculation": { + "type": "boolean", + "description": "Automatic Average Weekly Earnings." + }, + "offsetPay": { + "type": "boolean", + "description": "Top-up pay to usual amongst (offsetting)" + }, + "calculationType": { + "$ref": "#/components/schemas/LeaveCalculationType" + }, + "percentOfPay": { + "type": "number", + "description": "Only provided when the leave type is 'Sick' and the payment type is 'Custom'.", + "format": "double", + "nullable": true + }, + "strikeHoursToDeduct": { + "type": "number", + "description": "Only provided when the leave type is 'StrikeAction' and the calculation type is 'SpecifyHours'.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.LeaveSettingsRequest": { + "type": "object", + "properties": { + "useDefaultHolidayType": { + "type": "boolean", + "description": "If true then the value for HolidayType comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowanceResetDate": { + "type": "boolean", + "description": "If true then the value for the AllowanceResetDate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowance": { + "type": "boolean", + "description": "If true then the value for the Allowance comes from the Employer record.\r\nThis property only appears if the LeaveSettings if a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieu": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuRate": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieuRate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuAllGrossPay": { + "type": "boolean", + "description": "[Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead.\r\nThis filed will be removed in a later release.", + "deprecated": true + }, + "useDefaultHolidayAccrualBasis": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualBasis comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)", + "nullable": true + }, + "useDefaultAccruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccrueHoursPerDay": { + "type": "boolean", + "description": "If true then the value for AccrueHoursPerDay comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultMaximumAccruePeriod": { + "type": "boolean", + "description": "If true then the value for MaximumAccruePeriod comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "allowanceResetDate": { + "type": "string", + "description": "The date that the holiday allowance resets. Only the day/month part of the value is relevant.", + "format": "date" + }, + "allowance": { + "type": "number", + "description": "The number of days holiday an employee can take per year if HolidayType is Days.\r\nOtherwise this is readonly and gives you the number of days accrued since the last reset", + "format": "double" + }, + "adjustment": { + "type": "number", + "description": "Adjustment to number of hours/days/weeks holiday this employee can take per year.\r\nWill reset to 0 when the Allowance resets.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)", + "format": "double", + "nullable": true + }, + "holidayType": { + "$ref": "#/components/schemas/HolidayType" + }, + "accrueSetAmount": { + "type": "boolean", + "description": "If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked." + }, + "accrueHoursPerDay": { + "type": "number", + "description": "If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued", + "format": "double" + }, + "showAllowanceOnPayslip": { + "type": "boolean", + "description": "If true then the remaining Allowance will be shown on the employees payslip." + }, + "showAhpOnPayslip": { + "type": "boolean", + "description": "If true then the AHP balance will be shown on the employees payslip." + }, + "accruePaymentInLieuRate": { + "type": "number", + "description": "The rate at which Payments in Lieu acrrue. Typically this should be 12.07%.", + "format": "double" + }, + "accruePaymentInLieuAllGrossPay": { + "type": "boolean", + "description": "[Deprecated] Please use HolidayAccrualBasis instead.\r\nThis filed will be removed in a later release.", + "deprecated": true + }, + "accruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "Set to true if you want employees to be automatically paid any outstanding holiday pay" + }, + "occupationalSicknessUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "accruedPaymentAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total accrued", + "format": "double" + }, + "accruedHoursAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total hours accrued", + "format": "double" + }, + "holidayAccrualBasis": { + "$ref": "#/components/schemas/HolidayAccrual" + }, + "holidayAccrualDefaultRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "useAggregatedServiceDate": { + "type": "boolean" + }, + "accruePayCodeSetUniqueId": { + "type": "string", + "description": "Pay code set to use for accruing holiday pay", + "format": "uuid", + "nullable": true + }, + "maximumAccruePeriod": { + "type": "number", + "description": "The maximum number of hours capable of being accrued in a single period", + "format": "double", + "nullable": true + }, + "holidayLeaveAccrualCustomRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "useDefaultHolidayAccrualDefaultRateType": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualDefaultRateType comes from the Employer record.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.LeaveSettingsResponse": { + "type": "object", + "properties": { + "allowanceUsed": { + "type": "number", + "description": "[readonly] The number of days used from the allowance since last reset", + "format": "double" + }, + "allowanceUsedPreviousPeriod": { + "type": "number", + "description": "[readonly] The number of days used in the 12 months prior to the last reset", + "format": "double" + }, + "allowanceRemaining": { + "type": "number", + "description": "[readonly] The number of days remaining of the allowance until next reset", + "format": "double", + "readOnly": true + }, + "accruedPaymentLiability": { + "type": "number", + "description": "[readonly] The total accrued payments for this employee over the lifetime of their employment so far", + "format": "double" + }, + "accruedPaymentPaid": { + "type": "number", + "description": "[readonly] The Total amount paid to this employee in lieu of holidays", + "format": "double" + }, + "accruedPaymentBalance": { + "type": "number", + "description": "[readonly] The balance of what is owed to this employee in lieu of holidays", + "format": "double" + }, + "accruedHoursAmount": { + "type": "number", + "description": "[readonly] The total accrued hours for this employee over the lifetime of their employment so far", + "format": "double" + }, + "accruedHoursPaid": { + "type": "number", + "description": "[readonly] The Total amount of hours paid to this employee in lieu of holidays", + "format": "double" + }, + "accruedHoursBalance": { + "type": "number", + "description": "[readonly] The balance of hours owed to this employee in lieu of holidays", + "format": "double", + "readOnly": true + }, + "useDefaultHolidayType": { + "type": "boolean", + "description": "If true then the value for HolidayType comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowanceResetDate": { + "type": "boolean", + "description": "If true then the value for the AllowanceResetDate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowance": { + "type": "boolean", + "description": "If true then the value for the Allowance comes from the Employer record.\r\nThis property only appears if the LeaveSettings if a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieu": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuRate": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieuRate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuAllGrossPay": { + "type": "boolean", + "description": "[Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead.\r\nThis filed will be removed in a later release.", + "deprecated": true + }, + "useDefaultHolidayAccrualBasis": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualBasis comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)", + "nullable": true + }, + "useDefaultAccruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccrueHoursPerDay": { + "type": "boolean", + "description": "If true then the value for AccrueHoursPerDay comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultMaximumAccruePeriod": { + "type": "boolean", + "description": "If true then the value for MaximumAccruePeriod comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "allowanceResetDate": { + "type": "string", + "description": "The date that the holiday allowance resets. Only the day/month part of the value is relevant.", + "format": "date" + }, + "allowance": { + "type": "number", + "description": "The number of days holiday an employee can take per year if HolidayType is Days.\r\nOtherwise this is readonly and gives you the number of days accrued since the last reset", + "format": "double" + }, + "adjustment": { + "type": "number", + "description": "Adjustment to number of hours/days/weeks holiday this employee can take per year.\r\nWill reset to 0 when the Allowance resets.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)", + "format": "double", + "nullable": true + }, + "holidayType": { + "$ref": "#/components/schemas/HolidayType" + }, + "accrueSetAmount": { + "type": "boolean", + "description": "If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked." + }, + "accrueHoursPerDay": { + "type": "number", + "description": "If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued", + "format": "double" + }, + "showAllowanceOnPayslip": { + "type": "boolean", + "description": "If true then the remaining Allowance will be shown on the employees payslip." + }, + "showAhpOnPayslip": { + "type": "boolean", + "description": "If true then the AHP balance will be shown on the employees payslip." + }, + "accruePaymentInLieuRate": { + "type": "number", + "description": "The rate at which Payments in Lieu acrrue. Typically this should be 12.07%.", + "format": "double" + }, + "accruePaymentInLieuAllGrossPay": { + "type": "boolean", + "description": "[Deprecated] Please use HolidayAccrualBasis instead.\r\nThis filed will be removed in a later release.", + "deprecated": true + }, + "accruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "Set to true if you want employees to be automatically paid any outstanding holiday pay" + }, + "occupationalSicknessUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "accruedPaymentAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total accrued", + "format": "double" + }, + "accruedHoursAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total hours accrued", + "format": "double" + }, + "holidayAccrualBasis": { + "$ref": "#/components/schemas/HolidayAccrual" + }, + "holidayAccrualDefaultRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "useAggregatedServiceDate": { + "type": "boolean" + }, + "accruePayCodeSetUniqueId": { + "type": "string", + "description": "Pay code set to use for accruing holiday pay", + "format": "uuid", + "nullable": true + }, + "maximumAccruePeriod": { + "type": "number", + "description": "The maximum number of hours capable of being accrued in a single period", + "format": "double", + "nullable": true + }, + "holidayLeaveAccrualCustomRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "useDefaultHolidayAccrualDefaultRateType": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualDefaultRateType comes from the Employer record.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.LeaverDetails": { + "type": "object", + "properties": { + "hasLeft": { + "type": "boolean" + }, + "leaveDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "isDeceased": { + "type": "boolean" + }, + "paymentAfterLeaving": { + "type": "boolean" + }, + "p45Sent": { + "type": "boolean" + }, + "payAccruedBalance": { + "type": "boolean", + "description": "If set to true then new PayLine will be added into the PayRunEntry to pay the accrued balance" + }, + "paymentMethodAfterLeaving": { + "$ref": "#/components/schemas/PaymentMethodAfterLeaving" + } + }, + "additionalProperties": false + }, + "Contract.LondonAllowanceRequest": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/LondonAllowanceType" + }, + "valueType": { + "$ref": "#/components/schemas/LondonAllowanceValueType" + }, + "value": { + "type": "number", + "description": "Value of London Allowance", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.LondonAllowanceResponse": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/LondonAllowanceType" + }, + "valueType": { + "$ref": "#/components/schemas/LondonAllowanceValueType" + }, + "value": { + "type": "number", + "description": "Value of London Allowance", + "format": "double" + }, + "uniqueId": { + "type": "string", + "description": "London Allowance identifier", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.NetOfOnCostsResponse": { + "type": "object", + "properties": { + "salary": { + "type": "number", + "format": "double" + }, + "holidayPay": { + "type": "number", + "format": "double" + }, + "employersPensionContribution": { + "type": "number", + "format": "double" + }, + "employeesPensionContribution": { + "type": "number", + "format": "double" + }, + "employersNi": { + "type": "number", + "format": "double" + }, + "apprenticeshipLevy": { + "type": "number", + "format": "double" + }, + "grossDailyRate": { + "type": "number", + "format": "double" + }, + "totalFees": { + "type": "number", + "format": "double" + }, + "numberOfDays": { + "type": "number", + "format": "double" + }, + "simulation": { + "$ref": "#/components/schemas/Contract.NetOfOnCostsSimulationResponse" + }, + "holInclusiveSimulation": { + "$ref": "#/components/schemas/Contract.NetOfOnCostsSimulationResponse" + } + }, + "additionalProperties": false + }, + "Contract.NetOfOnCostsSimulationResponse": { + "type": "object", + "properties": { + "grossPay": { + "type": "number", + "format": "double" + }, + "employeePension": { + "type": "number", + "format": "double" + }, + "taxDue": { + "type": "number", + "format": "double" + }, + "niDue": { + "type": "number", + "format": "double" + }, + "netPay": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "Contract.OverseasEmployerDetails": { + "type": "object", + "properties": { + "overseasEmployer": { + "type": "boolean" + }, + "overseasSecondmentStatus": { + "$ref": "#/components/schemas/OverseasSecondmentStatus" + }, + "eeaCitizen": { + "type": "boolean" + }, + "epm6Scheme": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Contract.P11HistoryRequest": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "periodNumber": { + "type": "integer", + "format": "int32" + }, + "niablePay": { + "type": "number", + "format": "double" + }, + "payDate": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.P11HistoryResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "periodNumber": { + "type": "integer", + "format": "int32" + }, + "niablePay": { + "type": "number", + "format": "double" + }, + "payDate": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.PartnerDetails": { + "type": "object", + "properties": { + "firstName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "initials": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "niNumber": { + "maxLength": 15, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PayHistoryRequest": { + "type": "object", + "properties": { + "employeeId": { + "type": "string", + "description": "Employee unique Id", + "format": "uuid" + }, + "employeeRoleId": { + "type": "string", + "description": "Employee role unique Id", + "format": "uuid" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYearTypes" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriodTypes" + }, + "periodNumber": { + "type": "integer", + "description": "Tax Week or Tax Month number this PayRunEntry relates to", + "format": "int32" + }, + "payAmount": { + "type": "number", + "description": "monetary amount for given period, if not provided then 0", + "format": "double" + }, + "hours": { + "type": "number", + "description": "decimal amount of hours worked, if not provided then 0", + "format": "double" + }, + "isStatutoryPayOnly": { + "type": "boolean", + "description": "optional boolean flag, if the period only had SXP present" + }, + "paymentDate": { + "type": "string", + "description": "The date payment was made for respective period", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.PayHistoryResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Average Holiday Pay History identifier", + "format": "uuid" + }, + "employeeId": { + "type": "string", + "description": "Employee unique Id", + "format": "uuid" + }, + "employeeRoleId": { + "type": "string", + "description": "Employee role unique Id", + "format": "uuid" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYearTypes" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriodTypes" + }, + "periodNumber": { + "type": "integer", + "description": "Tax Week or Tax Month number this PayRunEntry relates to", + "format": "int32" + }, + "payAmount": { + "type": "number", + "description": "monetary amount for given period, if not provided then 0", + "format": "double" + }, + "hours": { + "type": "number", + "description": "decimal amount of hours worked, if not provided then 0", + "format": "double" + }, + "isStatutoryPayOnly": { + "type": "boolean", + "description": "optional boolean flag, if the period only had SXP present" + }, + "paymentDate": { + "type": "string", + "description": "The date payment was made for respective period", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.PayHistoryUpdateRequest": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Average Holiday Pay History identifier", + "format": "uuid" + }, + "employeeId": { + "type": "string", + "description": "Employee unique Id", + "format": "uuid" + }, + "employeeRoleId": { + "type": "string", + "description": "Employee role unique Id", + "format": "uuid" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYearTypes" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriodTypes" + }, + "periodNumber": { + "type": "integer", + "description": "Tax Week or Tax Month number this PayRunEntry relates to", + "format": "int32" + }, + "payAmount": { + "type": "number", + "description": "monetary amount for given period, if not provided then 0", + "format": "double" + }, + "hours": { + "type": "number", + "description": "decimal amount of hours worked, if not provided then 0", + "format": "double" + }, + "isStatutoryPayOnly": { + "type": "boolean", + "description": "optional boolean flag, if the period only had SXP present" + }, + "paymentDate": { + "type": "string", + "description": "The date payment was made for respective period", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.PayLineRequest": { + "type": "object", + "properties": { + "analysisCategoryCodesJson": { + "type": "string", + "description": "Analysis category id and analysiscategoryCode json", + "nullable": true + }, + "value": { + "type": "number", + "description": "The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used).\r\nIf the PayCode has a CalculationType other than FixedAmount then this field will be a percentage.\r\nIf the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated.", + "format": "double" + }, + "rate": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used", + "format": "double", + "nullable": true + }, + "multiplier": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours", + "format": "double", + "nullable": true + }, + "description": { + "maxLength": 100, + "type": "string", + "description": "A freeform description to accompany this line. It will be displayed on the payslip.", + "nullable": true + }, + "code": { + "type": "string", + "description": "The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition.", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "childId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "isNetToGross": { + "type": "boolean", + "description": "If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target." + }, + "targetNetToGrossValue": { + "type": "number", + "description": "The orginal net fixed addition amount that is considered to be a take home pay target.", + "format": "double", + "nullable": true + }, + "netToGrossDiscrepancy": { + "type": "number", + "description": "The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation.", + "format": "double", + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "description": "The date the payline starts being calculated in payrun", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "description": "The date the payline stops being calculated in payrun", + "format": "date", + "nullable": true + }, + "isAutoGeneratedBasicPayLine": { + "type": "boolean" + }, + "percentageOfEffectiveDays": { + "type": "number", + "description": "The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun", + "format": "double", + "nullable": true + }, + "totalWorkingDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "isAutomaticBackPay": { + "type": "boolean", + "description": "Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created.\r\nApplicable only to employee level addition/deduction pay lines.\r\nIf set to false then you must manually handle the calculation and adding of backpay lines." + }, + "ignoreInitialBackPay": { + "type": "boolean", + "description": "Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology.\r\nIf set to false, the automatic backpay calculation will be performed on the first pay run." + }, + "contributesToBasicPay": { + "type": "boolean", + "description": "Indicates whether this PayLine contributes to the basic pay of the Employee." + }, + "calculateAsWhenPaid": { + "type": "boolean", + "description": "Indicates whether this pay line should be treated as When Paid rather than When Earned" + }, + "totalPaidDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "The employee role which is associated with this pay line.\r\nIf set to null, the pay line is not related with a role.", + "format": "uuid", + "nullable": true + }, + "earnedFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "earnedTo": { + "type": "string", + "format": "date", + "nullable": true + }, + "annualValue": { + "type": "number", + "description": "The original value from the PayLine before we modify it\r\nCurrently only used when CalculationType is set to FixedAnnualAmount\r\nso we can determine whether the payline value needs calculating or not\r\nTo recalculate set to null with annual amount recorded in Value", + "format": "double", + "nullable": true + }, + "department": { + "type": "string", + "description": "Department code which we want to override in payline", + "nullable": true + }, + "costCentre": { + "type": "string", + "description": "CostCentre code which we want to override in payline", + "nullable": true + }, + "departmentId": { + "type": "string", + "description": "Department uniqueId which we want to override in payline", + "format": "uuid", + "nullable": true + }, + "costCentreId": { + "type": "string", + "description": "CostCentre uniqueId which we want to override in payline", + "format": "uuid", + "nullable": true + }, + "analysisCategoriesCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaylineAnalysisCategoriesCodes" + }, + "description": "List of analysiscategory id and analysiscategoryCode id", + "nullable": true + }, + "analysisCategoryCodeIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Array of analysiscategoryCode uniqueId", + "nullable": true + }, + "paySpineId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine.", + "format": "uuid", + "nullable": true + }, + "paySpineGradeId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine grade.", + "format": "uuid", + "nullable": true + }, + "spinalPointId": { + "type": "string", + "description": "[readonly] The Id of the associated spinal point.", + "format": "uuid", + "nullable": true + }, + "londonAllowanceId": { + "type": "integer", + "description": "Used to set London allowance id for payline", + "format": "int32", + "nullable": true + }, + "fullTimeAnnualValue": { + "type": "number", + "description": "Used to set Full Time Annual Value for payline", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.PayLineResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "attachmentOrderId": { + "type": "string", + "description": "[readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO", + "format": "uuid", + "nullable": true + }, + "pensionId": { + "type": "string", + "description": "[readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS", + "format": "uuid", + "nullable": true + }, + "leaveId": { + "type": "string", + "description": "[readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay", + "format": "uuid", + "nullable": true + }, + "loanId": { + "type": "string", + "description": "[readonly] The Id of the associated Loan, if any.", + "format": "uuid", + "nullable": true + }, + "leaveStatutoryDaysPaid": { + "type": "number", + "description": "[readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern).", + "format": "double", + "nullable": true + }, + "leaveStatutoryWeeksPaid": { + "type": "number", + "description": "[readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern).", + "format": "double", + "nullable": true + }, + "initialBackPayPublicPayRunId": { + "type": "string", + "description": "[readonly] Used to mark the first payrun where this payline has been payrolled for backpay", + "format": "uuid", + "nullable": true + }, + "value": { + "type": "number", + "description": "The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used).\r\nIf the PayCode has a CalculationType other than FixedAmount then this field will be a percentage.\r\nIf the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated.", + "format": "double" + }, + "rate": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used", + "format": "double", + "nullable": true + }, + "multiplier": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours", + "format": "double", + "nullable": true + }, + "description": { + "maxLength": 100, + "type": "string", + "description": "A freeform description to accompany this line. It will be displayed on the payslip.", + "nullable": true + }, + "code": { + "type": "string", + "description": "The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition.", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "childId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "isNetToGross": { + "type": "boolean", + "description": "If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target." + }, + "targetNetToGrossValue": { + "type": "number", + "description": "The orginal net fixed addition amount that is considered to be a take home pay target.", + "format": "double", + "nullable": true + }, + "netToGrossDiscrepancy": { + "type": "number", + "description": "The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation.", + "format": "double", + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "description": "The date the payline starts being calculated in payrun", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "description": "The date the payline stops being calculated in payrun", + "format": "date", + "nullable": true + }, + "isAutoGeneratedBasicPayLine": { + "type": "boolean" + }, + "percentageOfEffectiveDays": { + "type": "number", + "description": "The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun", + "format": "double", + "nullable": true + }, + "totalWorkingDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "isAutomaticBackPay": { + "type": "boolean", + "description": "Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created.\r\nApplicable only to employee level addition/deduction pay lines.\r\nIf set to false then you must manually handle the calculation and adding of backpay lines." + }, + "ignoreInitialBackPay": { + "type": "boolean", + "description": "Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology.\r\nIf set to false, the automatic backpay calculation will be performed on the first pay run." + }, + "contributesToBasicPay": { + "type": "boolean", + "description": "Indicates whether this PayLine contributes to the basic pay of the Employee." + }, + "calculateAsWhenPaid": { + "type": "boolean", + "description": "Indicates whether this pay line should be treated as When Paid rather than When Earned" + }, + "totalPaidDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "The employee role which is associated with this pay line.\r\nIf set to null, the pay line is not related with a role.", + "format": "uuid", + "nullable": true + }, + "earnedFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "earnedTo": { + "type": "string", + "format": "date", + "nullable": true + }, + "annualValue": { + "type": "number", + "description": "The original value from the PayLine before we modify it\r\nCurrently only used when CalculationType is set to FixedAnnualAmount\r\nso we can determine whether the payline value needs calculating or not\r\nTo recalculate set to null with annual amount recorded in Value", + "format": "double", + "nullable": true + }, + "department": { + "type": "string", + "description": "Department code which we want to override in payline", + "nullable": true + }, + "costCentre": { + "type": "string", + "description": "CostCentre code which we want to override in payline", + "nullable": true + }, + "departmentId": { + "type": "string", + "description": "Department uniqueId which we want to override in payline", + "format": "uuid", + "nullable": true + }, + "costCentreId": { + "type": "string", + "description": "CostCentre uniqueId which we want to override in payline", + "format": "uuid", + "nullable": true + }, + "analysisCategoriesCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaylineAnalysisCategoriesCodes" + }, + "description": "List of analysiscategory id and analysiscategoryCode id", + "nullable": true + }, + "analysisCategoryCodeIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Array of analysiscategoryCode uniqueId", + "nullable": true + }, + "paySpineId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine.", + "format": "uuid", + "nullable": true + }, + "paySpineGradeId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine grade.", + "format": "uuid", + "nullable": true + }, + "spinalPointId": { + "type": "string", + "description": "[readonly] The Id of the associated spinal point.", + "format": "uuid", + "nullable": true + }, + "londonAllowanceId": { + "type": "integer", + "description": "Used to set London allowance id for payline", + "format": "int32", + "nullable": true + }, + "fullTimeAnnualValue": { + "type": "number", + "description": "Used to set Full Time Annual Value for payline", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.PayOptionsBaseResponse": { + "type": "object", + "properties": { + "regularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayLineResponse" + }, + "description": "These are used to make additions/deductions to the pay for this Employee.\r\nYou do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created.", + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "nationalMinimumWage": { + "type": "boolean" + }, + "payCode": { + "type": "string", + "description": "If you want the Employees pay to be allocated to a code other than BASIC, specify it here", + "nullable": true + }, + "mileageVehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "mapsMiles": { + "type": "integer", + "description": "The number of miles to pay for as Mileage Allowance Payments", + "format": "int32", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "niTable": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Contract.PayOptionsImportRequest": { + "type": "object", + "properties": { + "analysisCategoriesCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaylineAnalysisCategoriesCodes" + }, + "nullable": true + }, + "autoAdjustForLeave": { + "type": "boolean" + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "contributesToBasicPay": { + "type": "boolean" + }, + "costCentre": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "format": "date", + "nullable": true + }, + "employerIdentifier": { + "type": "string", + "nullable": true + }, + "ignoreInitialBackPay": { + "type": "boolean" + }, + "isAutomaticBackPay": { + "type": "boolean" + }, + "isNetToGross": { + "type": "boolean" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaylineRequest" + }, + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + }, + "payAmount": { + "type": "number", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "format": "double" + }, + "payCode": { + "type": "string", + "nullable": true + }, + "payGrade": { + "type": "string", + "nullable": true + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "paySpine": { + "type": "string", + "nullable": true + }, + "roleReference": { + "type": "string", + "nullable": true + }, + "spinePoint": { + "type": "string", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PayOptionsRequest": { + "type": "object", + "properties": { + "regularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayLineRequest" + }, + "description": "These are used to make additions/deductions to the pay for this Employee.\r\nYou do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created.", + "nullable": true + }, + "period": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "method": { + "$ref": "#/components/schemas/PayMethod" + }, + "withholdTaxRefundIfPayIsZero": { + "type": "boolean", + "description": "If you don't want negative PAYE values when the Gross pay is zero, set this to true" + }, + "taxAndNi": { + "$ref": "#/components/schemas/Contract.TaxAndNi" + }, + "fpsFields": { + "$ref": "#/components/schemas/Contract.FpsFields" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "nationalMinimumWage": { + "type": "boolean" + }, + "payCode": { + "type": "string", + "description": "If you want the Employees pay to be allocated to a code other than BASIC, specify it here", + "nullable": true + }, + "mileageVehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "mapsMiles": { + "type": "integer", + "description": "The number of miles to pay for as Mileage Allowance Payments", + "format": "int32", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "niTable": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Contract.PayOptionsResponse": { + "type": "object", + "properties": { + "regularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayLineResponse" + }, + "description": "These are used to make additions/deductions to the pay for this Employee.\r\nYou do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created.", + "nullable": true + }, + "basicPay": { + "type": "number", + "description": "The amount of basic pay the Employee is regularly paid each period\r\nThis amount is the combined total of all pay elements that contribute to basic pay", + "format": "double" + }, + "period": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "method": { + "$ref": "#/components/schemas/PayMethod" + }, + "withholdTaxRefundIfPayIsZero": { + "type": "boolean", + "description": "If you don't want negative PAYE values when the Gross pay is zero, set this to true" + }, + "taxAndNi": { + "$ref": "#/components/schemas/Contract.TaxAndNi" + }, + "fpsFields": { + "$ref": "#/components/schemas/Contract.FpsFields" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "nationalMinimumWage": { + "type": "boolean" + }, + "payCode": { + "type": "string", + "description": "If you want the Employees pay to be allocated to a code other than BASIC, specify it here", + "nullable": true + }, + "mileageVehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "mapsMiles": { + "type": "integer", + "description": "The number of miles to pay for as Mileage Allowance Payments", + "format": "int32", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of\r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "niTable": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Contract.PayRunStateHistoryResponse": { + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/PayRunState" + }, + "createdDate": { + "type": "string", + "description": "Date in which the State was changed", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.PaySpineGradeRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Pay spine grade name", + "nullable": true + }, + "lowerPointUniqueId": { + "type": "string", + "description": "Id of lower spinal point to be used.", + "format": "uuid" + }, + "upperPointUniqueId": { + "type": "string", + "description": "Id of upper spinal point to be used.", + "format": "uuid" + }, + "upperPointUseMax": { + "type": "boolean", + "description": "Use the Alt Max Value of the Upper Point. (Default false)" + }, + "effectiveDate": { + "type": "string", + "description": "Date that this configuration is effective from.", + "format": "date" + }, + "holidayEntitlement": { + "type": "number", + "description": "The number of holiday days entitled for this pay spine grade.", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.PaySpineGradeResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Pay spine grade name", + "nullable": true + }, + "lowerPointUniqueId": { + "type": "string", + "description": "Id of lower spinal point used.", + "format": "uuid" + }, + "upperPointUniqueId": { + "type": "string", + "description": "Id of upper spinal point used.", + "format": "uuid" + }, + "upperPointUseMax": { + "type": "boolean", + "description": "Use the Alt Max Value of the Upper Point. (Default false)" + }, + "effectiveDate": { + "type": "string", + "description": "Date that this configuration is effective from.", + "format": "date" + }, + "uniqueId": { + "type": "string", + "description": "Pay spine grade Id", + "format": "uuid" + }, + "holidayEntitlement": { + "type": "number", + "description": "The number of holiday days entitled for this pay spine grade.", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.PaySpineRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Pay Spine", + "nullable": true + }, + "fullTimeHours": { + "type": "number", + "description": "Maximum Full Time Hours on this Pay Spine", + "format": "double" + }, + "fullTimeWeeks": { + "type": "number", + "description": "Maximum Full Time Weeks on this Pay Spine", + "format": "double" + }, + "salaryFormula": { + "type": "string", + "description": "Formula used to derive annual salary\r\n\r\nThe salary formula consists of the following elements and Round functions:\r\n- PointValue (The value of an individual Spinal Point)\r\n- HoursWorked (The hours an employee is contracted to work for in their role)\r\n- FTHours (The full time hours specified for an employee in their role)\r\n- WeeksWorked (The contracted weeks an employee works in their role)\r\n- FTWeeks (The full weeks specified for an employee in their role)\r\nRound functions: \r\n- ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15.\r\n- ROUNDUP(Value)\r\n- ROUNDDOWN(Value) \r\n- TRUNCATE(Value)\r\n\r\nFor example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" \r\n", + "nullable": true + }, + "hourlyDivisor": { + "type": "number", + "description": "Hours used to determine Hourly Rate", + "format": "double" + }, + "hourlyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Hourly Rates", + "format": "int32" + }, + "dailyDivisor": { + "type": "number", + "description": "Days used to determine Full time Daily Rate", + "format": "double" + }, + "dailyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Daily Rates", + "format": "int32" + }, + "annualDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Annual Salaries", + "format": "int32" + }, + "annualRoundingRule": { + "$ref": "#/components/schemas/AnnualRoundingRule" + }, + "incrementRule": { + "$ref": "#/components/schemas/IncrementRule" + }, + "requiresLondonAllowance": { + "type": "boolean", + "description": "Requires LA column to be completed on the spine" + }, + "gradeEffectiveDate": { + "type": "string", + "description": "Effective date for applicable grades", + "format": "date" + }, + "pointEffectiveDate": { + "type": "string", + "description": "Effective date for applicable spinal points", + "format": "date" + }, + "useSpineHolidayRules": { + "type": "boolean", + "description": "Flag to include holiday entitlements in Payspine (Default false)" + }, + "holidayEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.HolidayEntitlementRequest" + }, + "description": "PaySpine Holiday Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PaySpineResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Pay Spine identifier", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "Name of the Pay Spine", + "nullable": true + }, + "fullTimeHours": { + "type": "number", + "description": "Maximum Full Time Hours on this Pay Spine", + "format": "double" + }, + "fullTimeWeeks": { + "type": "number", + "description": "Maximum Full Time Weeks on this Pay Spine", + "format": "double" + }, + "salaryFormula": { + "type": "string", + "description": "Formula used to derive annual salary\r\n\r\nThe salary formula consists of the following elements and Round functions:\r\n- PointValue (The value of an individual Spinal Point)\r\n- HoursWorked (The hours an employee is contracted to work for in their role)\r\n- FTHours (The full time hours specified for an employee in their role)\r\n- WeeksWorked (The contracted weeks an employee works in their role)\r\n- FTWeeks (The full weeks specified for an employee in their role)\r\nRound functions: \r\n- ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15.\r\n- ROUNDUP(Value)\r\n- ROUNDDOWN(Value) \r\n- TRUNCATE(Value)\r\n\r\nFor example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" \r\n", + "nullable": true + }, + "hourlyDivisor": { + "type": "number", + "description": "Hours used to determine Hourly Rate", + "format": "double" + }, + "hourlyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Hourly Rates", + "format": "int32" + }, + "dailyDivisor": { + "type": "number", + "description": "Days used to determine Full time Daily Rate", + "format": "double" + }, + "dailyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Daily Rates", + "format": "int32" + }, + "annualDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Annual Salaries", + "format": "int32" + }, + "annualRoundingRule": { + "$ref": "#/components/schemas/AnnualRoundingRule" + }, + "incrementRule": { + "$ref": "#/components/schemas/IncrementRule" + }, + "requiresLondonAllowance": { + "type": "boolean", + "description": "Requires LA column to be completed on the spine" + }, + "gradeEffectiveDate": { + "type": "string", + "description": "Effective date for applicable grades", + "format": "date" + }, + "pointEffectiveDate": { + "type": "string", + "description": "Effective date for applicable spinal points", + "format": "date" + }, + "useSpineHolidayRules": { + "type": "boolean", + "description": "Flag to include holiday entitlements in Payspine (Default false)" + }, + "holidayEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.HolidayEntitlementResponse" + }, + "description": "PaySpine Years Service Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PaySpineUpdateRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Pay Spine", + "nullable": true + }, + "fullTimeHours": { + "type": "number", + "description": "Maximum Full Time Hours on this Pay Spine", + "format": "double" + }, + "fullTimeWeeks": { + "type": "number", + "description": "Maximum Full Time Weeks on this Pay Spine", + "format": "double" + }, + "salaryFormula": { + "type": "string", + "description": "Formula used to derive annual salary\r\n\r\nThe salary formula consists of the following elements and Round functions:\r\n- PointValue (The value of an individual Spinal Point)\r\n- HoursWorked (The hours an employee is contracted to work for in their role)\r\n- FTHours (The full time hours specified for an employee in their role)\r\n- WeeksWorked (The contracted weeks an employee works in their role)\r\n- FTWeeks (The full weeks specified for an employee in their role)\r\nRound functions: \r\n- ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15.\r\n- ROUNDUP(Value)\r\n- ROUNDDOWN(Value) \r\n- TRUNCATE(Value)\r\n\r\nFor example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" \r\n", + "nullable": true + }, + "hourlyDivisor": { + "type": "number", + "description": "Hours used to determine Hourly Rate", + "format": "double" + }, + "hourlyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Hourly Rates", + "format": "int32" + }, + "dailyDivisor": { + "type": "number", + "description": "Days used to determine Full time Daily Rate", + "format": "double" + }, + "dailyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Daily Rates", + "format": "int32" + }, + "annualDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Annual Salaries", + "format": "int32" + }, + "annualRoundingRule": { + "$ref": "#/components/schemas/AnnualRoundingRule" + }, + "incrementRule": { + "$ref": "#/components/schemas/IncrementRule" + }, + "requiresLondonAllowance": { + "type": "boolean", + "description": "Requires LA column to be completed on the spine" + }, + "gradeEffectiveDate": { + "type": "string", + "description": "Effective date for applicable grades", + "format": "date" + }, + "pointEffectiveDate": { + "type": "string", + "description": "Effective date for applicable spinal points", + "format": "date" + }, + "useSpineHolidayRules": { + "type": "boolean", + "description": "Flag to include holiday entitlements in Payspine (Default false)" + }, + "holidayEntitlements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.HolidayEntitlementUpdateRequest" + }, + "description": "PaySpine Holiday Entitlements", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PaylineAnalysisCategoriesCodes": { + "type": "object", + "properties": { + "analysisCategory": { + "type": "string", + "description": "AnalysisCategory Model", + "nullable": true + }, + "analysisCategoryCode": { + "type": "string", + "description": "AnalysisCategoryCode Model", + "nullable": true + }, + "analysisCategoryId": { + "type": "string", + "description": "AnalysisCategory Identifier", + "format": "uuid", + "nullable": true + }, + "analysisCategoryCodeId": { + "type": "string", + "description": "AnalysisCategoryCode Identifier", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PaylineRequest": { + "type": "object", + "properties": { + "analysisCategoryCodeIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "List of analysis category code unique ids.", + "nullable": true + }, + "analysisCategoriesCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PaylineAnalysisCategoriesCodes" + }, + "description": "List of analysis category ids and analysis category code ids.", + "nullable": true + }, + "annualValue": { + "type": "number", + "description": "The original value from the PayLine before we modify it.\r\nCurrently only used when CalculationType is set to FixedAnnualAmount\r\nso we can determine whether the payline value needs calculating or not.\r\nTo recalculate set to null with annual amount recorded in Value.", + "format": "double", + "nullable": true + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling midway through a PayRun." + }, + "calculateAsWhenPaid": { + "type": "boolean", + "description": "Indicates whether this pay line should be treated as When Paid rather than When Earned." + }, + "childId": { + "type": "string", + "description": "The child id.", + "format": "uuid", + "nullable": true + }, + "code": { + "type": "string", + "description": "The PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition.", + "nullable": true + }, + "contributesToBasicPay": { + "type": "boolean", + "description": "Indicates whether this PayLine contributes to the basic pay of the Employee." + }, + "costCentre": { + "type": "string", + "description": "CostCentre code which we want to override in the payline.", + "nullable": true + }, + "costCentreId": { + "type": "string", + "description": "CostCentre uniqueId which we want to override in the payline.", + "format": "uuid", + "nullable": true + }, + "department": { + "type": "string", + "description": "Department code which we want to override in the payline.", + "nullable": true + }, + "departmentId": { + "type": "string", + "description": "Department uniqueId which we want to override in the payline.", + "format": "uuid", + "nullable": true + }, + "description": { + "type": "string", + "description": "A description to accompany this line. It will be displayed on the payslip.", + "nullable": true + }, + "earnedFrom": { + "type": "string", + "description": "The earned from date.", + "format": "date", + "nullable": true + }, + "earnedTo": { + "type": "string", + "description": "The earned to date.", + "format": "date", + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "description": "The date the payline starts being calculated in the payrun.", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "description": "The date the payline stops being calculated in the payrun.", + "format": "date", + "nullable": true + }, + "employeeRoleReference": { + "type": "string", + "description": "The employee role reference.", + "nullable": true + }, + "fullTimeAnnualValue": { + "type": "number", + "description": "Used to set the Full Time Annual Value for the payline.", + "format": "double" + }, + "ignoreInitialBackPay": { + "type": "boolean", + "description": "Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside of Staffology.\r\nIf set to false, the automatic backpay calculation will be performed on the first pay run." + }, + "isAutoGeneratedBasicPayLine": { + "type": "boolean", + "description": "If the PayLine is an auto-generated basic payline." + }, + "isAutomaticBackPay": { + "type": "boolean", + "description": "Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created.\r\nApplicable only to employee level addition/deduction pay lines.\r\nIf set to false then you must manually handle the calculation and adding of backpay lines." + }, + "isNetToGross": { + "type": "boolean", + "description": "If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target." + }, + "isZeroHoursTeachersBackPayLine": { + "type": "boolean", + "description": "If the PayLine is a zero-hours teachers back-pay line." + }, + "londonAllowanceId": { + "type": "integer", + "description": "Used to set London allowance id for payline.", + "format": "int32", + "nullable": true + }, + "multiplier": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours.", + "format": "double", + "nullable": true + }, + "netToGrossDiscrepancy": { + "type": "number", + "description": "The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation.", + "format": "double", + "nullable": true + }, + "payGrade": { + "type": "string", + "description": "PayGrade for imported pay lines", + "nullable": true + }, + "paySpine": { + "type": "string", + "description": "PaySpine for imported pay lines", + "nullable": true + }, + "paySpineGradeId": { + "type": "string", + "description": "The Id of the associated pay spine grade.", + "format": "uuid", + "nullable": true + }, + "paySpineId": { + "type": "string", + "description": "The Id of the associated pay spine.", + "format": "uuid", + "nullable": true + }, + "percentageOfEffectiveDays": { + "type": "number", + "description": "The percentage of working days the effective dates span for pro-rata values, calculated and set during each payrun.", + "format": "double", + "nullable": true + }, + "rate": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used.", + "format": "double", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "The employee role which is associated with this pay line.\r\nIf set to null, the pay line is not related with a role.", + "format": "uuid", + "nullable": true + }, + "spinePoint": { + "type": "string", + "description": "SpinePoint for imported pay lines", + "nullable": true + }, + "spinalPointId": { + "type": "string", + "description": "The Id of the associated spinal point.", + "format": "uuid", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags related to this line.", + "nullable": true + }, + "targetNetToGrossValue": { + "type": "number", + "description": "The orginal net fixed addition amount that is considered to be a take home pay target.", + "format": "double", + "nullable": true + }, + "totalPaidDays": { + "type": "number", + "description": "The total paid days.", + "format": "double", + "nullable": true + }, + "totalWorkingDays": { + "type": "number", + "description": "The total working days.", + "format": "double", + "nullable": true + }, + "value": { + "type": "number", + "description": "The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used).\r\nIf the PayCode has a CalculationType other than FixedAmount then this field will be a percentage.\r\nIf the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated.", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadEmployerRequest": { + "type": "object", + "properties": { + "payrollSquadId": { + "type": "string", + "description": "UniqueId of Payroll Squad", + "format": "uuid" + }, + "employerIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "UniqueIds of Employers", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadEmployerResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Payroll Squad Employer Id", + "format": "uuid" + }, + "employerId": { + "type": "string", + "description": "Employer Id", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadMemberRequest": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Payroll Squad Selected UserId", + "format": "uuid" + }, + "payrollSquadId": { + "type": "string", + "description": "UniqueId of Payroll Squad", + "format": "uuid" + }, + "role": { + "$ref": "#/components/schemas/UserRole" + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadMemberResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Payroll Squad Member Identifier", + "format": "uuid" + }, + "userId": { + "type": "string", + "description": "Payroll Squad User Identifier", + "format": "uuid" + }, + "displayName": { + "type": "string", + "description": "Payroll Squad Member DisplayName", + "nullable": true + }, + "emailAddress": { + "type": "string", + "description": "Payroll Squad Member EmailAddress", + "nullable": true + }, + "lastLogin": { + "type": "string", + "description": "Payroll Squad Member LastLogin", + "format": "date", + "nullable": true + }, + "role": { + "$ref": "#/components/schemas/UserRole" + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of Payroll Squad", + "nullable": true + }, + "employerIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Employer ids of Payroll Squad", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PayrollSquadResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Payroll Squad Identifier", + "format": "uuid" + }, + "tenantId": { + "type": "string", + "description": "Current Tenant Id", + "format": "uuid" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.PayrollSquadMemberResponse" + }, + "description": "List of all Members", + "nullable": true + }, + "employers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.EmployerBase" + }, + "description": "List of all Employers", + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of Payroll Squad", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PendingLettersCountResponse": { + "type": "object", + "properties": { + "pendingLettersCount": { + "type": "integer", + "format": "int32" + }, + "requiringAePostponementLettersCount": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "Contract.PensionerPayroll": { + "type": "object", + "properties": { + "inReceiptOfPension": { + "type": "boolean", + "description": "If set to true then the FPS will have the OccPenInd flag set to 'yes'" + }, + "bereaved": { + "type": "boolean", + "description": "Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner" + }, + "amount": { + "type": "number", + "description": "Annual amount of occupational pension", + "format": "double" + }, + "startDate": { + "type": "string", + "description": "Start date of occupational Pension", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.PersonalDetailsRequest": { + "required": [ + "dateOfBirth", + "gender", + "maritalStatus" + ], + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Contract.Address" + }, + "maritalStatus": { + "$ref": "#/components/schemas/MaritalStatus" + }, + "title": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "firstName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "middleName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "alternativeEmail": { + "maxLength": 100, + "type": "string", + "format": "email", + "nullable": true + }, + "previousSurName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "email": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "emailPayslip": { + "type": "boolean", + "description": "If set to true then the employees Payslip will be sent by email when a PayRun is finalised." + }, + "pdfPassword": { + "type": "string", + "description": "Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property.", + "nullable": true + }, + "pdfPasswordType": { + "$ref": "#/components/schemas/PdfPasswordType" + }, + "emailStatement": { + "type": "boolean", + "description": "Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted." + }, + "photoUrl": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "telephone": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "photoSasUrl": { + "type": "string", + "nullable": true + }, + "mobile": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "format": "date" + }, + "gender": { + "$ref": "#/components/schemas/Gender" + }, + "niNumber": { + "maxLength": 15, + "type": "string", + "nullable": true + }, + "passportNumber": { + "maxLength": 25, + "type": "string", + "nullable": true + }, + "partnerDetails": { + "$ref": "#/components/schemas/Contract.PartnerDetails" + } + }, + "additionalProperties": false + }, + "Contract.PersonalDetailsResponse": { + "required": [ + "dateOfBirth", + "gender", + "maritalStatus" + ], + "type": "object", + "properties": { + "statePensionAge": { + "type": "integer", + "description": "Automatically calculated.", + "format": "int32" + }, + "address": { + "$ref": "#/components/schemas/Contract.Address" + }, + "maritalStatus": { + "$ref": "#/components/schemas/MaritalStatus" + }, + "title": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "firstName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "middleName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "alternativeEmail": { + "maxLength": 100, + "type": "string", + "format": "email", + "nullable": true + }, + "previousSurName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "email": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "emailPayslip": { + "type": "boolean", + "description": "If set to true then the employees Payslip will be sent by email when a PayRun is finalised." + }, + "pdfPassword": { + "type": "string", + "description": "Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property.", + "nullable": true + }, + "pdfPasswordType": { + "$ref": "#/components/schemas/PdfPasswordType" + }, + "emailStatement": { + "type": "boolean", + "description": "Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted." + }, + "photoUrl": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "telephone": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "photoSasUrl": { + "type": "string", + "nullable": true + }, + "mobile": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "format": "date" + }, + "gender": { + "$ref": "#/components/schemas/Gender" + }, + "niNumber": { + "maxLength": 15, + "type": "string", + "nullable": true + }, + "passportNumber": { + "maxLength": 25, + "type": "string", + "nullable": true + }, + "partnerDetails": { + "$ref": "#/components/schemas/Contract.PartnerDetails" + } + }, + "additionalProperties": false + }, + "Contract.ReapplyDpsNoticeResponse": { + "type": "object", + "properties": { + "numberOfAppliedNotices": { + "type": "integer", + "format": "int32" + }, + "numberOfFailedNotices": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "Contract.RightToWork": { + "type": "object", + "properties": { + "checked": { + "type": "boolean" + }, + "documentType": { + "$ref": "#/components/schemas/RightToWorkDocumentType" + }, + "documentRef": { + "maxLength": 80, + "type": "string", + "nullable": true + }, + "documentExpiry": { + "type": "string", + "format": "date", + "nullable": true + }, + "note": { + "maxLength": 200, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.RtiEmployeeAddress": { + "type": "object", + "properties": { + "line": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "postcode": { + "type": "string", + "nullable": true + }, + "postCode": { + "type": "string", + "nullable": true + }, + "ukPostcode": { + "type": "string", + "nullable": true + }, + "country": { + "type": "string", + "nullable": true + }, + "foreignCountry": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.RtiEmployeeName": { + "type": "object", + "properties": { + "ttl": { + "type": "string", + "nullable": true + }, + "fore": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "initials": { + "type": "string", + "nullable": true + }, + "sur": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.ShiftWorkingPatternDayRequest": { + "type": "object", + "properties": { + "day": { + "type": "integer", + "format": "int32" + }, + "isWorkingDay": { + "type": "boolean" + }, + "hours": { + "type": "number", + "format": "double" + }, + "workingPatternHoursType": { + "$ref": "#/components/schemas/WorkingPatternHoursType" + } + }, + "additionalProperties": false + }, + "Contract.ShiftWorkingPatternDayResponse": { + "type": "object", + "properties": { + "day": { + "type": "integer", + "format": "int32" + }, + "isWorkingDay": { + "type": "boolean" + }, + "hours": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "Contract.SpinalPointRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Spinal Point", + "nullable": true + }, + "number": { + "type": "integer", + "description": "Number of Spinal Point within the Scale", + "format": "int32" + }, + "annualValue": { + "type": "number", + "description": "Annual Value for the Spinal Point", + "format": "double" + }, + "annualValueAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point (Alternative Max Value)", + "format": "double" + }, + "annualValueLAInner": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner London Allowance", + "format": "double" + }, + "annualValueLAInnerAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAOuter": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer London Allowance", + "format": "double" + }, + "annualValueLAOuterAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAFringe": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe London Allowance", + "format": "double" + }, + "annualValueLAFringeAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe LA (Alt Max Value)", + "format": "double" + }, + "effectiveDate": { + "type": "string", + "description": "Date these rates became effective", + "format": "date" + }, + "predecessorId": { + "type": "string", + "description": "Spinal point predecessorId", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.SpinalPointResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Spinal Point identifier", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "Name of the Spinal Point", + "nullable": true + }, + "number": { + "type": "integer", + "description": "Number of Spinal Point within the Scale", + "format": "int32" + }, + "annualValue": { + "type": "number", + "description": "Annual Value for the Spinal Point", + "format": "double" + }, + "annualValueAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point (Alternative Max Value)", + "format": "double" + }, + "annualValueLAInner": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner London Allowance", + "format": "double" + }, + "annualValueLAInnerAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAOuter": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer London Allowance", + "format": "double" + }, + "annualValueLAOuterAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAFringe": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe London Allowance", + "format": "double" + }, + "annualValueLAFringeAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe LA (Alt Max Value)", + "format": "double" + }, + "effectiveDate": { + "type": "string", + "description": "Date these rates became effective", + "format": "date" + }, + "predecessorId": { + "type": "string", + "description": "Spinal point predecessorId", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.SpinalPointUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "Name of the Spinal Point", + "nullable": true + }, + "number": { + "type": "integer", + "description": "Number of Spinal Point within the Scale", + "format": "int32" + }, + "annualValue": { + "type": "number", + "description": "Annual Value for the Spinal Point", + "format": "double" + }, + "annualValueAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point (Alternative Max Value)", + "format": "double" + }, + "annualValueLAInner": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner London Allowance", + "format": "double" + }, + "annualValueLAInnerAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Inner LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAOuter": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer London Allowance", + "format": "double" + }, + "annualValueLAOuterAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Outer LA (Alt Max Value)", + "format": "double" + }, + "annualValueLAFringe": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe London Allowance", + "format": "double" + }, + "annualValueLAFringeAltMax": { + "type": "number", + "description": "Annual Value for the Spinal Point Fringe LA (Alt Max Value)", + "format": "double" + }, + "effectiveDate": { + "type": "string", + "description": "Date these rates became effective", + "format": "date" + }, + "predecessorId": { + "type": "string", + "description": "Spinal point predecessorId", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.SpineAllowanceRequest": { + "type": "object", + "properties": { + "allowanceName": { + "type": "string", + "description": "Name of Allowance", + "nullable": true + }, + "allowanceType": { + "$ref": "#/components/schemas/AllowanceType" + }, + "allowanceUsualAnnualValue": { + "type": "number", + "description": "Value of Allowance Usual Annual", + "format": "double" + }, + "allowanceRangeLowerValue": { + "type": "number", + "description": "Value of Allowance Range Lower", + "format": "double" + }, + "allowanceRangeUpperValue": { + "type": "number", + "description": "Value of Allowance Range Upper", + "format": "double" + }, + "allowanceEffectiveDate": { + "type": "string", + "description": "Allowance Effective Date", + "format": "date" + }, + "allowanceAlwaysFTE": { + "type": "boolean", + "description": "Allowance Always FTE or Not" + }, + "payCode": { + "type": "string", + "description": "Pay Code", + "nullable": true + }, + "payCodeTitle": { + "type": "string", + "description": "Pay Code Title", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.SpineAllowanceResponse": { + "type": "object", + "properties": { + "allowanceName": { + "type": "string", + "description": "Name of Allowance", + "nullable": true + }, + "allowanceType": { + "$ref": "#/components/schemas/AllowanceType" + }, + "allowanceUsualAnnualValue": { + "type": "number", + "description": "Value of Allowance Usual Annual", + "format": "double" + }, + "allowanceRangeLowerValue": { + "type": "number", + "description": "Value of Allowance Range Lower", + "format": "double" + }, + "allowanceRangeUpperValue": { + "type": "number", + "description": "Value of Allowance Range Upper", + "format": "double" + }, + "allowanceEffectiveDate": { + "type": "string", + "description": "Allowance Effective Date", + "format": "date" + }, + "allowanceAlwaysFTE": { + "type": "boolean", + "description": "Allowance Always FTE or Not" + }, + "uniqueId": { + "type": "string", + "description": "Spine Allowance identifier", + "format": "uuid" + }, + "payCode": { + "type": "string", + "description": "Pay Code", + "nullable": true + }, + "payCodeTitle": { + "type": "string", + "description": "Pay Code Title", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.SpineAllowanceUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Spine Allowance identifier", + "format": "uuid" + }, + "allowanceName": { + "type": "string", + "description": "Name of Allowance", + "nullable": true + }, + "allowanceType": { + "$ref": "#/components/schemas/AllowanceType" + }, + "allowanceUsualAnnualValue": { + "type": "number", + "description": "Value of Allowance Usual Annual", + "format": "double" + }, + "allowanceRangeLowerValue": { + "type": "number", + "description": "Value of Allowance Range Lower", + "format": "double" + }, + "allowanceRangeUpperValue": { + "type": "number", + "description": "Value of Allowance Range Upper", + "format": "double" + }, + "allowanceEffectiveDate": { + "type": "string", + "description": "Allowance Effective Date", + "format": "date" + }, + "allowanceAlwaysFTE": { + "type": "boolean", + "description": "Allowance Always FTE or Not" + }, + "payCode": { + "type": "string", + "description": "Pay Code", + "nullable": true + }, + "payCodeTitle": { + "type": "string", + "description": "Pay Code Title", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.StarterDetails": { + "required": [ + "startDate", + "starterDeclaration" + ], + "type": "object", + "properties": { + "startDate": { + "type": "string", + "format": "date" + }, + "starterDeclaration": { + "$ref": "#/components/schemas/StarterDeclaration" + }, + "overseasEmployerDetails": { + "$ref": "#/components/schemas/Contract.OverseasEmployerDetails" + }, + "pensionerPayroll": { + "$ref": "#/components/schemas/Contract.PensionerPayroll" + } + }, + "additionalProperties": false + }, + "Contract.TaxAndNi": { + "required": [ + "niTable" + ], + "type": "object", + "properties": { + "niTable": { + "type": "string", + "description": "The appropriate NI letter for this Employee" + }, + "secondaryClass1NotPayable": { + "type": "boolean", + "description": "If set to true then no Employer NI will be paid for this Employee" + }, + "postgradLoan": { + "type": "boolean", + "description": "Set to true if the Employee needs to make Post Graduate Loan repayments" + }, + "postgraduateLoanStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "postgraduateLoanEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "studentLoan": { + "$ref": "#/components/schemas/StudentLoan" + }, + "studentLoanStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "studentLoanEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "taxCode": { + "maxLength": 12, + "type": "string", + "description": "The Tax Code for this Employee", + "nullable": true + }, + "week1Month1": { + "type": "boolean", + "description": "Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis.\r\nThis is automatically set to false for any existing Employees when you start a new Tax Year." + }, + "foreignTaxCredit": { + "type": "boolean", + "description": "If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities." + } + }, + "additionalProperties": false + }, + "Contract.TermCalendarRequest": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Title of the Term Calendar", + "nullable": true + }, + "academicYearStartMonth": { + "$ref": "#/components/schemas/CalendarMonth" + } + }, + "additionalProperties": false + }, + "Contract.TermCalendarResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Term Calendar identifier", + "format": "uuid" + }, + "title": { + "type": "string", + "description": "Title of the Term Calendar", + "nullable": true + }, + "academicYearStartMonth": { + "$ref": "#/components/schemas/CalendarMonth" + } + }, + "additionalProperties": false + }, + "Contract.TermCalendarYearRequest": { + "type": "object", + "properties": { + "autumnTermStartDate": { + "type": "string", + "description": "Autumn Term Start Date of Term Calendar Year View", + "format": "date" + }, + "autumnTermEndDate": { + "type": "string", + "description": "Autumn Term End Date of Term Calendar Year View", + "format": "date" + }, + "springTermStartDate": { + "type": "string", + "description": "Spring Term Start Date of Term Calendar Year View", + "format": "date" + }, + "springTermEndDate": { + "type": "string", + "description": "Spring Term End Date of Term Calendar Year View", + "format": "date" + }, + "summerTermStartDate": { + "type": "string", + "description": "Summer Term Start Date of Term Calendar Year View", + "format": "date" + }, + "summerTermEndDate": { + "type": "string", + "description": "Summer Term End Date of Term Calendar Year View", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.TermCalendarYearResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Term Calendar Year identifier", + "format": "uuid" + }, + "autumnTermStartDate": { + "type": "string", + "description": "Autumn Term Start Date of Term Calendar Year View", + "format": "date" + }, + "autumnTermEndDate": { + "type": "string", + "description": "Autumn Term End Date of Term Calendar Year View", + "format": "date" + }, + "springTermStartDate": { + "type": "string", + "description": "Spring Term Start Date of Term Calendar Year View", + "format": "date" + }, + "springTermEndDate": { + "type": "string", + "description": "Spring Term End Date of Term Calendar Year View", + "format": "date" + }, + "summerTermStartDate": { + "type": "string", + "description": "Summer Term Start Date of Term Calendar Year View", + "format": "date" + }, + "summerTermEndDate": { + "type": "string", + "description": "Summer Term End Date of Term Calendar Year View", + "format": "date" + } + }, + "additionalProperties": false + }, + "Contract.UpdateEmployeeRequest": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique id of the object", + "format": "uuid" + }, + "personalDetails": { + "$ref": "#/components/schemas/Contract.PersonalDetailsRequest" + }, + "employmentDetails": { + "$ref": "#/components/schemas/Contract.EmploymentDetailsRequest" + }, + "autoEnrolment": { + "$ref": "#/components/schemas/Contract.AutoEnrolmentRequest" + }, + "leaveSettings": { + "$ref": "#/components/schemas/Contract.LeaveSettingsRequest" + }, + "rightToWork": { + "$ref": "#/components/schemas/Contract.RightToWork" + }, + "bankDetails": { + "$ref": "#/components/schemas/Contract.BankDetails" + }, + "payOptions": { + "$ref": "#/components/schemas/Contract.PayOptionsRequest" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "holidaySchemeUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "evcId": { + "type": "string", + "description": "If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId.", + "format": "uuid", + "nullable": true + }, + "sourceSystemId": { + "maxLength": 50, + "type": "string", + "description": "Used by external systems so they can store an immutable reference.\r\nOnce this property is set it cannot be changed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.VeteranDetails": { + "type": "object", + "properties": { + "isVeteran": { + "type": "boolean", + "description": "Set to true if the employee is a veteran" + }, + "firstCivilianEmploymentDate": { + "type": "string", + "description": "Date of Veteran's first civilian employment", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.WorkingPatternRequest": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "title": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "mon": { + "type": "number", + "format": "double" + }, + "tue": { + "type": "number", + "format": "double" + }, + "wed": { + "type": "number", + "format": "double" + }, + "thu": { + "type": "number", + "format": "double" + }, + "fri": { + "type": "number", + "format": "double" + }, + "sat": { + "type": "number", + "format": "double" + }, + "sun": { + "type": "number", + "format": "double" + }, + "monIsWorkingDay": { + "type": "boolean" + }, + "tueIsWorkingDay": { + "type": "boolean" + }, + "wedIsWorkingDay": { + "type": "boolean" + }, + "thuIsWorkingDay": { + "type": "boolean" + }, + "friIsWorkingDay": { + "type": "boolean" + }, + "satIsWorkingDay": { + "type": "boolean" + }, + "sunIsWorkingDay": { + "type": "boolean" + }, + "totalHours": { + "type": "number", + "format": "double" + }, + "contractedWeeks": { + "type": "number", + "description": "The amount of weeks an employee works, utilise for employees who aren't working full time.\r\nIf Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedWeeks": { + "type": "number", + "description": "The amount of weeks an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedHours": { + "type": "number", + "description": "The amount of hours an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "bankHolidays": { + "$ref": "#/components/schemas/BankHolidayCollection" + }, + "proRataRule": { + "$ref": "#/components/schemas/ProRataRule" + }, + "workingPatternHoursType": { + "$ref": "#/components/schemas/WorkingPatternHoursType" + }, + "isDefault": { + "type": "boolean" + }, + "workingPatternType": { + "$ref": "#/components/schemas/WorkingPatternType" + }, + "effectiveFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "shiftWorkingPatternDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.ShiftWorkingPatternDayRequest" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.WorkingPatternResponse": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "title": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "mon": { + "type": "number", + "format": "double" + }, + "tue": { + "type": "number", + "format": "double" + }, + "wed": { + "type": "number", + "format": "double" + }, + "thu": { + "type": "number", + "format": "double" + }, + "fri": { + "type": "number", + "format": "double" + }, + "sat": { + "type": "number", + "format": "double" + }, + "sun": { + "type": "number", + "format": "double" + }, + "contractedWeeks": { + "type": "number", + "description": "The amount of weeks an employee works, utilise for employees who aren't working full time.\r\nIf Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedWeeks": { + "type": "number", + "description": "The amount of weeks an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedHours": { + "type": "number", + "description": "The amount of hours an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "bankHolidays": { + "$ref": "#/components/schemas/BankHolidayCollection" + }, + "proRataRule": { + "$ref": "#/components/schemas/ProRataRule" + }, + "bankHolidayDates": { + "type": "array", + "items": { + "type": "string", + "format": "date-time" + }, + "description": "[readonly] The dates that are classed as Bank Holidays for this Working Pattern", + "nullable": true + }, + "workingPatternHoursType": { + "$ref": "#/components/schemas/WorkingPatternHoursType" + }, + "isDefault": { + "type": "boolean" + }, + "displayName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "totalHours": { + "type": "number", + "format": "double", + "readOnly": true + }, + "workingPatternType": { + "$ref": "#/components/schemas/WorkingPatternType" + }, + "effectiveFrom": { + "type": "string", + "format": "date", + "nullable": true + }, + "shiftWorkingPatternDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract.ShiftWorkingPatternDayResponse" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.YearsServiceEntitlementRequest": { + "type": "object", + "properties": { + "yearsService": { + "type": "integer", + "description": "Number of years of service.", + "format": "int32", + "nullable": true + }, + "totalAdditionalDaysHoliday": { + "type": "number", + "description": "Total additional days of holiday entitlement.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.YearsServiceEntitlementResponse": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique identifier for the Years Service Entitlement.", + "format": "uuid" + }, + "yearsService": { + "type": "integer", + "description": "Number of years of service.", + "format": "int32", + "nullable": true + }, + "totalAdditionalDaysHoliday": { + "type": "number", + "description": "Total additional days of holiday entitlement.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "Contract.YearsServiceEntitlementUpdateRequest": { + "type": "object", + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique identifier for the request.", + "format": "uuid" + }, + "yearsService": { + "type": "integer", + "description": "Number of years of service.", + "format": "int32", + "nullable": true + }, + "totalAdditionalDaysHoliday": { + "type": "number", + "description": "Total additional days of holiday entitlement.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "CostAnalysisReport": { + "type": "object", + "properties": { + "singlePayrun": { + "$ref": "#/components/schemas/PayRun" + }, + "totalPay": { + "type": "number", + "format": "double", + "readOnly": true + }, + "pension": { + "type": "number", + "format": "double" + }, + "aeoFees": { + "type": "number", + "format": "double" + }, + "totalCost": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employerNic": { + "type": "number", + "format": "double" + }, + "netPayrollCost": { + "type": "number", + "format": "double" + }, + "maleCount": { + "type": "integer", + "format": "int32" + }, + "femaleCount": { + "type": "integer", + "format": "int32" + }, + "leaverCount": { + "type": "integer", + "format": "int32" + }, + "joinerCount": { + "type": "integer", + "format": "int32" + }, + "paymentAfterLeavingCount": { + "type": "integer", + "format": "int32" + }, + "recoverableAmounts": { + "$ref": "#/components/schemas/RecoverableAmounts" + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CostAnalysisReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/CostAnalysisReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "CostCentre": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this Cost Centre" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Cost Centre" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Cost Centre, in hex format. ie 'ff0000'", + "nullable": true + }, + "accountingCode": { + "maxLength": 50, + "type": "string", + "nullable": true + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of employees with this set as their primary cost centre", + "format": "int32" + }, + "hasJournalOverrides": { + "type": "boolean", + "description": "Has Journal Overrides" + } + }, + "additionalProperties": false + }, + "CostOfEmploymentReport": { + "type": "object", + "properties": { + "hasDepartments": { + "type": "boolean" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CostOfEmploymentReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "CostOfEmploymentReportLine": { + "type": "object", + "properties": { + "pay": { + "type": "number", + "format": "double" + }, + "employerNic": { + "type": "number", + "format": "double" + }, + "pension": { + "type": "number", + "format": "double" + }, + "aeoFees": { + "type": "number", + "format": "double" + }, + "statPayReclaim": { + "type": "number", + "format": "double" + }, + "totalCost": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CostOfEmploymentReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/CostOfEmploymentReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Country": { + "enum": [ + "England", + "NorthernIreland", + "Scotland", + "Wales", + "OutsideUk", + "Uk" + ], + "type": "string" + }, + "CsvFileFormat": { + "enum": [ + "MoneysoftEmployees", + "BrightPayEmployees", + "Fps", + "SageEmployeeDetails", + "AccessPeoplePlanner", + "EmployeeCsv" + ], + "type": "string" + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "type": "string" + }, + "DecimalTaxYearConfigPrimitiveValue": { + "type": "object", + "properties": { + "value": { + "type": "number", + "format": "double" + }, + "effectiveFrom": { + "type": "string", + "description": "The date when these period values are effective", + "format": "date", + "nullable": true + }, + "midYearChanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DecimalTaxYearConfigPrimitiveValue" + }, + "description": "Any optional changes to the period values that are effective from a specified date in the middle of a tax year", + "nullable": true + } + }, + "additionalProperties": false + }, + "DeferalPeriodType": { + "enum": [ + "Days", + "Weeks", + "Months", + "PayPeriods" + ], + "type": "string" + }, + "Department": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this Department" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Department" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Department, in hex format. ie 'ff0000'", + "nullable": true + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of employees with this set as their primary department", + "format": "int32" + }, + "accountingCode": { + "maxLength": 50, + "type": "string", + "nullable": true + }, + "hasJournalOverrides": { + "type": "boolean", + "description": "Has Overrides" + } + }, + "additionalProperties": false + }, + "DepartmentMembership": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "minLength": 1, + "type": "string", + "description": "The Code for the Department" + }, + "color": { + "type": "string", + "description": "[readonly] The Color for the Department", + "nullable": true + }, + "title": { + "type": "string", + "description": "[readonly] The Title for the Department", + "nullable": true + }, + "primary": { + "type": "boolean", + "description": "Set to true if this is the primary Department for the Employee.\r\nOnly one department can be set as the primary." + }, + "weighting": { + "type": "number", + "description": "If there is more than one Department Membership for the Employee then this determines the weighting to give to this membership.\r\nie, if he is in two departments you might set the primary as 0.8 and the secondary as 0.2;", + "format": "double" + }, + "employeeRoleUniqueId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Used to represent an Employees membership of a Department" + }, + "DirectDebitMandate": { + "type": "object", + "properties": { + "isCompleted": { + "type": "boolean" + }, + "mandateLink": { + "type": "string", + "nullable": true + }, + "customerLink": { + "type": "string", + "nullable": true + }, + "bankName": { + "type": "string", + "nullable": true + }, + "accountNumberEnding": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "DirectorshipDetails": { + "type": "object", + "properties": { + "isDirector": { + "type": "boolean" + }, + "startDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "leaveDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "niAlternativeMethod": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "DpsDataType": { + "enum": [ + "P6", + "P9", + "SL1", + "SL2", + "PGL1", + "PGL2", + "AR", + "NOT", + "RTI", + "CIS" + ], + "type": "string" + }, + "DpsNotice": { + "type": "object", + "properties": { + "issueDate": { + "type": "string", + "format": "date" + }, + "effectiveDate": { + "type": "string", + "format": "date" + }, + "taxYear": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "sequenceNumber": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/DpsDataType" + }, + "formType": { + "type": "string", + "nullable": true + }, + "forename": { + "type": "string", + "nullable": true + }, + "surname": { + "type": "string", + "nullable": true + }, + "niNo": { + "type": "string", + "nullable": true + }, + "worksNumber": { + "type": "string", + "nullable": true + }, + "taxCode": { + "type": "string", + "nullable": true + }, + "week1Month1": { + "type": "boolean", + "nullable": true + }, + "previousTax": { + "type": "number", + "format": "double", + "nullable": true + }, + "previousPay": { + "type": "number", + "format": "double", + "nullable": true + }, + "planType": { + "$ref": "#/components/schemas/StudentLoan" + }, + "appliedOn": { + "type": "string", + "format": "date", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "DpsSettings": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "If enabled, we'll automatically retrieve DPS notices from HMRC for you" + }, + "retrieveFrom": { + "type": "string", + "description": "The date from which notices should be retrieved", + "format": "date" + }, + "autoApply": { + "type": "boolean", + "description": "If enabled, we'll automatically apply DPSNotices before starting a payrun that covers the EffectiveDate" + }, + "lastChecked": { + "type": "string", + "description": "[readonly] The time we last checked for notices", + "format": "date", + "nullable": true + }, + "error": { + "type": "string", + "description": "[readonly] If we received an error from HMRC when checking for notices, it'll be displayed here", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This model is used to set an employers settings for HMRCs Data Provisioning Service" + }, + "EmailAttachment": { + "required": [ + "filename", + "url" + ], + "type": "object", + "properties": { + "url": { + "minLength": 1, + "type": "string" + }, + "filename": { + "minLength": 1, + "type": "string" + }, + "pdfPasswordType": { + "$ref": "#/components/schemas/PdfPasswordType" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EmpRefs": { + "type": "object", + "properties": { + "officeNo": { + "type": "string", + "nullable": true + }, + "payeRef": { + "type": "string", + "nullable": true + }, + "aoRef": { + "type": "string", + "nullable": true + }, + "econ": { + "type": "string", + "nullable": true + }, + "cotaxRef": { + "type": "string", + "nullable": true + }, + "sautr": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "Employee": { + "type": "object", + "properties": { + "holidaySchemeUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "leaveHolidayAccrualDefaultRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + }, + "personalDetails": { + "$ref": "#/components/schemas/PersonalDetails" + }, + "employmentDetails": { + "$ref": "#/components/schemas/EmploymentDetails" + }, + "autoEnrolment": { + "$ref": "#/components/schemas/AutoEnrolment" + }, + "leaveSettings": { + "$ref": "#/components/schemas/LeaveSettings" + }, + "rightToWork": { + "$ref": "#/components/schemas/RightToWork" + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "payOptions": { + "$ref": "#/components/schemas/PayOptions" + }, + "status": { + "$ref": "#/components/schemas/EmployeeStatus" + }, + "aeNotEnroledWarning": { + "type": "boolean", + "description": "[readonly] If true then the employee should be enrolled in an Auto Enrolment Qualifying pension but isn't", + "readOnly": true + }, + "sourceSystemId": { + "maxLength": 50, + "type": "string", + "description": "[readonly] Can only be given a value when the employee is created. It can then never be changed.\r\nUsed by external systems so they can store an immutable reference", + "nullable": true + }, + "evcId": { + "type": "string", + "description": "If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployeeBenefitsReport": { + "type": "object", + "properties": { + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "EmployeeBenefitsReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/EmployeeBenefitsReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "EmployeeCostCentre": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "minLength": 1, + "type": "string", + "description": "The Code for the Cost Centre" + }, + "color": { + "type": "string", + "description": "[readonly] The Color for the Cost Centre", + "nullable": true + }, + "title": { + "type": "string", + "description": "[readonly] The Title for the Cost Centre", + "nullable": true + }, + "isPrimary": { + "type": "boolean", + "description": "Set to true if this is the primary Cost Centre for the Employee.\r\nOnly one Cost Centre can be set as the primary." + }, + "weighting": { + "type": "number", + "description": "If there is more than one Cost Centre Membership for the Employee then this determines the weighting to give to this membership.\r\nie, if he is in two Cost Centre you might set the primary as 0.8 and the secondary as 0.2;", + "format": "double" + }, + "employeeRoleUniqueId": { + "type": "string", + "format": "uuid" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false, + "description": "Used to represent an Employees membership of a Cost Centre" + }, + "EmployeeLeaveReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeLeaveReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "EmployeeLeaveReportLine": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/LeaveType" + }, + "payment": { + "$ref": "#/components/schemas/LeavePayType" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "openEndedAbsence": { + "type": "boolean" + }, + "percentOfPay": { + "type": "number", + "format": "double" + }, + "paySSPInAddition": { + "type": "boolean" + }, + "payFrequency": { + "$ref": "#/components/schemas/StatPayFrequency" + }, + "occupationalPolicy": { + "type": "string", + "nullable": true + }, + "from": { + "type": "string", + "format": "date" + }, + "to": { + "type": "string", + "format": "date" + }, + "useOpeningPay": { + "type": "boolean" + }, + "openingPay": { + "type": "number", + "format": "double", + "nullable": true + }, + "openingOmpPay": { + "type": "number", + "format": "double", + "nullable": true + }, + "babyDueDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "babyBirthDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "matchingDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "expectedPlacementDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "placementDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "deathDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "averageWeeklyEarnings": { + "type": "number", + "format": "double" + }, + "automaticAWECalculation": { + "type": "boolean" + }, + "calculationType": { + "$ref": "#/components/schemas/LeaveCalculationType" + }, + "strikeHoursToDeduct": { + "type": "number", + "format": "double", + "nullable": true + }, + "historicLeaveRequiresProcessing": { + "type": "boolean" + }, + "offsetPay": { + "type": "boolean" + }, + "useAssumedPensionablePay": { + "type": "boolean" + }, + "automaticAPPCalculation": { + "type": "boolean" + }, + "assumedPensionablePay": { + "type": "number", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployeeLeaveReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/EmployeeLeaveReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "EmployeeNiYtdValues": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "niTable": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NiYtdValue" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployeePayRunTotal": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "description": "Payroll code of the employee", + "nullable": true + }, + "grossForNi": { + "type": "number", + "description": "The amount of the Gross that is subject to NI", + "format": "double" + }, + "grossPensionPay": { + "type": "number", + "description": "The amount of the Gross that is subject to PensionPay", + "format": "double" + }, + "employerPensionContribution": { + "type": "number", + "description": "The value of the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "employerNi": { + "type": "number", + "description": "The Employer NI Contribution amount", + "format": "double" + }, + "grossTaxablePay": { + "type": "number", + "description": "The amount of the Gross that is subject to TaxablePay", + "format": "double" + }, + "employeeNi": { + "type": "number", + "description": "The Employee NI Contribution amount", + "format": "double" + }, + "tax": { + "type": "number", + "description": "The Employee Tax amount", + "format": "double" + }, + "studentLoanRecovered": { + "type": "number", + "description": "The Employee Student Loan recovered amount", + "format": "double" + }, + "employeePension": { + "type": "number", + "description": "The value of the Pension Contribution(PENSION) being made by the Employee as a Net Pay Arrangement", + "format": "double" + }, + "employeePensionContributionReliefAtSource": { + "type": "number", + "description": "The value of employee pension contributions Relief At Source(PENSIONRAS) that are not paid under 'net pay arrangements'", + "format": "double" + }, + "employeePensionContributionSalarySacrifice": { + "type": "number", + "description": "The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee as a Salary Sacrifice", + "format": "double" + } + }, + "additionalProperties": false, + "description": "EmployeePayRunTotal is used to calculte the employee pay run total" + }, + "EmployeeRole": { + "type": "object", + "properties": { + "jobTitle": { + "type": "string", + "description": "Job Title of the Role", + "nullable": true + }, + "isPrimary": { + "type": "boolean", + "description": "Set to True if this is Primary role of the Employee" + }, + "reference": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/RoleBasis" + }, + "type": { + "$ref": "#/components/schemas/RoleType" + }, + "payOptions": { + "$ref": "#/components/schemas/EmployeeRolePayOptions" + }, + "workingPatternId": { + "type": "string", + "description": "Used when calculating payments for Leave.\r\nIf null then the default Working Pattern is used", + "format": "uuid", + "nullable": true, + "deprecated": true + }, + "occupationalMaternityPolicyUniqueId": { + "type": "string", + "description": "Used for assigning occupational maternity policy", + "format": "uuid", + "nullable": true + }, + "occupationalSicknessPolicyUniqueId": { + "type": "string", + "description": "Used for assigning occupational sickness policy", + "format": "uuid", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EmployeeRoleAnalysisCategoryCode": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "minLength": 1, + "type": "string", + "description": "The Code for the AnalysisCategoryCode" + }, + "color": { + "type": "string", + "description": "[readonly] The Color for the AnalysisCategoryCode", + "nullable": true + }, + "title": { + "type": "string", + "description": "[readonly] The Title for the AnalysisCategoryCode", + "nullable": true + }, + "isPrimary": { + "type": "boolean", + "description": "Set to true if this is the primary AnalysisCategoryCode for the Employee.\r\nOnly one AnalysisCategoryCode can be set as the primary." + }, + "weighting": { + "type": "number", + "description": "If there is more than one AnalysisCategoryCode Membership for the Employee then this determines the weighting to give to this membership.\r\nie, if he is in two AnalysisCategoryCode you might set the primary as 0.8 and the secondary as 0.2;", + "format": "double" + }, + "analysisCategoryName": { + "type": "string", + "description": "Analysis Category Name", + "nullable": true + }, + "analysisCategoryPublicId": { + "type": "string", + "description": "Analysis Category Public Id", + "format": "uuid" + }, + "employeeRolePublicId": { + "type": "string", + "description": "Employee Role Public Id", + "format": "uuid" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false + }, + "EmployeeRolePayItem": { + "type": "object", + "properties": { + "roleId": { + "type": "string", + "format": "uuid" + }, + "isPrimary": { + "type": "boolean" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "weight": { + "type": "number", + "description": "This property is used to calculate values for the relative weight of the usual pay for \r\neach role compared to the sum of all roles' usual pay\r\nUsual pay for the purpose of the current value's calculation is based on the employee's permanent pay items\r\nincluding employee basic pay and permanent addition and deduction pay lines subject to NI or Tax", + "format": "double" + } + }, + "additionalProperties": false + }, + "EmployeeRolePayOptions": { + "type": "object", + "properties": { + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "nationalMinimumWage": { + "type": "boolean" + }, + "payCode": { + "type": "string", + "description": "If you want the Employees pay to be allocated to a code other than BASIC, specify it here", + "nullable": true + }, + "mileageVehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "mapsMiles": { + "type": "integer", + "description": "The number of miles to pay for as Mileage Allowance Payments", + "format": "int32", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "basicPay": { + "type": "number", + "description": "The amount of basic pay the Employee is regularly paid each period\r\nThis amount is the combined total of all pay elements that contribute to basic pay", + "format": "double" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "niTable": { + "type": "string" + }, + "regularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayLine" + }, + "description": "These are used to make additions/deductions to the pay for this Employee.\r\nYou do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created.", + "nullable": true + }, + "excludedRegularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayLine" + }, + "description": "These used to store the PayLines that have been excluded from RegularPaylines.", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EmployeeSortBy": { + "enum": [ + "PayrollCode", + "Employee", + "Department", + "PaySchedule" + ], + "type": "string" + }, + "EmployeeStatus": { + "enum": [ + "Current", + "Former", + "Upcoming" + ], + "type": "string" + }, + "EmployeeYtdValues": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/YtdValue" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Employer": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 200, + "minLength": 1, + "type": "string" + }, + "crn": { + "maxLength": 25, + "type": "string", + "description": "Company Registration Number", + "nullable": true + }, + "logoUrl": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "logoSasUrl": { + "type": "string", + "nullable": true + }, + "alternativeId": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "bankPaymentsCsvFormat": { + "$ref": "#/components/schemas/BankPaymentInstructionsCsvFormat" + }, + "bacsServiceUserNumber": { + "maxLength": 6, + "type": "string", + "nullable": true + }, + "bacsBureauNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "rejectInvalidBankDetails": { + "type": "boolean" + }, + "bankPaymentsReferenceFormat": { + "maxLength": 120, + "type": "string", + "nullable": true + }, + "bacsIncludeAEO": { + "type": "boolean" + }, + "bacsIncludeDeductions": { + "type": "boolean" + }, + "bacsIncludeHmrc": { + "type": "boolean" + }, + "bacsIncludePensions": { + "type": "boolean" + }, + "useTenantRtiSubmissionSettings": { + "type": "boolean", + "description": "If the Tenant for this employer has Bureau Features enabled then they can set RtiSubmissionSettings to be used across multiple employers.\r\nIf this is set to true then those settings will be used instead of any set at the Employer level" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "defaultPayOptions": { + "$ref": "#/components/schemas/PayOptions" + }, + "hmrcDetails": { + "$ref": "#/components/schemas/HmrcDetails" + }, + "defaultPension": { + "$ref": "#/components/schemas/PensionSelection" + }, + "rtiSubmissionSettings": { + "$ref": "#/components/schemas/RtiSubmissionSettings" + }, + "autoEnrolmentSettings": { + "$ref": "#/components/schemas/AutoEnrolmentSettings" + }, + "accruePayCodeSetUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "leaveSettings": { + "$ref": "#/components/schemas/LeaveSettings" + }, + "settings": { + "$ref": "#/components/schemas/EmployerSettings" + }, + "umbrellaSettings": { + "$ref": "#/components/schemas/UmbrellaSettings" + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of Employees this Employer has, including CIS Subcontractors.", + "format": "int32" + }, + "subcontractorCount": { + "type": "integer", + "description": "[readonly] The number of CIS Subcontractors this Employer has.", + "format": "int32" + }, + "startYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "currentYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "supportAccessEnabled": { + "type": "boolean", + "description": "If set to true then the support team can access this employer to help resolve\r\nsupport queries" + }, + "archived": { + "type": "boolean", + "description": "A flag to indicate whather or not the employer is Archived, ie no longer actively used" + }, + "canUseBureauFeatures": { + "type": "boolean" + }, + "multiRoleEnabled": { + "type": "boolean" + }, + "educationPayrollEnabled": { + "type": "boolean" + }, + "effectiveDateWorkingPatternsEnabled": { + "type": "boolean" + }, + "backPayEnabled": { + "type": "boolean", + "readOnly": true + }, + "isOptedInToEvc": { + "type": "boolean", + "description": "[readonly] Indicates whether or not the Employer is opted in to the Employee Verification Programme.\r\nValue can only be changed by its dedicated API end point." + }, + "evcId": { + "type": "string", + "description": "If set then this will be used as the Employer ID sent to EVC in place of the standard EmployerId.", + "format": "uuid", + "nullable": true + }, + "holidayAccrualBasis": { + "$ref": "#/components/schemas/HolidayAccrual" + }, + "holidayAccrualDefaultRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "mfaEnabled": { + "type": "boolean", + "description": "if set to true requires all users to setup MFA\r\nsupport queries" + }, + "departmentJournalOverridesEnabled": { + "type": "boolean", + "description": "Enables the journal overrides for departments, if set to true." + }, + "costCentreJournalOverridesEnabled": { + "type": "boolean", + "description": "Enables the journal overrides for cost centre, if set to true." + }, + "settingsSortPayrollNumbersAlphanumerically": { + "type": "boolean", + "description": "Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied" + }, + "unauthorisedLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "holidayLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "sickLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "parentalLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "bereavementLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + }, + "sourceSystemId": { + "maxLength": 50, + "type": "string", + "description": "[readonly] Can only be given a value when the employer is created. It can then never be changed.\r\nUsed by external systems so they can store an immutable reference", + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployerDefaults": { + "type": "object", + "properties": { + "employer": { + "$ref": "#/components/schemas/EmployerItem" + }, + "payCodes": { + "type": "boolean", + "description": "If true then PayCodes and PayCodeSets will be copied from the specified Employer" + }, + "csvMappings": { + "type": "boolean", + "description": "If true then CSV Mappings will be copied from the specified Employer" + }, + "departments": { + "type": "boolean", + "description": "If true then Departments, Cost Centres and Analysis Categories will be copied from the specified Employer" + }, + "rti": { + "type": "boolean", + "description": "If true then RTI Settings will be copied from the specified Employer" + }, + "users": { + "type": "boolean", + "description": "If true then Users will be copied from the specified Employer" + }, + "hmrcNoticeSettings": { + "type": "boolean", + "description": "If true then HMRC Notice Settings will be copied from the specified Employer" + }, + "payOptions": { + "type": "boolean", + "description": "If true then Default Pay Options will be copied from the specified Employer." + }, + "workingPatterns": { + "type": "boolean", + "description": "If true then WorkingPatterns will be copied from the specified Employer" + }, + "occupationalPolicies": { + "type": "boolean", + "description": "If true then Occupational Absence Schemes will be copied from the specified Employer." + }, + "pensionSchemes": { + "type": "boolean", + "description": "If true then PensionSchemes will be copied from the specified Employer" + }, + "payees": { + "type": "boolean", + "description": "If true then Payees will be copied from the specified Employer" + }, + "reportPacks": { + "type": "boolean", + "description": "If true then ReportPacks will be copied from the specified Employer" + } + }, + "additionalProperties": false, + "description": "When a user creates a new Employer, certain settings can be copied from an existing employer.\r\nThis model determines which employer (if any) settings should be copied from and what should be copied." + }, + "EmployerEmail": { + "required": [ + "subject", + "toEmail", + "toName" + ], + "type": "object", + "properties": { + "toName": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "toEmail": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "subject": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "buttonText": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "buttonLink": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "bodyPreview": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "body": { + "type": "string", + "nullable": true + }, + "afterBtnBody": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusDate": { + "type": "string", + "format": "date-time" + }, + "statusMessage": { + "type": "string", + "nullable": true + }, + "sendAttempts": { + "type": "integer", + "format": "int32" + }, + "webAppBaseUrl": { + "type": "string", + "nullable": true + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmailAttachment" + }, + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EmployerEvcOptInHistory": { + "type": "object", + "properties": { + "optIn": { + "type": "boolean" + }, + "date": { + "type": "string", + "format": "date" + }, + "userEmail": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployerGroup": { + "required": [ + "code", + "name" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this EmployerGroup" + }, + "employerCount": { + "type": "integer", + "format": "int32" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this EmployerGroup, in hex format. ie 'ff0000'", + "nullable": true + }, + "name": { + "maxLength": 150, + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "EmployerGroupMembership": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "minLength": 1, + "type": "string", + "description": "The Code for the EmployerGroup" + }, + "color": { + "type": "string", + "description": "[readonly] The Color for the EmployerGroup", + "nullable": true + }, + "title": { + "type": "string", + "description": "[readonly] The Title for the EmployerGroup", + "nullable": true + }, + "primary": { + "type": "boolean", + "description": "Set to true if this is the primary EmployerGroup for the Employer.\r\nOnly one EmployerGroup can be set as the primary." + } + }, + "additionalProperties": false, + "description": "Used to represent an Employers membership of a EmployerGroup" + }, + "EmployerItem": { + "type": "object", + "properties": { + "isOwner": { + "type": "boolean" + }, + "role": { + "$ref": "#/components/schemas/UserRole" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "EmployerOpeningBalances": { + "type": "object", + "properties": { + "smpRecovered": { + "type": "number", + "description": "Value of Statutory Maternity Pay recovered year to date", + "format": "double" + }, + "sppRecovered": { + "type": "number", + "description": "Value of Statutory Paternity Pay recovered year to date", + "format": "double" + }, + "sapRecovered": { + "type": "number", + "description": "Value of Statutory Adoption Pay recovered year to date", + "format": "double" + }, + "shPPRecovered": { + "type": "number", + "description": "Value of Shared Parental Pay recovered year to date", + "format": "double" + }, + "spbpRecovered": { + "type": "number", + "description": "Value of Statutory Parental Bereavment Pay recovered year to date", + "format": "double" + }, + "nicCompensationOnSMP": { + "type": "number", + "description": "Value of NIC compensation on SMP year to date", + "format": "double" + }, + "nicCompensationOnSPP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Paternity Pay year to date", + "format": "double" + }, + "nicCompensationOnSAP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Adoption Pay year to date", + "format": "double" + }, + "nicCompensationOnShPP": { + "type": "number", + "description": "Value of NIC compensation on Shared Parental Pay year to date", + "format": "double" + }, + "nicCompensationOnSPBP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Parental Bereavement Pay year to date", + "format": "double" + }, + "cisDeductionsSuffered": { + "type": "number", + "description": "Value of CIS deductions suffered year to date", + "format": "double" + }, + "apprenticeshipLevy": { + "type": "number", + "description": "Value of Apprenticeship levy paid year to date", + "format": "double" + }, + "employmentAllowance": { + "type": "number", + "description": "Value of Employment Allowance claimed year to date", + "format": "double" + } + }, + "additionalProperties": false + }, + "EmployerPensionContribution": { + "type": "object", + "properties": { + "pensionName": { + "type": "string", + "nullable": true + }, + "contributionAmount": { + "type": "number", + "format": "double" + }, + "contributionPercentage": { + "type": "number", + "format": "double" + }, + "isPercentage": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "EmployerSettings": { + "type": "object", + "properties": { + "allowNegativePay": { + "type": "boolean" + }, + "manualStatutoryPayLinesEnabled": { + "type": "boolean" + }, + "mergeMatchingNominalsEnabled": { + "type": "boolean" + }, + "autoCalcBackPayForNewStarters": { + "type": "boolean" + }, + "payCodeValidationEnabled": { + "type": "boolean" + }, + "calculateEffectiveDateSalaryChanges": { + "type": "boolean" + }, + "groupPayLinesEnabled": { + "type": "boolean", + "description": "A flag to indicate whether paylines should be grouped. The grouping is done based on the following PayLine properties: Rate, Multiplier, Code, Description and RoleId" + }, + "contractedWeeks": { + "pattern": "^([0-9]|[1234][0-9]|5[0-2])(\\.\\d{0,6})?$", + "type": "number", + "description": "The amount of weeks an employee works, utilise for employees who aren't working full time.\r\nThis value is the default which can be inherited when creating/updating a WorkingPattern.", + "format": "double" + }, + "fullTimeContractedWeeks": { + "pattern": "^(52)(\\.\\d{0,6})?$", + "type": "number", + "description": "The amount of weeks an employee works (Full Time).\r\nThis value is the default which can be inherited when creating/updating a WorkingPattern.", + "format": "double" + }, + "fullTimeContractedHours": { + "type": "number", + "description": "The amount of hours an employee works (Full Time).\r\nThis value is the default which can be inherited when creating/updating a WorkingPattern.", + "format": "double" + }, + "disabledPayRunWarningsList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRunEntryWarningType" + }, + "description": "Pay run warnings that the user has opted to ignore.", + "nullable": true + }, + "journalCsvFormat": { + "$ref": "#/components/schemas/JournalCsvFormat" + }, + "preferAsyncPayrunApiCalls": { + "type": "boolean", + "description": "This setting is only available temporarily and is only setable by users with access to beta features enabled.\r\nIf set to true the the web applicaiton will use new async API calls for managing payruns" + }, + "nominalMappingsEnabled": { + "type": "boolean", + "description": "Enables the nominal mappings(Custom Codes,System Codes,Control Codes,Employer Codes) for the employer, if set to true." + }, + "sortPayrollNumbersAlphanumerically": { + "type": "boolean", + "description": "Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied" + } + }, + "additionalProperties": false, + "description": "Miscellaneous settings related to the employer that don't naturally belong in other models" + }, + "EmployerTemplate": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/EmployerTemplateType" + }, + "description": { + "type": "string", + "description": "Explains the purpose of this template", + "nullable": true + }, + "isCustom": { + "type": "boolean", + "description": "Indicates whether or not this template has been changed from the default content.", + "readOnly": true + }, + "content": { + "type": "string", + "nullable": true + }, + "subject": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "defaultContent": { + "type": "string", + "description": "[readonly] The default content for this template", + "nullable": true + }, + "defaultSubject": { + "type": "string", + "description": "[readonly] The default subject for this template", + "nullable": true + }, + "hasSubject": { + "type": "boolean", + "description": "[readonly] If false then the Subject property is not relevant for this template type" + }, + "tokens": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[readonly] A list of tokens that can be used with this template.\r\nFor example, if 'Employee.FirstName' is in the list then use '{Employee.FirstName}' in the Content or Subject and\r\nit'll be replaced with the relevant value when the template is parsed.", + "nullable": true + }, + "tokensExpanded": { + "type": "boolean" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EmployerTemplateType": { + "enum": [ + "PayslipEmail", + "AutoEnrolment_Enrolled", + "AutoEnrolment_Enrolled_NetPay", + "AutoEnrolment_NotEnrolled", + "AutoEnrolment_Insert", + "CisStatementEmail", + "PayrunSummary", + "PayslipsUnemailed", + "PayrunAutoEmail", + "P60Email", + "AnnualCisStatementEmail", + "P45Email", + "AutoEnrolment_Postponed", + "AutoEnrolment_ReEnrolled", + "AutoEnrolment_Enrolled_SalarySacrifice", + "AutoEnrolment_ReEnrolled_SalarySacrifice", + "P11DEmail" + ], + "type": "string" + }, + "EmploymentDetails": { + "required": [ + "payrollCode" + ], + "type": "object", + "properties": { + "cisSubContractor": { + "type": "boolean", + "description": "Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information" + }, + "payrollCode": { + "maxLength": 35, + "minLength": 1, + "type": "string", + "description": "The Employees Payroll Code. Must be unique within the Employer." + }, + "jobTitle": { + "maxLength": 120, + "type": "string", + "description": "Job Title of Primary role of the Employee", + "nullable": true + }, + "onHold": { + "type": "boolean", + "description": "Set to true to temporarily exclude the employee from payruns" + }, + "onFurlough": { + "type": "boolean", + "description": "Set to true if the employee is on furlough." + }, + "furloughStart": { + "type": "string", + "description": "Furlough Start Date.", + "format": "date", + "nullable": true + }, + "furloughEnd": { + "type": "string", + "description": "Furlough End Date.", + "format": "date", + "nullable": true + }, + "furloughCalculationBasis": { + "$ref": "#/components/schemas/FurloughCalculationBasis" + }, + "furloughCalculationBasisAmount": { + "type": "number", + "format": "double" + }, + "partialFurlough": { + "type": "boolean", + "description": "Set to true if the employee is partially furloughed." + }, + "furloughHoursNormallyWorked": { + "type": "number", + "format": "double" + }, + "furloughHoursOnFurlough": { + "type": "number", + "format": "double" + }, + "isApprentice": { + "type": "boolean", + "description": "Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage" + }, + "apprenticeshipStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "apprenticeshipEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "workingPattern": { + "type": "string", + "description": "Used when calculating payments for Leave.\r\nIf null then the default Working Pattern is used", + "format": "uuid", + "nullable": true + }, + "forcePreviousPayrollCode": { + "maxLength": 35, + "type": "string", + "description": "If this property has a non-empty value then a change of Payroll code will be declared on the next FPS.", + "nullable": true + }, + "starterDetails": { + "$ref": "#/components/schemas/StarterDetails" + }, + "directorshipDetails": { + "$ref": "#/components/schemas/DirectorshipDetails" + }, + "leaverDetails": { + "$ref": "#/components/schemas/LeaverDetails" + }, + "cis": { + "$ref": "#/components/schemas/CisDetails" + }, + "department": { + "$ref": "#/components/schemas/Department" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "List of Roles held by Employee", + "nullable": true + }, + "isWorkingInFreePort": { + "type": "boolean", + "description": "Flag indicating the employee is employed in a Freeport" + }, + "veteranDetails": { + "$ref": "#/components/schemas/VeteranDetails" + }, + "continuousEmploymentDate": { + "type": "string", + "description": "[readonly] Continuous employment date for the occupational scheme.", + "format": "date", + "nullable": true + }, + "includeSecondedInfoOnStarter": { + "type": "boolean", + "description": "[readonly] If true then include seconded information on starter of FPS" + }, + "isWorkingInInvestmentZone": { + "type": "boolean", + "description": "Flag indicating the employee is employed in an Investment Zone" + } + }, + "additionalProperties": false + }, + "EntitlementBand": { + "type": "object", + "properties": { + "percentOfPay": { + "type": "number", + "format": "double" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "paySspInAddition": { + "type": "boolean" + }, + "order": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EntityType": { + "enum": [ + "None", + "Employer", + "Employee", + "PayRunEntry", + "PensionScheme", + "PayCode", + "Note", + "Leave", + "Benefits", + "Pension", + "AttachmentOrder", + "OpeningBalances", + "NicSummary", + "HmrcPayment", + "DpsNotice", + "User", + "Settings", + "PayRun", + "Loan", + "Department", + "EmployerOpeningBalances", + "EmployerGroupMembership", + "DepartmentMembership", + "TermCalendar", + "TermCalendarYear" + ], + "type": "string" + }, + "Eps": { + "type": "object", + "properties": { + "periodOfInactivity": { + "$ref": "#/components/schemas/FromToDates" + }, + "noPaymentForPeriod": { + "$ref": "#/components/schemas/FromToDates" + }, + "finalSubmission": { + "$ref": "#/components/schemas/EpsFinalSubmission" + }, + "recoverableAmounts": { + "$ref": "#/components/schemas/RecoverableAmounts" + }, + "apprenticeshipLevy": { + "$ref": "#/components/schemas/EpsApprenticeshipLevy" + }, + "account": { + "$ref": "#/components/schemas/EpsAccount" + }, + "eligibleForEmploymentAllowance": { + "type": "boolean", + "nullable": true + }, + "deMinimisStateAid": { + "$ref": "#/components/schemas/EpsDeMinimisStateAid" + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EpsAccount": { + "type": "object", + "properties": { + "accountHoldersName": { + "type": "string", + "nullable": true + }, + "accountNo": { + "type": "string", + "nullable": true + }, + "sortCode": { + "type": "string", + "nullable": true + }, + "buildingSocRef": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used on an EPS to send bank account information" + }, + "EpsApprenticeshipLevy": { + "type": "object", + "properties": { + "taxMonth": { + "type": "integer", + "format": "int32" + }, + "levyDueYTD": { + "type": "number", + "format": "double" + }, + "annualAllce": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Used on an EPS to declare an Apprenticeship Levy amount" + }, + "EpsDeMinimisStateAid": { + "type": "object", + "properties": { + "agri": { + "type": "boolean" + }, + "fisheriesAqua": { + "type": "boolean" + }, + "roadTrans": { + "type": "boolean" + }, + "indust": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "Used on an EPS to declare an Employment Allowance DeMinimis State Aid information" + }, + "EpsFinalSubmission": { + "type": "object", + "properties": { + "isFinalSubmission": { + "type": "boolean" + }, + "becauseSchemeCeased": { + "type": "boolean" + }, + "dateCeased": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used on an EPS to declare a Final Submission" + }, + "Establishment": { + "type": "object", + "properties": { + "localAuthorityNumber": { + "type": "string", + "nullable": true + }, + "schoolEmployerType": { + "type": "string", + "nullable": true + }, + "establishmentCode": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "EvcSettings": { + "type": "object", + "properties": { + "rightToRestrict": { + "type": "boolean", + "description": "If set to True then this employee shouldn't be included in data sent to EVC" + }, + "rightToDelete": { + "type": "boolean", + "description": "If set to True then the EVC service will be informed that the employee has invoked their GDPR Right To Delete" + }, + "subjectAccessRequest": { + "type": "boolean", + "description": "If set to True then the EVC service will be informed that the employee has made a Subject Access Request" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false, + "description": "Employee Settings related to the Employee Verification Programme" + }, + "Exb": { + "type": "object", + "properties": { + "additionsAmount": { + "type": "number", + "format": "double" + }, + "additionsDescription": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "deductionsAmount": { + "type": "number", + "format": "double" + }, + "deductionsDescription": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of employees with a P11D", + "format": "int32" + }, + "totalBenefits": { + "type": "number", + "description": "[readonly] Total value of benefits, not including any deductions or additions", + "format": "double" + }, + "totalAdjustedBenefits": { + "type": "number", + "description": "[readonly] Total value of benefits", + "format": "double", + "readOnly": true + }, + "nicsRate": { + "type": "number", + "description": "[readonly] The Class 1A NICS Rate", + "format": "double" + }, + "nicsPayable": { + "type": "number", + "description": "[readonly] NICs Payable", + "format": "double", + "readOnly": true + }, + "expensesAndBenefits": { + "$ref": "#/components/schemas/ExpensesAndBenefits" + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ExbDeclarations": { + "type": "object", + "properties": { + "p11Dincluded": { + "type": "string", + "nullable": true + }, + "p46CarDeclaration": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbEmployer": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbP11d": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/ExbP11dEmployee" + }, + "transferred": { + "$ref": "#/components/schemas/P11DAssetTransferredCollection" + }, + "payments": { + "$ref": "#/components/schemas/P11DPaymentCollection" + }, + "vouchersOrCCs": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "livingAccom": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "mileageAllow": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "cars": { + "$ref": "#/components/schemas/P11DCarCollection" + }, + "vans": { + "$ref": "#/components/schemas/P11dVans" + }, + "loans": { + "$ref": "#/components/schemas/P11DLoanCollection" + }, + "medical": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "relocation": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "services": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "assetsAvail": { + "$ref": "#/components/schemas/P11DAssetAvailableCollection" + }, + "other": { + "$ref": "#/components/schemas/P11DOther" + }, + "expPaid": { + "$ref": "#/components/schemas/P11dExpenses" + } + }, + "additionalProperties": false + }, + "ExbP11dEmployee": { + "type": "object", + "properties": { + "employeeUniqueId": { + "type": "string", + "format": "uuid" + }, + "dirInd": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/RtiEmployeeName" + }, + "wksNo": { + "type": "string", + "nullable": true + }, + "nino": { + "type": "string", + "nullable": true + }, + "birthDate": { + "type": "string", + "nullable": true + }, + "gender": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbP11db": { + "type": "object", + "properties": { + "class1AcontributionsDue": { + "$ref": "#/components/schemas/ExbP11dbClass1A" + } + }, + "additionalProperties": false + }, + "ExbP11dbClass1A": { + "type": "object", + "properties": { + "niCsRate": { + "type": "string", + "nullable": true + }, + "totalBenefit": { + "$ref": "#/components/schemas/ExbP11dbClass1ATotalBenefit" + }, + "adjustments": { + "$ref": "#/components/schemas/ExbP11dbClass1AAdjustments" + }, + "niCpayable": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbP11dbClass1AAdjustment": { + "type": "object", + "properties": { + "description": { + "type": "string", + "nullable": true + }, + "adjustment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbP11dbClass1AAdjustments": { + "type": "object", + "properties": { + "totalBenefit": { + "type": "string", + "nullable": true + }, + "amountDue": { + "$ref": "#/components/schemas/ExbP11dbClass1AAdjustment" + }, + "amountNotDue": { + "$ref": "#/components/schemas/ExbP11dbClass1AAdjustment" + }, + "total": { + "type": "string", + "nullable": true + }, + "payable": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbP11dbClass1ATotalBenefit": { + "type": "object", + "properties": { + "adjustmentRequired": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExbReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/Exb" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "ExpensesAndBenefits": { + "type": "object", + "properties": { + "employer": { + "$ref": "#/components/schemas/ExbEmployer" + }, + "declarations": { + "$ref": "#/components/schemas/ExbDeclarations" + }, + "p11Db": { + "$ref": "#/components/schemas/ExbP11db" + }, + "p11DrecordCount": { + "type": "integer", + "format": "int32" + }, + "p46CarRecordCount": { + "type": "integer", + "format": "int32" + }, + "p11D": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExbP11d" + }, + "nullable": true + }, + "relatedTaxYear": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExternalDataCompany": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "schemeName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "When we retrieve data from an ExternalDataProvider we normalise it so that regardless of the provider the models are the same.\r\nThis model is used to represent a Company in an ExternalDataProvider" + }, + "ExternalDataProvider": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "id": { + "$ref": "#/components/schemas/ExternalDataProviderId" + }, + "authScheme": { + "$ref": "#/components/schemas/AuthScheme" + }, + "logoUrl": { + "type": "string", + "nullable": true + }, + "iconUrl": { + "type": "string", + "nullable": true + }, + "connected": { + "type": "boolean" + }, + "connectedAs": { + "type": "string", + "nullable": true + }, + "requiresConfig": { + "type": "boolean" + }, + "deferralUrl": { + "type": "string", + "nullable": true + }, + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalDataProviderType" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ExternalDataProviderId": { + "enum": [ + "SmartPension_Employer", + "SmartPension_Adviser", + "PeoplesPension", + "Xero", + "Qbo", + "Sage", + "Nest", + "Cashplus", + "BreatheHr", + "KashFlow", + "Reckon", + "FreeAgent", + "FreeAgentPm", + "Modulr", + "Square", + "Cezanne", + "Ciphr", + "Telleroo", + "WeWorked", + "RotaCloud", + "Quinyx", + "Csod", + "Planday", + "Starling", + "Deputy", + "Bottomline", + "Twinfield", + "MyePayWindow", + "IFinance", + "AccountsIQ", + "EPaySlips", + "NetSuite" + ], + "type": "string" + }, + "ExternalDataProviderType": { + "enum": [ + "PensionSchemes", + "Accounting", + "Payments", + "Hr", + "TimeAndAttendance", + "EmployeePortal" + ], + "type": "string" + }, + "ExternalEmployeeMapping": { + "type": "object", + "properties": { + "externalId": { + "type": "string", + "description": "[readonly] The id for the employee in the external system", + "nullable": true + }, + "providerId": { + "$ref": "#/components/schemas/ExternalDataProviderId" + }, + "status": { + "$ref": "#/components/schemas/ExternalEmployeeMappingStatus" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "externalEmployee": { + "$ref": "#/components/schemas/Employee" + }, + "lastSyncDate": { + "type": "string", + "description": "[readonly] The date and time this mapping was last synchronised", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to represent details of an employee from an ExternalDataProvider, along with mapping information to an employee in the payroll system" + }, + "ExternalEmployeeMappingStatus": { + "enum": [ + "Unmapped", + "Mapped", + "Ignored", + "Import" + ], + "type": "string" + }, + "ExternalProviderConversation": { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true + }, + "contentType": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + }, + "request": { + "type": "string", + "nullable": true + }, + "response": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusMessage": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This model is used to provide details of a data exchange with an ExternalDataProvider" + }, + "FieldModification": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "nullable": true + }, + "isSignificant": { + "type": "boolean" + }, + "oldValue": { + "type": "string", + "nullable": true + }, + "newValue": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FixedCode": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "rate": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to enable calculation of Tax and NI.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "FlexibleDrawdown": { + "enum": [ + "None", + "DeathBenefit", + "Pension", + "SeriousIllHealth" + ], + "type": "string" + }, + "Fps": { + "type": "object", + "properties": { + "lateReason": { + "$ref": "#/components/schemas/FpsLateReason" + }, + "paymentDate": { + "type": "string", + "format": "date" + }, + "overridePaymentDate": { + "type": "string", + "description": "If a value if provided here then it will be used in place of the actual PaymentDate on the FPS.\r\nThe value must fall in to the same Tax Period as the PaymentDate", + "format": "date", + "nullable": true + }, + "employeeCount": { + "type": "integer", + "format": "int32" + }, + "isCorrection": { + "type": "boolean" + }, + "supersededCount": { + "type": "integer", + "description": "The number of payments on this FPS that have been superseded by later versions", + "format": "int32" + }, + "fullPaymentSubmission": { + "$ref": "#/components/schemas/FullPaymentSubmission" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FpsPriorVersion" + }, + "description": "If any of the payments on this FPS appear on another FPS then\r\nthen there will be an entry here for each of them.\r\nIf there is an entry where the FpsId matches this FPS then that means the FpsEmployee on this Fps\r\nis itself a prior version (ie, it's been superseded)", + "nullable": true + }, + "validationWarnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RtiValidationWarning" + }, + "nullable": true, + "readOnly": true + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "FpsBenefit": { + "type": "object", + "properties": { + "car": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FpsCar" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsCar": { + "type": "object", + "properties": { + "make": { + "type": "string", + "nullable": true + }, + "firstRegd": { + "type": "string", + "nullable": true + }, + "cO2": { + "type": "string", + "nullable": true + }, + "zeroEmissionsMileage": { + "type": "string", + "nullable": true + }, + "fuel": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "amendment": { + "type": "string", + "nullable": true + }, + "price": { + "type": "string", + "nullable": true + }, + "availFrom": { + "type": "string", + "nullable": true + }, + "cashEquiv": { + "type": "string", + "nullable": true + }, + "availTo": { + "type": "string", + "nullable": true + }, + "freeFuel": { + "$ref": "#/components/schemas/FpsCarFuel" + } + }, + "additionalProperties": false + }, + "FpsCarFuel": { + "type": "object", + "properties": { + "provided": { + "type": "string", + "nullable": true + }, + "cashEquiv": { + "type": "string", + "nullable": true + }, + "withdrawn": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployee": { + "type": "object", + "properties": { + "payrunEntryId": { + "type": "string", + "format": "uuid" + }, + "employeeUniqueId": { + "type": "string", + "format": "uuid" + }, + "item": { + "$ref": "#/components/schemas/Item" + }, + "employeeDetails": { + "$ref": "#/components/schemas/FpsEmployeeDetails" + }, + "employment": { + "$ref": "#/components/schemas/FpsEmployment" + }, + "validationWarnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RtiValidationWarning" + }, + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeDetails": { + "type": "object", + "properties": { + "nino": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/RtiEmployeeName" + }, + "address": { + "$ref": "#/components/schemas/RtiEmployeeAddress" + }, + "birthDate": { + "type": "string", + "nullable": true + }, + "gender": { + "type": "string", + "nullable": true + }, + "passportNumber": { + "type": "string", + "nullable": true + }, + "partnerDetails": { + "$ref": "#/components/schemas/FpsEmployeeDetailsPartnerDetails" + } + }, + "additionalProperties": false + }, + "FpsEmployeeDetailsPartnerDetails": { + "type": "object", + "properties": { + "nino": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/RtiEmployeeName" + } + }, + "additionalProperties": false + }, + "FpsEmployeeFigsToDate": { + "type": "object", + "properties": { + "taxablePay": { + "type": "string", + "nullable": true + }, + "totalTax": { + "type": "string", + "nullable": true + }, + "studentLoansTD": { + "type": "string", + "nullable": true + }, + "postgradLoansTD": { + "type": "string", + "nullable": true + }, + "benefitsTaxedViaPayrollYTD": { + "type": "string", + "nullable": true + }, + "empeePenContribnsPaidYTD": { + "type": "string", + "nullable": true + }, + "empeePenContribnsNotPaidYTD": { + "type": "string", + "nullable": true + }, + "smpytd": { + "type": "string", + "nullable": true + }, + "sppytd": { + "type": "string", + "nullable": true + }, + "sapytd": { + "type": "string", + "nullable": true + }, + "shppytd": { + "type": "string", + "nullable": true + }, + "spbpytd": { + "type": "string", + "nullable": true + }, + "sspytd": { + "type": "string", + "nullable": true + }, + "gross": { + "type": "string", + "nullable": true + }, + "netPay": { + "type": "string", + "nullable": true + }, + "additions": { + "type": "string", + "nullable": true + }, + "deductions": { + "type": "string", + "nullable": true + }, + "takeHomePay": { + "type": "string", + "nullable": true + }, + "adjustments": { + "type": "string", + "nullable": true + }, + "mapsMiles": { + "type": "string", + "nullable": true + }, + "foreignTaxAmount": { + "type": "string", + "nullable": true + }, + "foreignTaxAmountReclaimed": { + "type": "string", + "nullable": true + }, + "pensionableEarnings": { + "type": "string", + "nullable": true + }, + "pensionablePay": { + "type": "string", + "nullable": true + }, + "employerPensionContribution": { + "type": "string", + "nullable": true + }, + "employeePensionContribution": { + "type": "string", + "nullable": true + }, + "employeePensionContributionAvc": { + "type": "string", + "nullable": true + }, + "paymentAfterLeaving": { + "type": "string", + "nullable": true + }, + "taxOnPaymentAfterLeaving": { + "type": "string", + "nullable": true + }, + "nonTaxOrNICPmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeFlexibleDrawdown": { + "type": "object", + "properties": { + "flexiblyAccessingPensionRights": { + "type": "string", + "nullable": true + }, + "pensionDeathBenefit": { + "type": "string", + "nullable": true + }, + "seriousIllHealthLumpSum": { + "type": "string", + "nullable": true + }, + "taxablePayment": { + "type": "string", + "nullable": true + }, + "nontaxablePayment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeNIlettersAndValues": { + "type": "object", + "properties": { + "nIletter": { + "type": "string", + "nullable": true + }, + "grossEarningsForNICsInPd": { + "type": "string", + "nullable": true + }, + "grossEarningsForNICsYTD": { + "type": "string", + "nullable": true + }, + "atLELYTD": { + "type": "string", + "nullable": true + }, + "leLtoPTYTD": { + "type": "string", + "nullable": true + }, + "pTtoUELYTD": { + "type": "string", + "nullable": true + }, + "totalEmpNICInPd": { + "type": "string", + "nullable": true + }, + "totalEmpNICYTD": { + "type": "string", + "nullable": true + }, + "empeeContribnsInPd": { + "type": "string", + "nullable": true + }, + "empeeContribnsYTD": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeePayment": { + "type": "object", + "properties": { + "bacsHashCode": { + "type": "string", + "nullable": true + }, + "payFreq": { + "type": "string", + "nullable": true + }, + "pmtDate": { + "type": "string", + "nullable": true + }, + "lateReason": { + "type": "string", + "nullable": true + }, + "weekNo": { + "type": "string", + "nullable": true + }, + "monthNo": { + "type": "string", + "nullable": true + }, + "periodsCovered": { + "type": "integer", + "format": "int32" + }, + "aggregatedEarnings": { + "type": "string", + "nullable": true + }, + "pmtAfterLeaving": { + "type": "string", + "nullable": true + }, + "hoursWorked": { + "type": "string", + "nullable": true + }, + "taxCode": { + "$ref": "#/components/schemas/FpsEmployeeTaxCode" + }, + "taxablePay": { + "type": "string", + "nullable": true + }, + "nonTaxOrNICPmt": { + "type": "string", + "nullable": true + }, + "dednsFromNetPay": { + "type": "string", + "nullable": true + }, + "payAfterStatDedns": { + "type": "string", + "nullable": true + }, + "benefitsTaxedViaPayroll": { + "type": "string", + "nullable": true + }, + "class1ANICsYTD": { + "type": "string", + "nullable": true + }, + "benefits": { + "$ref": "#/components/schemas/FpsBenefit" + }, + "empeePenContribnsPaid": { + "type": "string", + "nullable": true + }, + "itemsSubjectToClass1NIC": { + "type": "string", + "nullable": true + }, + "empeePenContribnsNotPaid": { + "type": "string", + "nullable": true + }, + "studentLoanRecovered": { + "$ref": "#/components/schemas/StudentLoanRecovered" + }, + "postgradLoanRecovered": { + "type": "string", + "nullable": true + }, + "taxDeductedOrRefunded": { + "type": "string", + "nullable": true + }, + "onStrike": { + "type": "string", + "nullable": true + }, + "unpaidAbsence": { + "type": "string", + "nullable": true + }, + "smpytd": { + "type": "string", + "nullable": true + }, + "sppytd": { + "type": "string", + "nullable": true + }, + "sapytd": { + "type": "string", + "nullable": true + }, + "shPPYTD": { + "type": "string", + "nullable": true + }, + "spbpytd": { + "type": "string", + "nullable": true + }, + "trivialCommutationPayment": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FpsEmployeeTrivialCommutationPayment" + }, + "nullable": true + }, + "flexibleDrawdown": { + "$ref": "#/components/schemas/FpsEmployeeFlexibleDrawdown" + } + }, + "additionalProperties": false + }, + "FpsEmployeeSeconded": { + "type": "object", + "properties": { + "inOutUK": { + "type": "string", + "nullable": true + }, + "stay183DaysOrMore": { + "type": "string", + "nullable": true + }, + "stayLessThan183Days": { + "type": "string", + "nullable": true + }, + "eeaCitizen": { + "type": "string", + "nullable": true + }, + "epM6": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeStarter": { + "type": "object", + "properties": { + "startDate": { + "type": "string", + "nullable": true + }, + "startDec": { + "type": "string", + "nullable": true + }, + "studentLoan": { + "type": "string", + "nullable": true + }, + "postgradLoan": { + "type": "string", + "nullable": true + }, + "occPension": { + "$ref": "#/components/schemas/FpsEmployeeStarterOccPension" + }, + "seconded": { + "$ref": "#/components/schemas/FpsEmployeeSeconded" + } + }, + "additionalProperties": false + }, + "FpsEmployeeStarterOccPension": { + "type": "object", + "properties": { + "bereaved": { + "type": "string", + "nullable": true + }, + "amount": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeTaxCode": { + "type": "object", + "properties": { + "basisNonCumulative": { + "type": "string", + "nullable": true + }, + "taxRegime": { + "type": "string", + "nullable": true + }, + "taxCode": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployeeTrivialCommutationPayment": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployerPayIdChanged": { + "type": "object", + "properties": { + "payrollIdChangedIndicator": { + "type": "string", + "nullable": true + }, + "oldPayrollId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsEmployment": { + "type": "object", + "properties": { + "employeeCurrentNiLetter": { + "type": "string", + "nullable": true + }, + "offPayrollWorker": { + "type": "string", + "nullable": true + }, + "occPenInd": { + "type": "string", + "nullable": true + }, + "directorsNIC": { + "type": "string", + "nullable": true + }, + "taxWkOfApptOfDirector": { + "type": "string", + "nullable": true + }, + "starter": { + "$ref": "#/components/schemas/FpsEmployeeStarter" + }, + "payId": { + "type": "string", + "nullable": true + }, + "payIdChgd": { + "$ref": "#/components/schemas/FpsEmployerPayIdChanged" + }, + "paymentToANonIndividual": { + "type": "string", + "nullable": true + }, + "irrEmp": { + "type": "string", + "nullable": true + }, + "leavingDate": { + "type": "string", + "nullable": true + }, + "figuresToDate": { + "$ref": "#/components/schemas/FpsEmployeeFigsToDate" + }, + "payment": { + "$ref": "#/components/schemas/FpsEmployeePayment" + }, + "nIlettersAndValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FpsEmployeeNIlettersAndValues" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "FpsFields": { + "type": "object", + "properties": { + "offPayrollWorker": { + "type": "boolean" + }, + "irregularPaymentPattern": { + "type": "boolean", + "description": "True if employee is currently on an irregular payment patter" + }, + "nonIndividual": { + "type": "boolean", + "description": "True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative)" + }, + "hoursNormallyWorked": { + "$ref": "#/components/schemas/HoursNormallyWorked" + }, + "excludeFromRtiSubmissions": { + "type": "boolean", + "description": "True if Employee is excluded from RTI submissions" + } + }, + "additionalProperties": false + }, + "FpsLateReason": { + "enum": [ + "NoneGiven", + "NotionalExpat", + "NotionalErs", + "NotionalOther", + "Class1", + "MicroEmployer", + "NoRequirement", + "ReasonableExcuse", + "Correction" + ], + "type": "string" + }, + "FpsPriorVersion": { + "type": "object", + "properties": { + "payRunEntryId": { + "type": "string", + "format": "uuid" + }, + "fpsId": { + "type": "string", + "description": "The Id of the FPS that contains an earlier version of the PayRunEntry", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "FpsReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/Fps" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "FromToDates": { + "type": "object", + "properties": { + "from": { + "type": "string", + "format": "date" + }, + "to": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false + }, + "FullPaymentSubmission": { + "type": "object", + "properties": { + "employee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FpsEmployee" + }, + "nullable": true + }, + "relatedTaxYear": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FullSummaryOfPayReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FullSummaryOfPayReportLine" + }, + "nullable": true + }, + "deductionLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FullSummaryOfPayReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FullSummaryOfPayReportLine": { + "type": "object", + "properties": { + "payCode": { + "$ref": "#/components/schemas/PayCode" + }, + "value": { + "type": "number", + "format": "double" + }, + "erValue": { + "type": "number", + "format": "double", + "nullable": true + }, + "qty": { + "type": "number", + "format": "double", + "nullable": true + }, + "headCount": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "FullSummaryOfPayReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/FullSummaryOfPayReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "FurloughCalculationBasis": { + "enum": [ + "ActualPaidAmount", + "DailyReferenceAmount", + "MonthlyReferenceAmount" + ], + "type": "string" + }, + "FurloughReport": { + "type": "object", + "properties": { + "maxClaimPerEmployee": { + "type": "number", + "format": "double" + }, + "percentageOfNIAndPensionToClaim": { + "type": "number", + "format": "double" + }, + "govtContribRate": { + "type": "number", + "format": "double" + }, + "companyName": { + "type": "string", + "nullable": true + }, + "employerReference": { + "type": "string", + "nullable": true + }, + "companyCrn": { + "type": "string", + "nullable": true + }, + "ctUtr": { + "type": "string", + "nullable": true + }, + "saUtr": { + "type": "string", + "nullable": true + }, + "claimPeriodStartDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "claimPeriodEndDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "numberOfEmployeesBeingFurloughed": { + "type": "integer", + "format": "int32" + }, + "totalClaimAmount": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalGrossPay": { + "type": "number", + "format": "double" + }, + "amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod": { + "type": "number", + "format": "double" + }, + "amountClaimedForEmployerNICsContributionsForFurloughedEmployees": { + "type": "number", + "format": "double" + }, + "amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees": { + "type": "number", + "format": "double" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FurloughReportLine" + }, + "nullable": true + }, + "bankAccountNumber": { + "type": "string", + "nullable": true + }, + "bankSortCode": { + "type": "string", + "nullable": true + }, + "bankAccountHoldersFirstName": { + "type": "string", + "nullable": true + }, + "bankAccountHoldersLastName": { + "type": "string", + "nullable": true + }, + "bankAccountHoldersAddress": { + "type": "string", + "nullable": true + }, + "buildingSocietyRollNumber": { + "type": "string", + "nullable": true + }, + "companyAddress": { + "type": "string", + "nullable": true + }, + "contactName": { + "type": "string", + "nullable": true + }, + "contactNumber": { + "type": "string", + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FurloughReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "employeesFullName": { + "type": "string", + "nullable": true + }, + "employeesNINO": { + "type": "string", + "nullable": true + }, + "employeesPayrollReferenceNumber": { + "type": "string", + "nullable": true + }, + "furloughedDays": { + "type": "integer", + "format": "int32" + }, + "daysInPeriod": { + "type": "integer", + "format": "int32" + }, + "hoursNormallyWorked": { + "type": "number", + "format": "double", + "nullable": true + }, + "hoursFurloughed": { + "type": "number", + "format": "double", + "nullable": true + }, + "percentageOfFurloughedDaysWorked": { + "type": "number", + "format": "double" + }, + "grossPay": { + "type": "number", + "format": "double" + }, + "grossPayClaim": { + "type": "number", + "format": "double" + }, + "niClaim": { + "type": "number", + "format": "double" + }, + "pensionClaim": { + "type": "number", + "format": "double" + }, + "totalClaim": { + "type": "number", + "format": "double", + "readOnly": true + }, + "furloughStart": { + "type": "string", + "format": "date", + "nullable": true + }, + "furloughEnd": { + "type": "string", + "format": "date", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FurloughReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/FurloughReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Gender": { + "enum": [ + "Male", + "Female" + ], + "type": "string" + }, + "GenderPayGapLine": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "nullable": true + }, + "forename": { + "type": "string", + "nullable": true + }, + "surname": { + "type": "string", + "nullable": true + }, + "gender": { + "$ref": "#/components/schemas/Gender" + }, + "fullPay": { + "type": "string", + "nullable": true + }, + "ordinaryPay": { + "type": "number", + "format": "double" + }, + "periodBonus": { + "type": "number", + "format": "double" + }, + "bonusRbp": { + "type": "number", + "format": "double" + }, + "weeklyHours": { + "type": "number", + "format": "double" + }, + "hourlyRate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "GenderPayGapReport": { + "type": "object", + "properties": { + "genderPayGapLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenderPayGapLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "GenderPayGapReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/GenderPayGapReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "GenderPayGapSnapShotDate": { + "enum": [ + "March", + "April" + ], + "type": "string" + }, + "GovTalk": { + "type": "object", + "properties": { + "fullPaymentSubmissionNamespace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "fullPaymentSubmissionNamespaceVersion": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerPaymentSummaryNamespace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerPaymentSummaryNamespaceVersion": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "niNoVerificationRequestNameSpace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "cisVerificationRequestNameSpace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "cis300NameSpace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "expensesAndBenefitsNameSpace": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "expensesAndBenefitsNameSpaceVersion": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses submit documents to the HMRC Gateway.\r\nIt is used internally when our engine communicates with HMRC.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "GovTalkError": { + "type": "object", + "properties": { + "raisedBy": { + "type": "string", + "nullable": true + }, + "number": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "text": { + "type": "string", + "nullable": true + }, + "location": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "GovTalkSubmission": { + "type": "object", + "properties": { + "rawResponse": { + "type": "string", + "nullable": true + }, + "messageClass": { + "type": "string", + "nullable": true + }, + "pollInterval": { + "type": "integer", + "format": "int32" + }, + "lastPoll": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "correlationId": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "url": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/SubmissionStatus" + }, + "message": { + "type": "string", + "nullable": true + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "errorsJson": { + "type": "string", + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GovTalkError" + }, + "nullable": true + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "GrossToNetReport": { + "type": "object", + "properties": { + "forCis": { + "type": "boolean" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrossToNetReportLine" + }, + "nullable": true + }, + "cisLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrossToNetReportCisLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "GrossToNetReportCisLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "totalGross": { + "type": "number", + "format": "double" + }, + "labour": { + "type": "number", + "format": "double" + }, + "materials": { + "type": "number", + "format": "double" + }, + "taxableGross": { + "type": "number", + "format": "double" + }, + "cisDeduction": { + "type": "number", + "format": "double" + }, + "umbrellaFee": { + "type": "number", + "format": "double" + }, + "vat": { + "type": "number", + "format": "double" + }, + "payment": { + "type": "number", + "format": "double" + }, + "lastName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "GrossToNetReportLine": { + "type": "object", + "properties": { + "niNumber": { + "type": "string", + "nullable": true + }, + "totalGross": { + "type": "number", + "format": "double" + }, + "taxableGross": { + "type": "number", + "format": "double" + }, + "netPay": { + "type": "number", + "format": "double" + }, + "tax": { + "type": "number", + "format": "double" + }, + "employeeNi": { + "type": "number", + "format": "double" + }, + "employerNi": { + "type": "number", + "format": "double" + }, + "employeePension": { + "type": "number", + "format": "double" + }, + "employerPension": { + "type": "number", + "format": "double" + }, + "studentOrPgLoan": { + "type": "number", + "format": "double" + }, + "statutoryPayments": { + "type": "number", + "format": "double" + }, + "attachments": { + "type": "number", + "format": "double" + }, + "otherDeductions": { + "type": "number", + "format": "double" + }, + "lastName": { + "type": "string", + "nullable": true + }, + "isNewStarter": { + "type": "boolean" + }, + "isLeaver": { + "type": "boolean" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "GrossToNetReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/GrossToNetReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "HmrcDetails": { + "type": "object", + "properties": { + "officeNumber": { + "maxLength": 3, + "type": "string", + "nullable": true + }, + "payeReference": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "accountsOfficeReference": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "econ": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "utr": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "coTax": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "employmentAllowance": { + "type": "boolean" + }, + "employmentAllowanceMaxClaim": { + "type": "number", + "description": "You might reduce this from the default if you've made/are making a claim in another system", + "format": "double" + }, + "smallEmployersRelief": { + "type": "boolean" + }, + "apprenticeshipLevy": { + "type": "boolean" + }, + "apprenticeshipLevyAllowance": { + "type": "number", + "format": "double" + }, + "quarterlyPaymentSchedule": { + "type": "boolean", + "description": "Set to true if the employer pays HMRC on a quarterly schedule.\r\nA value of false implies a monthly schedule.\r\nWarning: Changing this value after starting PayRuns will\r\ndelete any existing payments or adjustments you may have entered." + }, + "includeEmploymentAllowanceOnMonthlyJournal": { + "type": "boolean", + "description": "If the employer is not on a QuarterlyPaymentSchedule\r\nand is claiming EmploymentAllowance, then set this to true to include a line for\r\nEmployment Allowance on the journal for the monthly schedule." + }, + "carryForwardUnpaidLiabilities": { + "type": "boolean", + "description": "If set to true then any unpaid amounts from previous periods will be brought forward\r\nto work out the liability for the current period.\r\nYou'd set this to false if you don't want to track payments." + }, + "paymentDateRule": { + "$ref": "#/components/schemas/PaymentDateRule" + }, + "paymentDateDayOfMonth": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "HmrcLiability": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "[readonly] A descriptive name for the Period", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "periodEnding": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "periodComplete": { + "type": "boolean", + "description": "[readonly] Indicates whether or not all PayRuns for this period have been completed" + }, + "recoverableAmountsEpsCreated": { + "type": "boolean", + "description": "[readonly] If there are recoverable amount present (ie, SMP) and the Period is complete then this field Indicates \r\nwhether or not an EPS has been created up to the final tax month of this period to declare\r\nthe recoverable amounts" + }, + "apprenticeshipLevyEpsCreated": { + "type": "boolean", + "description": "[readonly] If there is an Apprenticeship LEvy amount present and the Period is complete then this field Indicates \r\nwhether or not an EPS has been created up to the final tax month of this period to declare\r\nthe amount" + }, + "payRuns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRun" + }, + "nullable": true + }, + "tax": { + "type": "number", + "description": "[readonly] Amount due to HMRC for PAYE in period", + "format": "double" + }, + "cisDeductions": { + "type": "number", + "description": "[readonly] Amount due to HMRC for CIS Deductions made in period", + "format": "double" + }, + "postgradLoanDeductions": { + "type": "number", + "description": "[readonly] Amount due to HMRC for Postgrad Loan Deductions made in period", + "format": "double" + }, + "studentLoanDeductions": { + "type": "number", + "description": "[readonly] Amount due to HMRC for Student Loan Deductions made in period", + "format": "double" + }, + "employeeNic": { + "type": "number", + "description": "[readonly] Amount due to HMRC for Employee NIC Contributions withheld in period", + "format": "double" + }, + "employerNic": { + "type": "number", + "description": "[readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period", + "format": "double" + }, + "realTimeClass1ANic": { + "type": "number", + "description": "[readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period", + "format": "double" + }, + "smp": { + "type": "number", + "description": "[readonly] SMP recovered from payments in period", + "format": "double" + }, + "smpNic": { + "type": "number", + "description": "[readonly] SMP NIC Compensation for period", + "format": "double" + }, + "spp": { + "type": "number", + "description": "[readonly] SPP recovered from payments in period", + "format": "double" + }, + "sppNic": { + "type": "number", + "description": "[readonly] SPP Nic Compensation for period", + "format": "double" + }, + "sap": { + "type": "number", + "description": "[readonly] SAP recovered from payments in period", + "format": "double" + }, + "sapNic": { + "type": "number", + "description": "[readonly] SAP Nic Compensation for period", + "format": "double" + }, + "shpp": { + "type": "number", + "description": "[readonly] ShPP recovered from payments in period", + "format": "double" + }, + "shppNic": { + "type": "number", + "description": "[readonly] ShPP Nic Compensation for period", + "format": "double" + }, + "spbp": { + "type": "number", + "description": "[readonly] SPBP recovered from payments in period", + "format": "double" + }, + "spbpNic": { + "type": "number", + "description": "[readonly] SPBP Nic Compensation for period", + "format": "double" + }, + "eligibleForEmploymentAllowance": { + "type": "boolean", + "description": "[readonly] Indicates whether the Employer settings say the Employer is eligible for Employment Allowance" + }, + "employmentAllowanceClaim": { + "type": "number", + "description": "Amount to claim with respect to the Employment Allowance", + "format": "double" + }, + "employmentAllowanceClaimAuto": { + "type": "boolean", + "description": "If set to true, we'll automatically claim the maximum allowed.\r\nIf set to false then you can enter your own value.\r\nIf EligibleForEmploymentAllowance is false then the EmploymentAllowanceClaim will \r\nalways be overwritten with a zero value regardless of this property" + }, + "liableForApprenticeshipLevy": { + "type": "boolean", + "description": "[readonly] Indicates whether the Employer settings say the Employer is liable for the Apprenticeship Levy" + }, + "apprenticeshipLevy": { + "type": "number", + "description": "Amount due with respect to the Apprenticeship Levy", + "format": "double" + }, + "apprenticeshipLevyAuto": { + "type": "boolean", + "description": "If set to true, we'll automatically calculate your liability\r\nIf set to false then you can enter your own value.\r\nIf LiableForApprenticeshipLevy is false then the ApprenticeshipLevy will \r\nalways be overwritten with a zero value regardless of this property" + }, + "liabilityArisingInPeriod": { + "type": "number", + "description": "[readonly] Total Liability (before any deductions) arising in this Period", + "format": "double", + "readOnly": true + }, + "dueInPreviousPeriods": { + "type": "number", + "description": "[readonly] Amount due to HMRC in previous periods for this Tax Year", + "format": "double" + }, + "paidInPreviousPeriods": { + "type": "number", + "description": "[readonly] Amount paid to HMRC in previous periods for this Tax Year", + "format": "double" + }, + "employmentAllowanceClaimInPreviousPeriods": { + "type": "number", + "description": "[readonly] The amount of Employment Allowance claimed in previous periods for this Tax Year", + "format": "double" + }, + "receivedFromHMRCToRefundTax": { + "type": "number", + "description": "Any amount received from HMRC to refund Tax in Period", + "format": "double" + }, + "receivedFromHMRCToPayStatutoryPay": { + "type": "number", + "description": "Any amount received from HMRC to pay Statutory Pay Period", + "format": "double" + }, + "cisDeductionsSuffered": { + "type": "number", + "description": "CIS Deductions Suffered in Period", + "format": "double" + }, + "adjustment": { + "type": "number", + "description": "Any manual adjustment for Period", + "format": "double" + }, + "netLiabilityForPeriod": { + "type": "number", + "description": "[readonly] Net Liability (including any deductions/additions) arising in this Period", + "format": "double", + "readOnly": true + }, + "totalPaid": { + "type": "number", + "description": "[readonly] The total value of all payments in this period", + "format": "double" + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HmrcPayment" + }, + "nullable": true + }, + "fpsList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "nullable": true + }, + "allowLinkedEps": { + "type": "boolean", + "description": "If true this will allow you to submit a combined Employer Payment Summary" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "HmrcPayment": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "format": "double" + }, + "date": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "HolidayAccrual": { + "enum": [ + "RegularPayOnly", + "AllGrossPay", + "PaycodeSet", + "WorkingPatternHours" + ], + "type": "string" + }, + "HolidayAccrualDefaultRateType": { + "enum": [ + "HourlyRate", + "AverageHolidayRate", + "FixedPeriodAmount" + ], + "type": "string" + }, + "HolidayReport": { + "type": "object", + "properties": { + "accrualsReport": { + "type": "boolean" + }, + "accrualsHrsReport": { + "type": "boolean" + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HolidayReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "HolidayReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "dayRate": { + "type": "number", + "format": "double", + "nullable": true + }, + "leaveSettings": { + "$ref": "#/components/schemas/LeaveSettings" + } + }, + "additionalProperties": false + }, + "HolidayReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/HolidayReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "HolidaySchemeDurationType": { + "enum": [ + "Hours", + "Days" + ], + "type": "string" + }, + "HolidayType": { + "enum": [ + "Days", + "Accrual_Money", + "Accrual_Days", + "Accrual_Hours" + ], + "type": "string" + }, + "HourlyPayReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HourlyPayReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "HourlyPayReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "payCode": { + "type": "string", + "nullable": true + }, + "period": { + "type": "integer", + "format": "int32" + }, + "hours": { + "type": "number", + "format": "double" + }, + "rate": { + "type": "number", + "format": "double" + }, + "total": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "HourlyPayReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/HourlyPayReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "HoursNormallyWorked": { + "enum": [ + "LessThan16", + "MoreThan16", + "MoreThan24", + "MoreThan30", + "NotRegular" + ], + "type": "string" + }, + "HtmlEmailSettings": { + "type": "object", + "properties": { + "bodyCssStyle": { + "type": "string", + "nullable": true + }, + "fontCssStyle": { + "type": "string", + "nullable": true + }, + "buttonCssStyle": { + "type": "string", + "nullable": true + }, + "headerHtml": { + "type": "string", + "nullable": true + }, + "footerHtml": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "HtmlInsertionPoint": { + "enum": [ + "CreateEmployer", + "EmployeeDetails" + ], + "type": "string" + }, + "IncrementRule": { + "enum": [ + "Manual", + "Annual", + "April", + "April6m" + ], + "type": "string" + }, + "Invitation": { + "required": [ + "emailAddress" + ], + "type": "object", + "properties": { + "employer": { + "$ref": "#/components/schemas/Item" + }, + "emailAddress": { + "maxLength": 150, + "minLength": 1, + "type": "string", + "description": "The email address of the user that is being invited to access the Employer", + "format": "email" + }, + "message": { + "type": "string", + "description": "An optional message to include in the email sent to the EmailAddress", + "nullable": true + }, + "role": { + "$ref": "#/components/schemas/UserRole" + }, + "emailId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "emailStatus": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "invitedBy": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Invitations are used to invite other users to access an existing Employer" + }, + "Item": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ItemListReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "JobStatus": { + "enum": [ + "Queued", + "Executing", + "Completed", + "Failed", + "CompletedWithErrors" + ], + "type": "string" + }, + "JobType": { + "enum": [ + "Report", + "Import", + "PayRun" + ], + "type": "string" + }, + "JournalCsvFormat": { + "enum": [ + "Default", + "SapS4Hana", + "MappedOutput" + ], + "type": "string" + }, + "JournalTemplate": { + "type": "object", + "properties": { + "header": { + "type": "string", + "description": "Header of Journal Template", + "nullable": true + }, + "content": { + "type": "string", + "description": "Content of Journal Template", + "nullable": true + }, + "useColumnHeaders": { + "type": "boolean", + "description": "Use Column Headers indicates whether to use column headers while parsing the content in CSV format" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "JournalTokenType": { + "enum": [ + "SystemToken", + "CustomToken", + "TextToken", + "ValueToken" + ], + "type": "string" + }, + "Leave": { + "type": "object", + "properties": { + "providerId": { + "$ref": "#/components/schemas/ExternalDataProviderId" + }, + "externalId": { + "maxLength": 100, + "type": "string", + "description": "If the Leave comes from an ExternalDataProvider, then this is its Id in the ExternalDataProvider", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/LeaveType" + }, + "pay": { + "$ref": "#/components/schemas/LeavePayType" + }, + "payFrequency": { + "$ref": "#/components/schemas/StatPayFrequency" + }, + "payRunExistsWithStatPay": { + "type": "boolean" + }, + "from": { + "type": "string", + "description": "The first day of Leave.\r\nIf it's a half day PM then set the time portion to 12:00:00, otherwise leave it blank or set it to 00:00:00", + "format": "date-time" + }, + "to": { + "type": "string", + "description": "The last day of Leave.\r\nIf it's a half day AM then set the time portion to 11:59:59, otherwise set it to 23:59:59", + "format": "date-time" + }, + "notes": { + "maxLength": 300, + "type": "string", + "description": "A free-form text field to record any comments", + "nullable": true + }, + "averageWeeklyEarnings": { + "type": "number", + "description": "The employees average weekly earnings. Only relevant for Statutory Pay\r\nIt's advised that you don't try to calculate this yourself.", + "format": "double" + }, + "automaticAWECalculation": { + "type": "boolean", + "description": "If set to True then we'll automatically calculate the AverageWeeklyEarnings. \r\nSet it to false if you want to manually provide a figure that overrides our calculations" + }, + "babyDate": { + "type": "string", + "description": "Only required for Parental Leave with Statutory Pay\r\nIf Type is Maternity or Paternity then this is the date the baby is due.\r\nFor Adoption this is the Matching Date.", + "format": "date", + "nullable": true + }, + "secondaryBabyDate": { + "type": "string", + "description": "Only used for Parental Leave with Statutory Pay\r\nIf Type is Maternity, Paternity, SharedParental (Birth) then this is the the Baby Born Date.\r\nFor Adoption or SharedParental (Adoption) this is the Expected Placement Date.", + "format": "date", + "nullable": true + }, + "tertiaryBabyDate": { + "type": "string", + "description": "Only used for Parental Leave with Statutory Pay\r\nIf Type is Adoption this is the Placement Date.", + "format": "date", + "nullable": true + }, + "overridePaymentDescription": { + "type": "boolean", + "description": "If Pay is StatutoryPay and you want to override our description that goes with the payment then set this to true" + }, + "overridenPaymentDescription": { + "maxLength": 150, + "type": "string", + "description": "If OverridePaymentDescription is true and Pay is set to StatutoryPay then we'll use this as the description for the payment amount.", + "nullable": true + }, + "workingDays": { + "type": "number", + "description": "[readonly] The number of working days covered by this leave.\r\nThis is calculated based on the employees Working Pattern.", + "format": "double" + }, + "workingDaysOverride": { + "type": "number", + "description": "If a value is provided here then this will be used in place of the calculated WorkingDays value", + "format": "double", + "nullable": true + }, + "totalDays": { + "type": "number", + "description": "[readonly] The number of days covered by this leave, regardless of whether or not they're working days.\r\nThis is calculated based on the employees Working Pattern.", + "format": "double" + }, + "totalDaysOverride": { + "type": "number", + "description": "If a value is provided here then this will be used in place of the calculated TotalDays value", + "format": "double", + "nullable": true + }, + "useAssumedPensionablePay": { + "type": "boolean", + "description": "If this Leave has Statutory Pay then if this is set to True\r\nwe will use the value set in AssumedPensionablePay to work out the employer pension contributions" + }, + "assumedPensionablePays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaveAssumedPensionablePay" + }, + "description": "if UseAssumedPensionablePay is True, then this is the value used to calculate the employer pension contributions", + "nullable": true + }, + "offsetPay": { + "type": "boolean", + "description": "If this Leave has Statutory Pay and this is set to True and the employe eis paid a fixed amoutn per period\r\nwith Leave Adjustments set to automatic, then we'll reduce their pay for the period by the statutory amount\r\nso the employee still gets paid the full amount." + }, + "sspPayFromDayOne": { + "type": "boolean", + "description": "If this is Sick Leave with Statutory Pay then setting this to true\r\nwill force SSP to be paid from day one rather than the usual rule \r\nof the first Working Day after 3 Qualifying Days" + }, + "linkedPiw": { + "$ref": "#/components/schemas/LinkedPiw" + }, + "kitSplitDays": { + "type": "array", + "items": { + "type": "string", + "format": "date-time" + }, + "description": "If the LeaveType supports KIT/SPLIT days then use this property to store the list of dates", + "nullable": true + }, + "historicSspRequiresProcessing": { + "type": "boolean", + "description": "Only used during the creation of historical SSP.\r\nWhen creating historical SSP, this will determine whether to pay that leave in the next PayRun." + }, + "historicSxpRequiresProcessing": { + "type": "boolean", + "description": "Used during to determine whether to back pay before current payrun" + }, + "openingPay": { + "type": "number", + "description": "Opening pay which has already been paid to the employee in another system", + "format": "double", + "nullable": true + }, + "useOpeningPay": { + "type": "boolean", + "description": "Use the OpeningPay which has already been paid in another system" + }, + "historicOspRequiresProcessing": { + "type": "boolean", + "description": "Only used during the creation of sickness Occupational Policy.\r\nWhen creating historical SOP, this will determine whether to pay that leave in the next PayRun." + }, + "historicOmpRequiresProcessing": { + "type": "boolean", + "description": "Only used during the creation and update of occupational maternity leaves.\r\nWhen creating or updating historical occupational leaves, this will determine whether to pay the historic payments or correction in the next PayRun." + }, + "historicSmpRequiresProcessing": { + "type": "boolean", + "description": "Only used during the creation and update of statutory maternity leaves.\r\nWhen creating or updating historical statutory maternity leaves, this will determine whether to pay the historic payments or correction in the next PayRun." + }, + "occupationalMaternityPolicyUniqueId": { + "type": "string", + "description": "Occupational Maternity Policy Id when leave type is Maternity and payment type is occupational policy", + "format": "uuid", + "nullable": true + }, + "openingOmpPay": { + "type": "number", + "description": "Opening occupational pay which has already been paid to the employee", + "format": "double", + "nullable": true + }, + "payRunExistsWithOccMaternityPay": { + "type": "boolean", + "description": "Indicates whether there is occupational maternity payment associated with a leave in the current pay run." + }, + "calculationType": { + "$ref": "#/components/schemas/LeaveCalculationType" + }, + "strikeHoursToDeduct": { + "type": "number", + "description": "The number of hours to be deducted at the employee's contractual rate\r\nThis property is valid for strike deducted hours", + "format": "double", + "nullable": true + }, + "customPayments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaveCustomPayment" + }, + "description": "If this is Sick Leave with Custom Payment, then this stores the RoleId, PercentOfPay and PaySSPInAddition for each\r\nrole assigned to an employee that did not end before the start date of the absence.", + "nullable": true + }, + "customProRataRules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaveCustomProRataRule" + }, + "description": "If this is a Leave that supports changing the pro rata at leave level,\r\nThis stores the RoleId and ProRataMethod for each\r\nrole assigned to an employee that did not end before the start date of the absence.", + "nullable": true + }, + "lastProcessedFrom": { + "type": "string", + "description": "[readonly] Last Processed From Date\r\nIf this Leave has already been processed,\r\nthis will be the original leave from date", + "format": "date", + "nullable": true + }, + "isReversed": { + "type": "boolean", + "description": "If the reversal of this Leave has already been processed,\r\nthis will be set to true" + }, + "documentCount": { + "type": "integer", + "description": "[readonly] The number of attachments associated with this model", + "format": "int32" + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The attachments associated with this model", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent Leave, including Holiday and Statutory leave (such as Maternity Leave)" + }, + "LeaveAssumedPensionablePay": { + "type": "object", + "properties": { + "roleReference": { + "type": "string", + "description": "Employee role reference", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "Employee role unique Id", + "format": "uuid" + }, + "isPrimary": { + "type": "boolean", + "description": "Boolean flag indicates if the role is primary" + }, + "assumedPensionablePay": { + "type": "number", + "description": "Assumed Pensionable Pay (APP) is an average figure, calculated as the average pay in the 3 months\r\n(or 12 weeks if weekly/fortnightly/fourweekly paid) before the absence", + "format": "double", + "nullable": true + }, + "automaticAPPCalculation": { + "type": "boolean", + "description": "If set to True then we'll automatically calculate the AssumedPensionablePay. \r\nSet it to false if you want to manually provide a figure that overrides our calculations" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "LeaveCalculationType": { + "enum": [ + "OneThreeSixtyFifthFTE", + "OneThreeSixtyFifthProRata", + "UsualProRata", + "OneFifthOrWorkingPattern", + "SpecifyHours" + ], + "type": "string" + }, + "LeaveCustomPayment": { + "type": "object", + "properties": { + "roleId": { + "type": "string", + "format": "uuid" + }, + "percentOfPay": { + "type": "number", + "description": "If this is Sick Leave with Custom Payment,\r\nthe user will input the desired impact on the employee’s pay, per role.\r\nThis will be via an amount between 0-100 in 'Pay for Absence'.\r\nThe employees pay will be fully reduced for the absence, and the % paid will be added back using the OSP pay code.", + "format": "double" + }, + "paySSPInAddition": { + "type": "boolean", + "description": "If this is Sick Leave with Custom Payment,\r\nIf true, then reduce the OSP by the amount of SSP paid (and apportioned according to role weighting)\r\nIf false, then do not reduce the OSP at all." + } + }, + "additionalProperties": false + }, + "LeaveCustomProRataRule": { + "type": "object", + "properties": { + "roleId": { + "type": "string", + "format": "uuid" + }, + "proRataMethod": { + "$ref": "#/components/schemas/LeaveProRataRule" + } + }, + "additionalProperties": false + }, + "LeavePayType": { + "enum": [ + "DoNotPay", + "PayAsUsual", + "StatutoryPay", + "OccupationalPolicy", + "Custom" + ], + "type": "string" + }, + "LeaveProRataRule": { + "enum": [ + "WorkingPattern", + "TwoSixtyDaysNotWorked", + "TwoSixtyDaysWorked", + "ThreeSixFiveDaysNotWorked", + "ThreeSixFiveDaysWorked", + "CalendarDays", + "WorkingDays" + ], + "type": "string" + }, + "LeaveSettings": { + "type": "object", + "properties": { + "useDefaultHolidayType": { + "type": "boolean", + "description": "If true then the value for HolidayType comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowanceResetDate": { + "type": "boolean", + "description": "If true then the value for the AllowanceResetDate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAllowance": { + "type": "boolean", + "description": "If true then the value for the Allowance comes from the Employer record.\r\nThis property only appears if the LeaveSettings if a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieu": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuRate": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieuRate comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultHolidayAccrualBasis": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualBasis comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "If true then the value for AccruePaymentInLieu comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultAccrueHoursPerDay": { + "type": "boolean", + "description": "If true then the value for AccrueHoursPerDay comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "useDefaultMaximumAccruePeriod": { + "type": "boolean", + "description": "If true then the value for MaximumAccruePeriod comes from the Employer record.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)" + }, + "allowanceResetDate": { + "type": "string", + "description": "The date that the holiday allowance resets. Only the day/month part of the value is relevant.", + "format": "date" + }, + "allowance": { + "type": "number", + "description": "The number of days holiday an employee can take per year if HolidayType is Days.\r\nOtherwise this is readonly and gives you the number of days accrued since the last reset", + "format": "double" + }, + "adjustment": { + "type": "number", + "description": "Adjustment to number of hours/days/weeks holiday this employee can take per year.\r\nWill reset to 0 when the Allowance resets.\r\nThis property only appears if the LeaveSettings is a child of an Employee (not of an Employer)", + "format": "double", + "nullable": true + }, + "allowanceUsed": { + "type": "number", + "description": "[readonly] The number of days used from the allowance since last reset", + "format": "double" + }, + "allowanceUsedPreviousPeriod": { + "type": "number", + "description": "[readonly] The number of days used in the 12 months prior to the last reset", + "format": "double" + }, + "allowanceRemaining": { + "type": "number", + "description": "[readonly] The number of days remaining of the allowance until next reset", + "format": "double", + "readOnly": true + }, + "holidayType": { + "$ref": "#/components/schemas/HolidayType" + }, + "accrueSetAmount": { + "type": "boolean", + "description": "If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked." + }, + "accrueHoursPerDay": { + "type": "number", + "description": "If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued", + "format": "double" + }, + "showAllowanceOnPayslip": { + "type": "boolean", + "description": "If true then the remaining Allowance will be shown on the employees payslip." + }, + "showAhpOnPayslip": { + "type": "boolean", + "description": "If true then the AHP balance will be shown on the employees payslip." + }, + "accruePaymentInLieuRate": { + "type": "number", + "description": "The rate at which Payments in Lieu acrrue. Typically this should be 12.07%.", + "format": "double" + }, + "accruePaymentInLieuAllGrossPay": { + "type": "boolean", + "description": "Set to true if you want accrued holiday payments to be calculated on the total gross pay for the employee or just on the single regular pay element" + }, + "accruePaymentInLieuPayAutomatically": { + "type": "boolean", + "description": "Set to true if you want employees to be automatically paid any outstanding holiday pay" + }, + "accruePayCodeSetUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "maximumAccruePeriod": { + "type": "number", + "description": "The maximum number of hours capable of being accrued in a single period", + "format": "double", + "nullable": true + }, + "holidayAccrualBasis": { + "$ref": "#/components/schemas/HolidayAccrual" + }, + "holidayAccrualDefaultRateType": { + "$ref": "#/components/schemas/HolidayAccrualDefaultRateType" + }, + "occupationalSicknessUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "accruedPaymentLiability": { + "type": "number", + "description": "[readonly] The total accrued payments for this employee over the lifetime of their employment so far", + "format": "double" + }, + "accruedPaymentAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total accrued", + "format": "double" + }, + "accruedPaymentPaid": { + "type": "number", + "description": "[readonly] The Total amount paid to this employee in lieu of holidays", + "format": "double" + }, + "accruedPaymentBalance": { + "type": "number", + "description": "[readonly] The balance of what is owed to this employee in lieu of holidays", + "format": "double", + "readOnly": true + }, + "accruedHoursAmount": { + "type": "number", + "description": "[readonly] The total accrued hours for this employee over the lifetime of their employment so far", + "format": "double" + }, + "accruedHoursAdjustment": { + "type": "number", + "description": "Any manual adjustment to the total hours accrued", + "format": "double" + }, + "accruedHoursPaid": { + "type": "number", + "description": "[readonly] The Total amount of hours paid to this employee in lieu of holidays", + "format": "double" + }, + "accruedHoursAmountLastPeriod": { + "type": "number", + "description": "[readonly] The total accrued hours for this employee in the last pay period", + "format": "double" + }, + "paidHoursAmountLastPeriod": { + "type": "number", + "description": "[readonly] The number of hours paid against the pay code", + "format": "double" + }, + "accruedHoursBalance": { + "type": "number", + "description": "[readonly] The balance of hours owed to this employee in lieu of holidays", + "format": "double", + "readOnly": true + }, + "aggregatedServiceDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "useAggregatedServiceDate": { + "type": "boolean" + }, + "useDefaultHolidayAccrualDefaultRateType": { + "type": "boolean", + "description": "If true then the value for HolidayAccrualDefaultRateType comes from the Employer record." + }, + "unauthorisedLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "holidayLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "sickLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "parentalLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + }, + "bereavementLeaveProRataRule": { + "$ref": "#/components/schemas/LeaveProRataRule" + } + }, + "additionalProperties": false + }, + "LeaveType": { + "enum": [ + "Unauthorised", + "Holiday", + "Sick", + "Maternity", + "Paternity", + "Adoption", + "SharedParental", + "Bereavement", + "SharedParentalAdoption", + "PaternityAdoption", + "StrikeAction" + ], + "type": "string" + }, + "LeaverDetails": { + "type": "object", + "properties": { + "hasLeft": { + "type": "boolean" + }, + "leaveDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "isDeceased": { + "type": "boolean" + }, + "paymentAfterLeaving": { + "type": "boolean" + }, + "p45Sent": { + "type": "boolean" + }, + "payAccruedBalance": { + "type": "boolean" + }, + "paymentMethodAfterLeaving": { + "$ref": "#/components/schemas/PaymentMethodAfterLeaving" + } + }, + "additionalProperties": false + }, + "LgpsCivicaCasualHours": { + "enum": [ + "ReportAsZero", + "ReportAsOne", + "ReportAsBlank" + ], + "type": "string" + }, + "LgpsCivicaPayrollNumber": { + "enum": [ + "PayrollCode", + "RoleReference", + "PayrollCodeAndRoleReference", + "UUID", + "PensionMembershipNoOrRoleReference", + "PensionMembershipNoOrPayrollCodeAndRoleReference", + "PensionMembershipNoOrUUID" + ], + "type": "string" + }, + "LgpsFund": { + "enum": [ + "Avon", + "BarkingAndDagenham", + "Barnet", + "Bedfordshire", + "Berkshire", + "Bexley", + "Brent", + "Bromley", + "Buckinghamshire", + "Cambridgeshire", + "Camden", + "Cardiff", + "Cheshire", + "CityOfWestminster", + "Clwyd", + "Cornwall", + "Croydon", + "Cumbria", + "Derbyshire", + "Devon", + "Dorset", + "Durham", + "Dyfed", + "Ealing", + "EastRiding", + "EastSussex", + "Enfield", + "Essex", + "Gloucestershire", + "GreaterGwent", + "GreaterManchester", + "Greenwich", + "Gwynedd", + "Hackney", + "HammersmithAndFulham", + "Hampshire", + "Haringey", + "Harrow", + "Havering", + "Hertfordshire", + "Hillingdon", + "Hounslow", + "IsleOfWight", + "Islington", + "KensingtonAndChelsea", + "Kent", + "KingstonUponThames", + "Lambeth", + "Lancashire", + "Leicestershire", + "Lewisham", + "Lincolnshire", + "LondonPensionsFundAuthority", + "Merseyside", + "Merton", + "Newham", + "Norfolk", + "NorthYorkshire", + "Northamptonshire", + "Northumberland", + "Nottinghamshire", + "Oxfordshire", + "Powys", + "Redbridge", + "RhonddaCynonTaf", + "Shropshire", + "Somerset", + "SouthYorkshire", + "Southwark", + "Staffordshire", + "Suffolk", + "Surrey", + "Sutton", + "Swansea", + "Teesside", + "TowerHamlets", + "TyneAndWear", + "WalthamForest", + "Wandsworth", + "Warwickshire", + "WestMidlandsPassengerTransport", + "WestMidlands", + "WestSussex", + "WestYorkshire", + "Wiltshire", + "Worcestershire" + ], + "type": "string" + }, + "LgpsIConnectFileType": { + "enum": [ + "SingleFile", + "MultipleProviderFile" + ], + "type": "string" + }, + "LgpsIConnectPayrollReference": { + "enum": [ + "Empty", + "PayrollCode", + "RoleReference", + "PensionMemberNo", + "Uuid", + "PayrollCodeAndRoleReference", + "EmployerCode", + "CustomText", + "PensionMemberNoOrRoleReference", + "PensionMemberNoOrPayrollCodeAndRoleReference", + "PensionMemberNoOrPensionUuid" + ], + "type": "string" + }, + "LgpsIConnectSalaryType": { + "enum": [ + "PayOnJoining", + "AnnualPensionableSalary", + "DoNotReport" + ], + "type": "string" + }, + "LgpsPayCategory": { + "enum": [ + "LgpsFinalPayPre2014" + ], + "type": "string" + }, + "LinkedPiw": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/LinkedPiwResult" + }, + "id": { + "type": "string", + "description": "[readonly] The Id of the linked Leave", + "format": "uuid" + }, + "averageWeeklyEarnings": { + "type": "number", + "description": "[readonly] Average weekly earnings from linked Leave", + "format": "double" + }, + "workingDays": { + "type": "number", + "description": "[readonly] The number of working days in the linked Leave.", + "format": "double" + }, + "totalDays": { + "type": "number", + "description": "[readonly] The number of days covered by the linked Leave.", + "format": "double" + }, + "sspFirstPayDay": { + "type": "string", + "description": "[readonly] The SspFirstPayDay from the linked Leave, if set", + "format": "date", + "nullable": true + }, + "sspFirstDay": { + "type": "string", + "description": "[readonly] The SspFirstDay from the linked Leave, if set", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Linked Period of Incapacity for Work.\r\nIf you record Sick Leave and select Statutory Pay then any other Sick Leave with Statutory Pay\r\nlasting 4 or more days in the previous 8 weeks will be linked to it" + }, + "LinkedPiwResult": { + "enum": [ + "Success", + "NoLinkedLeave" + ], + "type": "string" + }, + "Loan": { + "type": "object", + "properties": { + "issueDate": { + "type": "string", + "description": "The date the Loan was made", + "format": "date" + }, + "reference": { + "maxLength": 100, + "type": "string", + "description": "An optional reference for this Loan", + "nullable": true + }, + "payCode": { + "type": "string", + "description": "The Code of the PayCode used for recording payments.\r\nThe PayCode must have a CalculationType of FixedAmount and not be a multiplier code", + "nullable": true + }, + "loanAmount": { + "type": "number", + "description": "The initial amount that the loan was for", + "format": "double" + }, + "periodAmount": { + "type": "number", + "description": "The amount to deduct per PayPeriod", + "format": "double" + }, + "amountRepaid": { + "type": "number", + "description": "[readonly] The amount repaid so far due to deductions in Payruns", + "format": "double" + }, + "previouslyPaid": { + "type": "number", + "description": "[readonly] Any amount by which to adjust the Balance, perhaps due to repayments made elsewhere", + "format": "double" + }, + "balance": { + "type": "number", + "description": "[readonly] The Balance of the Loan", + "format": "double", + "readOnly": true + }, + "isSettled": { + "type": "boolean", + "description": "[readonly]", + "readOnly": true + }, + "isPaused": { + "type": "boolean", + "description": "If set to true then deductions will not be made" + }, + "documentCount": { + "type": "integer", + "description": "[readonly] The number of attachments associated with this model", + "format": "int32" + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The attachments associated with this model", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent an Attachment of Earnings Order (AEO)" + }, + "LoanBalancesReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoanBalancesReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "LoanBalancesReportLine": { + "type": "object", + "properties": { + "employeeName": { + "type": "string", + "nullable": true + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "issueDate": { + "type": "string", + "format": "date" + }, + "reference": { + "type": "string", + "nullable": true + }, + "payCode": { + "type": "string", + "nullable": true + }, + "loanAmount": { + "type": "number", + "format": "double" + }, + "paidAmount": { + "type": "number", + "format": "double" + }, + "outstandingBalance": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "LoanBalancesReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/LoanBalancesReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "LoanCharge": { + "type": "object", + "properties": { + "threshhold": { + "type": "number", + "format": "double" + }, + "officialInterestRate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate charges for a Loan.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "LogEntry": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date" + }, + "message": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LondonAllowance": { + "required": [ + "paySpineId" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/LondonAllowanceType" + }, + "valueType": { + "$ref": "#/components/schemas/LondonAllowanceValueType" + }, + "value": { + "type": "number", + "description": "Value of London Allowance", + "format": "double" + }, + "paySpineId": { + "type": "integer", + "description": "foreign key with pay spine table", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "LondonAllowanceType": { + "enum": [ + "Inner", + "Outer", + "Fringe" + ], + "type": "string" + }, + "LondonAllowanceValueType": { + "enum": [ + "Graded", + "Fixed" + ], + "type": "string" + }, + "MailSettings": { + "required": [ + "customiseHtmlEmailSettings", + "customiseSmtpSettings", + "senderEmail", + "senderName" + ], + "type": "object", + "properties": { + "senderName": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "senderEmail": { + "maxLength": 100, + "minLength": 1, + "type": "string", + "format": "email" + }, + "useSystemFromAddress": { + "type": "boolean", + "description": "If set to true then the SenderEmail provided will only be used in the \r\nReplyTo fields. The system defaults will be used for the From address." + }, + "senderEmailVerified": { + "type": "boolean", + "description": "[readonly] The SenderEmail must be verified before you can send email using that address" + }, + "customiseSmtpSettings": { + "type": "boolean" + }, + "smtpSettings": { + "$ref": "#/components/schemas/SmtpSettings" + }, + "customiseHtmlEmailSettings": { + "type": "boolean" + }, + "htmlEmailSettings": { + "$ref": "#/components/schemas/HtmlEmailSettings" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Determines the settings used when the Employer sends emails.\r\nIf CustomiseSmtpSettings is false then SmtpSettings will be null and our default internal settings will be used;" + }, + "MaritalStatus": { + "enum": [ + "Single", + "Married", + "Divorced", + "Widowed", + "CivilPartnership", + "Unknown" + ], + "type": "string" + }, + "McrPayCategory": { + "enum": [ + "McrPensionablePay", + "McrOvertime", + "McrAdditionalPensionablePayments" + ], + "type": "string" + }, + "MileageAllowancePaymentsRate": { + "type": "object", + "properties": { + "vehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "rate": { + "type": "number", + "format": "double" + }, + "threshold": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "aboveThresholdRate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate Mileage Allowance Payments.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "MileageVehicleType": { + "enum": [ + "Car", + "Motorcycle", + "Cycle" + ], + "type": "string" + }, + "MonthlyMinimum": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "amount": { + "type": "number", + "format": "double" + }, + "startDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "endDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "billPastEndDate": { + "type": "boolean", + "description": "If set to true then this user should still be billed even after the End Date" + } + }, + "additionalProperties": false + }, + "NationalInsuranceCalculation": { + "type": "object", + "properties": { + "breakdown": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NationalInsuranceCalculationBase" + }, + "description": "[readonly] List of calculations that make up this calculation", + "nullable": true + }, + "niCategory": { + "type": "string", + "description": "Calculated on NI table letter" + }, + "asDirector": { + "type": "boolean", + "description": "Calculated as a Director" + }, + "earningsUptoIncludingLEL": { + "type": "number", + "description": "Earnings up to and including LEL", + "format": "double" + }, + "earningsAboveLELUptoIncludingPT": { + "type": "number", + "description": "Earnings above LEL up to PT", + "format": "double" + }, + "earningsAbovePTUptoIncludingST": { + "type": "number", + "description": "Earnings above PT up to ST", + "format": "double" + }, + "earningsAbovePTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above PT up to UEL", + "format": "double" + }, + "earningsAboveSTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above ST up to UEL", + "format": "double" + }, + "earningsAboveSTUptoIncludingFUST": { + "type": "number", + "description": "Earnings above ST up to FUST", + "format": "double", + "nullable": true + }, + "earningsAboveFUSTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above FUST up to UEL", + "format": "double", + "nullable": true + }, + "earningsAboveUEL": { + "type": "number", + "description": "Earnings above UEL", + "format": "double" + }, + "employeeNiGross": { + "type": "number", + "description": "Employee National Insurance Gross Value", + "format": "double" + }, + "employeeNiRebate": { + "type": "number", + "description": "Employee National Insurance Rebate Value", + "format": "double" + }, + "employerNiGross": { + "type": "number", + "description": "Employer National Insurance Gross Value", + "format": "double" + }, + "employerNiRebate": { + "type": "number", + "description": "Employer National Insurance Rebate Value", + "format": "double" + }, + "employeeNi": { + "type": "number", + "description": "[readonly] Net Employee National Insurance", + "format": "double", + "readOnly": true + }, + "employerNi": { + "type": "number", + "description": "[readonly] Net Employer National Insurance", + "format": "double", + "readOnly": true + }, + "netNi": { + "type": "number", + "description": "[readonly] Net National Insurance (Employer + Employee)", + "format": "double", + "readOnly": true + }, + "niablePay": { + "type": "number", + "description": "Niable pay value, required for payrun overrides", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Included as part of the PayRunEntry model to provide details of how the National Insurance Contribution was calculated.\r\nUnless the PayRunEntry.ManualNi property is set to true then these value will all be read-only and are recalculated everytime a payrun is updated.\r\nThis calculation could be made up of one or more calculations made on different NI table letters.\r\nWhere more than NI table letter affects the calculation, the calculation for each NI table letter will be contain in the Breakdown." + }, + "NationalInsuranceCalculationBase": { + "type": "object", + "properties": { + "niCategory": { + "type": "string", + "description": "Calculated on NI table letter" + }, + "asDirector": { + "type": "boolean", + "description": "Calculated as a Director" + }, + "earningsUptoIncludingLEL": { + "type": "number", + "description": "Earnings up to and including LEL", + "format": "double" + }, + "earningsAboveLELUptoIncludingPT": { + "type": "number", + "description": "Earnings above LEL up to PT", + "format": "double" + }, + "earningsAbovePTUptoIncludingST": { + "type": "number", + "description": "Earnings above PT up to ST", + "format": "double" + }, + "earningsAbovePTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above PT up to UEL", + "format": "double" + }, + "earningsAboveSTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above ST up to UEL", + "format": "double" + }, + "earningsAboveSTUptoIncludingFUST": { + "type": "number", + "description": "Earnings above ST up to FUST", + "format": "double", + "nullable": true + }, + "earningsAboveFUSTUptoIncludingUEL": { + "type": "number", + "description": "Earnings above FUST up to UEL", + "format": "double", + "nullable": true + }, + "earningsAboveUEL": { + "type": "number", + "description": "Earnings above UEL", + "format": "double" + }, + "employeeNiGross": { + "type": "number", + "description": "Employee National Insurance Gross Value", + "format": "double" + }, + "employeeNiRebate": { + "type": "number", + "description": "Employee National Insurance Rebate Value", + "format": "double" + }, + "employerNiGross": { + "type": "number", + "description": "Employer National Insurance Gross Value", + "format": "double" + }, + "employerNiRebate": { + "type": "number", + "description": "Employer National Insurance Rebate Value", + "format": "double" + }, + "employeeNi": { + "type": "number", + "description": "[readonly] Net Employee National Insurance", + "format": "double", + "readOnly": true + }, + "employerNi": { + "type": "number", + "description": "[readonly] Net Employer National Insurance", + "format": "double", + "readOnly": true + }, + "netNi": { + "type": "number", + "description": "[readonly] Net National Insurance (Employer + Employee)", + "format": "double", + "readOnly": true + }, + "niablePay": { + "type": "number", + "description": "Niable pay value, required for payrun overrides", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Included as part of the PayRunEntry model to provide details of how the National Insurance Contribution was calculated.\r\nUnless the PayRunEntry.ManualNi property is set to true then these value will all be read-only and are recalculated everytime a payrun is updated.\r\nThis calculation could be made up of one or more calculations made on different NI table letters.\r\nWhere more than NI table letter affects the calculation, the calculation for each NI table letter will be contain in the Breakdown." + }, + "NationalInsuranceCalculationPeriodValues": { + "type": "object", + "properties": { + "lel": { + "type": "number", + "description": "[readonly] Lower Earnings Limit", + "format": "double" + }, + "pt": { + "type": "number", + "description": "[readonly] Primary Threshold", + "format": "double" + }, + "st": { + "type": "number", + "description": "[readonly] Secondary Threshold", + "format": "double" + }, + "fust": { + "type": "number", + "description": "[readonly] Freeports Upper Accrual Threshold", + "format": "double" + }, + "uap": { + "type": "number", + "description": "[readonly] Upper Accrual Point", + "format": "double" + }, + "ust": { + "type": "number", + "description": "[readonly] Upper Secondary Threshold (under 21)", + "format": "double" + }, + "aust": { + "type": "number", + "description": "[readonly] Apprentice Upper Secondary Threshold (apprentice under 25)", + "format": "double" + }, + "uel": { + "type": "number", + "description": "[readonly] Upper Earnings Limit", + "format": "double" + }, + "vust": { + "type": "number", + "description": "[readonly] Veterian Upper Secondary Threshold", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate National Insurance Contributions.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "NationalInsuranceCode": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[readonly] NI Table Letter" + }, + "description": { + "type": "string", + "description": "[readonly] Description of Employees that would use this NI Letter", + "nullable": true + }, + "eeB": { + "type": "number", + "description": "[readonly] Earnings at or above LEL up to and including PT (Employee Contribution)", + "format": "double" + }, + "eeC": { + "type": "number", + "description": "[readonly] Earnings above the PT up to and including UEL (Employee Contribution)", + "format": "double" + }, + "eeD": { + "type": "number", + "description": "[readonly] Balance of earnings above UEL (Employee Contribution)", + "format": "double" + }, + "eeE": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "eeF": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "erB": { + "type": "number", + "description": "[readonly] Earnings at or above LEL up to and including PT (Employer Contribution)", + "format": "double" + }, + "erC": { + "type": "number", + "description": "[readonly] Earnings above the PT up to and including UEL (Employer Contribution)", + "format": "double" + }, + "erD": { + "type": "number", + "description": "[readonly] Balance of earnings above UEL (Employer Contribution)", + "format": "double" + }, + "erE": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "erF": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "effectiveFrom": { + "type": "string", + "description": "The date when these period values are effective", + "format": "date", + "nullable": true + }, + "midYearChanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NationalInsuranceCode" + }, + "description": "Any optional changes to the period values that are effective from a specified date in the middle of a tax year", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate National Insurance Contributions.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "NationalMinimumWage": { + "type": "object", + "properties": { + "apprentice": { + "type": "boolean", + "nullable": true + }, + "maxAge": { + "type": "integer", + "format": "int32" + }, + "hourlyAmount": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate National Minimum Wage.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "NiLetterError": { + "enum": [ + "XNotUsedForPensionersPayroll", + "BUsedForMale", + "CUsedBeforeStatePensionAge", + "AUsedForUnder21", + "AUsedOverStatePensionAge", + "HUsedForOver24", + "MUsedForOver20", + "ZUsedForOver20", + "IUsedForMale", + "FUsedForNonFreeportWorker", + "IUsedForNonFreeportWorker", + "LUsedForNonFreeportWorker", + "SUsedForNonFreeportWorker", + "VUsedForNonVeteran", + "VUsedForVeteransFirstEmploymentDateOverOneYearOld", + "FUsedForFreeportWorkerOverThreeYearsOld", + "IUsedForFreeportWorkerOverThreeYearsOld", + "LUsedForFreeportWorkerOverThreeYearsOld", + "SUsedForFreeportWorkerOverThreeYearsOld", + "XNotUsedForUnder16", + "DUsedForNonInvestmentZoneWorker", + "EUsedForNonInvestmentZoneWorker", + "KUsedForNonInvestmentZoneWorker", + "NUsedForNonInvestmentZoneWorker" + ], + "type": "string" + }, + "NiLetterValidationReport": { + "type": "object", + "properties": { + "basedOnPayrun": { + "type": "boolean", + "description": "If false, then any payrun related information (Tax year, etc) should be ignored." + }, + "errorLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NiLetterValidationReportLine" + }, + "nullable": true, + "readOnly": true + }, + "paymentDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "NiLetterValidationReportLine": { + "type": "object", + "properties": { + "employeeId": { + "type": "string", + "format": "uuid" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "niNumber": { + "type": "string", + "nullable": true + }, + "gender": { + "$ref": "#/components/schemas/Gender" + }, + "dateOfBirth": { + "type": "string", + "format": "date" + }, + "niLetterError": { + "$ref": "#/components/schemas/NiLetterError" + }, + "errorDetails": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "niLetter": { + "type": "string", + "nullable": true + }, + "suggestedLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "NiLetterValidationReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/NiLetterValidationReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "NiYtdReport": { + "type": "object", + "properties": { + "payrun": { + "$ref": "#/components/schemas/PayRun" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeNiYtdValues" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "NiYtdReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/NiYtdReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "NiYtdValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "broughtForward": { + "type": "number", + "format": "double" + }, + "period": { + "type": "number", + "format": "double" + }, + "value": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "NicSummary": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "paymentDate": { + "type": "string", + "format": "date" + }, + "niTable": { + "type": "string" + }, + "asDirector": { + "type": "boolean" + }, + "grossEarningsForNics": { + "type": "number", + "format": "double" + }, + "earningsAtLel": { + "type": "number", + "format": "double" + }, + "earningsAboveLelToPt": { + "type": "number", + "format": "double" + }, + "earningsAbovePtToSt": { + "type": "number", + "format": "double" + }, + "earningsAbovePtToUap": { + "type": "number", + "format": "double" + }, + "earningsAboveStToUel": { + "type": "number", + "format": "double" + }, + "earningsAboveStToFust": { + "type": "number", + "format": "double" + }, + "earningsAboveFustToUel": { + "type": "number", + "format": "double" + }, + "earningsAboveUapToUel": { + "type": "number", + "format": "double" + }, + "earningsAboveUel": { + "type": "number", + "format": "double" + }, + "employeeNics": { + "type": "number", + "format": "double" + }, + "employeeNiRebate": { + "type": "number", + "format": "double" + }, + "employerNics": { + "type": "number", + "format": "double" + }, + "employerNiRebate": { + "type": "number", + "format": "double" + }, + "hasValues": { + "type": "boolean", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "isNiYtdOverride": { + "type": "boolean" + }, + "childId": { + "type": "string", + "description": "This is nothing but the UniqueId of the model.", + "format": "uuid" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false + }, + "NominalCodeMapping": { + "type": "object", + "properties": { + "nominalCode": { + "maxLength": 500, + "type": "string", + "nullable": true + }, + "nominalName": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "externalId": { + "maxLength": 100, + "type": "string", + "description": "If you will be using the API to post journals to an ExternalDataProvider, then this is the Id of the nominal code in the external system.\r\nIf there's no mapping then this will have a value of \"0\"", + "nullable": true + }, + "payCode": { + "type": "string", + "nullable": true + }, + "nominalMapping": { + "maxLength": 500, + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "Note": { + "type": "object", + "properties": { + "noteDate": { + "type": "string", + "description": "The date of the note", + "format": "date" + }, + "noteText": { + "type": "string", + "description": "Note text", + "nullable": true + }, + "createdBy": { + "type": "string", + "description": "[readonly] The email address of the user that create the Note", + "nullable": true + }, + "updatedBy": { + "type": "string", + "description": "[readonly] The email address of the user that last updated the Note", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/NoteType" + }, + "documentCount": { + "type": "integer", + "description": "[readonly] The number of attachments associated with this model", + "format": "int32" + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The attachments associated with this model", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent a Note for an Employee" + }, + "NoteType": { + "enum": [ + "General", + "NewStarterStatement", + "RtwProof", + "P45" + ], + "type": "string" + }, + "Nvr": { + "type": "object", + "properties": { + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "nullable": true + }, + "employeeCount": { + "type": "integer", + "format": "int32" + }, + "nvrRequest": { + "$ref": "#/components/schemas/NvrRequest" + }, + "iRmark": { + "type": "string", + "nullable": true + }, + "xml": { + "type": "string", + "description": "This property will soon be removed and should not be used.\r\nThere is now a dedicated API endpoint for retrieving the XML for a submission.", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "employerReferences": { + "$ref": "#/components/schemas/EmpRefs" + }, + "govTalkSubmission": { + "$ref": "#/components/schemas/GovTalkSubmission" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "NvrEmployee": { + "type": "object", + "properties": { + "employeeUniqueId": { + "type": "string", + "format": "uuid" + }, + "item": { + "$ref": "#/components/schemas/Item" + }, + "employeeDetails": { + "$ref": "#/components/schemas/NvrEmployeeDetails" + }, + "employment": { + "$ref": "#/components/schemas/NvrEmployment" + } + }, + "additionalProperties": false + }, + "NvrEmployeeDetails": { + "type": "object", + "properties": { + "nino": { + "type": "string", + "nullable": true + }, + "name": { + "$ref": "#/components/schemas/RtiEmployeeName" + }, + "address": { + "$ref": "#/components/schemas/RtiEmployeeAddress" + }, + "birthDate": { + "type": "string", + "nullable": true + }, + "gender": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "NvrEmployment": { + "type": "object", + "properties": { + "payId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "NvrRequest": { + "type": "object", + "properties": { + "employee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NvrEmployee" + }, + "nullable": true + }, + "relatedTaxYear": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "OccupationalPolicy": { + "required": [ + "entitlement", + "policyName", + "sicknessYear", + "type" + ], + "type": "object", + "properties": { + "policyName": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The unique policy name" + }, + "type": { + "$ref": "#/components/schemas/OccupationalPolicyType" + }, + "entitlement": { + "$ref": "#/components/schemas/OccupationalPolicyEntitlement" + }, + "sicknessYear": { + "$ref": "#/components/schemas/OccupationalPolicySicknessYear" + }, + "policyStartMonth": { + "$ref": "#/components/schemas/CalendarMonth" + }, + "serviceBands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceBand" + }, + "description": "Service Bands Json", + "nullable": true + }, + "payCalculatedOn": { + "$ref": "#/components/schemas/OccupationalPolicyPayCalculatedOn" + }, + "payCodeSetUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "useAggregatedServiceDate": { + "type": "boolean" + }, + "daysOrWeeksBeforeRecalculatingEntitlement": { + "type": "integer", + "description": "How many days or weeks an employee needs to return to work before new entitlements are used in calculations", + "format": "int32" + }, + "entitlementRecalculationBasis": { + "$ref": "#/components/schemas/OccupationalPolicyEntitlementRecalculationBasis" + }, + "ignorePreviousYearsSickness": { + "type": "boolean", + "description": "Defines whether any sickness that relates to a previous year's sickness entitlement should be included in the entitlement calculation,\r\nor whether only sickness that is relevant to the current year's entitlement is taken into consideration" + } + }, + "additionalProperties": false + }, + "OccupationalPolicyEntitlement": { + "enum": [ + "Days", + "Weeks" + ], + "type": "string" + }, + "OccupationalPolicyEntitlementRecalculationBasis": { + "enum": [ + "ServiceBanding", + "SickYear" + ], + "type": "string" + }, + "OccupationalPolicyPayCalculatedOn": { + "enum": [ + "NotApplicable", + "PercentageOfAnnualSalary", + "PercentageOfAverageWeeklyEarnings", + "PercentageOfPayCodeSet", + "Custom" + ], + "type": "string" + }, + "OccupationalPolicySicknessYear": { + "enum": [ + "NotApplicable", + "Rolling", + "Fixed" + ], + "type": "string" + }, + "OccupationalPolicyType": { + "enum": [ + "Sickness", + "Maternity" + ], + "type": "string" + }, + "OccupationalSickLeaveHistory": { + "required": [ + "leaveDate", + "payPercent", + "serviceBandFrom", + "serviceBandTo" + ], + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "nullable": true + }, + "leaveDate": { + "type": "string", + "format": "date" + }, + "payPercent": { + "type": "number", + "format": "double" + }, + "serviceBandFrom": { + "type": "integer", + "format": "int32" + }, + "serviceBandTo": { + "type": "integer", + "format": "int32" + }, + "roleReference": { + "type": "string", + "nullable": true + }, + "occupationalPolicy": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "OpeningBalances": { + "type": "object", + "properties": { + "notNewStarter": { + "type": "boolean" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "previousEmployerGross": { + "type": "number", + "format": "double" + }, + "previousEmployerTax": { + "type": "number", + "format": "double" + }, + "currentEmployerGross": { + "type": "number", + "format": "double" + }, + "currentEmployerTax": { + "type": "number", + "format": "double" + }, + "currentEmployerNet": { + "type": "number", + "format": "double" + }, + "studentLoanDeductions": { + "type": "number", + "format": "double" + }, + "postgradLoanDeductions": { + "type": "number", + "format": "double" + }, + "empeePenContribnsPaid": { + "type": "number", + "format": "double" + }, + "empeePenContribnsNotPaid": { + "type": "number", + "format": "double" + }, + "smp": { + "type": "number", + "format": "double" + }, + "spp": { + "type": "number", + "format": "double" + }, + "sap": { + "type": "number", + "format": "double" + }, + "shpp": { + "type": "number", + "format": "double" + }, + "spbp": { + "type": "number", + "format": "double" + }, + "realTimeClass1ANi": { + "type": "number", + "format": "double" + }, + "terminationPayments": { + "type": "number", + "format": "double" + }, + "mapsMiles": { + "type": "integer", + "format": "int32" + }, + "benefitsTaxedViaPayroll": { + "type": "number", + "format": "double" + }, + "nicSummaries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + }, + "nullable": true + }, + "foreignTaxCredit": { + "type": "number", + "format": "double" + }, + "foreignTaxCreditReclaimed": { + "type": "number", + "format": "double" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false + }, + "OpeningBalancesTotals": { + "type": "object", + "properties": { + "employeesWithOpeningBalancesCount": { + "type": "integer", + "format": "int32" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "previousEmployerGross": { + "type": "number", + "format": "double" + }, + "previousEmployerTax": { + "type": "number", + "format": "double" + }, + "currentEmployerGross": { + "type": "number", + "format": "double" + }, + "currentEmployerTax": { + "type": "number", + "format": "double" + }, + "currentEmployerNet": { + "type": "number", + "format": "double" + }, + "studentLoanDeductions": { + "type": "number", + "format": "double" + }, + "postgradLoanDeductions": { + "type": "number", + "format": "double" + }, + "empeePenContribnsPaid": { + "type": "number", + "format": "double" + }, + "empeePenContribnsNotPaid": { + "type": "number", + "format": "double" + }, + "smp": { + "type": "number", + "format": "double" + }, + "spp": { + "type": "number", + "format": "double" + }, + "sap": { + "type": "number", + "format": "double" + }, + "shpp": { + "type": "number", + "format": "double" + }, + "spbp": { + "type": "number", + "format": "double" + }, + "realTimeClass1ANi": { + "type": "number", + "format": "double" + }, + "terminationPayments": { + "type": "number", + "format": "double" + }, + "mapsMiles": { + "type": "integer", + "format": "int32" + }, + "benefitsTaxedViaPayroll": { + "type": "number", + "format": "double" + }, + "nicSummaries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NicSummary" + }, + "nullable": true + }, + "foreignTaxCredit": { + "type": "number", + "format": "double" + }, + "foreignTaxCreditReclaimed": { + "type": "number", + "format": "double" + }, + "employee": { + "$ref": "#/components/schemas/Item" + } + }, + "additionalProperties": false + }, + "OverseasEmployerDetails": { + "type": "object", + "properties": { + "overseasEmployer": { + "type": "boolean" + }, + "overseasSecondmentStatus": { + "$ref": "#/components/schemas/OverseasSecondmentStatus" + }, + "eeaCitizen": { + "type": "boolean" + }, + "epm6Scheme": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "OverseasSecondmentStatus": { + "enum": [ + "None", + "MoreThan183Days", + "LessThan183Days", + "BothInAndOutOfUK" + ], + "type": "string" + }, + "P11": { + "type": "object", + "properties": { + "employerName": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "payrollCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerOfficeNo": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerPayeRef": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "firstname": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "surname": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "niNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "taxCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "joinDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "leaveDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11Line" + }, + "description": "[readonly]", + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "A P11 Report summarises payments and deductions made to an employee.\r\nOur Reports API can return this to you in many formats including as a PDF file\r\nIf you request is as a JSOn object then it is represented using this model." + }, + "P11DAssetAvailable": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "nullable": true + }, + "other": { + "type": "string", + "nullable": true + }, + "annValProRata": { + "type": "string", + "nullable": true + }, + "grossOrAmtForgone": { + "type": "string", + "nullable": true + }, + "costOrAmtForgone": { + "type": "string", + "nullable": true + }, + "madeGood": { + "type": "string", + "nullable": true + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DAssetAvailableCollection": { + "type": "object", + "properties": { + "asset": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DAssetAvailable" + }, + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DAssetTransferredCollection": { + "type": "object", + "properties": { + "asset": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DDescOther" + }, + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DCar": { + "type": "object", + "properties": { + "make": { + "type": "string", + "nullable": true + }, + "registered": { + "type": "string", + "nullable": true + }, + "availFrom": { + "type": "string", + "nullable": true + }, + "availTo": { + "type": "string", + "nullable": true + }, + "cc": { + "type": "string", + "nullable": true + }, + "fuel": { + "type": "string", + "nullable": true + }, + "cO2": { + "type": "string", + "nullable": true + }, + "zeroEmissionMileage": { + "type": "string", + "nullable": true + }, + "noAppCO2Fig": { + "type": "string", + "nullable": true + }, + "list": { + "type": "string", + "nullable": true + }, + "accs": { + "type": "string", + "nullable": true + }, + "capCont": { + "type": "string", + "nullable": true + }, + "privUsePmt": { + "type": "string", + "nullable": true + }, + "fuelWithdrawn": { + "$ref": "#/components/schemas/P11dCarFreeFuelWithdrawn" + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "fuelCashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DCarCollection": { + "type": "object", + "properties": { + "car": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DCar" + }, + "nullable": true + }, + "totalCarsOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "totalFuelOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DDescOther": { + "type": "object", + "properties": { + "desc": { + "type": "string", + "nullable": true + }, + "other": { + "type": "string", + "nullable": true + }, + "annValProRata": { + "type": "string", + "nullable": true + }, + "grossOrAmtForgone": { + "type": "string", + "nullable": true + }, + "costOrAmtForgone": { + "type": "string", + "nullable": true + }, + "madeGood": { + "type": "string", + "nullable": true + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DLoan": { + "type": "object", + "properties": { + "joint": { + "type": "string", + "nullable": true + }, + "initOS": { + "type": "string", + "nullable": true + }, + "finalOS": { + "type": "string", + "nullable": true + }, + "maxOS": { + "type": "string", + "nullable": true + }, + "intPaid": { + "type": "string", + "nullable": true + }, + "date": { + "type": "string", + "nullable": true + }, + "discharge": { + "type": "string", + "nullable": true + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DLoanCollection": { + "type": "object", + "properties": { + "loan": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DLoan" + }, + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DOther": { + "type": "object", + "properties": { + "class1A": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DDescOther" + }, + "nullable": true + }, + "nonClass1A": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DDescOther" + }, + "nullable": true + }, + "taxPaid": { + "type": "string", + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DPaymentCollection": { + "type": "object", + "properties": { + "payment": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DDescOther" + }, + "nullable": true + }, + "tax": { + "type": "string", + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11DSingleItem": { + "type": "object", + "properties": { + "typeLetter": { + "type": "string", + "nullable": true + }, + "taxablePmt": { + "type": "string", + "nullable": true + }, + "excess": { + "type": "string", + "nullable": true + }, + "taxablePmtOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "tradingOrgInd": { + "type": "string", + "nullable": true + }, + "desc": { + "type": "string", + "nullable": true + }, + "other": { + "type": "string", + "nullable": true + }, + "annValProRata": { + "type": "string", + "nullable": true + }, + "grossOrAmtForgone": { + "type": "string", + "nullable": true + }, + "costOrAmtForgone": { + "type": "string", + "nullable": true + }, + "madeGood": { + "type": "string", + "nullable": true + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11Detailed": { + "type": "object", + "properties": { + "employerName": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "payrollCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerOfficeNo": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employerPayeRef": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "firstname": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "middlename": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "surname": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "niNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "taxCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "joinDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "leaveDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "isDirector": { + "type": "boolean", + "description": "[readonly]" + }, + "niAndStatPaymentsLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11NiAndStatPaymentsLine" + }, + "description": "[readonly]", + "nullable": true + }, + "totalsLine": { + "$ref": "#/components/schemas/P11NiAndStatPaymentsTotalsLine" + }, + "niSummary": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11DetailedNiValues" + }, + "description": "[readonly]", + "nullable": true + }, + "payeLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11PayeLine" + }, + "description": "[readonly]", + "nullable": true + }, + "payeTotalsLine": { + "$ref": "#/components/schemas/P11PayeTotalsLine" + }, + "payeSummary": { + "$ref": "#/components/schemas/P11PayeSummary" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "A more comprehensive P11 Report.\r\nOur Reports API can return this to you in several formats including as a PDF file\r\nIf you request a JSON object then it is represented using this model." + }, + "P11DetailedNiValues": { + "type": "object", + "properties": { + "table": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "earningsAtLel": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "earningsAboveLelToPt": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "earningsAbovePtToUap": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "earningsAboveUapToUel": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "earningsAbovePtToUel": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employeeNics": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employerNics": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employeeAndEmployerNics": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Forms the NI Summary table in the P11 Detailed report." + }, + "P11DetailedReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/P11Detailed" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "P11Line": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "period": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "grossTaxablePay": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "grossTaxablePayYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "tax": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "smpYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "sppYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "sapYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "shppYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "spbpYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "studentLoanYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postgradLoanYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "niValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/P11NiValues" + }, + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lines for the P11 Report" + }, + "P11NiAndStatPaymentsLine": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "period": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "monthNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "weekNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "smp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "spp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "sap": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "shpp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "ssp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "spbp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "class1a": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "niValues": { + "$ref": "#/components/schemas/P11DetailedNiValues" + }, + "taxCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lines for the NI Contributions and Statutory Payments table in the P11 Detailed Report" + }, + "P11NiAndStatPaymentsTotalsLine": { + "type": "object", + "properties": { + "toLel": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "lelToPt": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "ptToUel": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "eesAndErs": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "ees": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "class1A": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "ssp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "smp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "spp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "shpp": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "sap": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "spbp": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Summary line for the NI Contributions and Statutory Payments table in the P11 Detailed report" + }, + "P11NiValues": { + "type": "object", + "properties": { + "table": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "period": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "ytd": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Forms a part of the P11 report." + }, + "P11PayeLine": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "period": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "monthNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "weekNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "grossTaxablePay": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "grossTaxablePayYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "tax": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxYTD": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "studentLoan": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postgradLoan": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lines for the Paye Income Tax table in the P11 Detailed report" + }, + "P11PayeSummary": { + "type": "object", + "properties": { + "previousEmploymentPay": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "previousEmploymentTax": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "thisEmploymentPay": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "thisEmploymentTax": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "totalPayForYear": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "totalTaxForYear": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Forms the PAYE summary in the P11 Detailed report" + }, + "P11PayeTotalsLine": { + "type": "object", + "properties": { + "studentLoan": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postgradLoan": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "pay": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "totalPayToDate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxDueToDate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxDue": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Summary line for the Paye Income Tax table in the P11 Detailed report" + }, + "P11ReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/P11" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "P11dCarFreeFuelWithdrawn": { + "type": "object", + "properties": { + "reinstated": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11dExpenses": { + "type": "object", + "properties": { + "travAndSub": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "ent": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "homeTel": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "nonQualRel": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "other": { + "$ref": "#/components/schemas/P11DSingleItem" + }, + "typeLetter": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P11dVans": { + "type": "object", + "properties": { + "fuelCashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "typeLetter": { + "type": "string", + "nullable": true + }, + "taxablePmt": { + "type": "string", + "nullable": true + }, + "excess": { + "type": "string", + "nullable": true + }, + "taxablePmtOrRelevantAmt": { + "type": "string", + "nullable": true + }, + "tradingOrgInd": { + "type": "string", + "nullable": true + }, + "desc": { + "type": "string", + "nullable": true + }, + "other": { + "type": "string", + "nullable": true + }, + "annValProRata": { + "type": "string", + "nullable": true + }, + "grossOrAmtForgone": { + "type": "string", + "nullable": true + }, + "costOrAmtForgone": { + "type": "string", + "nullable": true + }, + "madeGood": { + "type": "string", + "nullable": true + }, + "cashEquivOrRelevantAmt": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "P32": { + "type": "object", + "properties": { + "isQuarterly": { + "type": "boolean", + "description": "[readonly]" + }, + "hmrcLiabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HmrcLiability" + }, + "description": "[readonly]", + "nullable": true + }, + "employerOpeningBalances": { + "$ref": "#/components/schemas/EmployerOpeningBalances" + }, + "openingBalancesTotals": { + "$ref": "#/components/schemas/OpeningBalancesTotals" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "" + }, + "P32ReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/P32" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PapdisDocument": { + "type": "object", + "properties": { + "messageFunctionCode": { + "$ref": "#/components/schemas/PapdisMessageFunctionCode" + }, + "version": { + "$ref": "#/components/schemas/PapdisVersion" + }, + "messageFunctionCodeInt": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "pensionProvider": { + "$ref": "#/components/schemas/PapdisPensionProvider" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "PAPDIS stands for 'Payroll and Pension Data Interface Standard'.\r\nIt is an industry standard for exchanging data between payroll software and pension providers.\r\nOur system provides an export of data in this standard and these models are used to represent the data.\r\nWhilst the relevant reporting API endpoint can provide this data as a JSON entity, it is usually represented in CSV or XML format which our API also provides." + }, + "PapdisDocumentReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PapdisDocument" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PapdisEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "employeeId": { + "type": "string", + "description": "[readonly]", + "format": "uuid" + }, + "name": { + "$ref": "#/components/schemas/PapdisEmployeeName" + }, + "identity": { + "$ref": "#/components/schemas/PapdisEmployeeIdentity" + }, + "contact": { + "$ref": "#/components/schemas/PapdisEmployeeContact" + }, + "pay": { + "$ref": "#/components/schemas/PapdisEmployeePay" + }, + "assessment": { + "$ref": "#/components/schemas/PapdisEmployeeAssessment" + }, + "contribution": { + "$ref": "#/components/schemas/PapdisEmployeeContribution" + }, + "exit": { + "$ref": "#/components/schemas/PapdisEmployeeExit" + }, + "payrollCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "aeStateDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "leaveDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "statePensionAge": { + "type": "integer", + "format": "int32" + }, + "contractualJoinerIndicator": { + "type": "boolean" + }, + "jobTitle": { + "type": "string", + "nullable": true + }, + "pensionMemberReference": { + "type": "string", + "nullable": true + }, + "pensionUniqueId": { + "type": "string", + "nullable": true + }, + "employeeRoleUniqueId": { + "type": "string", + "format": "uuid" + }, + "lastPaymentDate": { + "type": "string", + "description": "The last time the employee was paid", + "format": "date", + "nullable": true + }, + "hasPrevioulyLeftPension": { + "type": "boolean", + "description": "Flag indicating the employee has previously left the pension" + }, + "pensionablePayDefinition": { + "$ref": "#/components/schemas/PensionablePayDefinition" + } + }, + "additionalProperties": false + }, + "PapdisEmployeeAssessment": { + "type": "object", + "properties": { + "assessmentCode": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "eventCode": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "eventDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "statutoryLetterCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "isIndividualAlreadyMemberOfQPS": { + "type": "boolean", + "description": "[readonly]" + }, + "deferralDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "enrolmentCommunicationsIssuedDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "workerExclusionCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "reenrolmentIndicator": { + "type": "boolean", + "description": "[readonly]" + }, + "optOutWindowEndDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "pensionJoinReason": { + "$ref": "#/components/schemas/PensionJoinReason" + }, + "pensionStartDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployeeContact": { + "type": "object", + "properties": { + "postalAddress": { + "$ref": "#/components/schemas/PapdisEmployeeContactPostalAddress" + }, + "emailAddress": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "secondaryEmailAddress": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "telephone": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "mobile": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployeeContactPostalAddress": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address2": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address3": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address4": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "postcode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "country": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployeeContribution": { + "type": "object", + "properties": { + "employerContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employerContributionsPercent": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employeeContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employeeContributionsPercent": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "additionalVoluntaryContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "additionalVoluntaryContributionsPercent": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "salarySacrificeIndicator": { + "type": "boolean", + "description": "[readonly]" + }, + "contributionStartDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "employeeContributionIsPercentage": { + "type": "boolean", + "description": "[readonly]" + }, + "employerContributionIsPercentage": { + "type": "boolean", + "description": "[readonly]" + }, + "unadjustedEmployeeContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "unadjustedEmployerContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "unadjustedAdditionalVoluntaryContributionsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employerContributionNiSavings": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "contributionLevelType": { + "$ref": "#/components/schemas/PensionContributionLevelType" + }, + "isAvcOnly": { + "type": "boolean", + "description": "[readonly]" + }, + "employerContributionIncludesNiSaving": { + "type": "boolean", + "description": "[readonly]" + }, + "unadjustedAdditionalVoluntaryContributionsPercent": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "isHalfContributionMember": { + "type": "boolean", + "description": "[readonly]" + }, + "assumedPensionablePay": { + "type": "number", + "description": "[readonly]", + "format": "double", + "nullable": true + }, + "isPensionRefund": { + "type": "boolean", + "description": "[readonly]" + }, + "lowerLimit": { + "type": "number", + "description": "[readonly]", + "format": "double" + } + }, + "additionalProperties": false + }, + "PapdisEmployeeExit": { + "type": "object", + "properties": { + "exitDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "exitReasonCode": { + "type": "integer", + "description": "[readonly]", + "format": "int32", + "nullable": true + }, + "aeOptOutDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "aeOptOutReference": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "reasonForLeaving": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployeeIdentity": { + "type": "object", + "properties": { + "employeeId": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "birthDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "gender": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "nationalInsuranceNumber": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "employmentStartDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "maritalStatus": { + "$ref": "#/components/schemas/MaritalStatus" + } + }, + "additionalProperties": false + }, + "PapdisEmployeeName": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "forename1": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "forename2": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "surname": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployeePay": { + "type": "object", + "properties": { + "pensionableEarningsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "totalGrossQualifyingEarningsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "annualSalary": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "annualPensionableEarningsAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "payAmountMultiplier": { + "type": "number", + "description": "[readonly]", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisEmployer": { + "type": "object", + "properties": { + "pensionRule": { + "$ref": "#/components/schemas/PensionRule" + }, + "employerId": { + "type": "string", + "description": "[readonly] Taken from the papdisEmployerId property of the PensionProvider", + "nullable": true + }, + "group": { + "type": "string", + "description": "[readonly] Taken from the papdisGroup property of the WorkerGroup", + "nullable": true + }, + "subGroup": { + "type": "string", + "description": "[readonly] Taken from the papdisSubGroup property of the WorkerGroup", + "nullable": true + }, + "payrollPeriod": { + "$ref": "#/components/schemas/PapdisPayrollPeriod" + }, + "stagingDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "cyclicalReenrolmentDate": { + "type": "string", + "description": "[readonly]", + "format": "date", + "nullable": true + }, + "name": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "postalAddress": { + "$ref": "#/components/schemas/PapdisEmployerContactPostalAddress" + }, + "fullTimeContractedHours": { + "type": "number", + "description": "[readonly]", + "format": "double", + "nullable": true + }, + "fullTimeContractedWeeks": { + "type": "number", + "description": "[readonly]", + "format": "double", + "nullable": true + }, + "contractedWeeks": { + "type": "number", + "description": "[readonly]", + "format": "double", + "nullable": true + }, + "id": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + } + }, + "additionalProperties": false + }, + "PapdisEmployerContactPostalAddress": { + "type": "object", + "properties": { + "address1": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address2": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address3": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "address4": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "postcode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "country": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisMessageFunctionCode": { + "enum": [ + "Enrol", + "InfoOnly", + "AssessmentRequest", + "AssessmentResponse", + "WokerInstruction" + ], + "type": "string" + }, + "PapdisPayrollPeriod": { + "type": "object", + "properties": { + "payPeriodStartDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "payPeriodEndDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "contributionDeductionDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "frequencyCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "taxPeriod": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "payReferenceStartDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "payReferenceEndDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PapdisEmployee" + }, + "description": "[readonly] Employees and contributions made in this period", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisPensionProvider": { + "type": "object", + "properties": { + "pensionProviderId": { + "type": "string", + "description": "[readonly] Taken from the papdisProviderId property of the PensionProvider", + "nullable": true + }, + "employers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PapdisEmployer" + }, + "nullable": true + }, + "accountNo": { + "type": "string", + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false + }, + "PapdisVersion": { + "enum": [ + "PAP10", + "PAP11" + ], + "type": "string" + }, + "PartnerDetails": { + "type": "object", + "properties": { + "firstName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "initials": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "niNumber": { + "maxLength": 15, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "PayBasis": { + "enum": [ + "Hourly", + "Daily", + "Monthly" + ], + "type": "string" + }, + "PayCode": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "title": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string" + }, + "defaultValue": { + "type": "number", + "description": "If a non-zero value is provided then when this code is selected in our UI the value will be automatically filled.", + "format": "double", + "nullable": true + }, + "isDeduction": { + "type": "boolean", + "description": "If set to true then a PayLine using this code will be treated as a deduction as opposed to an addition." + }, + "isNiable": { + "type": "boolean", + "description": "Determines whether or not the value of PayLines using this code should be taken into consideration when calculating National Insurance Contributions." + }, + "isTaxable": { + "type": "boolean", + "description": "Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the PAYE liability." + }, + "isPensionable": { + "type": "boolean", + "description": "Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the total pensionable pay." + }, + "isAttachable": { + "type": "boolean", + "description": "Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the attachable pay for AttachmentOrders." + }, + "isRealTimeClass1aNiable": { + "type": "boolean", + "description": "Determines whether or not the value of PayLines using this code are subject to real time Class 1A NIC." + }, + "isNotContributingToHolidayPay": { + "type": "boolean", + "description": "If true then any payments made using this code will not contribute towards holiday pay calculations." + }, + "isQualifyingEarningsForAe": { + "type": "boolean", + "description": "If true then any payments made using this code will be used as the basis for calculating QualifyingEarnings for AutoEnrolment assessments.\r\nIf it is set to null then when it's next retrieved it'll have the same value as PensionablePay", + "nullable": true + }, + "isNotTierable": { + "type": "boolean", + "description": "If true then any payments made using this code will not be included when calculating the tier an employee should be on for a Tiered Pension." + }, + "isTcp_Tcls": { + "type": "boolean", + "description": "If true then any payments made using this code will be reported as\r\na Trivial Commutation Payment (A - TCLS)" + }, + "isTcp_Pp": { + "type": "boolean", + "description": "If true then any payments made using this code will be reported as\r\na Trivial Commutation Payment (B - Personal Pension)" + }, + "isTcp_Op": { + "type": "boolean", + "description": "If true then any payments made using this code will be reported as\r\na Trivial Commutation Payment (C - Occupational Pension)" + }, + "flexibleDrawdown": { + "$ref": "#/components/schemas/FlexibleDrawdown" + }, + "isAutoAdjust": { + "type": "boolean", + "description": "Can be used to inform a User to what default value to set for PayLine.autoAdjustForLeave for new lines created." + }, + "calculationType": { + "$ref": "#/components/schemas/PayCodeCalculationType" + }, + "multiplierType": { + "$ref": "#/components/schemas/PayCodeMultiplierType" + }, + "dailyRateMultiplier": { + "type": "number", + "description": "If the MultiplierType is MultipleOfDailyRate then this sets the multiple to be used, ie 1.5", + "format": "double" + }, + "hourlyRateMultiplier": { + "type": "number", + "description": "If the MultiplierType is MultipleOfHourlyRate then this sets the multiple to be used, ie 1.5", + "format": "double" + }, + "isSystemCode": { + "type": "boolean", + "description": "[readonly] System Codes cannot be deleted or edited" + }, + "isControlCode": { + "type": "boolean", + "description": "[readonly] Control Codes cannot be deleted or edited nor can PayLines be assigned to them." + }, + "isNotional": { + "type": "boolean", + "description": "Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance." + }, + "payee": { + "type": "string", + "description": "The Id of the Payee, if any, that deductions are to be paid to.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Each PayLine has a Code. The Code will match the Code property of a PayCode.\r\nThe PayCode that is used determines how the amount is treated with regards to tax, NI and pensions" + }, + "PayCodeCalculationType": { + "enum": [ + "FixedAmount", + "PercentageOfGross", + "PercentageOfNet", + "MultipleOfHourlyRate", + "MultipleOfDailyRate", + "FixedAnnualAmount" + ], + "type": "string" + }, + "PayCodeMultiplierType": { + "enum": [ + "None", + "Hours", + "Days" + ], + "type": "string" + }, + "PayCodeSet": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string", + "description": "The name of this PayCodeSet" + }, + "payCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The Code of any PayCodes included in this PayCodeSet", + "nullable": true + }, + "useForMcr": { + "type": "boolean" + }, + "mcrPayCategory": { + "$ref": "#/components/schemas/McrPayCategory" + }, + "useForLgps": { + "type": "boolean", + "description": "Flag indicating if this PayCodeSet will be used for LGPS pay categorisation" + }, + "lgpsPayCategory": { + "$ref": "#/components/schemas/LgpsPayCategory" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "A PayCodeSet is used to group together a number of PayCodes." + }, + "PayCodeVarianceLine": { + "type": "object", + "properties": { + "code": { + "type": "string", + "nullable": true + }, + "primaryValue": { + "type": "number", + "format": "double", + "nullable": true + }, + "secondaryValue": { + "type": "number", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false + }, + "PayElementReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayElementReportLine" + }, + "nullable": true + }, + "payCodeTotals": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double", + "nullable": true + }, + "nullable": true, + "readOnly": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PayElementReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "niNumber": { + "type": "string", + "nullable": true + }, + "payElements": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double", + "nullable": true + }, + "nullable": true + }, + "hasPay": { + "type": "boolean", + "readOnly": true + }, + "totalPay": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PayElementReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PayElementReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PayGradesReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AveragePayGradesReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PayGradesReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PayGradesReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PayLine": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used).\r\nIf the PayCode has a CalculationType other than FixedAmount then this field will be a percentage.\r\nIf the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated.", + "format": "double" + }, + "rate": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used", + "format": "double", + "nullable": true + }, + "multiplier": { + "type": "number", + "description": "If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours", + "format": "double", + "nullable": true + }, + "description": { + "maxLength": 100, + "type": "string", + "description": "A free form description to accompany this line. It will be displayed on the payslip.", + "nullable": true + }, + "attachmentOrderId": { + "type": "string", + "description": "[readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO", + "format": "uuid", + "nullable": true + }, + "pensionId": { + "type": "string", + "description": "[readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS", + "format": "uuid", + "nullable": true + }, + "leaveId": { + "type": "string", + "description": "[readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay", + "format": "uuid", + "nullable": true + }, + "loanId": { + "type": "string", + "description": "[readonly] The Id of the associated Loan, if any.", + "format": "uuid", + "nullable": true + }, + "leaveStatutoryDaysPaid": { + "type": "number", + "description": "[readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern).", + "format": "double", + "nullable": true + }, + "leaveStatutoryWeeksPaid": { + "type": "number", + "description": "[readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern).", + "format": "double", + "nullable": true + }, + "code": { + "type": "string", + "description": "The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition.", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "childId": { + "type": "string", + "description": "This is nothing but the UniqueId of the model.", + "format": "uuid" + }, + "isNetToGross": { + "type": "boolean", + "description": "If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target." + }, + "targetNetToGrossValue": { + "type": "number", + "description": "The original net fixed addition amount that is considered to be a take home pay target.", + "format": "double", + "nullable": true + }, + "netToGrossDiscrepancy": { + "type": "number", + "description": "The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation.", + "format": "double", + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "description": "The date the pay line starts being calculated in payrun", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "description": "The date the pay line stops being calculated in payrun", + "format": "date", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "costCentre": { + "type": "string", + "nullable": true + }, + "departmentId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "costCentreId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "isAutoGeneratedBasicPayLine": { + "type": "boolean" + }, + "percentageOfEffectiveDays": { + "type": "number", + "description": "The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun", + "format": "double", + "nullable": true + }, + "totalWorkingDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "isAutomaticBackPay": { + "type": "boolean", + "description": "Automatically calculate back pay and add or modify the necessary pay lines for this addition/deduction when a pay run is created.\r\nApplicable only to employee level addition/deduction pay lines.\r\nIf set to false then you must manually handle the calculation and adding of back pay lines." + }, + "ignoreInitialBackPay": { + "type": "boolean", + "description": "Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology.\r\nIf set to false, the automatic backpay calculation will be performed on the first pay run." + }, + "initialBackPayPublicPayRunId": { + "type": "string", + "description": "Used to mark the first payrun where this payline has been payrolled for backpay", + "format": "uuid", + "nullable": true + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "contributesToBasicPay": { + "type": "boolean", + "description": "Indicates whether this pay line contributes to the basic pay of the employee.\r\nWill be set to true by default when IsAutoGeneratedBasicPayLine is true." + }, + "calculateAsWhenPaid": { + "type": "boolean", + "description": "Indicates whether this pay line should be treated as When Paid rather than When Earned" + }, + "totalPaidDays": { + "type": "number", + "format": "double", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "The employee role which is associated with this pay line.\r\nIf set to null, the pay line is not related with a role.", + "format": "uuid", + "nullable": true + }, + "employeeRoleReference": { + "type": "string", + "nullable": true + }, + "earnedFrom": { + "type": "string", + "description": "Nullable DateTime property \"EarnedFrom\" in the PayLine model to store the start date of the PayLine's 'earned' period in a PayRun.", + "format": "date", + "nullable": true + }, + "earnedTo": { + "type": "string", + "description": "Nullable DateTime property \"EarnedTo\" in the PayLine model to store the end date of the PayLine's 'earned' period in a PayRun.", + "format": "date", + "nullable": true + }, + "periodFrom": { + "type": "string", + "description": "Nullable DateTime property \"PeriodFrom\" in the PayLine model to store the start date of the PayRun period the current PayLine is part of.", + "format": "date", + "nullable": true + }, + "periodTo": { + "type": "string", + "description": "Nullable DateTime property \"PeriodTo\" in the PayLine model to store the end date of the PayRun period the current PayLine is part of.", + "format": "date", + "nullable": true + }, + "annualValue": { + "type": "number", + "description": "The original value from the PayLine before we modify it\r\nCurrently only used when CalculationType is set to FixedAnnualAmount\r\nso we can determine whether the pay line value needs calculating or not\r\nTo recalculate set to null with annual amount recorded in Value", + "format": "double", + "nullable": true + }, + "parentId": { + "type": "string", + "description": "[readonly] The Id of the associated employee level pay line, if the current line is a back pay line.", + "format": "uuid", + "nullable": true + }, + "isAutoCalculatedBackPayLine": { + "type": "boolean", + "readOnly": true + }, + "isZeroHoursTeachersBackPayLine": { + "type": "boolean", + "description": "[readonly] Indicates whether this pay line is a backdated pay claim line\r\nbelonging to a zero hours contract teacher." + }, + "analysisCategoriesCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisCategoryCodes" + }, + "description": "List of analysis Category Codes", + "nullable": true + }, + "analysisCategoryCodeIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "List of analysis Category Codes uniqueId", + "nullable": true + }, + "paySpineId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine.", + "format": "uuid", + "nullable": true + }, + "paySpineGradeId": { + "type": "string", + "description": "[readonly] The Id of the associated pay spine grade.", + "format": "uuid", + "nullable": true + }, + "spinalPointId": { + "type": "string", + "description": "[readonly] The Id of the associated spinal point.", + "format": "uuid", + "nullable": true + }, + "londonAllowanceId": { + "type": "integer", + "description": "Used to set London allowance id for payline", + "format": "int32", + "nullable": true + }, + "fullTimeAnnualValue": { + "type": "number", + "description": "Used to set Full Time Annual Value for payline", + "format": "double" + }, + "paySpine": { + "type": "string", + "description": "PaySpine name based on PaySpineId", + "nullable": true + }, + "payGrade": { + "type": "string", + "description": "PayGrade name based on PayGradeId", + "nullable": true + }, + "spinePoint": { + "type": "string", + "description": "SpinePoint name based on SpinePointId", + "nullable": true + } + }, + "additionalProperties": false, + "description": "As well as the basic pay amount for an employee there are often additions and deductions such as bonuses.\r\nThese additions and deductions are represented using this model." + }, + "PayMethod": { + "enum": [ + "Cash", + "Cheque", + "Credit", + "DirectDebit" + ], + "type": "string" + }, + "PayOptions": { + "type": "object", + "properties": { + "period": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "method": { + "$ref": "#/components/schemas/PayMethod" + }, + "withholdTaxRefundIfPayIsZero": { + "type": "boolean", + "description": "If you don't want negative PAYE values when the Gross pay is zero, set this to true" + }, + "taxAndNi": { + "$ref": "#/components/schemas/TaxAndNi" + }, + "fpsFields": { + "$ref": "#/components/schemas/FpsFields" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "nationalMinimumWage": { + "type": "boolean" + }, + "payCode": { + "type": "string", + "description": "If you want the Employees pay to be allocated to a code other than BASIC, specify it here", + "nullable": true + }, + "mileageVehicleType": { + "$ref": "#/components/schemas/MileageVehicleType" + }, + "mapsMiles": { + "type": "integer", + "description": "The number of miles to pay for as Mileage Allowance Payments", + "format": "int32", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "baseHourlyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base hourly rate. Eg Overtime.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "baseDailyRate": { + "type": "number", + "description": "This property is used to calculate values for PayCodes that are set as multiples of \r\nthe employees base daily rate. Eg sick.\r\nIf this is set as zero then we'll attempt to calculate a value based on the other fields", + "format": "double" + }, + "basicPay": { + "type": "number", + "description": "The amount of basic pay the Employee is regularly paid each period\r\nThis amount is the combined total of all pay elements that contribute to basic pay", + "format": "double" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "This sets whether the PayLine should be automatically adjusted or not for:\r\nLeave Entries;\r\nStarters/Leavers;\r\nPayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun" + }, + "niTable": { + "type": "string" + }, + "regularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayLine" + }, + "description": "These are used to make additions/deductions to the pay for this Employee.\r\nYou do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created.", + "nullable": true + }, + "excludedRegularPayLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayLine" + }, + "description": "These used to store the PayLines that have been excluded from RegularPaylines.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This object forms the basis of the Employees payment." + }, + "PayOptionsImport": { + "type": "object", + "properties": { + "employerIdentifier": { + "type": "string", + "description": "Optional. But if one entry has it then all must.\r\nAllows you to import to multiple employers by specifying the Employers AlternativeIdentifier", + "nullable": true + }, + "payrollCode": { + "type": "string", + "description": "The payroll code of the employee to update", + "nullable": true + }, + "payAmount": { + "type": "number", + "description": "The amount the Employee is regularly paid each period", + "format": "double" + }, + "basis": { + "$ref": "#/components/schemas/PayBasis" + }, + "payCode": { + "type": "string", + "description": "If you want to override the PayCode used for the Basic Pay then set the code here, otherwise leave this blank and the default will be used.", + "nullable": true + }, + "roleReference": { + "type": "string", + "description": "This is the unique reference of the Role that the employee is assigned to.", + "nullable": true + }, + "payAmountMultiplier": { + "type": "number", + "description": "This property is irrelevant if the basis is Monthly.\r\nBut if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period.", + "format": "double" + }, + "note": { + "type": "string", + "description": "Any note that you'd like to appear on the payslip", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "isNetToGross": { + "type": "boolean" + }, + "department": { + "type": "string", + "description": "Any Department that you'd like to appear on the payslip", + "nullable": true + }, + "costCentre": { + "type": "string", + "description": "Any CostCentre that you'd like to appear on the payslip", + "nullable": true + }, + "analysisCategoryCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisCategoryCodes" + }, + "description": "List of Analysis Category Codes associated with this item on the payslip.", + "nullable": true + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayLine" + }, + "nullable": true + }, + "effectiveFrom": { + "type": "string", + "description": "EffectiveFrom date for imported pay lines", + "format": "date", + "nullable": true + }, + "effectiveTo": { + "type": "string", + "description": "EffectiveTo date for imported pay lines", + "format": "date", + "nullable": true + }, + "isAutomaticBackPay": { + "type": "boolean", + "description": "IsAutomaticBackPay for imported pay lines" + }, + "ignoreInitialBackPay": { + "type": "boolean", + "description": "IgnoreInitialBackPay for imported pay lines" + }, + "contributesToBasicPay": { + "type": "boolean", + "description": "ContributesToBasicPay for imported pay lines" + }, + "autoAdjustForLeave": { + "type": "boolean", + "description": "AutoAdjustForLeave for imported pay lines" + }, + "paySpine": { + "type": "string", + "description": "PaySpine for imported pay lines", + "nullable": true + }, + "payGrade": { + "type": "string", + "description": "PayGrade for imported pay lines", + "nullable": true + }, + "spinePoint": { + "type": "string", + "description": "SpinePoint for imported pay lines", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This object is used to import payment information for a payrun entry" + }, + "PayPeriodEventType": { + "enum": [ + "SubmitForProcessing", + "SendForApproval", + "Approval", + "Finalise", + "SendPaySlip", + "SubmitRti" + ], + "type": "string", + "description": "Different events supported for a PaySchedule Period. These events happen a pre-configured number of days before the PaymentDate for that PaySchedulePeriod." + }, + "PayPeriodTypes": { + "enum": [ + "Custom", + "Monthly", + "FourWeekly", + "Fortnightly", + "Weekly", + "Daily" + ], + "type": "string" + }, + "PayPeriods": { + "enum": [ + "Custom", + "Monthly", + "FourWeekly", + "Fortnightly", + "Weekly", + "Daily" + ], + "type": "string" + }, + "PayRun": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "taxMonth": { + "type": "integer", + "description": "[readonly] The Tax Month that the Payment Date falls in", + "format": "int32" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "[readonly] Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "period": { + "type": "integer", + "description": "[readonly] The period (i.e, Tax Week or Tax Month) that this PayRun is for.", + "format": "int32" + }, + "startDate": { + "type": "string", + "description": "[readonly] The start date of the period this PayRun covers", + "format": "date" + }, + "endDate": { + "type": "string", + "description": "[readonly] The end date of the period this PayRun covers", + "format": "date" + }, + "paymentDate": { + "type": "string", + "description": "[readonly] The intended date that Employees will be paid, although this can be changed on a per PayRunEntry basis", + "format": "date" + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of Employees included in this PayRun (including any CIS Subcontractors)", + "format": "int32" + }, + "subContractorCount": { + "type": "integer", + "description": "[readonly] The number of CIS Subcontractors included in this PayRun", + "format": "int32" + }, + "nonRtiEmployeeCount": { + "type": "integer", + "description": "[readonly] The number of employees excluded from the RTI submission in this PayRun", + "format": "int32" + }, + "totals": { + "$ref": "#/components/schemas/PayRunTotals" + }, + "payslipScheduledDateTime": { + "type": "string", + "description": "The scheduled date time for sending payslips by email.", + "format": "date", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/PayRunState" + }, + "isClosed": { + "type": "boolean", + "description": "[readonly] Set to True if the PayRun is Finalised and changes can no longer be made", + "readOnly": true + }, + "isRolledBack": { + "type": "boolean", + "description": "[readonly] Set to True if the PayRun is currently rolled back" + }, + "dateClosed": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "autoPilotCloseDate": { + "type": "string", + "description": "[readonly] If AutoPilot is enabled in the AutomationSettings for the Employer then this property will tell you when\r\nthe payrun will be automatically closed", + "format": "date", + "nullable": true + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The PayRunEntries that make up this PayRun.\r\nThis is populate automatically when you start a PayRun.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This model is right at the very heart of the software.\r\nThere is a PayRun for each period in which people are paid." + }, + "PayRunChanges": { + "type": "object", + "properties": { + "payRunEntries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "A list of PayRunEntries where the PayRunEntry itself has been modified and.or the related Employee record was changed", + "nullable": true + } + }, + "additionalProperties": false + }, + "PayRunCsvType": { + "enum": [ + "Summary", + "Lines", + "PayrollCodeAndNameOnly", + "ColumnCsvMapping" + ], + "type": "string" + }, + "PayRunEntry": { + "type": "object", + "properties": { + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "taxMonth": { + "type": "integer", + "description": "[readonly] The Tax Month that the Payment Date falls in", + "format": "int32" + }, + "startDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "endDate": { + "type": "string", + "description": "[readonly]", + "format": "date" + }, + "note": { + "maxLength": 500, + "type": "string", + "description": "Any note that you'd like to appear on the payslip", + "nullable": true + }, + "bacsSubReference": { + "type": "string", + "description": "[readonly] A randomly generated string for use with the RTI Hash Cross Reference", + "nullable": true + }, + "bacsHashCode": { + "type": "string", + "description": "[readonly] A Hash Code used for RTI BACS Hash Cross Reference", + "nullable": true + }, + "percentageOfWorkingDaysPaidAsNormal": { + "type": "number", + "description": "[readonly] If the employee is paid a set amount per period (ie, not an hourly or daily rate) and there is any Leave that is either Not Paid or Statutory Pay then this value\r\nwill give the percentage of working days (based on the Working Pattern) that should be paid as normal.\r\nIf there is no Leave in the period or PayOptions.AutoAdjustForLeave is false, then this will be 1.", + "format": "double" + }, + "workingDaysNotPaidAsNormal": { + "type": "number", + "description": "[readonly] If PercentageOfWorkingDaysPaidAsNormal has a value other than 1\r\nthen this property will tell you how many working days have been deducted from the basic pay\r\ndue to either being Not Paid or Statutory Pay", + "format": "double" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "[readonly] Indicates whether this uses the first, second, third (etc) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "period": { + "type": "integer", + "description": "[readonly] The Tax Week or Tax Month number this PayRunEntry relates to", + "format": "int32" + }, + "isNewStarter": { + "type": "boolean", + "description": "Determines whether or not this Employee will be declared as a new starter on the resulting FPS" + }, + "unpaidAbsence": { + "type": "boolean", + "description": "[readonly] Indicates that there was unpaid absence in the pay period" + }, + "hasAttachmentOrders": { + "type": "boolean", + "description": "[readonly] Indicates that there are AttachmentOrders for this Employee in this entry" + }, + "paymentDate": { + "type": "string", + "description": "The date this payment was or will be made", + "format": "date" + }, + "priorPayrollCode": { + "type": "string", + "description": "[readonly] If the FPS needs to declare a change of PayId then this will contain the previous code\r\nIt's worked out automatically but can also be set from the Employees EmploymentDetails property.", + "nullable": true + }, + "pensionSummary": { + "$ref": "#/components/schemas/PensionSummary" + }, + "pensionSummaries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionSummary" + }, + "description": "[readonly] A summary of the details for the Pensions (if any) that the Employee is assigned to.", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "totals": { + "$ref": "#/components/schemas/PayRunTotals" + }, + "periodOverrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValueOverride" + }, + "description": "Any calculated values for this period that should be overridden with a different value", + "nullable": true + }, + "totalsYtd": { + "$ref": "#/components/schemas/PayRunTotals" + }, + "totalsYtdOverrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValueOverride" + }, + "description": "Any values of TotalsYtd that should be overridden with a different value", + "nullable": true + }, + "forcedCisVatAmount": { + "type": "number", + "description": "If this employee is a CIS Subcontractor registered for VAT, we'll automatically work out VAT at the set rate.\r\nIf you want to override this calculations then set this property to anything other than null.", + "format": "double", + "nullable": true + }, + "holidayAccrued": { + "type": "number", + "description": "The amount of holiday days or hours accrued in the period.", + "format": "double" + }, + "state": { + "$ref": "#/components/schemas/PayRunState" + }, + "isClosed": { + "type": "boolean", + "description": "[readonly] Set to True if the PayRun is Finalised and changes can no longer be made to the PayRunEntries", + "readOnly": true + }, + "manualNi": { + "type": "boolean", + "description": "If set to true then you must provide your own value for NationalInsuranceCalculation.\r\nYou'd normally leave this set to false and let us automatically calculate NI amounts." + }, + "niSplit": { + "type": "boolean", + "description": "If set to true Ni calculations are done for backdated pay for each pay period separately and then summed up" + }, + "nationalInsuranceCalculation": { + "$ref": "#/components/schemas/NationalInsuranceCalculation" + }, + "payrollCodeChanged": { + "type": "boolean", + "description": "[readonly] Indicates whether or not the Payroll Code for this Employee has changed since the last FPS", + "readOnly": true + }, + "aeNotEnroledWarning": { + "type": "boolean", + "description": "[readonly] If true then this Employee needs to be on an Auto Enrolment pension but isn't yet." + }, + "fps": { + "$ref": "#/components/schemas/Item" + }, + "emailId": { + "type": "string", + "description": "If the Payslip for this PayRunEntry has been emailed to the employee then the Id for an EmployerEmail will be provided here.\r\nif the value is all zeroes then the email is in the process of being created.", + "format": "uuid", + "nullable": true + }, + "recievingOffsetPay": { + "type": "boolean", + "description": "If the pay is being topped up due to an applied Leave having the offset value set to true then\r\nthis will be set to true" + }, + "paymentAfterLeaving": { + "type": "boolean", + "description": "[readonly] If this payment is for an employee that has left then this is set to true." + }, + "umbrellaPayment": { + "$ref": "#/components/schemas/UmbrellaPayment" + }, + "isRemoved": { + "type": "boolean", + "description": "Has the entry been removed from the payrun" + }, + "isRolledBack": { + "type": "boolean", + "description": "[readonly] Set to True if the Pay Run Entry is currently rolled back" + }, + "periodsCovered": { + "type": "integer", + "description": "[readonly] The amount of periods that the Pay Run Entry covers. This can be > 1 when back pay for previous periods is paid in the current period", + "format": "int32" + }, + "employeeRolePayItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeRolePayItem" + }, + "description": "[readonly] Automatically populated.\r\nArray of base hourly and daily rates for the employee roles", + "nullable": true + }, + "warnings": { + "$ref": "#/components/schemas/PayRunEntryWarningType" + }, + "niLetterError": { + "$ref": "#/components/schemas/NiLetterError" + }, + "teachersPensionAgeWarning": { + "$ref": "#/components/schemas/TeachersPensionAgeWarning" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + }, + "personalDetails": { + "$ref": "#/components/schemas/PersonalDetails" + }, + "employmentDetails": { + "$ref": "#/components/schemas/EmploymentDetails" + }, + "payOptions": { + "$ref": "#/components/schemas/PayOptions" + } + }, + "additionalProperties": false, + "description": "A PayRun contains multiple PayRunEntries, one for each Employee that is being paid.\r\nThe value for ```PersonalDetails``` and ```EmploymentDetails``` is copied from the Employee record.\r\nSo to change them you should update the Employee, not the PayRunEntry.\r\nChanges made to the Employee are only reflected whilst the PayRun is still open.\r\nOnce you finalise and close the PayRun then a snapshot is taken of these values which is stored with the PayRunEntry for future reference." + }, + "PayRunEntrySortBy": { + "enum": [ + "PayrollCode", + "FirstName", + "LastName", + "TotalCost", + "NetPay", + "GrossPay", + "TakeHomePay", + "Paye", + "EmployeeNic", + "EmployerNic", + "PaymentDate" + ], + "type": "string" + }, + "PayRunEntryWarningType": { + "enum": [ + "MissingBankDetails", + "MissingAddressLines", + "AddressInvalid", + "NinoInvalid", + "BelowNationalMinimumWage", + "HighGrossPay", + "HighNetPay", + "InReceiptOfTaxRefund", + "NetToGrossDiscrepancyAboveThreshold", + "StatutoryMaternity", + "TeachersPensionNotAutoCalculated", + "JointTeachersPensionsNotAutoCalculated", + "MissingNiNumber", + "OpenEndedAbsences", + "SspHasExpired", + "SspDueToExpire", + "InvalidBankDetails", + "DuplicateEmployee", + "TeachersPensionAge" + ], + "type": "string" + }, + "PayRunJournal": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRunSummaryLine" + }, + "nullable": true + }, + "date": { + "type": "string", + "description": "[readonly] The PaymentDate from the PayRun", + "format": "date" + }, + "title": { + "type": "string", + "description": "[readonly] The status of the task for posting this journal to an ExternalDataProvider", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusMessage": { + "type": "string", + "description": "[readonly] A message to elaborate on the Status", + "nullable": true + }, + "link": { + "type": "string", + "description": "[readonly] If available, a link to the journal in the ExternalDataProvider", + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "period": { + "type": "integer", + "description": "[readonly]", + "format": "int32" + }, + "mergeMatchingNominals": { + "type": "boolean", + "description": "[readonly]" + }, + "csvFormat": { + "$ref": "#/components/schemas/JournalCsvFormat" + } + }, + "additionalProperties": false + }, + "PayRunPayment": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/PayeeType" + }, + "payee": { + "$ref": "#/components/schemas/Item" + }, + "date": { + "type": "string", + "description": "[readonly] The date the payment is to be made", + "format": "date" + }, + "method": { + "$ref": "#/components/schemas/PayMethod" + }, + "amount": { + "type": "number", + "description": "[readonly] The amount to pay", + "format": "double" + }, + "reference": { + "type": "string", + "description": "[readonly] The period the payment is for", + "nullable": true + }, + "employerPaymentReference": { + "type": "string", + "description": "The employer's payment reference, formatted as per the employer settings", + "nullable": true + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "bacsHash": { + "type": "string", + "description": "[readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsHash included on the FPS", + "nullable": true + }, + "bacsSubReference": { + "type": "string", + "description": "[readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsSubReference included on the FPS", + "nullable": true + }, + "isBankDetailValid": { + "type": "boolean", + "description": "[readonly] for checking if bank details are valid" + } + }, + "additionalProperties": false + }, + "PayRunState": { + "enum": [ + "Opening", + "Open", + "ReOpening", + "RollingBack", + "RolledBack", + "SubmittedForProcessing", + "Processing", + "AwaitingApproval", + "Approved", + "Finalising", + "Finalised", + "Deleting" + ], + "type": "string" + }, + "PayRunStateChange": { + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/PayRunState" + }, + "reason": { + "$ref": "#/components/schemas/PayRunStateChangeReason" + }, + "reasonText": { + "maxLength": 300, + "type": "string", + "description": "A free-form text field for a reason for the change of state.", + "nullable": true + }, + "employeeUniqueIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "List of employee unique ids, whose PayRunEntries to be re-opened during a Payrun rollback operation.\r\nWill be used only during a transition to a rolled back pay run state", + "nullable": true + } + }, + "additionalProperties": false + }, + "PayRunStateChangeReason": { + "enum": [ + "Other", + "AdditionalDataNotSubmitted", + "ChangeToOriginalData", + "PayBureauError" + ], + "type": "string" + }, + "PayRunSummaryLine": { + "type": "object", + "properties": { + "nominalCode": { + "type": "string", + "description": "[readonly] If you've set up NominalCodeMapping then the relevant Nominal code for the PayCode will be shown here.", + "nullable": true + }, + "departmentCode": { + "type": "string", + "description": "[readonly] If the journal is split by department then the relevant department code is shown here.", + "nullable": true + }, + "nominalName": { + "type": "string", + "description": "[readonly] As above", + "nullable": true + }, + "description": { + "type": "string", + "description": "[readonly] A description of what this line summarises.", + "nullable": true + }, + "qty": { + "type": "number", + "description": "[readonly] If the PayCode is a Multiplier code then this will contain the number of days/hours", + "format": "double", + "nullable": true + }, + "value": { + "type": "number", + "description": "[readonly] The total value for this line.", + "format": "double" + }, + "payCode": { + "$ref": "#/components/schemas/PayCode" + }, + "costCentreCode": { + "type": "string", + "description": "[readonly] If the journal is split by cost centre then the relevant cost centre code is shown here.", + "nullable": true + }, + "analysisCategories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisCategory" + }, + "description": "[readonly] If the journal is split by analysis categories", + "nullable": true + }, + "analysisCategoryCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisCategoryCode" + }, + "description": "[readonly] If the journal is split by analysis categories then the relevant analysis categories code is shown here.", + "nullable": true + }, + "employeeUniqueId": { + "type": "string", + "description": "[readonly] The EmployeeId this summary line relates to.", + "format": "uuid", + "nullable": true + }, + "journalNarrative": { + "type": "string", + "description": "[readonly] Gets the journal narrative for the pension, if defined.", + "nullable": true + }, + "pensionId": { + "type": "string", + "description": "[readonly] The PensionId of the pension associated with this summary line, only present for pension summary lines.", + "format": "uuid", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Employee" + }, + "unMappedNominalCode": { + "type": "string", + "description": "[readonly] Unmapped Nominal Code is the Nominal Code without the Nominal Mapping.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "An array of this model is used to represent a summary of a PayRun.\r\nThis would typically be used for creating accounting entries for the PayRun." + }, + "PayRunSummaryLineIEnumerableReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRunSummaryLine" + }, + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PayRunTotals": { + "type": "object", + "properties": { + "basicPay": { + "type": "number", + "description": "[readonly] The amount to be paid to this Employee as a result of the PayOptions that have been set", + "format": "double" + }, + "gross": { + "type": "number", + "description": "[readonly] Gross pay", + "format": "double" + }, + "grossForNi": { + "type": "number", + "description": "[readonly] The amount of the Gross that is subject to NI", + "format": "double" + }, + "grossForNiNonRti": { + "type": "number", + "description": "[readonly] The amount of the Gross that is subject to NI but excluded from RTI", + "format": "double" + }, + "grossNotSubjectToEmployersNi": { + "type": "number", + "description": "[readonly] The amount of the Gross that is not subject to Employers NI.\r\nThis is the same as GrossForNI where the employees NI Table has an Er contribution", + "format": "double" + }, + "grossNotSubjectToEmployersNiNonRti": { + "type": "number", + "description": "[readonly] The amount of the Gross that is not subject to Employers NI.\r\nThis is the same as GrossForNI where the employees NI Table has an Er contribution\r\nThis is the amount that is excluded from RTI", + "format": "double" + }, + "grossForTax": { + "type": "number", + "description": "[readonly] The amount of the Gross that is subject to PAYE", + "format": "double" + }, + "employerNi": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employerNiNonRti": { + "type": "number", + "description": "[readonly] Employer NI excluded from RTI", + "format": "double" + }, + "employeeNi": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employeeNiNonRti": { + "type": "number", + "description": "[readonly] Employee NI excluded from RTI", + "format": "double" + }, + "employerNiOffPayroll": { + "type": "number", + "description": "[readonly] The amount included in EmployerNi that is in relation to Off-Payroll Workers", + "format": "double" + }, + "realTimeClass1ANi": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "realTimeClass1ANiNonRti": { + "type": "number", + "description": "[readonly] Real Time Class 1A NI excluded from RTI", + "format": "double" + }, + "tax": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "taxNonRti": { + "type": "number", + "description": "[readonly] Tax excluded from RTI", + "format": "double" + }, + "netPay": { + "type": "number", + "description": "[readonly] The Net Pay for this Employee", + "format": "double" + }, + "adjustments": { + "type": "number", + "description": "[readonly] The value of adjustments made to the Net Pay (Non taxable/NIable additions/deductions)", + "format": "double" + }, + "notionalPay": { + "type": "number", + "description": "[readonly] The value of adjustments that are of type notional.", + "format": "double" + }, + "additions": { + "type": "number", + "description": "The value of all additions. This minus Deductions should equal TakeHomePay", + "format": "double" + }, + "deductions": { + "type": "number", + "description": "The value of all deductions. Additions minus This value should equal TakeHomePay", + "format": "double" + }, + "takeHomePay": { + "type": "number", + "description": "[readonly] The amount this Employee takes home", + "format": "double" + }, + "nonTaxOrNICPmt": { + "type": "number", + "description": "[readonly] The value of any payments being made to this Employee that aren't being subjected to PAYE or NI", + "format": "double" + }, + "itemsSubjectToClass1NIC": { + "type": "number", + "description": "[readonly] Items subject to Class 1 NIC but not taxed under PAYE regulations excluding pension contributions", + "format": "double" + }, + "dednsFromNetPay": { + "type": "number", + "description": "[readonly] The value of any deductions being made to the Net Pay for this Employee", + "format": "double" + }, + "tcp_Tcls": { + "type": "number", + "description": "[readonly] Value of payments marked as Trivial Commutation Payment (A - TCLS)", + "format": "double" + }, + "tcp_Pp": { + "type": "number", + "description": "[readonly] Value of payments marked as Trivial Commutation Payment (B - Personal Pension)", + "format": "double" + }, + "tcp_Op": { + "type": "number", + "description": "[readonly] Value of payments marked as Trivial Commutation Payment (C - Occupational Pension)", + "format": "double" + }, + "flexiDd_Death": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing death benefit (taxable)", + "format": "double" + }, + "flexiDd_Death_NonTax": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing death benefit (non taxable)", + "format": "double" + }, + "flexiDd_Pension": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing pension (taxable)", + "format": "double" + }, + "flexiDd_Pension_NonTax": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing pension (non taxable)", + "format": "double" + }, + "flexiDd_SeriousIllHealth": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing serious ill health lump sum (taxable)", + "format": "double" + }, + "flexiDd_SeriousIllHealth_NonTax": { + "type": "number", + "description": "[readonly] Value of payments marked as flexibly accessing serious ill health lump sum (non taxable)", + "format": "double" + }, + "smp": { + "type": "number", + "description": "[readonly] Statutory Maternity Pay", + "format": "double" + }, + "smpNonRti": { + "type": "number", + "description": "[readonly] Statutory Maternity Pay excluded from RTI", + "format": "double" + }, + "spp": { + "type": "number", + "description": "[readonly] Statutory Paternity Pay", + "format": "double" + }, + "sppNonRti": { + "type": "number", + "description": "[readonly] Statutory Paternity Pay excluded from RTI", + "format": "double" + }, + "sap": { + "type": "number", + "description": "[readonly] Statutory Adoption Pay", + "format": "double" + }, + "sapNonRti": { + "type": "number", + "description": "[readonly] Statutory Adoption Pay excluded from RTI", + "format": "double" + }, + "shpp": { + "type": "number", + "description": "[readonly] Statutory Shared Parental Pay", + "format": "double" + }, + "shppNonRti": { + "type": "number", + "description": "[readonly] Statutory Shared Parental Pay excluded from RTI", + "format": "double" + }, + "spbp": { + "type": "number", + "description": "[readonly] Statutory Parental Bereavement Pay", + "format": "double" + }, + "spbpNonRti": { + "type": "number", + "description": "[readonly] Statutory Parental Bereavement Pay excluded from RTI", + "format": "double" + }, + "ssp": { + "type": "number", + "description": "[readonly] Statutory Sick Pay", + "format": "double" + }, + "sspNonRti": { + "type": "number", + "description": "[readonly] Statutory Sick Pay excluded from RTI", + "format": "double" + }, + "studentLoanRecovered": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "studentLoanRecoveredNonRti": { + "type": "number", + "description": "[readonly] Student Loan recovered excluded from RTI", + "format": "double" + }, + "postgradLoanRecovered": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postgradLoanRecoveredNonRti": { + "type": "number", + "description": "[readonly] Postgrad Loan recovered excluded from RTI", + "format": "double" + }, + "pensionableEarnings": { + "type": "number", + "description": "[readonly] The amount of the Gross that is subject to Pension Deductions.\r\nIf the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied", + "format": "double" + }, + "pensionablePay": { + "type": "number", + "description": "[readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup.", + "format": "double" + }, + "nonTierablePay": { + "type": "number", + "description": "[readonly] The value of any pay that shouldn't count towards determining a pension tier.", + "format": "double" + }, + "employeePensionContribution": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions", + "format": "double" + }, + "employeePensionContributionAvc": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution", + "format": "double" + }, + "employerPensionContribution": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "empeePenContribnsNotPaid": { + "type": "number", + "description": "[readonly] Value of employee pension contributions that are not paid under 'net pay arrangements', including any AVC", + "format": "double" + }, + "empeePenContribnsPaid": { + "type": "number", + "description": "[readonly] Value of employee pension contributions paid under 'net pay arrangements', including any AVC", + "format": "double" + }, + "attachmentOrderDeductions": { + "type": "number", + "description": "[readonly] Value of deductions made due to AttachmentOrders", + "format": "double" + }, + "cisDeduction": { + "type": "number", + "description": "[readonly] Value of any CIS Deduction made", + "format": "double" + }, + "cisVat": { + "type": "number", + "description": "[readonly] Value of any VAT paid to CIS Subcontractor", + "format": "double" + }, + "cisUmbrellaFee": { + "type": "number", + "description": "[readonly] Value of any pre-tax fee charged to the CIS Subcontractor for processing the payment", + "format": "double" + }, + "cisUmbrellaFeePostTax": { + "type": "number", + "description": "[readonly] Value of any post-tax fee charged to the CIS Subcontractor for processing the payment", + "format": "double" + }, + "pbik": { + "type": "number", + "description": "[readonly] Value of any Payrolled Benefits In Kind", + "format": "double" + }, + "mapsMiles": { + "type": "integer", + "description": "[readonly] The number of miles paid for Mileage Allowance Payments", + "format": "int32" + }, + "foreignTaxAmount": { + "type": "number", + "description": "[readonly] The amount paid for Foreign Tax Credits in this period", + "format": "double" + }, + "foreignTaxAmountReclaimed": { + "type": "number", + "description": "[readonly] The amount of Foreign Tax Credits that you actually reclaimed", + "format": "double" + }, + "umbrellaFee": { + "type": "number", + "description": "[readonly] Value of any Umbrella fee charged for processing the payment", + "format": "double" + }, + "appLevyDeduction": { + "type": "number", + "description": "[readonly] Value of any Apprenticeship Levy fee deducted for processing the umbrella payment", + "format": "double" + }, + "paymentAfterLeaving": { + "type": "number", + "description": "[readonly] Payment After Leaving", + "format": "double" + }, + "taxOnPaymentAfterLeaving": { + "type": "number", + "description": "[readonly] Tax On Payment After Leaving", + "format": "double" + }, + "nilPaid": { + "type": "integer", + "description": "[readonly] The number of employees with NilPaid on the PayRun", + "format": "int32" + }, + "leavers": { + "type": "integer", + "description": "[readonly] The number of Leavers on ths PayRun", + "format": "int32" + }, + "starters": { + "type": "integer", + "description": "[readonly] The number of Starters on this PayRun", + "format": "int32" + }, + "p45Gross": { + "type": "number", + "description": "[readonly] The value P45 Gross which is held on the Employees Opening Balance", + "format": "double", + "nullable": true + }, + "p45Tax": { + "type": "number", + "description": "[readonly] The value of P45 Tax which is held on the Employees Opening Balance", + "format": "double", + "nullable": true + }, + "totalCost": { + "type": "number", + "format": "double", + "readOnly": true + }, + "recoverableAmounts": { + "$ref": "#/components/schemas/RecoverableAmounts" + } + }, + "additionalProperties": false, + "description": "Used to represent totals for a PayRun or PayRunEntry.\r\nIf a value is 0 then it will not be shown in the JSON." + }, + "PaySchedule": { + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "type": "string", + "description": "A descriptive name for this PaySchedule", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "[readonly] Indicates whether this is first, second, third (etc) PaySchedule for this PayPeriod.", + "format": "int32" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "firstPeriodEndDate": { + "type": "string", + "description": "The last day of the first pay period", + "format": "date" + }, + "firstPaymentDate": { + "type": "string", + "description": "The first payment date", + "format": "date" + }, + "paymentDateType": { + "$ref": "#/components/schemas/PaymentDateType" + }, + "periodEndDateType": { + "$ref": "#/components/schemas/PaymentDateType" + }, + "periodLengths": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Only applicable for PayPeriod of Custom. Defines the length of each period", + "nullable": true + }, + "highGrossPay": { + "type": "number", + "description": "A gross pay amount considered high for this PaySchedule", + "format": "double" + }, + "highNetPay": { + "type": "number", + "description": "A net pay amount considered high for this PaySchedule", + "format": "double" + }, + "periodEventsConfig": { + "type": "object", + "properties": { + "SubmitForProcessing": { + "type": "integer", + "format": "int32" + }, + "SendForApproval": { + "type": "integer", + "format": "int32" + }, + "Approval": { + "type": "integer", + "format": "int32" + }, + "Finalise": { + "type": "integer", + "format": "int32" + }, + "SendPaySlip": { + "type": "integer", + "format": "int32" + }, + "SubmitRti": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Only applicable if Bureau functionality is enabled. Defines the number of days each event occurs before the Payment Date.", + "nullable": true + }, + "hasOpenPayRunPeriod": { + "type": "boolean", + "description": "[readonly] Will be true if the employer currently has an open PayRun for this PayPeriod" + }, + "lastPeriodEndDate": { + "type": "string", + "description": "[readonly] The end date of the most recent PayRun on this schedule", + "format": "date", + "nullable": true + }, + "lastPeriodNumber": { + "type": "integer", + "description": "[readonly] The period number of the most recent PayRun on this schedule", + "format": "int32", + "nullable": true + }, + "employeeCount": { + "type": "integer", + "description": "[readonly] The number of employees paid with this PaySchedule", + "format": "int32" + }, + "isRequired": { + "type": "boolean", + "description": "[readonly] Whether or not this PaySchedule is required for the employer, ie: they have employees to be paid on this PaySchedule", + "readOnly": true + }, + "isConfigured": { + "type": "boolean", + "description": "[readonly] Whether or not this PaySchedule has been configured and is ready for use" + }, + "isYearCompleted": { + "type": "boolean", + "description": "[readonly] Returns true if all PayRuns for this PaySchedule in the TaxYear have been completed" + }, + "yearEndTasks": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[readonly] A list of actions that need to be completed for this PaySchedule before this TaxYear can be finalised", + "nullable": true + }, + "payRuns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] Details of PayRuns for this PaySchedule", + "nullable": true + }, + "currentPayRun": { + "$ref": "#/components/schemas/Item" + }, + "nextPayRun": { + "$ref": "#/components/schemas/PayRun" + }, + "publicCreatedDate": { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false + }, + "PaySchedulePeriod": { + "type": "object", + "properties": { + "paySchedulePeriodEvents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaySchedulePeriodEvent" + }, + "description": "[readonly] List of all the events in this PaySchedulePeriod", + "nullable": true + }, + "period": { + "type": "integer", + "description": "[readonly] The Period number of the PaySchedulePeriod.", + "format": "int32" + }, + "startDate": { + "type": "string", + "description": "[readonly] The start date of the PaySchedulePeriod", + "format": "date" + }, + "endDate": { + "type": "string", + "description": "[readonly] The end date of the PaySchedulePeriod", + "format": "date" + }, + "paymentDate": { + "type": "string", + "description": "The payment date of the PaySchedulePeriod.", + "format": "date" + }, + "unadjustedPaymentDate": { + "type": "string", + "description": "The payment date of the PaySchedulePeriod when not accounting for weekends, bank hols or ad-hoc alterations to the pay schedule", + "format": "date" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PaySchedulePeriodEvent": { + "type": "object", + "properties": { + "payPeriodEventType": { + "$ref": "#/components/schemas/PayPeriodEventType" + }, + "eventDate": { + "type": "string", + "description": "The expected date and time of the event.", + "format": "date" + }, + "actualEventDate": { + "type": "string", + "description": "The actual date and time when the event was completed.", + "format": "date", + "nullable": true + }, + "isOverDue": { + "type": "boolean", + "description": "Returns true if its past the event date.", + "readOnly": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "An Event within a PaySchedulePeriod. The event could be scheduled x days before PaymentDate." + }, + "PaySpineReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaySpineReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PaySpineReportLine": { + "type": "object", + "properties": { + "spineName": { + "type": "string", + "description": "Name of the Pay Spine", + "nullable": true + }, + "fullTimeHours": { + "type": "number", + "description": "Maximum Full Time Hours on this Pay Spine", + "format": "double" + }, + "fullTimeWeeks": { + "type": "number", + "description": "Maximum Full Time Weeks on this Pay Spine", + "format": "double" + }, + "salaryFormula": { + "type": "string", + "description": "Formula used to derive annual salary", + "nullable": true + }, + "hourlyDivisor": { + "type": "number", + "description": "Hours used to determine Hourly Rate", + "format": "double" + }, + "hourlyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Hourly Rates", + "format": "int32" + }, + "dailyDivisor": { + "type": "number", + "description": "Days used to determine Full time Daily Rate", + "format": "double" + }, + "dailyDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Daily Rates", + "format": "int32" + }, + "annualDecimals": { + "type": "integer", + "description": "Number of decimal places to calculate Annual Salaries", + "format": "int32" + }, + "annualRoundingRule": { + "$ref": "#/components/schemas/AnnualRoundingRule" + }, + "incrementRule": { + "$ref": "#/components/schemas/IncrementRule" + }, + "requiresLondonAllowance": { + "type": "boolean", + "description": "Requires LA column to be completed on the spine" + }, + "gradeEffectiveDate": { + "type": "string", + "description": "Effective date for applicable grades", + "format": "date" + }, + "pointEffectiveDate": { + "type": "string", + "description": "Effective date for applicable spinal points", + "format": "date" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "PaySpineReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PaySpineReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PaySpineYearsServiceEntitlementBasis": { + "enum": [ + "RoleStartDate", + "EmploymentStartDate", + "ContinuousStartDate", + "AggregatedStartDate" + ], + "type": "string" + }, + "Payee": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of this Payee" + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "paymentDateRule": { + "$ref": "#/components/schemas/PaymentDateRule" + }, + "paymentDateDayOfWeek": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "paymentDateDayOfMonth": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "hasMinimumBankDetails": { + "type": "boolean", + "description": "Denotes whether the payee has the minimum bank details to receive a payment", + "readOnly": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PayeeType": { + "enum": [ + "Employee", + "Hmrc", + "PensionProvider", + "Aeo", + "Deduction" + ], + "type": "string" + }, + "PaylineCalculationData": { + "type": "object", + "properties": { + "fixedAnnualValue": { + "type": "number", + "description": "PaySpine full time annual value", + "format": "double" + }, + "contractedHours": { + "type": "number", + "description": "PaySpine contracted hours", + "format": "double" + }, + "contractedWeeks": { + "type": "number", + "description": "PaySpine contracted weeks", + "format": "double" + }, + "fullTimeEquivalent": { + "type": "number", + "description": "PaySpine full time equivalent value", + "format": "double" + }, + "fullTimeHours": { + "type": "number", + "description": "PaySpine full time hours", + "format": "double" + }, + "fullTimeWeeks": { + "type": "number", + "description": "PaySpine full time weeks", + "format": "double" + }, + "fullTimeSalary": { + "type": "number", + "description": "PaySpine full time salary", + "format": "double" + } + }, + "additionalProperties": false + }, + "PaymentDateRule": { + "enum": [ + "OnPayDate", + "OnDayOfWeekAfterPayDate", + "OnDayOfMonth" + ], + "type": "string" + }, + "PaymentDateType": { + "enum": [ + "SameDate", + "LastDay", + "LastWeekday", + "LastXxxday", + "SameDateWorkingDay", + "SecondXxxday", + "ThirdXxxday", + "FourthXxxday", + "SecondToLastXxxday", + "ThirdToLastXxxday" + ], + "type": "string" + }, + "PaymentMethodAfterLeaving": { + "enum": [ + "RegularPayMethod", + "IrregularPayMethod" + ], + "type": "string" + }, + "PaymentsCsvMapping": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 50, + "minLength": 1, + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/PaymentsCsvMappingType" + }, + "importBehaviour": { + "type": "integer", + "format": "int32" + }, + "payBasis": { + "$ref": "#/components/schemas/PayBasis" + }, + "hasHeader": { + "type": "boolean" + }, + "payrollCodeIndex": { + "type": "integer", + "format": "int32" + }, + "employerIdIndex": { + "type": "integer", + "format": "int32" + }, + "roleReferenceIndex": { + "type": "integer", + "format": "int32" + }, + "payAmountIndex": { + "type": "integer", + "format": "int32" + }, + "payAmountMultiplierIndex": { + "type": "integer", + "format": "int32" + }, + "noteIndex": { + "type": "integer", + "format": "int32" + }, + "payCodeIndex": { + "type": "integer", + "format": "int32" + }, + "hasPaylineCosting": { + "type": "boolean" + }, + "departmentIndex": { + "type": "integer", + "format": "int32" + }, + "costCentreIndex": { + "type": "integer", + "format": "int32" + }, + "effectiveFromIndex": { + "type": "integer", + "format": "int32" + }, + "effectiveToIndex": { + "type": "integer", + "format": "int32" + }, + "isAutomaticBackPayIndex": { + "type": "integer", + "format": "int32" + }, + "ignoreInitialBackPayIndex": { + "type": "integer", + "format": "int32" + }, + "contributesToBasicPayIndex": { + "type": "integer", + "format": "int32" + }, + "autoAdjustForLeaveIndex": { + "type": "integer", + "format": "int32" + }, + "analysisCategoryIndexesJson": { + "type": "string", + "nullable": true + }, + "paySpineIndex": { + "type": "integer", + "format": "int32" + }, + "payGradeIndex": { + "type": "integer", + "format": "int32" + }, + "spinePointIndex": { + "type": "integer", + "format": "int32" + }, + "analysisCategoryIndexes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalysisCategoryIndex" + }, + "nullable": true + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentsCsvMappingColumn" + }, + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "This model is used to save CSV mappings for importing of payments.\r\nIt probably has very little practical use outside of our own UI" + }, + "PaymentsCsvMappingColumn": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "maxLength": 25, + "minLength": 1, + "type": "string" + }, + "code": { + "type": "string", + "nullable": true + }, + "isReferenceOnly": { + "type": "boolean", + "description": "If set to true then no PayCode is mapped and this column is just for on-screen refernece only" + }, + "colIndex": { + "type": "integer", + "format": "int32" + }, + "isMultiplier": { + "type": "boolean" + }, + "isNetToGross": { + "type": "boolean" + }, + "rateColIndex": { + "type": "integer", + "description": "If the mapping IsMultiplier, then this optionally specifies another column from which to get the value", + "format": "int32", + "nullable": true + }, + "shouldSerializeRateColIndex": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PaymentsCsvMappingType": { + "enum": [ + "RowBased", + "ColumnBased" + ], + "type": "string" + }, + "PayrollAnalysisCostBreakdownReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayrollAnalysisCostBreakdownReportLine" + }, + "nullable": true + }, + "payCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + }, + "nullable": true + }, + "employeesPayRunTotals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeePayRunTotal" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisCostBreakdownReportLine": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "department": { + "$ref": "#/components/schemas/StringDecimalKeyValuePair" + }, + "costCentre": { + "$ref": "#/components/schemas/StringDecimalKeyValuePair" + }, + "employeeRoleAnalysisCategory": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/StringDecimalKeyValuePair" + }, + "nullable": true + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayrollAnalysisCostBreakdownReportValue" + }, + "nullable": true + }, + "totalPay": { + "type": "number", + "format": "double" + }, + "niablePay": { + "type": "number", + "format": "double" + }, + "pensionPay": { + "type": "number", + "format": "double" + }, + "niPercent": { + "type": "number", + "format": "double" + }, + "ersNi": { + "type": "number", + "format": "double" + }, + "pensionPercent": { + "type": "number", + "format": "double" + }, + "ersPension": { + "type": "number", + "format": "double" + }, + "taxablePay": { + "type": "number", + "format": "double" + }, + "taxablePercent": { + "type": "number", + "format": "double" + }, + "employeeNi": { + "type": "number", + "format": "double" + }, + "taxPaid": { + "type": "number", + "format": "double" + }, + "studentLoan": { + "type": "number", + "format": "double" + }, + "employeePension": { + "type": "number", + "description": "The value of the Pension Contribution(PENSION) being made by the Employee", + "format": "double" + }, + "employeePensionContributionSalarySacrifice": { + "type": "number", + "description": "The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee", + "format": "double" + }, + "employeePensionContributionReliefAtSource": { + "type": "number", + "description": "The value of the Pension Contribution Relief At Source(PENSIONRAS) being made by the Employee", + "format": "double" + }, + "pensionSummaryCostBreakdowns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionSummaryCostBreakdown" + }, + "description": "List of pension summaries, each representing a breakdown of various pension components", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "RoleId of that particular line entry", + "format": "uuid", + "nullable": true + }, + "roleWeightage": { + "type": "number", + "description": "Weightage value of the given employee role", + "format": "double" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisCostBreakdownReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PayrollAnalysisCostBreakdownReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PayrollAnalysisCostBreakdownReportValue": { + "type": "object", + "properties": { + "qty": { + "type": "number", + "format": "double", + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisEmployeeRoleBreakdownReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayrollAnalysisEmployeeRoleBreakdownReportLine" + }, + "nullable": true + }, + "payCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayCode" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisEmployeeRoleBreakdownReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "fullEmployee": { + "$ref": "#/components/schemas/Employee" + }, + "employeeRole": { + "$ref": "#/components/schemas/Item" + }, + "department": { + "$ref": "#/components/schemas/DepartmentMembership" + }, + "gross": { + "type": "number", + "format": "double" + }, + "niableGross": { + "type": "number", + "format": "double" + }, + "net": { + "type": "number", + "format": "double" + }, + "takeHome": { + "type": "number", + "format": "double" + }, + "employerNic": { + "type": "number", + "format": "double" + }, + "showQtyColumn": { + "type": "boolean" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayrollAnalysisEmployeeRoleBreakdownReportLineValue" + }, + "nullable": true + }, + "ersPension": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisEmployeeRoleBreakdownReportLineValue": { + "type": "object", + "properties": { + "qty": { + "type": "number", + "format": "double", + "nullable": true + }, + "code": { + "type": "string", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PayrollAnalysisEmployeeRoleBreakdownReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PayrollAnalysisEmployeeRoleBreakdownReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PayrollValueType": { + "enum": [ + "BasicPay", + "Gross", + "GrossForTax", + "GrossForNi", + "EmployerNi", + "EmployeeNi", + "EmployerNiOffPayroll", + "RealTimeClass1ANi", + "Tax", + "NetPay", + "Adjustments", + "TakeHomePay", + "NonTaxOrNICPmt", + "ItemsSubjectToClass1NIC", + "DednsFromNetPay", + "Tcp_Tcls", + "Tcp_Pp", + "Tcp_Op", + "FlexiDd_Death", + "FlexiDd_Death_NonTax", + "FlexiDd_Pension", + "FlexiDd_Pension_NonTax", + "Smp", + "Spp", + "Sap", + "Shpp", + "Spbp", + "StudentLoanRecovered", + "PostgradLoanRecovered", + "PensionablePay", + "NonTierablePay", + "EmployeePensionContribution", + "EmployerPensionContribution", + "EmpeePenContribnsNotPaid", + "EmpeePenContribnsPaid", + "AttachmentOrderDeductions", + "CisDeduction", + "CisVat", + "CisUmbrellaFee", + "CisUmbrellaFeePostTax", + "Pbik", + "MapsMiles", + "UmbrellaFee", + "AppLevyDeduction", + "PaymentAfterLeaving", + "TaxOnPaymentAfterLeaving", + "Ssp", + "AttachmentOrderAdminFee", + "EmployeePensionNetPay", + "EmployeePensionRas", + "EmployeePensionSalSac", + "EmployeePensionContributionAvc", + "Deductions", + "Additions", + "PensionableEarnings", + "TotalGross", + "FlexiDd_SeriousIllHealth", + "FlexiDd_SeriousIllHealth_NonTax", + "ForeignTaxCredit", + "ForeignTaxReclaimed", + "AverageHolidayPay", + "P45Gross", + "P45Tax" + ], + "type": "string" + }, + "PayrunEmail": { + "required": [ + "name", + "recipientAddress" + ], + "type": "object", + "properties": { + "isActive": { + "type": "boolean", + "description": "If false then this email won't be sent" + }, + "name": { + "maxLength": 75, + "minLength": 1, + "type": "string", + "description": "Only used for reference, not included in the email" + }, + "templateType": { + "$ref": "#/components/schemas/EmployerTemplateType" + }, + "recipientAddress": { + "maxLength": 150, + "minLength": 1, + "type": "string", + "description": "The address to which the email should be sent", + "format": "email" + }, + "pdfPassword": { + "maxLength": 50, + "type": "string", + "description": "If a value is provided, then all PDFs attached to the email will be encrypted using this password", + "nullable": true + }, + "attachPayslips": { + "type": "boolean", + "description": "If set to true then Payslips will be attached to the email" + }, + "payslips_Unemailed": { + "type": "boolean", + "description": "If AttachPayslips is true and this property is also true then only payslips that haven't already been sent directly to employees will be attached." + }, + "payslips_SingleFile": { + "type": "boolean", + "description": "If AttachPayslips is true and this property is also true then the payslips will be attached as a single file rather than as separate PDFs," + }, + "attachPaymentSummary": { + "type": "boolean", + "description": "If set to True then the PaymentSummary report will be attached to the Email" + }, + "attachP32": { + "type": "boolean", + "description": "If set to True then the P32 report will be attached to the email" + }, + "attachP30": { + "type": "boolean", + "description": "If set to True then the P30 report will be attached to the email" + }, + "attachGrossToNet": { + "type": "boolean", + "description": "If set to True then the GrossToNet report will be attached to the email" + }, + "attachPensionContributions": { + "type": "boolean", + "description": "If set to True then the Pensions Contributions report will be attached to the email" + }, + "attachCostAnalysis": { + "type": "boolean", + "description": "If set to True then the Cost Analysis report will be attached to the email" + }, + "attachCostOfEmployment": { + "type": "boolean", + "description": "If set to True then the Cost of Employment report will be attached to the email" + }, + "attachFullSummaryOfPay": { + "type": "boolean", + "description": "If set to True then the Full Summary Of Payment report will be attached to the email" + }, + "attachBankPayments": { + "type": "boolean", + "description": "If set to True then the Bank Payments CSV file will be attached to the email" + }, + "customSubject": { + "maxLength": 200, + "type": "string", + "description": "If TemplateType is null then you can provide a subject line here to be used for the email", + "nullable": true + }, + "customBody": { + "type": "string", + "description": "If TemplateType is null then you can provide the body text here to be used for the email", + "nullable": true + }, + "customBody_IsHtml": { + "type": "boolean", + "description": "If the CustomBody is in HTML format, set this to true." + }, + "childId": { + "type": "string", + "description": "This is nothing but the UniqueId of the model.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "PayrunEmails are sent automatically when a payrun has been finalised" + }, + "PayrunPaymentsReport": { + "type": "object", + "properties": { + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayRunPayment" + }, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusMessage": { + "type": "string", + "description": "[readonly] A message to elaborate on the Status", + "nullable": true + }, + "link": { + "type": "string", + "description": "[readonly] If available, a link to the payments in an ExternalDataProvider", + "nullable": true + }, + "connectedExternalDataProvider": { + "$ref": "#/components/schemas/ExternalDataProvider" + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "After finalising a PayRun, employees need to actually be paid.\r\nThis model is returned by the Reports API and is used to provide details of a payment that needs to be made." + }, + "PayrunPaymentsReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PayrunPaymentsReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Payslip": { + "type": "object", + "properties": { + "isClosed": { + "type": "boolean", + "description": "[readonly] Indicates if the Payrun has been finalised" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "periodNumber": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "string", + "description": "[readonly] A description of the period that Payslip relates to.", + "nullable": true + }, + "from": { + "type": "string", + "description": "[readonly] The start date of the period this Payslip covers.", + "format": "date" + }, + "to": { + "type": "string", + "description": "[readonly] The end date of the period this Payslip covers.", + "format": "date" + }, + "paymentDate": { + "type": "string", + "description": "[readonly] The date the Employee will be paid on", + "format": "date" + }, + "note": { + "type": "string", + "description": "[readonly] Any note that should appear on the payslip", + "nullable": true + }, + "allowanceNote": { + "type": "string", + "description": "[readonly] Details of remaining allowance to show on payslip", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "logoUrl": { + "type": "string", + "description": "[readonly] The Logo to include on the payslip", + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "employerAddress": { + "$ref": "#/components/schemas/Address" + }, + "hmrcDetails": { + "$ref": "#/components/schemas/HmrcDetails" + }, + "payOptions": { + "$ref": "#/components/schemas/PayOptions" + }, + "employmentDetails": { + "$ref": "#/components/schemas/EmploymentDetails" + }, + "personalDetails": { + "$ref": "#/components/schemas/PersonalDetails" + }, + "totals": { + "$ref": "#/components/schemas/PayRunTotals" + }, + "totalsYtd": { + "$ref": "#/components/schemas/PayRunTotals" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayslipLine" + }, + "description": "[readonly] The lines to display on the Payslip", + "nullable": true + }, + "employerNi": { + "type": "number", + "description": "[readonly] The Employer NI Contribution amount", + "format": "double" + }, + "employerPensionContribs": { + "type": "number", + "description": "[readonly] The Employer Pension Contribution Amount", + "format": "double" + }, + "depts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringDecimalKeyValuePair" + }, + "description": "The employees Department Membership(s) at the time the payrun was finalised", + "nullable": true + }, + "umbrellaPayment": { + "$ref": "#/components/schemas/UmbrellaPayment" + }, + "costCentres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StringDecimalKeyValuePair" + }, + "description": "The employees Cost Centre Membership(s) only populated when creating journals", + "nullable": true + }, + "employeeRoleAnalysisCategoryCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeRoleAnalysisCategoryCode" + }, + "description": "The EmployeeRoleAnalysisCategoryCodes only populated when creating journals", + "nullable": true + }, + "employeeCostCentres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeCostCentre" + }, + "description": "The Employee Cost Centre Membership(s) by role only populated when creating journals", + "nullable": true + }, + "departmentMemberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepartmentMembership" + }, + "description": "The Employee Department Membership(s) by role only populated when creating journals", + "nullable": true + }, + "pensionContributionsByRole": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "The Pension Employer contribution by role only populated when creating journals", + "nullable": true + }, + "employerPensionContributions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerPensionContribution" + }, + "description": "[readonly] The list of Employer Pension Contribution(s)", + "nullable": true + } + }, + "additionalProperties": false, + "description": "If you don't want to use our customisable PDFs for Payslips then you can retrieve the raw data used to create a Payslip.\r\nThis is the model you will be provided with for each employee." + }, + "PayslipCustomisation": { + "type": "object", + "properties": { + "custom": { + "type": "boolean", + "description": "Whether or not you are customising the Payslip.\r\nThis should always be true if you are providing any other values." + }, + "includeLogo": { + "type": "boolean", + "description": "Whether or not to include the employer logo on the payslip." + }, + "customCssOption": { + "$ref": "#/components/schemas/ReportCustomCssOption" + }, + "customCss": { + "maxLength": 2500, + "type": "string", + "nullable": true + }, + "removeYtd": { + "type": "boolean", + "description": "Whether or not to remove the YTD column" + }, + "includeEmployerAddress": { + "type": "boolean", + "description": "Whether or not to include the employer address" + }, + "useUmbrellaFormat": { + "type": "boolean", + "description": "If true then the format the payslip will include details of the Umbrella Payment as well as employer costs" + }, + "filename": { + "maxLength": 200, + "type": "string", + "nullable": true + }, + "includeDepartment": { + "type": "boolean", + "description": "Whether or not to include the primary department of the employee on the payslip" + }, + "includeHealthAndSocialCareMessage": { + "type": "boolean", + "description": "Whether or not to include health and social car message" + }, + "includeBenefits": { + "type": "boolean", + "description": "Whether or not to include any payrolled benefits" + }, + "paperSize": { + "$ref": "#/components/schemas/PdfPaperSize" + }, + "orientation": { + "$ref": "#/components/schemas/PdfPaperOrientation" + }, + "margins": { + "$ref": "#/components/schemas/PdfPaperMargins" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent any customisations you make to the look of Payslip PDFs.\r\nThis is covered in detail in the Guides section." + }, + "PayslipLine": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/PayslipLineType" + }, + "code": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "secondaryDescription": { + "type": "string", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + }, + "multiplier": { + "type": "number", + "description": "[readonly] If the Code is a multiplier code then this is the multiplier. Value has already been calculated so this is just for reference", + "format": "double", + "nullable": true + }, + "attachmentOrderId": { + "type": "string", + "description": "[readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO", + "format": "uuid", + "nullable": true + }, + "pensionId": { + "type": "string", + "description": "[readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS", + "format": "uuid", + "nullable": true + }, + "loanId": { + "type": "string", + "description": "[readonly] The Id of the associated Loan, if any.", + "format": "uuid", + "nullable": true + }, + "currencySymbol": { + "type": "string", + "nullable": true + }, + "formattedValue": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "isNetToGross": { + "type": "boolean", + "description": "If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target." + }, + "targetNetToGrossValue": { + "type": "number", + "description": "The orginal net fixed addition amount that is considered to be a take home pay target.", + "format": "double", + "nullable": true + }, + "leaveId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "roleId": { + "type": "string", + "description": "The employee role which is associated with this payslip line.\r\nIf set to null, the payslip line is not related with a role.", + "format": "uuid", + "nullable": true + }, + "isAutoCalculatedBackPayLine": { + "type": "boolean" + }, + "isAutomaticBackPay": { + "type": "boolean" + }, + "hasSecondaryDescription": { + "type": "boolean", + "readOnly": true + }, + "contributesToBasicPay": { + "type": "boolean" + }, + "isNotional": { + "type": "boolean", + "description": "Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance" + } + }, + "additionalProperties": false + }, + "PayslipLineType": { + "enum": [ + "BasicPay", + "Gross", + "Net", + "Nic", + "Tax", + "Cis" + ], + "type": "string" + }, + "PayslipReleaseType": { + "enum": [ + "Immediately", + "Scheduled" + ], + "type": "string" + }, + "PayslipReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/Payslip" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PdfPaperMargins": { + "type": "object", + "properties": { + "top": { + "type": "number", + "format": "double" + }, + "right": { + "type": "number", + "format": "double" + }, + "bottom": { + "type": "number", + "format": "double" + }, + "left": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PdfPaperOrientation": { + "enum": [ + "Landscape", + "Portrait" + ], + "type": "string" + }, + "PdfPaperSize": { + "enum": [ + "Letter", + "LetterSmall", + "A4", + "A4Small", + "A5" + ], + "type": "string" + }, + "PdfPasswordType": { + "enum": [ + "InitialsAndDob", + "NiNumber", + "Custom" + ], + "type": "string" + }, + "Pension": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "contributionLevelType": { + "$ref": "#/components/schemas/PensionContributionLevelType" + }, + "endDate": { + "type": "string", + "description": "The date the employee left the scheme", + "format": "date", + "nullable": true + }, + "endReason": { + "$ref": "#/components/schemas/PensionEndReason" + }, + "joinReason": { + "$ref": "#/components/schemas/PensionJoinReason" + }, + "startPayRunEntryId": { + "type": "integer", + "description": "[readonly] Holds the Id for the payroll that the employee joined the scheme", + "format": "int32", + "nullable": true + }, + "endPayRunEntryId": { + "type": "integer", + "description": "[readonly] Holds the Id for the payroll that the employee left the scheme", + "format": "int32", + "nullable": true + }, + "startReportingType": { + "$ref": "#/components/schemas/PensionReportingType" + }, + "endReportingType": { + "$ref": "#/components/schemas/PensionReportingType" + }, + "pensionOpeningBalances": { + "$ref": "#/components/schemas/PensionOpeningBalances" + }, + "reasonForLeaving": { + "maxLength": 100, + "type": "string", + "description": "If a value is provided for EndDate then this is the reason for leaving the employee left the scheme", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + }, + "pensionSchemeId": { + "type": "string", + "format": "uuid" + }, + "pensionScheme": { + "$ref": "#/components/schemas/PensionScheme" + }, + "workerGroupId": { + "type": "string", + "format": "uuid" + }, + "workerGroup": { + "$ref": "#/components/schemas/WorkerGroup" + }, + "startDate": { + "type": "string", + "format": "date" + }, + "memberReferenceNumber": { + "maxLength": 25, + "type": "string", + "nullable": true + }, + "overrideContributions": { + "type": "boolean", + "description": "If this is set to true then the Contributions levels set for the WorkerGroup will be replaced with the values provided here" + }, + "employeeContribution": { + "type": "number", + "description": "The amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on EmployeeContributionIsPercentage.\r\nThis is read-only if OverrideContributions is false", + "format": "double" + }, + "employeeContributionIsPercentage": { + "type": "boolean", + "description": "Determines whether the Value of the EmployeeContribution is a fixed amount or a percentage," + }, + "employerContribution": { + "type": "number", + "description": "The amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on EmployerContributionIsPercentage.\r\nThis is read-only if OverrideContributions is false", + "format": "double" + }, + "employerContributionIsPercentage": { + "type": "boolean", + "description": "Determines whether the Value of the EmployerContribution is a fixed amount or a percentage," + }, + "employerContributionTopUpPercentage": { + "type": "number", + "description": "Increase Employer Contribution by this percentage of the Employee Contribution", + "format": "double" + }, + "isAeQualifyingScheme": { + "type": "boolean", + "description": "[readonly] Whether or not the associated PensionScheme is a Qualifying Scheme for AutoEnrolment" + }, + "isTeachersPension": { + "type": "boolean", + "description": "[readonly] Whether or not the associated PensionScheme is a Teachers' Pension (determined by its CsvFormat)" + }, + "aeStatusAtJoining": { + "$ref": "#/components/schemas/AeStatus" + }, + "externalEmployeeId": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "additionalVoluntaryContribution": { + "type": "number", + "description": "Any additional voluntary amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage.", + "format": "double" + }, + "avcIsPercentage": { + "type": "boolean", + "description": "Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage," + }, + "exitViaProvider": { + "type": "boolean", + "readOnly": true + }, + "teachersPensionDetails": { + "$ref": "#/components/schemas/TeachersPensionDetails" + }, + "forcedTier": { + "type": "string", + "description": "If the WorkerGroup ContributionLevelType is a Tiered Scheme then you can specify the name of the tier to force the employee on to.\r\nIf none is specified then the Tier is determined by the earnings in the period", + "nullable": true + }, + "forceEnrolment": { + "type": "boolean", + "description": "If the PensionScheme is connected to an ExternalDataProvider that supports enrolment then setting this to true will force this employee to be enrolled with the next submission." + }, + "employerContributionIncludesNiSaving": { + "type": "boolean", + "description": "Employer Contribution includes the Employers NI saving" + }, + "employerContributionNiSavingPercentage": { + "type": "number", + "description": "Increase Employer Contribution by this percentage of the Employers NI saving", + "format": "double" + }, + "fiftyFiftySchemeMember": { + "type": "boolean", + "description": "if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions." + }, + "associatedEmployeeRoles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "The list of employee roles associated with the pension membership", + "nullable": true + }, + "autoEnrolled": { + "type": "boolean", + "description": "[readonly] Is True if the employee joined this Pension due to an AutoEnrolment action" + } + }, + "additionalProperties": false + }, + "PensionAdministrator": { + "type": "object", + "properties": { + "name": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "email": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "telephone": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PensionContributionLevelType": { + "enum": [ + "UserDefined", + "StatutoryMinimum", + "Nhs2015", + "TeachersPensionEnglandAndWales", + "LgpsEnglandAndWales", + "TpFasterAccrual", + "TpAdditionalPensionContributions", + "TpActuariallyAdjustedBenefits", + "TpFamilyBenefits", + "tpPastAddedYears", + "tpHigherSalaries", + "tpPreston", + "LgpsAdditionalPensionContributions", + "LgpsSharedAdditionalPensionContributions", + "LgpsAdditionalRegularContributions", + "LgpsAddedYearsContributions", + "LgpsSharedAdditionalPensionLumpSump", + "LgpsPartTimeBuyBack", + "PrudentialAVC", + "tpElectedFurtherEmployment", + "AptisCashIsa", + "AptisStocksSharesIsa", + "AptisInvestmentAccount" + ], + "type": "string" + }, + "PensionContributionsSubmission": { + "type": "object", + "properties": { + "employerId": { + "type": "integer", + "format": "int32" + }, + "payRunId": { + "type": "integer", + "format": "int32" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "schemeId": { + "type": "integer", + "format": "int32" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "externalId": { + "type": "string", + "nullable": true + }, + "statusMessage": { + "type": "string", + "nullable": true + }, + "submissionData": { + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "This model is used to track submission of Pension Contributions to an external data provider." + }, + "PensionCsvFormat": { + "enum": [ + "Papdis", + "Nest", + "NowPensions", + "TeachersPensionMdc", + "TeachersPensionMcr", + "ScottishWidowsAssistMe", + "Aviva", + "AvivaEnrolment", + "ScottishWidowsWorkplace", + "Aegon", + "ScottishWidowsWorkplaceEnrolment", + "AegonEnrolment", + "StandardLifeWorkplaceHub", + "PeoplesPension", + "StandardLifeWorkplaceHubEnrolment", + "PrudentialAvc", + "LgpsCivicaUpm", + "LgpsIConnect", + "StandardLifeGpz", + "StandardLifeGpzEnrolment", + "Aptis", + "AptisEnrolment", + "NestEnrolment", + "TruePotential", + "TruePotentialEnrolment" + ], + "type": "string" + }, + "PensionEndReason": { + "enum": [ + "OptOut", + "CeasedMembership", + "Leaver" + ], + "type": "string" + }, + "PensionJoinReason": { + "enum": [ + "Automatic", + "OptIn", + "VoluntaryJoiner", + "ContractualPension", + "Enrol" + ], + "type": "string" + }, + "PensionMembershipReportLine": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "description": "Payroll code of the employee", + "nullable": true + }, + "pensionScheme": { + "type": "string", + "description": "Employee pension scheme", + "nullable": true + }, + "workerGroup": { + "type": "string", + "description": "The WorkerGroup of the employee pension scheme", + "nullable": true + }, + "joinDate": { + "type": "string", + "description": "The Join Date of the employee", + "nullable": true + }, + "joinReason": { + "$ref": "#/components/schemas/PensionJoinReason" + }, + "isPensionJoinerActionReported": { + "type": "boolean", + "description": "Indicates whether the pension joiner action is reported." + }, + "endDate": { + "type": "string", + "description": "Pension End Date", + "nullable": true + }, + "endReason": { + "$ref": "#/components/schemas/PensionEndReason" + }, + "isPensionLeaverActionReported": { + "type": "boolean", + "description": "Indicates whether the pension leaver action is reported.", + "nullable": true + }, + "aeStatusAtJoining": { + "$ref": "#/components/schemas/AeStatus" + }, + "roleRefs": { + "type": "string", + "description": "role references of employee", + "nullable": true + }, + "pensionEmployeeContribution": { + "type": "number", + "description": "Pension Employee Contribution", + "format": "double", + "nullable": true + }, + "isEmployeeContributionPercentage": { + "type": "boolean", + "description": "Indicates whether the EmployeeContribution is expressed as a percentage." + }, + "pensionTiers": { + "type": "string", + "description": "Pension Tiers of the employee", + "nullable": true + }, + "pensionAVCContribution": { + "type": "number", + "description": "Pension AVC Contribution of employee", + "format": "double", + "nullable": true + }, + "isAvcPercentage": { + "type": "boolean", + "description": "Indicates whether the AvcContribution is expressed as a percentage." + }, + "pensionEmployerContribution": { + "type": "number", + "description": "Employer Pension Contribution", + "format": "double", + "nullable": true + }, + "isEmployerContributionPercentage": { + "type": "boolean", + "description": "Indicates whether the EmployerContribution is expressed as a percentage." + }, + "pensionMembershipNo": { + "type": "string", + "description": "Pension Membership Number", + "nullable": true + }, + "mcrRoleID1": { + "type": "string", + "description": "MCR Role ID1 for teachers pension", + "nullable": true + }, + "mcrRoleID2": { + "type": "string", + "description": "MCR Role ID2 for teachers pension", + "nullable": true + }, + "isHalfContributionMember": { + "type": "boolean", + "description": "50/50 membership", + "nullable": true + }, + "tpAdminNino": { + "type": "string", + "description": "Teachers Pension Admin Ni Number", + "nullable": true + }, + "pensionableEarningsYTD": { + "type": "number", + "description": "Pensionable earning year to date", + "format": "double", + "nullable": true + }, + "pensionablePayYTD": { + "type": "number", + "description": "Pensionable Pay year to date", + "format": "double", + "nullable": true + }, + "employeePensionYTD": { + "type": "number", + "description": "Employee pension year to date", + "format": "double", + "nullable": true + }, + "avcPensionYTD": { + "type": "number", + "description": "Additional Voluntary Contribution YTD", + "format": "double", + "nullable": true + }, + "employerPensionYTD": { + "type": "number", + "description": "Employer pension year to date", + "format": "double", + "nullable": true + }, + "assumedPensionablePayYTD": { + "type": "number", + "description": "Assumed pensionable pay year to date", + "format": "double", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "PensionMembershipsReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionMembershipReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PensionMembershipsReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/PensionMembershipsReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "PensionOpeningBalances": { + "type": "object", + "properties": { + "pensionableEarnings": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for pensionable earnings", + "format": "double" + }, + "pensionablePay": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for pensionable pay", + "format": "double" + }, + "employeePensionContribution": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for employee pension contribution", + "format": "double" + }, + "employeePensionContributionAvc": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for employee pension contribution avc", + "format": "double" + }, + "employerPensionContribution": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for employer pension contribution", + "format": "double" + }, + "assumedPensionablePay": { + "pattern": "^[\\d\\.\\,]{1,8}([\\.\\,]\\d{0,2})?$", + "type": "number", + "description": "Opening balances for assumed pensionable pay", + "format": "double" + } + }, + "additionalProperties": false + }, + "PensionPayCode": { + "enum": [ + "Default", + "CustomPayCodes", + "PayCodeSets" + ], + "type": "string" + }, + "PensionProvider": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "accountNo": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "portal": { + "maxLength": 100, + "type": "string", + "format": "uri", + "nullable": true + }, + "website": { + "maxLength": 100, + "type": "string", + "format": "uri", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "telephone": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "papdisVersion": { + "$ref": "#/components/schemas/PapdisVersion" + }, + "papdisProviderId": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "papdisEmployerId": { + "maxLength": 40, + "type": "string", + "nullable": true + }, + "csvFormat": { + "$ref": "#/components/schemas/PensionCsvFormat" + }, + "excludeNilPaidFromContributions": { + "type": "boolean", + "description": "If we're sending contributions to an external provider then we'll include all employees that were on the payrun.\r\nIf you want to exclude employees that don't have any contributions to report then set this to true." + }, + "payPeriodDateAdjustment": { + "type": "integer", + "description": "If you need to adjust the reported dates of the contributions then you can do so by setting a non-zero value here.\r\nA negative value of will move the date back in time.", + "format": "int32" + }, + "miscBoolean1": { + "type": "boolean", + "description": "This field has different uses dependent on the ExternalDataProvider, if any.\r\nFor Nest, it indicates whether or not contributions are reported as \"Tax Weekly/Monthly\" rather than just \"Weekly/Monthly\"" + }, + "miscBoolean2": { + "type": "boolean", + "description": "This field has different uses dependent on the ExternalDataProvider, if any.\r\nFor Nest, it indicates whether or not to approve payments after submitting contributions" + }, + "miscString1": { + "maxLength": 50, + "type": "string", + "description": "This field has different uses dependent on the ExternalDataProvider, if any.\r\nFor Nest, it dictates the PaymentSource.", + "nullable": true + }, + "miscString2": { + "maxLength": 50, + "type": "string", + "description": "This field has different uses dependent on the ExternalDataProvider, if any.", + "nullable": true + }, + "optOutWindow": { + "type": "integer", + "description": "The number of days or months that an employee has to Opt out after being enrolled", + "format": "int32" + }, + "optOutWindowIsMonths": { + "type": "boolean", + "description": "Determines whether the value given for OptOutWindow is in Months (true) or days (false)" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PensionRefund": { + "required": [ + "additionalVoluntaryContribution", + "assumedPensionablePay", + "employeeRefund", + "employerRefund", + "pensionableEarning", + "pensionablePay" + ], + "type": "object", + "properties": { + "employeeRefund": { + "type": "number", + "format": "double" + }, + "employerRefund": { + "type": "number", + "format": "double" + }, + "pensionSchemeUniqueId": { + "type": "string", + "format": "uuid" + }, + "pensionUniqueId": { + "type": "string", + "format": "uuid" + }, + "payInCurrentPayRun": { + "type": "boolean" + }, + "payRun": { + "$ref": "#/components/schemas/Item" + }, + "pensionableEarning": { + "type": "number", + "format": "double" + }, + "pensionablePay": { + "type": "number", + "format": "double" + }, + "additionalVoluntaryContribution": { + "type": "number", + "format": "double" + }, + "assumedPensionablePay": { + "type": "number", + "format": "double" + }, + "tierName": { + "minLength": 1, + "type": "string", + "nullable": true + }, + "tierRate": { + "maximum": 0.999, + "minimum": 0.001, + "type": "number", + "format": "double", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Used to represent a Pension Refund" + }, + "PensionReportingType": { + "enum": [ + "UsePayRun", + "UseAssessment", + "AlreadyReported", + "UseExisting" + ], + "type": "string" + }, + "PensionRule": { + "enum": [ + "ReliefAtSource", + "SalarySacrifice", + "NetPayArrangement" + ], + "type": "string" + }, + "PensionScheme": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/PensionProvider" + }, + "administrator": { + "$ref": "#/components/schemas/PensionAdministrator" + }, + "pensionRule": { + "$ref": "#/components/schemas/PensionRule" + }, + "qualifyingScheme": { + "type": "boolean", + "description": "Set to true if this is a Qualifying Scheme for Auto Enrolment" + }, + "disableAeLetters": { + "type": "boolean", + "description": "Set to true if the provider deals with AutoEnrolment Letters and therefore the system should not generate them" + }, + "subtractBasicRateTax": { + "type": "boolean" + }, + "payMethod": { + "$ref": "#/components/schemas/PayMethod" + }, + "bankDetails": { + "$ref": "#/components/schemas/BankDetails" + }, + "useCustomPayCodes": { + "type": "boolean", + "description": "If set to true then rather than using the setting on the PayCode to determine if the pay is pensionable\r\nwe'll instead treat it as pensionable if the Code is included in CustomPayCodes" + }, + "useCustomPayCodesForTierablePay": { + "type": "boolean", + "description": "If set to true then rather than using the setting on the PayCode to determine if the pay is tierable\r\nwe'll instead treat it as tierable if the Code is included in TierablePayCustomPayCodes" + }, + "customPayCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "If UseCustomPayCodes is set to true then this contains a list of PayCodes.Code\r\nthat we'll treat as being pensionable.", + "nullable": true + }, + "tierablePayCustomPayCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "If UseCustomPayCodesForTierablePay is set to true then this contains a list of PayCodes.Code\r\nthat we'll treat as being tierable.", + "nullable": true + }, + "workerGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkerGroup" + }, + "description": "A list of WorkerGroups for this Pension. There must always be at least one WorkerGroup", + "nullable": true + }, + "externalDataProviderId": { + "$ref": "#/components/schemas/ExternalDataProviderId" + }, + "externalDataCompany": { + "$ref": "#/components/schemas/ExternalDataCompany" + }, + "payCodeType": { + "$ref": "#/components/schemas/PensionPayCode" + }, + "tierablePayPayCodeType": { + "$ref": "#/components/schemas/PensionPayCode" + }, + "payCodeSetUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "tierablePayPayCodeSetUniqueId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "paymentDateRule": { + "$ref": "#/components/schemas/PaymentDateRule" + }, + "paymentDateDayOfWeek": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "paymentDateDayOfMonth": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "reportOptionsLgpsIConnect": { + "$ref": "#/components/schemas/PensionSchemeReportOptionsLgpsIConnect" + }, + "reportOptionsLgpsCivicaUpm": { + "$ref": "#/components/schemas/PensionSchemeReportOptionsLgpsCivicaUpm" + }, + "deficitValueOrdinal": { + "type": "integer", + "description": "The Ordinal used to identify the PaySchedule which the Deficit will be against", + "format": "int32", + "nullable": true + }, + "deficitValue": { + "type": "number", + "description": "The Defict value that will be deducted in a PaySchedule", + "format": "double", + "nullable": true + }, + "includeDeficitValue": { + "type": "boolean", + "description": "Set to true if this a Deficit Payment needs to be assigned to a PaySchedule" + }, + "deficitValuePayPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "nominalCodeMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionSchemeNominalCodeMapping" + }, + "description": "The PensionSchemeNominalCodeMappings used to map the PayCodes to a PensionScheme for the journal configuration", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PensionSchemeNominalCodeMapping": { + "type": "object", + "properties": { + "nominalCode": { + "maxLength": 500, + "type": "string", + "description": "Nominal Code for pension scheme", + "nullable": true + }, + "nominalName": { + "maxLength": 100, + "type": "string", + "description": "Nominal Name", + "nullable": true + }, + "journalNarrative": { + "maxLength": 500, + "type": "string", + "description": "Journal narrative description.", + "nullable": true + }, + "payCode": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "PensionSchemeReportOptionsLgpsCivicaUpm": { + "type": "object", + "properties": { + "payrollNumber": { + "$ref": "#/components/schemas/LgpsCivicaPayrollNumber" + }, + "casualHours": { + "$ref": "#/components/schemas/LgpsCivicaCasualHours" + }, + "omitHeaderLine": { + "type": "boolean" + }, + "includeFolderNo": { + "type": "boolean" + }, + "excludeSchoolEmployerName": { + "type": "boolean" + }, + "addressesForNewJoinersOnly": { + "type": "boolean" + }, + "proRatePtHoursWeeksWorked": { + "type": "boolean" + }, + "fullTimeHoursAsOneHundred": { + "type": "boolean" + }, + "includeWeeksWorkedColumns": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PensionSchemeReportOptionsLgpsIConnect": { + "type": "object", + "properties": { + "fileType": { + "$ref": "#/components/schemas/LgpsIConnectFileType" + }, + "payrollReference1": { + "$ref": "#/components/schemas/LgpsIConnectPayrollReference" + }, + "payrollReference2": { + "$ref": "#/components/schemas/LgpsIConnectPayrollReference" + }, + "payrollReference3": { + "$ref": "#/components/schemas/LgpsIConnectPayrollReference" + }, + "populateEmailAddress": { + "type": "boolean" + }, + "populateTelephoneNumber": { + "type": "boolean" + }, + "populateMobileNumber": { + "type": "boolean" + }, + "populateWorksPlaceName": { + "type": "boolean" + }, + "populateWorksAddress": { + "type": "boolean" + }, + "populateWorksEmailAddress": { + "type": "boolean" + }, + "includeEmploymentBreaks": { + "type": "boolean" + }, + "breakReasonSmpIndicatorOnly": { + "type": "boolean" + }, + "populateMaritalStatus": { + "type": "boolean" + }, + "includeAeQualifyingEarnings": { + "type": "boolean" + }, + "proRatePtHoursByTermTimeWeeks": { + "type": "boolean" + }, + "ignoreTermTimeWeeksForFteFinalPay": { + "type": "boolean" + }, + "showFteAnnualSalaryForFteFinalPay": { + "type": "boolean" + }, + "casualStaffHoursAsOne": { + "type": "boolean" + }, + "casualStaffIndicatorAsY": { + "type": "boolean" + }, + "ignoreHours": { + "type": "boolean" + }, + "forceUpperCase": { + "type": "boolean" + }, + "salaryType": { + "$ref": "#/components/schemas/LgpsIConnectSalaryType" + }, + "customText": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "PensionSelection": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + }, + "pensionSchemeId": { + "type": "string", + "format": "uuid" + }, + "pensionScheme": { + "$ref": "#/components/schemas/PensionScheme" + }, + "workerGroupId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "PensionSummary": { + "type": "object", + "properties": { + "pensionId": { + "type": "string", + "description": "[readonly] The Id of the Pension.", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "[readonly] The name of the PensionScheme to which contributions have been made.", + "nullable": true + }, + "pensionSchemeId": { + "type": "string", + "description": "[readonly] The Id of the PensionScheme.", + "format": "uuid" + }, + "startDate": { + "type": "string", + "description": "[readonly] Pension Start Date", + "format": "date" + }, + "endDate": { + "type": "string", + "description": "Pension End Date", + "format": "date", + "nullable": true + }, + "workerGroupId": { + "type": "string", + "description": "[readonly] The Id of the WorkerGroup.", + "format": "uuid" + }, + "pensionRule": { + "$ref": "#/components/schemas/PensionRule" + }, + "subtractedBasicRateTax": { + "type": "boolean", + "description": "[readonly] The SubtractedBasicRateTax applied from the PensionScheme SubtractBasicRateTax." + }, + "papdisPensionProviderId": { + "type": "string", + "description": "[readonly] Papdis information from the PensionScheme", + "nullable": true + }, + "papdisEmployerId": { + "type": "string", + "description": "[readonly] Papdis information from the PensionScheme", + "nullable": true + }, + "employeePensionContributionMultiplier": { + "type": "number", + "description": "[readonly] If the PensionScheme is set to SubtractBasicRateTax then this value is used to reduce the contribution amount.\r\nOtherwise it is set as 1.", + "format": "double" + }, + "additionalVoluntaryContribution": { + "type": "number", + "description": "[readonly] Any Additional Voluntary Contribution the Employee has chosen to make\r\nOtherwise it is set as 1.", + "format": "double" + }, + "avcIsPercentage": { + "type": "boolean", + "description": "[readonly] Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage," + }, + "autoEnrolled": { + "type": "boolean", + "description": "[readonly] Any Additional Voluntary Contribution the Employee has chosen to make\r\nOtherwise it is set as 1." + }, + "workerGroup": { + "$ref": "#/components/schemas/WorkerGroup" + }, + "forcedTier": { + "type": "string", + "description": "[readonly] If the WorkerGroup ContributionLevelType is a Tiered Scheme then the name of the tier to force the employee on to may be specified.\r\nIf none is specified then the Tier is determined by the earnings in the period", + "nullable": true + }, + "tiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TieredPensionRate" + }, + "nullable": true + }, + "assumedPensionablePay": { + "type": "number", + "description": "[readonly] Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set\r\nthen it'll be shown here.", + "format": "double", + "nullable": true + }, + "pensionablePayCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[readonly] If the pension scheme is set to override the Pensionale PayCodes, then this is what they've been set to.", + "nullable": true + }, + "tierablePayPayCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[readonly] If the pension scheme is set to override the TierablePay PayCodes, then this is what they've been set to.", + "nullable": true + }, + "isHalfContributionMember": { + "type": "boolean", + "description": "if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions." + }, + "pensionableEarnings": { + "type": "number", + "description": "[readonly] The amount of the Gross that is subject to Pension Deductions.\r\nIf the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied\r\nApplied only if an employee has more than one pension assigned to them", + "format": "double" + }, + "pensionablePay": { + "type": "number", + "description": "[readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup.\r\nApplied only if an employee has more than one pension assigned to them", + "format": "double" + }, + "nonTierablePay": { + "type": "number", + "description": "[readonly] The value of any pay that shouldn't count towards determining a pension tier.", + "format": "double" + }, + "employeePensionContribution": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions", + "format": "double" + }, + "employeePensionContributionAvc": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution", + "format": "double" + }, + "employerPensionContribution": { + "type": "number", + "description": "[readonly] The value of the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "isForEndedPension": { + "type": "boolean", + "description": "[readonly] Determines whether the pension summary is related to a pension that has ended or not" + }, + "associatedEmployeeRoles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "nullable": true + }, + "notionalPay": { + "type": "number", + "description": "Pay value based on regular pay lines and the pension's associated roles\r\nSet before any adjustments for things like stat payments", + "format": "double" + }, + "pensionableEarningsBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date amount of the Gross that is subject to Pension Deductions.\r\nApplied only if an employee has more than one pension assigned to them", + "format": "double" + }, + "pensionablePayBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup.\r\nApplied only if an employee has more than one pension assigned to them", + "format": "double" + }, + "employeePensionContributionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions", + "format": "double" + }, + "assumedPensionablePayBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date value of Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set\r\nthen it'll be shown here.", + "format": "double", + "nullable": true + }, + "employerPensionContributionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date value of the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "employeePensionContributionAvcBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution", + "format": "double" + }, + "whenEarnedPensionSummaries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionSummary" + }, + "description": "The list of pension summaries created on the base of when earned additions' and deductions' pension calculations for back paid periods", + "nullable": true + }, + "periodFrom": { + "type": "string", + "description": "Nullable DateTime property \"PeriodFrom\" to store the start date of the PayPeriod the current PensionSummary is attributable to.\r\nApplicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods", + "format": "date", + "nullable": true + }, + "periodTo": { + "type": "string", + "description": "Nullable DateTime property \"PeriodTo\" to store the start date of the PayPeriod the current PensionSummary is attributable to.\r\nApplicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods", + "format": "date", + "nullable": true + }, + "whenEarnedPensionableEarningsCorrection": { + "type": "number", + "description": "[readonly] The when earned amount correction to the Gross that is subject to Pension Deductions.", + "format": "double" + }, + "whenEarnedPensionablePayCorrection": { + "type": "number", + "description": "[readonly] The when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup.", + "format": "double" + }, + "whenEarnedEmployeePensionContributionCorrection": { + "type": "number", + "description": "[readonly] The when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions", + "format": "double" + }, + "whenEarnedEmployerPensionContributionCorrection": { + "type": "number", + "description": "[readonly] The when earned amount correction to the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "whenEarnedEmployeePensionContributionAvcCorrection": { + "type": "number", + "description": "[readonly] The when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution", + "format": "double" + }, + "whenEarnedPensionableEarningsCorrectionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date when earned amount correction to the Gross that is subject to Pension Deductions.", + "format": "double" + }, + "whenEarnedPensionablePayCorrectionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup.", + "format": "double" + }, + "whenEarnedEmployeePensionContributionCorrectionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions", + "format": "double" + }, + "whenEarnedEmployerPensionContributionCorrectionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by the Employer for this Employee", + "format": "double" + }, + "whenEarnedEmployeePensionContributionAvcCorrectionBfd": { + "type": "number", + "description": "[readonly] The brought forward Year to Date when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution", + "format": "double" + }, + "nominalCodeMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PensionSchemeNominalCodeMapping" + }, + "description": "List of Nominal Code Mappings of the Pension", + "nullable": true + } + }, + "additionalProperties": false, + "description": "If a PayRunEntry contains pension contributions then it'll also include a PensionSummary model\r\ngiving further information about the Pension Scheme and the contributions made" + }, + "PensionSummaryCostBreakdown": { + "type": "object", + "properties": { + "pensionRule": { + "$ref": "#/components/schemas/PensionRule" + }, + "payCodes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of pay codes associated with this pension rule.", + "nullable": true + }, + "amount": { + "type": "number", + "description": "The amount associated with this pension entry.", + "format": "double" + }, + "pensionableEarnings": { + "type": "number", + "description": "The total pensionable earnings relevant to this pension rule.", + "format": "double" + }, + "employeePensionContribution": { + "type": "number", + "description": "The contribution amount made by the employee towards the pension.", + "format": "double" + }, + "employerPensionContribution": { + "type": "number", + "description": "The contribution amount made by the employer towards the pension.", + "format": "double" + } + }, + "additionalProperties": false + }, + "PensionablePayDefinition": { + "enum": [ + "NotApplicable", + "QualifyingEarnings", + "BasicPay", + "TotalPay", + "OwnDefinition" + ], + "type": "string" + }, + "PensionerPayroll": { + "type": "object", + "properties": { + "inReceiptOfPension": { + "type": "boolean", + "description": "If set to true then the FPS will have the OccPenInd flag set to 'yes'" + }, + "bereaved": { + "type": "boolean", + "description": "Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner" + }, + "amount": { + "type": "number", + "description": "Annual amount of occupational pension", + "format": "double" + }, + "startDate": { + "type": "string", + "description": "Start date of occupational Pension", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "PeriodValue": { + "type": "object", + "properties": { + "effectiveFrom": { + "type": "string", + "description": "The date when these period values are effective", + "format": "date", + "nullable": true + }, + "annualValue": { + "type": "number", + "description": "The Annual value", + "format": "double" + }, + "periodValues": { + "type": "object", + "properties": { + "Custom": { + "type": "number", + "format": "double" + }, + "Monthly": { + "type": "number", + "format": "double" + }, + "FourWeekly": { + "type": "number", + "format": "double" + }, + "Fortnightly": { + "type": "number", + "format": "double" + }, + "Weekly": { + "type": "number", + "format": "double" + }, + "Daily": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Period values for different pay periods", + "nullable": true + }, + "midYearChanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PeriodValue" + }, + "description": "Any optional changes to the period values that are effective from a specified date in the middle of a tax year", + "nullable": true + } + }, + "additionalProperties": false + }, + "PersonalDetails": { + "required": [ + "dateOfBirth", + "gender", + "maritalStatus" + ], + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Address" + }, + "maritalStatus": { + "$ref": "#/components/schemas/MaritalStatus" + }, + "title": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "firstName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "middleName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "alternativeEmail": { + "maxLength": 100, + "type": "string", + "format": "email", + "nullable": true + }, + "previousSurName": { + "maxLength": 35, + "type": "string", + "nullable": true + }, + "email": { + "maxLength": 100, + "type": "string", + "format": "email", + "nullable": true + }, + "emailPayslip": { + "type": "boolean", + "description": "If set to true then the employees Payslip will be sent by email when a PayRun is finalised." + }, + "pdfPassword": { + "type": "string", + "description": "Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property.", + "nullable": true + }, + "pdfPasswordType": { + "$ref": "#/components/schemas/PdfPasswordType" + }, + "emailStatement": { + "type": "boolean", + "description": "Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted." + }, + "photoUrl": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "photoSasUrl": { + "type": "string", + "nullable": true + }, + "telephone": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "mobile": { + "maxLength": 30, + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "format": "date" + }, + "statePensionAge": { + "type": "integer", + "description": "[readonly] Automatically calculated.", + "format": "int32" + }, + "gender": { + "$ref": "#/components/schemas/Gender" + }, + "niNumber": { + "maxLength": 15, + "type": "string", + "nullable": true + }, + "passportNumber": { + "maxLength": 25, + "type": "string", + "nullable": true + }, + "partnerDetails": { + "$ref": "#/components/schemas/PartnerDetails" + } + }, + "additionalProperties": false + }, + "PricingBand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "nullable": true + }, + "from": { + "type": "integer", + "format": "int32" + }, + "to": { + "type": "integer", + "format": "int32" + }, + "price": { + "type": "number", + "format": "double" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "PricingTable": { + "type": "object", + "properties": { + "name": { + "maxLength": 50, + "type": "string", + "nullable": true + }, + "minimumCharge": { + "type": "number", + "format": "double" + }, + "bands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricingBand" + }, + "nullable": true + }, + "isDefault": { + "type": "boolean" + }, + "netSuiteItemCode": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "netSuiteDescription": { + "maxLength": 40, + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ProRataRule": { + "enum": [ + "WorkingDaysInPeriod", + "CalendarDaysInPeriod", + "TwoSixtyRule", + "ThreeSixFiveRule" + ], + "type": "string" + }, + "ProcessingNote": { + "required": [ + "note" + ], + "type": "object", + "properties": { + "payRunEntryId": { + "type": "string", + "description": "The Id of the payrunEntry this ProcessingNote relates to, if any", + "format": "uuid", + "nullable": true + }, + "note": { + "minLength": 1, + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/Item" + }, + "payRun": { + "$ref": "#/components/schemas/Item" + }, + "date": { + "type": "string", + "format": "date" + }, + "documentCount": { + "type": "integer", + "description": "[readonly] The number of attachments associated with this model", + "format": "int32" + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] The attachments associated with this model", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ProcessingNoteStatus" + }, + "updatedByName": { + "type": "string", + "description": "Name of the user who was last to update the record", + "nullable": true + }, + "completedDate": { + "type": "string", + "description": "UpdatedDate is assigned to this to get around the base implementation of UpdatedDate having [JsonIgnore] tag", + "format": "date", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ProcessingNoteStatus": { + "enum": [ + "New", + "Complete" + ], + "type": "string" + }, + "RecoverableAmounts": { + "type": "object", + "properties": { + "taxMonth": { + "type": "integer", + "format": "int32" + }, + "smpRecovered": { + "type": "number", + "description": "Value of Statutory Maternity Pay recovered year to date", + "format": "double" + }, + "sppRecovered": { + "type": "number", + "description": "Value of Statutory Paternity Pay recovered year to date", + "format": "double" + }, + "sapRecovered": { + "type": "number", + "description": "Value of Statutory Adoption Pay recovered year to date", + "format": "double" + }, + "shPPRecovered": { + "type": "number", + "description": "Value of Shared Parental Pay recovered year to date", + "format": "double" + }, + "spbpRecovered": { + "type": "number", + "description": "Value of Statutory Parental Bereavement Pay recovered year to date", + "format": "double" + }, + "nicCompensationOnSMP": { + "type": "number", + "description": "Value of NIC compensation on SMP year to date", + "format": "double" + }, + "nicCompensationOnSPP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Paternity Pay year to date", + "format": "double" + }, + "nicCompensationOnSAP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Adoption Pay year to date", + "format": "double" + }, + "nicCompensationOnShPP": { + "type": "number", + "description": "Value of NIC compensation on Shared Parental Pay year to date", + "format": "double" + }, + "nicCompensationOnSPBP": { + "type": "number", + "description": "Value of NIC compensation on Statutory Parental Bereavement Pay year to date", + "format": "double" + }, + "cisDeductionsSuffered": { + "type": "number", + "description": "Value of CIS deductions suffered year to date", + "format": "double" + }, + "total": { + "type": "number", + "description": "The total value of the reclaimed amounts", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "Report": { + "enum": [ + "GrossToNet", + "GrossToNetCis", + "PayrunPayments", + "Furlough", + "PensionContribs", + "Journal", + "HourlyPay", + "UmbrellaReconciliation", + "UmbrellaStatement", + "StatutoryPay", + "CostAnalysis", + "CostOfEmployment", + "FullSummaryOfPay", + "P11", + "P11d", + "P30", + "P32", + "P45", + "P60", + "EmployeeExport", + "RightToWork", + "AeoStatement", + "HolidayAllowances", + "HolidayPayAccruals", + "AeAssessments", + "CisStatement", + "SubcontractorSummary", + "PayrollAnalysis", + "VarianceReport", + "P11Detailed", + "NiLetterValidation", + "Ytd", + "TaxCodeChanges", + "EmployeeBenefits", + "MemberEnrolment", + "AttachmentOrders", + "NiYtd", + "ApprenticeshipLevy", + "TeachersPensionEoy", + "MaternitySchedule", + "PaySpine", + "SpinePoint", + "PayGrades", + "PaySpineAllowances", + "AverageHolidayPayRate", + "EmployeeRoleExport", + "HolidayPayAccrualsHours", + "GenderPayGap", + "PensionMemberships", + "PayElement", + "LoanBalances", + "EmployeeLeave", + "AdvancedVarianceReport" + ], + "type": "string" + }, + "ReportCustomCssOption": { + "enum": [ + "UseDefault", + "AppendToDefault", + "ReplaceDefault" + ], + "type": "string" + }, + "ReportFormat": { + "enum": [ + "Json", + "Csv", + "Pdf" + ], + "type": "string" + }, + "ReportPack": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "maxLength": 150, + "minLength": 1, + "type": "string", + "description": "The name of this ReportPack" + }, + "reports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Report" + }, + "description": "The Reports included in this ReportPack", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "A ReportPack is used to group together a number of reports" + }, + "ReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "description": "[readonly] If the type is application.json then this will contain a JSON representation of the relevant model", + "nullable": true + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "ReportSortBy": { + "enum": [ + "PayrollCode", + "LastName", + "Department" + ], + "type": "string" + }, + "ReportTemplate": { + "required": [ + "templateName" + ], + "type": "object", + "properties": { + "templateName": { + "minLength": 1, + "type": "string" + }, + "userName": { + "type": "string", + "nullable": true + }, + "lastUpdated": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "RightToWork": { + "type": "object", + "properties": { + "checked": { + "type": "boolean" + }, + "documentType": { + "$ref": "#/components/schemas/RightToWorkDocumentType" + }, + "documentRef": { + "maxLength": 80, + "type": "string", + "nullable": true + }, + "documentExpiry": { + "type": "string", + "format": "date", + "nullable": true + }, + "note": { + "maxLength": 200, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "RightToWorkDocumentType": { + "enum": [ + "Other", + "Visa", + "Passport", + "BirthCertificate", + "IdentityCard", + "ShareCode" + ], + "type": "string" + }, + "RightToWorkReport": { + "type": "object", + "properties": { + "employer": { + "$ref": "#/components/schemas/Item" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RightToWorkReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RightToWorkReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "rightToWork": { + "$ref": "#/components/schemas/RightToWork" + } + }, + "additionalProperties": false + }, + "RightToWorkReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/RightToWorkReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "RoleBasis": { + "enum": [ + "NotApplicable", + "Permanent", + "Temporary", + "FixedTerm", + "ZeroHours", + "Casual", + "Supply" + ], + "type": "string" + }, + "RoleType": { + "enum": [ + "NotApplicable", + "Teacher", + "Support", + "Other" + ], + "type": "string" + }, + "RtiAgent": { + "type": "object", + "properties": { + "agentId": { + "type": "string", + "nullable": true + }, + "company": { + "type": "string", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "contact": { + "$ref": "#/components/schemas/RtiContact" + } + }, + "additionalProperties": false + }, + "RtiContact": { + "type": "object", + "properties": { + "firstName": { + "maxLength": 50, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 50, + "type": "string", + "nullable": true + }, + "email": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "telephone": { + "maxLength": 50, + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "RtiEmployeeAddress": { + "type": "object", + "properties": { + "line": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "postcode": { + "type": "string", + "nullable": true + }, + "postCode": { + "type": "string", + "nullable": true + }, + "ukPostcode": { + "type": "string", + "nullable": true + }, + "country": { + "type": "string", + "nullable": true + }, + "foreignCountry": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "RtiEmployeeName": { + "type": "object", + "properties": { + "ttl": { + "type": "string", + "nullable": true + }, + "fore": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "initials": { + "type": "string", + "nullable": true + }, + "sur": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "RtiSenderType": { + "enum": [ + "ActingInCapacity", + "Agent", + "Bureau", + "Company", + "Employer", + "Government", + "Individual", + "Other", + "Partnership", + "Trust" + ], + "type": "string" + }, + "RtiSubmissionSettings": { + "type": "object", + "properties": { + "senderType": { + "$ref": "#/components/schemas/RtiSenderType" + }, + "senderId": { + "maxLength": 30, + "type": "string", + "description": "The SenderId used to submit RTI documents to HMRC", + "nullable": true + }, + "password": { + "maxLength": 200, + "type": "string", + "description": "The Password used to submit RTI documents to HMRC", + "nullable": true + }, + "excludeNilPaid": { + "type": "boolean", + "description": "Whether or not to include Employees paid a zero amount on your FPS" + }, + "includeHashCrossRef": { + "type": "boolean", + "description": "[readonly] Whether or not the Bacs Cross Ref field is included on your FPS submissions\r\nThis is automatically set to true if you use a bank payments CSV format that supports it\r\nor set to false if not" + }, + "autoSubmitFps": { + "type": "boolean", + "description": "If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun" + }, + "testInLive": { + "type": "boolean", + "description": "Used for testing the RTI gateway. If set to true then the Document Type name will have \"-TIL\" appended to it" + }, + "useTestGateway": { + "type": "boolean", + "description": "If set to true then your RTI documents will be sent to HMRCs test services instead of the live service" + }, + "overrideTimestampValue": { + "maxLength": 25, + "type": "string", + "description": "If a value is provided then it will be used as the timestamp on the RTI submission. This would normally only be used for testing purposes.", + "nullable": true + }, + "contact": { + "$ref": "#/components/schemas/RtiContact" + }, + "agent": { + "$ref": "#/components/schemas/RtiAgent" + }, + "allowLinkedEps": { + "type": "boolean", + "description": "If set to true this will allow you to submit a combined Employer Payment Summary" + }, + "shouldCompressFps": { + "type": "boolean", + "description": "If set to true this will compress the FPS before submitting to HMRC" + }, + "autoSubmitEps": { + "type": "boolean", + "description": "If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun." + } + }, + "additionalProperties": false + }, + "RtiValidationWarning": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/RtiValidationWarningType" + }, + "employeeId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "RtiValidationWarningType": { + "enum": [ + "MissingAddress", + "MissingNiNo" + ], + "type": "string" + }, + "ServiceBand": { + "type": "object", + "properties": { + "description": { + "type": "string", + "nullable": true + }, + "from": { + "type": "integer", + "format": "int32" + }, + "to": { + "type": "integer", + "format": "int32" + }, + "entitlementBands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntitlementBand" + }, + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ShiftWorkingPatternDay": { + "type": "object", + "properties": { + "day": { + "type": "integer", + "format": "int32" + }, + "isWorkingDay": { + "type": "boolean" + }, + "hours": { + "type": "number", + "format": "double" + }, + "workingPatternHoursType": { + "$ref": "#/components/schemas/WorkingPatternHoursType" + } + }, + "additionalProperties": false + }, + "SmtpEncryption": { + "enum": [ + "Auto", + "Ssl", + "Tls" + ], + "type": "string" + }, + "SmtpSettings": { + "type": "object", + "properties": { + "smtpServer": { + "type": "string", + "nullable": true + }, + "smtpPort": { + "type": "integer", + "format": "int32" + }, + "encryption": { + "$ref": "#/components/schemas/SmtpEncryption" + }, + "smtpUsername": { + "type": "string", + "nullable": true + }, + "smtpPassword": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "SpinePointReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpinePointReportLine" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SpinePointReportLine": { + "type": "object", + "properties": { + "spineName": { + "type": "string", + "description": "Spine Name", + "nullable": true + }, + "spinePointName": { + "type": "string", + "description": "Spine Point Name", + "nullable": true + }, + "number": { + "type": "integer", + "description": "Spine Point Number", + "format": "int32" + }, + "effectiveDate": { + "type": "string", + "description": "Effective Date of spine point", + "format": "date" + }, + "annualValue": { + "type": "number", + "description": "Annual Value of spine point", + "format": "double" + }, + "annualValueAltMax": { + "type": "number", + "description": "Alt Max Annual Value of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAInner": { + "type": "number", + "description": "Annual Value LA Inner of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAInnerAltMax": { + "type": "number", + "description": "Annual Value LA Inner Alt Max of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAOuter": { + "type": "number", + "description": "Annual Value LA Outer of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAOuterAltMax": { + "type": "number", + "description": "Annual Value LA Outer Alt Max of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAFringe": { + "type": "number", + "description": "Annual Value LA Fringe of spine point", + "format": "double", + "nullable": true + }, + "annualValueLAFringeAltMax": { + "type": "number", + "description": "Annual Value LA Fringe Alt Max of spine point", + "format": "double", + "nullable": true + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "SpinePointReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/SpinePointReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "StarterDeclaration": { + "enum": [ + "A", + "B", + "C", + "Unknown" + ], + "type": "string" + }, + "StarterDetails": { + "required": [ + "startDate", + "starterDeclaration" + ], + "type": "object", + "properties": { + "startDate": { + "type": "string", + "format": "date" + }, + "starterDeclaration": { + "$ref": "#/components/schemas/StarterDeclaration" + }, + "overseasEmployerDetails": { + "$ref": "#/components/schemas/OverseasEmployerDetails" + }, + "pensionerPayroll": { + "$ref": "#/components/schemas/PensionerPayroll" + } + }, + "additionalProperties": false + }, + "StartersLeaversFilter": { + "enum": [ + "Starters", + "Leavers" + ], + "type": "string" + }, + "StatPayFrequency": { + "enum": [ + "DaysInPeriod", + "WeeksInPeriod" + ], + "type": "string" + }, + "StatutoryPay": { + "type": "object", + "properties": { + "weeklyParentalLeaveAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "weeklySickPayAmount": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "aweEligibilityThreshold": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate Statutory Pay.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "StatutoryPayReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StatutoryPayReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "StatutoryPayReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "ssp": { + "type": "number", + "format": "double" + }, + "smp": { + "type": "number", + "format": "double" + }, + "spp": { + "type": "number", + "format": "double" + }, + "sap": { + "type": "number", + "format": "double" + }, + "shpp": { + "type": "number", + "format": "double" + }, + "spbp": { + "type": "number", + "format": "double" + }, + "hasStatPay": { + "type": "boolean", + "readOnly": true + }, + "totalStatPay": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "StatutoryPayReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/StatutoryPayReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "StringDecimalKeyValuePair": { + "type": "object", + "properties": { + "key": { + "type": "string", + "nullable": true + }, + "value": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "StringStringKeyValuePair": { + "type": "object", + "properties": { + "key": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "StudentLoan": { + "enum": [ + "None", + "PlanOne", + "PlanTwo", + "PlanFour" + ], + "type": "string" + }, + "StudentLoanRecovered": { + "type": "object", + "properties": { + "planType": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "SubmissionStatus": { + "enum": [ + "NotSubmitted", + "Submitted", + "ErrorResponse", + "Accepted" + ], + "type": "string" + }, + "Tag": { + "required": [ + "code", + "title" + ], + "type": "object", + "properties": { + "code": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The unique code for this Tag" + }, + "title": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The title for this Tag" + }, + "color": { + "maxLength": 6, + "type": "string", + "description": "A color to used to represent this Tag, in hex format. ie 'ff0000'", + "nullable": true + } + }, + "additionalProperties": false + }, + "TaxAndNi": { + "required": [ + "niTable" + ], + "type": "object", + "properties": { + "niTable": { + "type": "string", + "description": "The appropriate NI letter for this Employee" + }, + "secondaryClass1NotPayable": { + "type": "boolean", + "description": "If set to true then no Employer NI will be paid for this Employee" + }, + "postgradLoan": { + "type": "boolean", + "description": "Set to true if the Employee needs to make Post Graduate Loan repayments" + }, + "postgraduateLoanStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "postgraduateLoanEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "studentLoan": { + "$ref": "#/components/schemas/StudentLoan" + }, + "studentLoanStartDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "studentLoanEndDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "taxCode": { + "maxLength": 12, + "type": "string", + "description": "The Tax Code for this Employee", + "nullable": true + }, + "week1Month1": { + "type": "boolean", + "description": "Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis.\r\nThis is automatically set to false for any existing Employees when you start a new Tax Year." + }, + "foreignTaxCredit": { + "type": "boolean", + "description": "If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities." + } + }, + "additionalProperties": false + }, + "TaxBracket": { + "type": "object", + "properties": { + "from": { + "type": "number", + "description": "[readonly] The starting point for applying this tax rate", + "format": "double" + }, + "to": { + "type": "number", + "description": "[readonly] The end point for applying this tax rate", + "format": "double" + }, + "multiplier": { + "type": "number", + "description": "[readonly] The tax rate to apply", + "format": "double" + } + }, + "additionalProperties": false + }, + "TaxCodeChange": { + "type": "object", + "properties": { + "suffix": { + "type": "string", + "description": "[readonly] The suffix of the Tax Code that needs to be incremented for this Tax Year", + "nullable": true + }, + "increment": { + "type": "integer", + "description": "[readonly] The amount by which to increment Tax Codes with the given suffix", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to perform the Year End routine.\r\nIt is used internally when our engine performs the Year End routine.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "TaxCodeChangeReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxCodeChangeValues" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TaxCodeChangeReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/TaxCodeChangeReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "TaxCodeChangeValues": { + "type": "object", + "properties": { + "employeeId": { + "type": "integer", + "format": "int32" + }, + "employee": { + "$ref": "#/components/schemas/Item" + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string", + "nullable": true + }, + "niNumber": { + "type": "string", + "nullable": true + }, + "periodChange": { + "type": "integer", + "format": "int32" + }, + "previousTaxCode": { + "type": "string", + "nullable": true + }, + "currentTaxCode": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TaxYear": { + "enum": [ + "Year2017", + "Year2018", + "Year2019", + "Year2020", + "Year2021", + "Year2022", + "Year2023", + "Year2024" + ], + "type": "string" + }, + "TaxYearConfig": { + "type": "object", + "properties": { + "taxYear": { + "type": "integer", + "description": "[readonly] The TaxYear for which this configuration applies", + "format": "int32" + }, + "isPreview": { + "type": "boolean", + "description": "[readonly] Indicates that this is a preview of the given years configuration and it shouldn't yet be used for live processing of payroll data." + }, + "defaultTaxCode": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "class1ANicsRate": { + "$ref": "#/components/schemas/DecimalTaxYearConfigPrimitiveValue" + }, + "lowerEarningsLimit": { + "$ref": "#/components/schemas/PeriodValue" + }, + "upperEarningsLimit": { + "$ref": "#/components/schemas/PeriodValue" + }, + "primaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "secondaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "upperAccrualPoint": { + "$ref": "#/components/schemas/PeriodValue" + }, + "upperSecondaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "apprenticeUpperSecondaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "freeportsUpperSecondaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "veteransUpperSecondaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "directorsProratePrimaryThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "plan1StudentLoanThreshold": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "plan1StudentLoanRate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "plan2StudentLoanThreshold": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "plan2StudentLoanRate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "plan4StudentLoanThreshold": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "plan4StudentLoanRate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postGradLoanThreshold": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "postGradLoanRate": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "deaProtectedEarnings": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "pensionLowerThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "pensionAutomaticEnrolment": { + "$ref": "#/components/schemas/PeriodValue" + }, + "pensionUpperThreshold": { + "$ref": "#/components/schemas/PeriodValue" + }, + "pensionAeEmployerContribution": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "pensionAeEmployeeContribution": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employmentAllowancePreviousYear": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "employmentAllowance": { + "type": "number", + "description": "[readonly]", + "format": "double" + }, + "fixedCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FixedCode" + }, + "description": "[readonly]", + "nullable": true + }, + "scottishFixedCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FixedCode" + }, + "description": "[readonly]", + "nullable": true + }, + "welshFixedCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FixedCode" + }, + "description": "[readonly]", + "nullable": true + }, + "niRates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NationalInsuranceCode" + }, + "description": "[readonly]", + "nullable": true + }, + "directorsNiRates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NationalInsuranceCode" + }, + "description": "[readonly]", + "nullable": true + }, + "brackets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxBracket" + }, + "description": "[readonly]", + "nullable": true + }, + "scottishBrackets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxBracket" + }, + "description": "[readonly]", + "nullable": true + }, + "welshBrackets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxBracket" + }, + "description": "[readonly]", + "nullable": true + }, + "taxCodeChanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxCodeChange" + }, + "description": "[readonly]", + "nullable": true + }, + "minimumWage": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NationalMinimumWage" + }, + "description": "[readonly]", + "nullable": true + }, + "statutoryPay": { + "$ref": "#/components/schemas/StatutoryPay" + }, + "loanCharge": { + "$ref": "#/components/schemas/LoanCharge" + }, + "carCharge": { + "$ref": "#/components/schemas/CarCharge" + }, + "govTalk": { + "$ref": "#/components/schemas/GovTalk" + }, + "mileageAllowancePaymentsRates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MileageAllowancePaymentsRate" + }, + "description": "[readonly]", + "nullable": true + }, + "tieredPensions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TieredPension" + }, + "description": "[readonly]", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The configuation that our engine uses to perform calculations for the related TaxYear.\r\nIt is used internally when our engine performs any calculations or the Year End routine.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "TaxYearTypes": { + "enum": [ + "Year2017", + "Year2018", + "Year2019", + "Year2020", + "Year2021", + "Year2022", + "Year2023", + "Year2024" + ], + "type": "string" + }, + "TeachersPensionAgeWarning": { + "enum": [ + "EmployeeUnder16", + "EmployeeTurns16", + "EmployeeOver75", + "EmployeeTurns75" + ], + "type": "string" + }, + "TeachersPensionDetails": { + "type": "object", + "properties": { + "employmentType": { + "$ref": "#/components/schemas/TeachersPensionEmploymentType" + }, + "fullTimeSalary": { + "type": "integer", + "description": "Up to 7 digits, in pounds. eg 24000", + "format": "int32", + "nullable": true + }, + "partTimeSalaryPaid": { + "type": "integer", + "description": "Up to 7 digits, in pounds. eg 24000", + "format": "int32", + "nullable": true + }, + "mcrRoleId1": { + "maxLength": 15, + "type": "string", + "description": "Data field for the Contract used for Teachers pension administration", + "nullable": true + }, + "mcrRoleId2": { + "maxLength": 20, + "type": "string", + "description": "The Job role within the contract used for Teachers pension administration", + "nullable": true + }, + "teachersPensionAdminNiNumber": { + "maxLength": 9, + "type": "string", + "description": "Where an employee does not have an NI number yet (or doesn't know their NI number) Teachers Pensions will issue an administrative NI number", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to represent additional information needed for \r\nTeachers' Pensions" + }, + "TeachersPensionEmploymentType": { + "enum": [ + "FullTime", + "PartTimeRegular", + "IrregularPartTime", + "IrregularPartTime_In" + ], + "type": "string" + }, + "TeachersPensionEoyLineItem": { + "type": "object", + "properties": { + "tier": { + "type": "number", + "format": "double" + }, + "percentageRate": { + "type": "number", + "format": "double", + "readOnly": true + }, + "contributorySalary": { + "type": "number", + "format": "double", + "readOnly": true + }, + "teachersContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employersContributions": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "TeachersPensionEoyReport": { + "type": "object", + "properties": { + "pdfFileName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "establishment": { + "$ref": "#/components/schemas/Establishment" + }, + "lineItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeachersPensionEoyLineItem" + }, + "nullable": true, + "readOnly": true + }, + "careerAverageFlexibilities": { + "type": "number", + "format": "double", + "readOnly": true + }, + "additionalPensionPayments": { + "type": "number", + "format": "double", + "readOnly": true + }, + "additionalContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "teachersContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employersContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "efeArrears": { + "type": "number", + "format": "double", + "readOnly": true + }, + "prestonContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "tr22ElectionAmounts": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalExtraContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "overallBalance": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employersContributionPercentage": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalContributorySalary": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalTeachersContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "totalEmployersContributions": { + "type": "number", + "format": "double", + "readOnly": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TeachersPensionEoyReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/TeachersPensionEoyReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Tenant": { + "type": "object", + "properties": { + "brandCode": { + "maxLength": 100, + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "appName": { + "type": "string", + "nullable": true + }, + "homeUrl": { + "type": "string", + "nullable": true + }, + "headContent": { + "type": "string", + "nullable": true + }, + "logOutUrl": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "loginImgUrl": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "homeImgUrl": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "favIcon": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "cssColorsFile": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "cssFile": { + "type": "string", + "description": "[readonly]", + "nullable": true + }, + "mailingList": { + "type": "boolean" + }, + "htmlInsertions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantHtmlInsertion" + }, + "nullable": true + }, + "mailSettings": { + "$ref": "#/components/schemas/MailSettings" + }, + "signupUrl": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "termsUrl": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "helpUrl": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "supportEmail": { + "maxLength": 150, + "type": "string", + "format": "email", + "nullable": true + }, + "newUserSignupEmail": { + "maxLength": 150, + "type": "string", + "format": "email", + "nullable": true + }, + "approveNewUsers": { + "type": "boolean" + }, + "enableBureauFeatures": { + "type": "boolean" + }, + "requireDdMandateBeforeAllowingBillableActivity": { + "type": "boolean" + }, + "whiteLabelMode": { + "type": "boolean" + }, + "enableReportWriterFeature": { + "type": "boolean", + "description": "Indicates if the Report Writer feature is enabled for the tenant." + }, + "disableEvc": { + "type": "boolean", + "description": "Indicates whether FPS should be submitted to EVC for employees/employers under this tenant." + }, + "tenantOwnsBilling": { + "type": "boolean", + "description": "[readonly]" + }, + "billingSettings": { + "$ref": "#/components/schemas/TenantBillingSettings" + }, + "usersCanManageAccountSecuritySettings": { + "type": "boolean", + "description": "If the users are allowed manage their own account security settings through a page or portal defined by their current authentication provider" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "The Tenant model represents the brand that provides the account.\r\nThis is used by our White Label partners to manage and brand their user accounts.\r\nUnless you are an admin for a White Label account you'll have no interest in this model." + }, + "TenantBillingSettings": { + "type": "object", + "properties": { + "discount": { + "type": "number", + "format": "double" + }, + "monthlyMinimum": { + "type": "number", + "format": "double" + }, + "aggregatedPricing": { + "type": "boolean" + }, + "billTo": { + "type": "string", + "description": "If all activity for a Tenant is being biulled to a specifc user, set the email address here", + "nullable": true + }, + "pricingTable": { + "type": "string", + "description": "If BillTo is set, then specify a Pricing Table to use from the Staffology tenant, otherwise the default Staffology Pricing Table will be used", + "format": "uuid", + "nullable": true + }, + "netSuiteDefaultItemCode": { + "type": "string", + "description": "[readonly] The item code used in the NetSuite billing if not specified in the pricing table", + "nullable": true + }, + "netSuiteDefaultDescription": { + "type": "string", + "description": "[readonly] The product description used in the NetSuite billing if not specified in the pricing table", + "nullable": true + } + }, + "additionalProperties": false + }, + "TenantEmail": { + "required": [ + "subject", + "toEmail", + "toName" + ], + "type": "object", + "properties": { + "toName": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "toEmail": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "subject": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "buttonText": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "buttonLink": { + "maxLength": 250, + "type": "string", + "nullable": true + }, + "bodyPreview": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "body": { + "type": "string", + "nullable": true + }, + "afterBtnBody": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusDate": { + "type": "string", + "format": "date-time" + }, + "statusMessage": { + "type": "string", + "nullable": true + }, + "sendAttempts": { + "type": "integer", + "format": "int32" + }, + "webAppBaseUrl": { + "type": "string", + "nullable": true + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmailAttachment" + }, + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "TenantHtmlInsertion": { + "type": "object", + "properties": { + "insertionPoint": { + "$ref": "#/components/schemas/HtmlInsertionPoint" + }, + "content": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TenantItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "metadata": { + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Represents a Tenant that the user account can administrate.\r\nUnless you are an admin for a White Label account you'll have no interest in this model." + }, + "TieredPension": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/PensionContributionLevelType" + }, + "rates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TieredPensionRate" + }, + "nullable": true + }, + "employerContribRate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate tiered pension contributions.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "TieredPensionRate": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "rangeStart": { + "type": "number", + "format": "double" + }, + "rate": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false, + "description": "Part of the TaxYearConfig that our engine uses to calculate tiered pension contributions.\r\nIt is used internally when our engine performs calculations.\r\nYou do not need to do anything with this model, it's provided purely for informational purposes." + }, + "UmbrellaPayment": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "description": "When importing multiple UmbrellaPayments this field is used to identify the employee", + "nullable": true + }, + "chargePerTimesheet": { + "type": "number", + "description": "Override the settings for this employer by specifying a ChargePerTimeSheet.\r\nOr leave it as null to use the settings from the Employer", + "format": "double", + "nullable": true + }, + "invoiceValue": { + "type": "number", + "format": "double" + }, + "mapsMiles": { + "type": "integer", + "format": "int32" + }, + "otherExpenses": { + "type": "number", + "format": "double" + }, + "numberOfTimesheets": { + "type": "integer", + "format": "int32" + }, + "hoursWorked": { + "type": "number", + "format": "double" + }, + "grossDeduction": { + "type": "number", + "format": "double" + }, + "grossAddition": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "UmbrellaReconciliationReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UmbrellaReconciliationReportLine" + }, + "nullable": true + }, + "employer": { + "$ref": "#/components/schemas/Item" + }, + "payPeriod": { + "$ref": "#/components/schemas/PayPeriods" + }, + "ordinal": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "integer", + "format": "int32" + }, + "periodTo": { + "type": "integer", + "format": "int32" + }, + "startPeriodName": { + "type": "string", + "nullable": true + }, + "endPeriodName": { + "type": "string", + "nullable": true + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "UmbrellaReconciliationReportLine": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "period": { + "type": "string", + "nullable": true + }, + "payrollCode": { + "type": "string", + "nullable": true + }, + "department": { + "type": "string", + "nullable": true + }, + "totalGross": { + "type": "number", + "format": "double" + }, + "netPay": { + "type": "number", + "format": "double" + }, + "tax": { + "type": "number", + "format": "double" + }, + "employeeNi": { + "type": "number", + "format": "double" + }, + "employerNi": { + "type": "number", + "format": "double" + }, + "employeePension": { + "type": "number", + "format": "double" + }, + "employerPension": { + "type": "number", + "format": "double" + }, + "expenses": { + "type": "number", + "format": "double" + }, + "fee": { + "type": "number", + "format": "double" + }, + "appLevy": { + "type": "number", + "format": "double" + }, + "invoiceValue": { + "type": "number", + "format": "double" + }, + "employeeCosts": { + "type": "number", + "format": "double", + "readOnly": true + }, + "employerCosts": { + "type": "number", + "format": "double", + "readOnly": true + }, + "total": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "UmbrellaReconciliationReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/UmbrellaReconciliationReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "UmbrellaSettings": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "chargePerTimesheet": { + "type": "number", + "format": "double" + }, + "apprenticeshipLevyDednRate": { + "type": "number", + "format": "double" + }, + "holidayRate": { + "type": "number", + "format": "double" + }, + "dpsbCode": { + "type": "string", + "nullable": true + }, + "expensesCode": { + "type": "string", + "nullable": true + }, + "grossDeductionCode": { + "type": "string", + "nullable": true + }, + "holidayCode": { + "type": "string", + "nullable": true + }, + "cisFeeCode": { + "type": "string", + "nullable": true + }, + "detailFeeInComment": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "UsageBill": { + "type": "object", + "properties": { + "year": { + "type": "integer", + "format": "int32" + }, + "month": { + "type": "integer", + "format": "int32" + }, + "payslipCount": { + "type": "integer", + "format": "int32" + }, + "previouslyBilledPayslipCount": { + "type": "integer", + "description": "The number of payslips that appear in the usage, but were billed in a previous period", + "format": "int32" + }, + "netCost": { + "type": "number", + "description": "Net cost of any payslips, or the Pricing Table minimum, whichever is greater.", + "format": "double" + }, + "discount": { + "type": "number", + "format": "double" + }, + "partnerDiscountAmount": { + "type": "number", + "format": "double" + }, + "monthlyMinimum": { + "type": "number", + "description": "This is actually an offset against the NetCost and doesn't contain the full MonthlyMinimum.", + "format": "double" + }, + "total": { + "type": "number", + "format": "double", + "readOnly": true + }, + "paid": { + "type": "boolean" + }, + "usage": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "nullable": true + }, + "accountingCustomerId": { + "type": "string", + "nullable": true + }, + "accountingInvoiceId": { + "type": "string", + "nullable": true + }, + "accountingInvoiceLink": { + "type": "string", + "nullable": true + }, + "useNetSuite": { + "type": "boolean" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "User": { + "type": "object", + "properties": { + "category": { + "$ref": "#/components/schemas/UserCategory" + }, + "emailAddress": { + "maxLength": 150, + "type": "string", + "format": "email", + "nullable": true + }, + "pendingEmailAddress": { + "maxLength": 150, + "type": "string", + "description": "If the user has requested to change their email address then the \r\naddress it'll be changed to after verification will be shown here.", + "format": "email", + "nullable": true + }, + "firstName": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "lastName": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "salutation": { + "maxLength": 35, + "pattern": "^[A-Za-z '\\-]{1,35}$", + "type": "string", + "nullable": true + }, + "userIdentifier": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "photo": { + "maxLength": 1000, + "type": "string", + "nullable": true + }, + "photoSasUrl": { + "type": "string", + "nullable": true + }, + "role": { + "$ref": "#/components/schemas/UserRole" + }, + "jobType": { + "$ref": "#/components/schemas/UserJobType" + }, + "jobTitle": { + "maxLength": 150, + "type": "string", + "nullable": true + }, + "telephoneNumber": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "businessName": { + "maxLength": 160, + "pattern": "^[A-Za-z0-9 ,;:'£()\\-\\.\\@\\$\\&]{1,160}$", + "type": "string", + "nullable": true + }, + "industry": { + "$ref": "#/components/schemas/UserIndustry" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "statedEmployeeCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "emailVerified": { + "type": "boolean" + }, + "emailVerificationKey": { + "type": "string", + "format": "uuid" + }, + "gdprOptin": { + "type": "boolean" + }, + "inviteCode": { + "type": "string", + "nullable": true + }, + "registrationIp": { + "maxLength": 20, + "type": "string", + "nullable": true + }, + "registrationDate": { + "type": "string", + "format": "date" + }, + "lastLogin": { + "type": "string", + "format": "date", + "nullable": true + }, + "isActivated": { + "type": "boolean" + }, + "authorization": { + "$ref": "#/components/schemas/UserAuthorization" + }, + "isSuperAdmin": { + "type": "boolean" + }, + "canUseBureauFeatures": { + "type": "boolean" + }, + "canUseBetaFeatures": { + "type": "boolean" + }, + "canUseReportWriter": { + "type": "boolean", + "description": "Indicates whether the user has permission to use the report writer feature." + }, + "isBilledInNetSuite": { + "type": "boolean" + }, + "tenant": { + "$ref": "#/components/schemas/Tenant" + }, + "requestDdSetup": { + "type": "boolean", + "description": "[readonly] If true then the user is required to set up a direct debit mandate" + }, + "disabled": { + "type": "boolean", + "description": "[readonly] If true then any employers the owner managed will not be able to run new payruns.\r\nDisabledReason will give a reason why the account is disabled" + }, + "canCreateEmployers": { + "type": "boolean", + "description": "[readonly] If false then the user cannot create new employers.\r\nThis can be turned on or off by the tenant admin." + }, + "disabledReason": { + "type": "string", + "nullable": true + }, + "directDebitMandate": { + "$ref": "#/components/schemas/DirectDebitMandate" + }, + "displayPrefs": { + "$ref": "#/components/schemas/UserDisplayPreferences" + }, + "showBills": { + "type": "boolean", + "description": "[readonly] Whether or not the user can see bills. This will be false if the Tenant manages billing and the user is not an admin for the Tenant", + "nullable": true + }, + "accountingCustomerId": { + "type": "string", + "description": "[readonly] Used internally to manage billing", + "nullable": true + }, + "pricingTableId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "utmInfo": { + "$ref": "#/components/schemas/UtmInfo" + }, + "firstBillableActivityDate": { + "type": "string", + "format": "date", + "nullable": true + }, + "bureauNotificationEmailAddress": { + "maxLength": 150, + "type": "string", + "description": "If an email address is provided here then Bureau-related notifications will go to this address instead of the EmailAddress", + "format": "email", + "nullable": true + }, + "monthlyMinimum": { + "$ref": "#/components/schemas/MonthlyMinimum" + }, + "apiMailingEnabled": { + "type": "boolean", + "description": "Flag to keep the user up-to-date with any API changes and inform about upcoming breaking changes." + }, + "loginDisabled": { + "type": "boolean", + "description": "[readonly] If true then the user will not have login permissions" + }, + "isBureauMember": { + "type": "boolean", + "description": "Indicates whether the user is a bureau member." + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Represents a User Account.\r\nAs well as basic details about the user it also includes details of Employers that the user account can access." + }, + "UserAuthorization": { + "type": "object", + "properties": { + "employers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployerItem" + }, + "description": "[readonly] A list of any Employers that the user can access", + "nullable": true + }, + "tenants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantItem" + }, + "description": "[readonly] A list of any Tenants that the user can administrate", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This model provides information about what the User is able to access.\r\nThis would usually just be a list of Employers. But if the user is an administrator for a White Label instance then this will be shown in the list of Tenants." + }, + "UserCategory": { + "enum": [ + "ActiveTrialist", + "AgedActiveTrialist", + "LapsedTrialist", + "ActiveCustomer", + "LapsedCustomer", + "SubUser", + "AgedActiveTrialistAndSubUser", + "InternalUser" + ], + "type": "string" + }, + "UserDisplayPreferences": { + "type": "object", + "properties": { + "startPage": { + "$ref": "#/components/schemas/UserstartPage" + }, + "showZeroes": { + "type": "boolean" + }, + "showTaxCodeWhenViewingPayrunEntry": { + "type": "boolean" + }, + "allowJournalResubmit": { + "type": "boolean" + }, + "hideSalaryOnEmployeeIndexPage": { + "type": "boolean" + }, + "enableMultiEmployerImport": { + "type": "boolean" + }, + "enableCovid19Features": { + "type": "boolean" + }, + "hidePayslipCheckboxes": { + "type": "boolean" + }, + "hidePayslipSearchAndSort": { + "type": "boolean" + }, + "showYtdInPayslipView": { + "type": "boolean" + }, + "enableDpsXmlUpload": { + "type": "boolean" + }, + "enableRtiTimestampOverride": { + "type": "boolean" + }, + "enablePayrunWarnings": { + "type": "boolean" + }, + "enableWorkingDaysOverrides": { + "type": "boolean" + }, + "enablePayrunPagination": { + "type": "boolean" + }, + "dontHideFpsEmployeeList": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "UserIndustry": { + "enum": [ + "NotSpecified", + "Agriculture", + "Apparel", + "Banking", + "Biotechnology", + "Chemicals", + "Communication", + "Construction", + "Consulting", + "Education", + "Engineering", + "Entertainment", + "Environmental", + "Finance", + "FoodAndBeverage", + "Government", + "Healthcare", + "Hospitality", + "Insurance", + "Legal", + "Machinery", + "Manufacturing", + "Media", + "NotForProfit", + "Other", + "Recreation", + "Retail", + "Shipping", + "Technology", + "Telecommunications", + "Transportation", + "Utilities" + ], + "type": "string" + }, + "UserJobType": { + "enum": [ + "BusinessOwner", + "PayrollManager", + "Accountant", + "Developer", + "SoftwareVendor", + "Other" + ], + "type": "string" + }, + "UserRole": { + "enum": [ + "Admin", + "Editor", + "Reviewer", + "PayrollClientApprover", + "PayrollClientEditor", + "PayrollClientReviewer" + ], + "type": "string" + }, + "UserstartPage": { + "enum": [ + "Dashboard", + "EmployerList", + "EmployeeList", + "Payroll", + "Rti", + "BureauDashboard" + ], + "type": "string" + }, + "UtmInfo": { + "type": "object", + "properties": { + "source": { + "type": "string", + "nullable": true + }, + "medium": { + "type": "string", + "nullable": true + }, + "term": { + "type": "string", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + }, + "campaign": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ValueOverride": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/PayrollValueType" + }, + "value": { + "type": "number", + "description": "The value to use in place of the original value", + "format": "double" + }, + "originalValue": { + "type": "number", + "description": "[readonly] The original value", + "format": "double" + }, + "note": { + "maxLength": 150, + "type": "string", + "description": "The reason given for the override", + "nullable": true + }, + "attachmentOrderId": { + "type": "string", + "description": "The Id of the AttachmentOrder. Only relevant if the Type is set to AttachmentOrderDeductions", + "format": "uuid", + "nullable": true + }, + "pensionId": { + "type": "string", + "description": "The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS", + "format": "uuid", + "nullable": true + }, + "leaveId": { + "type": "string", + "description": "The Id of the associated Leave.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "VarianceReport": { + "type": "object", + "properties": { + "showDifferenceAsPercentage": { + "type": "boolean" + }, + "minimumChangePercentage": { + "type": "number", + "format": "double" + }, + "primary": { + "$ref": "#/components/schemas/GrossToNetReport" + }, + "secondary": { + "$ref": "#/components/schemas/GrossToNetReport" + }, + "joiners": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrossToNetReportLine" + }, + "nullable": true, + "readOnly": true + }, + "leavers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrossToNetReportLine" + }, + "nullable": true, + "readOnly": true + }, + "hasDepartments": { + "type": "boolean", + "readOnly": true + }, + "commonLines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GrossToNetReportLine" + }, + "nullable": true, + "readOnly": true + }, + "hasVariances": { + "type": "boolean", + "readOnly": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VarianceReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/VarianceReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "VeteranDetails": { + "type": "object", + "properties": { + "isVeteran": { + "type": "boolean", + "description": "Set to true if the employee is a veteran" + }, + "firstCivilianEmploymentDate": { + "type": "string", + "description": "Date of Veteran's first civilian employment", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Employment details for veterans" + }, + "WarningsReport": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WarningsReportLine" + }, + "nullable": true + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + } + }, + "additionalProperties": false + }, + "WarningsReportLine": { + "type": "object", + "properties": { + "payrollCode": { + "type": "string", + "nullable": true + }, + "employeeName": { + "type": "string", + "nullable": true + }, + "warningType": { + "$ref": "#/components/schemas/PayRunEntryWarningType" + }, + "warningMessage": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "WarningsReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/WarningsReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "Webhook": { + "required": [ + "url" + ], + "type": "object", + "properties": { + "webhookEvent": { + "$ref": "#/components/schemas/WebhookEvent" + }, + "url": { + "maxLength": 300, + "minLength": 1, + "type": "string", + "description": "The Url to which the payload should be sent", + "format": "uri" + }, + "active": { + "type": "boolean", + "description": "If set to false then this Webhook will not be triggered" + }, + "eventCount": { + "type": "integer", + "description": "The number of times this webhook has been triggered", + "format": "int32" + }, + "lastPayload": { + "$ref": "#/components/schemas/WebhookPayload" + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "WebhookEvent": { + "enum": [ + "Employee_Created", + "Employee_Updated", + "Employee_Deleted", + "Payrun_Finalised", + "Payrun_StateChanged", + "PensionMembership_Created", + "PensionMembership_Updated", + "PensionMembership_Deleted", + "JobCompleted" + ], + "type": "string" + }, + "WebhookPayload": { + "required": [ + "url" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 150, + "type": "string", + "description": "[readonly] A descriptive name for this payload", + "nullable": true + }, + "url": { + "maxLength": 300, + "minLength": 1, + "type": "string", + "description": "[readonly] The Url that payload will be sent to", + "format": "uri" + }, + "attempts": { + "type": "integer", + "description": "[readonly] The number of attempts that have been made to deliver this payload", + "format": "int32" + }, + "statusCode": { + "type": "integer", + "description": "[readonly] The status code received from the Url", + "format": "int32" + }, + "taskStatus": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "statusMessage": { + "maxLength": 150, + "type": "string", + "description": "[readonly] A message to accompany the status", + "nullable": true + }, + "created": { + "type": "string", + "description": "[readonly] The date and time this payload was created", + "format": "date", + "readOnly": true + }, + "payload": { + "description": "[readonly] the JSON payload that will be sent to the URl", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "WorkerGroup": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 150, + "minLength": 1, + "type": "string" + }, + "contributionLevelType": { + "$ref": "#/components/schemas/PensionContributionLevelType" + }, + "employeeContribution": { + "type": "number", + "format": "double" + }, + "employeeContributionIsPercentage": { + "type": "boolean" + }, + "employerContribution": { + "type": "number", + "format": "double" + }, + "employerContributionIsPercentage": { + "type": "boolean" + }, + "employerContributionTopUpPercentage": { + "type": "number", + "description": "Increase Employer Contribution by this percentage of the Employee Contribution", + "format": "double" + }, + "employerContributionIncludesNiSaving": { + "type": "boolean", + "description": "Employer Contribution includes the Employers NI saving" + }, + "employerContributionNiSavingPercentage": { + "type": "number", + "description": "Increase Employer Contribution by this percentage of the Employers NI saving", + "format": "double" + }, + "isAvc": { + "type": "boolean", + "description": "Determines whether the workergroup uses additonal voluntary contributions.\r\nThis property will automatically be set to true for the following Contribution Level Types: TpFasterAccrual, TpAdditionalPensionContributions, TpActuariallyAdjustedBenefits, TpFamilyBenefits, tpPastAddedYears, tpHigherSalaries, tpPreston, tpElectedFurtherEmployment, LgpsAdditionalPensionContributions, LgpsSharedAdditionalPensionContributions, LgpsAdditionalRegularContributions, LgpsAddedYearsContributions, LgpsSharedAdditionalPensionLumpSump, LgpsPartTimeBuyBack, PrudentialAVC." + }, + "additionalVoluntaryContribution": { + "type": "number", + "description": "Any additional voluntary amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage.", + "format": "double", + "nullable": true + }, + "avcIsPercentage": { + "type": "boolean", + "description": "Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage,", + "nullable": true + }, + "employerContributionNiSaving": { + "type": "number", + "description": "Employers NI Saving", + "format": "double" + }, + "customThreshold": { + "type": "boolean" + }, + "lowerLimit": { + "type": "number", + "format": "double" + }, + "upperLimit": { + "type": "number", + "format": "double" + }, + "papdisGroup": { + "maxLength": 40, + "type": "string", + "nullable": true + }, + "papdisSubGroup": { + "maxLength": 40, + "type": "string", + "nullable": true + }, + "localAuthorityNumber": { + "maxLength": 3, + "pattern": "^(\\d{3})$", + "type": "string", + "description": "Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales", + "nullable": true + }, + "schoolEmployerType": { + "maxLength": 4, + "pattern": "^(\\d{4})$", + "type": "string", + "description": "Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales", + "nullable": true + }, + "matIdentifier": { + "maxLength": 3, + "pattern": "^(\\d{3}|)$", + "type": "string", + "description": "Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales", + "nullable": true + }, + "matUniqueNumber": { + "maxLength": 4, + "pattern": "^(\\d{4}|)$", + "type": "string", + "description": "Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales", + "nullable": true + }, + "employerReference": { + "type": "string", + "nullable": true + }, + "lgpsFund": { + "$ref": "#/components/schemas/LgpsFund" + }, + "workerGroupId": { + "type": "string", + "description": "[readonly]", + "format": "uuid" + }, + "assumedPensionablePay": { + "$ref": "#/components/schemas/AssumedPensionablePay" + }, + "pensionablePayDefinition": { + "$ref": "#/components/schemas/PensionablePayDefinition" + }, + "payslipDescription": { + "maxLength": 100, + "type": "string", + "description": "Used for overwriting the pension description that is displayed on the payslip", + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "WorkingPattern": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "mon": { + "type": "number", + "format": "double" + }, + "tue": { + "type": "number", + "format": "double" + }, + "wed": { + "type": "number", + "format": "double" + }, + "thu": { + "type": "number", + "format": "double" + }, + "fri": { + "type": "number", + "format": "double" + }, + "sat": { + "type": "number", + "format": "double" + }, + "sun": { + "type": "number", + "format": "double" + }, + "contractedWeeks": { + "pattern": "^([0-9]|[1234][0-9]|5[0-2])(\\.\\d{0,6})?$", + "type": "number", + "description": "The amount of weeks an employee works, utilise for employees who aren't working full time.\r\nIf Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedWeeks": { + "pattern": "^(52)(\\.\\d{0,6})?$", + "type": "number", + "description": "The amount of weeks an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "fullTimeContractedHours": { + "type": "number", + "description": "The amount of hours an employee works (Full Time). If Null then the default is used.", + "format": "double", + "nullable": true + }, + "bankHolidays": { + "$ref": "#/components/schemas/BankHolidayCollection" + }, + "proRataRule": { + "$ref": "#/components/schemas/ProRataRule" + }, + "bankHolidayDates": { + "type": "array", + "items": { + "type": "string", + "format": "date-time" + }, + "description": "[readonly] The dates that are classed as Bank Holidays for this WorkingPattern", + "nullable": true + }, + "workingPatternHoursType": { + "$ref": "#/components/schemas/WorkingPatternHoursType" + }, + "isDefault": { + "type": "boolean" + }, + "effectiveFrom": { + "type": "string", + "description": "The date when the assignment of the Working Pattern becomes effective.\r\nRequired for a Shift WorkingPattern to determine when it starts", + "format": "date", + "nullable": true + }, + "workingPatternType": { + "$ref": "#/components/schemas/WorkingPatternType" + }, + "shiftWorkingPatternDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShiftWorkingPatternDay" + }, + "nullable": true + }, + "id": { + "type": "string", + "description": "[readonly] The unique id of the object", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false + }, + "WorkingPatternHoursType": { + "enum": [ + "HoursPerDay", + "HoursPerWeek", + "HoursPerPattern" + ], + "type": "string" + }, + "WorkingPatternType": { + "enum": [ + "Standard", + "Shift" + ], + "type": "string" + }, + "YearEnd": { + "type": "object", + "properties": { + "endingYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "startingYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "createEpsForFinalSubmission": { + "type": "boolean", + "description": "[readonly] Whether or not the system will automatically create an EPS to tell HMRC the year has ended." + }, + "createEpsForEmploymentAllowance": { + "type": "boolean", + "description": "[readonly] Whether or not the system will automatically create an EPS to tell HMRC you qualify for Employment Allowance." + }, + "createExb": { + "type": "boolean", + "description": "[readonly] Whether or not the system will automatically create an EXB to inform HMRC of Expenses and Benefits" + }, + "setEmploymentAllowance": { + "type": "number", + "description": "[readonly] If the Employment Allowance needs to be changed, this indicates the new value", + "format": "double", + "nullable": true + }, + "taxCodeChanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/YearEndTaxCodeChange" + }, + "description": "[readonly] Details of changes that wil be made to Tax Codes", + "nullable": true + }, + "removeWeek1Month1": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] Employees that will have the Week1Month1 flag removed from their tax code", + "nullable": true + }, + "emailP60": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] Employees who will be automatically emailed P60s", + "nullable": true + }, + "pushP60": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalDataProviderId" + }, + "description": "[readonly] ExternalDataProviderIds to which P60s can be pushed", + "nullable": true + }, + "emailCisStatement": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "[readonly] Subcontractors who will be automatically sent an annual CIS Statement", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This model gives you a summary of what will happen when you confirm the closing of one year and the start of the next" + }, + "YearEndTaxCodeChange": { + "type": "object", + "properties": { + "employee": { + "$ref": "#/components/schemas/Item" + }, + "currentCode": { + "type": "string", + "description": "[readonly] The Employees current tax code", + "nullable": true + }, + "newCode": { + "type": "string", + "description": "[readonly] The new TaxCode for the employee", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Forms part of the YearEnd model to list changes to Tax Codes" + }, + "YtdReport": { + "type": "object", + "properties": { + "payrun": { + "$ref": "#/components/schemas/PayRun" + }, + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeYtdValues" + }, + "nullable": true + }, + "report": { + "$ref": "#/components/schemas/Report" + }, + "taxYear": { + "$ref": "#/components/schemas/TaxYear" + }, + "title": { + "type": "string", + "nullable": true + }, + "isDraft": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "YtdReportReportResponse": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "[readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report", + "nullable": true + }, + "content": { + "type": "string", + "description": "[readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value.", + "nullable": true + }, + "model": { + "$ref": "#/components/schemas/YtdReport" + }, + "stream": { + "type": "string", + "description": "byte array", + "format": "byte", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to encapsulate a response for any of the reports.\r\nSee the Introduction Guide for Reports for more details" + }, + "YtdValue": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/PayrollValueType" + }, + "broughtForward": { + "type": "number", + "format": "double" + }, + "period": { + "type": "number", + "format": "double" + }, + "value": { + "type": "number", + "format": "double", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ZeroPaidFilter": { + "enum": [ + "NegativePaid", + "ZeroPaid", + "NonZeroPaid" + ], + "type": "string" + } + }, + "securitySchemes": { + "Basic": { + "type": "http", + "description": "If you have an API Key then enter is as the password.
The username can be anything you like.", + "scheme": "basic" + } + } + }, + "security": [ + { + "Basic": [ ] + }, + { + "oauth2": [ + "openid", + "profile", + "email" + ] + } + ] +} \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..1135449 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./src/Api + ./src/Model + + + + + ./tests/Api + ./tests/Model + + + + + + diff --git a/src/Api/AccountApi.php b/src/Api/AccountApi.php new file mode 100644 index 0000000..ec8151c --- /dev/null +++ b/src/Api/AccountApi.php @@ -0,0 +1,5412 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'changeEmailAddressAccount' => [ + 'application/json', + ], + 'createApiKeyAccount' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createDemoEmployerAccount' => [ + 'application/json', + ], + 'deleteApiKeyAccount' => [ + 'application/json', + ], + 'getAccount' => [ + 'application/json', + ], + 'getApiKeyAccount' => [ + 'application/json', + ], + 'getEmployerDefaultsAccount' => [ + 'application/json', + ], + 'getInvitationsAccount' => [ + 'application/json', + ], + 'getTenantAccount' => [ + 'application/json', + ], + 'getUserEmployersAccount' => [ + 'application/json', + ], + 'listApiKeysAccount' => [ + 'application/json', + ], + 'profileAccount' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setEmployerDefaultsAccount' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePhotoAccount' => [ + 'multipart/form-data', + ], + 'verifyAccount' => [ + 'application/json', + ], + 'verifyResponseAccount' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation activateAccount + * + * Activate an Account + * + * @param string|null $brandCode brandCode (optional) + * @param bool|null $autoActivate If autoActivate is set to true, the account activation should be automatically performed without any user interaction (optional, default to false) + * @param \SynergiTech\Staffology\Model\User|null $user user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['activateAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function activateAccount( + ?string $brandCode = null, + ?bool $autoActivate = false, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['activateAccount'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->activateAccountWithHttpInfo($brandCode, $autoActivate, $user, $contentType); + return $response; + } + + /** + * Operation activateAccountWithHttpInfo + * + * Activate an Account + * + * @param string|null $brandCode (optional) + * @param bool|null $autoActivate If autoActivate is set to true, the account activation should be automatically performed without any user interaction (optional, default to false) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['activateAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function activateAccountWithHttpInfo( + ?string $brandCode = null, + ?bool $autoActivate = false, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['activateAccount'][0] + ): array + { + $request = $this->activateAccountRequest($brandCode, $autoActivate, $user, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation activateAccountAsync + * + * Activate an Account + * + * @param string|null $brandCode (optional) + * @param bool|null $autoActivate If autoActivate is set to true, the account activation should be automatically performed without any user interaction (optional, default to false) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['activateAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function activateAccountAsync( + ?string $brandCode = null, + ?bool $autoActivate = false, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['activateAccount'][0] + ): PromiseInterface + { + return $this->activateAccountAsyncWithHttpInfo($brandCode, $autoActivate, $user, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation activateAccountAsyncWithHttpInfo + * + * Activate an Account + * + * @param string|null $brandCode (optional) + * @param bool|null $autoActivate If autoActivate is set to true, the account activation should be automatically performed without any user interaction (optional, default to false) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['activateAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function activateAccountAsyncWithHttpInfo( + $brandCode = null, + $autoActivate = false, + $user = null, + string $contentType = self::contentTypes['activateAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->activateAccountRequest($brandCode, $autoActivate, $user, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'activateAccount' + * + * @param string|null $brandCode (optional) + * @param bool|null $autoActivate If autoActivate is set to true, the account activation should be automatically performed without any user interaction (optional, default to false) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['activateAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function activateAccountRequest( + $brandCode = null, + $autoActivate = false, + $user = null, + string $contentType = self::contentTypes['activateAccount'][0] + ): Request + { + + + + + + $resourcePath = '/account/activate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $brandCode, + 'brandCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $autoActivate, + 'autoActivate', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($user)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($user)); + } else { + $httpBody = $user; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation changeEmailAddressAccount + * + * Change Email Address + * + * @param string|null $emailAddress emailAddress (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeEmailAddressAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function changeEmailAddressAccount( + ?string $emailAddress = null, + string $contentType = self::contentTypes['changeEmailAddressAccount'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->changeEmailAddressAccountWithHttpInfo($emailAddress, $contentType); + return $response; + } + + /** + * Operation changeEmailAddressAccountWithHttpInfo + * + * Change Email Address + * + * @param string|null $emailAddress (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeEmailAddressAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function changeEmailAddressAccountWithHttpInfo( + ?string $emailAddress = null, + string $contentType = self::contentTypes['changeEmailAddressAccount'][0] + ): array + { + $request = $this->changeEmailAddressAccountRequest($emailAddress, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation changeEmailAddressAccountAsync + * + * Change Email Address + * + * @param string|null $emailAddress (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeEmailAddressAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changeEmailAddressAccountAsync( + ?string $emailAddress = null, + string $contentType = self::contentTypes['changeEmailAddressAccount'][0] + ): PromiseInterface + { + return $this->changeEmailAddressAccountAsyncWithHttpInfo($emailAddress, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation changeEmailAddressAccountAsyncWithHttpInfo + * + * Change Email Address + * + * @param string|null $emailAddress (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeEmailAddressAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changeEmailAddressAccountAsyncWithHttpInfo( + $emailAddress = null, + string $contentType = self::contentTypes['changeEmailAddressAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->changeEmailAddressAccountRequest($emailAddress, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'changeEmailAddressAccount' + * + * @param string|null $emailAddress (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changeEmailAddressAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function changeEmailAddressAccountRequest( + $emailAddress = null, + string $contentType = self::contentTypes['changeEmailAddressAccount'][0] + ): Request + { + + + + $resourcePath = '/account/emailaddress'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $emailAddress, + 'emailAddress', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createApiKeyAccount + * + * Create ApiKey + * + * @param \SynergiTech\Staffology\Model\Item|null $item item (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item + */ + public function createApiKeyAccount( + ?\SynergiTech\Staffology\Model\Item $item = null, + string $contentType = self::contentTypes['createApiKeyAccount'][0] + ): \SynergiTech\Staffology\Model\Item + { + list($response) = $this->createApiKeyAccountWithHttpInfo($item, $contentType); + return $response; + } + + /** + * Operation createApiKeyAccountWithHttpInfo + * + * Create ApiKey + * + * @param \SynergiTech\Staffology\Model\Item|null $item (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item, HTTP status code, HTTP response headers (array of strings) + */ + public function createApiKeyAccountWithHttpInfo( + ?\SynergiTech\Staffology\Model\Item $item = null, + string $contentType = self::contentTypes['createApiKeyAccount'][0] + ): array + { + $request = $this->createApiKeyAccountRequest($item, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Item', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createApiKeyAccountAsync + * + * Create ApiKey + * + * @param \SynergiTech\Staffology\Model\Item|null $item (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createApiKeyAccountAsync( + ?\SynergiTech\Staffology\Model\Item $item = null, + string $contentType = self::contentTypes['createApiKeyAccount'][0] + ): PromiseInterface + { + return $this->createApiKeyAccountAsyncWithHttpInfo($item, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createApiKeyAccountAsyncWithHttpInfo + * + * Create ApiKey + * + * @param \SynergiTech\Staffology\Model\Item|null $item (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createApiKeyAccountAsyncWithHttpInfo( + $item = null, + string $contentType = self::contentTypes['createApiKeyAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item'; + $request = $this->createApiKeyAccountRequest($item, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createApiKeyAccount' + * + * @param \SynergiTech\Staffology\Model\Item|null $item (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createApiKeyAccountRequest( + $item = null, + string $contentType = self::contentTypes['createApiKeyAccount'][0] + ): Request + { + + + + $resourcePath = '/account/keys'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($item)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($item)); + } else { + $httpBody = $item; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createDemoEmployerAccount + * + * Create Demo Employer + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDemoEmployerAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createDemoEmployerAccount( + string $contentType = self::contentTypes['createDemoEmployerAccount'][0] + ): void + { + $this->createDemoEmployerAccountWithHttpInfo($contentType); + } + + /** + * Operation createDemoEmployerAccountWithHttpInfo + * + * Create Demo Employer + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDemoEmployerAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createDemoEmployerAccountWithHttpInfo( + string $contentType = self::contentTypes['createDemoEmployerAccount'][0] + ): array + { + $request = $this->createDemoEmployerAccountRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createDemoEmployerAccountAsync + * + * Create Demo Employer + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDemoEmployerAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDemoEmployerAccountAsync( + string $contentType = self::contentTypes['createDemoEmployerAccount'][0] + ): PromiseInterface + { + return $this->createDemoEmployerAccountAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDemoEmployerAccountAsyncWithHttpInfo + * + * Create Demo Employer + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDemoEmployerAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDemoEmployerAccountAsyncWithHttpInfo( + string $contentType = self::contentTypes['createDemoEmployerAccount'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createDemoEmployerAccountRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDemoEmployerAccount' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDemoEmployerAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDemoEmployerAccountRequest( + string $contentType = self::contentTypes['createDemoEmployerAccount'][0] + ): Request + { + + + $resourcePath = '/account/demo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteApiKeyAccount + * + * Delete ApiKey + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteApiKeyAccount( + string $id, + string $contentType = self::contentTypes['deleteApiKeyAccount'][0] + ): void + { + $this->deleteApiKeyAccountWithHttpInfo($id, $contentType); + } + + /** + * Operation deleteApiKeyAccountWithHttpInfo + * + * Delete ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteApiKeyAccountWithHttpInfo( + string $id, + string $contentType = self::contentTypes['deleteApiKeyAccount'][0] + ): array + { + $request = $this->deleteApiKeyAccountRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteApiKeyAccountAsync + * + * Delete ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteApiKeyAccountAsync( + string $id, + string $contentType = self::contentTypes['deleteApiKeyAccount'][0] + ): PromiseInterface + { + return $this->deleteApiKeyAccountAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteApiKeyAccountAsyncWithHttpInfo + * + * Delete ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteApiKeyAccountAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['deleteApiKeyAccount'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteApiKeyAccountRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteApiKeyAccount' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteApiKeyAccountRequest( + $id, + string $contentType = self::contentTypes['deleteApiKeyAccount'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteApiKeyAccount' + ); + } + + + $resourcePath = '/account/keys/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAccount + * + * Get Account Details + * + * @param string|null $defaults You can leave this empty, it's for internal use only. (optional) + * @param string|null $defaultsKey You can leave this empty, it's for internal use only. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function getAccount( + ?string $defaults = null, + ?string $defaultsKey = null, + string $contentType = self::contentTypes['getAccount'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->getAccountWithHttpInfo($defaults, $defaultsKey, $contentType); + return $response; + } + + /** + * Operation getAccountWithHttpInfo + * + * Get Account Details + * + * @param string|null $defaults You can leave this empty, it's for internal use only. (optional) + * @param string|null $defaultsKey You can leave this empty, it's for internal use only. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function getAccountWithHttpInfo( + ?string $defaults = null, + ?string $defaultsKey = null, + string $contentType = self::contentTypes['getAccount'][0] + ): array + { + $request = $this->getAccountRequest($defaults, $defaultsKey, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAccountAsync + * + * Get Account Details + * + * @param string|null $defaults You can leave this empty, it's for internal use only. (optional) + * @param string|null $defaultsKey You can leave this empty, it's for internal use only. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAccountAsync( + ?string $defaults = null, + ?string $defaultsKey = null, + string $contentType = self::contentTypes['getAccount'][0] + ): PromiseInterface + { + return $this->getAccountAsyncWithHttpInfo($defaults, $defaultsKey, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAccountAsyncWithHttpInfo + * + * Get Account Details + * + * @param string|null $defaults You can leave this empty, it's for internal use only. (optional) + * @param string|null $defaultsKey You can leave this empty, it's for internal use only. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAccountAsyncWithHttpInfo( + $defaults = null, + $defaultsKey = null, + string $contentType = self::contentTypes['getAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->getAccountRequest($defaults, $defaultsKey, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAccount' + * + * @param string|null $defaults You can leave this empty, it's for internal use only. (optional) + * @param string|null $defaultsKey You can leave this empty, it's for internal use only. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAccountRequest( + $defaults = null, + $defaultsKey = null, + string $contentType = self::contentTypes['getAccount'][0] + ): Request + { + + + + + $resourcePath = '/account'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $defaults, + 'defaults', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $defaultsKey, + 'defaultsKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiKeyAccount + * + * Get ApiKey + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item + */ + public function getApiKeyAccount( + string $id, + string $contentType = self::contentTypes['getApiKeyAccount'][0] + ): \SynergiTech\Staffology\Model\Item + { + list($response) = $this->getApiKeyAccountWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getApiKeyAccountWithHttpInfo + * + * Get ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiKeyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiKeyAccountWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getApiKeyAccount'][0] + ): array + { + $request = $this->getApiKeyAccountRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiKeyAccountAsync + * + * Get ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiKeyAccountAsync( + string $id, + string $contentType = self::contentTypes['getApiKeyAccount'][0] + ): PromiseInterface + { + return $this->getApiKeyAccountAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiKeyAccountAsyncWithHttpInfo + * + * Get ApiKey + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiKeyAccountAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getApiKeyAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item'; + $request = $this->getApiKeyAccountRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiKeyAccount' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiKeyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiKeyAccountRequest( + $id, + string $contentType = self::contentTypes['getApiKeyAccount'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getApiKeyAccount' + ); + } + + + $resourcePath = '/account/keys/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployerDefaultsAccount + * + * Get EmployerDefaults + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerDefaults + */ + public function getEmployerDefaultsAccount( + string $contentType = self::contentTypes['getEmployerDefaultsAccount'][0] + ): \SynergiTech\Staffology\Model\EmployerDefaults + { + list($response) = $this->getEmployerDefaultsAccountWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getEmployerDefaultsAccountWithHttpInfo + * + * Get EmployerDefaults + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerDefaults, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployerDefaultsAccountWithHttpInfo( + string $contentType = self::contentTypes['getEmployerDefaultsAccount'][0] + ): array + { + $request = $this->getEmployerDefaultsAccountRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerDefaults', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerDefaults' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerDefaults', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerDefaults'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerDefaults', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployerDefaultsAccountAsync + * + * Get EmployerDefaults + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerDefaultsAccountAsync( + string $contentType = self::contentTypes['getEmployerDefaultsAccount'][0] + ): PromiseInterface + { + return $this->getEmployerDefaultsAccountAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployerDefaultsAccountAsyncWithHttpInfo + * + * Get EmployerDefaults + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerDefaultsAccountAsyncWithHttpInfo( + string $contentType = self::contentTypes['getEmployerDefaultsAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerDefaults'; + $request = $this->getEmployerDefaultsAccountRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployerDefaultsAccount' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployerDefaultsAccountRequest( + string $contentType = self::contentTypes['getEmployerDefaultsAccount'][0] + ): Request + { + + + $resourcePath = '/account/employerdefaults'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getInvitationsAccount + * + * Get Invitations + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitationsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getInvitationsAccount( + string $contentType = self::contentTypes['getInvitationsAccount'][0] + ): array + { + list($response) = $this->getInvitationsAccountWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getInvitationsAccountWithHttpInfo + * + * Get Invitations + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitationsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getInvitationsAccountWithHttpInfo( + string $contentType = self::contentTypes['getInvitationsAccount'][0] + ): array + { + $request = $this->getInvitationsAccountRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getInvitationsAccountAsync + * + * Get Invitations + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitationsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getInvitationsAccountAsync( + string $contentType = self::contentTypes['getInvitationsAccount'][0] + ): PromiseInterface + { + return $this->getInvitationsAccountAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getInvitationsAccountAsyncWithHttpInfo + * + * Get Invitations + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitationsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getInvitationsAccountAsyncWithHttpInfo( + string $contentType = self::contentTypes['getInvitationsAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getInvitationsAccountRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getInvitationsAccount' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitationsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getInvitationsAccountRequest( + string $contentType = self::contentTypes['getInvitationsAccount'][0] + ): Request + { + + + $resourcePath = '/account/invitations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTenantAccount + * + * Get Tenant + * + * @param string|null $tenantId tenantId (optional) + * @param string|null $key key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function getTenantAccount( + ?string $tenantId = null, + ?string $key = null, + string $contentType = self::contentTypes['getTenantAccount'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->getTenantAccountWithHttpInfo($tenantId, $key, $contentType); + return $response; + } + + /** + * Operation getTenantAccountWithHttpInfo + * + * Get Tenant + * + * @param string|null $tenantId (optional) + * @param string|null $key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function getTenantAccountWithHttpInfo( + ?string $tenantId = null, + ?string $key = null, + string $contentType = self::contentTypes['getTenantAccount'][0] + ): array + { + $request = $this->getTenantAccountRequest($tenantId, $key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTenantAccountAsync + * + * Get Tenant + * + * @param string|null $tenantId (optional) + * @param string|null $key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantAccountAsync( + ?string $tenantId = null, + ?string $key = null, + string $contentType = self::contentTypes['getTenantAccount'][0] + ): PromiseInterface + { + return $this->getTenantAccountAsyncWithHttpInfo($tenantId, $key, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTenantAccountAsyncWithHttpInfo + * + * Get Tenant + * + * @param string|null $tenantId (optional) + * @param string|null $key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantAccountAsyncWithHttpInfo( + $tenantId = null, + $key = null, + string $contentType = self::contentTypes['getTenantAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->getTenantAccountRequest($tenantId, $key, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTenantAccount' + * + * @param string|null $tenantId (optional) + * @param string|null $key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTenantAccountRequest( + $tenantId = null, + $key = null, + string $contentType = self::contentTypes['getTenantAccount'][0] + ): Request + { + + + + + $resourcePath = '/account/Tenant'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tenantId, + 'tenantId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $key, + 'key', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserEmployersAccount + * + * List User Employers + * + * @param int|null $id The Id of the user you want a list of employers for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserEmployersAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerItem[] + */ + public function getUserEmployersAccount( + ?int $id = null, + string $contentType = self::contentTypes['getUserEmployersAccount'][0] + ): array + { + list($response) = $this->getUserEmployersAccountWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getUserEmployersAccountWithHttpInfo + * + * List User Employers + * + * @param int|null $id The Id of the user you want a list of employers for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserEmployersAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerItem[], HTTP status code, HTTP response headers (array of strings) + */ + public function getUserEmployersAccountWithHttpInfo( + ?int $id = null, + string $contentType = self::contentTypes['getUserEmployersAccount'][0] + ): array + { + $request = $this->getUserEmployersAccountRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerItem[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerItem[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerItem[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerItem[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerItem[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserEmployersAccountAsync + * + * List User Employers + * + * @param int|null $id The Id of the user you want a list of employers for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserEmployersAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUserEmployersAccountAsync( + ?int $id = null, + string $contentType = self::contentTypes['getUserEmployersAccount'][0] + ): PromiseInterface + { + return $this->getUserEmployersAccountAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserEmployersAccountAsyncWithHttpInfo + * + * List User Employers + * + * @param int|null $id The Id of the user you want a list of employers for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserEmployersAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUserEmployersAccountAsyncWithHttpInfo( + $id = null, + string $contentType = self::contentTypes['getUserEmployersAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerItem[]'; + $request = $this->getUserEmployersAccountRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserEmployersAccount' + * + * @param int|null $id The Id of the user you want a list of employers for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserEmployersAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUserEmployersAccountRequest( + $id = null, + string $contentType = self::contentTypes['getUserEmployersAccount'][0] + ): Request + { + + + + $resourcePath = '/account/useremployers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listApiKeysAccount + * + * List ApiKeys + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApiKeysAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listApiKeysAccount( + string $contentType = self::contentTypes['listApiKeysAccount'][0] + ): array + { + list($response) = $this->listApiKeysAccountWithHttpInfo($contentType); + return $response; + } + + /** + * Operation listApiKeysAccountWithHttpInfo + * + * List ApiKeys + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApiKeysAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listApiKeysAccountWithHttpInfo( + string $contentType = self::contentTypes['listApiKeysAccount'][0] + ): array + { + $request = $this->listApiKeysAccountRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listApiKeysAccountAsync + * + * List ApiKeys + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApiKeysAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listApiKeysAccountAsync( + string $contentType = self::contentTypes['listApiKeysAccount'][0] + ): PromiseInterface + { + return $this->listApiKeysAccountAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listApiKeysAccountAsyncWithHttpInfo + * + * List ApiKeys + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApiKeysAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listApiKeysAccountAsyncWithHttpInfo( + string $contentType = self::contentTypes['listApiKeysAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listApiKeysAccountRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listApiKeysAccount' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApiKeysAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listApiKeysAccountRequest( + string $contentType = self::contentTypes['listApiKeysAccount'][0] + ): Request + { + + + $resourcePath = '/account/keys'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation profileAccount + * + * Update Profile + * + * @param \SynergiTech\Staffology\Model\User|null $user user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['profileAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function profileAccount( + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['profileAccount'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->profileAccountWithHttpInfo($user, $contentType); + return $response; + } + + /** + * Operation profileAccountWithHttpInfo + * + * Update Profile + * + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['profileAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function profileAccountWithHttpInfo( + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['profileAccount'][0] + ): array + { + $request = $this->profileAccountRequest($user, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation profileAccountAsync + * + * Update Profile + * + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['profileAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function profileAccountAsync( + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['profileAccount'][0] + ): PromiseInterface + { + return $this->profileAccountAsyncWithHttpInfo($user, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation profileAccountAsyncWithHttpInfo + * + * Update Profile + * + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['profileAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function profileAccountAsyncWithHttpInfo( + $user = null, + string $contentType = self::contentTypes['profileAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->profileAccountRequest($user, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'profileAccount' + * + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['profileAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function profileAccountRequest( + $user = null, + string $contentType = self::contentTypes['profileAccount'][0] + ): Request + { + + + + $resourcePath = '/account/profile'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($user)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($user)); + } else { + $httpBody = $user; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEmployerDefaultsAccount + * + * Set EmployerDefaults + * + * @param \SynergiTech\Staffology\Model\EmployerDefaults|null $employerDefaults employerDefaults (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerDefaults + */ + public function setEmployerDefaultsAccount( + ?\SynergiTech\Staffology\Model\EmployerDefaults $employerDefaults = null, + string $contentType = self::contentTypes['setEmployerDefaultsAccount'][0] + ): \SynergiTech\Staffology\Model\EmployerDefaults + { + list($response) = $this->setEmployerDefaultsAccountWithHttpInfo($employerDefaults, $contentType); + return $response; + } + + /** + * Operation setEmployerDefaultsAccountWithHttpInfo + * + * Set EmployerDefaults + * + * @param \SynergiTech\Staffology\Model\EmployerDefaults|null $employerDefaults (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerDefaults, HTTP status code, HTTP response headers (array of strings) + */ + public function setEmployerDefaultsAccountWithHttpInfo( + ?\SynergiTech\Staffology\Model\EmployerDefaults $employerDefaults = null, + string $contentType = self::contentTypes['setEmployerDefaultsAccount'][0] + ): array + { + $request = $this->setEmployerDefaultsAccountRequest($employerDefaults, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerDefaults', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerDefaults' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerDefaults', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerDefaults'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerDefaults', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setEmployerDefaultsAccountAsync + * + * Set EmployerDefaults + * + * @param \SynergiTech\Staffology\Model\EmployerDefaults|null $employerDefaults (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployerDefaultsAccountAsync( + ?\SynergiTech\Staffology\Model\EmployerDefaults $employerDefaults = null, + string $contentType = self::contentTypes['setEmployerDefaultsAccount'][0] + ): PromiseInterface + { + return $this->setEmployerDefaultsAccountAsyncWithHttpInfo($employerDefaults, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEmployerDefaultsAccountAsyncWithHttpInfo + * + * Set EmployerDefaults + * + * @param \SynergiTech\Staffology\Model\EmployerDefaults|null $employerDefaults (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployerDefaultsAccountAsyncWithHttpInfo( + $employerDefaults = null, + string $contentType = self::contentTypes['setEmployerDefaultsAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerDefaults'; + $request = $this->setEmployerDefaultsAccountRequest($employerDefaults, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEmployerDefaultsAccount' + * + * @param \SynergiTech\Staffology\Model\EmployerDefaults|null $employerDefaults (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployerDefaultsAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEmployerDefaultsAccountRequest( + $employerDefaults = null, + string $contentType = self::contentTypes['setEmployerDefaultsAccount'][0] + ): Request + { + + + + $resourcePath = '/account/employerdefaults'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerDefaults)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerDefaults)); + } else { + $httpBody = $employerDefaults; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePhotoAccount + * + * Update Photo + * + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function updatePhotoAccount( + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoAccount'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->updatePhotoAccountWithHttpInfo($file, $contentType); + return $response; + } + + /** + * Operation updatePhotoAccountWithHttpInfo + * + * Update Photo + * + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePhotoAccountWithHttpInfo( + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoAccount'][0] + ): array + { + $request = $this->updatePhotoAccountRequest($file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePhotoAccountAsync + * + * Update Photo + * + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePhotoAccountAsync( + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoAccount'][0] + ): PromiseInterface + { + return $this->updatePhotoAccountAsyncWithHttpInfo($file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePhotoAccountAsyncWithHttpInfo + * + * Update Photo + * + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePhotoAccountAsyncWithHttpInfo( + $file = null, + string $contentType = self::contentTypes['updatePhotoAccount'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->updatePhotoAccountRequest($file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePhotoAccount' + * + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePhotoAccountRequest( + $file = null, + string $contentType = self::contentTypes['updatePhotoAccount'][0] + ): Request + { + + + + $resourcePath = '/account/photo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation verifyAccount + * + * Re-send Verification Email + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function verifyAccount( + string $contentType = self::contentTypes['verifyAccount'][0] + ): void + { + $this->verifyAccountWithHttpInfo($contentType); + } + + /** + * Operation verifyAccountWithHttpInfo + * + * Re-send Verification Email + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function verifyAccountWithHttpInfo( + string $contentType = self::contentTypes['verifyAccount'][0] + ): array + { + $request = $this->verifyAccountRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation verifyAccountAsync + * + * Re-send Verification Email + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyAccountAsync( + string $contentType = self::contentTypes['verifyAccount'][0] + ): PromiseInterface + { + return $this->verifyAccountAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation verifyAccountAsyncWithHttpInfo + * + * Re-send Verification Email + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyAccountAsyncWithHttpInfo( + string $contentType = self::contentTypes['verifyAccount'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->verifyAccountRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'verifyAccount' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function verifyAccountRequest( + string $contentType = self::contentTypes['verifyAccount'][0] + ): Request + { + + + $resourcePath = '/account/verify'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation verifyResponseAccount + * + * Verify Email Address + * + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyResponseAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return bool + */ + public function verifyResponseAccount( + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyResponseAccount'][0] + ): bool + { + list($response) = $this->verifyResponseAccountWithHttpInfo($u, $k, $contentType); + return $response; + } + + /** + * Operation verifyResponseAccountWithHttpInfo + * + * Verify Email Address + * + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyResponseAccount'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of bool, HTTP status code, HTTP response headers (array of strings) + */ + public function verifyResponseAccountWithHttpInfo( + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyResponseAccount'][0] + ): array + { + $request = $this->verifyResponseAccountRequest($u, $k, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('bool', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'bool', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'bool'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'bool', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation verifyResponseAccountAsync + * + * Verify Email Address + * + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyResponseAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyResponseAccountAsync( + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyResponseAccount'][0] + ): PromiseInterface + { + return $this->verifyResponseAccountAsyncWithHttpInfo($u, $k, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation verifyResponseAccountAsyncWithHttpInfo + * + * Verify Email Address + * + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyResponseAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyResponseAccountAsyncWithHttpInfo( + $u = null, + $k = null, + string $contentType = self::contentTypes['verifyResponseAccount'][0] + ): PromiseInterface + { + $returnType = 'bool'; + $request = $this->verifyResponseAccountRequest($u, $k, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'verifyResponseAccount' + * + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyResponseAccount'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function verifyResponseAccountRequest( + $u = null, + $k = null, + string $contentType = self::contentTypes['verifyResponseAccount'][0] + ): Request + { + + + + + $resourcePath = '/account/verify/respond'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $u, + 'u', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $k, + 'k', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/AnalysisCategoryApi.php b/src/Api/AnalysisCategoryApi.php new file mode 100644 index 0000000..0eaff35 --- /dev/null +++ b/src/Api/AnalysisCategoryApi.php @@ -0,0 +1,3618 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createAnalysisCategoryCodeAnalysisCategory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteAnalysisCategory' => [ + 'application/json', + ], + 'deleteAnalysisCategoryCodeAnalysisCategory' => [ + 'application/json', + ], + 'getAnalysisCategory' => [ + 'application/json', + ], + 'getAnalysisCategoryCodeAnalysisCategory' => [ + 'application/json', + ], + 'getCodesAnalysisCategory' => [ + 'application/json', + ], + 'indexAnalysisCategory' => [ + 'application/json', + ], + 'updateAnalysisCategory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateAnalysisCategoryCodeAnalysisCategory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createAnalysisCategory + * + * Create AnalysisCategory + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + */ + public function createAnalysisCategory( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['createAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + { + list($response) = $this->createAnalysisCategoryWithHttpInfo($employerId, $contractAnalysisCategoryRequest, $contentType); + return $response; + } + + /** + * Operation createAnalysisCategoryWithHttpInfo + * + * Create AnalysisCategory + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createAnalysisCategoryWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['createAnalysisCategory'][0] + ): array + { + $request = $this->createAnalysisCategoryRequest($employerId, $contractAnalysisCategoryRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAnalysisCategoryAsync + * + * Create AnalysisCategory + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAnalysisCategoryAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['createAnalysisCategory'][0] + ): PromiseInterface + { + return $this->createAnalysisCategoryAsyncWithHttpInfo($employerId, $contractAnalysisCategoryRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAnalysisCategoryAsyncWithHttpInfo + * + * Create AnalysisCategory + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['createAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + $request = $this->createAnalysisCategoryRequest($employerId, $contractAnalysisCategoryRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAnalysisCategory' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAnalysisCategoryRequest( + $employerId, + $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['createAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createAnalysisCategory' + ); + } + + + + $resourcePath = '/employers/{employerId}/analysiscategories'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAnalysisCategoryRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAnalysisCategoryRequest)); + } else { + $httpBody = $contractAnalysisCategoryRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createAnalysisCategoryCodeAnalysisCategory + * + * Create AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to create code (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + */ + public function createAnalysisCategoryCodeAnalysisCategory( + string $employerId, + string $analysisCategoryId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + { + list($response) = $this->createAnalysisCategoryCodeAnalysisCategoryWithHttpInfo($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest, $contentType); + return $response; + } + + /** + * Operation createAnalysisCategoryCodeAnalysisCategoryWithHttpInfo + * + * Create AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to create code (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createAnalysisCategoryCodeAnalysisCategoryWithHttpInfo( + string $employerId, + string $analysisCategoryId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'][0] + ): array + { + $request = $this->createAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAnalysisCategoryCodeAnalysisCategoryAsync + * + * Create AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to create code (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAnalysisCategoryCodeAnalysisCategoryAsync( + string $employerId, + string $analysisCategoryId, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + return $this->createAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo + * + * Create AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to create code (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $analysisCategoryId, + $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + $request = $this->createAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $contractAnalysisCategoryCodeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAnalysisCategoryCodeAnalysisCategory' + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to create code (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAnalysisCategoryCodeAnalysisCategoryRequest( + $employerId, + $analysisCategoryId, + $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['createAnalysisCategoryCodeAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling createAnalysisCategoryCodeAnalysisCategory' + ); + } + + + + $resourcePath = '/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAnalysisCategoryCodeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAnalysisCategoryCodeRequest)); + } else { + $httpBody = $contractAnalysisCategoryCodeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAnalysisCategory + * + * Delete AnalysisCategory + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAnalysisCategory( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAnalysisCategory'][0] + ): void + { + $this->deleteAnalysisCategoryWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteAnalysisCategoryWithHttpInfo + * + * Delete AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAnalysisCategoryWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAnalysisCategory'][0] + ): array + { + $request = $this->deleteAnalysisCategoryRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAnalysisCategoryAsync + * + * Delete AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAnalysisCategoryAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAnalysisCategory'][0] + ): PromiseInterface + { + return $this->deleteAnalysisCategoryAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAnalysisCategoryAsyncWithHttpInfo + * + * Delete AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAnalysisCategoryRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAnalysisCategory' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAnalysisCategoryRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAnalysisCategory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAnalysisCategoryCodeAnalysisCategory + * + * Delete AnalysisCategoryCode + * + * @param string $employerId employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAnalysisCategoryCodeAnalysisCategory( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'][0] + ): void + { + $this->deleteAnalysisCategoryCodeAnalysisCategoryWithHttpInfo($employerId, $analysisCategoryId, $code, $contentType); + } + + /** + * Operation deleteAnalysisCategoryCodeAnalysisCategoryWithHttpInfo + * + * Delete AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAnalysisCategoryCodeAnalysisCategoryWithHttpInfo( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'][0] + ): array + { + $request = $this->deleteAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAnalysisCategoryCodeAnalysisCategoryAsync + * + * Delete AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAnalysisCategoryCodeAnalysisCategoryAsync( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + return $this->deleteAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo($employerId, $analysisCategoryId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo + * + * Delete AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $analysisCategoryId, + $code, + string $contentType = self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAnalysisCategoryCodeAnalysisCategory' + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAnalysisCategoryCodeAnalysisCategoryRequest( + $employerId, + $analysisCategoryId, + $code, + string $contentType = self::contentTypes['deleteAnalysisCategoryCodeAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling deleteAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deleteAnalysisCategoryCodeAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAnalysisCategory + * + * Get AnalysisCategory + * + * @param string $employerId The Id of the Employer to which the AnalysisCategory belongs. (required) + * @param string $id The Id of the AnalysisCategory which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + */ + public function getAnalysisCategory( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + { + list($response) = $this->getAnalysisCategoryWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getAnalysisCategoryWithHttpInfo + * + * Get AnalysisCategory + * + * @param string $employerId The Id of the Employer to which the AnalysisCategory belongs. (required) + * @param string $id The Id of the AnalysisCategory which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAnalysisCategoryWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAnalysisCategory'][0] + ): array + { + $request = $this->getAnalysisCategoryRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAnalysisCategoryAsync + * + * Get AnalysisCategory + * + * @param string $employerId The Id of the Employer to which the AnalysisCategory belongs. (required) + * @param string $id The Id of the AnalysisCategory which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnalysisCategoryAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAnalysisCategory'][0] + ): PromiseInterface + { + return $this->getAnalysisCategoryAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAnalysisCategoryAsyncWithHttpInfo + * + * Get AnalysisCategory + * + * @param string $employerId The Id of the Employer to which the AnalysisCategory belongs. (required) + * @param string $id The Id of the AnalysisCategory which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + $request = $this->getAnalysisCategoryRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAnalysisCategory' + * + * @param string $employerId The Id of the Employer to which the AnalysisCategory belongs. (required) + * @param string $id The Id of the AnalysisCategory which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAnalysisCategoryRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAnalysisCategory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAnalysisCategoryCodeAnalysisCategory + * + * Get AnalysisCategoryCode + * + * @param string $employerId employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + */ + public function getAnalysisCategoryCodeAnalysisCategory( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + { + list($response) = $this->getAnalysisCategoryCodeAnalysisCategoryWithHttpInfo($employerId, $analysisCategoryId, $code, $contentType); + return $response; + } + + /** + * Operation getAnalysisCategoryCodeAnalysisCategoryWithHttpInfo + * + * Get AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAnalysisCategoryCodeAnalysisCategoryWithHttpInfo( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'][0] + ): array + { + $request = $this->getAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAnalysisCategoryCodeAnalysisCategoryAsync + * + * Get AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnalysisCategoryCodeAnalysisCategoryAsync( + string $employerId, + string $analysisCategoryId, + string $code, + string $contentType = self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + return $this->getAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo($employerId, $analysisCategoryId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo + * + * Get AnalysisCategoryCode + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $analysisCategoryId, + $code, + string $contentType = self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + $request = $this->getAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAnalysisCategoryCodeAnalysisCategory' + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the AnalysisCategory to which the Code belongs. (required) + * @param string $code The code of the AnalysisCategoryCode you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAnalysisCategoryCodeAnalysisCategoryRequest( + $employerId, + $analysisCategoryId, + $code, + string $contentType = self::contentTypes['getAnalysisCategoryCodeAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling getAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getAnalysisCategoryCodeAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCodesAnalysisCategory + * + * List AnalysisCategoryCodes + * + * @param string $employerId employerId (required) + * @param string $analysisCategoryId The Id of the Category for which you want to list Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCodesAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getCodesAnalysisCategory( + string $employerId, + string $analysisCategoryId, + string $contentType = self::contentTypes['getCodesAnalysisCategory'][0] + ): array + { + list($response) = $this->getCodesAnalysisCategoryWithHttpInfo($employerId, $analysisCategoryId, $contentType); + return $response; + } + + /** + * Operation getCodesAnalysisCategoryWithHttpInfo + * + * List AnalysisCategoryCodes + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the Category for which you want to list Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCodesAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getCodesAnalysisCategoryWithHttpInfo( + string $employerId, + string $analysisCategoryId, + string $contentType = self::contentTypes['getCodesAnalysisCategory'][0] + ): array + { + $request = $this->getCodesAnalysisCategoryRequest($employerId, $analysisCategoryId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCodesAnalysisCategoryAsync + * + * List AnalysisCategoryCodes + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the Category for which you want to list Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCodesAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCodesAnalysisCategoryAsync( + string $employerId, + string $analysisCategoryId, + string $contentType = self::contentTypes['getCodesAnalysisCategory'][0] + ): PromiseInterface + { + return $this->getCodesAnalysisCategoryAsyncWithHttpInfo($employerId, $analysisCategoryId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCodesAnalysisCategoryAsyncWithHttpInfo + * + * List AnalysisCategoryCodes + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the Category for which you want to list Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCodesAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCodesAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $analysisCategoryId, + string $contentType = self::contentTypes['getCodesAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getCodesAnalysisCategoryRequest($employerId, $analysisCategoryId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCodesAnalysisCategory' + * + * @param string $employerId (required) + * @param string $analysisCategoryId The Id of the Category for which you want to list Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCodesAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCodesAnalysisCategoryRequest( + $employerId, + $analysisCategoryId, + string $contentType = self::contentTypes['getCodesAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCodesAnalysisCategory' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling getCodesAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexAnalysisCategory + * + * List AnalysisCategories + * + * @param string $employerId The Id of the Employer for which you want to list AnalysisCategories (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexAnalysisCategory( + string $employerId, + string $contentType = self::contentTypes['indexAnalysisCategory'][0] + ): array + { + list($response) = $this->indexAnalysisCategoryWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexAnalysisCategoryWithHttpInfo + * + * List AnalysisCategories + * + * @param string $employerId The Id of the Employer for which you want to list AnalysisCategories (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexAnalysisCategoryWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexAnalysisCategory'][0] + ): array + { + $request = $this->indexAnalysisCategoryRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexAnalysisCategoryAsync + * + * List AnalysisCategories + * + * @param string $employerId The Id of the Employer for which you want to list AnalysisCategories (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAnalysisCategoryAsync( + string $employerId, + string $contentType = self::contentTypes['indexAnalysisCategory'][0] + ): PromiseInterface + { + return $this->indexAnalysisCategoryAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexAnalysisCategoryAsyncWithHttpInfo + * + * List AnalysisCategories + * + * @param string $employerId The Id of the Employer for which you want to list AnalysisCategories (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAnalysisCategoryAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexAnalysisCategoryRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexAnalysisCategory' + * + * @param string $employerId The Id of the Employer for which you want to list AnalysisCategories (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexAnalysisCategoryRequest( + $employerId, + string $contentType = self::contentTypes['indexAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexAnalysisCategory' + ); + } + + + $resourcePath = '/employers/{employerId}/analysiscategories'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAnalysisCategory + * + * Update AnalysisCategory + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + */ + public function updateAnalysisCategory( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse + { + list($response) = $this->updateAnalysisCategoryWithHttpInfo($employerId, $id, $contractAnalysisCategoryRequest, $contentType); + return $response; + } + + /** + * Operation updateAnalysisCategoryWithHttpInfo + * + * Update AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAnalysisCategoryWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategory'][0] + ): array + { + $request = $this->updateAnalysisCategoryRequest($employerId, $id, $contractAnalysisCategoryRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAnalysisCategoryAsync + * + * Update AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAnalysisCategoryAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategory'][0] + ): PromiseInterface + { + return $this->updateAnalysisCategoryAsyncWithHttpInfo($employerId, $id, $contractAnalysisCategoryRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAnalysisCategoryAsyncWithHttpInfo + * + * Update AnalysisCategory + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $id, + $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryResponse'; + $request = $this->updateAnalysisCategoryRequest($employerId, $id, $contractAnalysisCategoryRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAnalysisCategory' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryRequest|null $contractAnalysisCategoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAnalysisCategoryRequest( + $employerId, + $id, + $contractAnalysisCategoryRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateAnalysisCategory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateAnalysisCategory' + ); + } + + + + $resourcePath = '/employers/{employerId}/analysiscategories/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAnalysisCategoryRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAnalysisCategoryRequest)); + } else { + $httpBody = $contractAnalysisCategoryRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAnalysisCategoryCodeAnalysisCategory + * + * Update AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to update Analysis code (required) + * @param string $code The code of the Analysis category code you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + */ + public function updateAnalysisCategoryCodeAnalysisCategory( + string $employerId, + string $analysisCategoryId, + string $code, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'][0] + ): \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse + { + list($response) = $this->updateAnalysisCategoryCodeAnalysisCategoryWithHttpInfo($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest, $contentType); + return $response; + } + + /** + * Operation updateAnalysisCategoryCodeAnalysisCategoryWithHttpInfo + * + * Update AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to update Analysis code (required) + * @param string $code The code of the Analysis category code you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAnalysisCategoryCodeAnalysisCategoryWithHttpInfo( + string $employerId, + string $analysisCategoryId, + string $code, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'][0] + ): array + { + $request = $this->updateAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAnalysisCategoryCodeAnalysisCategoryAsync + * + * Update AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to update Analysis code (required) + * @param string $code The code of the Analysis category code you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAnalysisCategoryCodeAnalysisCategoryAsync( + string $employerId, + string $analysisCategoryId, + string $code, + ?\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + return $this->updateAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo + * + * Update AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to update Analysis code (required) + * @param string $code The code of the Analysis category code you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAnalysisCategoryCodeAnalysisCategoryAsyncWithHttpInfo( + $employerId, + $analysisCategoryId, + $code, + $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeResponse'; + $request = $this->updateAnalysisCategoryCodeAnalysisCategoryRequest($employerId, $analysisCategoryId, $code, $contractAnalysisCategoryCodeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAnalysisCategoryCodeAnalysisCategory' + * + * @param string $employerId The Id of the Employer to which the Analysis category belongs. (required) + * @param string $analysisCategoryId The Analysis category id for which you want to update Analysis code (required) + * @param string $code The code of the Analysis category code you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractAnalysisCategoryCodeRequest|null $contractAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAnalysisCategoryCodeAnalysisCategoryRequest( + $employerId, + $analysisCategoryId, + $code, + $contractAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['updateAnalysisCategoryCodeAnalysisCategory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling updateAnalysisCategoryCodeAnalysisCategory' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updateAnalysisCategoryCodeAnalysisCategory' + ); + } + + + + $resourcePath = '/employers/{employerId}/analysiscategories/{analysisCategoryId}/categorycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAnalysisCategoryCodeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAnalysisCategoryCodeRequest)); + } else { + $httpBody = $contractAnalysisCategoryCodeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/AttachmentOrderApi.php b/src/Api/AttachmentOrderApi.php new file mode 100644 index 0000000..461b6ee --- /dev/null +++ b/src/Api/AttachmentOrderApi.php @@ -0,0 +1,3264 @@ + [ + 'multipart/form-data', + ], + 'createAttachmentOrder' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteAttachmentOrder' => [ + 'application/json', + ], + 'deleteDocumentAttachmentOrder' => [ + 'application/json', + ], + 'getAttachmentOrder' => [ + 'application/json', + ], + 'getDocumentAttachmentOrder' => [ + 'application/json', + ], + 'indexAttachmentOrder' => [ + 'application/json', + ], + 'paymentsAttachmentOrder' => [ + 'application/json', + ], + 'updateAttachmentOrder' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addDocumentAttachmentOrder + * + * Add Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to attach documents to (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addDocumentAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentAttachmentOrder'][0] + ): void + { + $this->addDocumentAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $file, $contentType); + } + + /** + * Operation addDocumentAttachmentOrderWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addDocumentAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentAttachmentOrder'][0] + ): array + { + $request = $this->addDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addDocumentAttachmentOrderAsync + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentAttachmentOrder'][0] + ): PromiseInterface + { + return $this->addDocumentAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDocumentAttachmentOrderAsyncWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDocumentAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addDocumentAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling addDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addDocumentAttachmentOrder' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createAttachmentOrder + * + * Create AttachmentOrder + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createAttachmentOrder( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['createAttachmentOrder'][0] + ): void + { + $this->createAttachmentOrderWithHttpInfo($employerId, $employeeId, $attachmentOrder, $contentType); + } + + /** + * Operation createAttachmentOrderWithHttpInfo + * + * Create AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['createAttachmentOrder'][0] + ): array + { + $request = $this->createAttachmentOrderRequest($employerId, $employeeId, $attachmentOrder, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createAttachmentOrderAsync + * + * Create AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAttachmentOrderAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['createAttachmentOrder'][0] + ): PromiseInterface + { + return $this->createAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $attachmentOrder, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAttachmentOrderAsyncWithHttpInfo + * + * Create AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $attachmentOrder = null, + string $contentType = self::contentTypes['createAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createAttachmentOrderRequest($employerId, $employeeId, $attachmentOrder, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAttachmentOrderRequest( + $employerId, + $employeeId, + $attachmentOrder = null, + string $contentType = self::contentTypes['createAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createAttachmentOrder' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($attachmentOrder)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($attachmentOrder)); + } else { + $httpBody = $attachmentOrder; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAttachmentOrder + * + * Delete AttachmentOrder + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAttachmentOrder'][0] + ): void + { + $this->deleteAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteAttachmentOrderWithHttpInfo + * + * Delete AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAttachmentOrder'][0] + ): array + { + $request = $this->deleteAttachmentOrderRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAttachmentOrderAsync + * + * Delete AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAttachmentOrder'][0] + ): PromiseInterface + { + return $this->deleteAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAttachmentOrderAsyncWithHttpInfo + * + * Delete AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAttachmentOrderRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocumentAttachmentOrder + * + * Delete AttachmentOrder Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDocumentAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentAttachmentOrder'][0] + ): void + { + $this->deleteDocumentAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + } + + /** + * Operation deleteDocumentAttachmentOrderWithHttpInfo + * + * Delete AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentAttachmentOrder'][0] + ): array + { + $request = $this->deleteDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDocumentAttachmentOrderAsync + * + * Delete AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentAttachmentOrder'][0] + ): PromiseInterface + { + return $this->deleteDocumentAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentAttachmentOrderAsyncWithHttpInfo + * + * Delete AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocumentAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling deleteDocumentAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAttachmentOrder + * + * Get AttachmentOrder + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AttachmentOrder + */ + public function getAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAttachmentOrder'][0] + ): \SynergiTech\Staffology\Model\AttachmentOrder + { + list($response) = $this->getAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getAttachmentOrderWithHttpInfo + * + * Get AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AttachmentOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function getAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAttachmentOrder'][0] + ): array + { + $request = $this->getAttachmentOrderRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AttachmentOrder', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AttachmentOrder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AttachmentOrder', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrder'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AttachmentOrder', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAttachmentOrderAsync + * + * Get AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAttachmentOrder'][0] + ): PromiseInterface + { + return $this->getAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAttachmentOrderAsyncWithHttpInfo + * + * Get AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrder'; + $request = $this->getAttachmentOrderRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentAttachmentOrder + * + * Get AttachmentOrder Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getDocumentAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentAttachmentOrder'][0] + ): \SplFileObject + { + list($response) = $this->getDocumentAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + return $response; + } + + /** + * Operation getDocumentAttachmentOrderWithHttpInfo + * + * Get AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentAttachmentOrder'][0] + ): array + { + $request = $this->getDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentAttachmentOrderAsync + * + * Get AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentAttachmentOrder'][0] + ): PromiseInterface + { + return $this->getDocumentAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentAttachmentOrderAsyncWithHttpInfo + * + * Get AttachmentOrder Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getDocumentAttachmentOrderRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDocumentAttachmentOrder' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling getDocumentAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexAttachmentOrder + * + * List AttachmentOrders + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexAttachmentOrder( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexAttachmentOrder'][0] + ): array + { + list($response) = $this->indexAttachmentOrderWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexAttachmentOrderWithHttpInfo + * + * List AttachmentOrders + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexAttachmentOrder'][0] + ): array + { + $request = $this->indexAttachmentOrderRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexAttachmentOrderAsync + * + * List AttachmentOrders + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexAttachmentOrder'][0] + ): PromiseInterface + { + return $this->indexAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexAttachmentOrderAsyncWithHttpInfo + * + * List AttachmentOrders + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexAttachmentOrderRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexAttachmentOrderRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation paymentsAttachmentOrder + * + * Get Payments + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AttachmentOrderPayment[] + */ + public function paymentsAttachmentOrder( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['paymentsAttachmentOrder'][0] + ): array + { + list($response) = $this->paymentsAttachmentOrderWithHttpInfo($employerId, $employeeId, $taxYear, $contentType); + return $response; + } + + /** + * Operation paymentsAttachmentOrderWithHttpInfo + * + * Get Payments + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AttachmentOrderPayment[], HTTP status code, HTTP response headers (array of strings) + */ + public function paymentsAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['paymentsAttachmentOrder'][0] + ): array + { + $request = $this->paymentsAttachmentOrderRequest($employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AttachmentOrderPayment[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AttachmentOrderPayment[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AttachmentOrderPayment[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrderPayment[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AttachmentOrderPayment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation paymentsAttachmentOrderAsync + * + * Get Payments + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsAttachmentOrderAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['paymentsAttachmentOrder'][0] + ): PromiseInterface + { + return $this->paymentsAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation paymentsAttachmentOrderAsyncWithHttpInfo + * + * Get Payments + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + string $contentType = self::contentTypes['paymentsAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrderPayment[]'; + $request = $this->paymentsAttachmentOrderRequest($employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'paymentsAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function paymentsAttachmentOrderRequest( + $employerId, + $employeeId, + $taxYear, + string $contentType = self::contentTypes['paymentsAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling paymentsAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling paymentsAttachmentOrder' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling paymentsAttachmentOrder' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/payments/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAttachmentOrder + * + * Update AttachmentOrder + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to update. (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\AttachmentOrder + */ + public function updateAttachmentOrder( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['updateAttachmentOrder'][0] + ): \SynergiTech\Staffology\Model\AttachmentOrder + { + list($response) = $this->updateAttachmentOrderWithHttpInfo($employerId, $employeeId, $id, $attachmentOrder, $contentType); + return $response; + } + + /** + * Operation updateAttachmentOrderWithHttpInfo + * + * Update AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to update. (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttachmentOrder'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\AttachmentOrder, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAttachmentOrderWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['updateAttachmentOrder'][0] + ): array + { + $request = $this->updateAttachmentOrderRequest($employerId, $employeeId, $id, $attachmentOrder, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AttachmentOrder', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AttachmentOrder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AttachmentOrder', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrder'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AttachmentOrder', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAttachmentOrderAsync + * + * Update AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to update. (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAttachmentOrderAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\AttachmentOrder $attachmentOrder = null, + string $contentType = self::contentTypes['updateAttachmentOrder'][0] + ): PromiseInterface + { + return $this->updateAttachmentOrderAsyncWithHttpInfo($employerId, $employeeId, $id, $attachmentOrder, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAttachmentOrderAsyncWithHttpInfo + * + * Update AttachmentOrder + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to update. (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAttachmentOrderAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $attachmentOrder = null, + string $contentType = self::contentTypes['updateAttachmentOrder'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrder'; + $request = $this->updateAttachmentOrderRequest($employerId, $employeeId, $id, $attachmentOrder, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAttachmentOrder' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the AttachmentOrder you want to update. (required) + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $attachmentOrder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAttachmentOrder'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAttachmentOrderRequest( + $employerId, + $employeeId, + $id, + $attachmentOrder = null, + string $contentType = self::contentTypes['updateAttachmentOrder'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateAttachmentOrder' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateAttachmentOrder' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateAttachmentOrder' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/attachmentorders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($attachmentOrder)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($attachmentOrder)); + } else { + $httpBody = $attachmentOrder; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/AuditApi.php b/src/Api/AuditApi.php new file mode 100644 index 0000000..31eb6cb --- /dev/null +++ b/src/Api/AuditApi.php @@ -0,0 +1,591 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation employerAuditListAudit + * + * Employer Audit Log + * + * @param string $employerId The Id of the Employer for which you want to list Audit logs (required) + * @param \SynergiTech\Staffology\Model\EntityType|null $entity Entity type name for which audit log should be retrieved (optional) + * @param string|null $entityId Id of the entity for which audit log should be retrieved (optional) + * @param \DateTime|null $fromDate Date from which records should be retrieved (optional) + * @param \DateTime|null $toDate Date till records should be retrieved (optional) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerAuditListAudit'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employerAuditListAudit( + string $employerId, + ?\SynergiTech\Staffology\Model\EntityType $entity = null, + ?string $entityId = null, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['employerAuditListAudit'][0] + ): array + { + list($response) = $this->employerAuditListAuditWithHttpInfo($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation employerAuditListAuditWithHttpInfo + * + * Employer Audit Log + * + * @param string $employerId The Id of the Employer for which you want to list Audit logs (required) + * @param \SynergiTech\Staffology\Model\EntityType|null $entity Entity type name for which audit log should be retrieved (optional) + * @param string|null $entityId Id of the entity for which audit log should be retrieved (optional) + * @param \DateTime|null $fromDate Date from which records should be retrieved (optional) + * @param \DateTime|null $toDate Date till records should be retrieved (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerAuditListAudit'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employerAuditListAuditWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\EntityType $entity = null, + ?string $entityId = null, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['employerAuditListAudit'][0] + ): array + { + $request = $this->employerAuditListAuditRequest($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employerAuditListAuditAsync + * + * Employer Audit Log + * + * @param string $employerId The Id of the Employer for which you want to list Audit logs (required) + * @param \SynergiTech\Staffology\Model\EntityType|null $entity Entity type name for which audit log should be retrieved (optional) + * @param string|null $entityId Id of the entity for which audit log should be retrieved (optional) + * @param \DateTime|null $fromDate Date from which records should be retrieved (optional) + * @param \DateTime|null $toDate Date till records should be retrieved (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerAuditListAudit'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerAuditListAuditAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\EntityType $entity = null, + ?string $entityId = null, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['employerAuditListAudit'][0] + ): PromiseInterface + { + return $this->employerAuditListAuditAsyncWithHttpInfo($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerAuditListAuditAsyncWithHttpInfo + * + * Employer Audit Log + * + * @param string $employerId The Id of the Employer for which you want to list Audit logs (required) + * @param \SynergiTech\Staffology\Model\EntityType|null $entity Entity type name for which audit log should be retrieved (optional) + * @param string|null $entityId Id of the entity for which audit log should be retrieved (optional) + * @param \DateTime|null $fromDate Date from which records should be retrieved (optional) + * @param \DateTime|null $toDate Date till records should be retrieved (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerAuditListAudit'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerAuditListAuditAsyncWithHttpInfo( + $employerId, + $entity = null, + $entityId = null, + $fromDate = null, + $toDate = null, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['employerAuditListAudit'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employerAuditListAuditRequest($employerId, $entity, $entityId, $fromDate, $toDate, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerAuditListAudit' + * + * @param string $employerId The Id of the Employer for which you want to list Audit logs (required) + * @param \SynergiTech\Staffology\Model\EntityType|null $entity Entity type name for which audit log should be retrieved (optional) + * @param string|null $entityId Id of the entity for which audit log should be retrieved (optional) + * @param \DateTime|null $fromDate Date from which records should be retrieved (optional) + * @param \DateTime|null $toDate Date till records should be retrieved (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerAuditListAudit'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerAuditListAuditRequest( + $employerId, + $entity = null, + $entityId = null, + $fromDate = null, + $toDate = null, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['employerAuditListAudit'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employerAuditListAudit' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/audit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entity, + 'entity', // param base name + 'EntityType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entityId, + 'entityId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromDate, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toDate, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/AutoEnrolmentApi.php b/src/Api/AutoEnrolmentApi.php new file mode 100644 index 0000000..cfee7a1 --- /dev/null +++ b/src/Api/AutoEnrolmentApi.php @@ -0,0 +1,5252 @@ + [ + 'application/json', + ], + 'deleteAutoEnrolment' => [ + 'application/json', + ], + 'emailAllLettersAutoEnrolment' => [ + 'application/json', + ], + 'emailLetterAutoEnrolment' => [ + 'application/json', + ], + 'getAutoEnrolment' => [ + 'application/json', + ], + 'getLastAutoEnrolment' => [ + 'application/json', + ], + 'getLetterAutoEnrolment' => [ + 'application/json', + ], + 'listAutoEnrolment' => [ + 'application/json', + ], + 'markLetterAsSentAutoEnrolment' => [ + 'application/json', + ], + 'markLettersAsSentAutoEnrolment' => [ + 'application/json', + ], + 'pendingLettersAutoEnrolment' => [ + 'application/json', + ], + 'pendingLettersCountAutoEnrolment' => [ + 'application/json', + ], + 'pendingPostponementLettersAutoEnrolment' => [ + 'application/json', + ], + 'reenrolAutoEnrolment' => [ + 'application/json', + ], + 'setStateAutoEnrolment' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation assessAutoEnrolment + * + * Assess Employee for AutoEnrolment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to assess (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['assessAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AeAssessment + */ + public function assessAutoEnrolment( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['assessAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\AeAssessment + { + list($response) = $this->assessAutoEnrolmentWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation assessAutoEnrolmentWithHttpInfo + * + * Assess Employee for AutoEnrolment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to assess (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['assessAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AeAssessment, HTTP status code, HTTP response headers (array of strings) + */ + public function assessAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['assessAutoEnrolment'][0] + ): array + { + $request = $this->assessAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\AeAssessment', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AeAssessment' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AeAssessment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AeAssessment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation assessAutoEnrolmentAsync + * + * Assess Employee for AutoEnrolment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to assess (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['assessAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function assessAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['assessAutoEnrolment'][0] + ): PromiseInterface + { + return $this->assessAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation assessAutoEnrolmentAsyncWithHttpInfo + * + * Assess Employee for AutoEnrolment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to assess (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['assessAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function assessAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['assessAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + $request = $this->assessAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'assessAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to assess (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['assessAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function assessAutoEnrolmentRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['assessAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling assessAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling assessAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAutoEnrolment + * + * Delete AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAutoEnrolment( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAutoEnrolment'][0] + ): void + { + $this->deleteAutoEnrolmentWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteAutoEnrolmentWithHttpInfo + * + * Delete AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAutoEnrolment'][0] + ): array + { + $request = $this->deleteAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAutoEnrolmentAsync + * + * Delete AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteAutoEnrolment'][0] + ): PromiseInterface + { + return $this->deleteAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAutoEnrolmentAsyncWithHttpInfo + * + * Delete AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAutoEnrolmentRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteAutoEnrolment' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailAllLettersAutoEnrolment + * + * Email All Letters + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailAllLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailAllLettersAutoEnrolment( + string $employerId, + string $contentType = self::contentTypes['emailAllLettersAutoEnrolment'][0] + ): void + { + $this->emailAllLettersAutoEnrolmentWithHttpInfo($employerId, $contentType); + } + + /** + * Operation emailAllLettersAutoEnrolmentWithHttpInfo + * + * Email All Letters + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailAllLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailAllLettersAutoEnrolmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['emailAllLettersAutoEnrolment'][0] + ): array + { + $request = $this->emailAllLettersAutoEnrolmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailAllLettersAutoEnrolmentAsync + * + * Email All Letters + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailAllLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailAllLettersAutoEnrolmentAsync( + string $employerId, + string $contentType = self::contentTypes['emailAllLettersAutoEnrolment'][0] + ): PromiseInterface + { + return $this->emailAllLettersAutoEnrolmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailAllLettersAutoEnrolmentAsyncWithHttpInfo + * + * Email All Letters + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailAllLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailAllLettersAutoEnrolmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['emailAllLettersAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailAllLettersAutoEnrolmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailAllLettersAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailAllLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailAllLettersAutoEnrolmentRequest( + $employerId, + string $contentType = self::contentTypes['emailAllLettersAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailAllLettersAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/autoenrolment/letters/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailLetterAutoEnrolment + * + * Email Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEmail + */ + public function emailLetterAutoEnrolment( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['emailLetterAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\EmployerEmail + { + list($response) = $this->emailLetterAutoEnrolmentWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation emailLetterAutoEnrolmentWithHttpInfo + * + * Email Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function emailLetterAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['emailLetterAutoEnrolment'][0] + ): array + { + $request = $this->emailLetterAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation emailLetterAutoEnrolmentAsync + * + * Email Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailLetterAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['emailLetterAutoEnrolment'][0] + ): PromiseInterface + { + return $this->emailLetterAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailLetterAutoEnrolmentAsyncWithHttpInfo + * + * Email Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailLetterAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['emailLetterAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + $request = $this->emailLetterAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailLetterAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailLetterAutoEnrolmentRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['emailLetterAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailLetterAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling emailLetterAutoEnrolment' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling emailLetterAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAutoEnrolment + * + * Get AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AeAssessment + */ + public function getAutoEnrolment( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\AeAssessment + { + list($response) = $this->getAutoEnrolmentWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getAutoEnrolmentWithHttpInfo + * + * Get AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AeAssessment, HTTP status code, HTTP response headers (array of strings) + */ + public function getAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAutoEnrolment'][0] + ): array + { + $request = $this->getAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AeAssessment', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AeAssessment' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AeAssessment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AeAssessment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAutoEnrolmentAsync + * + * Get AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getAutoEnrolment'][0] + ): PromiseInterface + { + return $this->getAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAutoEnrolmentAsyncWithHttpInfo + * + * Get AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + $request = $this->getAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAutoEnrolmentRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getAutoEnrolment' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLastAutoEnrolment + * + * Get Last AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLastAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AeAssessment + */ + public function getLastAutoEnrolment( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getLastAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\AeAssessment + { + list($response) = $this->getLastAutoEnrolmentWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation getLastAutoEnrolmentWithHttpInfo + * + * Get Last AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLastAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AeAssessment, HTTP status code, HTTP response headers (array of strings) + */ + public function getLastAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getLastAutoEnrolment'][0] + ): array + { + $request = $this->getLastAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AeAssessment', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AeAssessment' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AeAssessment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AeAssessment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLastAutoEnrolmentAsync + * + * Get Last AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLastAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLastAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getLastAutoEnrolment'][0] + ): PromiseInterface + { + return $this->getLastAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLastAutoEnrolmentAsyncWithHttpInfo + * + * Get Last AE Assessment + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLastAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLastAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getLastAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + $request = $this->getLastAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLastAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLastAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLastAutoEnrolmentRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getLastAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLastAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getLastAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/last'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLetterAutoEnrolment + * + * Get Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getLetterAutoEnrolment( + string $employerId, + string $employeeId, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['getLetterAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getLetterAutoEnrolmentWithHttpInfo($employerId, $employeeId, $id, $accept, $contentType); + return $response; + } + + /** + * Operation getLetterAutoEnrolmentWithHttpInfo + * + * Get Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getLetterAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['getLetterAutoEnrolment'][0] + ): array + { + $request = $this->getLetterAutoEnrolmentRequest($employerId, $employeeId, $id, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLetterAutoEnrolmentAsync + * + * Get Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLetterAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['getLetterAutoEnrolment'][0] + ): PromiseInterface + { + return $this->getLetterAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $id, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLetterAutoEnrolmentAsyncWithHttpInfo + * + * Get Letter + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLetterAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $accept = null, + string $contentType = self::contentTypes['getLetterAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getLetterAutoEnrolmentRequest($employerId, $employeeId, $id, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLetterAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLetterAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLetterAutoEnrolmentRequest( + $employerId, + $employeeId, + $id, + $accept = null, + string $contentType = self::contentTypes['getLetterAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLetterAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getLetterAutoEnrolment' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getLetterAutoEnrolment' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listAutoEnrolment + * + * Get AE Assessments + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve AE Assessments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listAutoEnrolment( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listAutoEnrolment'][0] + ): array + { + list($response) = $this->listAutoEnrolmentWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation listAutoEnrolmentWithHttpInfo + * + * Get AE Assessments + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve AE Assessments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listAutoEnrolment'][0] + ): array + { + $request = $this->listAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listAutoEnrolmentAsync + * + * Get AE Assessments + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve AE Assessments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listAutoEnrolment'][0] + ): PromiseInterface + { + return $this->listAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listAutoEnrolmentAsyncWithHttpInfo + * + * Get AE Assessments + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve AE Assessments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['listAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listAutoEnrolmentRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve AE Assessments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listAutoEnrolmentRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['listAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling listAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markLetterAsSentAutoEnrolment + * + * Mark Letter as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLetterAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function markLetterAsSentAutoEnrolment( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['markLetterAsSentAutoEnrolment'][0] + ): void + { + $this->markLetterAsSentAutoEnrolmentWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation markLetterAsSentAutoEnrolmentWithHttpInfo + * + * Mark Letter as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLetterAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function markLetterAsSentAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['markLetterAsSentAutoEnrolment'][0] + ): array + { + $request = $this->markLetterAsSentAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation markLetterAsSentAutoEnrolmentAsync + * + * Mark Letter as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLetterAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markLetterAsSentAutoEnrolmentAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['markLetterAsSentAutoEnrolment'][0] + ): PromiseInterface + { + return $this->markLetterAsSentAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markLetterAsSentAutoEnrolmentAsyncWithHttpInfo + * + * Mark Letter as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLetterAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markLetterAsSentAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['markLetterAsSentAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->markLetterAsSentAutoEnrolmentRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markLetterAsSentAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee the assessment is for (required) + * @param string $id The Id of the Assessment (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLetterAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markLetterAsSentAutoEnrolmentRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['markLetterAsSentAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markLetterAsSentAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling markLetterAsSentAutoEnrolment' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markLetterAsSentAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/assessments/{id}/letter/sent'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markLettersAsSentAutoEnrolment + * + * Mark All Letters as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLettersAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function markLettersAsSentAutoEnrolment( + string $employerId, + string $contentType = self::contentTypes['markLettersAsSentAutoEnrolment'][0] + ): void + { + $this->markLettersAsSentAutoEnrolmentWithHttpInfo($employerId, $contentType); + } + + /** + * Operation markLettersAsSentAutoEnrolmentWithHttpInfo + * + * Mark All Letters as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLettersAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function markLettersAsSentAutoEnrolmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['markLettersAsSentAutoEnrolment'][0] + ): array + { + $request = $this->markLettersAsSentAutoEnrolmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation markLettersAsSentAutoEnrolmentAsync + * + * Mark All Letters as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLettersAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markLettersAsSentAutoEnrolmentAsync( + string $employerId, + string $contentType = self::contentTypes['markLettersAsSentAutoEnrolment'][0] + ): PromiseInterface + { + return $this->markLettersAsSentAutoEnrolmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markLettersAsSentAutoEnrolmentAsyncWithHttpInfo + * + * Mark All Letters as Sent + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLettersAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markLettersAsSentAutoEnrolmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['markLettersAsSentAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->markLettersAsSentAutoEnrolmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markLettersAsSentAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markLettersAsSentAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markLettersAsSentAutoEnrolmentRequest( + $employerId, + string $contentType = self::contentTypes['markLettersAsSentAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markLettersAsSentAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/autoenrolment/letters/sent'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pendingLettersAutoEnrolment + * + * Pending Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function pendingLettersAutoEnrolment( + string $employerId, + string $contentType = self::contentTypes['pendingLettersAutoEnrolment'][0] + ): array + { + list($response) = $this->pendingLettersAutoEnrolmentWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation pendingLettersAutoEnrolmentWithHttpInfo + * + * Pending Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function pendingLettersAutoEnrolmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['pendingLettersAutoEnrolment'][0] + ): array + { + $request = $this->pendingLettersAutoEnrolmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pendingLettersAutoEnrolmentAsync + * + * Pending Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingLettersAutoEnrolmentAsync( + string $employerId, + string $contentType = self::contentTypes['pendingLettersAutoEnrolment'][0] + ): PromiseInterface + { + return $this->pendingLettersAutoEnrolmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pendingLettersAutoEnrolmentAsyncWithHttpInfo + * + * Pending Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingLettersAutoEnrolmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['pendingLettersAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->pendingLettersAutoEnrolmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pendingLettersAutoEnrolment' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pendingLettersAutoEnrolmentRequest( + $employerId, + string $contentType = self::contentTypes['pendingLettersAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pendingLettersAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/autoenrolment/letters/pending'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pendingLettersCountAutoEnrolment + * + * Pending Letters Count + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersCountAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPendingLettersCountResponse + */ + public function pendingLettersCountAutoEnrolment( + string $employerId, + string $contentType = self::contentTypes['pendingLettersCountAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\ContractPendingLettersCountResponse + { + list($response) = $this->pendingLettersCountAutoEnrolmentWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation pendingLettersCountAutoEnrolmentWithHttpInfo + * + * Pending Letters Count + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersCountAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPendingLettersCountResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function pendingLettersCountAutoEnrolmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['pendingLettersCountAutoEnrolment'][0] + ): array + { + $request = $this->pendingLettersCountAutoEnrolmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pendingLettersCountAutoEnrolmentAsync + * + * Pending Letters Count + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersCountAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingLettersCountAutoEnrolmentAsync( + string $employerId, + string $contentType = self::contentTypes['pendingLettersCountAutoEnrolment'][0] + ): PromiseInterface + { + return $this->pendingLettersCountAutoEnrolmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pendingLettersCountAutoEnrolmentAsyncWithHttpInfo + * + * Pending Letters Count + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersCountAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingLettersCountAutoEnrolmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['pendingLettersCountAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPendingLettersCountResponse'; + $request = $this->pendingLettersCountAutoEnrolmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pendingLettersCountAutoEnrolment' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingLettersCountAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pendingLettersCountAutoEnrolmentRequest( + $employerId, + string $contentType = self::contentTypes['pendingLettersCountAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pendingLettersCountAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/autoenrolment/letters/pending/count'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pendingPostponementLettersAutoEnrolment + * + * Pending Postponement Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingPostponementLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function pendingPostponementLettersAutoEnrolment( + string $employerId, + string $contentType = self::contentTypes['pendingPostponementLettersAutoEnrolment'][0] + ): array + { + list($response) = $this->pendingPostponementLettersAutoEnrolmentWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation pendingPostponementLettersAutoEnrolmentWithHttpInfo + * + * Pending Postponement Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingPostponementLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function pendingPostponementLettersAutoEnrolmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['pendingPostponementLettersAutoEnrolment'][0] + ): array + { + $request = $this->pendingPostponementLettersAutoEnrolmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pendingPostponementLettersAutoEnrolmentAsync + * + * Pending Postponement Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingPostponementLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingPostponementLettersAutoEnrolmentAsync( + string $employerId, + string $contentType = self::contentTypes['pendingPostponementLettersAutoEnrolment'][0] + ): PromiseInterface + { + return $this->pendingPostponementLettersAutoEnrolmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pendingPostponementLettersAutoEnrolmentAsyncWithHttpInfo + * + * Pending Postponement Letters + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingPostponementLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pendingPostponementLettersAutoEnrolmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['pendingPostponementLettersAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->pendingPostponementLettersAutoEnrolmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pendingPostponementLettersAutoEnrolment' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pendingPostponementLettersAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pendingPostponementLettersAutoEnrolmentRequest( + $employerId, + string $contentType = self::contentTypes['pendingPostponementLettersAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pendingPostponementLettersAutoEnrolment' + ); + } + + + $resourcePath = '/employers/{employerId}/autoenrolment/letters/pending/postponement'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation reenrolAutoEnrolment + * + * Cyclical Re-enrolment + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime|null $cyclicalReenrolmentDate The new Cyclical Re-enrolment Date for the Employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reenrolAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function reenrolAutoEnrolment( + string $employerId, + ?\DateTime $cyclicalReenrolmentDate = null, + string $contentType = self::contentTypes['reenrolAutoEnrolment'][0] + ): array + { + list($response) = $this->reenrolAutoEnrolmentWithHttpInfo($employerId, $cyclicalReenrolmentDate, $contentType); + return $response; + } + + /** + * Operation reenrolAutoEnrolmentWithHttpInfo + * + * Cyclical Re-enrolment + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime|null $cyclicalReenrolmentDate The new Cyclical Re-enrolment Date for the Employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reenrolAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function reenrolAutoEnrolmentWithHttpInfo( + string $employerId, + ?\DateTime $cyclicalReenrolmentDate = null, + string $contentType = self::contentTypes['reenrolAutoEnrolment'][0] + ): array + { + $request = $this->reenrolAutoEnrolmentRequest($employerId, $cyclicalReenrolmentDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation reenrolAutoEnrolmentAsync + * + * Cyclical Re-enrolment + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime|null $cyclicalReenrolmentDate The new Cyclical Re-enrolment Date for the Employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reenrolAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reenrolAutoEnrolmentAsync( + string $employerId, + ?\DateTime $cyclicalReenrolmentDate = null, + string $contentType = self::contentTypes['reenrolAutoEnrolment'][0] + ): PromiseInterface + { + return $this->reenrolAutoEnrolmentAsyncWithHttpInfo($employerId, $cyclicalReenrolmentDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation reenrolAutoEnrolmentAsyncWithHttpInfo + * + * Cyclical Re-enrolment + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime|null $cyclicalReenrolmentDate The new Cyclical Re-enrolment Date for the Employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reenrolAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reenrolAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $cyclicalReenrolmentDate = null, + string $contentType = self::contentTypes['reenrolAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->reenrolAutoEnrolmentRequest($employerId, $cyclicalReenrolmentDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'reenrolAutoEnrolment' + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime|null $cyclicalReenrolmentDate The new Cyclical Re-enrolment Date for the Employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reenrolAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function reenrolAutoEnrolmentRequest( + $employerId, + $cyclicalReenrolmentDate = null, + string $contentType = self::contentTypes['reenrolAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling reenrolAutoEnrolment' + ); + } + + + + $resourcePath = '/employers/{employerId}/autoenrolment/renrol'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cyclicalReenrolmentDate, + 'cyclicalReenrolmentDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setStateAutoEnrolment + * + * Update State + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to set the status for (required) + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state The AutoEnrolment State to set for the Employee (optional) + * @param \SynergiTech\Staffology\Model\AeStatus|null $status status (optional) + * @param \DateTime|null $stateDate Optional. Will default to the current date (optional) + * @param string|null $pensionId Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn (optional) + * @param string|null $workerGroupId Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. (optional) + * @param bool|null $startActionAlreadyReported startActionAlreadyReported (optional, default to false) + * @param bool|null $endActionAlreadyReported endActionAlreadyReported (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStateAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AeAssessment + */ + public function setStateAutoEnrolment( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AeEmployeeState $state = null, + ?\SynergiTech\Staffology\Model\AeStatus $status = null, + ?\DateTime $stateDate = null, + ?string $pensionId = null, + ?string $workerGroupId = null, + ?bool $startActionAlreadyReported = false, + ?bool $endActionAlreadyReported = false, + string $contentType = self::contentTypes['setStateAutoEnrolment'][0] + ): \SynergiTech\Staffology\Model\AeAssessment + { + list($response) = $this->setStateAutoEnrolmentWithHttpInfo($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported, $contentType); + return $response; + } + + /** + * Operation setStateAutoEnrolmentWithHttpInfo + * + * Update State + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to set the status for (required) + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state The AutoEnrolment State to set for the Employee (optional) + * @param \SynergiTech\Staffology\Model\AeStatus|null $status (optional) + * @param \DateTime|null $stateDate Optional. Will default to the current date (optional) + * @param string|null $pensionId Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn (optional) + * @param string|null $workerGroupId Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. (optional) + * @param bool|null $startActionAlreadyReported (optional, default to false) + * @param bool|null $endActionAlreadyReported (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStateAutoEnrolment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AeAssessment, HTTP status code, HTTP response headers (array of strings) + */ + public function setStateAutoEnrolmentWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AeEmployeeState $state = null, + ?\SynergiTech\Staffology\Model\AeStatus $status = null, + ?\DateTime $stateDate = null, + ?string $pensionId = null, + ?string $workerGroupId = null, + ?bool $startActionAlreadyReported = false, + ?bool $endActionAlreadyReported = false, + string $contentType = self::contentTypes['setStateAutoEnrolment'][0] + ): array + { + $request = $this->setStateAutoEnrolmentRequest($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\AeAssessment', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AeAssessment' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AeAssessment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AeAssessment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setStateAutoEnrolmentAsync + * + * Update State + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to set the status for (required) + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state The AutoEnrolment State to set for the Employee (optional) + * @param \SynergiTech\Staffology\Model\AeStatus|null $status (optional) + * @param \DateTime|null $stateDate Optional. Will default to the current date (optional) + * @param string|null $pensionId Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn (optional) + * @param string|null $workerGroupId Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. (optional) + * @param bool|null $startActionAlreadyReported (optional, default to false) + * @param bool|null $endActionAlreadyReported (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStateAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setStateAutoEnrolmentAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\AeEmployeeState $state = null, + ?\SynergiTech\Staffology\Model\AeStatus $status = null, + ?\DateTime $stateDate = null, + ?string $pensionId = null, + ?string $workerGroupId = null, + ?bool $startActionAlreadyReported = false, + ?bool $endActionAlreadyReported = false, + string $contentType = self::contentTypes['setStateAutoEnrolment'][0] + ): PromiseInterface + { + return $this->setStateAutoEnrolmentAsyncWithHttpInfo($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setStateAutoEnrolmentAsyncWithHttpInfo + * + * Update State + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to set the status for (required) + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state The AutoEnrolment State to set for the Employee (optional) + * @param \SynergiTech\Staffology\Model\AeStatus|null $status (optional) + * @param \DateTime|null $stateDate Optional. Will default to the current date (optional) + * @param string|null $pensionId Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn (optional) + * @param string|null $workerGroupId Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. (optional) + * @param bool|null $startActionAlreadyReported (optional, default to false) + * @param bool|null $endActionAlreadyReported (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStateAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setStateAutoEnrolmentAsyncWithHttpInfo( + $employerId, + $employeeId, + $state = null, + $status = null, + $stateDate = null, + $pensionId = null, + $workerGroupId = null, + $startActionAlreadyReported = false, + $endActionAlreadyReported = false, + string $contentType = self::contentTypes['setStateAutoEnrolment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AeAssessment'; + $request = $this->setStateAutoEnrolmentRequest($employerId, $employeeId, $state, $status, $stateDate, $pensionId, $workerGroupId, $startActionAlreadyReported, $endActionAlreadyReported, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setStateAutoEnrolment' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to set the status for (required) + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state The AutoEnrolment State to set for the Employee (optional) + * @param \SynergiTech\Staffology\Model\AeStatus|null $status (optional) + * @param \DateTime|null $stateDate Optional. Will default to the current date (optional) + * @param string|null $pensionId Optional. Used to override the default AE Pension. Only valid with states of Enrol, VoluntaryJoiner or OptIn (optional) + * @param string|null $workerGroupId Optional. Used to override the default AE Pension Workergroup. Only valid with states of Enrol, Join or OptIn. Must be provided if a pensionId is being provided. (optional) + * @param bool|null $startActionAlreadyReported (optional, default to false) + * @param bool|null $endActionAlreadyReported (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStateAutoEnrolment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setStateAutoEnrolmentRequest( + $employerId, + $employeeId, + $state = null, + $status = null, + $stateDate = null, + $pensionId = null, + $workerGroupId = null, + $startActionAlreadyReported = false, + $endActionAlreadyReported = false, + string $contentType = self::contentTypes['setStateAutoEnrolment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setStateAutoEnrolment' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling setStateAutoEnrolment' + ); + } + + + + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/autoenrolment/state'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $state, + 'state', // param base name + 'AeEmployeeState', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'AeStatus', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $stateDate, + 'stateDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pensionId, + 'pensionId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $workerGroupId, + 'workerGroupId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $startActionAlreadyReported, + 'startActionAlreadyReported', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $endActionAlreadyReported, + 'endActionAlreadyReported', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/AverageHolidayPayHistoryApi.php b/src/Api/AverageHolidayPayHistoryApi.php new file mode 100644 index 0000000..d531315 --- /dev/null +++ b/src/Api/AverageHolidayPayHistoryApi.php @@ -0,0 +1,2274 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteAverageHolidayPayHistory' => [ + 'application/json', + ], + 'deleteByEmployeeIdAverageHolidayPayHistory' => [ + 'application/json', + ], + 'getByEmployeeAverageHolidayPayHistory' => [ + 'application/json', + ], + 'getByEmployerAverageHolidayPayHistory' => [ + 'application/json', + ], + 'importCsvAverageHolidayPayHistory' => [ + 'multipart/form-data', + ], + 'updateAverageHolidayPayHistory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createAverageHolidayPayHistory + * + * Create multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryRequest[]|null $contractPayHistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createAverageHolidayPayHistory( + string $employerId, + ?array $contractPayHistoryRequest = null, + string $contentType = self::contentTypes['createAverageHolidayPayHistory'][0] + ): void + { + $this->createAverageHolidayPayHistoryWithHttpInfo($employerId, $contractPayHistoryRequest, $contentType); + } + + /** + * Operation createAverageHolidayPayHistoryWithHttpInfo + * + * Create multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryRequest[]|null $contractPayHistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + ?array $contractPayHistoryRequest = null, + string $contentType = self::contentTypes['createAverageHolidayPayHistory'][0] + ): array + { + $request = $this->createAverageHolidayPayHistoryRequest($employerId, $contractPayHistoryRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createAverageHolidayPayHistoryAsync + * + * Create multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryRequest[]|null $contractPayHistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAverageHolidayPayHistoryAsync( + string $employerId, + ?array $contractPayHistoryRequest = null, + string $contentType = self::contentTypes['createAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->createAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $contractPayHistoryRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Create multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryRequest[]|null $contractPayHistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $contractPayHistoryRequest = null, + string $contentType = self::contentTypes['createAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createAverageHolidayPayHistoryRequest($employerId, $contractPayHistoryRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAverageHolidayPayHistory' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryRequest[]|null $contractPayHistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAverageHolidayPayHistoryRequest( + $employerId, + $contractPayHistoryRequest = null, + string $contentType = self::contentTypes['createAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createAverageHolidayPayHistory' + ); + } + + + + $resourcePath = '/{employerId}/employees/AverageHolidayPay/PayHistory'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayHistoryRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayHistoryRequest)); + } else { + $httpBody = $contractPayHistoryRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAverageHolidayPayHistory + * + * Delete an AverageHolidayPayHistory record + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $id The pay history unique id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAverageHolidayPayHistory( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAverageHolidayPayHistory'][0] + ): void + { + $this->deleteAverageHolidayPayHistoryWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteAverageHolidayPayHistoryWithHttpInfo + * + * Delete an AverageHolidayPayHistory record + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $id The pay history unique id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAverageHolidayPayHistory'][0] + ): array + { + $request = $this->deleteAverageHolidayPayHistoryRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAverageHolidayPayHistoryAsync + * + * Delete an AverageHolidayPayHistory record + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $id The pay history unique id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAverageHolidayPayHistoryAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->deleteAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Delete an AverageHolidayPayHistory record + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $id The pay history unique id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAverageHolidayPayHistoryRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAverageHolidayPayHistory' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $id The pay history unique id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAverageHolidayPayHistoryRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAverageHolidayPayHistory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteAverageHolidayPayHistory' + ); + } + + + $resourcePath = '/{employerId}/employees/AverageHolidayPay/PayHistory/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteByEmployeeIdAverageHolidayPayHistory + * + * Delete all AverageHolidayPayHistory for an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteByEmployeeIdAverageHolidayPayHistory( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'][0] + ): void + { + $this->deleteByEmployeeIdAverageHolidayPayHistoryWithHttpInfo($employerId, $employeeId, $contentType); + } + + /** + * Operation deleteByEmployeeIdAverageHolidayPayHistoryWithHttpInfo + * + * Delete all AverageHolidayPayHistory for an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteByEmployeeIdAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'][0] + ): array + { + $request = $this->deleteByEmployeeIdAverageHolidayPayHistoryRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteByEmployeeIdAverageHolidayPayHistoryAsync + * + * Delete all AverageHolidayPayHistory for an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteByEmployeeIdAverageHolidayPayHistoryAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->deleteByEmployeeIdAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteByEmployeeIdAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Delete all AverageHolidayPayHistory for an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteByEmployeeIdAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteByEmployeeIdAverageHolidayPayHistoryRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteByEmployeeIdAverageHolidayPayHistory' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteByEmployeeIdAverageHolidayPayHistoryRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['deleteByEmployeeIdAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteByEmployeeIdAverageHolidayPayHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteByEmployeeIdAverageHolidayPayHistory' + ); + } + + + $resourcePath = '/{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getByEmployeeAverageHolidayPayHistory + * + * List AverageHolidayPayHistory for Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want the history. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployeeAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayHistoryResponse[] + */ + public function getByEmployeeAverageHolidayPayHistory( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getByEmployeeAverageHolidayPayHistory'][0] + ): array + { + list($response) = $this->getByEmployeeAverageHolidayPayHistoryWithHttpInfo($employerId, $employeeId, $taxYear, $contentType); + return $response; + } + + /** + * Operation getByEmployeeAverageHolidayPayHistoryWithHttpInfo + * + * List AverageHolidayPayHistory for Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want the history. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployeeAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayHistoryResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getByEmployeeAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getByEmployeeAverageHolidayPayHistory'][0] + ): array + { + $request = $this->getByEmployeeAverageHolidayPayHistoryRequest($employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getByEmployeeAverageHolidayPayHistoryAsync + * + * List AverageHolidayPayHistory for Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want the history. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployeeAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByEmployeeAverageHolidayPayHistoryAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getByEmployeeAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->getByEmployeeAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getByEmployeeAverageHolidayPayHistoryAsyncWithHttpInfo + * + * List AverageHolidayPayHistory for Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want the history. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployeeAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByEmployeeAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + string $contentType = self::contentTypes['getByEmployeeAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]'; + $request = $this->getByEmployeeAverageHolidayPayHistoryRequest($employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getByEmployeeAverageHolidayPayHistory' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want the history. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployeeAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getByEmployeeAverageHolidayPayHistoryRequest( + $employerId, + $employeeId, + $taxYear, + string $contentType = self::contentTypes['getByEmployeeAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getByEmployeeAverageHolidayPayHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getByEmployeeAverageHolidayPayHistory' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getByEmployeeAverageHolidayPayHistory' + ); + } + + + $resourcePath = '/{employerId}/employees/{employeeId}/AverageHolidayPay/PayHistory/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getByEmployerAverageHolidayPayHistory + * + * Get AverageHolidayPayHistory for Employer + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployerAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayHistoryResponse[] + */ + public function getByEmployerAverageHolidayPayHistory( + string $employerId, + string $contentType = self::contentTypes['getByEmployerAverageHolidayPayHistory'][0] + ): array + { + list($response) = $this->getByEmployerAverageHolidayPayHistoryWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getByEmployerAverageHolidayPayHistoryWithHttpInfo + * + * Get AverageHolidayPayHistory for Employer + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployerAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayHistoryResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getByEmployerAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getByEmployerAverageHolidayPayHistory'][0] + ): array + { + $request = $this->getByEmployerAverageHolidayPayHistoryRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getByEmployerAverageHolidayPayHistoryAsync + * + * Get AverageHolidayPayHistory for Employer + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployerAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByEmployerAverageHolidayPayHistoryAsync( + string $employerId, + string $contentType = self::contentTypes['getByEmployerAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->getByEmployerAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getByEmployerAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Get AverageHolidayPayHistory for Employer + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployerAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByEmployerAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getByEmployerAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayHistoryResponse[]'; + $request = $this->getByEmployerAverageHolidayPayHistoryRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getByEmployerAverageHolidayPayHistory' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByEmployerAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getByEmployerAverageHolidayPayHistoryRequest( + $employerId, + string $contentType = self::contentTypes['getByEmployerAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getByEmployerAverageHolidayPayHistory' + ); + } + + + $resourcePath = '/{employerId}/employees/AverageHolidayPay/PayHistory'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCsvAverageHolidayPayHistory + * + * Import AverageHistoryPayHistory from csv file + * + * @param string $employerId employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importCsvAverageHolidayPayHistory( + string $employerId, + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvAverageHolidayPayHistory'][0] + ): array + { + list($response) = $this->importCsvAverageHolidayPayHistoryWithHttpInfo($employerId, $previewOnly, $file, $contentType); + return $response; + } + + /** + * Operation importCsvAverageHolidayPayHistoryWithHttpInfo + * + * Import AverageHistoryPayHistory from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importCsvAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvAverageHolidayPayHistory'][0] + ): array + { + $request = $this->importCsvAverageHolidayPayHistoryRequest($employerId, $previewOnly, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCsvAverageHolidayPayHistoryAsync + * + * Import AverageHistoryPayHistory from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvAverageHolidayPayHistoryAsync( + string $employerId, + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->importCsvAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $previewOnly, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCsvAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Import AverageHistoryPayHistory from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $previewOnly = false, + $file = null, + string $contentType = self::contentTypes['importCsvAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importCsvAverageHolidayPayHistoryRequest($employerId, $previewOnly, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCsvAverageHolidayPayHistory' + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importCsvAverageHolidayPayHistoryRequest( + $employerId, + $previewOnly = false, + $file = null, + string $contentType = self::contentTypes['importCsvAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importCsvAverageHolidayPayHistory' + ); + } + + + + + $resourcePath = '/{employerId}/employees/AverageHolidayPay/PayHistory/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $previewOnly, + 'previewOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAverageHolidayPayHistory + * + * Update multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]|null $contractPayHistoryUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function updateAverageHolidayPayHistory( + string $employerId, + ?array $contractPayHistoryUpdateRequest = null, + string $contentType = self::contentTypes['updateAverageHolidayPayHistory'][0] + ): void + { + $this->updateAverageHolidayPayHistoryWithHttpInfo($employerId, $contractPayHistoryUpdateRequest, $contentType); + } + + /** + * Operation updateAverageHolidayPayHistoryWithHttpInfo + * + * Update multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]|null $contractPayHistoryUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAverageHolidayPayHistoryWithHttpInfo( + string $employerId, + ?array $contractPayHistoryUpdateRequest = null, + string $contentType = self::contentTypes['updateAverageHolidayPayHistory'][0] + ): array + { + $request = $this->updateAverageHolidayPayHistoryRequest($employerId, $contractPayHistoryUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation updateAverageHolidayPayHistoryAsync + * + * Update multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]|null $contractPayHistoryUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAverageHolidayPayHistoryAsync( + string $employerId, + ?array $contractPayHistoryUpdateRequest = null, + string $contentType = self::contentTypes['updateAverageHolidayPayHistory'][0] + ): PromiseInterface + { + return $this->updateAverageHolidayPayHistoryAsyncWithHttpInfo($employerId, $contractPayHistoryUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAverageHolidayPayHistoryAsyncWithHttpInfo + * + * Update multiple AverageHolidayPayHistory for an Employer + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]|null $contractPayHistoryUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAverageHolidayPayHistoryAsyncWithHttpInfo( + $employerId, + $contractPayHistoryUpdateRequest = null, + string $contentType = self::contentTypes['updateAverageHolidayPayHistory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->updateAverageHolidayPayHistoryRequest($employerId, $contractPayHistoryUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAverageHolidayPayHistory' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPayHistoryUpdateRequest[]|null $contractPayHistoryUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAverageHolidayPayHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAverageHolidayPayHistoryRequest( + $employerId, + $contractPayHistoryUpdateRequest = null, + string $contentType = self::contentTypes['updateAverageHolidayPayHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateAverageHolidayPayHistory' + ); + } + + + + $resourcePath = '/{employerId}/employees/AverageHolidayPay/PayHistory'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayHistoryUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayHistoryUpdateRequest)); + } else { + $httpBody = $contractPayHistoryUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/BenefitsApi.php b/src/Api/BenefitsApi.php new file mode 100644 index 0000000..48d62df --- /dev/null +++ b/src/Api/BenefitsApi.php @@ -0,0 +1,1851 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteBenefits' => [ + 'application/json', + ], + 'getBenefits' => [ + 'application/json', + ], + 'indexBenefits' => [ + 'application/json', + ], + 'updateBenefits' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createBenefits + * + * Create Benefit + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createBenefits( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['createBenefits'][0] + ): void + { + $this->createBenefitsWithHttpInfo($employerId, $employeeId, $benefit, $contentType); + } + + /** + * Operation createBenefitsWithHttpInfo + * + * Create Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createBenefitsWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['createBenefits'][0] + ): array + { + $request = $this->createBenefitsRequest($employerId, $employeeId, $benefit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createBenefitsAsync + * + * Create Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createBenefitsAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['createBenefits'][0] + ): PromiseInterface + { + return $this->createBenefitsAsyncWithHttpInfo($employerId, $employeeId, $benefit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createBenefitsAsyncWithHttpInfo + * + * Create Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createBenefitsAsyncWithHttpInfo( + $employerId, + $employeeId, + $benefit = null, + string $contentType = self::contentTypes['createBenefits'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createBenefitsRequest($employerId, $employeeId, $benefit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createBenefits' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createBenefitsRequest( + $employerId, + $employeeId, + $benefit = null, + string $contentType = self::contentTypes['createBenefits'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createBenefits' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createBenefits' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/benefits'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($benefit)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($benefit)); + } else { + $httpBody = $benefit; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteBenefits + * + * Delete Benefit + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Benefit you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteBenefits( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteBenefits'][0] + ): void + { + $this->deleteBenefitsWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteBenefitsWithHttpInfo + * + * Delete Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteBenefitsWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteBenefits'][0] + ): array + { + $request = $this->deleteBenefitsRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteBenefitsAsync + * + * Delete Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteBenefitsAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteBenefits'][0] + ): PromiseInterface + { + return $this->deleteBenefitsAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteBenefitsAsyncWithHttpInfo + * + * Delete Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteBenefitsAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteBenefits'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteBenefitsRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteBenefits' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteBenefitsRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteBenefits'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteBenefits' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteBenefits' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteBenefits' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/benefits/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBenefits + * + * Get Benefit + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Benefit you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Benefit + */ + public function getBenefits( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getBenefits'][0] + ): \SynergiTech\Staffology\Model\Benefit + { + list($response) = $this->getBenefitsWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getBenefitsWithHttpInfo + * + * Get Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Benefit, HTTP status code, HTTP response headers (array of strings) + */ + public function getBenefitsWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getBenefits'][0] + ): array + { + $request = $this->getBenefitsRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Benefit', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Benefit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Benefit', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Benefit'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Benefit', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBenefitsAsync + * + * Get Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBenefitsAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getBenefits'][0] + ): PromiseInterface + { + return $this->getBenefitsAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBenefitsAsyncWithHttpInfo + * + * Get Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBenefitsAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getBenefits'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Benefit'; + $request = $this->getBenefitsRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBenefits' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBenefitsRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getBenefits'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getBenefits' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getBenefits' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getBenefits' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/benefits/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexBenefits + * + * List Benefits + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexBenefits( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexBenefits'][0] + ): array + { + list($response) = $this->indexBenefitsWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexBenefitsWithHttpInfo + * + * List Benefits + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexBenefitsWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexBenefits'][0] + ): array + { + $request = $this->indexBenefitsRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexBenefitsAsync + * + * List Benefits + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexBenefitsAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexBenefits'][0] + ): PromiseInterface + { + return $this->indexBenefitsAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexBenefitsAsyncWithHttpInfo + * + * List Benefits + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexBenefitsAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexBenefits'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexBenefitsRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexBenefits' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexBenefitsRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexBenefits'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexBenefits' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexBenefits' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/benefits'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateBenefits + * + * Update Benefit + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Benefit you want to update. (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Benefit + */ + public function updateBenefits( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['updateBenefits'][0] + ): \SynergiTech\Staffology\Model\Benefit + { + list($response) = $this->updateBenefitsWithHttpInfo($employerId, $employeeId, $id, $benefit, $contentType); + return $response; + } + + /** + * Operation updateBenefitsWithHttpInfo + * + * Update Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to update. (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBenefits'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Benefit, HTTP status code, HTTP response headers (array of strings) + */ + public function updateBenefitsWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['updateBenefits'][0] + ): array + { + $request = $this->updateBenefitsRequest($employerId, $employeeId, $id, $benefit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Benefit', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Benefit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Benefit', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Benefit'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Benefit', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateBenefitsAsync + * + * Update Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to update. (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateBenefitsAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Benefit $benefit = null, + string $contentType = self::contentTypes['updateBenefits'][0] + ): PromiseInterface + { + return $this->updateBenefitsAsyncWithHttpInfo($employerId, $employeeId, $id, $benefit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateBenefitsAsyncWithHttpInfo + * + * Update Benefit + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to update. (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateBenefitsAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $benefit = null, + string $contentType = self::contentTypes['updateBenefits'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Benefit'; + $request = $this->updateBenefitsRequest($employerId, $employeeId, $id, $benefit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateBenefits' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Benefit you want to update. (required) + * @param \SynergiTech\Staffology\Model\Benefit|null $benefit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBenefits'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateBenefitsRequest( + $employerId, + $employeeId, + $id, + $benefit = null, + string $contentType = self::contentTypes['updateBenefits'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateBenefits' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateBenefits' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateBenefits' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/benefits/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($benefit)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($benefit)); + } else { + $httpBody = $benefit; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/BillingApi.php b/src/Api/BillingApi.php new file mode 100644 index 0000000..c960bc6 --- /dev/null +++ b/src/Api/BillingApi.php @@ -0,0 +1,2544 @@ + [ + 'application/json', + ], + 'billCsvBilling' => [ + 'application/json', + ], + 'billsBilling' => [ + 'application/json', + ], + 'confirmDirectDebitMandateBilling' => [ + 'application/json', + ], + 'deleteDirectDebitMandateBilling' => [ + 'application/json', + ], + 'directDebitMandateBilling' => [ + 'application/json', + ], + 'getUsageStatsBilling' => [ + 'application/json', + ], + 'setupDirectDebitMandateBilling' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation billBilling + * + * Get Bill + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\UsageBill + */ + public function billBilling( + string $id, + string $contentType = self::contentTypes['billBilling'][0] + ): \SynergiTech\Staffology\Model\UsageBill + { + list($response) = $this->billBillingWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation billBillingWithHttpInfo + * + * Get Bill + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\UsageBill, HTTP status code, HTTP response headers (array of strings) + */ + public function billBillingWithHttpInfo( + string $id, + string $contentType = self::contentTypes['billBilling'][0] + ): array + { + $request = $this->billBillingRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\UsageBill', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\UsageBill' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\UsageBill', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\UsageBill', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation billBillingAsync + * + * Get Bill + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billBillingAsync( + string $id, + string $contentType = self::contentTypes['billBilling'][0] + ): PromiseInterface + { + return $this->billBillingAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation billBillingAsyncWithHttpInfo + * + * Get Bill + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billBillingAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['billBilling'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + $request = $this->billBillingRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'billBilling' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function billBillingRequest( + $id, + string $contentType = self::contentTypes['billBilling'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling billBilling' + ); + } + + + $resourcePath = '/billing/bill/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation billCsvBilling + * + * Get Bill CSV + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billCsvBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function billCsvBilling( + string $id, + string $contentType = self::contentTypes['billCsvBilling'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->billCsvBillingWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation billCsvBillingWithHttpInfo + * + * Get Bill CSV + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billCsvBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function billCsvBillingWithHttpInfo( + string $id, + string $contentType = self::contentTypes['billCsvBilling'][0] + ): array + { + $request = $this->billCsvBillingRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation billCsvBillingAsync + * + * Get Bill CSV + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billCsvBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billCsvBillingAsync( + string $id, + string $contentType = self::contentTypes['billCsvBilling'][0] + ): PromiseInterface + { + return $this->billCsvBillingAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation billCsvBillingAsyncWithHttpInfo + * + * Get Bill CSV + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billCsvBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billCsvBillingAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['billCsvBilling'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->billCsvBillingRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'billCsvBilling' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billCsvBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function billCsvBillingRequest( + $id, + string $contentType = self::contentTypes['billCsvBilling'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling billCsvBilling' + ); + } + + + $resourcePath = '/billing/bill/{id}/csv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation billsBilling + * + * List Bills + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function billsBilling( + string $contentType = self::contentTypes['billsBilling'][0] + ): array + { + list($response) = $this->billsBillingWithHttpInfo($contentType); + return $response; + } + + /** + * Operation billsBillingWithHttpInfo + * + * List Bills + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function billsBillingWithHttpInfo( + string $contentType = self::contentTypes['billsBilling'][0] + ): array + { + $request = $this->billsBillingRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation billsBillingAsync + * + * List Bills + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billsBillingAsync( + string $contentType = self::contentTypes['billsBilling'][0] + ): PromiseInterface + { + return $this->billsBillingAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation billsBillingAsyncWithHttpInfo + * + * List Bills + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billsBillingAsyncWithHttpInfo( + string $contentType = self::contentTypes['billsBilling'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->billsBillingRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'billsBilling' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function billsBillingRequest( + string $contentType = self::contentTypes['billsBilling'][0] + ): Request + { + + + $resourcePath = '/billing/bills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation confirmDirectDebitMandateBilling + * + * Confirm Direct Debit Setup + * + * @param string|null $redirectFlowId redirectFlowId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function confirmDirectDebitMandateBilling( + ?string $redirectFlowId = null, + string $contentType = self::contentTypes['confirmDirectDebitMandateBilling'][0] + ): void + { + $this->confirmDirectDebitMandateBillingWithHttpInfo($redirectFlowId, $contentType); + } + + /** + * Operation confirmDirectDebitMandateBillingWithHttpInfo + * + * Confirm Direct Debit Setup + * + * @param string|null $redirectFlowId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function confirmDirectDebitMandateBillingWithHttpInfo( + ?string $redirectFlowId = null, + string $contentType = self::contentTypes['confirmDirectDebitMandateBilling'][0] + ): array + { + $request = $this->confirmDirectDebitMandateBillingRequest($redirectFlowId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation confirmDirectDebitMandateBillingAsync + * + * Confirm Direct Debit Setup + * + * @param string|null $redirectFlowId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function confirmDirectDebitMandateBillingAsync( + ?string $redirectFlowId = null, + string $contentType = self::contentTypes['confirmDirectDebitMandateBilling'][0] + ): PromiseInterface + { + return $this->confirmDirectDebitMandateBillingAsyncWithHttpInfo($redirectFlowId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation confirmDirectDebitMandateBillingAsyncWithHttpInfo + * + * Confirm Direct Debit Setup + * + * @param string|null $redirectFlowId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function confirmDirectDebitMandateBillingAsyncWithHttpInfo( + $redirectFlowId = null, + string $contentType = self::contentTypes['confirmDirectDebitMandateBilling'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->confirmDirectDebitMandateBillingRequest($redirectFlowId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'confirmDirectDebitMandateBilling' + * + * @param string|null $redirectFlowId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function confirmDirectDebitMandateBillingRequest( + $redirectFlowId = null, + string $contentType = self::contentTypes['confirmDirectDebitMandateBilling'][0] + ): Request + { + + + + $resourcePath = '/billing/directdebit/confirm'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $redirectFlowId, + 'redirect_flow_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDirectDebitMandateBilling + * + * Delete DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDirectDebitMandateBilling( + string $contentType = self::contentTypes['deleteDirectDebitMandateBilling'][0] + ): void + { + $this->deleteDirectDebitMandateBillingWithHttpInfo($contentType); + } + + /** + * Operation deleteDirectDebitMandateBillingWithHttpInfo + * + * Delete DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDirectDebitMandateBillingWithHttpInfo( + string $contentType = self::contentTypes['deleteDirectDebitMandateBilling'][0] + ): array + { + $request = $this->deleteDirectDebitMandateBillingRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDirectDebitMandateBillingAsync + * + * Delete DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDirectDebitMandateBillingAsync( + string $contentType = self::contentTypes['deleteDirectDebitMandateBilling'][0] + ): PromiseInterface + { + return $this->deleteDirectDebitMandateBillingAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDirectDebitMandateBillingAsyncWithHttpInfo + * + * Delete DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDirectDebitMandateBillingAsyncWithHttpInfo( + string $contentType = self::contentTypes['deleteDirectDebitMandateBilling'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDirectDebitMandateBillingRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDirectDebitMandateBilling' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDirectDebitMandateBillingRequest( + string $contentType = self::contentTypes['deleteDirectDebitMandateBilling'][0] + ): Request + { + + + $resourcePath = '/billing/directdebit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation directDebitMandateBilling + * + * Get DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['directDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DirectDebitMandate + */ + public function directDebitMandateBilling( + string $contentType = self::contentTypes['directDebitMandateBilling'][0] + ): \SynergiTech\Staffology\Model\DirectDebitMandate + { + list($response) = $this->directDebitMandateBillingWithHttpInfo($contentType); + return $response; + } + + /** + * Operation directDebitMandateBillingWithHttpInfo + * + * Get DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['directDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DirectDebitMandate, HTTP status code, HTTP response headers (array of strings) + */ + public function directDebitMandateBillingWithHttpInfo( + string $contentType = self::contentTypes['directDebitMandateBilling'][0] + ): array + { + $request = $this->directDebitMandateBillingRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DirectDebitMandate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DirectDebitMandate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DirectDebitMandate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DirectDebitMandate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DirectDebitMandate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation directDebitMandateBillingAsync + * + * Get DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['directDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function directDebitMandateBillingAsync( + string $contentType = self::contentTypes['directDebitMandateBilling'][0] + ): PromiseInterface + { + return $this->directDebitMandateBillingAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation directDebitMandateBillingAsyncWithHttpInfo + * + * Get DirectDebitMandate + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['directDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function directDebitMandateBillingAsyncWithHttpInfo( + string $contentType = self::contentTypes['directDebitMandateBilling'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DirectDebitMandate'; + $request = $this->directDebitMandateBillingRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'directDebitMandateBilling' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['directDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function directDebitMandateBillingRequest( + string $contentType = self::contentTypes['directDebitMandateBilling'][0] + ): Request + { + + + $resourcePath = '/billing/directdebit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUsageStatsBilling + * + * Get UsageStats Report + * + * @param \DateTime|null $fromDate fromDate (optional) + * @param \DateTime|null $toDate toDate (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsageStatsBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getUsageStatsBilling( + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['getUsageStatsBilling'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getUsageStatsBillingWithHttpInfo($fromDate, $toDate, $accept, $contentType); + return $response; + } + + /** + * Operation getUsageStatsBillingWithHttpInfo + * + * Get UsageStats Report + * + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsageStatsBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getUsageStatsBillingWithHttpInfo( + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['getUsageStatsBilling'][0] + ): array + { + $request = $this->getUsageStatsBillingRequest($fromDate, $toDate, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUsageStatsBillingAsync + * + * Get UsageStats Report + * + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsageStatsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUsageStatsBillingAsync( + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['getUsageStatsBilling'][0] + ): PromiseInterface + { + return $this->getUsageStatsBillingAsyncWithHttpInfo($fromDate, $toDate, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUsageStatsBillingAsyncWithHttpInfo + * + * Get UsageStats Report + * + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsageStatsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUsageStatsBillingAsyncWithHttpInfo( + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['getUsageStatsBilling'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getUsageStatsBillingRequest($fromDate, $toDate, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUsageStatsBilling' + * + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsageStatsBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUsageStatsBillingRequest( + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['getUsageStatsBilling'][0] + ): Request + { + + + + + + $resourcePath = '/billing/usage-stats'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromDate, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toDate, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setupDirectDebitMandateBilling + * + * Setup DirectDebitMandate + * + * @param string|null $returnUrl returnUrl (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setupDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function setupDirectDebitMandateBilling( + ?string $returnUrl = null, + string $contentType = self::contentTypes['setupDirectDebitMandateBilling'][0] + ): string + { + list($response) = $this->setupDirectDebitMandateBillingWithHttpInfo($returnUrl, $contentType); + return $response; + } + + /** + * Operation setupDirectDebitMandateBillingWithHttpInfo + * + * Setup DirectDebitMandate + * + * @param string|null $returnUrl (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setupDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function setupDirectDebitMandateBillingWithHttpInfo( + ?string $returnUrl = null, + string $contentType = self::contentTypes['setupDirectDebitMandateBilling'][0] + ): array + { + $request = $this->setupDirectDebitMandateBillingRequest($returnUrl, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setupDirectDebitMandateBillingAsync + * + * Setup DirectDebitMandate + * + * @param string|null $returnUrl (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setupDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setupDirectDebitMandateBillingAsync( + ?string $returnUrl = null, + string $contentType = self::contentTypes['setupDirectDebitMandateBilling'][0] + ): PromiseInterface + { + return $this->setupDirectDebitMandateBillingAsyncWithHttpInfo($returnUrl, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setupDirectDebitMandateBillingAsyncWithHttpInfo + * + * Setup DirectDebitMandate + * + * @param string|null $returnUrl (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setupDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setupDirectDebitMandateBillingAsyncWithHttpInfo( + $returnUrl = null, + string $contentType = self::contentTypes['setupDirectDebitMandateBilling'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->setupDirectDebitMandateBillingRequest($returnUrl, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setupDirectDebitMandateBilling' + * + * @param string|null $returnUrl (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setupDirectDebitMandateBilling'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setupDirectDebitMandateBillingRequest( + $returnUrl = null, + string $contentType = self::contentTypes['setupDirectDebitMandateBilling'][0] + ): Request + { + + + + $resourcePath = '/billing/directdebit/setup'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $returnUrl, + 'returnUrl', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/BureauApi.php b/src/Api/BureauApi.php new file mode 100644 index 0000000..dafee54 --- /dev/null +++ b/src/Api/BureauApi.php @@ -0,0 +1,2112 @@ + [ + 'application/json', + ], + 'getProcessorUserBureau' => [ + 'application/json', + ], + 'getReportPackBureau' => [ + 'application/json', + ], + 'getSettingsBureau' => [ + 'application/json', + ], + 'processorUsersBureau' => [ + 'application/json', + ], + 'updateSettingsBureau' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation employersBureau + * + * List Employers + * + * @param string|null $processor The Id of the Processor (User) you want to restrict the list to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employersBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employersBureau( + ?string $processor = null, + string $contentType = self::contentTypes['employersBureau'][0] + ): array + { + list($response) = $this->employersBureauWithHttpInfo($processor, $contentType); + return $response; + } + + /** + * Operation employersBureauWithHttpInfo + * + * List Employers + * + * @param string|null $processor The Id of the Processor (User) you want to restrict the list to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employersBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employersBureauWithHttpInfo( + ?string $processor = null, + string $contentType = self::contentTypes['employersBureau'][0] + ): array + { + $request = $this->employersBureauRequest($processor, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employersBureauAsync + * + * List Employers + * + * @param string|null $processor The Id of the Processor (User) you want to restrict the list to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employersBureauAsync( + ?string $processor = null, + string $contentType = self::contentTypes['employersBureau'][0] + ): PromiseInterface + { + return $this->employersBureauAsyncWithHttpInfo($processor, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employersBureauAsyncWithHttpInfo + * + * List Employers + * + * @param string|null $processor The Id of the Processor (User) you want to restrict the list to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employersBureauAsyncWithHttpInfo( + $processor = null, + string $contentType = self::contentTypes['employersBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employersBureauRequest($processor, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employersBureau' + * + * @param string|null $processor The Id of the Processor (User) you want to restrict the list to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employersBureauRequest( + $processor = null, + string $contentType = self::contentTypes['employersBureau'][0] + ): Request + { + + + + $resourcePath = '/bureau/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $processor, + 'processor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProcessorUserBureau + * + * Get Processor + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessorUserBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\User + */ + public function getProcessorUserBureau( + string $employerId, + string $contentType = self::contentTypes['getProcessorUserBureau'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->getProcessorUserBureauWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getProcessorUserBureauWithHttpInfo + * + * Get Processor + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessorUserBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function getProcessorUserBureauWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getProcessorUserBureau'][0] + ): array + { + $request = $this->getProcessorUserBureauRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProcessorUserBureauAsync + * + * Get Processor + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessorUserBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getProcessorUserBureauAsync( + string $employerId, + string $contentType = self::contentTypes['getProcessorUserBureau'][0] + ): PromiseInterface + { + return $this->getProcessorUserBureauAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProcessorUserBureauAsyncWithHttpInfo + * + * Get Processor + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessorUserBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getProcessorUserBureauAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getProcessorUserBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->getProcessorUserBureauRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProcessorUserBureau' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessorUserBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProcessorUserBureauRequest( + $employerId, + string $contentType = self::contentTypes['getProcessorUserBureau'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getProcessorUserBureau' + ); + } + + + $resourcePath = '/employers/{employerId}/bureau/settings/processor'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportPackBureau + * + * Get BureauSettings ReportPack + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPackBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportPack + */ + public function getReportPackBureau( + string $employerId, + string $contentType = self::contentTypes['getReportPackBureau'][0] + ): \SynergiTech\Staffology\Model\ReportPack + { + list($response) = $this->getReportPackBureauWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getReportPackBureauWithHttpInfo + * + * Get BureauSettings ReportPack + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPackBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportPack, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportPackBureauWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getReportPackBureau'][0] + ): array + { + $request = $this->getReportPackBureauRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportPack', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportPack' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportPack', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportPack', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReportPackBureauAsync + * + * Get BureauSettings ReportPack + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPackBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportPackBureauAsync( + string $employerId, + string $contentType = self::contentTypes['getReportPackBureau'][0] + ): PromiseInterface + { + return $this->getReportPackBureauAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportPackBureauAsyncWithHttpInfo + * + * Get BureauSettings ReportPack + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPackBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportPackBureauAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getReportPackBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + $request = $this->getReportPackBureauRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportPackBureau' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPackBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportPackBureauRequest( + $employerId, + string $contentType = self::contentTypes['getReportPackBureau'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getReportPackBureau' + ); + } + + + $resourcePath = '/employers/{employerId}/bureau/settings/reportpack'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSettingsBureau + * + * Get BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSettingsBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\BureauSettings + */ + public function getSettingsBureau( + string $employerId, + string $contentType = self::contentTypes['getSettingsBureau'][0] + ): \SynergiTech\Staffology\Model\BureauSettings + { + list($response) = $this->getSettingsBureauWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getSettingsBureauWithHttpInfo + * + * Get BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSettingsBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\BureauSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getSettingsBureauWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getSettingsBureau'][0] + ): array + { + $request = $this->getSettingsBureauRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\BureauSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\BureauSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\BureauSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\BureauSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\BureauSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSettingsBureauAsync + * + * Get BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSettingsBureauAsync( + string $employerId, + string $contentType = self::contentTypes['getSettingsBureau'][0] + ): PromiseInterface + { + return $this->getSettingsBureauAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSettingsBureauAsyncWithHttpInfo + * + * Get BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSettingsBureauAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getSettingsBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\BureauSettings'; + $request = $this->getSettingsBureauRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSettingsBureau' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSettingsBureauRequest( + $employerId, + string $contentType = self::contentTypes['getSettingsBureau'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getSettingsBureau' + ); + } + + + $resourcePath = '/employers/{employerId}/bureau/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation processorUsersBureau + * + * List Allocated Processors + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['processorUsersBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function processorUsersBureau( + string $contentType = self::contentTypes['processorUsersBureau'][0] + ): array + { + list($response) = $this->processorUsersBureauWithHttpInfo($contentType); + return $response; + } + + /** + * Operation processorUsersBureauWithHttpInfo + * + * List Allocated Processors + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['processorUsersBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function processorUsersBureauWithHttpInfo( + string $contentType = self::contentTypes['processorUsersBureau'][0] + ): array + { + $request = $this->processorUsersBureauRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation processorUsersBureauAsync + * + * List Allocated Processors + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['processorUsersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function processorUsersBureauAsync( + string $contentType = self::contentTypes['processorUsersBureau'][0] + ): PromiseInterface + { + return $this->processorUsersBureauAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation processorUsersBureauAsyncWithHttpInfo + * + * List Allocated Processors + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['processorUsersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function processorUsersBureauAsyncWithHttpInfo( + string $contentType = self::contentTypes['processorUsersBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->processorUsersBureauRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'processorUsersBureau' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['processorUsersBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function processorUsersBureauRequest( + string $contentType = self::contentTypes['processorUsersBureau'][0] + ): Request + { + + + $resourcePath = '/bureau/processors'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSettingsBureau + * + * Update BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\BureauSettings|null $bureauSettings bureauSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSettingsBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\BureauSettings + */ + public function updateSettingsBureau( + string $employerId, + ?\SynergiTech\Staffology\Model\BureauSettings $bureauSettings = null, + string $contentType = self::contentTypes['updateSettingsBureau'][0] + ): \SynergiTech\Staffology\Model\BureauSettings + { + list($response) = $this->updateSettingsBureauWithHttpInfo($employerId, $bureauSettings, $contentType); + return $response; + } + + /** + * Operation updateSettingsBureauWithHttpInfo + * + * Update BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\BureauSettings|null $bureauSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSettingsBureau'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\BureauSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSettingsBureauWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\BureauSettings $bureauSettings = null, + string $contentType = self::contentTypes['updateSettingsBureau'][0] + ): array + { + $request = $this->updateSettingsBureauRequest($employerId, $bureauSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\BureauSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\BureauSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\BureauSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\BureauSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\BureauSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSettingsBureauAsync + * + * Update BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\BureauSettings|null $bureauSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSettingsBureauAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\BureauSettings $bureauSettings = null, + string $contentType = self::contentTypes['updateSettingsBureau'][0] + ): PromiseInterface + { + return $this->updateSettingsBureauAsyncWithHttpInfo($employerId, $bureauSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSettingsBureauAsyncWithHttpInfo + * + * Update BureauSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\BureauSettings|null $bureauSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSettingsBureauAsyncWithHttpInfo( + $employerId, + $bureauSettings = null, + string $contentType = self::contentTypes['updateSettingsBureau'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\BureauSettings'; + $request = $this->updateSettingsBureauRequest($employerId, $bureauSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSettingsBureau' + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\BureauSettings|null $bureauSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSettingsBureau'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSettingsBureauRequest( + $employerId, + $bureauSettings = null, + string $contentType = self::contentTypes['updateSettingsBureau'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateSettingsBureau' + ); + } + + + + $resourcePath = '/employers/{employerId}/bureau/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($bureauSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($bureauSettings)); + } else { + $httpBody = $bureauSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/Cis300Api.php b/src/Api/Cis300Api.php new file mode 100644 index 0000000..1182b70 --- /dev/null +++ b/src/Api/Cis300Api.php @@ -0,0 +1,3432 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteCis300' => [ + 'application/json', + ], + 'getCis300' => [ + 'application/json', + ], + 'getXmlRequestCis300' => [ + 'application/json', + ], + 'listCis300' => [ + 'application/json', + ], + 'markAsAcceptedCis300' => [ + 'application/json', + ], + 'requiringAttentionCis300' => [ + 'application/json', + ], + 'submitCis300' => [ + 'application/json', + ], + 'updateCis300' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createCis300 + * + * Create Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300 + */ + public function createCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['createCis300'][0] + ): \SynergiTech\Staffology\Model\Cis300 + { + list($response) = $this->createCis300WithHttpInfo($employerId, $taxYear, $cis300, $contentType); + return $response; + } + + /** + * Operation createCis300WithHttpInfo + * + * Create Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300, HTTP status code, HTTP response headers (array of strings) + */ + public function createCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['createCis300'][0] + ): array + { + $request = $this->createCis300Request($employerId, $taxYear, $cis300, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Cis300', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCis300Async + * + * Create Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['createCis300'][0] + ): PromiseInterface + { + return $this->createCis300AsyncWithHttpInfo($employerId, $taxYear, $cis300, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCis300AsyncWithHttpInfo + * + * Create Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $cis300 = null, + string $contentType = self::contentTypes['createCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + $request = $this->createCis300Request($employerId, $taxYear, $cis300, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createCis300Request( + $employerId, + $taxYear, + $cis300 = null, + string $contentType = self::contentTypes['createCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createCis300' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($cis300)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($cis300)); + } else { + $httpBody = $cis300; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteCis300 + * + * Delete Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCis300'][0] + ): void + { + $this->deleteCis300WithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteCis300WithHttpInfo + * + * Delete Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCis300'][0] + ): array + { + $request = $this->deleteCis300Request($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteCis300Async + * + * Delete Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCis300'][0] + ): PromiseInterface + { + return $this->deleteCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCis300AsyncWithHttpInfo + * + * Delete Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteCis300'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteCis300Request($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCis300Request( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCis300 + * + * Get Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300 + */ + public function getCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCis300'][0] + ): \SynergiTech\Staffology\Model\Cis300 + { + list($response) = $this->getCis300WithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getCis300WithHttpInfo + * + * Get Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300, HTTP status code, HTTP response headers (array of strings) + */ + public function getCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCis300'][0] + ): array + { + $request = $this->getCis300Request($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Cis300', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCis300Async + * + * Get Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCis300'][0] + ): PromiseInterface + { + return $this->getCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCis300AsyncWithHttpInfo + * + * Get Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + $request = $this->getCis300Request($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCis300Request( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestCis300 + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCis300'][0] + ): string + { + list($response) = $this->getXmlRequestCis300WithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getXmlRequestCis300WithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCis300'][0] + ): array + { + $request = $this->getXmlRequestCis300Request($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestCis300Async + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCis300'][0] + ): PromiseInterface + { + return $this->getXmlRequestCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestCis300AsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestCis300'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestCis300Request($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestCis300Request( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listCis300 + * + * List Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCis300'][0] + ): array + { + list($response) = $this->listCis300WithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listCis300WithHttpInfo + * + * List Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCis300'][0] + ): array + { + $request = $this->listCis300Request($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listCis300Async + * + * List Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCis300'][0] + ): PromiseInterface + { + return $this->listCis300AsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listCis300AsyncWithHttpInfo + * + * List Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listCis300Request($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listCis300Request( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedCis300 + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300 + */ + public function markAsAcceptedCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCis300'][0] + ): \SynergiTech\Staffology\Model\Cis300 + { + list($response) = $this->markAsAcceptedCis300WithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedCis300WithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCis300'][0] + ): array + { + $request = $this->markAsAcceptedCis300Request($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Cis300', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedCis300Async + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCis300'][0] + ): PromiseInterface + { + return $this->markAsAcceptedCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedCis300AsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + $request = $this->markAsAcceptedCis300Request($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedCis300Request( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionCis300 + * + * Cis300 Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionCis300( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCis300'][0] + ): array + { + list($response) = $this->requiringAttentionCis300WithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionCis300WithHttpInfo + * + * Cis300 Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionCis300WithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCis300'][0] + ): array + { + $request = $this->requiringAttentionCis300Request($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionCis300Async + * + * Cis300 Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionCis300Async( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCis300'][0] + ): PromiseInterface + { + return $this->requiringAttentionCis300AsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionCis300AsyncWithHttpInfo + * + * Cis300 Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionCis300AsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionCis300Request($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionCis300' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionCis300Request( + $employerId, + string $contentType = self::contentTypes['requiringAttentionCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionCis300' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis300/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitCis300 + * + * Submit Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300 + */ + public function submitCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCis300'][0] + ): \SynergiTech\Staffology\Model\Cis300 + { + list($response) = $this->submitCis300WithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitCis300WithHttpInfo + * + * Submit Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300, HTTP status code, HTTP response headers (array of strings) + */ + public function submitCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCis300'][0] + ): array + { + $request = $this->submitCis300Request($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Cis300', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitCis300Async + * + * Submit Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCis300'][0] + ): PromiseInterface + { + return $this->submitCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitCis300AsyncWithHttpInfo + * + * Submit Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + $request = $this->submitCis300Request($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CIS300 has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitCis300Request( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitCis300' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCis300 + * + * Update Cis300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300 + */ + public function updateCis300( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['updateCis300'][0] + ): \SynergiTech\Staffology\Model\Cis300 + { + list($response) = $this->updateCis300WithHttpInfo($employerId, $taxYear, $id, $cis300, $contentType); + return $response; + } + + /** + * Operation updateCis300WithHttpInfo + * + * Update Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCis300'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCis300WithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['updateCis300'][0] + ): array + { + $request = $this->updateCis300Request($employerId, $taxYear, $id, $cis300, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Cis300', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCis300Async + * + * Update Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCis300Async( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Cis300 $cis300 = null, + string $contentType = self::contentTypes['updateCis300'][0] + ): PromiseInterface + { + return $this->updateCis300AsyncWithHttpInfo($employerId, $taxYear, $id, $cis300, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCis300AsyncWithHttpInfo + * + * Update Cis300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCis300AsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $cis300 = null, + string $contentType = self::contentTypes['updateCis300'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300'; + $request = $this->updateCis300Request($employerId, $taxYear, $id, $cis300, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCis300' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Cis300|null $cis300 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCis300'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCis300Request( + $employerId, + $taxYear, + $id, + $cis300 = null, + string $contentType = self::contentTypes['updateCis300'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateCis300' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateCis300' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateCis300' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis300/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($cis300)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($cis300)); + } else { + $httpBody = $cis300; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/CisVerificationApi.php b/src/Api/CisVerificationApi.php new file mode 100644 index 0000000..e7e273c --- /dev/null +++ b/src/Api/CisVerificationApi.php @@ -0,0 +1,3432 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteCisVerification' => [ + 'application/json', + ], + 'getCisVerification' => [ + 'application/json', + ], + 'getXmlRequestCisVerification' => [ + 'application/json', + ], + 'listCisVerification' => [ + 'application/json', + ], + 'markAsAcceptedCisVerification' => [ + 'application/json', + ], + 'requiringAttentionCisVerification' => [ + 'application/json', + ], + 'submitCisVerification' => [ + 'application/json', + ], + 'updateCisVerification' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createCisVerification + * + * Create CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisVerification + */ + public function createCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['createCisVerification'][0] + ): \SynergiTech\Staffology\Model\CisVerification + { + list($response) = $this->createCisVerificationWithHttpInfo($employerId, $taxYear, $cisVerification, $contentType); + return $response; + } + + /** + * Operation createCisVerificationWithHttpInfo + * + * Create CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisVerification, HTTP status code, HTTP response headers (array of strings) + */ + public function createCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['createCisVerification'][0] + ): array + { + $request = $this->createCisVerificationRequest($employerId, $taxYear, $cisVerification, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\CisVerification', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisVerification' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisVerification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisVerification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCisVerificationAsync + * + * Create CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['createCisVerification'][0] + ): PromiseInterface + { + return $this->createCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $cisVerification, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCisVerificationAsyncWithHttpInfo + * + * Create CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $cisVerification = null, + string $contentType = self::contentTypes['createCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + $request = $this->createCisVerificationRequest($employerId, $taxYear, $cisVerification, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createCisVerificationRequest( + $employerId, + $taxYear, + $cisVerification = null, + string $contentType = self::contentTypes['createCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createCisVerification' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($cisVerification)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($cisVerification)); + } else { + $httpBody = $cisVerification; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteCisVerification + * + * Delete CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCisVerification'][0] + ): void + { + $this->deleteCisVerificationWithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteCisVerificationWithHttpInfo + * + * Delete CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCisVerification'][0] + ): array + { + $request = $this->deleteCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteCisVerificationAsync + * + * Delete CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteCisVerification'][0] + ): PromiseInterface + { + return $this->deleteCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCisVerificationAsyncWithHttpInfo + * + * Delete CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteCisVerification'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCisVerificationRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCisVerification + * + * Get CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisVerification + */ + public function getCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCisVerification'][0] + ): \SynergiTech\Staffology\Model\CisVerification + { + list($response) = $this->getCisVerificationWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getCisVerificationWithHttpInfo + * + * Get CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisVerification, HTTP status code, HTTP response headers (array of strings) + */ + public function getCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCisVerification'][0] + ): array + { + $request = $this->getCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisVerification', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisVerification' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisVerification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisVerification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCisVerificationAsync + * + * Get CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getCisVerification'][0] + ): PromiseInterface + { + return $this->getCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCisVerificationAsyncWithHttpInfo + * + * Get CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + $request = $this->getCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCisVerificationRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestCisVerification + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCisVerification'][0] + ): string + { + list($response) = $this->getXmlRequestCisVerificationWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getXmlRequestCisVerificationWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCisVerification'][0] + ): array + { + $request = $this->getXmlRequestCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestCisVerificationAsync + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestCisVerification'][0] + ): PromiseInterface + { + return $this->getXmlRequestCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestCisVerificationAsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestCisVerification'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestCisVerificationRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listCisVerification + * + * List CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCisVerification'][0] + ): array + { + list($response) = $this->listCisVerificationWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listCisVerificationWithHttpInfo + * + * List CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCisVerification'][0] + ): array + { + $request = $this->listCisVerificationRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listCisVerificationAsync + * + * List CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listCisVerification'][0] + ): PromiseInterface + { + return $this->listCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listCisVerificationAsyncWithHttpInfo + * + * List CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listCisVerificationRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listCisVerificationRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedCisVerification + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisVerification + */ + public function markAsAcceptedCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCisVerification'][0] + ): \SynergiTech\Staffology\Model\CisVerification + { + list($response) = $this->markAsAcceptedCisVerificationWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedCisVerificationWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisVerification, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCisVerification'][0] + ): array + { + $request = $this->markAsAcceptedCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisVerification', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisVerification' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisVerification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisVerification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedCisVerificationAsync + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedCisVerification'][0] + ): PromiseInterface + { + return $this->markAsAcceptedCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedCisVerificationAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + $request = $this->markAsAcceptedCisVerificationRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedCisVerificationRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionCisVerification + * + * CisVerificationRequest Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionCisVerification( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCisVerification'][0] + ): array + { + list($response) = $this->requiringAttentionCisVerificationWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionCisVerificationWithHttpInfo + * + * CisVerificationRequest Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionCisVerificationWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCisVerification'][0] + ): array + { + $request = $this->requiringAttentionCisVerificationRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionCisVerificationAsync + * + * CisVerificationRequest Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionCisVerificationAsync( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionCisVerification'][0] + ): PromiseInterface + { + return $this->requiringAttentionCisVerificationAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionCisVerificationAsyncWithHttpInfo + * + * CisVerificationRequest Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionCisVerificationAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionCisVerificationRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionCisVerification' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionCisVerificationRequest( + $employerId, + string $contentType = self::contentTypes['requiringAttentionCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionCisVerification' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitCisVerification + * + * Submit CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisVerification + */ + public function submitCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCisVerification'][0] + ): \SynergiTech\Staffology\Model\CisVerification + { + list($response) = $this->submitCisVerificationWithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitCisVerificationWithHttpInfo + * + * Submit CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisVerification, HTTP status code, HTTP response headers (array of strings) + */ + public function submitCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCisVerification'][0] + ): array + { + $request = $this->submitCisVerificationRequest($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisVerification', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisVerification' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisVerification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisVerification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitCisVerificationAsync + * + * Submit CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitCisVerification'][0] + ): PromiseInterface + { + return $this->submitCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitCisVerificationAsyncWithHttpInfo + * + * Submit CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + $request = $this->submitCisVerificationRequest($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the CisVerification has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitCisVerificationRequest( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitCisVerification' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCisVerification + * + * Update CisVerificationRequest + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisVerification + */ + public function updateCisVerification( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['updateCisVerification'][0] + ): \SynergiTech\Staffology\Model\CisVerification + { + list($response) = $this->updateCisVerificationWithHttpInfo($employerId, $taxYear, $id, $cisVerification, $contentType); + return $response; + } + + /** + * Operation updateCisVerificationWithHttpInfo + * + * Update CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCisVerification'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisVerification, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCisVerificationWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['updateCisVerification'][0] + ): array + { + $request = $this->updateCisVerificationRequest($employerId, $taxYear, $id, $cisVerification, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisVerification', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisVerification' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisVerification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisVerification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCisVerificationAsync + * + * Update CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCisVerificationAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\CisVerification $cisVerification = null, + string $contentType = self::contentTypes['updateCisVerification'][0] + ): PromiseInterface + { + return $this->updateCisVerificationAsyncWithHttpInfo($employerId, $taxYear, $id, $cisVerification, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCisVerificationAsyncWithHttpInfo + * + * Update CisVerificationRequest + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCisVerificationAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $cisVerification = null, + string $contentType = self::contentTypes['updateCisVerification'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisVerification'; + $request = $this->updateCisVerificationRequest($employerId, $taxYear, $id, $cisVerification, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCisVerification' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\CisVerification|null $cisVerification (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCisVerification'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCisVerificationRequest( + $employerId, + $taxYear, + $id, + $cisVerification = null, + string $contentType = self::contentTypes['updateCisVerification'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateCisVerification' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateCisVerification' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateCisVerification' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/cis-verification/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($cisVerification)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($cisVerification)); + } else { + $httpBody = $cisVerification; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/CostCentreApi.php b/src/Api/CostCentreApi.php new file mode 100644 index 0000000..82d95c7 --- /dev/null +++ b/src/Api/CostCentreApi.php @@ -0,0 +1,2797 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteCostCentre' => [ + 'application/json', + ], + 'deleteCostCentreCostCentre' => [ + 'application/json', + ], + 'getCostCentre' => [ + 'application/json', + ], + 'getCostCentreCostCentre' => [ + 'application/json', + ], + 'indexCostCentre' => [ + 'application/json', + ], + 'updateCostCentre' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateCostCentreCostCentre' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createCostCentre + * + * Create Cost Centre + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\CostCentre + */ + public function createCostCentre( + string $employerId, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['createCostCentre'][0] + ): \SynergiTech\Staffology\Model\CostCentre + { + list($response) = $this->createCostCentreWithHttpInfo($employerId, $costCentre, $contentType); + return $response; + } + + /** + * Operation createCostCentreWithHttpInfo + * + * Create Cost Centre + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\CostCentre, HTTP status code, HTTP response headers (array of strings) + */ + public function createCostCentreWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['createCostCentre'][0] + ): array + { + $request = $this->createCostCentreRequest($employerId, $costCentre, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\CostCentre', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostCentre' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostCentre', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostCentre', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCostCentreAsync + * + * Create Cost Centre + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCostCentreAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['createCostCentre'][0] + ): PromiseInterface + { + return $this->createCostCentreAsyncWithHttpInfo($employerId, $costCentre, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCostCentreAsyncWithHttpInfo + * + * Create Cost Centre + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCostCentreAsyncWithHttpInfo( + $employerId, + $costCentre = null, + string $contentType = self::contentTypes['createCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + $request = $this->createCostCentreRequest($employerId, $costCentre, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createCostCentre' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createCostCentreRequest( + $employerId, + $costCentre = null, + string $contentType = self::contentTypes['createCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createCostCentre' + ); + } + + + + $resourcePath = '/employers/{employerId}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($costCentre)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($costCentre)); + } else { + $httpBody = $costCentre; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteCostCentre + * + * Delete Cost Centre (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteCostCentre( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteCostCentre'][0] + ): void + { + $this->deleteCostCentreWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteCostCentreWithHttpInfo + * + * Delete Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCostCentreWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteCostCentre'][0] + ): array + { + $request = $this->deleteCostCentreRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteCostCentreAsync + * + * Delete Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCostCentreAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteCostCentre'][0] + ): PromiseInterface + { + return $this->deleteCostCentreAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCostCentreAsyncWithHttpInfo + * + * Delete Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCostCentreAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['deleteCostCentre'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteCostCentreRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCostCentre' + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCostCentreRequest( + $employerId, + $code, + string $contentType = self::contentTypes['deleteCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteCostCentre' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deleteCostCentre' + ); + } + + + $resourcePath = '/employers/{employerId}/costcentres/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteCostCentreCostCentre + * + * Delete Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The code of the Cost Centre you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteCostCentreCostCentre( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteCostCentreCostCentre'][0] + ): void + { + $this->deleteCostCentreCostCentreWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteCostCentreCostCentreWithHttpInfo + * + * Delete Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The code of the Cost Centre you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCostCentreCostCentreWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteCostCentreCostCentre'][0] + ): array + { + $request = $this->deleteCostCentreCostCentreRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteCostCentreCostCentreAsync + * + * Delete Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The code of the Cost Centre you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCostCentreCostCentreAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteCostCentreCostCentre'][0] + ): PromiseInterface + { + return $this->deleteCostCentreCostCentreAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCostCentreCostCentreAsyncWithHttpInfo + * + * Delete Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The code of the Cost Centre you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCostCentreCostCentreAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteCostCentreCostCentre'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteCostCentreCostCentreRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCostCentreCostCentre' + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The code of the Cost Centre you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCostCentreCostCentreRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteCostCentreCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteCostCentreCostCentre' + ); + } + + + + $resourcePath = '/employers/{employerId}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCostCentre + * + * Get Cost Centre (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostCentre + */ + public function getCostCentre( + string $employerId, + string $code, + string $contentType = self::contentTypes['getCostCentre'][0] + ): \SynergiTech\Staffology\Model\CostCentre + { + list($response) = $this->getCostCentreWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getCostCentreWithHttpInfo + * + * Get Cost Centre (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostCentre, HTTP status code, HTTP response headers (array of strings) + */ + public function getCostCentreWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['getCostCentre'][0] + ): array + { + $request = $this->getCostCentreRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostCentre', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostCentre' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostCentre', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostCentre', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCostCentreAsync + * + * Get Cost Centre (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['getCostCentre'][0] + ): PromiseInterface + { + return $this->getCostCentreAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCostCentreAsyncWithHttpInfo + * + * Get Cost Centre (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['getCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + $request = $this->getCostCentreRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCostCentre' + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCostCentreRequest( + $employerId, + $code, + string $contentType = self::contentTypes['getCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCostCentre' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getCostCentre' + ); + } + + + $resourcePath = '/employers/{employerId}/costcentres/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCostCentreCostCentre + * + * Get Cost Centre + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostCentre + */ + public function getCostCentreCostCentre( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getCostCentreCostCentre'][0] + ): \SynergiTech\Staffology\Model\CostCentre + { + list($response) = $this->getCostCentreCostCentreWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getCostCentreCostCentreWithHttpInfo + * + * Get Cost Centre + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostCentre, HTTP status code, HTTP response headers (array of strings) + */ + public function getCostCentreCostCentreWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getCostCentreCostCentre'][0] + ): array + { + $request = $this->getCostCentreCostCentreRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostCentre', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostCentre' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostCentre', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostCentre', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCostCentreCostCentreAsync + * + * Get Cost Centre + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreCostCentreAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getCostCentreCostCentre'][0] + ): PromiseInterface + { + return $this->getCostCentreCostCentreAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCostCentreCostCentreAsyncWithHttpInfo + * + * Get Cost Centre + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreCostCentreAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['getCostCentreCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + $request = $this->getCostCentreCostCentreRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCostCentreCostCentre' + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCostCentreCostCentreRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['getCostCentreCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCostCentreCostCentre' + ); + } + + + + $resourcePath = '/employers/{employerId}/costcentres/costcentre'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexCostCentre + * + * List Cost Centres + * + * @param string $employerId The Id of the Employer for which you want to list Cost Centres (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexCostCentre( + string $employerId, + string $contentType = self::contentTypes['indexCostCentre'][0] + ): array + { + list($response) = $this->indexCostCentreWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexCostCentreWithHttpInfo + * + * List Cost Centres + * + * @param string $employerId The Id of the Employer for which you want to list Cost Centres (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexCostCentreWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexCostCentre'][0] + ): array + { + $request = $this->indexCostCentreRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexCostCentreAsync + * + * List Cost Centres + * + * @param string $employerId The Id of the Employer for which you want to list Cost Centres (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexCostCentreAsync( + string $employerId, + string $contentType = self::contentTypes['indexCostCentre'][0] + ): PromiseInterface + { + return $this->indexCostCentreAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexCostCentreAsyncWithHttpInfo + * + * List Cost Centres + * + * @param string $employerId The Id of the Employer for which you want to list Cost Centres (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexCostCentreAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexCostCentreRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexCostCentre' + * + * @param string $employerId The Id of the Employer for which you want to list Cost Centres (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexCostCentreRequest( + $employerId, + string $contentType = self::contentTypes['indexCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexCostCentre' + ); + } + + + $resourcePath = '/employers/{employerId}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCostCentre + * + * Update Cost Centre (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostCentre + */ + public function updateCostCentre( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentre'][0] + ): \SynergiTech\Staffology\Model\CostCentre + { + list($response) = $this->updateCostCentreWithHttpInfo($employerId, $code, $costCentre, $contentType); + return $response; + } + + /** + * Operation updateCostCentreWithHttpInfo + * + * Update Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostCentre, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCostCentreWithHttpInfo( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentre'][0] + ): array + { + $request = $this->updateCostCentreRequest($employerId, $code, $costCentre, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostCentre', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostCentre' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostCentre', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostCentre', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCostCentreAsync + * + * Update Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreAsync( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentre'][0] + ): PromiseInterface + { + return $this->updateCostCentreAsyncWithHttpInfo($employerId, $code, $costCentre, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCostCentreAsyncWithHttpInfo + * + * Update Cost Centre (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreAsyncWithHttpInfo( + $employerId, + $code, + $costCentre = null, + string $contentType = self::contentTypes['updateCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + $request = $this->updateCostCentreRequest($employerId, $code, $costCentre, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCostCentre' + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCostCentreRequest( + $employerId, + $code, + $costCentre = null, + string $contentType = self::contentTypes['updateCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateCostCentre' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updateCostCentre' + ); + } + + + + $resourcePath = '/employers/{employerId}/costcentres/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($costCentre)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($costCentre)); + } else { + $httpBody = $costCentre; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCostCentreCostCentre + * + * Update Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre The new values for the Cost Centre you want to update (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostCentre + */ + public function updateCostCentreCostCentre( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentreCostCentre'][0] + ): \SynergiTech\Staffology\Model\CostCentre + { + list($response) = $this->updateCostCentreCostCentreWithHttpInfo($employerId, $code, $costCentre, $contentType); + return $response; + } + + /** + * Operation updateCostCentreCostCentreWithHttpInfo + * + * Update Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre The new values for the Cost Centre you want to update (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreCostCentre'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostCentre, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCostCentreCostCentreWithHttpInfo( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentreCostCentre'][0] + ): array + { + $request = $this->updateCostCentreCostCentreRequest($employerId, $code, $costCentre, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostCentre', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostCentre' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostCentre', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostCentre', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCostCentreCostCentreAsync + * + * Update Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre The new values for the Cost Centre you want to update (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreCostCentreAsync( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\CostCentre $costCentre = null, + string $contentType = self::contentTypes['updateCostCentreCostCentre'][0] + ): PromiseInterface + { + return $this->updateCostCentreCostCentreAsyncWithHttpInfo($employerId, $code, $costCentre, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCostCentreCostCentreAsyncWithHttpInfo + * + * Update Cost Centre + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre The new values for the Cost Centre you want to update (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreCostCentreAsyncWithHttpInfo( + $employerId, + $code = null, + $costCentre = null, + string $contentType = self::contentTypes['updateCostCentreCostCentre'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostCentre'; + $request = $this->updateCostCentreCostCentreRequest($employerId, $code, $costCentre, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCostCentreCostCentre' + * + * @param string $employerId The Id of the Employer to which the Cost Centre belongs. (required) + * @param string|null $code The existing code of the Cost Centre you want to get. (optional) + * @param \SynergiTech\Staffology\Model\CostCentre|null $costCentre The new values for the Cost Centre you want to update (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreCostCentre'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCostCentreCostCentreRequest( + $employerId, + $code = null, + $costCentre = null, + string $contentType = self::contentTypes['updateCostCentreCostCentre'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateCostCentreCostCentre' + ); + } + + + + + $resourcePath = '/employers/{employerId}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($costCentre)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($costCentre)); + } else { + $httpBody = $costCentre; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/DepartmentApi.php b/src/Api/DepartmentApi.php new file mode 100644 index 0000000..e1f5759 --- /dev/null +++ b/src/Api/DepartmentApi.php @@ -0,0 +1,2797 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteDepartment' => [ + 'application/json', + ], + 'deleteDepartmentDepartment' => [ + 'application/json', + ], + 'getDepartment' => [ + 'application/json', + ], + 'getDepartmentDepartment' => [ + 'application/json', + ], + 'indexDepartment' => [ + 'application/json', + ], + 'updateDepartment' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateDepartmentDepartment' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createDepartment + * + * Create Department + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\Department|null $department department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Department + */ + public function createDepartment( + string $employerId, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['createDepartment'][0] + ): \SynergiTech\Staffology\Model\Department + { + list($response) = $this->createDepartmentWithHttpInfo($employerId, $department, $contentType); + return $response; + } + + /** + * Operation createDepartmentWithHttpInfo + * + * Create Department + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Department, HTTP status code, HTTP response headers (array of strings) + */ + public function createDepartmentWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['createDepartment'][0] + ): array + { + $request = $this->createDepartmentRequest($employerId, $department, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Department', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Department' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Department', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Department'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Department', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDepartmentAsync + * + * Create Department + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDepartmentAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['createDepartment'][0] + ): PromiseInterface + { + return $this->createDepartmentAsyncWithHttpInfo($employerId, $department, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDepartmentAsyncWithHttpInfo + * + * Create Department + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDepartmentAsyncWithHttpInfo( + $employerId, + $department = null, + string $contentType = self::contentTypes['createDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Department'; + $request = $this->createDepartmentRequest($employerId, $department, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDepartment' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDepartmentRequest( + $employerId, + $department = null, + string $contentType = self::contentTypes['createDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createDepartment' + ); + } + + + + $resourcePath = '/employers/{employerId}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($department)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($department)); + } else { + $httpBody = $department; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDepartment + * + * Delete Department (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDepartment( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteDepartment'][0] + ): void + { + $this->deleteDepartmentWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteDepartmentWithHttpInfo + * + * Delete Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDepartmentWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteDepartment'][0] + ): array + { + $request = $this->deleteDepartmentRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDepartmentAsync + * + * Delete Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDepartmentAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteDepartment'][0] + ): PromiseInterface + { + return $this->deleteDepartmentAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDepartmentAsyncWithHttpInfo + * + * Delete Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDepartmentAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['deleteDepartment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDepartmentRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDepartment' + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDepartmentRequest( + $employerId, + $code, + string $contentType = self::contentTypes['deleteDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDepartment' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deleteDepartment' + ); + } + + + $resourcePath = '/employers/{employerId}/departments/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDepartmentDepartment + * + * Delete Department + * + * @param string $employerId employerId (required) + * @param string|null $code code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDepartmentDepartment( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteDepartmentDepartment'][0] + ): void + { + $this->deleteDepartmentDepartmentWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteDepartmentDepartmentWithHttpInfo + * + * Delete Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDepartmentDepartmentWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteDepartmentDepartment'][0] + ): array + { + $request = $this->deleteDepartmentDepartmentRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDepartmentDepartmentAsync + * + * Delete Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDepartmentDepartmentAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteDepartmentDepartment'][0] + ): PromiseInterface + { + return $this->deleteDepartmentDepartmentAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDepartmentDepartmentAsyncWithHttpInfo + * + * Delete Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDepartmentDepartmentAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteDepartmentDepartment'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDepartmentDepartmentRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDepartmentDepartment' + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDepartmentDepartmentRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteDepartmentDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDepartmentDepartment' + ); + } + + + + $resourcePath = '/employers/{employerId}/departments/department'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDepartment + * + * Get Department (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Department + */ + public function getDepartment( + string $employerId, + string $code, + string $contentType = self::contentTypes['getDepartment'][0] + ): \SynergiTech\Staffology\Model\Department + { + list($response) = $this->getDepartmentWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getDepartmentWithHttpInfo + * + * Get Department (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Department, HTTP status code, HTTP response headers (array of strings) + */ + public function getDepartmentWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['getDepartment'][0] + ): array + { + $request = $this->getDepartmentRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Department', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Department' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Department', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Department'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Department', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDepartmentAsync + * + * Get Department (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['getDepartment'][0] + ): PromiseInterface + { + return $this->getDepartmentAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDepartmentAsyncWithHttpInfo + * + * Get Department (deprecated) + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['getDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Department'; + $request = $this->getDepartmentRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDepartment' + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDepartmentRequest( + $employerId, + $code, + string $contentType = self::contentTypes['getDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDepartment' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getDepartment' + ); + } + + + $resourcePath = '/employers/{employerId}/departments/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDepartmentDepartment + * + * Get Department + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The code of the Department you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Department + */ + public function getDepartmentDepartment( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getDepartmentDepartment'][0] + ): \SynergiTech\Staffology\Model\Department + { + list($response) = $this->getDepartmentDepartmentWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getDepartmentDepartmentWithHttpInfo + * + * Get Department + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The code of the Department you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Department, HTTP status code, HTTP response headers (array of strings) + */ + public function getDepartmentDepartmentWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getDepartmentDepartment'][0] + ): array + { + $request = $this->getDepartmentDepartmentRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Department', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Department' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Department', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Department'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Department', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDepartmentDepartmentAsync + * + * Get Department + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The code of the Department you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentDepartmentAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getDepartmentDepartment'][0] + ): PromiseInterface + { + return $this->getDepartmentDepartmentAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDepartmentDepartmentAsyncWithHttpInfo + * + * Get Department + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The code of the Department you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentDepartmentAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['getDepartmentDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Department'; + $request = $this->getDepartmentDepartmentRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDepartmentDepartment' + * + * @param string $employerId The Id of the Employer to which the Department belongs. (required) + * @param string|null $code The code of the Department you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDepartmentDepartmentRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['getDepartmentDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDepartmentDepartment' + ); + } + + + + $resourcePath = '/employers/{employerId}/departments/Department'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexDepartment + * + * List Departments + * + * @param string $employerId The Id of the Employer for which you want to list Departments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexDepartment( + string $employerId, + string $contentType = self::contentTypes['indexDepartment'][0] + ): array + { + list($response) = $this->indexDepartmentWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexDepartmentWithHttpInfo + * + * List Departments + * + * @param string $employerId The Id of the Employer for which you want to list Departments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexDepartmentWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexDepartment'][0] + ): array + { + $request = $this->indexDepartmentRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexDepartmentAsync + * + * List Departments + * + * @param string $employerId The Id of the Employer for which you want to list Departments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexDepartmentAsync( + string $employerId, + string $contentType = self::contentTypes['indexDepartment'][0] + ): PromiseInterface + { + return $this->indexDepartmentAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexDepartmentAsyncWithHttpInfo + * + * List Departments + * + * @param string $employerId The Id of the Employer for which you want to list Departments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexDepartmentAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexDepartmentRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexDepartment' + * + * @param string $employerId The Id of the Employer for which you want to list Departments (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexDepartmentRequest( + $employerId, + string $contentType = self::contentTypes['indexDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexDepartment' + ); + } + + + $resourcePath = '/employers/{employerId}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDepartment + * + * Update Department (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param \SynergiTech\Staffology\Model\Department|null $department department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Department + */ + public function updateDepartment( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartment'][0] + ): \SynergiTech\Staffology\Model\Department + { + list($response) = $this->updateDepartmentWithHttpInfo($employerId, $code, $department, $contentType); + return $response; + } + + /** + * Operation updateDepartmentWithHttpInfo + * + * Update Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Department, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDepartmentWithHttpInfo( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartment'][0] + ): array + { + $request = $this->updateDepartmentRequest($employerId, $code, $department, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Department', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Department' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Department', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Department'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Department', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDepartmentAsync + * + * Update Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentAsync( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartment'][0] + ): PromiseInterface + { + return $this->updateDepartmentAsyncWithHttpInfo($employerId, $code, $department, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDepartmentAsyncWithHttpInfo + * + * Update Department (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentAsyncWithHttpInfo( + $employerId, + $code, + $department = null, + string $contentType = self::contentTypes['updateDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Department'; + $request = $this->updateDepartmentRequest($employerId, $code, $department, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDepartment' + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDepartmentRequest( + $employerId, + $code, + $department = null, + string $contentType = self::contentTypes['updateDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateDepartment' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updateDepartment' + ); + } + + + + $resourcePath = '/employers/{employerId}/departments/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($department)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($department)); + } else { + $httpBody = $department; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDepartmentDepartment + * + * Update Department + * + * @param string $employerId employerId (required) + * @param string|null $code code (optional) + * @param \SynergiTech\Staffology\Model\Department|null $department department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Department + */ + public function updateDepartmentDepartment( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartmentDepartment'][0] + ): \SynergiTech\Staffology\Model\Department + { + list($response) = $this->updateDepartmentDepartmentWithHttpInfo($employerId, $code, $department, $contentType); + return $response; + } + + /** + * Operation updateDepartmentDepartmentWithHttpInfo + * + * Update Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentDepartment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Department, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDepartmentDepartmentWithHttpInfo( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartmentDepartment'][0] + ): array + { + $request = $this->updateDepartmentDepartmentRequest($employerId, $code, $department, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Department', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Department' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Department', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Department'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Department', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDepartmentDepartmentAsync + * + * Update Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentDepartmentAsync( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Department $department = null, + string $contentType = self::contentTypes['updateDepartmentDepartment'][0] + ): PromiseInterface + { + return $this->updateDepartmentDepartmentAsyncWithHttpInfo($employerId, $code, $department, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDepartmentDepartmentAsyncWithHttpInfo + * + * Update Department + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentDepartmentAsyncWithHttpInfo( + $employerId, + $code = null, + $department = null, + string $contentType = self::contentTypes['updateDepartmentDepartment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Department'; + $request = $this->updateDepartmentDepartmentRequest($employerId, $code, $department, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDepartmentDepartment' + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\Department|null $department (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentDepartment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDepartmentDepartmentRequest( + $employerId, + $code = null, + $department = null, + string $contentType = self::contentTypes['updateDepartmentDepartment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateDepartmentDepartment' + ); + } + + + + + $resourcePath = '/employers/{employerId}/departments/department'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($department)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($department)); + } else { + $httpBody = $department; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/DpsApi.php b/src/Api/DpsApi.php new file mode 100644 index 0000000..a9f4ec3 --- /dev/null +++ b/src/Api/DpsApi.php @@ -0,0 +1,3442 @@ + [ + 'application/json', + ], + 'checkForNoticesDps' => [ + 'application/json', + ], + 'deleteAllDps' => [ + 'application/json', + ], + 'deleteDps' => [ + 'application/json', + ], + 'getDps' => [ + 'application/json', + ], + 'getDpsSettingsDps' => [ + 'application/json', + ], + 'listNoticesDps' => [ + 'application/json', + ], + 'parseXmlDps' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'reapplyNoticesDps' => [ + 'application/json', + ], + 'updateDpsSettingsDps' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation applyDps + * + * Apply Notice + * + * @param string $employerId employerId (required) + * @param string $id The Id of the DpsNotice you want to apply. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DpsNotice + */ + public function applyDps( + string $employerId, + string $id, + string $contentType = self::contentTypes['applyDps'][0] + ): \SynergiTech\Staffology\Model\DpsNotice + { + list($response) = $this->applyDpsWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation applyDpsWithHttpInfo + * + * Apply Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to apply. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DpsNotice, HTTP status code, HTTP response headers (array of strings) + */ + public function applyDpsWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['applyDps'][0] + ): array + { + $request = $this->applyDpsRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DpsNotice', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DpsNotice' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DpsNotice', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DpsNotice'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DpsNotice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation applyDpsAsync + * + * Apply Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to apply. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyDpsAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['applyDps'][0] + ): PromiseInterface + { + return $this->applyDpsAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation applyDpsAsyncWithHttpInfo + * + * Apply Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to apply. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyDpsAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['applyDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DpsNotice'; + $request = $this->applyDpsRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'applyDps' + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to apply. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function applyDpsRequest( + $employerId, + $id, + string $contentType = self::contentTypes['applyDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling applyDps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling applyDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/notices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation checkForNoticesDps + * + * Check for new Notices + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkForNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return int + */ + public function checkForNoticesDps( + string $employerId, + string $contentType = self::contentTypes['checkForNoticesDps'][0] + ): int + { + list($response) = $this->checkForNoticesDpsWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation checkForNoticesDpsWithHttpInfo + * + * Check for new Notices + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkForNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of int, HTTP status code, HTTP response headers (array of strings) + */ + public function checkForNoticesDpsWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['checkForNoticesDps'][0] + ): array + { + $request = $this->checkForNoticesDpsRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('int', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('int' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'int', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'int'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation checkForNoticesDpsAsync + * + * Check for new Notices + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkForNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function checkForNoticesDpsAsync( + string $employerId, + string $contentType = self::contentTypes['checkForNoticesDps'][0] + ): PromiseInterface + { + return $this->checkForNoticesDpsAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation checkForNoticesDpsAsyncWithHttpInfo + * + * Check for new Notices + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkForNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function checkForNoticesDpsAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['checkForNoticesDps'][0] + ): PromiseInterface + { + $returnType = 'int'; + $request = $this->checkForNoticesDpsRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'checkForNoticesDps' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkForNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function checkForNoticesDpsRequest( + $employerId, + string $contentType = self::contentTypes['checkForNoticesDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling checkForNoticesDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/notices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAllDps + * + * Delete All Notices + * + * @param string $employerId The Id of the Employer that you want to delete all notices for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAllDps( + string $employerId, + string $contentType = self::contentTypes['deleteAllDps'][0] + ): void + { + $this->deleteAllDpsWithHttpInfo($employerId, $contentType); + } + + /** + * Operation deleteAllDpsWithHttpInfo + * + * Delete All Notices + * + * @param string $employerId The Id of the Employer that you want to delete all notices for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAllDpsWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['deleteAllDps'][0] + ): array + { + $request = $this->deleteAllDpsRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAllDpsAsync + * + * Delete All Notices + * + * @param string $employerId The Id of the Employer that you want to delete all notices for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllDpsAsync( + string $employerId, + string $contentType = self::contentTypes['deleteAllDps'][0] + ): PromiseInterface + { + return $this->deleteAllDpsAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAllDpsAsyncWithHttpInfo + * + * Delete All Notices + * + * @param string $employerId The Id of the Employer that you want to delete all notices for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllDpsAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['deleteAllDps'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAllDpsRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAllDps' + * + * @param string $employerId The Id of the Employer that you want to delete all notices for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAllDpsRequest( + $employerId, + string $contentType = self::contentTypes['deleteAllDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAllDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/notices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDps + * + * Delete Notice + * + * @param string $employerId The Id of the Employer to which the DpsNotice belongs. (required) + * @param string $id The Id of the DsNotice you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDps( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteDps'][0] + ): void + { + $this->deleteDpsWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteDpsWithHttpInfo + * + * Delete Notice + * + * @param string $employerId The Id of the Employer to which the DpsNotice belongs. (required) + * @param string $id The Id of the DsNotice you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDpsWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteDps'][0] + ): array + { + $request = $this->deleteDpsRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDpsAsync + * + * Delete Notice + * + * @param string $employerId The Id of the Employer to which the DpsNotice belongs. (required) + * @param string $id The Id of the DsNotice you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDpsAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteDps'][0] + ): PromiseInterface + { + return $this->deleteDpsAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDpsAsyncWithHttpInfo + * + * Delete Notice + * + * @param string $employerId The Id of the Employer to which the DpsNotice belongs. (required) + * @param string $id The Id of the DsNotice you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDpsAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteDps'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDpsRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDps' + * + * @param string $employerId The Id of the Employer to which the DpsNotice belongs. (required) + * @param string $id The Id of the DsNotice you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDpsRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/notices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDps + * + * Get Notice + * + * @param string $employerId employerId (required) + * @param string $id The Id of the DpsNotice you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DpsNotice + */ + public function getDps( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDps'][0] + ): \SynergiTech\Staffology\Model\DpsNotice + { + list($response) = $this->getDpsWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getDpsWithHttpInfo + * + * Get Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DpsNotice, HTTP status code, HTTP response headers (array of strings) + */ + public function getDpsWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDps'][0] + ): array + { + $request = $this->getDpsRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DpsNotice', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DpsNotice' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DpsNotice', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DpsNotice'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DpsNotice', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDpsAsync + * + * Get Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDpsAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDps'][0] + ): PromiseInterface + { + return $this->getDpsAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDpsAsyncWithHttpInfo + * + * Get Notice + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDpsAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DpsNotice'; + $request = $this->getDpsRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDps' + * + * @param string $employerId (required) + * @param string $id The Id of the DpsNotice you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDpsRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/notices/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDpsSettingsDps + * + * Get DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDpsSettingsDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DpsSettings + */ + public function getDpsSettingsDps( + string $employerId, + string $contentType = self::contentTypes['getDpsSettingsDps'][0] + ): \SynergiTech\Staffology\Model\DpsSettings + { + list($response) = $this->getDpsSettingsDpsWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getDpsSettingsDpsWithHttpInfo + * + * Get DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDpsSettingsDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DpsSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getDpsSettingsDpsWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getDpsSettingsDps'][0] + ): array + { + $request = $this->getDpsSettingsDpsRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DpsSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DpsSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DpsSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DpsSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DpsSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDpsSettingsDpsAsync + * + * Get DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDpsSettingsDpsAsync( + string $employerId, + string $contentType = self::contentTypes['getDpsSettingsDps'][0] + ): PromiseInterface + { + return $this->getDpsSettingsDpsAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDpsSettingsDpsAsyncWithHttpInfo + * + * Get DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDpsSettingsDpsAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getDpsSettingsDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DpsSettings'; + $request = $this->getDpsSettingsDpsRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDpsSettingsDps' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDpsSettingsDpsRequest( + $employerId, + string $contentType = self::contentTypes['getDpsSettingsDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDpsSettingsDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listNoticesDps + * + * List Notices + * + * @param string $employerId employerId (required) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listNoticesDps( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listNoticesDps'][0] + ): array + { + list($response) = $this->listNoticesDpsWithHttpInfo($employerId, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation listNoticesDpsWithHttpInfo + * + * List Notices + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listNoticesDpsWithHttpInfo( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listNoticesDps'][0] + ): array + { + $request = $this->listNoticesDpsRequest($employerId, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listNoticesDpsAsync + * + * List Notices + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listNoticesDpsAsync( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listNoticesDps'][0] + ): PromiseInterface + { + return $this->listNoticesDpsAsyncWithHttpInfo($employerId, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listNoticesDpsAsyncWithHttpInfo + * + * List Notices + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listNoticesDpsAsyncWithHttpInfo( + $employerId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['listNoticesDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listNoticesDpsRequest($employerId, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listNoticesDps' + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listNoticesDpsRequest( + $employerId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['listNoticesDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listNoticesDps' + ); + } + + + + + $resourcePath = '/employers/{employerId}/dps/notices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation parseXmlDps + * + * Parse notices from XML + * + * @param string $employerId employerId (required) + * @param string|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['parseXmlDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return int + */ + public function parseXmlDps( + string $employerId, + ?string $body = null, + string $contentType = self::contentTypes['parseXmlDps'][0] + ): int + { + list($response) = $this->parseXmlDpsWithHttpInfo($employerId, $body, $contentType); + return $response; + } + + /** + * Operation parseXmlDpsWithHttpInfo + * + * Parse notices from XML + * + * @param string $employerId (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['parseXmlDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of int, HTTP status code, HTTP response headers (array of strings) + */ + public function parseXmlDpsWithHttpInfo( + string $employerId, + ?string $body = null, + string $contentType = self::contentTypes['parseXmlDps'][0] + ): array + { + $request = $this->parseXmlDpsRequest($employerId, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('int', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('int' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'int', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'int'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation parseXmlDpsAsync + * + * Parse notices from XML + * + * @param string $employerId (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['parseXmlDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function parseXmlDpsAsync( + string $employerId, + ?string $body = null, + string $contentType = self::contentTypes['parseXmlDps'][0] + ): PromiseInterface + { + return $this->parseXmlDpsAsyncWithHttpInfo($employerId, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation parseXmlDpsAsyncWithHttpInfo + * + * Parse notices from XML + * + * @param string $employerId (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['parseXmlDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function parseXmlDpsAsyncWithHttpInfo( + $employerId, + $body = null, + string $contentType = self::contentTypes['parseXmlDps'][0] + ): PromiseInterface + { + $returnType = 'int'; + $request = $this->parseXmlDpsRequest($employerId, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'parseXmlDps' + * + * @param string $employerId (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['parseXmlDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function parseXmlDpsRequest( + $employerId, + $body = null, + string $contentType = self::contentTypes['parseXmlDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling parseXmlDps' + ); + } + + + + $resourcePath = '/employers/{employerId}/dps/notices/xml'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation reapplyNoticesDps + * + * Reapply DpsNotices + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime $appliedFromDate The date from which to apply DpsNotices (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reapplyNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse + */ + public function reapplyNoticesDps( + string $employerId, + \DateTime $appliedFromDate, + string $contentType = self::contentTypes['reapplyNoticesDps'][0] + ): \SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse + { + list($response) = $this->reapplyNoticesDpsWithHttpInfo($employerId, $appliedFromDate, $contentType); + return $response; + } + + /** + * Operation reapplyNoticesDpsWithHttpInfo + * + * Reapply DpsNotices + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime $appliedFromDate The date from which to apply DpsNotices (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reapplyNoticesDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function reapplyNoticesDpsWithHttpInfo( + string $employerId, + \DateTime $appliedFromDate, + string $contentType = self::contentTypes['reapplyNoticesDps'][0] + ): array + { + $request = $this->reapplyNoticesDpsRequest($employerId, $appliedFromDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation reapplyNoticesDpsAsync + * + * Reapply DpsNotices + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime $appliedFromDate The date from which to apply DpsNotices (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reapplyNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reapplyNoticesDpsAsync( + string $employerId, + \DateTime $appliedFromDate, + string $contentType = self::contentTypes['reapplyNoticesDps'][0] + ): PromiseInterface + { + return $this->reapplyNoticesDpsAsyncWithHttpInfo($employerId, $appliedFromDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation reapplyNoticesDpsAsyncWithHttpInfo + * + * Reapply DpsNotices + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime $appliedFromDate The date from which to apply DpsNotices (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reapplyNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reapplyNoticesDpsAsyncWithHttpInfo( + $employerId, + $appliedFromDate, + string $contentType = self::contentTypes['reapplyNoticesDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractReapplyDpsNoticeResponse'; + $request = $this->reapplyNoticesDpsRequest($employerId, $appliedFromDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'reapplyNoticesDps' + * + * @param string $employerId The Id of the Employer (required) + * @param \DateTime $appliedFromDate The date from which to apply DpsNotices (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reapplyNoticesDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function reapplyNoticesDpsRequest( + $employerId, + $appliedFromDate, + string $contentType = self::contentTypes['reapplyNoticesDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling reapplyNoticesDps' + ); + } + + // verify the required parameter 'appliedFromDate' is set + if ($appliedFromDate === null || (is_array($appliedFromDate) && count($appliedFromDate) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $appliedFromDate when calling reapplyNoticesDps' + ); + } + + + $resourcePath = '/employers/{employerId}/dps/reapply'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $appliedFromDate, + 'appliedFromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDpsSettingsDps + * + * Update DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\DpsSettings|null $dpsSettings dpsSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDpsSettingsDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DpsSettings + */ + public function updateDpsSettingsDps( + string $employerId, + ?\SynergiTech\Staffology\Model\DpsSettings $dpsSettings = null, + string $contentType = self::contentTypes['updateDpsSettingsDps'][0] + ): \SynergiTech\Staffology\Model\DpsSettings + { + list($response) = $this->updateDpsSettingsDpsWithHttpInfo($employerId, $dpsSettings, $contentType); + return $response; + } + + /** + * Operation updateDpsSettingsDpsWithHttpInfo + * + * Update DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\DpsSettings|null $dpsSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDpsSettingsDps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DpsSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDpsSettingsDpsWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\DpsSettings $dpsSettings = null, + string $contentType = self::contentTypes['updateDpsSettingsDps'][0] + ): array + { + $request = $this->updateDpsSettingsDpsRequest($employerId, $dpsSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DpsSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DpsSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DpsSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DpsSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DpsSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDpsSettingsDpsAsync + * + * Update DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\DpsSettings|null $dpsSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDpsSettingsDpsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\DpsSettings $dpsSettings = null, + string $contentType = self::contentTypes['updateDpsSettingsDps'][0] + ): PromiseInterface + { + return $this->updateDpsSettingsDpsAsyncWithHttpInfo($employerId, $dpsSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDpsSettingsDpsAsyncWithHttpInfo + * + * Update DPS Settings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\DpsSettings|null $dpsSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDpsSettingsDpsAsyncWithHttpInfo( + $employerId, + $dpsSettings = null, + string $contentType = self::contentTypes['updateDpsSettingsDps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DpsSettings'; + $request = $this->updateDpsSettingsDpsRequest($employerId, $dpsSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDpsSettingsDps' + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\DpsSettings|null $dpsSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDpsSettingsDps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDpsSettingsDpsRequest( + $employerId, + $dpsSettings = null, + string $contentType = self::contentTypes['updateDpsSettingsDps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateDpsSettingsDps' + ); + } + + + + $resourcePath = '/employers/{employerId}/dps/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($dpsSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($dpsSettings)); + } else { + $httpBody = $dpsSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmailApi.php b/src/Api/EmailApi.php new file mode 100644 index 0000000..fb8a20f --- /dev/null +++ b/src/Api/EmailApi.php @@ -0,0 +1,2861 @@ + [ + 'application/json', + ], + 'getMailSettingsEmail' => [ + 'application/json', + ], + 'indexEmail' => [ + 'application/json', + ], + 'resendEmailEmail' => [ + 'application/json', + ], + 'testMailSettingsEmail' => [ + 'application/json', + ], + 'updateMailSettingsEmail' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'verifyMailSettingsEmail' => [ + 'application/json', + ], + 'verifyMailSettingsResponseEmail' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation getEmailEmail + * + * Get Email + * + * @param string $employerId employerId (required) + * @param string $emailId emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEmail + */ + public function getEmailEmail( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['getEmailEmail'][0] + ): \SynergiTech\Staffology\Model\EmployerEmail + { + list($response) = $this->getEmailEmailWithHttpInfo($employerId, $emailId, $contentType); + return $response; + } + + /** + * Operation getEmailEmailWithHttpInfo + * + * Get Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailEmailWithHttpInfo( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['getEmailEmail'][0] + ): array + { + $request = $this->getEmailEmailRequest($employerId, $emailId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailEmailAsync + * + * Get Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmailEmailAsync( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['getEmailEmail'][0] + ): PromiseInterface + { + return $this->getEmailEmailAsyncWithHttpInfo($employerId, $emailId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailEmailAsyncWithHttpInfo + * + * Get Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmailEmailAsyncWithHttpInfo( + $employerId, + $emailId, + string $contentType = self::contentTypes['getEmailEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + $request = $this->getEmailEmailRequest($employerId, $emailId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmailEmail' + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmailEmailRequest( + $employerId, + $emailId, + string $contentType = self::contentTypes['getEmailEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmailEmail' + ); + } + + // verify the required parameter 'emailId' is set + if ($emailId === null || (is_array($emailId) && count($emailId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $emailId when calling getEmailEmail' + ); + } + + + $resourcePath = '/employers/{employerId}/email/{emailId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($emailId !== null) { + $resourcePath = str_replace( + '{' . 'emailId' . '}', + ObjectSerializer::toPathValue($emailId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailSettingsEmail + * + * Get MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\MailSettings + */ + public function getMailSettingsEmail( + string $employerId, + string $contentType = self::contentTypes['getMailSettingsEmail'][0] + ): \SynergiTech\Staffology\Model\MailSettings + { + list($response) = $this->getMailSettingsEmailWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getMailSettingsEmailWithHttpInfo + * + * Get MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\MailSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailSettingsEmailWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getMailSettingsEmail'][0] + ): array + { + $request = $this->getMailSettingsEmailRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\MailSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\MailSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\MailSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\MailSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailSettingsEmailAsync + * + * Get MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMailSettingsEmailAsync( + string $employerId, + string $contentType = self::contentTypes['getMailSettingsEmail'][0] + ): PromiseInterface + { + return $this->getMailSettingsEmailAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailSettingsEmailAsyncWithHttpInfo + * + * Get MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMailSettingsEmailAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getMailSettingsEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + $request = $this->getMailSettingsEmailRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailSettingsEmail' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMailSettingsEmailRequest( + $employerId, + string $contentType = self::contentTypes['getMailSettingsEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getMailSettingsEmail' + ); + } + + + $resourcePath = '/employers/{employerId}/email/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmail + * + * List Emails + * + * @param string $employerId employerId (required) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmail( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexEmail'][0] + ): array + { + list($response) = $this->indexEmailWithHttpInfo($employerId, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation indexEmailWithHttpInfo + * + * List Emails + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmailWithHttpInfo( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexEmail'][0] + ): array + { + $request = $this->indexEmailRequest($employerId, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmailAsync + * + * List Emails + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmailAsync( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexEmail'][0] + ): PromiseInterface + { + return $this->indexEmailAsyncWithHttpInfo($employerId, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmailAsyncWithHttpInfo + * + * List Emails + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmailAsyncWithHttpInfo( + $employerId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['indexEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmailRequest($employerId, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmail' + * + * @param string $employerId (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmailRequest( + $employerId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['indexEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexEmail' + ); + } + + + + + $resourcePath = '/employers/{employerId}/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation resendEmailEmail + * + * Re-send Email + * + * @param string $employerId employerId (required) + * @param string $emailId emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEmail + */ + public function resendEmailEmail( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['resendEmailEmail'][0] + ): \SynergiTech\Staffology\Model\EmployerEmail + { + list($response) = $this->resendEmailEmailWithHttpInfo($employerId, $emailId, $contentType); + return $response; + } + + /** + * Operation resendEmailEmailWithHttpInfo + * + * Re-send Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function resendEmailEmailWithHttpInfo( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['resendEmailEmail'][0] + ): array + { + $request = $this->resendEmailEmailRequest($employerId, $emailId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation resendEmailEmailAsync + * + * Re-send Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resendEmailEmailAsync( + string $employerId, + string $emailId, + string $contentType = self::contentTypes['resendEmailEmail'][0] + ): PromiseInterface + { + return $this->resendEmailEmailAsyncWithHttpInfo($employerId, $emailId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation resendEmailEmailAsyncWithHttpInfo + * + * Re-send Email + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resendEmailEmailAsyncWithHttpInfo( + $employerId, + $emailId, + string $contentType = self::contentTypes['resendEmailEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + $request = $this->resendEmailEmailRequest($employerId, $emailId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'resendEmailEmail' + * + * @param string $employerId (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function resendEmailEmailRequest( + $employerId, + $emailId, + string $contentType = self::contentTypes['resendEmailEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling resendEmailEmail' + ); + } + + // verify the required parameter 'emailId' is set + if ($emailId === null || (is_array($emailId) && count($emailId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $emailId when calling resendEmailEmail' + ); + } + + + $resourcePath = '/employers/{employerId}/email/{emailId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($emailId !== null) { + $resourcePath = str_replace( + '{' . 'emailId' . '}', + ObjectSerializer::toPathValue($emailId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation testMailSettingsEmail + * + * Send Test Email + * + * @param string $employerId The Id of the Employer (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEmail + */ + public function testMailSettingsEmail( + string $employerId, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsEmail'][0] + ): \SynergiTech\Staffology\Model\EmployerEmail + { + list($response) = $this->testMailSettingsEmailWithHttpInfo($employerId, $email, $contentType); + return $response; + } + + /** + * Operation testMailSettingsEmailWithHttpInfo + * + * Send Test Email + * + * @param string $employerId The Id of the Employer (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function testMailSettingsEmailWithHttpInfo( + string $employerId, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsEmail'][0] + ): array + { + $request = $this->testMailSettingsEmailRequest($employerId, $email, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\EmployerEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation testMailSettingsEmailAsync + * + * Send Test Email + * + * @param string $employerId The Id of the Employer (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testMailSettingsEmailAsync( + string $employerId, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsEmail'][0] + ): PromiseInterface + { + return $this->testMailSettingsEmailAsyncWithHttpInfo($employerId, $email, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testMailSettingsEmailAsyncWithHttpInfo + * + * Send Test Email + * + * @param string $employerId The Id of the Employer (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testMailSettingsEmailAsyncWithHttpInfo( + $employerId, + $email = null, + string $contentType = self::contentTypes['testMailSettingsEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + $request = $this->testMailSettingsEmailRequest($employerId, $email, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testMailSettingsEmail' + * + * @param string $employerId The Id of the Employer (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testMailSettingsEmailRequest( + $employerId, + $email = null, + string $contentType = self::contentTypes['testMailSettingsEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling testMailSettingsEmail' + ); + } + + + + $resourcePath = '/employers/{employerId}/email/settings/test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $email, + 'email', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMailSettingsEmail + * + * Update MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\MailSettings + */ + public function updateMailSettingsEmail( + string $employerId, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsEmail'][0] + ): \SynergiTech\Staffology\Model\MailSettings + { + list($response) = $this->updateMailSettingsEmailWithHttpInfo($employerId, $mailSettings, $contentType); + return $response; + } + + /** + * Operation updateMailSettingsEmailWithHttpInfo + * + * Update MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\MailSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateMailSettingsEmailWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsEmail'][0] + ): array + { + $request = $this->updateMailSettingsEmailRequest($employerId, $mailSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\MailSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\MailSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\MailSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\MailSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMailSettingsEmailAsync + * + * Update MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMailSettingsEmailAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsEmail'][0] + ): PromiseInterface + { + return $this->updateMailSettingsEmailAsyncWithHttpInfo($employerId, $mailSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMailSettingsEmailAsyncWithHttpInfo + * + * Update MailSettings + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMailSettingsEmailAsyncWithHttpInfo( + $employerId, + $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + $request = $this->updateMailSettingsEmailRequest($employerId, $mailSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMailSettingsEmail' + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateMailSettingsEmailRequest( + $employerId, + $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateMailSettingsEmail' + ); + } + + + + $resourcePath = '/employers/{employerId}/email/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($mailSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($mailSettings)); + } else { + $httpBody = $mailSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation verifyMailSettingsEmail + * + * Email Verification (Request) + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function verifyMailSettingsEmail( + string $employerId, + string $contentType = self::contentTypes['verifyMailSettingsEmail'][0] + ): void + { + $this->verifyMailSettingsEmailWithHttpInfo($employerId, $contentType); + } + + /** + * Operation verifyMailSettingsEmailWithHttpInfo + * + * Email Verification (Request) + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function verifyMailSettingsEmailWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['verifyMailSettingsEmail'][0] + ): array + { + $request = $this->verifyMailSettingsEmailRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation verifyMailSettingsEmailAsync + * + * Email Verification (Request) + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyMailSettingsEmailAsync( + string $employerId, + string $contentType = self::contentTypes['verifyMailSettingsEmail'][0] + ): PromiseInterface + { + return $this->verifyMailSettingsEmailAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation verifyMailSettingsEmailAsyncWithHttpInfo + * + * Email Verification (Request) + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyMailSettingsEmailAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['verifyMailSettingsEmail'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->verifyMailSettingsEmailRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'verifyMailSettingsEmail' + * + * @param string $employerId The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function verifyMailSettingsEmailRequest( + $employerId, + string $contentType = self::contentTypes['verifyMailSettingsEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling verifyMailSettingsEmail' + ); + } + + + $resourcePath = '/employers/{employerId}/email/settings/verify'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation verifyMailSettingsResponseEmail + * + * Email Verification (Respond) + * + * @param string $employerId The employer Id. (required) + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsResponseEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return bool + */ + public function verifyMailSettingsResponseEmail( + string $employerId, + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyMailSettingsResponseEmail'][0] + ): bool + { + list($response) = $this->verifyMailSettingsResponseEmailWithHttpInfo($employerId, $u, $k, $contentType); + return $response; + } + + /** + * Operation verifyMailSettingsResponseEmailWithHttpInfo + * + * Email Verification (Respond) + * + * @param string $employerId The employer Id. (required) + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsResponseEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of bool, HTTP status code, HTTP response headers (array of strings) + */ + public function verifyMailSettingsResponseEmailWithHttpInfo( + string $employerId, + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyMailSettingsResponseEmail'][0] + ): array + { + $request = $this->verifyMailSettingsResponseEmailRequest($employerId, $u, $k, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('bool', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'bool', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'bool'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'bool', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation verifyMailSettingsResponseEmailAsync + * + * Email Verification (Respond) + * + * @param string $employerId The employer Id. (required) + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsResponseEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyMailSettingsResponseEmailAsync( + string $employerId, + ?string $u = null, + ?string $k = null, + string $contentType = self::contentTypes['verifyMailSettingsResponseEmail'][0] + ): PromiseInterface + { + return $this->verifyMailSettingsResponseEmailAsyncWithHttpInfo($employerId, $u, $k, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation verifyMailSettingsResponseEmailAsyncWithHttpInfo + * + * Email Verification (Respond) + * + * @param string $employerId The employer Id. (required) + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsResponseEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function verifyMailSettingsResponseEmailAsyncWithHttpInfo( + $employerId, + $u = null, + $k = null, + string $contentType = self::contentTypes['verifyMailSettingsResponseEmail'][0] + ): PromiseInterface + { + $returnType = 'bool'; + $request = $this->verifyMailSettingsResponseEmailRequest($employerId, $u, $k, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'verifyMailSettingsResponseEmail' + * + * @param string $employerId The employer Id. (required) + * @param string|null $u The value from the link in the email. (optional) + * @param string|null $k The value from the link in the email. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyMailSettingsResponseEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function verifyMailSettingsResponseEmailRequest( + $employerId, + $u = null, + $k = null, + string $contentType = self::contentTypes['verifyMailSettingsResponseEmail'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling verifyMailSettingsResponseEmail' + ); + } + + + + + $resourcePath = '/employers/{employerId}/email/settings/verify'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $u, + 'u', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $k, + 'k', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmployeeApi.php b/src/Api/EmployeeApi.php new file mode 100644 index 0000000..9a8407d --- /dev/null +++ b/src/Api/EmployeeApi.php @@ -0,0 +1,10277 @@ + [ + 'application/json', + ], + 'applyPayOptionsEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'averageWeeklyEarningsEmployee' => [ + 'application/json', + ], + 'baseDailyRateEmployee' => [ + 'application/json', + ], + 'baseHourlyRateEmployee' => [ + 'application/json', + ], + 'createEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteEmployee' => [ + 'application/json', + ], + 'deleteMultipleEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePhotoEmployee' => [ + 'application/json', + ], + 'expiringRtwEmployee' => [ + 'application/json', + ], + 'getDepartmentMembershipsEmployee' => [ + 'application/json', + ], + 'getEmployee' => [ + 'application/json', + ], + 'getEmployeeCostCentresEmployee' => [ + 'application/json', + ], + 'getEvcSettingsEmployee' => [ + 'application/json', + ], + 'importCsvEmployee' => [ + 'multipart/form-data', + ], + 'indexEmployee' => [ + 'application/json', + ], + 'leaversEmployee' => [ + 'application/json', + ], + 'markAsLeaversEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'minimumWageEmployee' => [ + 'application/json', + ], + 'payRunEntriesEmployee' => [ + 'application/json', + ], + 'reHireEmployee' => [ + 'application/json', + ], + 'searchByPayrollCodeEmployee' => [ + 'application/json', + ], + 'searchEmployee' => [ + 'application/json', + ], + 'setDepartmentMembershipsEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setEmployeeCostCentresEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setOnHoldEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateEvcSettingsEmployee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePhotoEmployee' => [ + 'multipart/form-data', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation applyPayIncreaseEmployee + * + * Apply Pay Increase + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param float|null $percentage percentage (optional) + * @param bool|null $allEmployees Set this to true (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayIncreaseEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function applyPayIncreaseEmployee( + string $employerId, + ?float $percentage = null, + ?bool $allEmployees = null, + string $contentType = self::contentTypes['applyPayIncreaseEmployee'][0] + ): void + { + $this->applyPayIncreaseEmployeeWithHttpInfo($employerId, $percentage, $allEmployees, $contentType); + } + + /** + * Operation applyPayIncreaseEmployeeWithHttpInfo + * + * Apply Pay Increase + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param float|null $percentage (optional) + * @param bool|null $allEmployees Set this to true (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayIncreaseEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function applyPayIncreaseEmployeeWithHttpInfo( + string $employerId, + ?float $percentage = null, + ?bool $allEmployees = null, + string $contentType = self::contentTypes['applyPayIncreaseEmployee'][0] + ): array + { + $request = $this->applyPayIncreaseEmployeeRequest($employerId, $percentage, $allEmployees, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation applyPayIncreaseEmployeeAsync + * + * Apply Pay Increase + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param float|null $percentage (optional) + * @param bool|null $allEmployees Set this to true (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayIncreaseEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyPayIncreaseEmployeeAsync( + string $employerId, + ?float $percentage = null, + ?bool $allEmployees = null, + string $contentType = self::contentTypes['applyPayIncreaseEmployee'][0] + ): PromiseInterface + { + return $this->applyPayIncreaseEmployeeAsyncWithHttpInfo($employerId, $percentage, $allEmployees, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation applyPayIncreaseEmployeeAsyncWithHttpInfo + * + * Apply Pay Increase + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param float|null $percentage (optional) + * @param bool|null $allEmployees Set this to true (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayIncreaseEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyPayIncreaseEmployeeAsyncWithHttpInfo( + $employerId, + $percentage = null, + $allEmployees = null, + string $contentType = self::contentTypes['applyPayIncreaseEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->applyPayIncreaseEmployeeRequest($employerId, $percentage, $allEmployees, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'applyPayIncreaseEmployee' + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param float|null $percentage (optional) + * @param bool|null $allEmployees Set this to true (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayIncreaseEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function applyPayIncreaseEmployeeRequest( + $employerId, + $percentage = null, + $allEmployees = null, + string $contentType = self::contentTypes['applyPayIncreaseEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling applyPayIncreaseEmployee' + ); + } + + + + + $resourcePath = '/employers/{employerId}/employees/payincrease'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $percentage, + 'percentage', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allEmployees, + 'allEmployees', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation applyPayOptionsEmployee + * + * Apply PayOptions + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions payOptions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayOptionsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function applyPayOptionsEmployee( + string $employerId, + ?\SynergiTech\Staffology\Model\PayOptions $payOptions = null, + string $contentType = self::contentTypes['applyPayOptionsEmployee'][0] + ): void + { + $this->applyPayOptionsEmployeeWithHttpInfo($employerId, $payOptions, $contentType); + } + + /** + * Operation applyPayOptionsEmployeeWithHttpInfo + * + * Apply PayOptions + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayOptionsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function applyPayOptionsEmployeeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PayOptions $payOptions = null, + string $contentType = self::contentTypes['applyPayOptionsEmployee'][0] + ): array + { + $request = $this->applyPayOptionsEmployeeRequest($employerId, $payOptions, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation applyPayOptionsEmployeeAsync + * + * Apply PayOptions + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayOptionsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyPayOptionsEmployeeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PayOptions $payOptions = null, + string $contentType = self::contentTypes['applyPayOptionsEmployee'][0] + ): PromiseInterface + { + return $this->applyPayOptionsEmployeeAsyncWithHttpInfo($employerId, $payOptions, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation applyPayOptionsEmployeeAsyncWithHttpInfo + * + * Apply PayOptions + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayOptionsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyPayOptionsEmployeeAsyncWithHttpInfo( + $employerId, + $payOptions = null, + string $contentType = self::contentTypes['applyPayOptionsEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->applyPayOptionsEmployeeRequest($employerId, $payOptions, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'applyPayOptionsEmployee' + * + * @param string $employerId The Id of the Employer to which the employees belong. (required) + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyPayOptionsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function applyPayOptionsEmployeeRequest( + $employerId, + $payOptions = null, + string $contentType = self::contentTypes['applyPayOptionsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling applyPayOptionsEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/payoptions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payOptions)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payOptions)); + } else { + $httpBody = $payOptions; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation averageWeeklyEarningsEmployee + * + * Average Weekly Earnings + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \DateTime|null $date The date at which you want to calculate the earnings from. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageWeeklyEarningsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AverageWeeklyEarnings + */ + public function averageWeeklyEarningsEmployee( + string $employerId, + string $id, + ?\DateTime $date = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + string $contentType = self::contentTypes['averageWeeklyEarningsEmployee'][0] + ): \SynergiTech\Staffology\Model\AverageWeeklyEarnings + { + list($response) = $this->averageWeeklyEarningsEmployeeWithHttpInfo($employerId, $id, $date, $leaveType, $contentType); + return $response; + } + + /** + * Operation averageWeeklyEarningsEmployeeWithHttpInfo + * + * Average Weekly Earnings + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \DateTime|null $date The date at which you want to calculate the earnings from. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageWeeklyEarningsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AverageWeeklyEarnings, HTTP status code, HTTP response headers (array of strings) + */ + public function averageWeeklyEarningsEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\DateTime $date = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + string $contentType = self::contentTypes['averageWeeklyEarningsEmployee'][0] + ): array + { + $request = $this->averageWeeklyEarningsEmployeeRequest($employerId, $id, $date, $leaveType, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AverageWeeklyEarnings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AverageWeeklyEarnings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AverageWeeklyEarnings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AverageWeeklyEarnings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AverageWeeklyEarnings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation averageWeeklyEarningsEmployeeAsync + * + * Average Weekly Earnings + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \DateTime|null $date The date at which you want to calculate the earnings from. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageWeeklyEarningsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function averageWeeklyEarningsEmployeeAsync( + string $employerId, + string $id, + ?\DateTime $date = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + string $contentType = self::contentTypes['averageWeeklyEarningsEmployee'][0] + ): PromiseInterface + { + return $this->averageWeeklyEarningsEmployeeAsyncWithHttpInfo($employerId, $id, $date, $leaveType, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation averageWeeklyEarningsEmployeeAsyncWithHttpInfo + * + * Average Weekly Earnings + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \DateTime|null $date The date at which you want to calculate the earnings from. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageWeeklyEarningsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function averageWeeklyEarningsEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $date = null, + $leaveType = null, + string $contentType = self::contentTypes['averageWeeklyEarningsEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AverageWeeklyEarnings'; + $request = $this->averageWeeklyEarningsEmployeeRequest($employerId, $id, $date, $leaveType, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'averageWeeklyEarningsEmployee' + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \DateTime|null $date The date at which you want to calculate the earnings from. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageWeeklyEarningsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function averageWeeklyEarningsEmployeeRequest( + $employerId, + $id, + $date = null, + $leaveType = null, + string $contentType = self::contentTypes['averageWeeklyEarningsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling averageWeeklyEarningsEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling averageWeeklyEarningsEmployee' + ); + } + + + + + $resourcePath = '/employers/{employerId}/employees/{id}/awe'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveType, + 'leaveType', // param base name + 'LeaveType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation baseDailyRateEmployee + * + * Calculate Base Daily Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseDailyRateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function baseDailyRateEmployee( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseDailyRateEmployee'][0] + ): float + { + list($response) = $this->baseDailyRateEmployeeWithHttpInfo($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + return $response; + } + + /** + * Operation baseDailyRateEmployeeWithHttpInfo + * + * Calculate Base Daily Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseDailyRateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function baseDailyRateEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseDailyRateEmployee'][0] + ): array + { + $request = $this->baseDailyRateEmployeeRequest($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation baseDailyRateEmployeeAsync + * + * Calculate Base Daily Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseDailyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function baseDailyRateEmployeeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseDailyRateEmployee'][0] + ): PromiseInterface + { + return $this->baseDailyRateEmployeeAsyncWithHttpInfo($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation baseDailyRateEmployeeAsyncWithHttpInfo + * + * Calculate Base Daily Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseDailyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function baseDailyRateEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + string $contentType = self::contentTypes['baseDailyRateEmployee'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->baseDailyRateEmployeeRequest($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'baseDailyRateEmployee' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseDailyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function baseDailyRateEmployeeRequest( + $employerId, + $id, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + string $contentType = self::contentTypes['baseDailyRateEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling baseDailyRateEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling baseDailyRateEmployee' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/employees/{id}/basedailyrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payBasis, + 'payBasis', // param base name + 'PayBasis', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payAmount, + 'payAmount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation baseHourlyRateEmployee + * + * Calculate Base Hourly Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseHourlyRateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function baseHourlyRateEmployee( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseHourlyRateEmployee'][0] + ): float + { + list($response) = $this->baseHourlyRateEmployeeWithHttpInfo($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + return $response; + } + + /** + * Operation baseHourlyRateEmployeeWithHttpInfo + * + * Calculate Base Hourly Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseHourlyRateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function baseHourlyRateEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseHourlyRateEmployee'][0] + ): array + { + $request = $this->baseHourlyRateEmployeeRequest($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation baseHourlyRateEmployeeAsync + * + * Calculate Base Hourly Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseHourlyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function baseHourlyRateEmployeeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + string $contentType = self::contentTypes['baseHourlyRateEmployee'][0] + ): PromiseInterface + { + return $this->baseHourlyRateEmployeeAsyncWithHttpInfo($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation baseHourlyRateEmployeeAsyncWithHttpInfo + * + * Calculate Base Hourly Rate (deprecated) + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseHourlyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function baseHourlyRateEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + string $contentType = self::contentTypes['baseHourlyRateEmployee'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->baseHourlyRateEmployeeRequest($employerId, $id, $payPeriod, $payBasis, $payAmount, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'baseHourlyRateEmployee' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee is regularly paid each period. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['baseHourlyRateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function baseHourlyRateEmployeeRequest( + $employerId, + $id, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + string $contentType = self::contentTypes['baseHourlyRateEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling baseHourlyRateEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling baseHourlyRateEmployee' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/employees/{id}/basehourlyrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payBasis, + 'payBasis', // param base name + 'PayBasis', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payAmount, + 'payAmount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createEmployee + * + * Create a new Employee + * + * @param string $employerId The Id of the Employer you are creating the Employee for (required) + * @param \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest|null $contractCreateEmployeeRequest contractCreateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeResponse + */ + public function createEmployee( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractCreateEmployeeRequest $contractCreateEmployeeRequest = null, + string $contentType = self::contentTypes['createEmployee'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeResponse + { + list($response) = $this->createEmployeeWithHttpInfo($employerId, $contractCreateEmployeeRequest, $contentType); + return $response; + } + + /** + * Operation createEmployeeWithHttpInfo + * + * Create a new Employee + * + * @param string $employerId The Id of the Employer you are creating the Employee for (required) + * @param \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest|null $contractCreateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createEmployeeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractCreateEmployeeRequest $contractCreateEmployeeRequest = null, + string $contentType = self::contentTypes['createEmployee'][0] + ): array + { + $request = $this->createEmployeeRequest($employerId, $contractCreateEmployeeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEmployeeAsync + * + * Create a new Employee + * + * @param string $employerId The Id of the Employer you are creating the Employee for (required) + * @param \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest|null $contractCreateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployeeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractCreateEmployeeRequest $contractCreateEmployeeRequest = null, + string $contentType = self::contentTypes['createEmployee'][0] + ): PromiseInterface + { + return $this->createEmployeeAsyncWithHttpInfo($employerId, $contractCreateEmployeeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEmployeeAsyncWithHttpInfo + * + * Create a new Employee + * + * @param string $employerId The Id of the Employer you are creating the Employee for (required) + * @param \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest|null $contractCreateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployeeAsyncWithHttpInfo( + $employerId, + $contractCreateEmployeeRequest = null, + string $contentType = self::contentTypes['createEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + $request = $this->createEmployeeRequest($employerId, $contractCreateEmployeeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEmployee' + * + * @param string $employerId The Id of the Employer you are creating the Employee for (required) + * @param \SynergiTech\Staffology\Model\ContractCreateEmployeeRequest|null $contractCreateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createEmployeeRequest( + $employerId, + $contractCreateEmployeeRequest = null, + string $contentType = self::contentTypes['createEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractCreateEmployeeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractCreateEmployeeRequest)); + } else { + $httpBody = $contractCreateEmployeeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEmployee + * + * Delete an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteEmployee'][0] + ): void + { + $this->deleteEmployeeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteEmployeeWithHttpInfo + * + * Delete an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteEmployee'][0] + ): array + { + $request = $this->deleteEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteEmployeeAsync + * + * Delete an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteEmployee'][0] + ): PromiseInterface + { + return $this->deleteEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEmployeeAsyncWithHttpInfo + * + * Delete an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteMultipleEmployee + * + * Delete Employees + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultipleEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteMultipleEmployee( + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['deleteMultipleEmployee'][0] + ): void + { + $this->deleteMultipleEmployeeWithHttpInfo($employerId, $requestBody, $contentType); + } + + /** + * Operation deleteMultipleEmployeeWithHttpInfo + * + * Delete Employees + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultipleEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteMultipleEmployeeWithHttpInfo( + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['deleteMultipleEmployee'][0] + ): array + { + $request = $this->deleteMultipleEmployeeRequest($employerId, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteMultipleEmployeeAsync + * + * Delete Employees + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultipleEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteMultipleEmployeeAsync( + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['deleteMultipleEmployee'][0] + ): PromiseInterface + { + return $this->deleteMultipleEmployeeAsyncWithHttpInfo($employerId, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteMultipleEmployeeAsyncWithHttpInfo + * + * Delete Employees + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultipleEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteMultipleEmployeeAsyncWithHttpInfo( + $employerId, + $requestBody = null, + string $contentType = self::contentTypes['deleteMultipleEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteMultipleEmployeeRequest($employerId, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteMultipleEmployee' + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMultipleEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteMultipleEmployeeRequest( + $employerId, + $requestBody = null, + string $contentType = self::contentTypes['deleteMultipleEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteMultipleEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/delete'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePhotoEmployee + * + * Delete Photo + * + * @param string $employerId employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePhotoEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePhotoEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePhotoEmployee'][0] + ): void + { + $this->deletePhotoEmployeeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePhotoEmployeeWithHttpInfo + * + * Delete Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePhotoEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePhotoEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePhotoEmployee'][0] + ): array + { + $request = $this->deletePhotoEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePhotoEmployeeAsync + * + * Delete Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePhotoEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePhotoEmployee'][0] + ): PromiseInterface + { + return $this->deletePhotoEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePhotoEmployeeAsyncWithHttpInfo + * + * Delete Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePhotoEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePhotoEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePhotoEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePhotoEmployee' + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePhotoEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePhotoEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePhotoEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePhotoEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/photo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation expiringRtwEmployee + * + * Expiring RightToWork + * + * @param string $employerId The Id of the Employer to search. (required) + * @param int|null $numberOfDays The number of days in the future to look got expiry dates. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expiringRtwEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function expiringRtwEmployee( + string $employerId, + ?int $numberOfDays = null, + string $contentType = self::contentTypes['expiringRtwEmployee'][0] + ): array + { + list($response) = $this->expiringRtwEmployeeWithHttpInfo($employerId, $numberOfDays, $contentType); + return $response; + } + + /** + * Operation expiringRtwEmployeeWithHttpInfo + * + * Expiring RightToWork + * + * @param string $employerId The Id of the Employer to search. (required) + * @param int|null $numberOfDays The number of days in the future to look got expiry dates. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expiringRtwEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function expiringRtwEmployeeWithHttpInfo( + string $employerId, + ?int $numberOfDays = null, + string $contentType = self::contentTypes['expiringRtwEmployee'][0] + ): array + { + $request = $this->expiringRtwEmployeeRequest($employerId, $numberOfDays, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation expiringRtwEmployeeAsync + * + * Expiring RightToWork + * + * @param string $employerId The Id of the Employer to search. (required) + * @param int|null $numberOfDays The number of days in the future to look got expiry dates. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expiringRtwEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function expiringRtwEmployeeAsync( + string $employerId, + ?int $numberOfDays = null, + string $contentType = self::contentTypes['expiringRtwEmployee'][0] + ): PromiseInterface + { + return $this->expiringRtwEmployeeAsyncWithHttpInfo($employerId, $numberOfDays, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation expiringRtwEmployeeAsyncWithHttpInfo + * + * Expiring RightToWork + * + * @param string $employerId The Id of the Employer to search. (required) + * @param int|null $numberOfDays The number of days in the future to look got expiry dates. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expiringRtwEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function expiringRtwEmployeeAsyncWithHttpInfo( + $employerId, + $numberOfDays = null, + string $contentType = self::contentTypes['expiringRtwEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->expiringRtwEmployeeRequest($employerId, $numberOfDays, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'expiringRtwEmployee' + * + * @param string $employerId The Id of the Employer to search. (required) + * @param int|null $numberOfDays The number of days in the future to look got expiry dates. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expiringRtwEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function expiringRtwEmployeeRequest( + $employerId, + $numberOfDays = null, + string $contentType = self::contentTypes['expiringRtwEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling expiringRtwEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/expiring-rtw'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $numberOfDays, + 'numberOfDays', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDepartmentMembershipsEmployee + * + * Get Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DepartmentMembership[] + */ + public function getDepartmentMembershipsEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployee'][0] + ): array + { + list($response) = $this->getDepartmentMembershipsEmployeeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getDepartmentMembershipsEmployeeWithHttpInfo + * + * Get Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DepartmentMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function getDepartmentMembershipsEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployee'][0] + ): array + { + $request = $this->getDepartmentMembershipsEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DepartmentMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DepartmentMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DepartmentMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DepartmentMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDepartmentMembershipsEmployeeAsync + * + * Get Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentMembershipsEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployee'][0] + ): PromiseInterface + { + return $this->getDepartmentMembershipsEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDepartmentMembershipsEmployeeAsyncWithHttpInfo + * + * Get Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentMembershipsEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + $request = $this->getDepartmentMembershipsEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDepartmentMembershipsEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDepartmentMembershipsEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDepartmentMembershipsEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDepartmentMembershipsEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployee + * + * Get an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeResponse + */ + public function getEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployee'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeResponse + { + list($response) = $this->getEmployeeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getEmployeeWithHttpInfo + * + * Get an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployee'][0] + ): array + { + $request = $this->getEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployeeAsync + * + * Get an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployee'][0] + ): PromiseInterface + { + return $this->getEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployeeAsyncWithHttpInfo + * + * Get an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + $request = $this->getEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployeeCostCentresEmployee + * + * Get Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve CostCenntres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeCostCentre[] + */ + public function getEmployeeCostCentresEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployeeCostCentresEmployee'][0] + ): array + { + list($response) = $this->getEmployeeCostCentresEmployeeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getEmployeeCostCentresEmployeeWithHttpInfo + * + * Get Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve CostCenntres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeCostCentre[], HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployeeCostCentresEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployeeCostCentresEmployee'][0] + ): array + { + $request = $this->getEmployeeCostCentresEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeCostCentre[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeCostCentre[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployeeCostCentresEmployeeAsync + * + * Get Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve CostCenntres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeCostCentresEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEmployeeCostCentresEmployee'][0] + ): PromiseInterface + { + return $this->getEmployeeCostCentresEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployeeCostCentresEmployeeAsyncWithHttpInfo + * + * Get Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve CostCenntres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeCostCentresEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getEmployeeCostCentresEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + $request = $this->getEmployeeCostCentresEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployeeCostCentresEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to retrieve CostCenntres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployeeCostCentresEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getEmployeeCostCentresEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmployeeCostCentresEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployeeCostCentresEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEvcSettingsEmployee + * + * Get EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for which you want to retrieve EvcSettings. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EvcSettings + */ + public function getEvcSettingsEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEvcSettingsEmployee'][0] + ): \SynergiTech\Staffology\Model\EvcSettings + { + list($response) = $this->getEvcSettingsEmployeeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getEvcSettingsEmployeeWithHttpInfo + * + * Get EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for which you want to retrieve EvcSettings. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EvcSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getEvcSettingsEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEvcSettingsEmployee'][0] + ): array + { + $request = $this->getEvcSettingsEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EvcSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EvcSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EvcSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EvcSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EvcSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEvcSettingsEmployeeAsync + * + * Get EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for which you want to retrieve EvcSettings. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEvcSettingsEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getEvcSettingsEmployee'][0] + ): PromiseInterface + { + return $this->getEvcSettingsEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEvcSettingsEmployeeAsyncWithHttpInfo + * + * Get EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for which you want to retrieve EvcSettings. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEvcSettingsEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getEvcSettingsEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EvcSettings'; + $request = $this->getEvcSettingsEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEvcSettingsEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for which you want to retrieve EvcSettings. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEvcSettingsEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getEvcSettingsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEvcSettingsEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEvcSettingsEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/evcsettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCsvEmployee + * + * Import CSV + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The format of the CSV file. (optional) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates Set to true and if the payroll code matches an existing employee then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importCsvEmployee( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployee'][0] + ): array + { + list($response) = $this->importCsvEmployeeWithHttpInfo($employerId, $format, $previewOnly, $allowUpdates, $file, $contentType); + return $response; + } + + /** + * Operation importCsvEmployeeWithHttpInfo + * + * Import CSV + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The format of the CSV file. (optional) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates Set to true and if the payroll code matches an existing employee then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importCsvEmployeeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployee'][0] + ): array + { + $request = $this->importCsvEmployeeRequest($employerId, $format, $previewOnly, $allowUpdates, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCsvEmployeeAsync + * + * Import CSV + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The format of the CSV file. (optional) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates Set to true and if the payroll code matches an existing employee then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvEmployeeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployee'][0] + ): PromiseInterface + { + return $this->importCsvEmployeeAsyncWithHttpInfo($employerId, $format, $previewOnly, $allowUpdates, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCsvEmployeeAsyncWithHttpInfo + * + * Import CSV + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The format of the CSV file. (optional) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates Set to true and if the payroll code matches an existing employee then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvEmployeeAsyncWithHttpInfo( + $employerId, + $format = null, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importCsvEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importCsvEmployeeRequest($employerId, $format, $previewOnly, $allowUpdates, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCsvEmployee' + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The format of the CSV file. (optional) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates Set to true and if the payroll code matches an existing employee then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importCsvEmployeeRequest( + $employerId, + $format = null, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importCsvEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importCsvEmployee' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/employees/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'CsvFileFormat', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $previewOnly, + 'previewOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allowUpdates, + 'allowUpdates', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmployee + * + * List Employees + * + * @param string $employerId The Id of the Employer for which you want to see Employees (required) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status Restrict the results to employees with the given status (optional) + * @param string|null $deptCode If specified then only employees assigned to this department code will be listed (optional) + * @param string|null $pensionSchemeId If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. (optional) + * @param \SynergiTech\Staffology\Model\EmployeeSortBy|null $sortBy Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. (optional) + * @param bool|null $sortDescending Specifies whether the sorting should be in descending order. Default is false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmployee( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\EmployeeStatus $status = null, + ?string $deptCode = null, + ?string $pensionSchemeId = null, + ?\SynergiTech\Staffology\Model\EmployeeSortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['indexEmployee'][0] + ): array + { + list($response) = $this->indexEmployeeWithHttpInfo($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending, $contentType); + return $response; + } + + /** + * Operation indexEmployeeWithHttpInfo + * + * List Employees + * + * @param string $employerId The Id of the Employer for which you want to see Employees (required) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status Restrict the results to employees with the given status (optional) + * @param string|null $deptCode If specified then only employees assigned to this department code will be listed (optional) + * @param string|null $pensionSchemeId If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. (optional) + * @param \SynergiTech\Staffology\Model\EmployeeSortBy|null $sortBy Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. (optional) + * @param bool|null $sortDescending Specifies whether the sorting should be in descending order. Default is false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmployeeWithHttpInfo( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\EmployeeStatus $status = null, + ?string $deptCode = null, + ?string $pensionSchemeId = null, + ?\SynergiTech\Staffology\Model\EmployeeSortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['indexEmployee'][0] + ): array + { + $request = $this->indexEmployeeRequest($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmployeeAsync + * + * List Employees + * + * @param string $employerId The Id of the Employer for which you want to see Employees (required) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status Restrict the results to employees with the given status (optional) + * @param string|null $deptCode If specified then only employees assigned to this department code will be listed (optional) + * @param string|null $pensionSchemeId If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. (optional) + * @param \SynergiTech\Staffology\Model\EmployeeSortBy|null $sortBy Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. (optional) + * @param bool|null $sortDescending Specifies whether the sorting should be in descending order. Default is false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployeeAsync( + string $employerId, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\EmployeeStatus $status = null, + ?string $deptCode = null, + ?string $pensionSchemeId = null, + ?\SynergiTech\Staffology\Model\EmployeeSortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['indexEmployee'][0] + ): PromiseInterface + { + return $this->indexEmployeeAsyncWithHttpInfo($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmployeeAsyncWithHttpInfo + * + * List Employees + * + * @param string $employerId The Id of the Employer for which you want to see Employees (required) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status Restrict the results to employees with the given status (optional) + * @param string|null $deptCode If specified then only employees assigned to this department code will be listed (optional) + * @param string|null $pensionSchemeId If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. (optional) + * @param \SynergiTech\Staffology\Model\EmployeeSortBy|null $sortBy Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. (optional) + * @param bool|null $sortDescending Specifies whether the sorting should be in descending order. Default is false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployeeAsyncWithHttpInfo( + $employerId, + $pageNum = null, + $pageSize = null, + $status = null, + $deptCode = null, + $pensionSchemeId = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['indexEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmployeeRequest($employerId, $pageNum, $pageSize, $status, $deptCode, $pensionSchemeId, $sortBy, $sortDescending, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmployee' + * + * @param string $employerId The Id of the Employer for which you want to see Employees (required) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status Restrict the results to employees with the given status (optional) + * @param string|null $deptCode If specified then only employees assigned to this department code will be listed (optional) + * @param string|null $pensionSchemeId If specified then only employees enrolled into the given pension scheme will be listed. If empty guid(00000000-0000-0000-0000-000000000000) is passed in all employees not enrolled into any pension scheme will be listed. (optional) + * @param \SynergiTech\Staffology\Model\EmployeeSortBy|null $sortBy Specifies the field by which to sort the employees. Default is EmployeeSortBy.None. (optional) + * @param bool|null $sortDescending Specifies whether the sorting should be in descending order. Default is false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmployeeRequest( + $employerId, + $pageNum = null, + $pageSize = null, + $status = null, + $deptCode = null, + $pensionSchemeId = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['indexEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexEmployee' + ); + } + + + + + + + + + + $resourcePath = '/employers/{employerId}/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'EmployeeStatus', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pensionSchemeId, + 'pensionSchemeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortBy, + 'sortBy', // param base name + 'EmployeeSortBy', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortDescending, + 'sortDescending', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation leaversEmployee + * + * List Leavers + * + * @param string $employerId The Id of the Employer for which you want to see Leavers (required) + * @param bool|null $onlyUnsentP45s If set to true then only employees that don't have the P45Sent set to true will be returned (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leaversEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function leaversEmployee( + string $employerId, + ?bool $onlyUnsentP45s = false, + string $contentType = self::contentTypes['leaversEmployee'][0] + ): array + { + list($response) = $this->leaversEmployeeWithHttpInfo($employerId, $onlyUnsentP45s, $contentType); + return $response; + } + + /** + * Operation leaversEmployeeWithHttpInfo + * + * List Leavers + * + * @param string $employerId The Id of the Employer for which you want to see Leavers (required) + * @param bool|null $onlyUnsentP45s If set to true then only employees that don't have the P45Sent set to true will be returned (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leaversEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function leaversEmployeeWithHttpInfo( + string $employerId, + ?bool $onlyUnsentP45s = false, + string $contentType = self::contentTypes['leaversEmployee'][0] + ): array + { + $request = $this->leaversEmployeeRequest($employerId, $onlyUnsentP45s, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation leaversEmployeeAsync + * + * List Leavers + * + * @param string $employerId The Id of the Employer for which you want to see Leavers (required) + * @param bool|null $onlyUnsentP45s If set to true then only employees that don't have the P45Sent set to true will be returned (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function leaversEmployeeAsync( + string $employerId, + ?bool $onlyUnsentP45s = false, + string $contentType = self::contentTypes['leaversEmployee'][0] + ): PromiseInterface + { + return $this->leaversEmployeeAsyncWithHttpInfo($employerId, $onlyUnsentP45s, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation leaversEmployeeAsyncWithHttpInfo + * + * List Leavers + * + * @param string $employerId The Id of the Employer for which you want to see Leavers (required) + * @param bool|null $onlyUnsentP45s If set to true then only employees that don't have the P45Sent set to true will be returned (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function leaversEmployeeAsyncWithHttpInfo( + $employerId, + $onlyUnsentP45s = false, + string $contentType = self::contentTypes['leaversEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->leaversEmployeeRequest($employerId, $onlyUnsentP45s, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'leaversEmployee' + * + * @param string $employerId The Id of the Employer for which you want to see Leavers (required) + * @param bool|null $onlyUnsentP45s If set to true then only employees that don't have the P45Sent set to true will be returned (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function leaversEmployeeRequest( + $employerId, + $onlyUnsentP45s = false, + string $contentType = self::contentTypes['leaversEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling leaversEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/leavers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $onlyUnsentP45s, + 'onlyUnsentP45s', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsLeaversEmployee + * + * Mark as Leavers + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param \DateTime|null $date The date the employees left or are leaving (optional) + * @param bool|null $emailP45 If set to true, the employee will be email a P45 if they have an email address (optional) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsLeaversEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function markAsLeaversEmployee( + string $employerId, + ?\DateTime $date = null, + ?bool $emailP45 = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['markAsLeaversEmployee'][0] + ): void + { + $this->markAsLeaversEmployeeWithHttpInfo($employerId, $date, $emailP45, $requestBody, $contentType); + } + + /** + * Operation markAsLeaversEmployeeWithHttpInfo + * + * Mark as Leavers + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param \DateTime|null $date The date the employees left or are leaving (optional) + * @param bool|null $emailP45 If set to true, the employee will be email a P45 if they have an email address (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsLeaversEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsLeaversEmployeeWithHttpInfo( + string $employerId, + ?\DateTime $date = null, + ?bool $emailP45 = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['markAsLeaversEmployee'][0] + ): array + { + $request = $this->markAsLeaversEmployeeRequest($employerId, $date, $emailP45, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation markAsLeaversEmployeeAsync + * + * Mark as Leavers + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param \DateTime|null $date The date the employees left or are leaving (optional) + * @param bool|null $emailP45 If set to true, the employee will be email a P45 if they have an email address (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsLeaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsLeaversEmployeeAsync( + string $employerId, + ?\DateTime $date = null, + ?bool $emailP45 = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['markAsLeaversEmployee'][0] + ): PromiseInterface + { + return $this->markAsLeaversEmployeeAsyncWithHttpInfo($employerId, $date, $emailP45, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsLeaversEmployeeAsyncWithHttpInfo + * + * Mark as Leavers + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param \DateTime|null $date The date the employees left or are leaving (optional) + * @param bool|null $emailP45 If set to true, the employee will be email a P45 if they have an email address (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsLeaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsLeaversEmployeeAsyncWithHttpInfo( + $employerId, + $date = null, + $emailP45 = null, + $requestBody = null, + string $contentType = self::contentTypes['markAsLeaversEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->markAsLeaversEmployeeRequest($employerId, $date, $emailP45, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsLeaversEmployee' + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param \DateTime|null $date The date the employees left or are leaving (optional) + * @param bool|null $emailP45 If set to true, the employee will be email a P45 if they have an email address (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsLeaversEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsLeaversEmployeeRequest( + $employerId, + $date = null, + $emailP45 = null, + $requestBody = null, + string $contentType = self::contentTypes['markAsLeaversEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsLeaversEmployee' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/employees/leavers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $emailP45, + 'emailP45', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation minimumWageEmployee + * + * Minimum Wage + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear (required) + * @param \DateTime|null $date The date for which we should calculate the employees age, for not provided we'll use today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['minimumWageEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function minimumWageEmployee( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\DateTime $date = null, + string $contentType = self::contentTypes['minimumWageEmployee'][0] + ): float + { + list($response) = $this->minimumWageEmployeeWithHttpInfo($employerId, $id, $taxYear, $date, $contentType); + return $response; + } + + /** + * Operation minimumWageEmployeeWithHttpInfo + * + * Minimum Wage + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear (required) + * @param \DateTime|null $date The date for which we should calculate the employees age, for not provided we'll use today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['minimumWageEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function minimumWageEmployeeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\DateTime $date = null, + string $contentType = self::contentTypes['minimumWageEmployee'][0] + ): array + { + $request = $this->minimumWageEmployeeRequest($employerId, $id, $taxYear, $date, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation minimumWageEmployeeAsync + * + * Minimum Wage + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear (required) + * @param \DateTime|null $date The date for which we should calculate the employees age, for not provided we'll use today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['minimumWageEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function minimumWageEmployeeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\DateTime $date = null, + string $contentType = self::contentTypes['minimumWageEmployee'][0] + ): PromiseInterface + { + return $this->minimumWageEmployeeAsyncWithHttpInfo($employerId, $id, $taxYear, $date, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation minimumWageEmployeeAsyncWithHttpInfo + * + * Minimum Wage + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear (required) + * @param \DateTime|null $date The date for which we should calculate the employees age, for not provided we'll use today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['minimumWageEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function minimumWageEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + $date = null, + string $contentType = self::contentTypes['minimumWageEmployee'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->minimumWageEmployeeRequest($employerId, $id, $taxYear, $date, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'minimumWageEmployee' + * + * @param string $employerId The Id of the Employer (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear (required) + * @param \DateTime|null $date The date for which we should calculate the employees age, for not provided we'll use today's date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['minimumWageEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function minimumWageEmployeeRequest( + $employerId, + $id, + $taxYear, + $date = null, + string $contentType = self::contentTypes['minimumWageEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling minimumWageEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling minimumWageEmployee' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling minimumWageEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}/{taxYear}/minimum-wage'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payRunEntriesEmployee + * + * PayRunEntries for Employee + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to list PayRunEntries. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntriesEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function payRunEntriesEmployee( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['payRunEntriesEmployee'][0] + ): array + { + list($response) = $this->payRunEntriesEmployeeWithHttpInfo($employerId, $id, $taxYear, $contentType); + return $response; + } + + /** + * Operation payRunEntriesEmployeeWithHttpInfo + * + * PayRunEntries for Employee + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to list PayRunEntries. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntriesEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function payRunEntriesEmployeeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['payRunEntriesEmployee'][0] + ): array + { + $request = $this->payRunEntriesEmployeeRequest($employerId, $id, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payRunEntriesEmployeeAsync + * + * PayRunEntries for Employee + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to list PayRunEntries. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntriesEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunEntriesEmployeeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['payRunEntriesEmployee'][0] + ): PromiseInterface + { + return $this->payRunEntriesEmployeeAsyncWithHttpInfo($employerId, $id, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payRunEntriesEmployeeAsyncWithHttpInfo + * + * PayRunEntries for Employee + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to list PayRunEntries. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntriesEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunEntriesEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + string $contentType = self::contentTypes['payRunEntriesEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->payRunEntriesEmployeeRequest($employerId, $id, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payRunEntriesEmployee' + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string $id The Employee Id. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to list PayRunEntries. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntriesEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payRunEntriesEmployeeRequest( + $employerId, + $id, + $taxYear, + string $contentType = self::contentTypes['payRunEntriesEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payRunEntriesEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payRunEntriesEmployee' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payRunEntriesEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/payrunentries/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation reHireEmployee + * + * Rehire an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to rehire. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reHireEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function reHireEmployee( + string $employerId, + string $id, + string $contentType = self::contentTypes['reHireEmployee'][0] + ): void + { + $this->reHireEmployeeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation reHireEmployeeWithHttpInfo + * + * Rehire an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to rehire. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reHireEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function reHireEmployeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['reHireEmployee'][0] + ): array + { + $request = $this->reHireEmployeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation reHireEmployeeAsync + * + * Rehire an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to rehire. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reHireEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reHireEmployeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['reHireEmployee'][0] + ): PromiseInterface + { + return $this->reHireEmployeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation reHireEmployeeAsyncWithHttpInfo + * + * Rehire an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to rehire. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reHireEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reHireEmployeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['reHireEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->reHireEmployeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'reHireEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to rehire. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reHireEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function reHireEmployeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['reHireEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling reHireEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling reHireEmployee' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{id}/rehire'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchByPayrollCodeEmployee + * + * Get Employee by Payroll Code + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $code The payroll code to look for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPayrollCodeEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item + */ + public function searchByPayrollCodeEmployee( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['searchByPayrollCodeEmployee'][0] + ): \SynergiTech\Staffology\Model\Item + { + list($response) = $this->searchByPayrollCodeEmployeeWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation searchByPayrollCodeEmployeeWithHttpInfo + * + * Get Employee by Payroll Code + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $code The payroll code to look for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPayrollCodeEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item, HTTP status code, HTTP response headers (array of strings) + */ + public function searchByPayrollCodeEmployeeWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['searchByPayrollCodeEmployee'][0] + ): array + { + $request = $this->searchByPayrollCodeEmployeeRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchByPayrollCodeEmployeeAsync + * + * Get Employee by Payroll Code + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $code The payroll code to look for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPayrollCodeEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchByPayrollCodeEmployeeAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['searchByPayrollCodeEmployee'][0] + ): PromiseInterface + { + return $this->searchByPayrollCodeEmployeeAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchByPayrollCodeEmployeeAsyncWithHttpInfo + * + * Get Employee by Payroll Code + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $code The payroll code to look for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPayrollCodeEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchByPayrollCodeEmployeeAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['searchByPayrollCodeEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item'; + $request = $this->searchByPayrollCodeEmployeeRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchByPayrollCodeEmployee' + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $code The payroll code to look for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPayrollCodeEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchByPayrollCodeEmployeeRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['searchByPayrollCodeEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling searchByPayrollCodeEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/search/payrollcode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchEmployee + * + * Search Employer for Employees + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function searchEmployee( + string $employerId, + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployee'][0] + ): array + { + list($response) = $this->searchEmployeeWithHttpInfo($employerId, $query, $exludeCisSubContactors, $contentType); + return $response; + } + + /** + * Operation searchEmployeeWithHttpInfo + * + * Search Employer for Employees + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function searchEmployeeWithHttpInfo( + string $employerId, + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployee'][0] + ): array + { + $request = $this->searchEmployeeRequest($employerId, $query, $exludeCisSubContactors, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchEmployeeAsync + * + * Search Employer for Employees + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployeeAsync( + string $employerId, + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployee'][0] + ): PromiseInterface + { + return $this->searchEmployeeAsyncWithHttpInfo($employerId, $query, $exludeCisSubContactors, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchEmployeeAsyncWithHttpInfo + * + * Search Employer for Employees + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployeeAsyncWithHttpInfo( + $employerId, + $query = null, + $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->searchEmployeeRequest($employerId, $query, $exludeCisSubContactors, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchEmployee' + * + * @param string $employerId The Id of the Employer to search. (required) + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labelled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchEmployeeRequest( + $employerId, + $query = null, + $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling searchEmployee' + ); + } + + + + + $resourcePath = '/employers/{employerId}/employees/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $exludeCisSubContactors, + 'exludeCisSubContactors', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setDepartmentMembershipsEmployee + * + * Set Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DepartmentMembership[] + */ + public function setDepartmentMembershipsEmployee( + string $employerId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployee'][0] + ): array + { + list($response) = $this->setDepartmentMembershipsEmployeeWithHttpInfo($employerId, $id, $departmentMembership, $contentType); + return $response; + } + + /** + * Operation setDepartmentMembershipsEmployeeWithHttpInfo + * + * Set Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DepartmentMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function setDepartmentMembershipsEmployeeWithHttpInfo( + string $employerId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployee'][0] + ): array + { + $request = $this->setDepartmentMembershipsEmployeeRequest($employerId, $id, $departmentMembership, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DepartmentMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DepartmentMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DepartmentMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DepartmentMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setDepartmentMembershipsEmployeeAsync + * + * Set Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setDepartmentMembershipsEmployeeAsync( + string $employerId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployee'][0] + ): PromiseInterface + { + return $this->setDepartmentMembershipsEmployeeAsyncWithHttpInfo($employerId, $id, $departmentMembership, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setDepartmentMembershipsEmployeeAsyncWithHttpInfo + * + * Set Employee Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setDepartmentMembershipsEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + $request = $this->setDepartmentMembershipsEmployeeRequest($employerId, $id, $departmentMembership, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setDepartmentMembershipsEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setDepartmentMembershipsEmployeeRequest( + $employerId, + $id, + $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setDepartmentMembershipsEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setDepartmentMembershipsEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($departmentMembership)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($departmentMembership)); + } else { + $httpBody = $departmentMembership; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEmployeeCostCentresEmployee + * + * Set Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set CostCentres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeCostCentre[] + */ + public function setEmployeeCostCentresEmployee( + string $employerId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setEmployeeCostCentresEmployee'][0] + ): array + { + list($response) = $this->setEmployeeCostCentresEmployeeWithHttpInfo($employerId, $id, $employeeCostCentre, $contentType); + return $response; + } + + /** + * Operation setEmployeeCostCentresEmployeeWithHttpInfo + * + * Set Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set CostCentres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeCostCentre[], HTTP status code, HTTP response headers (array of strings) + */ + public function setEmployeeCostCentresEmployeeWithHttpInfo( + string $employerId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setEmployeeCostCentresEmployee'][0] + ): array + { + $request = $this->setEmployeeCostCentresEmployeeRequest($employerId, $id, $employeeCostCentre, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeCostCentre[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeCostCentre[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setEmployeeCostCentresEmployeeAsync + * + * Set Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set CostCentres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeCostCentresEmployeeAsync( + string $employerId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setEmployeeCostCentresEmployee'][0] + ): PromiseInterface + { + return $this->setEmployeeCostCentresEmployeeAsyncWithHttpInfo($employerId, $id, $employeeCostCentre, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEmployeeCostCentresEmployeeAsyncWithHttpInfo + * + * Set Employee Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set CostCentres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeCostCentresEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $employeeCostCentre = null, + string $contentType = self::contentTypes['setEmployeeCostCentresEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + $request = $this->setEmployeeCostCentresEmployeeRequest($employerId, $id, $employeeCostCentre, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEmployeeCostCentresEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to set CostCentres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCostCentresEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEmployeeCostCentresEmployeeRequest( + $employerId, + $id, + $employeeCostCentre = null, + string $contentType = self::contentTypes['setEmployeeCostCentresEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setEmployeeCostCentresEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setEmployeeCostCentresEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employeeCostCentre)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employeeCostCentre)); + } else { + $httpBody = $employeeCostCentre; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setOnHoldEmployee + * + * Mark as On Hold + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param bool|null $onHold The OnHold status to set (optional) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOnHoldEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setOnHoldEmployee( + string $employerId, + ?bool $onHold = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['setOnHoldEmployee'][0] + ): void + { + $this->setOnHoldEmployeeWithHttpInfo($employerId, $onHold, $requestBody, $contentType); + } + + /** + * Operation setOnHoldEmployeeWithHttpInfo + * + * Mark as On Hold + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param bool|null $onHold The OnHold status to set (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOnHoldEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setOnHoldEmployeeWithHttpInfo( + string $employerId, + ?bool $onHold = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['setOnHoldEmployee'][0] + ): array + { + $request = $this->setOnHoldEmployeeRequest($employerId, $onHold, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setOnHoldEmployeeAsync + * + * Mark as On Hold + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param bool|null $onHold The OnHold status to set (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOnHoldEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setOnHoldEmployeeAsync( + string $employerId, + ?bool $onHold = null, + ?array $requestBody = null, + string $contentType = self::contentTypes['setOnHoldEmployee'][0] + ): PromiseInterface + { + return $this->setOnHoldEmployeeAsyncWithHttpInfo($employerId, $onHold, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setOnHoldEmployeeAsyncWithHttpInfo + * + * Mark as On Hold + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param bool|null $onHold The OnHold status to set (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOnHoldEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setOnHoldEmployeeAsyncWithHttpInfo( + $employerId, + $onHold = null, + $requestBody = null, + string $contentType = self::contentTypes['setOnHoldEmployee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setOnHoldEmployeeRequest($employerId, $onHold, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setOnHoldEmployee' + * + * @param string $employerId The Id of the Employer to which the Employees belong (required) + * @param bool|null $onHold The OnHold status to set (optional) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOnHoldEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setOnHoldEmployeeRequest( + $employerId, + $onHold = null, + $requestBody = null, + string $contentType = self::contentTypes['setOnHoldEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setOnHoldEmployee' + ); + } + + + + + $resourcePath = '/employers/{employerId}/employees/onhold'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $onHold, + 'onHold', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployee + * + * Update an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest|null $contractUpdateEmployeeRequest contractUpdateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeResponse + */ + public function updateEmployee( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest $contractUpdateEmployeeRequest = null, + string $contentType = self::contentTypes['updateEmployee'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeResponse + { + list($response) = $this->updateEmployeeWithHttpInfo($employerId, $id, $contractUpdateEmployeeRequest, $contentType); + return $response; + } + + /** + * Operation updateEmployeeWithHttpInfo + * + * Update an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest|null $contractUpdateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest $contractUpdateEmployeeRequest = null, + string $contentType = self::contentTypes['updateEmployee'][0] + ): array + { + $request = $this->updateEmployeeRequest($employerId, $id, $contractUpdateEmployeeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployeeAsync + * + * Update an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest|null $contractUpdateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest $contractUpdateEmployeeRequest = null, + string $contentType = self::contentTypes['updateEmployee'][0] + ): PromiseInterface + { + return $this->updateEmployeeAsyncWithHttpInfo($employerId, $id, $contractUpdateEmployeeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployeeAsyncWithHttpInfo + * + * Update an Employee + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest|null $contractUpdateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $contractUpdateEmployeeRequest = null, + string $contentType = self::contentTypes['updateEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + $request = $this->updateEmployeeRequest($employerId, $id, $contractUpdateEmployeeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractUpdateEmployeeRequest|null $contractUpdateEmployeeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployeeRequest( + $employerId, + $id, + $contractUpdateEmployeeRequest = null, + string $contentType = self::contentTypes['updateEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractUpdateEmployeeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractUpdateEmployeeRequest)); + } else { + $httpBody = $contractUpdateEmployeeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEvcSettingsEmployee + * + * Update EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for who you want to update EvcSettings. (required) + * @param \SynergiTech\Staffology\Model\EvcSettings|null $evcSettings evcSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EvcSettings + */ + public function updateEvcSettingsEmployee( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\EvcSettings $evcSettings = null, + string $contentType = self::contentTypes['updateEvcSettingsEmployee'][0] + ): \SynergiTech\Staffology\Model\EvcSettings + { + list($response) = $this->updateEvcSettingsEmployeeWithHttpInfo($employerId, $id, $evcSettings, $contentType); + return $response; + } + + /** + * Operation updateEvcSettingsEmployeeWithHttpInfo + * + * Update EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for who you want to update EvcSettings. (required) + * @param \SynergiTech\Staffology\Model\EvcSettings|null $evcSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EvcSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEvcSettingsEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\EvcSettings $evcSettings = null, + string $contentType = self::contentTypes['updateEvcSettingsEmployee'][0] + ): array + { + $request = $this->updateEvcSettingsEmployeeRequest($employerId, $id, $evcSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EvcSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EvcSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EvcSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EvcSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EvcSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEvcSettingsEmployeeAsync + * + * Update EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for who you want to update EvcSettings. (required) + * @param \SynergiTech\Staffology\Model\EvcSettings|null $evcSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEvcSettingsEmployeeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\EvcSettings $evcSettings = null, + string $contentType = self::contentTypes['updateEvcSettingsEmployee'][0] + ): PromiseInterface + { + return $this->updateEvcSettingsEmployeeAsyncWithHttpInfo($employerId, $id, $evcSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEvcSettingsEmployeeAsyncWithHttpInfo + * + * Update EvcSettings + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for who you want to update EvcSettings. (required) + * @param \SynergiTech\Staffology\Model\EvcSettings|null $evcSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEvcSettingsEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $evcSettings = null, + string $contentType = self::contentTypes['updateEvcSettingsEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EvcSettings'; + $request = $this->updateEvcSettingsEmployeeRequest($employerId, $id, $evcSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEvcSettingsEmployee' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $id The Id of the Employee for who you want to update EvcSettings. (required) + * @param \SynergiTech\Staffology\Model\EvcSettings|null $evcSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEvcSettingsEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEvcSettingsEmployeeRequest( + $employerId, + $id, + $evcSettings = null, + string $contentType = self::contentTypes['updateEvcSettingsEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEvcSettingsEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEvcSettingsEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}/evcsettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($evcSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($evcSettings)); + } else { + $httpBody = $evcSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePhotoEmployee + * + * Update Photo + * + * @param string $employerId employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeResponse + */ + public function updatePhotoEmployee( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoEmployee'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeResponse + { + list($response) = $this->updatePhotoEmployeeWithHttpInfo($employerId, $id, $file, $contentType); + return $response; + } + + /** + * Operation updatePhotoEmployeeWithHttpInfo + * + * Update Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoEmployee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePhotoEmployeeWithHttpInfo( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoEmployee'][0] + ): array + { + $request = $this->updatePhotoEmployeeRequest($employerId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePhotoEmployeeAsync + * + * Update Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePhotoEmployeeAsync( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updatePhotoEmployee'][0] + ): PromiseInterface + { + return $this->updatePhotoEmployeeAsyncWithHttpInfo($employerId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePhotoEmployeeAsyncWithHttpInfo + * + * Update Photo + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePhotoEmployeeAsyncWithHttpInfo( + $employerId, + $id, + $file = null, + string $contentType = self::contentTypes['updatePhotoEmployee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeResponse'; + $request = $this->updatePhotoEmployeeRequest($employerId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePhotoEmployee' + * + * @param string $employerId (required) + * @param string $id The Id of the Employee you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhotoEmployee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePhotoEmployeeRequest( + $employerId, + $id, + $file = null, + string $contentType = self::contentTypes['updatePhotoEmployee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePhotoEmployee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePhotoEmployee' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{id}/photo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmployeeRoleApi.php b/src/Api/EmployeeRoleApi.php new file mode 100644 index 0000000..7d7cc30 --- /dev/null +++ b/src/Api/EmployeeRoleApi.php @@ -0,0 +1,7616 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createRoleWorkingPatternEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteEmployeeRole' => [ + 'application/json', + ], + 'deleteRoleWorkingPatternEmployeeRole' => [ + 'application/json', + ], + 'getBaseDailyRateEmployeeRole' => [ + 'application/json', + ], + 'getBaseHourlyRateEmployeeRole' => [ + 'application/json', + ], + 'getCostCentreMembershipsEmployeeRole' => [ + 'application/json', + ], + 'getDepartmentMembershipsEmployeeRole' => [ + 'application/json', + ], + 'getEmployeeRole' => [ + 'application/json', + ], + 'getEmployeeRoleAnalysisCategoryCodesEmployeeRole' => [ + 'application/json', + ], + 'getRoleAssumedPensionablePayEmployeeRole' => [ + 'application/json', + ], + 'getRoleWorkingPatternEmployeeRole' => [ + 'application/json', + ], + 'indexEmployeeRole' => [ + 'application/json', + ], + 'listRoleWorkingPatternsEmployeeRole' => [ + 'application/json', + ], + 'setCostCentreMembershipsEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setDepartmentMembershipsEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setEmployeeRoleAnalysisCategoryCodesEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateRoleWorkingPatternEmployeeRole' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createEmployeeRole + * + * Create Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\EmployeeRole + */ + public function createEmployeeRole( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['createEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\EmployeeRole + { + list($response) = $this->createEmployeeRoleWithHttpInfo($employerId, $employeeId, $employeeRole, $contentType); + return $response; + } + + /** + * Operation createEmployeeRoleWithHttpInfo + * + * Create Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\EmployeeRole, HTTP status code, HTTP response headers (array of strings) + */ + public function createEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['createEmployeeRole'][0] + ): array + { + $request = $this->createEmployeeRoleRequest($employerId, $employeeId, $employeeRole, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\EmployeeRole', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeRole' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeRole'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEmployeeRoleAsync + * + * Create Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployeeRoleAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['createEmployeeRole'][0] + ): PromiseInterface + { + return $this->createEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $employeeRole, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEmployeeRoleAsyncWithHttpInfo + * + * Create Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $employeeRole = null, + string $contentType = self::contentTypes['createEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeRole'; + $request = $this->createEmployeeRoleRequest($employerId, $employeeId, $employeeRole, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createEmployeeRoleRequest( + $employerId, + $employeeId, + $employeeRole = null, + string $contentType = self::contentTypes['createEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employeeRole)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employeeRole)); + } else { + $httpBody = $employeeRole; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createRoleWorkingPatternEmployeeRole + * + * Create Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to create a Role Working Pattern for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + */ + public function createRoleWorkingPatternEmployeeRole( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['createRoleWorkingPatternEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + { + list($response) = $this->createRoleWorkingPatternEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest, $contentType); + return $response; + } + + /** + * Operation createRoleWorkingPatternEmployeeRoleWithHttpInfo + * + * Create Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to create a Role Working Pattern for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createRoleWorkingPatternEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['createRoleWorkingPatternEmployeeRole'][0] + ): array + { + $request = $this->createRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createRoleWorkingPatternEmployeeRoleAsync + * + * Create Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to create a Role Working Pattern for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createRoleWorkingPatternEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['createRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + return $this->createRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo + * + * Create Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to create a Role Working Pattern for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['createRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + $request = $this->createRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $contractEmployeeRoleWorkingPatternRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createRoleWorkingPatternEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to create a Role Working Pattern for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createRoleWorkingPatternEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['createRoleWorkingPatternEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling createRoleWorkingPatternEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractEmployeeRoleWorkingPatternRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractEmployeeRoleWorkingPatternRequest)); + } else { + $httpBody = $contractEmployeeRoleWorkingPatternRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEmployeeRole + * + * Delete Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteEmployeeRole'][0] + ): void + { + $this->deleteEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteEmployeeRoleWithHttpInfo + * + * Delete Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteEmployeeRole'][0] + ): array + { + $request = $this->deleteEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteEmployeeRoleAsync + * + * Delete Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteEmployeeRole'][0] + ): PromiseInterface + { + return $this->deleteEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEmployeeRoleAsyncWithHttpInfo + * + * Delete Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteEmployeeRole'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteRoleWorkingPatternEmployeeRole + * + * Delete Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role to which the Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteRoleWorkingPatternEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['deleteRoleWorkingPatternEmployeeRole'][0] + ): void + { + $this->deleteRoleWorkingPatternEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + } + + /** + * Operation deleteRoleWorkingPatternEmployeeRoleWithHttpInfo + * + * Delete Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role to which the Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteRoleWorkingPatternEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['deleteRoleWorkingPatternEmployeeRole'][0] + ): array + { + $request = $this->deleteRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteRoleWorkingPatternEmployeeRoleAsync + * + * Delete Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role to which the Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteRoleWorkingPatternEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['deleteRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + return $this->deleteRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo + * + * Delete Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role to which the Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + string $contentType = self::contentTypes['deleteRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteRoleWorkingPatternEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role to which the Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteRoleWorkingPatternEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + string $contentType = self::contentTypes['deleteRoleWorkingPatternEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'roleWorkingPatternId' is set + if ($roleWorkingPatternId === null || (is_array($roleWorkingPatternId) && count($roleWorkingPatternId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleWorkingPatternId when calling deleteRoleWorkingPatternEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($roleWorkingPatternId !== null) { + $resourcePath = str_replace( + '{' . 'roleWorkingPatternId' . '}', + ObjectSerializer::toPathValue($roleWorkingPatternId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBaseDailyRateEmployeeRole + * + * Calculate Base Daily Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseDailyRateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function getBaseDailyRateEmployeeRole( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseDailyRateEmployeeRole'][0] + ): float + { + list($response) = $this->getBaseDailyRateEmployeeRoleWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + return $response; + } + + /** + * Operation getBaseDailyRateEmployeeRoleWithHttpInfo + * + * Calculate Base Daily Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseDailyRateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function getBaseDailyRateEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseDailyRateEmployeeRole'][0] + ): array + { + $request = $this->getBaseDailyRateEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBaseDailyRateEmployeeRoleAsync + * + * Calculate Base Daily Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseDailyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBaseDailyRateEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseDailyRateEmployeeRole'][0] + ): PromiseInterface + { + return $this->getBaseDailyRateEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBaseDailyRateEmployeeRoleAsyncWithHttpInfo + * + * Calculate Base Daily Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseDailyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBaseDailyRateEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getBaseDailyRateEmployeeRole'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->getBaseDailyRateEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBaseDailyRateEmployeeRole' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseDailyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBaseDailyRateEmployeeRoleRequest( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getBaseDailyRateEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getBaseDailyRateEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getBaseDailyRateEmployeeRole' + ); + } + + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleId when calling getBaseDailyRateEmployeeRole' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{roleId}/basedailyrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payBasis, + 'payBasis', // param base name + 'PayBasis', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payAmount, + 'payAmount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $workingPatternId, + 'workingPatternId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($roleId !== null) { + $resourcePath = str_replace( + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBaseHourlyRateEmployeeRole + * + * Calculate Base Hourly Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseHourlyRateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function getBaseHourlyRateEmployeeRole( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseHourlyRateEmployeeRole'][0] + ): float + { + list($response) = $this->getBaseHourlyRateEmployeeRoleWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + return $response; + } + + /** + * Operation getBaseHourlyRateEmployeeRoleWithHttpInfo + * + * Calculate Base Hourly Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseHourlyRateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function getBaseHourlyRateEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseHourlyRateEmployeeRole'][0] + ): array + { + $request = $this->getBaseHourlyRateEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBaseHourlyRateEmployeeRoleAsync + * + * Calculate Base Hourly Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseHourlyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBaseHourlyRateEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\PayBasis $payBasis = null, + ?float $payAmount = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getBaseHourlyRateEmployeeRole'][0] + ): PromiseInterface + { + return $this->getBaseHourlyRateEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBaseHourlyRateEmployeeRoleAsyncWithHttpInfo + * + * Calculate Base Hourly Rate + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseHourlyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getBaseHourlyRateEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getBaseHourlyRateEmployeeRole'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->getBaseHourlyRateEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $payBasis, $payAmount, $workingPatternId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBaseHourlyRateEmployeeRole' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis (optional) + * @param float|null $payAmount The amount the Employee Role is regularly paid each period. (optional) + * @param string|null $workingPatternId The Id of the Working Pattern that we want the calculations against. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBaseHourlyRateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBaseHourlyRateEmployeeRoleRequest( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $payBasis = null, + $payAmount = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getBaseHourlyRateEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getBaseHourlyRateEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getBaseHourlyRateEmployeeRole' + ); + } + + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleId when calling getBaseHourlyRateEmployeeRole' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{roleId}/basehourlyrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payBasis, + 'payBasis', // param base name + 'PayBasis', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payAmount, + 'payAmount', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $workingPatternId, + 'workingPatternId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($roleId !== null) { + $resourcePath = str_replace( + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCostCentreMembershipsEmployeeRole + * + * Get Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Cost Centres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeCostCentre[] + */ + public function getCostCentreMembershipsEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getCostCentreMembershipsEmployeeRole'][0] + ): array + { + list($response) = $this->getCostCentreMembershipsEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getCostCentreMembershipsEmployeeRoleWithHttpInfo + * + * Get Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Cost Centres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeCostCentre[], HTTP status code, HTTP response headers (array of strings) + */ + public function getCostCentreMembershipsEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getCostCentreMembershipsEmployeeRole'][0] + ): array + { + $request = $this->getCostCentreMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeCostCentre[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeCostCentre[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCostCentreMembershipsEmployeeRoleAsync + * + * Get Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Cost Centres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreMembershipsEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getCostCentreMembershipsEmployeeRole'][0] + ): PromiseInterface + { + return $this->getCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo + * + * Get Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Cost Centres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getCostCentreMembershipsEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + $request = $this->getCostCentreMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCostCentreMembershipsEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Cost Centres for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCostCentreMembershipsEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getCostCentreMembershipsEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCostCentreMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getCostCentreMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getCostCentreMembershipsEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDepartmentMembershipsEmployeeRole + * + * Get Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Departments for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DepartmentMembership[] + */ + public function getDepartmentMembershipsEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployeeRole'][0] + ): array + { + list($response) = $this->getDepartmentMembershipsEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getDepartmentMembershipsEmployeeRoleWithHttpInfo + * + * Get Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Departments for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DepartmentMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function getDepartmentMembershipsEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployeeRole'][0] + ): array + { + $request = $this->getDepartmentMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DepartmentMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DepartmentMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DepartmentMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DepartmentMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDepartmentMembershipsEmployeeRoleAsync + * + * Get Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Departments for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentMembershipsEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployeeRole'][0] + ): PromiseInterface + { + return $this->getDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo + * + * Get Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Departments for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + $request = $this->getDepartmentMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDepartmentMembershipsEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve Departments for. (required) + * @param string $id The Id of the Employee Role you want to retrieve Departments for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDepartmentMembershipsEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getDepartmentMembershipsEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDepartmentMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDepartmentMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDepartmentMembershipsEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployeeRole + * + * Get Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The id of the Role you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleResponse + */ + public function getEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeRoleResponse + { + list($response) = $this->getEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getEmployeeRoleWithHttpInfo + * + * Get Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The id of the Role you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRole'][0] + ): array + { + $request = $this->getEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployeeRoleAsync + * + * Get Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The id of the Role you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRole'][0] + ): PromiseInterface + { + return $this->getEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployeeRoleAsyncWithHttpInfo + * + * Get Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The id of the Role you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleResponse'; + $request = $this->getEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The id of the Role you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployeeRoleAnalysisCategoryCodesEmployeeRole + * + * Get Employee Role AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[] + */ + public function getEmployeeRoleAnalysisCategoryCodesEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): array + { + list($response) = $this->getEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo + * + * Get Employee Role AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): array + { + $request = $this->getEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsync + * + * Get Employee Role AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): PromiseInterface + { + return $this->getEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo + * + * Get Employee Role AnalysisCategoryCode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]'; + $request = $this->getEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployeeRoleAnalysisCategoryCodesEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to retrieve AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to retrieve AnalysisCategoryCode for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategorycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRoleAssumedPensionablePayEmployeeRole + * + * Calculate Assumed Pensionable Pay + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of the Leave. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The pay type of the Leave. (optional) + * @param \DateTime|null $from The date from which the Assumed Pensionable Pay is calculated. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function getRoleAssumedPensionablePayEmployeeRole( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + string $contentType = self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'][0] + ): float + { + list($response) = $this->getRoleAssumedPensionablePayEmployeeRoleWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from, $contentType); + return $response; + } + + /** + * Operation getRoleAssumedPensionablePayEmployeeRoleWithHttpInfo + * + * Calculate Assumed Pensionable Pay + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of the Leave. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The pay type of the Leave. (optional) + * @param \DateTime|null $from The date from which the Assumed Pensionable Pay is calculated. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function getRoleAssumedPensionablePayEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + string $contentType = self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'][0] + ): array + { + $request = $this->getRoleAssumedPensionablePayEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleAssumedPensionablePayEmployeeRoleAsync + * + * Calculate Assumed Pensionable Pay + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of the Leave. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The pay type of the Leave. (optional) + * @param \DateTime|null $from The date from which the Assumed Pensionable Pay is calculated. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRoleAssumedPensionablePayEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $roleId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + string $contentType = self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'][0] + ): PromiseInterface + { + return $this->getRoleAssumedPensionablePayEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleAssumedPensionablePayEmployeeRoleAsyncWithHttpInfo + * + * Calculate Assumed Pensionable Pay + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of the Leave. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The pay type of the Leave. (optional) + * @param \DateTime|null $from The date from which the Assumed Pensionable Pay is calculated. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRoleAssumedPensionablePayEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $leaveType = null, + $leavePayType = null, + $from = null, + string $contentType = self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->getRoleAssumedPensionablePayEmployeeRoleRequest($employerId, $employeeId, $roleId, $payPeriod, $leaveType, $leavePayType, $from, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRoleAssumedPensionablePayEmployeeRole' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param string $roleId The Employee Role Id. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The frequency that this Employee Role is paid. (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of the Leave. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The pay type of the Leave. (optional) + * @param \DateTime|null $from The date from which the Assumed Pensionable Pay is calculated. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRoleAssumedPensionablePayEmployeeRoleRequest( + $employerId, + $employeeId, + $roleId, + $payPeriod = null, + $leaveType = null, + $leavePayType = null, + $from = null, + string $contentType = self::contentTypes['getRoleAssumedPensionablePayEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getRoleAssumedPensionablePayEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getRoleAssumedPensionablePayEmployeeRole' + ); + } + + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleId when calling getRoleAssumedPensionablePayEmployeeRole' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{roleId}/assumedpensionablepay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveType, + 'leaveType', // param base name + 'LeaveType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leavePayType, + 'leavePayType', // param base name + 'LeavePayType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from, + 'from', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($roleId !== null) { + $resourcePath = str_replace( + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRoleWorkingPatternEmployeeRole + * + * Get Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve a Role Working Pattern for. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + */ + public function getRoleWorkingPatternEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['getRoleWorkingPatternEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + { + list($response) = $this->getRoleWorkingPatternEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + return $response; + } + + /** + * Operation getRoleWorkingPatternEmployeeRoleWithHttpInfo + * + * Get Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve a Role Working Pattern for. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getRoleWorkingPatternEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['getRoleWorkingPatternEmployeeRole'][0] + ): array + { + $request = $this->getRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleWorkingPatternEmployeeRoleAsync + * + * Get Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve a Role Working Pattern for. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRoleWorkingPatternEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + string $contentType = self::contentTypes['getRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + return $this->getRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo + * + * Get Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve a Role Working Pattern for. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + string $contentType = self::contentTypes['getRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + $request = $this->getRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRoleWorkingPatternEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve a Role Working Pattern for. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRoleWorkingPatternEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + string $contentType = self::contentTypes['getRoleWorkingPatternEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'roleWorkingPatternId' is set + if ($roleWorkingPatternId === null || (is_array($roleWorkingPatternId) && count($roleWorkingPatternId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleWorkingPatternId when calling getRoleWorkingPatternEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns/{roleWorkingPatternId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($roleWorkingPatternId !== null) { + $resourcePath = str_replace( + '{' . 'roleWorkingPatternId' . '}', + ObjectSerializer::toPathValue($roleWorkingPatternId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmployeeRole + * + * List Employee Roles + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee which you want to list Roles. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmployeeRole( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexEmployeeRole'][0] + ): array + { + list($response) = $this->indexEmployeeRoleWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexEmployeeRoleWithHttpInfo + * + * List Employee Roles + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee which you want to list Roles. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexEmployeeRole'][0] + ): array + { + $request = $this->indexEmployeeRoleRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmployeeRoleAsync + * + * List Employee Roles + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee which you want to list Roles. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexEmployeeRole'][0] + ): PromiseInterface + { + return $this->indexEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmployeeRoleAsyncWithHttpInfo + * + * List Employee Roles + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee which you want to list Roles. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmployeeRoleRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee which you want to list Roles. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmployeeRoleRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listRoleWorkingPatternsEmployeeRole + * + * List Working Patterns for an Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRoleWorkingPatternsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[] + */ + public function listRoleWorkingPatternsEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['listRoleWorkingPatternsEmployeeRole'][0] + ): array + { + list($response) = $this->listRoleWorkingPatternsEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation listRoleWorkingPatternsEmployeeRoleWithHttpInfo + * + * List Working Patterns for an Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRoleWorkingPatternsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[], HTTP status code, HTTP response headers (array of strings) + */ + public function listRoleWorkingPatternsEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['listRoleWorkingPatternsEmployeeRole'][0] + ): array + { + $request = $this->listRoleWorkingPatternsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listRoleWorkingPatternsEmployeeRoleAsync + * + * List Working Patterns for an Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRoleWorkingPatternsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listRoleWorkingPatternsEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['listRoleWorkingPatternsEmployeeRole'][0] + ): PromiseInterface + { + return $this->listRoleWorkingPatternsEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listRoleWorkingPatternsEmployeeRoleAsyncWithHttpInfo + * + * List Working Patterns for an Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRoleWorkingPatternsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listRoleWorkingPatternsEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['listRoleWorkingPatternsEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponseItem[]'; + $request = $this->listRoleWorkingPatternsEmployeeRoleRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listRoleWorkingPatternsEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Employee Role you want to retrieve Employee Role Working Patterns for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRoleWorkingPatternsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listRoleWorkingPatternsEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['listRoleWorkingPatternsEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listRoleWorkingPatternsEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling listRoleWorkingPatternsEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling listRoleWorkingPatternsEmployeeRole' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/workingpatterns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setCostCentreMembershipsEmployeeRole + * + * Set Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to set Cost Centres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeCostCentre[] + */ + public function setCostCentreMembershipsEmployeeRole( + string $employerId, + string $employeeId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setCostCentreMembershipsEmployeeRole'][0] + ): array + { + list($response) = $this->setCostCentreMembershipsEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $employeeCostCentre, $contentType); + return $response; + } + + /** + * Operation setCostCentreMembershipsEmployeeRoleWithHttpInfo + * + * Set Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to set Cost Centres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeCostCentre[], HTTP status code, HTTP response headers (array of strings) + */ + public function setCostCentreMembershipsEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setCostCentreMembershipsEmployeeRole'][0] + ): array + { + $request = $this->setCostCentreMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $employeeCostCentre, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeCostCentre[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeCostCentre[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setCostCentreMembershipsEmployeeRoleAsync + * + * Set Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to set Cost Centres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCostCentreMembershipsEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + ?array $employeeCostCentre = null, + string $contentType = self::contentTypes['setCostCentreMembershipsEmployeeRole'][0] + ): PromiseInterface + { + return $this->setCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $employeeCostCentre, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo + * + * Set Employee Role Cost Centres + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to set Cost Centres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCostCentreMembershipsEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $employeeCostCentre = null, + string $contentType = self::contentTypes['setCostCentreMembershipsEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeCostCentre[]'; + $request = $this->setCostCentreMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $employeeCostCentre, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setCostCentreMembershipsEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Cost Centres for. (required) + * @param string $id The Id of the Employee Role you want to set Cost Centres for. (required) + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentre (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCostCentreMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setCostCentreMembershipsEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $employeeCostCentre = null, + string $contentType = self::contentTypes['setCostCentreMembershipsEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setCostCentreMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling setCostCentreMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setCostCentreMembershipsEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/costcentres'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employeeCostCentre)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employeeCostCentre)); + } else { + $httpBody = $employeeCostCentre; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setDepartmentMembershipsEmployeeRole + * + * Set Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Departments for. (required) + * @param string $id The Id of the Employee Role you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\DepartmentMembership[] + */ + public function setDepartmentMembershipsEmployeeRole( + string $employerId, + string $employeeId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployeeRole'][0] + ): array + { + list($response) = $this->setDepartmentMembershipsEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $departmentMembership, $contentType); + return $response; + } + + /** + * Operation setDepartmentMembershipsEmployeeRoleWithHttpInfo + * + * Set Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Departments for. (required) + * @param string $id The Id of the Employee Role you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\DepartmentMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function setDepartmentMembershipsEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployeeRole'][0] + ): array + { + $request = $this->setDepartmentMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $departmentMembership, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\DepartmentMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\DepartmentMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\DepartmentMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\DepartmentMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setDepartmentMembershipsEmployeeRoleAsync + * + * Set Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Departments for. (required) + * @param string $id The Id of the Employee Role you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setDepartmentMembershipsEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + ?array $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployeeRole'][0] + ): PromiseInterface + { + return $this->setDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $departmentMembership, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo + * + * Set Employee Role Departments + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Departments for. (required) + * @param string $id The Id of the Employee Role you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setDepartmentMembershipsEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\DepartmentMembership[]'; + $request = $this->setDepartmentMembershipsEmployeeRoleRequest($employerId, $employeeId, $id, $departmentMembership, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setDepartmentMembershipsEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set Departments for. (required) + * @param string $id The Id of the Employee Role you want to set Departments for. (required) + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setDepartmentMembershipsEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setDepartmentMembershipsEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $departmentMembership = null, + string $contentType = self::contentTypes['setDepartmentMembershipsEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setDepartmentMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling setDepartmentMembershipsEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setDepartmentMembershipsEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/departments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($departmentMembership)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($departmentMembership)); + } else { + $httpBody = $departmentMembership; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEmployeeRoleAnalysisCategoryCodesEmployeeRole + * + * Set Employee Role AnalysisCategorycode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to set AnalysisCategoryCode for. (required) + * @param string $analysisCategoryId The Id of the Analysis Category you want to set AnalysisCategoryCode for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]|null $contractEmployeeRoleAnalysisCategoryCodeRequest contractEmployeeRoleAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[] + */ + public function setEmployeeRoleAnalysisCategoryCodesEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $analysisCategoryId, + ?array $contractEmployeeRoleAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): array + { + list($response) = $this->setEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest, $contentType); + return $response; + } + + /** + * Operation setEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo + * + * Set Employee Role AnalysisCategorycode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to set AnalysisCategoryCode for. (required) + * @param string $analysisCategoryId The Id of the Analysis Category you want to set AnalysisCategoryCode for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]|null $contractEmployeeRoleAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function setEmployeeRoleAnalysisCategoryCodesEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $analysisCategoryId, + ?array $contractEmployeeRoleAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): array + { + $request = $this->setEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsync + * + * Set Employee Role AnalysisCategorycode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to set AnalysisCategoryCode for. (required) + * @param string $analysisCategoryId The Id of the Analysis Category you want to set AnalysisCategoryCode for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]|null $contractEmployeeRoleAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $analysisCategoryId, + ?array $contractEmployeeRoleAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): PromiseInterface + { + return $this->setEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo + * + * Set Employee Role AnalysisCategorycode + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to set AnalysisCategoryCode for. (required) + * @param string $analysisCategoryId The Id of the Analysis Category you want to set AnalysisCategoryCode for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]|null $contractEmployeeRoleAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeRoleAnalysisCategoryCodesEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $analysisCategoryId, + $contractEmployeeRoleAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeResponse[]'; + $request = $this->setEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest($employerId, $employeeId, $id, $analysisCategoryId, $contractEmployeeRoleAnalysisCategoryCodeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEmployeeRoleAnalysisCategoryCodesEmployeeRole' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to set AnalysisCategoryCode for. (required) + * @param string $id The Id of the Employee Role you want to set AnalysisCategoryCode for. (required) + * @param string $analysisCategoryId The Id of the Analysis Category you want to set AnalysisCategoryCode for. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleAnalysisCategoryCodeRequest[]|null $contractEmployeeRoleAnalysisCategoryCodeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEmployeeRoleAnalysisCategoryCodesEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $analysisCategoryId, + $contractEmployeeRoleAnalysisCategoryCodeRequest = null, + string $contentType = self::contentTypes['setEmployeeRoleAnalysisCategoryCodesEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling setEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + // verify the required parameter 'analysisCategoryId' is set + if ($analysisCategoryId === null || (is_array($analysisCategoryId) && count($analysisCategoryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $analysisCategoryId when calling setEmployeeRoleAnalysisCategoryCodesEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/analysiscategories/{analysisCategoryId}/analysiscategorycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($analysisCategoryId !== null) { + $resourcePath = str_replace( + '{' . 'analysisCategoryId' . '}', + ObjectSerializer::toPathValue($analysisCategoryId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractEmployeeRoleAnalysisCategoryCodeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractEmployeeRoleAnalysisCategoryCodeRequest)); + } else { + $httpBody = $contractEmployeeRoleAnalysisCategoryCodeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployeeRole + * + * Update Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to update. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeRole + */ + public function updateEmployeeRole( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['updateEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\EmployeeRole + { + list($response) = $this->updateEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $employeeRole, $contentType); + return $response; + } + + /** + * Operation updateEmployeeRoleWithHttpInfo + * + * Update Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to update. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeRole, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['updateEmployeeRole'][0] + ): array + { + $request = $this->updateEmployeeRoleRequest($employerId, $employeeId, $id, $employeeRole, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeRole', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeRole' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeRole'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployeeRoleAsync + * + * Update Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to update. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\EmployeeRole $employeeRole = null, + string $contentType = self::contentTypes['updateEmployeeRole'][0] + ): PromiseInterface + { + return $this->updateEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $employeeRole, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployeeRoleAsyncWithHttpInfo + * + * Update Employee Role + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to update. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $employeeRole = null, + string $contentType = self::contentTypes['updateEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeRole'; + $request = $this->updateEmployeeRoleRequest($employerId, $employeeId, $id, $employeeRole, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to update. (required) + * @param \SynergiTech\Staffology\Model\EmployeeRole|null $employeeRole (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $employeeRole = null, + string $contentType = self::contentTypes['updateEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employeeRole)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employeeRole)); + } else { + $httpBody = $employeeRole; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateRoleWorkingPatternEmployeeRole + * + * Update Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to which the Employee Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + */ + public function updateRoleWorkingPatternEmployeeRole( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateRoleWorkingPatternEmployeeRole'][0] + ): \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse + { + list($response) = $this->updateRoleWorkingPatternEmployeeRoleWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest, $contentType); + return $response; + } + + /** + * Operation updateRoleWorkingPatternEmployeeRoleWithHttpInfo + * + * Update Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to which the Employee Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateRoleWorkingPatternEmployeeRoleWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateRoleWorkingPatternEmployeeRole'][0] + ): array + { + $request = $this->updateRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateRoleWorkingPatternEmployeeRoleAsync + * + * Update Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to which the Employee Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateRoleWorkingPatternEmployeeRoleAsync( + string $employerId, + string $employeeId, + string $id, + string $roleWorkingPatternId, + ?\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + return $this->updateRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo + * + * Update Employee Role Working Pattern + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to which the Employee Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateRoleWorkingPatternEmployeeRoleAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateRoleWorkingPatternEmployeeRole'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternResponse'; + $request = $this->updateRoleWorkingPatternEmployeeRoleRequest($employerId, $employeeId, $id, $roleWorkingPatternId, $contractEmployeeRoleWorkingPatternRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateRoleWorkingPatternEmployeeRole' + * + * @param string $employerId The Id of the Employer for the Employee. (required) + * @param string $employeeId The Id of the Employee to which the Role belongs. (required) + * @param string $id The Id of the Role to which the Employee Role Working Pattern belongs. (required) + * @param string $roleWorkingPatternId The Id of the Employee Role Working Pattern you want to update. (required) + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleWorkingPatternRequest|null $contractEmployeeRoleWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoleWorkingPatternEmployeeRole'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateRoleWorkingPatternEmployeeRoleRequest( + $employerId, + $employeeId, + $id, + $roleWorkingPatternId, + $contractEmployeeRoleWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateRoleWorkingPatternEmployeeRole'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateRoleWorkingPatternEmployeeRole' + ); + } + + // verify the required parameter 'roleWorkingPatternId' is set + if ($roleWorkingPatternId === null || (is_array($roleWorkingPatternId) && count($roleWorkingPatternId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $roleWorkingPatternId when calling updateRoleWorkingPatternEmployeeRole' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/roles/{id}/workingPatterns/{roleWorkingPatternId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($roleWorkingPatternId !== null) { + $resourcePath = str_replace( + '{' . 'roleWorkingPatternId' . '}', + ObjectSerializer::toPathValue($roleWorkingPatternId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractEmployeeRoleWorkingPatternRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractEmployeeRoleWorkingPatternRequest)); + } else { + $httpBody = $contractEmployeeRoleWorkingPatternRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmployerApi.php b/src/Api/EmployerApi.php new file mode 100644 index 0000000..ebb3f8c --- /dev/null +++ b/src/Api/EmployerApi.php @@ -0,0 +1,8966 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'calendarEmployer' => [ + 'application/json', + ], + 'createEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'customPayslipEmployer' => [ + 'application/json', + ], + 'deleteEmployer' => [ + 'application/json', + ], + 'getAutomationSettingsEmployer' => [ + 'application/json', + ], + 'getEmployer' => [ + 'application/json', + ], + 'getEmployerOpeningBalancesEmployer' => [ + 'application/json', + ], + 'getEvcOptInHistoryEmployer' => [ + 'application/json', + ], + 'getGroupMembershipsEmployer' => [ + 'application/json', + ], + 'importCsvEmployer' => [ + 'multipart/form-data', + ], + 'indexEmployer' => [ + 'application/json', + ], + 'listUsersEmployer' => [ + 'application/json', + ], + 'removeUserEmployer' => [ + 'application/json', + ], + 'reviewYearEndEmployer' => [ + 'application/json', + ], + 'rtiRequiringAttentionEmployer' => [ + 'application/json', + ], + 'searchEmployeesEmployer' => [ + 'application/json', + ], + 'searchEmployer' => [ + 'application/json', + ], + 'setEvcOptInEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setGroupMembershipsEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setOwnerEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'suggestPayCodeEmployer' => [ + 'application/json', + ], + 'updateAutomationSettingsEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateCustomPayslipEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateEmployerOpeningBalancesEmployer' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateLogoEmployer' => [ + 'multipart/form-data', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation applyYearEndEmployer + * + * Make Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param array|null $requestBody You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyYearEndEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\YearEnd + */ + public function applyYearEndEmployer( + string $id, + ?array $requestBody = null, + string $contentType = self::contentTypes['applyYearEndEmployer'][0] + ): \SynergiTech\Staffology\Model\YearEnd + { + list($response) = $this->applyYearEndEmployerWithHttpInfo($id, $requestBody, $contentType); + return $response; + } + + /** + * Operation applyYearEndEmployerWithHttpInfo + * + * Make Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param array|null $requestBody You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyYearEndEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\YearEnd, HTTP status code, HTTP response headers (array of strings) + */ + public function applyYearEndEmployerWithHttpInfo( + string $id, + ?array $requestBody = null, + string $contentType = self::contentTypes['applyYearEndEmployer'][0] + ): array + { + $request = $this->applyYearEndEmployerRequest($id, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\YearEnd', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\YearEnd' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\YearEnd', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\YearEnd'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\YearEnd', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation applyYearEndEmployerAsync + * + * Make Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param array|null $requestBody You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyYearEndEmployerAsync( + string $id, + ?array $requestBody = null, + string $contentType = self::contentTypes['applyYearEndEmployer'][0] + ): PromiseInterface + { + return $this->applyYearEndEmployerAsyncWithHttpInfo($id, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation applyYearEndEmployerAsyncWithHttpInfo + * + * Make Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param array|null $requestBody You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function applyYearEndEmployerAsyncWithHttpInfo( + $id, + $requestBody = null, + string $contentType = self::contentTypes['applyYearEndEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\YearEnd'; + $request = $this->applyYearEndEmployerRequest($id, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'applyYearEndEmployer' + * + * @param string $id The Id of the Employer (required) + * @param array|null $requestBody You can suppress the emailing of P60s and/or CIS Statements by supplying a value of true for dontEmailP60s and/or dontEmailCisStatements (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['applyYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function applyYearEndEmployerRequest( + $id, + $requestBody = null, + string $contentType = self::contentTypes['applyYearEndEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling applyYearEndEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/YearEnd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation calendarEmployer + * + * Get Employer Calendar + * + * @param string $id The Id of the Employer. (required) + * @param \DateTime|null $from from (optional) + * @param \DateTime|null $to to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calendarEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CalendarEntry[] + */ + public function calendarEmployer( + string $id, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['calendarEmployer'][0] + ): array + { + list($response) = $this->calendarEmployerWithHttpInfo($id, $from, $to, $contentType); + return $response; + } + + /** + * Operation calendarEmployerWithHttpInfo + * + * Get Employer Calendar + * + * @param string $id The Id of the Employer. (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calendarEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CalendarEntry[], HTTP status code, HTTP response headers (array of strings) + */ + public function calendarEmployerWithHttpInfo( + string $id, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['calendarEmployer'][0] + ): array + { + $request = $this->calendarEmployerRequest($id, $from, $to, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CalendarEntry[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CalendarEntry[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CalendarEntry[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CalendarEntry[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CalendarEntry[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation calendarEmployerAsync + * + * Get Employer Calendar + * + * @param string $id The Id of the Employer. (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calendarEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calendarEmployerAsync( + string $id, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['calendarEmployer'][0] + ): PromiseInterface + { + return $this->calendarEmployerAsyncWithHttpInfo($id, $from, $to, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation calendarEmployerAsyncWithHttpInfo + * + * Get Employer Calendar + * + * @param string $id The Id of the Employer. (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calendarEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calendarEmployerAsyncWithHttpInfo( + $id, + $from = null, + $to = null, + string $contentType = self::contentTypes['calendarEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CalendarEntry[]'; + $request = $this->calendarEmployerRequest($id, $from, $to, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'calendarEmployer' + * + * @param string $id The Id of the Employer. (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calendarEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function calendarEmployerRequest( + $id, + $from = null, + $to = null, + string $contentType = self::contentTypes['calendarEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling calendarEmployer' + ); + } + + + + + $resourcePath = '/employers/{id}/calendar'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from, + 'from', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to, + 'to', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createEmployer + * + * Create an Employer + * + * @param \SynergiTech\Staffology\Model\Employer|null $employer employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Employer + */ + public function createEmployer( + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['createEmployer'][0] + ): \SynergiTech\Staffology\Model\Employer + { + list($response) = $this->createEmployerWithHttpInfo($employer, $contentType); + return $response; + } + + /** + * Operation createEmployerWithHttpInfo + * + * Create an Employer + * + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Employer, HTTP status code, HTTP response headers (array of strings) + */ + public function createEmployerWithHttpInfo( + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['createEmployer'][0] + ): array + { + $request = $this->createEmployerRequest($employer, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Employer', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Employer' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Employer', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Employer'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Employer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEmployerAsync + * + * Create an Employer + * + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployerAsync( + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['createEmployer'][0] + ): PromiseInterface + { + return $this->createEmployerAsyncWithHttpInfo($employer, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEmployerAsyncWithHttpInfo + * + * Create an Employer + * + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployerAsyncWithHttpInfo( + $employer = null, + string $contentType = self::contentTypes['createEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Employer'; + $request = $this->createEmployerRequest($employer, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEmployer' + * + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createEmployerRequest( + $employer = null, + string $contentType = self::contentTypes['createEmployer'][0] + ): Request + { + + + + $resourcePath = '/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employer)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employer)); + } else { + $httpBody = $employer; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation customPayslipEmployer + * + * Get Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['customPayslipEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayslipCustomisation + */ + public function customPayslipEmployer( + string $id, + string $contentType = self::contentTypes['customPayslipEmployer'][0] + ): \SynergiTech\Staffology\Model\PayslipCustomisation + { + list($response) = $this->customPayslipEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation customPayslipEmployerWithHttpInfo + * + * Get Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['customPayslipEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayslipCustomisation, HTTP status code, HTTP response headers (array of strings) + */ + public function customPayslipEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['customPayslipEmployer'][0] + ): array + { + $request = $this->customPayslipEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayslipCustomisation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayslipCustomisation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayslipCustomisation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayslipCustomisation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayslipCustomisation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation customPayslipEmployerAsync + * + * Get Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['customPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function customPayslipEmployerAsync( + string $id, + string $contentType = self::contentTypes['customPayslipEmployer'][0] + ): PromiseInterface + { + return $this->customPayslipEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation customPayslipEmployerAsyncWithHttpInfo + * + * Get Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['customPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function customPayslipEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['customPayslipEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayslipCustomisation'; + $request = $this->customPayslipEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'customPayslipEmployer' + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['customPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function customPayslipEmployerRequest( + $id, + string $contentType = self::contentTypes['customPayslipEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling customPayslipEmployer' + ); + } + + + $resourcePath = '/employers/{id}/custompayslip'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEmployer + * + * Delete an Employer + * + * @param string $id The Id of the Employer you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteEmployer( + string $id, + string $contentType = self::contentTypes['deleteEmployer'][0] + ): void + { + $this->deleteEmployerWithHttpInfo($id, $contentType); + } + + /** + * Operation deleteEmployerWithHttpInfo + * + * Delete an Employer + * + * @param string $id The Id of the Employer you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['deleteEmployer'][0] + ): array + { + $request = $this->deleteEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteEmployerAsync + * + * Delete an Employer + * + * @param string $id The Id of the Employer you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployerAsync( + string $id, + string $contentType = self::contentTypes['deleteEmployer'][0] + ): PromiseInterface + { + return $this->deleteEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEmployerAsyncWithHttpInfo + * + * Delete an Employer + * + * @param string $id The Id of the Employer you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['deleteEmployer'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEmployer' + * + * @param string $id The Id of the Employer you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteEmployerRequest( + $id, + string $contentType = self::contentTypes['deleteEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteEmployer' + ); + } + + + $resourcePath = '/employers/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAutomationSettingsEmployer + * + * Get Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AutomationSettings + */ + public function getAutomationSettingsEmployer( + string $id, + string $contentType = self::contentTypes['getAutomationSettingsEmployer'][0] + ): \SynergiTech\Staffology\Model\AutomationSettings + { + list($response) = $this->getAutomationSettingsEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getAutomationSettingsEmployerWithHttpInfo + * + * Get Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AutomationSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getAutomationSettingsEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getAutomationSettingsEmployer'][0] + ): array + { + $request = $this->getAutomationSettingsEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AutomationSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AutomationSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AutomationSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AutomationSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AutomationSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAutomationSettingsEmployerAsync + * + * Get Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAutomationSettingsEmployerAsync( + string $id, + string $contentType = self::contentTypes['getAutomationSettingsEmployer'][0] + ): PromiseInterface + { + return $this->getAutomationSettingsEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAutomationSettingsEmployerAsyncWithHttpInfo + * + * Get Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAutomationSettingsEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getAutomationSettingsEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AutomationSettings'; + $request = $this->getAutomationSettingsEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAutomationSettingsEmployer' + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAutomationSettingsEmployerRequest( + $id, + string $contentType = self::contentTypes['getAutomationSettingsEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAutomationSettingsEmployer' + ); + } + + + $resourcePath = '/employers/{id}/automation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployer + * + * Get an Employer + * + * @param string $id The Id of the Employer you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Employer + */ + public function getEmployer( + string $id, + string $contentType = self::contentTypes['getEmployer'][0] + ): \SynergiTech\Staffology\Model\Employer + { + list($response) = $this->getEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getEmployerWithHttpInfo + * + * Get an Employer + * + * @param string $id The Id of the Employer you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Employer, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getEmployer'][0] + ): array + { + $request = $this->getEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Employer', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Employer' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Employer', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Employer'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Employer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployerAsync + * + * Get an Employer + * + * @param string $id The Id of the Employer you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerAsync( + string $id, + string $contentType = self::contentTypes['getEmployer'][0] + ): PromiseInterface + { + return $this->getEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployerAsyncWithHttpInfo + * + * Get an Employer + * + * @param string $id The Id of the Employer you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Employer'; + $request = $this->getEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployer' + * + * @param string $id The Id of the Employer you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployerRequest( + $id, + string $contentType = self::contentTypes['getEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployer' + ); + } + + + $resourcePath = '/employers/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployerOpeningBalancesEmployer + * + * Get EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerOpeningBalances + */ + public function getEmployerOpeningBalancesEmployer( + string $id, + string $contentType = self::contentTypes['getEmployerOpeningBalancesEmployer'][0] + ): \SynergiTech\Staffology\Model\EmployerOpeningBalances + { + list($response) = $this->getEmployerOpeningBalancesEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getEmployerOpeningBalancesEmployerWithHttpInfo + * + * Get EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerOpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployerOpeningBalancesEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getEmployerOpeningBalancesEmployer'][0] + ): array + { + $request = $this->getEmployerOpeningBalancesEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerOpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerOpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerOpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerOpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerOpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployerOpeningBalancesEmployerAsync + * + * Get EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerOpeningBalancesEmployerAsync( + string $id, + string $contentType = self::contentTypes['getEmployerOpeningBalancesEmployer'][0] + ): PromiseInterface + { + return $this->getEmployerOpeningBalancesEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployerOpeningBalancesEmployerAsyncWithHttpInfo + * + * Get EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerOpeningBalancesEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getEmployerOpeningBalancesEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerOpeningBalances'; + $request = $this->getEmployerOpeningBalancesEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployerOpeningBalancesEmployer' + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployerOpeningBalancesEmployerRequest( + $id, + string $contentType = self::contentTypes['getEmployerOpeningBalancesEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployerOpeningBalancesEmployer' + ); + } + + + $resourcePath = '/employers/{id}/openingbalances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEvcOptInHistoryEmployer + * + * Get EVC OptIn History + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcOptInHistoryEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEvcOptInHistory[] + */ + public function getEvcOptInHistoryEmployer( + string $id, + string $contentType = self::contentTypes['getEvcOptInHistoryEmployer'][0] + ): array + { + list($response) = $this->getEvcOptInHistoryEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getEvcOptInHistoryEmployerWithHttpInfo + * + * Get EVC OptIn History + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcOptInHistoryEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEvcOptInHistory[], HTTP status code, HTTP response headers (array of strings) + */ + public function getEvcOptInHistoryEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getEvcOptInHistoryEmployer'][0] + ): array + { + $request = $this->getEvcOptInHistoryEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEvcOptInHistoryEmployerAsync + * + * Get EVC OptIn History + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcOptInHistoryEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEvcOptInHistoryEmployerAsync( + string $id, + string $contentType = self::contentTypes['getEvcOptInHistoryEmployer'][0] + ): PromiseInterface + { + return $this->getEvcOptInHistoryEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEvcOptInHistoryEmployerAsyncWithHttpInfo + * + * Get EVC OptIn History + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcOptInHistoryEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEvcOptInHistoryEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getEvcOptInHistoryEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEvcOptInHistory[]'; + $request = $this->getEvcOptInHistoryEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEvcOptInHistoryEmployer' + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEvcOptInHistoryEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEvcOptInHistoryEmployerRequest( + $id, + string $contentType = self::contentTypes['getEvcOptInHistoryEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEvcOptInHistoryEmployer' + ); + } + + + $resourcePath = '/employers/{id}/evc'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGroupMembershipsEmployer + * + * Get Employer Groups + * + * @param string $id The Id of the Employer you want to retrieve Groups for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerGroupMembership[] + */ + public function getGroupMembershipsEmployer( + string $id, + string $contentType = self::contentTypes['getGroupMembershipsEmployer'][0] + ): array + { + list($response) = $this->getGroupMembershipsEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getGroupMembershipsEmployerWithHttpInfo + * + * Get Employer Groups + * + * @param string $id The Id of the Employer you want to retrieve Groups for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerGroupMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function getGroupMembershipsEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getGroupMembershipsEmployer'][0] + ): array + { + $request = $this->getGroupMembershipsEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerGroupMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerGroupMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerGroupMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerGroupMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerGroupMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGroupMembershipsEmployerAsync + * + * Get Employer Groups + * + * @param string $id The Id of the Employer you want to retrieve Groups for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getGroupMembershipsEmployerAsync( + string $id, + string $contentType = self::contentTypes['getGroupMembershipsEmployer'][0] + ): PromiseInterface + { + return $this->getGroupMembershipsEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGroupMembershipsEmployerAsyncWithHttpInfo + * + * Get Employer Groups + * + * @param string $id The Id of the Employer you want to retrieve Groups for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getGroupMembershipsEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getGroupMembershipsEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerGroupMembership[]'; + $request = $this->getGroupMembershipsEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGroupMembershipsEmployer' + * + * @param string $id The Id of the Employer you want to retrieve Groups for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGroupMembershipsEmployerRequest( + $id, + string $contentType = self::contentTypes['getGroupMembershipsEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getGroupMembershipsEmployer' + ); + } + + + $resourcePath = '/employers/{id}/groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCsvEmployer + * + * Import CSV + * + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importCsvEmployer( + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployer'][0] + ): array + { + list($response) = $this->importCsvEmployerWithHttpInfo($previewOnly, $file, $contentType); + return $response; + } + + /** + * Operation importCsvEmployerWithHttpInfo + * + * Import CSV + * + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importCsvEmployerWithHttpInfo( + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployer'][0] + ): array + { + $request = $this->importCsvEmployerRequest($previewOnly, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCsvEmployerAsync + * + * Import CSV + * + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvEmployerAsync( + ?bool $previewOnly = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvEmployer'][0] + ): PromiseInterface + { + return $this->importCsvEmployerAsyncWithHttpInfo($previewOnly, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCsvEmployerAsyncWithHttpInfo + * + * Import CSV + * + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvEmployerAsyncWithHttpInfo( + $previewOnly = false, + $file = null, + string $contentType = self::contentTypes['importCsvEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importCsvEmployerRequest($previewOnly, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCsvEmployer' + * + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importCsvEmployerRequest( + $previewOnly = false, + $file = null, + string $contentType = self::contentTypes['importCsvEmployer'][0] + ): Request + { + + + + + $resourcePath = '/employers/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $previewOnly, + 'previewOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmployer + * + * List Employers + * + * @param string|null $employerGroupCode Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmployer( + ?string $employerGroupCode = null, + string $contentType = self::contentTypes['indexEmployer'][0] + ): array + { + list($response) = $this->indexEmployerWithHttpInfo($employerGroupCode, $contentType); + return $response; + } + + /** + * Operation indexEmployerWithHttpInfo + * + * List Employers + * + * @param string|null $employerGroupCode Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmployerWithHttpInfo( + ?string $employerGroupCode = null, + string $contentType = self::contentTypes['indexEmployer'][0] + ): array + { + $request = $this->indexEmployerRequest($employerGroupCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmployerAsync + * + * List Employers + * + * @param string|null $employerGroupCode Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerAsync( + ?string $employerGroupCode = null, + string $contentType = self::contentTypes['indexEmployer'][0] + ): PromiseInterface + { + return $this->indexEmployerAsyncWithHttpInfo($employerGroupCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmployerAsyncWithHttpInfo + * + * List Employers + * + * @param string|null $employerGroupCode Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerAsyncWithHttpInfo( + $employerGroupCode = null, + string $contentType = self::contentTypes['indexEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmployerRequest($employerGroupCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmployer' + * + * @param string|null $employerGroupCode Optionally specify the code of an EmployerGroup to only see employers that are a member of that group. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmployerRequest( + $employerGroupCode = null, + string $contentType = self::contentTypes['indexEmployer'][0] + ): Request + { + + + + $resourcePath = '/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerGroupCode, + 'employerGroupCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listUsersEmployer + * + * List Users + * + * @param string $id The Id of the Employer you want a list of Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUsersEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listUsersEmployer( + string $id, + string $contentType = self::contentTypes['listUsersEmployer'][0] + ): array + { + list($response) = $this->listUsersEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation listUsersEmployerWithHttpInfo + * + * List Users + * + * @param string $id The Id of the Employer you want a list of Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUsersEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listUsersEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['listUsersEmployer'][0] + ): array + { + $request = $this->listUsersEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listUsersEmployerAsync + * + * List Users + * + * @param string $id The Id of the Employer you want a list of Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUsersEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listUsersEmployerAsync( + string $id, + string $contentType = self::contentTypes['listUsersEmployer'][0] + ): PromiseInterface + { + return $this->listUsersEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listUsersEmployerAsyncWithHttpInfo + * + * List Users + * + * @param string $id The Id of the Employer you want a list of Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUsersEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listUsersEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['listUsersEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listUsersEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listUsersEmployer' + * + * @param string $id The Id of the Employer you want a list of Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUsersEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listUsersEmployerRequest( + $id, + string $contentType = self::contentTypes['listUsersEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling listUsersEmployer' + ); + } + + + $resourcePath = '/employers/{id}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeUserEmployer + * + * Remove User + * + * @param string $id The Id of the Employer you want to remove the User from. (required) + * @param string $userId The Id of the User you want to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeUserEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function removeUserEmployer( + string $id, + string $userId, + string $contentType = self::contentTypes['removeUserEmployer'][0] + ): void + { + $this->removeUserEmployerWithHttpInfo($id, $userId, $contentType); + } + + /** + * Operation removeUserEmployerWithHttpInfo + * + * Remove User + * + * @param string $id The Id of the Employer you want to remove the User from. (required) + * @param string $userId The Id of the User you want to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeUserEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeUserEmployerWithHttpInfo( + string $id, + string $userId, + string $contentType = self::contentTypes['removeUserEmployer'][0] + ): array + { + $request = $this->removeUserEmployerRequest($id, $userId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation removeUserEmployerAsync + * + * Remove User + * + * @param string $id The Id of the Employer you want to remove the User from. (required) + * @param string $userId The Id of the User you want to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeUserEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeUserEmployerAsync( + string $id, + string $userId, + string $contentType = self::contentTypes['removeUserEmployer'][0] + ): PromiseInterface + { + return $this->removeUserEmployerAsyncWithHttpInfo($id, $userId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeUserEmployerAsyncWithHttpInfo + * + * Remove User + * + * @param string $id The Id of the Employer you want to remove the User from. (required) + * @param string $userId The Id of the User you want to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeUserEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeUserEmployerAsyncWithHttpInfo( + $id, + $userId, + string $contentType = self::contentTypes['removeUserEmployer'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->removeUserEmployerRequest($id, $userId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeUserEmployer' + * + * @param string $id The Id of the Employer you want to remove the User from. (required) + * @param string $userId The Id of the User you want to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeUserEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeUserEmployerRequest( + $id, + $userId, + string $contentType = self::contentTypes['removeUserEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling removeUserEmployer' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling removeUserEmployer' + ); + } + + + $resourcePath = '/employers/{id}/users/{userId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation reviewYearEndEmployer + * + * Review Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reviewYearEndEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\YearEnd + */ + public function reviewYearEndEmployer( + string $id, + string $contentType = self::contentTypes['reviewYearEndEmployer'][0] + ): \SynergiTech\Staffology\Model\YearEnd + { + list($response) = $this->reviewYearEndEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation reviewYearEndEmployerWithHttpInfo + * + * Review Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reviewYearEndEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\YearEnd, HTTP status code, HTTP response headers (array of strings) + */ + public function reviewYearEndEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['reviewYearEndEmployer'][0] + ): array + { + $request = $this->reviewYearEndEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\YearEnd', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\YearEnd' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\YearEnd', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\YearEnd'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\YearEnd', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation reviewYearEndEmployerAsync + * + * Review Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reviewYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reviewYearEndEmployerAsync( + string $id, + string $contentType = self::contentTypes['reviewYearEndEmployer'][0] + ): PromiseInterface + { + return $this->reviewYearEndEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation reviewYearEndEmployerAsyncWithHttpInfo + * + * Review Year End Changes + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reviewYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reviewYearEndEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['reviewYearEndEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\YearEnd'; + $request = $this->reviewYearEndEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'reviewYearEndEmployer' + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reviewYearEndEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function reviewYearEndEmployerRequest( + $id, + string $contentType = self::contentTypes['reviewYearEndEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling reviewYearEndEmployer' + ); + } + + + $resourcePath = '/employers/{id}/YearEnd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation rtiRequiringAttentionEmployer + * + * RTI Documents Requiring Attention + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rtiRequiringAttentionEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function rtiRequiringAttentionEmployer( + string $id, + string $contentType = self::contentTypes['rtiRequiringAttentionEmployer'][0] + ): array + { + list($response) = $this->rtiRequiringAttentionEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation rtiRequiringAttentionEmployerWithHttpInfo + * + * RTI Documents Requiring Attention + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rtiRequiringAttentionEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function rtiRequiringAttentionEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['rtiRequiringAttentionEmployer'][0] + ): array + { + $request = $this->rtiRequiringAttentionEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation rtiRequiringAttentionEmployerAsync + * + * RTI Documents Requiring Attention + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rtiRequiringAttentionEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function rtiRequiringAttentionEmployerAsync( + string $id, + string $contentType = self::contentTypes['rtiRequiringAttentionEmployer'][0] + ): PromiseInterface + { + return $this->rtiRequiringAttentionEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation rtiRequiringAttentionEmployerAsyncWithHttpInfo + * + * RTI Documents Requiring Attention + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rtiRequiringAttentionEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function rtiRequiringAttentionEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['rtiRequiringAttentionEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->rtiRequiringAttentionEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'rtiRequiringAttentionEmployer' + * + * @param string $id The Id of the Employer (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rtiRequiringAttentionEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function rtiRequiringAttentionEmployerRequest( + $id, + string $contentType = self::contentTypes['rtiRequiringAttentionEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling rtiRequiringAttentionEmployer' + ); + } + + + $resourcePath = '/employers/{id}/rti/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchEmployeesEmployer + * + * Search Employees + * + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployeesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function searchEmployeesEmployer( + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployeesEmployer'][0] + ): array + { + list($response) = $this->searchEmployeesEmployerWithHttpInfo($query, $exludeCisSubContactors, $contentType); + return $response; + } + + /** + * Operation searchEmployeesEmployerWithHttpInfo + * + * Search Employees + * + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployeesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function searchEmployeesEmployerWithHttpInfo( + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployeesEmployer'][0] + ): array + { + $request = $this->searchEmployeesEmployerRequest($query, $exludeCisSubContactors, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchEmployeesEmployerAsync + * + * Search Employees + * + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployeesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployeesEmployerAsync( + ?string $query = null, + ?bool $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployeesEmployer'][0] + ): PromiseInterface + { + return $this->searchEmployeesEmployerAsyncWithHttpInfo($query, $exludeCisSubContactors, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchEmployeesEmployerAsyncWithHttpInfo + * + * Search Employees + * + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployeesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployeesEmployerAsyncWithHttpInfo( + $query = null, + $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployeesEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->searchEmployeesEmployerRequest($query, $exludeCisSubContactors, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchEmployeesEmployer' + * + * @param string|null $query The search string (at least 3 characters). (optional) + * @param bool|null $exludeCisSubContactors If set to true, then we'll only search employees that aren't labeled as CIS Subcontractors (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployeesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchEmployeesEmployerRequest( + $query = null, + $exludeCisSubContactors = false, + string $contentType = self::contentTypes['searchEmployeesEmployer'][0] + ): Request + { + + + + + $resourcePath = '/employers/employees/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $exludeCisSubContactors, + 'exludeCisSubContactors', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchEmployer + * + * Search Employers + * + * @param string|null $query query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function searchEmployer( + ?string $query = null, + string $contentType = self::contentTypes['searchEmployer'][0] + ): array + { + list($response) = $this->searchEmployerWithHttpInfo($query, $contentType); + return $response; + } + + /** + * Operation searchEmployerWithHttpInfo + * + * Search Employers + * + * @param string|null $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function searchEmployerWithHttpInfo( + ?string $query = null, + string $contentType = self::contentTypes['searchEmployer'][0] + ): array + { + $request = $this->searchEmployerRequest($query, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchEmployerAsync + * + * Search Employers + * + * @param string|null $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployerAsync( + ?string $query = null, + string $contentType = self::contentTypes['searchEmployer'][0] + ): PromiseInterface + { + return $this->searchEmployerAsyncWithHttpInfo($query, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchEmployerAsyncWithHttpInfo + * + * Search Employers + * + * @param string|null $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function searchEmployerAsyncWithHttpInfo( + $query = null, + string $contentType = self::contentTypes['searchEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->searchEmployerRequest($query, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchEmployer' + * + * @param string|null $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchEmployerRequest( + $query = null, + string $contentType = self::contentTypes['searchEmployer'][0] + ): Request + { + + + + $resourcePath = '/employers/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEvcOptInEmployer + * + * Update EVC OptIn + * + * @param string $id The Id of the Employer (required) + * @param bool|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcOptInEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setEvcOptInEmployer( + string $id, + ?bool $body = null, + string $contentType = self::contentTypes['setEvcOptInEmployer'][0] + ): void + { + $this->setEvcOptInEmployerWithHttpInfo($id, $body, $contentType); + } + + /** + * Operation setEvcOptInEmployerWithHttpInfo + * + * Update EVC OptIn + * + * @param string $id The Id of the Employer (required) + * @param bool|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcOptInEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setEvcOptInEmployerWithHttpInfo( + string $id, + ?bool $body = null, + string $contentType = self::contentTypes['setEvcOptInEmployer'][0] + ): array + { + $request = $this->setEvcOptInEmployerRequest($id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setEvcOptInEmployerAsync + * + * Update EVC OptIn + * + * @param string $id The Id of the Employer (required) + * @param bool|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcOptInEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEvcOptInEmployerAsync( + string $id, + ?bool $body = null, + string $contentType = self::contentTypes['setEvcOptInEmployer'][0] + ): PromiseInterface + { + return $this->setEvcOptInEmployerAsyncWithHttpInfo($id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEvcOptInEmployerAsyncWithHttpInfo + * + * Update EVC OptIn + * + * @param string $id The Id of the Employer (required) + * @param bool|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcOptInEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEvcOptInEmployerAsyncWithHttpInfo( + $id, + $body = null, + string $contentType = self::contentTypes['setEvcOptInEmployer'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setEvcOptInEmployerRequest($id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEvcOptInEmployer' + * + * @param string $id The Id of the Employer (required) + * @param bool|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcOptInEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEvcOptInEmployerRequest( + $id, + $body = null, + string $contentType = self::contentTypes['setEvcOptInEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setEvcOptInEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/evc'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setGroupMembershipsEmployer + * + * Set Employer Groups + * + * @param string $id The Id of the Employer you want to set Groups for. (required) + * @param \SynergiTech\Staffology\Model\EmployerGroupMembership[]|null $employerGroupMembership employerGroupMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerGroupMembership[] + */ + public function setGroupMembershipsEmployer( + string $id, + ?array $employerGroupMembership = null, + string $contentType = self::contentTypes['setGroupMembershipsEmployer'][0] + ): array + { + list($response) = $this->setGroupMembershipsEmployerWithHttpInfo($id, $employerGroupMembership, $contentType); + return $response; + } + + /** + * Operation setGroupMembershipsEmployerWithHttpInfo + * + * Set Employer Groups + * + * @param string $id The Id of the Employer you want to set Groups for. (required) + * @param \SynergiTech\Staffology\Model\EmployerGroupMembership[]|null $employerGroupMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerGroupMembership[], HTTP status code, HTTP response headers (array of strings) + */ + public function setGroupMembershipsEmployerWithHttpInfo( + string $id, + ?array $employerGroupMembership = null, + string $contentType = self::contentTypes['setGroupMembershipsEmployer'][0] + ): array + { + $request = $this->setGroupMembershipsEmployerRequest($id, $employerGroupMembership, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerGroupMembership[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerGroupMembership[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerGroupMembership[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerGroupMembership[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerGroupMembership[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setGroupMembershipsEmployerAsync + * + * Set Employer Groups + * + * @param string $id The Id of the Employer you want to set Groups for. (required) + * @param \SynergiTech\Staffology\Model\EmployerGroupMembership[]|null $employerGroupMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setGroupMembershipsEmployerAsync( + string $id, + ?array $employerGroupMembership = null, + string $contentType = self::contentTypes['setGroupMembershipsEmployer'][0] + ): PromiseInterface + { + return $this->setGroupMembershipsEmployerAsyncWithHttpInfo($id, $employerGroupMembership, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setGroupMembershipsEmployerAsyncWithHttpInfo + * + * Set Employer Groups + * + * @param string $id The Id of the Employer you want to set Groups for. (required) + * @param \SynergiTech\Staffology\Model\EmployerGroupMembership[]|null $employerGroupMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setGroupMembershipsEmployerAsyncWithHttpInfo( + $id, + $employerGroupMembership = null, + string $contentType = self::contentTypes['setGroupMembershipsEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerGroupMembership[]'; + $request = $this->setGroupMembershipsEmployerRequest($id, $employerGroupMembership, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setGroupMembershipsEmployer' + * + * @param string $id The Id of the Employer you want to set Groups for. (required) + * @param \SynergiTech\Staffology\Model\EmployerGroupMembership[]|null $employerGroupMembership (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setGroupMembershipsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setGroupMembershipsEmployerRequest( + $id, + $employerGroupMembership = null, + string $contentType = self::contentTypes['setGroupMembershipsEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setGroupMembershipsEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerGroupMembership)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerGroupMembership)); + } else { + $httpBody = $employerGroupMembership; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setOwnerEmployer + * + * Set Owner + * + * @param string $id The Id of the Employer you want to change the ownership of. (required) + * @param string|null $body The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOwnerEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setOwnerEmployer( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['setOwnerEmployer'][0] + ): void + { + $this->setOwnerEmployerWithHttpInfo($id, $body, $contentType); + } + + /** + * Operation setOwnerEmployerWithHttpInfo + * + * Set Owner + * + * @param string $id The Id of the Employer you want to change the ownership of. (required) + * @param string|null $body The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOwnerEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setOwnerEmployerWithHttpInfo( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['setOwnerEmployer'][0] + ): array + { + $request = $this->setOwnerEmployerRequest($id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setOwnerEmployerAsync + * + * Set Owner + * + * @param string $id The Id of the Employer you want to change the ownership of. (required) + * @param string|null $body The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOwnerEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setOwnerEmployerAsync( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['setOwnerEmployer'][0] + ): PromiseInterface + { + return $this->setOwnerEmployerAsyncWithHttpInfo($id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setOwnerEmployerAsyncWithHttpInfo + * + * Set Owner + * + * @param string $id The Id of the Employer you want to change the ownership of. (required) + * @param string|null $body The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOwnerEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setOwnerEmployerAsyncWithHttpInfo( + $id, + $body = null, + string $contentType = self::contentTypes['setOwnerEmployer'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setOwnerEmployerRequest($id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setOwnerEmployer' + * + * @param string $id The Id of the Employer you want to change the ownership of. (required) + * @param string|null $body The Id of the User you want a change ownership to. They must already be a user for this employer and have the admin role assigned to them. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOwnerEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setOwnerEmployerRequest( + $id, + $body = null, + string $contentType = self::contentTypes['setOwnerEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setOwnerEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/users/owner'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation suggestPayCodeEmployer + * + * Suggest Payroll Code + * + * @param string $id The Id of the Employer you want a suggestion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['suggestPayCodeEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function suggestPayCodeEmployer( + string $id, + string $contentType = self::contentTypes['suggestPayCodeEmployer'][0] + ): string + { + list($response) = $this->suggestPayCodeEmployerWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation suggestPayCodeEmployerWithHttpInfo + * + * Suggest Payroll Code + * + * @param string $id The Id of the Employer you want a suggestion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['suggestPayCodeEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function suggestPayCodeEmployerWithHttpInfo( + string $id, + string $contentType = self::contentTypes['suggestPayCodeEmployer'][0] + ): array + { + $request = $this->suggestPayCodeEmployerRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation suggestPayCodeEmployerAsync + * + * Suggest Payroll Code + * + * @param string $id The Id of the Employer you want a suggestion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['suggestPayCodeEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function suggestPayCodeEmployerAsync( + string $id, + string $contentType = self::contentTypes['suggestPayCodeEmployer'][0] + ): PromiseInterface + { + return $this->suggestPayCodeEmployerAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation suggestPayCodeEmployerAsyncWithHttpInfo + * + * Suggest Payroll Code + * + * @param string $id The Id of the Employer you want a suggestion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['suggestPayCodeEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function suggestPayCodeEmployerAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['suggestPayCodeEmployer'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->suggestPayCodeEmployerRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'suggestPayCodeEmployer' + * + * @param string $id The Id of the Employer you want a suggestion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['suggestPayCodeEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function suggestPayCodeEmployerRequest( + $id, + string $contentType = self::contentTypes['suggestPayCodeEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling suggestPayCodeEmployer' + ); + } + + + $resourcePath = '/employers/{id}/suggestPayrollCode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAutomationSettingsEmployer + * + * Update Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\AutomationSettings|null $automationSettings automationSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AutomationSettings + */ + public function updateAutomationSettingsEmployer( + string $id, + ?\SynergiTech\Staffology\Model\AutomationSettings $automationSettings = null, + string $contentType = self::contentTypes['updateAutomationSettingsEmployer'][0] + ): \SynergiTech\Staffology\Model\AutomationSettings + { + list($response) = $this->updateAutomationSettingsEmployerWithHttpInfo($id, $automationSettings, $contentType); + return $response; + } + + /** + * Operation updateAutomationSettingsEmployerWithHttpInfo + * + * Update Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\AutomationSettings|null $automationSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AutomationSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAutomationSettingsEmployerWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\AutomationSettings $automationSettings = null, + string $contentType = self::contentTypes['updateAutomationSettingsEmployer'][0] + ): array + { + $request = $this->updateAutomationSettingsEmployerRequest($id, $automationSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AutomationSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AutomationSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AutomationSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AutomationSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AutomationSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAutomationSettingsEmployerAsync + * + * Update Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\AutomationSettings|null $automationSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAutomationSettingsEmployerAsync( + string $id, + ?\SynergiTech\Staffology\Model\AutomationSettings $automationSettings = null, + string $contentType = self::contentTypes['updateAutomationSettingsEmployer'][0] + ): PromiseInterface + { + return $this->updateAutomationSettingsEmployerAsyncWithHttpInfo($id, $automationSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAutomationSettingsEmployerAsyncWithHttpInfo + * + * Update Automation Settings + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\AutomationSettings|null $automationSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAutomationSettingsEmployerAsyncWithHttpInfo( + $id, + $automationSettings = null, + string $contentType = self::contentTypes['updateAutomationSettingsEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AutomationSettings'; + $request = $this->updateAutomationSettingsEmployerRequest($id, $automationSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAutomationSettingsEmployer' + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\AutomationSettings|null $automationSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAutomationSettingsEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAutomationSettingsEmployerRequest( + $id, + $automationSettings = null, + string $contentType = self::contentTypes['updateAutomationSettingsEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateAutomationSettingsEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/automation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($automationSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($automationSettings)); + } else { + $httpBody = $automationSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCustomPayslipEmployer + * + * Update Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation payslipCustomisation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCustomPayslipEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayslipCustomisation + */ + public function updateCustomPayslipEmployer( + string $id, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['updateCustomPayslipEmployer'][0] + ): \SynergiTech\Staffology\Model\PayslipCustomisation + { + list($response) = $this->updateCustomPayslipEmployerWithHttpInfo($id, $payslipCustomisation, $contentType); + return $response; + } + + /** + * Operation updateCustomPayslipEmployerWithHttpInfo + * + * Update Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCustomPayslipEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayslipCustomisation, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCustomPayslipEmployerWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['updateCustomPayslipEmployer'][0] + ): array + { + $request = $this->updateCustomPayslipEmployerRequest($id, $payslipCustomisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayslipCustomisation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayslipCustomisation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayslipCustomisation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayslipCustomisation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayslipCustomisation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCustomPayslipEmployerAsync + * + * Update Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCustomPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCustomPayslipEmployerAsync( + string $id, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['updateCustomPayslipEmployer'][0] + ): PromiseInterface + { + return $this->updateCustomPayslipEmployerAsyncWithHttpInfo($id, $payslipCustomisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCustomPayslipEmployerAsyncWithHttpInfo + * + * Update Payslip Customisations + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCustomPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCustomPayslipEmployerAsyncWithHttpInfo( + $id, + $payslipCustomisation = null, + string $contentType = self::contentTypes['updateCustomPayslipEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayslipCustomisation'; + $request = $this->updateCustomPayslipEmployerRequest($id, $payslipCustomisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCustomPayslipEmployer' + * + * @param string $id The Id of the Employer you want customisations for. (required) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCustomPayslipEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCustomPayslipEmployerRequest( + $id, + $payslipCustomisation = null, + string $contentType = self::contentTypes['updateCustomPayslipEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateCustomPayslipEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/custompayslip'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payslipCustomisation)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payslipCustomisation)); + } else { + $httpBody = $payslipCustomisation; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployer + * + * Update an Employer + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SynergiTech\Staffology\Model\Employer|null $employer employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Employer + */ + public function updateEmployer( + string $id, + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['updateEmployer'][0] + ): \SynergiTech\Staffology\Model\Employer + { + list($response) = $this->updateEmployerWithHttpInfo($id, $employer, $contentType); + return $response; + } + + /** + * Operation updateEmployerWithHttpInfo + * + * Update an Employer + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Employer, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployerWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['updateEmployer'][0] + ): array + { + $request = $this->updateEmployerRequest($id, $employer, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Employer', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Employer' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Employer', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Employer'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Employer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployerAsync + * + * Update an Employer + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerAsync( + string $id, + ?\SynergiTech\Staffology\Model\Employer $employer = null, + string $contentType = self::contentTypes['updateEmployer'][0] + ): PromiseInterface + { + return $this->updateEmployerAsyncWithHttpInfo($id, $employer, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployerAsyncWithHttpInfo + * + * Update an Employer + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerAsyncWithHttpInfo( + $id, + $employer = null, + string $contentType = self::contentTypes['updateEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Employer'; + $request = $this->updateEmployerRequest($id, $employer, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployer' + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SynergiTech\Staffology\Model\Employer|null $employer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployerRequest( + $id, + $employer = null, + string $contentType = self::contentTypes['updateEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEmployer' + ); + } + + + + $resourcePath = '/employers/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employer)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employer)); + } else { + $httpBody = $employer; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployerOpeningBalancesEmployer + * + * Update EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances employerOpeningBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerOpeningBalances + */ + public function updateEmployerOpeningBalancesEmployer( + string $id, + ?\SynergiTech\Staffology\Model\EmployerOpeningBalances $employerOpeningBalances = null, + string $contentType = self::contentTypes['updateEmployerOpeningBalancesEmployer'][0] + ): \SynergiTech\Staffology\Model\EmployerOpeningBalances + { + list($response) = $this->updateEmployerOpeningBalancesEmployerWithHttpInfo($id, $employerOpeningBalances, $contentType); + return $response; + } + + /** + * Operation updateEmployerOpeningBalancesEmployerWithHttpInfo + * + * Update EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerOpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployerOpeningBalancesEmployerWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\EmployerOpeningBalances $employerOpeningBalances = null, + string $contentType = self::contentTypes['updateEmployerOpeningBalancesEmployer'][0] + ): array + { + $request = $this->updateEmployerOpeningBalancesEmployerRequest($id, $employerOpeningBalances, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerOpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerOpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerOpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerOpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerOpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployerOpeningBalancesEmployerAsync + * + * Update EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerOpeningBalancesEmployerAsync( + string $id, + ?\SynergiTech\Staffology\Model\EmployerOpeningBalances $employerOpeningBalances = null, + string $contentType = self::contentTypes['updateEmployerOpeningBalancesEmployer'][0] + ): PromiseInterface + { + return $this->updateEmployerOpeningBalancesEmployerAsyncWithHttpInfo($id, $employerOpeningBalances, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployerOpeningBalancesEmployerAsyncWithHttpInfo + * + * Update EmployerOpeningBalances + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerOpeningBalancesEmployerAsyncWithHttpInfo( + $id, + $employerOpeningBalances = null, + string $contentType = self::contentTypes['updateEmployerOpeningBalancesEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerOpeningBalances'; + $request = $this->updateEmployerOpeningBalancesEmployerRequest($id, $employerOpeningBalances, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployerOpeningBalancesEmployer' + * + * @param string $id The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerOpeningBalancesEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployerOpeningBalancesEmployerRequest( + $id, + $employerOpeningBalances = null, + string $contentType = self::contentTypes['updateEmployerOpeningBalancesEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEmployerOpeningBalancesEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/openingbalances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerOpeningBalances)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerOpeningBalances)); + } else { + $httpBody = $employerOpeningBalances; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLogoEmployer + * + * Update Employer Logo + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Employer + */ + public function updateLogoEmployer( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoEmployer'][0] + ): \SynergiTech\Staffology\Model\Employer + { + list($response) = $this->updateLogoEmployerWithHttpInfo($id, $file, $contentType); + return $response; + } + + /** + * Operation updateLogoEmployerWithHttpInfo + * + * Update Employer Logo + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoEmployer'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Employer, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLogoEmployerWithHttpInfo( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoEmployer'][0] + ): array + { + $request = $this->updateLogoEmployerRequest($id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Employer', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Employer' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Employer', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Employer'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Employer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLogoEmployerAsync + * + * Update Employer Logo + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLogoEmployerAsync( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoEmployer'][0] + ): PromiseInterface + { + return $this->updateLogoEmployerAsyncWithHttpInfo($id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLogoEmployerAsyncWithHttpInfo + * + * Update Employer Logo + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLogoEmployerAsyncWithHttpInfo( + $id, + $file = null, + string $contentType = self::contentTypes['updateLogoEmployer'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Employer'; + $request = $this->updateLogoEmployerRequest($id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLogoEmployer' + * + * @param string $id The Id of the Employer you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoEmployer'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLogoEmployerRequest( + $id, + $file = null, + string $contentType = self::contentTypes['updateLogoEmployer'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateLogoEmployer' + ); + } + + + + $resourcePath = '/employers/{id}/logo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmployerGroupApi.php b/src/Api/EmployerGroupApi.php new file mode 100644 index 0000000..ed95649 --- /dev/null +++ b/src/Api/EmployerGroupApi.php @@ -0,0 +1,1692 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteEmployerGroup' => [ + 'application/json', + ], + 'getEmployerGroup' => [ + 'application/json', + ], + 'indexEmployerGroup' => [ + 'application/json', + ], + 'updateEmployerGroup' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createEmployerGroup + * + * Create EmployerGroup + * + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\EmployerGroup + */ + public function createEmployerGroup( + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['createEmployerGroup'][0] + ): \SynergiTech\Staffology\Model\EmployerGroup + { + list($response) = $this->createEmployerGroupWithHttpInfo($employerGroup, $contentType); + return $response; + } + + /** + * Operation createEmployerGroupWithHttpInfo + * + * Create EmployerGroup + * + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\EmployerGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function createEmployerGroupWithHttpInfo( + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['createEmployerGroup'][0] + ): array + { + $request = $this->createEmployerGroupRequest($employerGroup, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\EmployerGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerGroup' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerGroup', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEmployerGroupAsync + * + * Create EmployerGroup + * + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployerGroupAsync( + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['createEmployerGroup'][0] + ): PromiseInterface + { + return $this->createEmployerGroupAsyncWithHttpInfo($employerGroup, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEmployerGroupAsyncWithHttpInfo + * + * Create EmployerGroup + * + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEmployerGroupAsyncWithHttpInfo( + $employerGroup = null, + string $contentType = self::contentTypes['createEmployerGroup'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + $request = $this->createEmployerGroupRequest($employerGroup, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEmployerGroup' + * + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createEmployerGroupRequest( + $employerGroup = null, + string $contentType = self::contentTypes['createEmployerGroup'][0] + ): Request + { + + + + $resourcePath = '/employers/groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerGroup)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerGroup)); + } else { + $httpBody = $employerGroup; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEmployerGroup + * + * Delete EmployerGroup + * + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteEmployerGroup( + string $code, + string $contentType = self::contentTypes['deleteEmployerGroup'][0] + ): void + { + $this->deleteEmployerGroupWithHttpInfo($code, $contentType); + } + + /** + * Operation deleteEmployerGroupWithHttpInfo + * + * Delete EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEmployerGroupWithHttpInfo( + string $code, + string $contentType = self::contentTypes['deleteEmployerGroup'][0] + ): array + { + $request = $this->deleteEmployerGroupRequest($code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteEmployerGroupAsync + * + * Delete EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployerGroupAsync( + string $code, + string $contentType = self::contentTypes['deleteEmployerGroup'][0] + ): PromiseInterface + { + return $this->deleteEmployerGroupAsyncWithHttpInfo($code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEmployerGroupAsyncWithHttpInfo + * + * Delete EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEmployerGroupAsyncWithHttpInfo( + $code, + string $contentType = self::contentTypes['deleteEmployerGroup'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteEmployerGroupRequest($code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEmployerGroup' + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteEmployerGroupRequest( + $code, + string $contentType = self::contentTypes['deleteEmployerGroup'][0] + ): Request + { + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deleteEmployerGroup' + ); + } + + + $resourcePath = '/employers/groups/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployerGroup + * + * Get EmployerGroup + * + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerGroup + */ + public function getEmployerGroup( + string $code, + string $contentType = self::contentTypes['getEmployerGroup'][0] + ): \SynergiTech\Staffology\Model\EmployerGroup + { + list($response) = $this->getEmployerGroupWithHttpInfo($code, $contentType); + return $response; + } + + /** + * Operation getEmployerGroupWithHttpInfo + * + * Get EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployerGroupWithHttpInfo( + string $code, + string $contentType = self::contentTypes['getEmployerGroup'][0] + ): array + { + $request = $this->getEmployerGroupRequest($code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerGroup' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerGroup', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployerGroupAsync + * + * Get EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerGroupAsync( + string $code, + string $contentType = self::contentTypes['getEmployerGroup'][0] + ): PromiseInterface + { + return $this->getEmployerGroupAsyncWithHttpInfo($code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployerGroupAsyncWithHttpInfo + * + * Get EmployerGroup + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerGroupAsyncWithHttpInfo( + $code, + string $contentType = self::contentTypes['getEmployerGroup'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + $request = $this->getEmployerGroupRequest($code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployerGroup' + * + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployerGroupRequest( + $code, + string $contentType = self::contentTypes['getEmployerGroup'][0] + ): Request + { + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getEmployerGroup' + ); + } + + + $resourcePath = '/employers/groups/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmployerGroup + * + * List EmployerGroups + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmployerGroup( + string $contentType = self::contentTypes['indexEmployerGroup'][0] + ): array + { + list($response) = $this->indexEmployerGroupWithHttpInfo($contentType); + return $response; + } + + /** + * Operation indexEmployerGroupWithHttpInfo + * + * List EmployerGroups + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmployerGroupWithHttpInfo( + string $contentType = self::contentTypes['indexEmployerGroup'][0] + ): array + { + $request = $this->indexEmployerGroupRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmployerGroupAsync + * + * List EmployerGroups + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerGroupAsync( + string $contentType = self::contentTypes['indexEmployerGroup'][0] + ): PromiseInterface + { + return $this->indexEmployerGroupAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmployerGroupAsyncWithHttpInfo + * + * List EmployerGroups + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerGroupAsyncWithHttpInfo( + string $contentType = self::contentTypes['indexEmployerGroup'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmployerGroupRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmployerGroup' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmployerGroupRequest( + string $contentType = self::contentTypes['indexEmployerGroup'][0] + ): Request + { + + + $resourcePath = '/employers/groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployerGroup + * + * Update EmployerGroup + * + * @param string $code code (required) + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerGroup + */ + public function updateEmployerGroup( + string $code, + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['updateEmployerGroup'][0] + ): \SynergiTech\Staffology\Model\EmployerGroup + { + list($response) = $this->updateEmployerGroupWithHttpInfo($code, $employerGroup, $contentType); + return $response; + } + + /** + * Operation updateEmployerGroupWithHttpInfo + * + * Update EmployerGroup + * + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerGroup'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerGroup, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployerGroupWithHttpInfo( + string $code, + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['updateEmployerGroup'][0] + ): array + { + $request = $this->updateEmployerGroupRequest($code, $employerGroup, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerGroup', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerGroup' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerGroup', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerGroup', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployerGroupAsync + * + * Update EmployerGroup + * + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerGroupAsync( + string $code, + ?\SynergiTech\Staffology\Model\EmployerGroup $employerGroup = null, + string $contentType = self::contentTypes['updateEmployerGroup'][0] + ): PromiseInterface + { + return $this->updateEmployerGroupAsyncWithHttpInfo($code, $employerGroup, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployerGroupAsyncWithHttpInfo + * + * Update EmployerGroup + * + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerGroupAsyncWithHttpInfo( + $code, + $employerGroup = null, + string $contentType = self::contentTypes['updateEmployerGroup'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerGroup'; + $request = $this->updateEmployerGroupRequest($code, $employerGroup, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployerGroup' + * + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\EmployerGroup|null $employerGroup (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerGroup'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployerGroupRequest( + $code, + $employerGroup = null, + string $contentType = self::contentTypes['updateEmployerGroup'][0] + ): Request + { + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updateEmployerGroup' + ); + } + + + + $resourcePath = '/employers/groups/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerGroup)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerGroup)); + } else { + $httpBody = $employerGroup; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EmployerTemplateApi.php b/src/Api/EmployerTemplateApi.php new file mode 100644 index 0000000..29525a4 --- /dev/null +++ b/src/Api/EmployerTemplateApi.php @@ -0,0 +1,1202 @@ + [ + 'application/json', + ], + 'indexEmployerTemplate' => [ + 'application/json', + ], + 'updateEmployerTemplate' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation getEmployerTemplate + * + * Get EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type The EmployerTemplateType you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerTemplate + */ + public function getEmployerTemplate( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + string $contentType = self::contentTypes['getEmployerTemplate'][0] + ): \SynergiTech\Staffology\Model\EmployerTemplate + { + list($response) = $this->getEmployerTemplateWithHttpInfo($employerId, $type, $contentType); + return $response; + } + + /** + * Operation getEmployerTemplateWithHttpInfo + * + * Get EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type The EmployerTemplateType you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerTemplate, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployerTemplateWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + string $contentType = self::contentTypes['getEmployerTemplate'][0] + ): array + { + $request = $this->getEmployerTemplateRequest($employerId, $type, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerTemplate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerTemplate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployerTemplateAsync + * + * Get EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type The EmployerTemplateType you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerTemplateAsync( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + string $contentType = self::contentTypes['getEmployerTemplate'][0] + ): PromiseInterface + { + return $this->getEmployerTemplateAsyncWithHttpInfo($employerId, $type, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployerTemplateAsyncWithHttpInfo + * + * Get EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type The EmployerTemplateType you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployerTemplateAsyncWithHttpInfo( + $employerId, + $type, + string $contentType = self::contentTypes['getEmployerTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerTemplate'; + $request = $this->getEmployerTemplateRequest($employerId, $type, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployerTemplate' + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type The EmployerTemplateType you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployerTemplateRequest( + $employerId, + $type, + string $contentType = self::contentTypes['getEmployerTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEmployerTemplate' + ); + } + + // verify the required parameter 'type' is set + if ($type === null || (is_array($type) && count($type) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $type when calling getEmployerTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/templates/{type}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($type !== null) { + $resourcePath = str_replace( + '{' . 'type' . '}', + ObjectSerializer::toPathValue($type), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexEmployerTemplate + * + * List EmployerTemplates + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexEmployerTemplate( + string $employerId, + string $contentType = self::contentTypes['indexEmployerTemplate'][0] + ): array + { + list($response) = $this->indexEmployerTemplateWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexEmployerTemplateWithHttpInfo + * + * List EmployerTemplates + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexEmployerTemplateWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexEmployerTemplate'][0] + ): array + { + $request = $this->indexEmployerTemplateRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexEmployerTemplateAsync + * + * List EmployerTemplates + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerTemplateAsync( + string $employerId, + string $contentType = self::contentTypes['indexEmployerTemplate'][0] + ): PromiseInterface + { + return $this->indexEmployerTemplateAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexEmployerTemplateAsyncWithHttpInfo + * + * List EmployerTemplates + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexEmployerTemplateAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexEmployerTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexEmployerTemplateRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexEmployerTemplate' + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexEmployerTemplateRequest( + $employerId, + string $contentType = self::contentTypes['indexEmployerTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexEmployerTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/templates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployerTemplate + * + * Update EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type type (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplate|null $employerTemplate The EmployerTemplateType you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerTemplate + */ + public function updateEmployerTemplate( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + ?\SynergiTech\Staffology\Model\EmployerTemplate $employerTemplate = null, + string $contentType = self::contentTypes['updateEmployerTemplate'][0] + ): \SynergiTech\Staffology\Model\EmployerTemplate + { + list($response) = $this->updateEmployerTemplateWithHttpInfo($employerId, $type, $employerTemplate, $contentType); + return $response; + } + + /** + * Operation updateEmployerTemplateWithHttpInfo + * + * Update EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplate|null $employerTemplate The EmployerTemplateType you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerTemplate, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployerTemplateWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + ?\SynergiTech\Staffology\Model\EmployerTemplate $employerTemplate = null, + string $contentType = self::contentTypes['updateEmployerTemplate'][0] + ): array + { + $request = $this->updateEmployerTemplateRequest($employerId, $type, $employerTemplate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployerTemplate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerTemplate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployerTemplateAsync + * + * Update EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplate|null $employerTemplate The EmployerTemplateType you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerTemplateAsync( + string $employerId, + \SynergiTech\Staffology\Model\EmployerTemplateType $type, + ?\SynergiTech\Staffology\Model\EmployerTemplate $employerTemplate = null, + string $contentType = self::contentTypes['updateEmployerTemplate'][0] + ): PromiseInterface + { + return $this->updateEmployerTemplateAsyncWithHttpInfo($employerId, $type, $employerTemplate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployerTemplateAsyncWithHttpInfo + * + * Update EmployerTemplate + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplate|null $employerTemplate The EmployerTemplateType you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployerTemplateAsyncWithHttpInfo( + $employerId, + $type, + $employerTemplate = null, + string $contentType = self::contentTypes['updateEmployerTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerTemplate'; + $request = $this->updateEmployerTemplateRequest($employerId, $type, $employerTemplate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployerTemplate' + * + * @param string $employerId The Id of the Employer to which the EmployerTemplate belongs. (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplateType $type (required) + * @param \SynergiTech\Staffology\Model\EmployerTemplate|null $employerTemplate The EmployerTemplateType you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployerTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployerTemplateRequest( + $employerId, + $type, + $employerTemplate = null, + string $contentType = self::contentTypes['updateEmployerTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEmployerTemplate' + ); + } + + // verify the required parameter 'type' is set + if ($type === null || (is_array($type) && count($type) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $type when calling updateEmployerTemplate' + ); + } + + + + $resourcePath = '/employers/{employerId}/templates/{type}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($type !== null) { + $resourcePath = str_replace( + '{' . 'type' . '}', + ObjectSerializer::toPathValue($type), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($employerTemplate)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($employerTemplate)); + } else { + $httpBody = $employerTemplate; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EngineApi.php b/src/Api/EngineApi.php new file mode 100644 index 0000000..9aa04a1 --- /dev/null +++ b/src/Api/EngineApi.php @@ -0,0 +1,2101 @@ + [ + 'application/json', + ], + 'calculateTaxEngine' => [ + 'application/json', + ], + 'configEngine' => [ + 'application/json', + ], + 'getNationalInsuranceThresholdsEngine' => [ + 'application/json', + ], + 'getTenantBrandingEngine' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation calculateNiEngine + * + * Calculate NI due. + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param string|null $niCategory The letter from the NI table (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNiEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NationalInsuranceCalculation + */ + public function calculateNiEngine( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?float $gross = null, + ?string $niCategory = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['calculateNiEngine'][0] + ): \SynergiTech\Staffology\Model\NationalInsuranceCalculation + { + list($response) = $this->calculateNiEngineWithHttpInfo($taxYear, $gross, $niCategory, $payPeriod, $contentType); + return $response; + } + + /** + * Operation calculateNiEngineWithHttpInfo + * + * Calculate NI due. + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param string|null $niCategory The letter from the NI table (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNiEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NationalInsuranceCalculation, HTTP status code, HTTP response headers (array of strings) + */ + public function calculateNiEngineWithHttpInfo( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?float $gross = null, + ?string $niCategory = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['calculateNiEngine'][0] + ): array + { + $request = $this->calculateNiEngineRequest($taxYear, $gross, $niCategory, $payPeriod, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NationalInsuranceCalculation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NationalInsuranceCalculation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NationalInsuranceCalculation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NationalInsuranceCalculation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NationalInsuranceCalculation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation calculateNiEngineAsync + * + * Calculate NI due. + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param string|null $niCategory The letter from the NI table (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNiEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateNiEngineAsync( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?float $gross = null, + ?string $niCategory = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['calculateNiEngine'][0] + ): PromiseInterface + { + return $this->calculateNiEngineAsyncWithHttpInfo($taxYear, $gross, $niCategory, $payPeriod, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation calculateNiEngineAsyncWithHttpInfo + * + * Calculate NI due. + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param string|null $niCategory The letter from the NI table (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNiEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateNiEngineAsyncWithHttpInfo( + $taxYear = null, + $gross = null, + $niCategory = null, + $payPeriod = null, + string $contentType = self::contentTypes['calculateNiEngine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NationalInsuranceCalculation'; + $request = $this->calculateNiEngineRequest($taxYear, $gross, $niCategory, $payPeriod, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'calculateNiEngine' + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param string|null $niCategory The letter from the NI table (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNiEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function calculateNiEngineRequest( + $taxYear = null, + $gross = null, + $niCategory = null, + $payPeriod = null, + string $contentType = self::contentTypes['calculateNiEngine'][0] + ): Request + { + + + + + + + $resourcePath = '/engine/ni'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $gross, + 'gross', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $niCategory, + 'niCategory', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation calculateTaxEngine + * + * Calculate Tax due + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param string|null $taxCode If not provided then the default code for the tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param \DateTime|null $periodStart periodStart (optional) + * @param \DateTime|null $periodEnd periodEnd (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param int|null $period The period that this payment is being made for (optional, default to 1) + * @param bool|null $week1 If set to true then tax will be calculated in a Week1/Month1 basis (optional, default to false) + * @param float|null $grossToDate Gross pay to date (optional, default to 0) + * @param float|null $taxToDate Tax paid to date (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTaxEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function calculateTaxEngine( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $taxCode = null, + ?float $gross = null, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $period = 1, + ?bool $week1 = false, + ?float $grossToDate = 0, + ?float $taxToDate = 0, + string $contentType = self::contentTypes['calculateTaxEngine'][0] + ): float + { + list($response) = $this->calculateTaxEngineWithHttpInfo($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate, $contentType); + return $response; + } + + /** + * Operation calculateTaxEngineWithHttpInfo + * + * Calculate Tax due + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param string|null $taxCode If not provided then the default code for the tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param int|null $period The period that this payment is being made for (optional, default to 1) + * @param bool|null $week1 If set to true then tax will be calculated in a Week1/Month1 basis (optional, default to false) + * @param float|null $grossToDate Gross pay to date (optional, default to 0) + * @param float|null $taxToDate Tax paid to date (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTaxEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function calculateTaxEngineWithHttpInfo( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $taxCode = null, + ?float $gross = null, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $period = 1, + ?bool $week1 = false, + ?float $grossToDate = 0, + ?float $taxToDate = 0, + string $contentType = self::contentTypes['calculateTaxEngine'][0] + ): array + { + $request = $this->calculateTaxEngineRequest($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation calculateTaxEngineAsync + * + * Calculate Tax due + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param string|null $taxCode If not provided then the default code for the tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param int|null $period The period that this payment is being made for (optional, default to 1) + * @param bool|null $week1 If set to true then tax will be calculated in a Week1/Month1 basis (optional, default to false) + * @param float|null $grossToDate Gross pay to date (optional, default to 0) + * @param float|null $taxToDate Tax paid to date (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTaxEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateTaxEngineAsync( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $taxCode = null, + ?float $gross = null, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $period = 1, + ?bool $week1 = false, + ?float $grossToDate = 0, + ?float $taxToDate = 0, + string $contentType = self::contentTypes['calculateTaxEngine'][0] + ): PromiseInterface + { + return $this->calculateTaxEngineAsyncWithHttpInfo($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation calculateTaxEngineAsyncWithHttpInfo + * + * Calculate Tax due + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param string|null $taxCode If not provided then the default code for the tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param int|null $period The period that this payment is being made for (optional, default to 1) + * @param bool|null $week1 If set to true then tax will be calculated in a Week1/Month1 basis (optional, default to false) + * @param float|null $grossToDate Gross pay to date (optional, default to 0) + * @param float|null $taxToDate Tax paid to date (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTaxEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateTaxEngineAsyncWithHttpInfo( + $taxYear = null, + $taxCode = null, + $gross = null, + $periodStart = null, + $periodEnd = null, + $payPeriod = null, + $period = 1, + $week1 = false, + $grossToDate = 0, + $taxToDate = 0, + string $contentType = self::contentTypes['calculateTaxEngine'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->calculateTaxEngineRequest($taxYear, $taxCode, $gross, $periodStart, $periodEnd, $payPeriod, $period, $week1, $grossToDate, $taxToDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'calculateTaxEngine' + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear If not provided then current tax year will be used. (optional) + * @param string|null $taxCode If not provided then the default code for the tax year will be used. (optional) + * @param float|null $gross The gross amount for which tax should be calculated. (optional) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The PayPeriod (Weekly, Monthly, etc) (optional) + * @param int|null $period The period that this payment is being made for (optional, default to 1) + * @param bool|null $week1 If set to true then tax will be calculated in a Week1/Month1 basis (optional, default to false) + * @param float|null $grossToDate Gross pay to date (optional, default to 0) + * @param float|null $taxToDate Tax paid to date (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTaxEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function calculateTaxEngineRequest( + $taxYear = null, + $taxCode = null, + $gross = null, + $periodStart = null, + $periodEnd = null, + $payPeriod = null, + $period = 1, + $week1 = false, + $grossToDate = 0, + $taxToDate = 0, + string $contentType = self::contentTypes['calculateTaxEngine'][0] + ): Request + { + + + + + + + + + + + + + $resourcePath = '/engine/tax'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxCode, + 'taxCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $gross, + 'gross', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodStart, + 'periodStart', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodEnd, + 'periodEnd', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period, + 'period', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $week1, + 'week1', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $grossToDate, + 'grossToDate', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxToDate, + 'taxToDate', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation configEngine + * + * Get Configuration + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The year that you want to retrieve details for. If not provided then current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['configEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\TaxYearConfig + */ + public function configEngine( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['configEngine'][0] + ): \SynergiTech\Staffology\Model\TaxYearConfig + { + list($response) = $this->configEngineWithHttpInfo($taxYear, $contentType); + return $response; + } + + /** + * Operation configEngineWithHttpInfo + * + * Get Configuration + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The year that you want to retrieve details for. If not provided then current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['configEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\TaxYearConfig, HTTP status code, HTTP response headers (array of strings) + */ + public function configEngineWithHttpInfo( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['configEngine'][0] + ): array + { + $request = $this->configEngineRequest($taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\TaxYearConfig', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\TaxYearConfig' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\TaxYearConfig', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\TaxYearConfig'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\TaxYearConfig', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation configEngineAsync + * + * Get Configuration + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The year that you want to retrieve details for. If not provided then current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['configEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function configEngineAsync( + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['configEngine'][0] + ): PromiseInterface + { + return $this->configEngineAsyncWithHttpInfo($taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation configEngineAsyncWithHttpInfo + * + * Get Configuration + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The year that you want to retrieve details for. If not provided then current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['configEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function configEngineAsyncWithHttpInfo( + $taxYear = null, + string $contentType = self::contentTypes['configEngine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\TaxYearConfig'; + $request = $this->configEngineRequest($taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'configEngine' + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The year that you want to retrieve details for. If not provided then current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['configEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function configEngineRequest( + $taxYear = null, + string $contentType = self::contentTypes['configEngine'][0] + ): Request + { + + + + $resourcePath = '/engine/config'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNationalInsuranceThresholdsEngine + * + * Get National Insurance Thresholds + * + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, monthly) that you want to retrieve details for. (required) + * @param \DateTime|null $periodStart periodStart (optional) + * @param \DateTime|null $periodEnd periodEnd (optional) + * @param \DateTime|null $effectiveDate The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNationalInsuranceThresholdsEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues + */ + public function getNationalInsuranceThresholdsEngine( + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\DateTime $effectiveDate = null, + string $contentType = self::contentTypes['getNationalInsuranceThresholdsEngine'][0] + ): \SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues + { + list($response) = $this->getNationalInsuranceThresholdsEngineWithHttpInfo($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate, $contentType); + return $response; + } + + /** + * Operation getNationalInsuranceThresholdsEngineWithHttpInfo + * + * Get National Insurance Thresholds + * + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, monthly) that you want to retrieve details for. (required) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \DateTime|null $effectiveDate The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNationalInsuranceThresholdsEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues, HTTP status code, HTTP response headers (array of strings) + */ + public function getNationalInsuranceThresholdsEngineWithHttpInfo( + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\DateTime $effectiveDate = null, + string $contentType = self::contentTypes['getNationalInsuranceThresholdsEngine'][0] + ): array + { + $request = $this->getNationalInsuranceThresholdsEngineRequest($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNationalInsuranceThresholdsEngineAsync + * + * Get National Insurance Thresholds + * + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, monthly) that you want to retrieve details for. (required) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \DateTime|null $effectiveDate The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNationalInsuranceThresholdsEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNationalInsuranceThresholdsEngineAsync( + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $periodStart = null, + ?\DateTime $periodEnd = null, + ?\DateTime $effectiveDate = null, + string $contentType = self::contentTypes['getNationalInsuranceThresholdsEngine'][0] + ): PromiseInterface + { + return $this->getNationalInsuranceThresholdsEngineAsyncWithHttpInfo($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNationalInsuranceThresholdsEngineAsyncWithHttpInfo + * + * Get National Insurance Thresholds + * + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, monthly) that you want to retrieve details for. (required) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \DateTime|null $effectiveDate The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNationalInsuranceThresholdsEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNationalInsuranceThresholdsEngineAsyncWithHttpInfo( + $taxYear, + $payPeriod, + $periodStart = null, + $periodEnd = null, + $effectiveDate = null, + string $contentType = self::contentTypes['getNationalInsuranceThresholdsEngine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NationalInsuranceCalculationPeriodValues'; + $request = $this->getNationalInsuranceThresholdsEngineRequest($taxYear, $payPeriod, $periodStart, $periodEnd, $effectiveDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNationalInsuranceThresholdsEngine' + * + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, monthly) that you want to retrieve details for. (required) + * @param \DateTime|null $periodStart (optional) + * @param \DateTime|null $periodEnd (optional) + * @param \DateTime|null $effectiveDate The date as of which you want to retrieve details for. If not provided then latest available details for the current tax year will be used. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNationalInsuranceThresholdsEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getNationalInsuranceThresholdsEngineRequest( + $taxYear, + $payPeriod, + $periodStart = null, + $periodEnd = null, + $effectiveDate = null, + string $contentType = self::contentTypes['getNationalInsuranceThresholdsEngine'][0] + ): Request + { + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getNationalInsuranceThresholdsEngine' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getNationalInsuranceThresholdsEngine' + ); + } + + + + + + $resourcePath = '/engine/config/{taxYear}/ni/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodStart, + 'periodStart', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodEnd, + 'periodEnd', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveDate, + 'effectiveDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTenantBrandingEngine + * + * Tenant Branding + * + * @param string $brandCode The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantBrandingEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function getTenantBrandingEngine( + string $brandCode, + string $contentType = self::contentTypes['getTenantBrandingEngine'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->getTenantBrandingEngineWithHttpInfo($brandCode, $contentType); + return $response; + } + + /** + * Operation getTenantBrandingEngineWithHttpInfo + * + * Tenant Branding + * + * @param string $brandCode The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantBrandingEngine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function getTenantBrandingEngineWithHttpInfo( + string $brandCode, + string $contentType = self::contentTypes['getTenantBrandingEngine'][0] + ): array + { + $request = $this->getTenantBrandingEngineRequest($brandCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTenantBrandingEngineAsync + * + * Tenant Branding + * + * @param string $brandCode The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantBrandingEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantBrandingEngineAsync( + string $brandCode, + string $contentType = self::contentTypes['getTenantBrandingEngine'][0] + ): PromiseInterface + { + return $this->getTenantBrandingEngineAsyncWithHttpInfo($brandCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTenantBrandingEngineAsyncWithHttpInfo + * + * Tenant Branding + * + * @param string $brandCode The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantBrandingEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantBrandingEngineAsyncWithHttpInfo( + $brandCode, + string $contentType = self::contentTypes['getTenantBrandingEngine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->getTenantBrandingEngineRequest($brandCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTenantBrandingEngine' + * + * @param string $brandCode The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenantBrandingEngine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTenantBrandingEngineRequest( + $brandCode, + string $contentType = self::contentTypes['getTenantBrandingEngine'][0] + ): Request + { + + // verify the required parameter 'brandCode' is set + if ($brandCode === null || (is_array($brandCode) && count($brandCode) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $brandCode when calling getTenantBrandingEngine' + ); + } + + + $resourcePath = '/engine/branding/{brandCode}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($brandCode !== null) { + $resourcePath = str_replace( + '{' . 'brandCode' . '}', + ObjectSerializer::toPathValue($brandCode), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/EpsApi.php b/src/Api/EpsApi.php new file mode 100644 index 0000000..379eb9a --- /dev/null +++ b/src/Api/EpsApi.php @@ -0,0 +1,4192 @@ + [ + 'application/json', + ], + 'createEps' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteEps' => [ + 'application/json', + ], + 'getEps' => [ + 'application/json', + ], + 'getXmlRequestEps' => [ + 'application/json', + ], + 'listEps' => [ + 'application/json', + ], + 'markAsAcceptedEps' => [ + 'application/json', + ], + 'recoverableAmountsEps' => [ + 'application/json', + ], + 'requiringAttentionEps' => [ + 'application/json', + ], + 'submitEps' => [ + 'application/json', + ], + 'updateEps' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation apprenticeshipLevyEps + * + * Apprenticeship Levy + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int $taxMonth taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EpsApprenticeshipLevy + */ + public function apprenticeshipLevyEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['apprenticeshipLevyEps'][0] + ): \SynergiTech\Staffology\Model\EpsApprenticeshipLevy + { + list($response) = $this->apprenticeshipLevyEpsWithHttpInfo($employerId, $taxYear, $taxMonth, $contentType); + return $response; + } + + /** + * Operation apprenticeshipLevyEpsWithHttpInfo + * + * Apprenticeship Levy + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EpsApprenticeshipLevy, HTTP status code, HTTP response headers (array of strings) + */ + public function apprenticeshipLevyEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['apprenticeshipLevyEps'][0] + ): array + { + $request = $this->apprenticeshipLevyEpsRequest($employerId, $taxYear, $taxMonth, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EpsApprenticeshipLevy', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EpsApprenticeshipLevy' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EpsApprenticeshipLevy', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EpsApprenticeshipLevy'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EpsApprenticeshipLevy', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation apprenticeshipLevyEpsAsync + * + * Apprenticeship Levy + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function apprenticeshipLevyEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['apprenticeshipLevyEps'][0] + ): PromiseInterface + { + return $this->apprenticeshipLevyEpsAsyncWithHttpInfo($employerId, $taxYear, $taxMonth, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apprenticeshipLevyEpsAsyncWithHttpInfo + * + * Apprenticeship Levy + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function apprenticeshipLevyEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $taxMonth, + string $contentType = self::contentTypes['apprenticeshipLevyEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EpsApprenticeshipLevy'; + $request = $this->apprenticeshipLevyEpsRequest($employerId, $taxYear, $taxMonth, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apprenticeshipLevyEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apprenticeshipLevyEpsRequest( + $employerId, + $taxYear, + $taxMonth, + string $contentType = self::contentTypes['apprenticeshipLevyEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling apprenticeshipLevyEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling apprenticeshipLevyEps' + ); + } + + // verify the required parameter 'taxMonth' is set + if ($taxMonth === null || (is_array($taxMonth) && count($taxMonth) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxMonth when calling apprenticeshipLevyEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/apprenticeshipLevytodate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($taxMonth !== null) { + $resourcePath = str_replace( + '{' . 'taxMonth' . '}', + ObjectSerializer::toPathValue($taxMonth), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createEps + * + * Create EPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function createEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['createEps'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->createEpsWithHttpInfo($employerId, $taxYear, $eps, $contentType); + return $response; + } + + /** + * Operation createEpsWithHttpInfo + * + * Create EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function createEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['createEps'][0] + ): array + { + $request = $this->createEpsRequest($employerId, $taxYear, $eps, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEpsAsync + * + * Create EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['createEps'][0] + ): PromiseInterface + { + return $this->createEpsAsyncWithHttpInfo($employerId, $taxYear, $eps, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEpsAsyncWithHttpInfo + * + * Create EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $eps = null, + string $contentType = self::contentTypes['createEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->createEpsRequest($employerId, $taxYear, $eps, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createEpsRequest( + $employerId, + $taxYear, + $eps = null, + string $contentType = self::contentTypes['createEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createEps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($eps)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($eps)); + } else { + $httpBody = $eps; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEps + * + * Delete Eps + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteEps'][0] + ): void + { + $this->deleteEpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteEpsWithHttpInfo + * + * Delete Eps + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteEps'][0] + ): array + { + $request = $this->deleteEpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteEpsAsync + * + * Delete Eps + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteEps'][0] + ): PromiseInterface + { + return $this->deleteEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEpsAsyncWithHttpInfo + * + * Delete Eps + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteEps'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteEpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteEpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEps + * + * Get EPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function getEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getEps'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->getEpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getEpsWithHttpInfo + * + * Get EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function getEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getEps'][0] + ): array + { + $request = $this->getEpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEpsAsync + * + * Get EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getEps'][0] + ): PromiseInterface + { + return $this->getEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEpsAsyncWithHttpInfo + * + * Get EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->getEpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestEps + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestEps'][0] + ): string + { + list($response) = $this->getXmlRequestEpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getXmlRequestEpsWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestEps'][0] + ): array + { + $request = $this->getXmlRequestEpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestEpsAsync + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestEps'][0] + ): PromiseInterface + { + return $this->getXmlRequestEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestEpsAsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestEps'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestEpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestEpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listEps + * + * List EPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listEps'][0] + ): array + { + list($response) = $this->listEpsWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listEpsWithHttpInfo + * + * List EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listEps'][0] + ): array + { + $request = $this->listEpsRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listEpsAsync + * + * List EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listEps'][0] + ): PromiseInterface + { + return $this->listEpsAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listEpsAsyncWithHttpInfo + * + * List EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listEpsRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listEpsRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedEps + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function markAsAcceptedEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedEps'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->markAsAcceptedEpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedEpsWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedEps'][0] + ): array + { + $request = $this->markAsAcceptedEpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedEpsAsync + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedEps'][0] + ): PromiseInterface + { + return $this->markAsAcceptedEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedEpsAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->markAsAcceptedEpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedEpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation recoverableAmountsEps + * + * Recoverable Amounts + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int $taxMonth taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['recoverableAmountsEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\RecoverableAmounts + */ + public function recoverableAmountsEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['recoverableAmountsEps'][0] + ): \SynergiTech\Staffology\Model\RecoverableAmounts + { + list($response) = $this->recoverableAmountsEpsWithHttpInfo($employerId, $taxYear, $taxMonth, $contentType); + return $response; + } + + /** + * Operation recoverableAmountsEpsWithHttpInfo + * + * Recoverable Amounts + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['recoverableAmountsEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\RecoverableAmounts, HTTP status code, HTTP response headers (array of strings) + */ + public function recoverableAmountsEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['recoverableAmountsEps'][0] + ): array + { + $request = $this->recoverableAmountsEpsRequest($employerId, $taxYear, $taxMonth, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\RecoverableAmounts', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\RecoverableAmounts' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\RecoverableAmounts', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\RecoverableAmounts'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\RecoverableAmounts', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation recoverableAmountsEpsAsync + * + * Recoverable Amounts + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['recoverableAmountsEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function recoverableAmountsEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + string $contentType = self::contentTypes['recoverableAmountsEps'][0] + ): PromiseInterface + { + return $this->recoverableAmountsEpsAsyncWithHttpInfo($employerId, $taxYear, $taxMonth, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation recoverableAmountsEpsAsyncWithHttpInfo + * + * Recoverable Amounts + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['recoverableAmountsEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function recoverableAmountsEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $taxMonth, + string $contentType = self::contentTypes['recoverableAmountsEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\RecoverableAmounts'; + $request = $this->recoverableAmountsEpsRequest($employerId, $taxYear, $taxMonth, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'recoverableAmountsEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['recoverableAmountsEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function recoverableAmountsEpsRequest( + $employerId, + $taxYear, + $taxMonth, + string $contentType = self::contentTypes['recoverableAmountsEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling recoverableAmountsEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling recoverableAmountsEps' + ); + } + + // verify the required parameter 'taxMonth' is set + if ($taxMonth === null || (is_array($taxMonth) && count($taxMonth) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxMonth when calling recoverableAmountsEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{taxMonth}/recoverableamounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($taxMonth !== null) { + $resourcePath = str_replace( + '{' . 'taxMonth' . '}', + ObjectSerializer::toPathValue($taxMonth), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionEps + * + * EPS Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionEps( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionEps'][0] + ): array + { + list($response) = $this->requiringAttentionEpsWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionEpsWithHttpInfo + * + * EPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionEpsWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionEps'][0] + ): array + { + $request = $this->requiringAttentionEpsRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionEpsAsync + * + * EPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionEpsAsync( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionEps'][0] + ): PromiseInterface + { + return $this->requiringAttentionEpsAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionEpsAsyncWithHttpInfo + * + * EPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionEpsAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionEpsRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionEps' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionEpsRequest( + $employerId, + string $contentType = self::contentTypes['requiringAttentionEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionEps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/eps/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitEps + * + * Submit EPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function submitEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitEps'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->submitEpsWithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitEpsWithHttpInfo + * + * Submit EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function submitEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitEps'][0] + ): array + { + $request = $this->submitEpsRequest($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitEpsAsync + * + * Submit EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitEps'][0] + ): PromiseInterface + { + return $this->submitEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitEpsAsyncWithHttpInfo + * + * Submit EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->submitEpsRequest($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitEpsRequest( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitEps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEps + * + * Update EPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function updateEps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['updateEps'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->updateEpsWithHttpInfo($employerId, $taxYear, $id, $eps, $contentType); + return $response; + } + + /** + * Operation updateEpsWithHttpInfo + * + * Update EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['updateEps'][0] + ): array + { + $request = $this->updateEpsRequest($employerId, $taxYear, $id, $eps, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEpsAsync + * + * Update EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Eps $eps = null, + string $contentType = self::contentTypes['updateEps'][0] + ): PromiseInterface + { + return $this->updateEpsAsyncWithHttpInfo($employerId, $taxYear, $id, $eps, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEpsAsyncWithHttpInfo + * + * Update EPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $eps = null, + string $contentType = self::contentTypes['updateEps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->updateEpsRequest($employerId, $taxYear, $id, $eps, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Eps|null $eps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEpsRequest( + $employerId, + $taxYear, + $id, + $eps = null, + string $contentType = self::contentTypes['updateEps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateEps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/eps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($eps)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($eps)); + } else { + $httpBody = $eps; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ExbApi.php b/src/Api/ExbApi.php new file mode 100644 index 0000000..821e5c8 --- /dev/null +++ b/src/Api/ExbApi.php @@ -0,0 +1,3787 @@ + [ + 'application/json', + ], + 'createExb' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteExb' => [ + 'application/json', + ], + 'getExb' => [ + 'application/json', + ], + 'getXmlRequestExb' => [ + 'application/json', + ], + 'listExb' => [ + 'application/json', + ], + 'markAsAcceptedExb' => [ + 'application/json', + ], + 'requiringAttentionExb' => [ + 'application/json', + ], + 'submitExb' => [ + 'application/json', + ], + 'updateExb' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation annualValuesExb + * + * Annual Values + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['annualValuesExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Exb + */ + public function annualValuesExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['annualValuesExb'][0] + ): \SynergiTech\Staffology\Model\Exb + { + list($response) = $this->annualValuesExbWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation annualValuesExbWithHttpInfo + * + * Annual Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['annualValuesExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Exb, HTTP status code, HTTP response headers (array of strings) + */ + public function annualValuesExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['annualValuesExb'][0] + ): array + { + $request = $this->annualValuesExbRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Exb', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Exb' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Exb', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Exb'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Exb', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation annualValuesExbAsync + * + * Annual Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['annualValuesExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function annualValuesExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['annualValuesExb'][0] + ): PromiseInterface + { + return $this->annualValuesExbAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation annualValuesExbAsyncWithHttpInfo + * + * Annual Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['annualValuesExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function annualValuesExbAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['annualValuesExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Exb'; + $request = $this->annualValuesExbRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'annualValuesExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['annualValuesExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function annualValuesExbRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['annualValuesExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling annualValuesExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling annualValuesExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/values'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createExb + * + * Create EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Eps + */ + public function createExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['createExb'][0] + ): \SynergiTech\Staffology\Model\Eps + { + list($response) = $this->createExbWithHttpInfo($employerId, $taxYear, $exb, $contentType); + return $response; + } + + /** + * Operation createExbWithHttpInfo + * + * Create EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Eps, HTTP status code, HTTP response headers (array of strings) + */ + public function createExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['createExb'][0] + ): array + { + $request = $this->createExbRequest($employerId, $taxYear, $exb, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Eps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Eps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Eps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Eps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Eps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createExbAsync + * + * Create EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['createExb'][0] + ): PromiseInterface + { + return $this->createExbAsyncWithHttpInfo($employerId, $taxYear, $exb, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createExbAsyncWithHttpInfo + * + * Create EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $exb = null, + string $contentType = self::contentTypes['createExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Eps'; + $request = $this->createExbRequest($employerId, $taxYear, $exb, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createExbRequest( + $employerId, + $taxYear, + $exb = null, + string $contentType = self::contentTypes['createExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createExb' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($exb)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($exb)); + } else { + $httpBody = $exb; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteExb + * + * Delete EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteExb'][0] + ): void + { + $this->deleteExbWithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteExbWithHttpInfo + * + * Delete EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteExb'][0] + ): array + { + $request = $this->deleteExbRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteExbAsync + * + * Delete EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteExb'][0] + ): PromiseInterface + { + return $this->deleteExbAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteExbAsyncWithHttpInfo + * + * Delete EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteExb'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteExbRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteExbRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getExb + * + * Get EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Exb + */ + public function getExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getExb'][0] + ): \SynergiTech\Staffology\Model\Exb + { + list($response) = $this->getExbWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getExbWithHttpInfo + * + * Get EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Exb, HTTP status code, HTTP response headers (array of strings) + */ + public function getExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getExb'][0] + ): array + { + $request = $this->getExbRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Exb', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Exb' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Exb', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Exb'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Exb', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getExbAsync + * + * Get EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getExb'][0] + ): PromiseInterface + { + return $this->getExbAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getExbAsyncWithHttpInfo + * + * Get EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Exb'; + $request = $this->getExbRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getExbRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestExb + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestExb'][0] + ): string + { + list($response) = $this->getXmlRequestExbWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getXmlRequestExbWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestExb'][0] + ): array + { + $request = $this->getXmlRequestExbRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestExbAsync + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestExb'][0] + ): PromiseInterface + { + return $this->getXmlRequestExbAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestExbAsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestExb'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestExbRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestExbRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listExb + * + * List EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listExb'][0] + ): array + { + list($response) = $this->listExbWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listExbWithHttpInfo + * + * List EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listExb'][0] + ): array + { + $request = $this->listExbRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listExbAsync + * + * List EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listExb'][0] + ): PromiseInterface + { + return $this->listExbAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listExbAsyncWithHttpInfo + * + * List EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listExbAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listExbRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listExbRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedExb + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Exb + */ + public function markAsAcceptedExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedExb'][0] + ): \SynergiTech\Staffology\Model\Exb + { + list($response) = $this->markAsAcceptedExbWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedExbWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Exb, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedExb'][0] + ): array + { + $request = $this->markAsAcceptedExbRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Exb', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Exb' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Exb', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Exb'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Exb', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedExbAsync + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedExb'][0] + ): PromiseInterface + { + return $this->markAsAcceptedExbAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedExbAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Exb'; + $request = $this->markAsAcceptedExbRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedExbRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionExb + * + * EXB Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionExb( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionExb'][0] + ): array + { + list($response) = $this->requiringAttentionExbWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionExbWithHttpInfo + * + * EXB Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionExbWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionExb'][0] + ): array + { + $request = $this->requiringAttentionExbRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionExbAsync + * + * EXB Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionExbAsync( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionExb'][0] + ): PromiseInterface + { + return $this->requiringAttentionExbAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionExbAsyncWithHttpInfo + * + * EXB Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionExbAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionExbRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionExb' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionExbRequest( + $employerId, + string $contentType = self::contentTypes['requiringAttentionExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionExb' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/exb/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitExb + * + * Submit EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Exb + */ + public function submitExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitExb'][0] + ): \SynergiTech\Staffology\Model\Exb + { + list($response) = $this->submitExbWithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitExbWithHttpInfo + * + * Submit EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Exb, HTTP status code, HTTP response headers (array of strings) + */ + public function submitExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitExb'][0] + ): array + { + $request = $this->submitExbRequest($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Exb', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Exb' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Exb', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Exb'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Exb', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitExbAsync + * + * Submit EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitExb'][0] + ): PromiseInterface + { + return $this->submitExbAsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitExbAsyncWithHttpInfo + * + * Submit EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Exb'; + $request = $this->submitExbRequest($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the EXB has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitExbRequest( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitExb' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateExb + * + * Update EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Exb + */ + public function updateExb( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['updateExb'][0] + ): \SynergiTech\Staffology\Model\Exb + { + list($response) = $this->updateExbWithHttpInfo($employerId, $taxYear, $id, $exb, $contentType); + return $response; + } + + /** + * Operation updateExbWithHttpInfo + * + * Update EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExb'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Exb, HTTP status code, HTTP response headers (array of strings) + */ + public function updateExbWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['updateExb'][0] + ): array + { + $request = $this->updateExbRequest($employerId, $taxYear, $id, $exb, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Exb', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Exb' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Exb', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Exb'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Exb', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateExbAsync + * + * Update EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateExbAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Exb $exb = null, + string $contentType = self::contentTypes['updateExb'][0] + ): PromiseInterface + { + return $this->updateExbAsyncWithHttpInfo($employerId, $taxYear, $id, $exb, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateExbAsyncWithHttpInfo + * + * Update EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateExbAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $exb = null, + string $contentType = self::contentTypes['updateExb'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Exb'; + $request = $this->updateExbRequest($employerId, $taxYear, $id, $exb, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateExb' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Exb|null $exb (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExb'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateExbRequest( + $employerId, + $taxYear, + $id, + $exb = null, + string $contentType = self::contentTypes['updateExb'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateExb' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateExb' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateExb' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/exb/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($exb)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($exb)); + } else { + $httpBody = $exb; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ExternalDataApi.php b/src/Api/ExternalDataApi.php new file mode 100644 index 0000000..6f44017 --- /dev/null +++ b/src/Api/ExternalDataApi.php @@ -0,0 +1,11157 @@ + [ + 'application/json', + ], + 'companiesExternalData' => [ + 'application/json', + ], + 'disconnectExternalData' => [ + 'application/json', + ], + 'employeeExternalData' => [ + 'application/json', + ], + 'employeeLogsExternalData' => [ + 'application/json', + ], + 'employeesExternalData' => [ + 'application/json', + ], + 'getConfigDataExternalData' => [ + 'application/json', + ], + 'importEmployeesExternalData' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'listExternalData' => [ + 'application/json', + ], + 'nominalCodesExternalData' => [ + 'application/json', + ], + 'pensionContributionsCsvExternalData' => [ + 'application/json', + ], + 'postJournalExternalData' => [ + 'application/json', + ], + 'postPaymentsExternalData' => [ + 'application/json', + ], + 'pushEmployeesExternalData' => [ + 'application/json', + ], + 'pushP11DExternalData' => [ + 'application/json', + ], + 'pushP11DsExternalData' => [ + 'application/json', + ], + 'pushP45ExternalData' => [ + 'application/json', + ], + 'pushP45sExternalData' => [ + 'application/json', + ], + 'pushP60ExternalData' => [ + 'application/json', + ], + 'pushP60sExternalData' => [ + 'application/json', + ], + 'pushPayslipsExternalData' => [ + 'application/json', + ], + 'pushPensionLetterExternalData' => [ + 'application/json', + ], + 'pushPensionLettersExternalData' => [ + 'application/json', + ], + 'respondExternalData' => [ + 'application/json', + ], + 'setConfigDataExternalData' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setCredentialsExternalData' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'syncAllEmployeesExternalData' => [ + 'application/json', + ], + 'syncEmployeeExternalData' => [ + 'application/json', + ], + 'syncLeaveExternalData' => [ + 'application/json', + ], + 'timeAndAttendanceExternalData' => [ + 'application/json', + ], + 'updateEmployeeExternalData' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation authorizeExternalData + * + * Get Authorization Url + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $returnUrl The URL to send the user to once the process is complete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authorizeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function authorizeExternalData( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $returnUrl = null, + string $contentType = self::contentTypes['authorizeExternalData'][0] + ): string + { + list($response) = $this->authorizeExternalDataWithHttpInfo($employerId, $id, $returnUrl, $contentType); + return $response; + } + + /** + * Operation authorizeExternalDataWithHttpInfo + * + * Get Authorization Url + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $returnUrl The URL to send the user to once the process is complete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authorizeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function authorizeExternalDataWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $returnUrl = null, + string $contentType = self::contentTypes['authorizeExternalData'][0] + ): array + { + $request = $this->authorizeExternalDataRequest($employerId, $id, $returnUrl, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation authorizeExternalDataAsync + * + * Get Authorization Url + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $returnUrl The URL to send the user to once the process is complete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authorizeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function authorizeExternalDataAsync( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $returnUrl = null, + string $contentType = self::contentTypes['authorizeExternalData'][0] + ): PromiseInterface + { + return $this->authorizeExternalDataAsyncWithHttpInfo($employerId, $id, $returnUrl, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation authorizeExternalDataAsyncWithHttpInfo + * + * Get Authorization Url + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $returnUrl The URL to send the user to once the process is complete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authorizeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function authorizeExternalDataAsyncWithHttpInfo( + $employerId, + $id, + $returnUrl = null, + string $contentType = self::contentTypes['authorizeExternalData'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->authorizeExternalDataRequest($employerId, $id, $returnUrl, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'authorizeExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $returnUrl The URL to send the user to once the process is complete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['authorizeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function authorizeExternalDataRequest( + $employerId, + $id, + $returnUrl = null, + string $contentType = self::contentTypes['authorizeExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling authorizeExternalData' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling authorizeExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/authorize'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $returnUrl, + 'returnUrl', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation companiesExternalData + * + * List Companies + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExternalDataCompany[] + */ + public function companiesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['companiesExternalData'][0] + ): array + { + list($response) = $this->companiesExternalDataWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation companiesExternalDataWithHttpInfo + * + * List Companies + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExternalDataCompany[], HTTP status code, HTTP response headers (array of strings) + */ + public function companiesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['companiesExternalData'][0] + ): array + { + $request = $this->companiesExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalDataCompany[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalDataCompany[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalDataCompany[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalDataCompany[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalDataCompany[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation companiesExternalDataAsync + * + * List Companies + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function companiesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['companiesExternalData'][0] + ): PromiseInterface + { + return $this->companiesExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation companiesExternalDataAsyncWithHttpInfo + * + * List Companies + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function companiesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['companiesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalDataCompany[]'; + $request = $this->companiesExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'companiesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['companiesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function companiesExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['companiesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling companiesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling companiesExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/companies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation disconnectExternalData + * + * Disconnect + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to disconnect from. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disconnectExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function disconnectExternalData( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['disconnectExternalData'][0] + ): void + { + $this->disconnectExternalDataWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation disconnectExternalDataWithHttpInfo + * + * Disconnect + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to disconnect from. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disconnectExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function disconnectExternalDataWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['disconnectExternalData'][0] + ): array + { + $request = $this->disconnectExternalDataRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation disconnectExternalDataAsync + * + * Disconnect + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to disconnect from. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disconnectExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function disconnectExternalDataAsync( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['disconnectExternalData'][0] + ): PromiseInterface + { + return $this->disconnectExternalDataAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation disconnectExternalDataAsyncWithHttpInfo + * + * Disconnect + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to disconnect from. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disconnectExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function disconnectExternalDataAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['disconnectExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->disconnectExternalDataRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'disconnectExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to disconnect from. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disconnectExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function disconnectExternalDataRequest( + $employerId, + $id, + string $contentType = self::contentTypes['disconnectExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling disconnectExternalData' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling disconnectExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/disconnect'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeExternalData + * + * Get Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExternalEmployeeMapping + */ + public function employeeExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeExternalData'][0] + ): \SynergiTech\Staffology\Model\ExternalEmployeeMapping + { + list($response) = $this->employeeExternalDataWithHttpInfo($id, $employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation employeeExternalDataWithHttpInfo + * + * Get Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExternalEmployeeMapping, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeExternalData'][0] + ): array + { + $request = $this->employeeExternalDataRequest($id, $employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalEmployeeMapping', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalEmployeeMapping' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalEmployeeMapping', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalEmployeeMapping'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalEmployeeMapping', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeExternalDataAsync + * + * Get Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeExternalData'][0] + ): PromiseInterface + { + return $this->employeeExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeExternalDataAsyncWithHttpInfo + * + * Get Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['employeeExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalEmployeeMapping'; + $request = $this->employeeExternalDataRequest($id, $employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeExternalDataRequest( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['employeeExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employeeExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeeExternalData' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling employeeExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeLogsExternalData + * + * Get Employee Logs + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLogsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\LogEntry[] + */ + public function employeeLogsExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeLogsExternalData'][0] + ): array + { + list($response) = $this->employeeLogsExternalDataWithHttpInfo($id, $employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation employeeLogsExternalDataWithHttpInfo + * + * Get Employee Logs + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLogsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\LogEntry[], HTTP status code, HTTP response headers (array of strings) + */ + public function employeeLogsExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeLogsExternalData'][0] + ): array + { + $request = $this->employeeLogsExternalDataRequest($id, $employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\LogEntry[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\LogEntry[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\LogEntry[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\LogEntry[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\LogEntry[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeLogsExternalDataAsync + * + * Get Employee Logs + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLogsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeLogsExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['employeeLogsExternalData'][0] + ): PromiseInterface + { + return $this->employeeLogsExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeLogsExternalDataAsyncWithHttpInfo + * + * Get Employee Logs + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLogsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeLogsExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['employeeLogsExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\LogEntry[]'; + $request = $this->employeeLogsExternalDataRequest($id, $employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeLogsExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLogsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeLogsExternalDataRequest( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['employeeLogsExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employeeLogsExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeeLogsExternalData' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling employeeLogsExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/{employeeId}/logs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeesExternalData + * + * List Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employeesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['employeesExternalData'][0] + ): array + { + list($response) = $this->employeesExternalDataWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation employeesExternalDataWithHttpInfo + * + * List Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employeesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['employeesExternalData'][0] + ): array + { + $request = $this->employeesExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeesExternalDataAsync + * + * List Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['employeesExternalData'][0] + ): PromiseInterface + { + return $this->employeesExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeesExternalDataAsyncWithHttpInfo + * + * List Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['employeesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employeesExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeesExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['employeesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employeesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeesExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getConfigDataExternalData + * + * Get Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfigDataExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return mixed + */ + public function getConfigDataExternalData( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['getConfigDataExternalData'][0] + ): mixed + { + list($response) = $this->getConfigDataExternalDataWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getConfigDataExternalDataWithHttpInfo + * + * Get Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfigDataExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of mixed, HTTP status code, HTTP response headers (array of strings) + */ + public function getConfigDataExternalDataWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['getConfigDataExternalData'][0] + ): array + { + $request = $this->getConfigDataExternalDataRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('mixed', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'mixed', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'mixed'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'mixed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getConfigDataExternalDataAsync + * + * Get Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getConfigDataExternalDataAsync( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $contentType = self::contentTypes['getConfigDataExternalData'][0] + ): PromiseInterface + { + return $this->getConfigDataExternalDataAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getConfigDataExternalDataAsyncWithHttpInfo + * + * Get Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getConfigDataExternalDataAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getConfigDataExternalData'][0] + ): PromiseInterface + { + $returnType = 'mixed'; + $request = $this->getConfigDataExternalDataRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getConfigDataExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getConfigDataExternalDataRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getConfigDataExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getConfigDataExternalData' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getConfigDataExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/config'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importEmployeesExternalData + * + * Import Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string[]|null $requestBody The externalIds to import (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importEmployeesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['importEmployeesExternalData'][0] + ): array + { + list($response) = $this->importEmployeesExternalDataWithHttpInfo($id, $employerId, $requestBody, $contentType); + return $response; + } + + /** + * Operation importEmployeesExternalDataWithHttpInfo + * + * Import Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string[]|null $requestBody The externalIds to import (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importEmployeesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['importEmployeesExternalData'][0] + ): array + { + $request = $this->importEmployeesExternalDataRequest($id, $employerId, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importEmployeesExternalDataAsync + * + * Import Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string[]|null $requestBody The externalIds to import (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importEmployeesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?array $requestBody = null, + string $contentType = self::contentTypes['importEmployeesExternalData'][0] + ): PromiseInterface + { + return $this->importEmployeesExternalDataAsyncWithHttpInfo($id, $employerId, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importEmployeesExternalDataAsyncWithHttpInfo + * + * Import Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string[]|null $requestBody The externalIds to import (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importEmployeesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $requestBody = null, + string $contentType = self::contentTypes['importEmployeesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importEmployeesExternalDataRequest($id, $employerId, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importEmployeesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string[]|null $requestBody The externalIds to import (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importEmployeesExternalDataRequest( + $id, + $employerId, + $requestBody = null, + string $contentType = self::contentTypes['importEmployeesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling importEmployeesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importEmployeesExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listExternalData + * + * List Providers + * + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ExternalDataProvider[] + */ + public function listExternalData( + string $employerId, + string $contentType = self::contentTypes['listExternalData'][0] + ): array + { + list($response) = $this->listExternalDataWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation listExternalDataWithHttpInfo + * + * List Providers + * + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ExternalDataProvider[], HTTP status code, HTTP response headers (array of strings) + */ + public function listExternalDataWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['listExternalData'][0] + ): array + { + $request = $this->listExternalDataRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalDataProvider[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalDataProvider[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalDataProvider[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalDataProvider[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalDataProvider[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listExternalDataAsync + * + * List Providers + * + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listExternalDataAsync( + string $employerId, + string $contentType = self::contentTypes['listExternalData'][0] + ): PromiseInterface + { + return $this->listExternalDataAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listExternalDataAsyncWithHttpInfo + * + * List Providers + * + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listExternalDataAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['listExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalDataProvider[]'; + $request = $this->listExternalDataRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listExternalDataRequest( + $employerId, + string $contentType = self::contentTypes['listExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation nominalCodesExternalData + * + * List Nominal Codes + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function nominalCodesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['nominalCodesExternalData'][0] + ): array + { + list($response) = $this->nominalCodesExternalDataWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation nominalCodesExternalDataWithHttpInfo + * + * List Nominal Codes + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function nominalCodesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['nominalCodesExternalData'][0] + ): array + { + $request = $this->nominalCodesExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation nominalCodesExternalDataAsync + * + * List Nominal Codes + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function nominalCodesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['nominalCodesExternalData'][0] + ): PromiseInterface + { + return $this->nominalCodesExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation nominalCodesExternalDataAsyncWithHttpInfo + * + * List Nominal Codes + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function nominalCodesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['nominalCodesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->nominalCodesExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'nominalCodesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function nominalCodesExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['nominalCodesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling nominalCodesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling nominalCodesExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/nominals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pensionContributionsCsvExternalData + * + * Contributions CSV File + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionContributionsCsvExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function pensionContributionsCsvExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionContributionsCsvExternalData'][0] + ): string + { + list($response) = $this->pensionContributionsCsvExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal, $contentType); + return $response; + } + + /** + * Operation pensionContributionsCsvExternalDataWithHttpInfo + * + * Contributions CSV File + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionContributionsCsvExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function pensionContributionsCsvExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionContributionsCsvExternalData'][0] + ): array + { + $request = $this->pensionContributionsCsvExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pensionContributionsCsvExternalDataAsync + * + * Contributions CSV File + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionContributionsCsvExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pensionContributionsCsvExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionContributionsCsvExternalData'][0] + ): PromiseInterface + { + return $this->pensionContributionsCsvExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pensionContributionsCsvExternalDataAsyncWithHttpInfo + * + * Contributions CSV File + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionContributionsCsvExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pensionContributionsCsvExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $schemeId = null, + $ordinal = 1, + string $contentType = self::contentTypes['pensionContributionsCsvExternalData'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->pensionContributionsCsvExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pensionContributionsCsvExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionContributionsCsvExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pensionContributionsCsvExternalDataRequest( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $schemeId = null, + $ordinal = 1, + string $contentType = self::contentTypes['pensionContributionsCsvExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pensionContributionsCsvExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pensionContributionsCsvExternalData' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling pensionContributionsCsvExternalData' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling pensionContributionsCsvExternalData' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling pensionContributionsCsvExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $schemeId, + 'schemeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postJournalExternalData + * + * Post Journal + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $force Set to true if you want to force the journal to be posted even if it already has been (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postJournalExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunJournal + */ + public function postJournalExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $force = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['postJournalExternalData'][0] + ): \SynergiTech\Staffology\Model\PayRunJournal + { + list($response) = $this->postJournalExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $contentType); + return $response; + } + + /** + * Operation postJournalExternalDataWithHttpInfo + * + * Post Journal + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $force Set to true if you want to force the journal to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postJournalExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunJournal, HTTP status code, HTTP response headers (array of strings) + */ + public function postJournalExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $force = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['postJournalExternalData'][0] + ): array + { + $request = $this->postJournalExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunJournal', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunJournal' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunJournal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunJournal'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunJournal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postJournalExternalDataAsync + * + * Post Journal + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $force Set to true if you want to force the journal to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postJournalExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function postJournalExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $force = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['postJournalExternalData'][0] + ): PromiseInterface + { + return $this->postJournalExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postJournalExternalDataAsyncWithHttpInfo + * + * Post Journal + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $force Set to true if you want to force the journal to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postJournalExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function postJournalExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $force = null, + $ordinal = 1, + string $contentType = self::contentTypes['postJournalExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunJournal'; + $request = $this->postJournalExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postJournalExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $force Set to true if you want to force the journal to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postJournalExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postJournalExternalDataRequest( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $force = null, + $ordinal = 1, + string $contentType = self::contentTypes['postJournalExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling postJournalExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling postJournalExternalData' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling postJournalExternalData' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling postJournalExternalData' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling postJournalExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/journal'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation postPaymentsExternalData + * + * Post Payments + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $incEmployees Include payments for employees (optional) + * @param bool|null $incHmrc Include payments for HMRC (if any) (optional) + * @param bool|null $incPensions Include payments for Pension Providers (if any) (optional) + * @param bool|null $incAeos Include any payment due as a result of AttachmentOrders (if any) (optional) + * @param bool|null $incDeductions Include any payment due to Deductions that are set to be paid to a Payee (if any) (optional) + * @param bool|null $force Set to true if you want to force the payments to be posted even if it already has been (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \DateTime|null $paymentDate Optional. If a value is provided then it'll be used in place of the payment date for the payment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postPaymentsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\BankPaymentInstruction + */ + public function postPaymentsExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $incEmployees = null, + ?bool $incHmrc = null, + ?bool $incPensions = null, + ?bool $incAeos = null, + ?bool $incDeductions = null, + ?bool $force = null, + ?int $ordinal = 1, + ?\DateTime $paymentDate = null, + string $contentType = self::contentTypes['postPaymentsExternalData'][0] + ): \SynergiTech\Staffology\Model\BankPaymentInstruction + { + list($response) = $this->postPaymentsExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate, $contentType); + return $response; + } + + /** + * Operation postPaymentsExternalDataWithHttpInfo + * + * Post Payments + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $incEmployees Include payments for employees (optional) + * @param bool|null $incHmrc Include payments for HMRC (if any) (optional) + * @param bool|null $incPensions Include payments for Pension Providers (if any) (optional) + * @param bool|null $incAeos Include any payment due as a result of AttachmentOrders (if any) (optional) + * @param bool|null $incDeductions Include any payment due to Deductions that are set to be paid to a Payee (if any) (optional) + * @param bool|null $force Set to true if you want to force the payments to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $paymentDate Optional. If a value is provided then it'll be used in place of the payment date for the payment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postPaymentsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\BankPaymentInstruction, HTTP status code, HTTP response headers (array of strings) + */ + public function postPaymentsExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $incEmployees = null, + ?bool $incHmrc = null, + ?bool $incPensions = null, + ?bool $incAeos = null, + ?bool $incDeductions = null, + ?bool $force = null, + ?int $ordinal = 1, + ?\DateTime $paymentDate = null, + string $contentType = self::contentTypes['postPaymentsExternalData'][0] + ): array + { + $request = $this->postPaymentsExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\BankPaymentInstruction', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\BankPaymentInstruction' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\BankPaymentInstruction', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstruction'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\BankPaymentInstruction', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation postPaymentsExternalDataAsync + * + * Post Payments + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $incEmployees Include payments for employees (optional) + * @param bool|null $incHmrc Include payments for HMRC (if any) (optional) + * @param bool|null $incPensions Include payments for Pension Providers (if any) (optional) + * @param bool|null $incAeos Include any payment due as a result of AttachmentOrders (if any) (optional) + * @param bool|null $incDeductions Include any payment due to Deductions that are set to be paid to a Payee (if any) (optional) + * @param bool|null $force Set to true if you want to force the payments to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $paymentDate Optional. If a value is provided then it'll be used in place of the payment date for the payment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postPaymentsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function postPaymentsExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $incEmployees = null, + ?bool $incHmrc = null, + ?bool $incPensions = null, + ?bool $incAeos = null, + ?bool $incDeductions = null, + ?bool $force = null, + ?int $ordinal = 1, + ?\DateTime $paymentDate = null, + string $contentType = self::contentTypes['postPaymentsExternalData'][0] + ): PromiseInterface + { + return $this->postPaymentsExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation postPaymentsExternalDataAsyncWithHttpInfo + * + * Post Payments + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $incEmployees Include payments for employees (optional) + * @param bool|null $incHmrc Include payments for HMRC (if any) (optional) + * @param bool|null $incPensions Include payments for Pension Providers (if any) (optional) + * @param bool|null $incAeos Include any payment due as a result of AttachmentOrders (if any) (optional) + * @param bool|null $incDeductions Include any payment due to Deductions that are set to be paid to a Payee (if any) (optional) + * @param bool|null $force Set to true if you want to force the payments to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $paymentDate Optional. If a value is provided then it'll be used in place of the payment date for the payment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postPaymentsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function postPaymentsExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $incEmployees = null, + $incHmrc = null, + $incPensions = null, + $incAeos = null, + $incDeductions = null, + $force = null, + $ordinal = 1, + $paymentDate = null, + string $contentType = self::contentTypes['postPaymentsExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstruction'; + $request = $this->postPaymentsExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $incEmployees, $incHmrc, $incPensions, $incAeos, $incDeductions, $force, $ordinal, $paymentDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'postPaymentsExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod To identify the PayRun (required) + * @param int $periodNumber To identify the PayRun (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear To identify the PayRun (required) + * @param bool|null $incEmployees Include payments for employees (optional) + * @param bool|null $incHmrc Include payments for HMRC (if any) (optional) + * @param bool|null $incPensions Include payments for Pension Providers (if any) (optional) + * @param bool|null $incAeos Include any payment due as a result of AttachmentOrders (if any) (optional) + * @param bool|null $incDeductions Include any payment due to Deductions that are set to be paid to a Payee (if any) (optional) + * @param bool|null $force Set to true if you want to force the payments to be posted even if it already has been (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $paymentDate Optional. If a value is provided then it'll be used in place of the payment date for the payment. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postPaymentsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function postPaymentsExternalDataRequest( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $incEmployees = null, + $incHmrc = null, + $incPensions = null, + $incAeos = null, + $incDeductions = null, + $force = null, + $ordinal = 1, + $paymentDate = null, + string $contentType = self::contentTypes['postPaymentsExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling postPaymentsExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling postPaymentsExternalData' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling postPaymentsExternalData' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling postPaymentsExternalData' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling postPaymentsExternalData' + ); + } + + + + + + + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incEmployees, + 'incEmployees', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incHmrc, + 'incHmrc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incPensions, + 'incPensions', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incAeos, + 'incAeos', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incDeductions, + 'incDeductions', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paymentDate, + 'paymentDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushEmployeesExternalData + * + * Push Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function pushEmployeesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushEmployeesExternalData'][0] + ): array + { + list($response) = $this->pushEmployeesExternalDataWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation pushEmployeesExternalDataWithHttpInfo + * + * Push Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function pushEmployeesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushEmployeesExternalData'][0] + ): array + { + $request = $this->pushEmployeesExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pushEmployeesExternalDataAsync + * + * Push Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushEmployeesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushEmployeesExternalData'][0] + ): PromiseInterface + { + return $this->pushEmployeesExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushEmployeesExternalDataAsyncWithHttpInfo + * + * Push Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushEmployeesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['pushEmployeesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->pushEmployeesExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushEmployeesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushEmployeesExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['pushEmployeesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushEmployeesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushEmployeesExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/push'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP11DExternalData + * + * Push P11D + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string|null $employeeId employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP11DExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DExternalData'][0] + ): void + { + $this->pushP11DExternalDataWithHttpInfo($id, $employerId, $employeeId, $taxYear, $contentType); + } + + /** + * Operation pushP11DExternalDataWithHttpInfo + * + * Push P11D + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP11DExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DExternalData'][0] + ): array + { + $request = $this->pushP11DExternalDataRequest($id, $employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP11DExternalDataAsync + * + * Push P11D + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP11DExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DExternalData'][0] + ): PromiseInterface + { + return $this->pushP11DExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP11DExternalDataAsyncWithHttpInfo + * + * Push P11D + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP11DExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId = null, + $taxYear = null, + string $contentType = self::contentTypes['pushP11DExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP11DExternalDataRequest($id, $employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP11DExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP11DExternalDataRequest( + $id, + $employerId, + $employeeId = null, + $taxYear = null, + string $contentType = self::contentTypes['pushP11DExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP11DExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP11DExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p11d'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP11DsExternalData + * + * Push P11Ds + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP11DsExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DsExternalData'][0] + ): void + { + $this->pushP11DsExternalDataWithHttpInfo($id, $employerId, $taxYear, $contentType); + } + + /** + * Operation pushP11DsExternalDataWithHttpInfo + * + * Push P11Ds + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP11DsExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DsExternalData'][0] + ): array + { + $request = $this->pushP11DsExternalDataRequest($id, $employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP11DsExternalDataAsync + * + * Push P11Ds + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP11DsExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP11DsExternalData'][0] + ): PromiseInterface + { + return $this->pushP11DsExternalDataAsyncWithHttpInfo($id, $employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP11DsExternalDataAsyncWithHttpInfo + * + * Push P11Ds + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP11DsExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $taxYear = null, + string $contentType = self::contentTypes['pushP11DsExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP11DsExternalDataRequest($id, $employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP11DsExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP11DsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP11DsExternalDataRequest( + $id, + $employerId, + $taxYear = null, + string $contentType = self::contentTypes['pushP11DsExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP11DsExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP11DsExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p11ds'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP45ExternalData + * + * Push P45 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string|null $employeeId employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45ExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP45ExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushP45ExternalData'][0] + ): void + { + $this->pushP45ExternalDataWithHttpInfo($id, $employerId, $employeeId, $contentType); + } + + /** + * Operation pushP45ExternalDataWithHttpInfo + * + * Push P45 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45ExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP45ExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushP45ExternalData'][0] + ): array + { + $request = $this->pushP45ExternalDataRequest($id, $employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP45ExternalDataAsync + * + * Push P45 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP45ExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushP45ExternalData'][0] + ): PromiseInterface + { + return $this->pushP45ExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP45ExternalDataAsyncWithHttpInfo + * + * Push P45 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP45ExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId = null, + string $contentType = self::contentTypes['pushP45ExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP45ExternalDataRequest($id, $employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP45ExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP45ExternalDataRequest( + $id, + $employerId, + $employeeId = null, + string $contentType = self::contentTypes['pushP45ExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP45ExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP45ExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p45'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP45sExternalData + * + * Push P45s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the External Provider to which you want to send P45s (required) + * @param string $employerId The Id of the Employer for which you want to send P45s (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s (optional) + * @param int|null $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to send P45s (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The Tax Year for which you want to send P45s (optional) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45sExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP45sExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pushP45sExternalData'][0] + ): void + { + $this->pushP45sExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + } + + /** + * Operation pushP45sExternalDataWithHttpInfo + * + * Push P45s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the External Provider to which you want to send P45s (required) + * @param string $employerId The Id of the Employer for which you want to send P45s (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s (optional) + * @param int|null $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to send P45s (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The Tax Year for which you want to send P45s (optional) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45sExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP45sExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pushP45sExternalData'][0] + ): array + { + $request = $this->pushP45sExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP45sExternalDataAsync + * + * Push P45s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the External Provider to which you want to send P45s (required) + * @param string $employerId The Id of the Employer for which you want to send P45s (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s (optional) + * @param int|null $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to send P45s (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The Tax Year for which you want to send P45s (optional) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP45sExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pushP45sExternalData'][0] + ): PromiseInterface + { + return $this->pushP45sExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP45sExternalDataAsyncWithHttpInfo + * + * Push P45s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the External Provider to which you want to send P45s (required) + * @param string $employerId The Id of the Employer for which you want to send P45s (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s (optional) + * @param int|null $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to send P45s (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The Tax Year for which you want to send P45s (optional) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP45sExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod = null, + $periodNumber = null, + $taxYear = null, + $ordinal = 1, + string $contentType = self::contentTypes['pushP45sExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP45sExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP45sExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the External Provider to which you want to send P45s (required) + * @param string $employerId The Id of the Employer for which you want to send P45s (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to send P45s (optional) + * @param int|null $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to send P45s (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The Tax Year for which you want to send P45s (optional) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod for which you want to send P45s (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP45sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP45sExternalDataRequest( + $id, + $employerId, + $payPeriod = null, + $periodNumber = null, + $taxYear = null, + $ordinal = 1, + string $contentType = self::contentTypes['pushP45sExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP45sExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP45sExternalData' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p45s'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodNumber, + 'periodNumber', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP60ExternalData + * + * Push P60 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string|null $employeeId employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60ExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP60ExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60ExternalData'][0] + ): void + { + $this->pushP60ExternalDataWithHttpInfo($id, $employerId, $employeeId, $taxYear, $contentType); + } + + /** + * Operation pushP60ExternalDataWithHttpInfo + * + * Push P60 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60ExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP60ExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60ExternalData'][0] + ): array + { + $request = $this->pushP60ExternalDataRequest($id, $employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP60ExternalDataAsync + * + * Push P60 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP60ExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60ExternalData'][0] + ): PromiseInterface + { + return $this->pushP60ExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP60ExternalDataAsyncWithHttpInfo + * + * Push P60 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP60ExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId = null, + $taxYear = null, + string $contentType = self::contentTypes['pushP60ExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP60ExternalDataRequest($id, $employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP60ExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60ExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP60ExternalDataRequest( + $id, + $employerId, + $employeeId = null, + $taxYear = null, + string $contentType = self::contentTypes['pushP60ExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP60ExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP60ExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p60'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushP60sExternalData + * + * Push P60s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60sExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushP60sExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60sExternalData'][0] + ): void + { + $this->pushP60sExternalDataWithHttpInfo($id, $employerId, $taxYear, $contentType); + } + + /** + * Operation pushP60sExternalDataWithHttpInfo + * + * Push P60s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60sExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushP60sExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60sExternalData'][0] + ): array + { + $request = $this->pushP60sExternalDataRequest($id, $employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushP60sExternalDataAsync + * + * Push P60s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP60sExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['pushP60sExternalData'][0] + ): PromiseInterface + { + return $this->pushP60sExternalDataAsyncWithHttpInfo($id, $employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushP60sExternalDataAsyncWithHttpInfo + * + * Push P60s + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushP60sExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $taxYear = null, + string $contentType = self::contentTypes['pushP60sExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushP60sExternalDataRequest($id, $employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushP60sExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushP60sExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushP60sExternalDataRequest( + $id, + $employerId, + $taxYear = null, + string $contentType = self::contentTypes['pushP60sExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushP60sExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushP60sExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/p60s'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushPayslipsExternalData + * + * Push Payslips + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod (optional) + * @param int|null $periodNumber periodNumber (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param bool|null $force force (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $employeeId employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPayslipsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushPayslipsExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $force = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushPayslipsExternalData'][0] + ): void + { + $this->pushPayslipsExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId, $contentType); + } + + /** + * Operation pushPayslipsExternalDataWithHttpInfo + * + * Push Payslips + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $periodNumber (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $force (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPayslipsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushPayslipsExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $force = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushPayslipsExternalData'][0] + ): array + { + $request = $this->pushPayslipsExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushPayslipsExternalDataAsync + * + * Push Payslips + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $periodNumber (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $force (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPayslipsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPayslipsExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $periodNumber = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $force = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['pushPayslipsExternalData'][0] + ): PromiseInterface + { + return $this->pushPayslipsExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushPayslipsExternalDataAsyncWithHttpInfo + * + * Push Payslips + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $periodNumber (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $force (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPayslipsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPayslipsExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod = null, + $periodNumber = null, + $taxYear = null, + $force = null, + $ordinal = 1, + $employeeId = null, + string $contentType = self::contentTypes['pushPayslipsExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushPayslipsExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $force, $ordinal, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushPayslipsExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $periodNumber (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $force (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPayslipsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushPayslipsExternalDataRequest( + $id, + $employerId, + $payPeriod = null, + $periodNumber = null, + $taxYear = null, + $force = null, + $ordinal = 1, + $employeeId = null, + string $contentType = self::contentTypes['pushPayslipsExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushPayslipsExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushPayslipsExternalData' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/payslips'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodNumber, + 'periodNumber', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushPensionLetterExternalData + * + * Push Pension Letter + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string|null $employeeId employeeId (optional) + * @param string|null $assessmentId assessmentId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLetterExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushPensionLetterExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?string $assessmentId = null, + string $contentType = self::contentTypes['pushPensionLetterExternalData'][0] + ): void + { + $this->pushPensionLetterExternalDataWithHttpInfo($id, $employerId, $employeeId, $assessmentId, $contentType); + } + + /** + * Operation pushPensionLetterExternalDataWithHttpInfo + * + * Push Pension Letter + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $assessmentId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLetterExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushPensionLetterExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?string $assessmentId = null, + string $contentType = self::contentTypes['pushPensionLetterExternalData'][0] + ): array + { + $request = $this->pushPensionLetterExternalDataRequest($id, $employerId, $employeeId, $assessmentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushPensionLetterExternalDataAsync + * + * Push Pension Letter + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $assessmentId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLetterExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPensionLetterExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?string $employeeId = null, + ?string $assessmentId = null, + string $contentType = self::contentTypes['pushPensionLetterExternalData'][0] + ): PromiseInterface + { + return $this->pushPensionLetterExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $assessmentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushPensionLetterExternalDataAsyncWithHttpInfo + * + * Push Pension Letter + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $assessmentId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLetterExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPensionLetterExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId = null, + $assessmentId = null, + string $contentType = self::contentTypes['pushPensionLetterExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushPensionLetterExternalDataRequest($id, $employerId, $employeeId, $assessmentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushPensionLetterExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $assessmentId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLetterExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushPensionLetterExternalDataRequest( + $id, + $employerId, + $employeeId = null, + $assessmentId = null, + string $contentType = self::contentTypes['pushPensionLetterExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushPensionLetterExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushPensionLetterExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/pension-letter'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $assessmentId, + 'assessmentId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pushPensionLettersExternalData + * + * Push Pension Letters + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLettersExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function pushPensionLettersExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushPensionLettersExternalData'][0] + ): void + { + $this->pushPensionLettersExternalDataWithHttpInfo($id, $employerId, $contentType); + } + + /** + * Operation pushPensionLettersExternalDataWithHttpInfo + * + * Push Pension Letters + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLettersExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pushPensionLettersExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushPensionLettersExternalData'][0] + ): array + { + $request = $this->pushPensionLettersExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pushPensionLettersExternalDataAsync + * + * Push Pension Letters + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLettersExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPensionLettersExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['pushPensionLettersExternalData'][0] + ): PromiseInterface + { + return $this->pushPensionLettersExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pushPensionLettersExternalDataAsyncWithHttpInfo + * + * Push Pension Letters + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLettersExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pushPensionLettersExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['pushPensionLettersExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->pushPensionLettersExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pushPensionLettersExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pushPensionLettersExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pushPensionLettersExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['pushPensionLettersExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling pushPensionLettersExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pushPensionLettersExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/pension-letters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation respondExternalData + * + * 3rd Party Response + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string|null $error error (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['respondExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function respondExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $error = null, + string $contentType = self::contentTypes['respondExternalData'][0] + ): void + { + $this->respondExternalDataWithHttpInfo($id, $error, $contentType); + } + + /** + * Operation respondExternalDataWithHttpInfo + * + * 3rd Party Response + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string|null $error (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['respondExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function respondExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $error = null, + string $contentType = self::contentTypes['respondExternalData'][0] + ): array + { + $request = $this->respondExternalDataRequest($id, $error, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation respondExternalDataAsync + * + * 3rd Party Response + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string|null $error (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['respondExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function respondExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $error = null, + string $contentType = self::contentTypes['respondExternalData'][0] + ): PromiseInterface + { + return $this->respondExternalDataAsyncWithHttpInfo($id, $error, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation respondExternalDataAsyncWithHttpInfo + * + * 3rd Party Response + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string|null $error (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['respondExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function respondExternalDataAsyncWithHttpInfo( + $id, + $error = null, + string $contentType = self::contentTypes['respondExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->respondExternalDataRequest($id, $error, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'respondExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string|null $error (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['respondExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function respondExternalDataRequest( + $id, + $error = null, + string $contentType = self::contentTypes['respondExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling respondExternalData' + ); + } + + + + $resourcePath = '/external-data/{id}/respond'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $error, + 'error', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setConfigDataExternalData + * + * Set Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param mixed|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDataExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return mixed + */ + public function setConfigDataExternalData( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?mixed $body = null, + string $contentType = self::contentTypes['setConfigDataExternalData'][0] + ): mixed + { + list($response) = $this->setConfigDataExternalDataWithHttpInfo($employerId, $id, $body, $contentType); + return $response; + } + + /** + * Operation setConfigDataExternalDataWithHttpInfo + * + * Set Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param mixed|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDataExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of mixed, HTTP status code, HTTP response headers (array of strings) + */ + public function setConfigDataExternalDataWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?mixed $body = null, + string $contentType = self::contentTypes['setConfigDataExternalData'][0] + ): array + { + $request = $this->setConfigDataExternalDataRequest($employerId, $id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('mixed', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'mixed', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'mixed'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'mixed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setConfigDataExternalDataAsync + * + * Set Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param mixed|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setConfigDataExternalDataAsync( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?mixed $body = null, + string $contentType = self::contentTypes['setConfigDataExternalData'][0] + ): PromiseInterface + { + return $this->setConfigDataExternalDataAsyncWithHttpInfo($employerId, $id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setConfigDataExternalDataAsyncWithHttpInfo + * + * Set Config Data + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param mixed|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setConfigDataExternalDataAsyncWithHttpInfo( + $employerId, + $id, + $body = null, + string $contentType = self::contentTypes['setConfigDataExternalData'][0] + ): PromiseInterface + { + $returnType = 'mixed'; + $request = $this->setConfigDataExternalDataRequest($employerId, $id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setConfigDataExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want configuration data for. (required) + * @param mixed|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setConfigDataExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setConfigDataExternalDataRequest( + $employerId, + $id, + $body = null, + string $contentType = self::contentTypes['setConfigDataExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setConfigDataExternalData' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setConfigDataExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/config'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setCredentialsExternalData + * + * Set Credentials + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $username The username for the ExternalDataProvider. (optional) + * @param string|null $password The password for the ExternalDataProvider. (optional) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair Any additional data that is needed (optional) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCredentialsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setCredentialsExternalData( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $username = null, + ?string $password = null, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['setCredentialsExternalData'][0] + ): void + { + $this->setCredentialsExternalDataWithHttpInfo($employerId, $id, $username, $password, $stringStringKeyValuePair, $contentType); + } + + /** + * Operation setCredentialsExternalDataWithHttpInfo + * + * Set Credentials + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $username The username for the ExternalDataProvider. (optional) + * @param string|null $password The password for the ExternalDataProvider. (optional) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair Any additional data that is needed (optional) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCredentialsExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setCredentialsExternalDataWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $username = null, + ?string $password = null, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['setCredentialsExternalData'][0] + ): array + { + $request = $this->setCredentialsExternalDataRequest($employerId, $id, $username, $password, $stringStringKeyValuePair, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setCredentialsExternalDataAsync + * + * Set Credentials + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $username The username for the ExternalDataProvider. (optional) + * @param string|null $password The password for the ExternalDataProvider. (optional) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair Any additional data that is needed (optional) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCredentialsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCredentialsExternalDataAsync( + string $employerId, + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + ?string $username = null, + ?string $password = null, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['setCredentialsExternalData'][0] + ): PromiseInterface + { + return $this->setCredentialsExternalDataAsyncWithHttpInfo($employerId, $id, $username, $password, $stringStringKeyValuePair, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setCredentialsExternalDataAsyncWithHttpInfo + * + * Set Credentials + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $username The username for the ExternalDataProvider. (optional) + * @param string|null $password The password for the ExternalDataProvider. (optional) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair Any additional data that is needed (optional) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCredentialsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCredentialsExternalDataAsyncWithHttpInfo( + $employerId, + $id, + $username = null, + $password = null, + $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['setCredentialsExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setCredentialsExternalDataRequest($employerId, $id, $username, $password, $stringStringKeyValuePair, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setCredentialsExternalData' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id The Id of the ExternalDataProvider you want to authorize with. (required) + * @param string|null $username The username for the ExternalDataProvider. (optional) + * @param string|null $password The password for the ExternalDataProvider. (optional) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair Any additional data that is needed (optional) (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCredentialsExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setCredentialsExternalDataRequest( + $employerId, + $id, + $username = null, + $password = null, + $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['setCredentialsExternalData'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setCredentialsExternalData' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setCredentialsExternalData' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/authorize'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $username, + 'username', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $password, + 'password', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($stringStringKeyValuePair)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($stringStringKeyValuePair)); + } else { + $httpBody = $stringStringKeyValuePair; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation syncAllEmployeesExternalData + * + * Sync Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncAllEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function syncAllEmployeesExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['syncAllEmployeesExternalData'][0] + ): array + { + list($response) = $this->syncAllEmployeesExternalDataWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation syncAllEmployeesExternalDataWithHttpInfo + * + * Sync Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncAllEmployeesExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function syncAllEmployeesExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['syncAllEmployeesExternalData'][0] + ): array + { + $request = $this->syncAllEmployeesExternalDataRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation syncAllEmployeesExternalDataAsync + * + * Sync Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncAllEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncAllEmployeesExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $contentType = self::contentTypes['syncAllEmployeesExternalData'][0] + ): PromiseInterface + { + return $this->syncAllEmployeesExternalDataAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation syncAllEmployeesExternalDataAsyncWithHttpInfo + * + * Sync Employees + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncAllEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncAllEmployeesExternalDataAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['syncAllEmployeesExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->syncAllEmployeesExternalDataRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'syncAllEmployeesExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncAllEmployeesExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function syncAllEmployeesExternalDataRequest( + $id, + $employerId, + string $contentType = self::contentTypes['syncAllEmployeesExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling syncAllEmployeesExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling syncAllEmployeesExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/i/sync-all'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation syncEmployeeExternalData + * + * Sync Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncEmployeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item + */ + public function syncEmployeeExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['syncEmployeeExternalData'][0] + ): \SynergiTech\Staffology\Model\Item + { + list($response) = $this->syncEmployeeExternalDataWithHttpInfo($id, $employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation syncEmployeeExternalDataWithHttpInfo + * + * Sync Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncEmployeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item, HTTP status code, HTTP response headers (array of strings) + */ + public function syncEmployeeExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['syncEmployeeExternalData'][0] + ): array + { + $request = $this->syncEmployeeExternalDataRequest($id, $employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation syncEmployeeExternalDataAsync + * + * Sync Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncEmployeeExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['syncEmployeeExternalData'][0] + ): PromiseInterface + { + return $this->syncEmployeeExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation syncEmployeeExternalDataAsyncWithHttpInfo + * + * Sync Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncEmployeeExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['syncEmployeeExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item'; + $request = $this->syncEmployeeExternalDataRequest($id, $employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'syncEmployeeExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function syncEmployeeExternalDataRequest( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['syncEmployeeExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling syncEmployeeExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling syncEmployeeExternalData' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling syncEmployeeExternalData' + ); + } + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/{employeeId}/sync'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation syncLeaveExternalData + * + * Sync Leave + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncLeaveExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function syncLeaveExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['syncLeaveExternalData'][0] + ): void + { + $this->syncLeaveExternalDataWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + } + + /** + * Operation syncLeaveExternalDataWithHttpInfo + * + * Sync Leave + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncLeaveExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function syncLeaveExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['syncLeaveExternalData'][0] + ): array + { + $request = $this->syncLeaveExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation syncLeaveExternalDataAsync + * + * Sync Leave + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncLeaveExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncLeaveExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['syncLeaveExternalData'][0] + ): PromiseInterface + { + return $this->syncLeaveExternalDataAsyncWithHttpInfo($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation syncLeaveExternalDataAsyncWithHttpInfo + * + * Sync Leave + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncLeaveExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function syncLeaveExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['syncLeaveExternalData'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->syncLeaveExternalDataRequest($id, $employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'syncLeaveExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncLeaveExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function syncLeaveExternalDataRequest( + $id, + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['syncLeaveExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling syncLeaveExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling syncLeaveExternalData' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling syncLeaveExternalData' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling syncLeaveExternalData' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling syncLeaveExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/{taxYear}/{payPeriod}/{periodNumber}/leave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation timeAndAttendanceExternalData + * + * Get Time And Attendance Data + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param \DateTime|null $from from (optional) + * @param \DateTime|null $to to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timeAndAttendanceExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayOptionsImport[] + */ + public function timeAndAttendanceExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['timeAndAttendanceExternalData'][0] + ): array + { + list($response) = $this->timeAndAttendanceExternalDataWithHttpInfo($id, $employerId, $from, $to, $contentType); + return $response; + } + + /** + * Operation timeAndAttendanceExternalDataWithHttpInfo + * + * Get Time And Attendance Data + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timeAndAttendanceExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayOptionsImport[], HTTP status code, HTTP response headers (array of strings) + */ + public function timeAndAttendanceExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['timeAndAttendanceExternalData'][0] + ): array + { + $request = $this->timeAndAttendanceExternalDataRequest($id, $employerId, $from, $to, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayOptionsImport[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayOptionsImport[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayOptionsImport[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayOptionsImport[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayOptionsImport[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation timeAndAttendanceExternalDataAsync + * + * Get Time And Attendance Data + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timeAndAttendanceExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function timeAndAttendanceExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['timeAndAttendanceExternalData'][0] + ): PromiseInterface + { + return $this->timeAndAttendanceExternalDataAsyncWithHttpInfo($id, $employerId, $from, $to, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation timeAndAttendanceExternalDataAsyncWithHttpInfo + * + * Get Time And Attendance Data + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timeAndAttendanceExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function timeAndAttendanceExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $from = null, + $to = null, + string $contentType = self::contentTypes['timeAndAttendanceExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayOptionsImport[]'; + $request = $this->timeAndAttendanceExternalDataRequest($id, $employerId, $from, $to, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'timeAndAttendanceExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param \DateTime|null $from (optional) + * @param \DateTime|null $to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['timeAndAttendanceExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function timeAndAttendanceExternalDataRequest( + $id, + $employerId, + $from = null, + $to = null, + string $contentType = self::contentTypes['timeAndAttendanceExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling timeAndAttendanceExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling timeAndAttendanceExternalData' + ); + } + + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/time-and-attendance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from, + 'from', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to, + 'to', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmployeeExternalData + * + * Update Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id id (required) + * @param string $employerId employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMapping|null $externalEmployeeMapping externalEmployeeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExternalEmployeeMapping + */ + public function updateEmployeeExternalData( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\ExternalEmployeeMapping $externalEmployeeMapping = null, + string $contentType = self::contentTypes['updateEmployeeExternalData'][0] + ): \SynergiTech\Staffology\Model\ExternalEmployeeMapping + { + list($response) = $this->updateEmployeeExternalDataWithHttpInfo($id, $employerId, $employeeId, $externalEmployeeMapping, $contentType); + return $response; + } + + /** + * Operation updateEmployeeExternalDataWithHttpInfo + * + * Update Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMapping|null $externalEmployeeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeExternalData'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExternalEmployeeMapping, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmployeeExternalDataWithHttpInfo( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\ExternalEmployeeMapping $externalEmployeeMapping = null, + string $contentType = self::contentTypes['updateEmployeeExternalData'][0] + ): array + { + $request = $this->updateEmployeeExternalDataRequest($id, $employerId, $employeeId, $externalEmployeeMapping, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalEmployeeMapping', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalEmployeeMapping' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalEmployeeMapping', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalEmployeeMapping'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalEmployeeMapping', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmployeeExternalDataAsync + * + * Update Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMapping|null $externalEmployeeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeExternalDataAsync( + \SynergiTech\Staffology\Model\ExternalDataProviderId $id, + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\ExternalEmployeeMapping $externalEmployeeMapping = null, + string $contentType = self::contentTypes['updateEmployeeExternalData'][0] + ): PromiseInterface + { + return $this->updateEmployeeExternalDataAsyncWithHttpInfo($id, $employerId, $employeeId, $externalEmployeeMapping, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmployeeExternalDataAsyncWithHttpInfo + * + * Update Employee + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMapping|null $externalEmployeeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateEmployeeExternalDataAsyncWithHttpInfo( + $id, + $employerId, + $employeeId, + $externalEmployeeMapping = null, + string $contentType = self::contentTypes['updateEmployeeExternalData'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalEmployeeMapping'; + $request = $this->updateEmployeeExternalDataRequest($id, $employerId, $employeeId, $externalEmployeeMapping, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmployeeExternalData' + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId $id (required) + * @param string $employerId (required) + * @param string $employeeId The Id of the employee in the external data provider (required) + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMapping|null $externalEmployeeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeExternalData'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateEmployeeExternalDataRequest( + $id, + $employerId, + $employeeId, + $externalEmployeeMapping = null, + string $contentType = self::contentTypes['updateEmployeeExternalData'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateEmployeeExternalData' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateEmployeeExternalData' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateEmployeeExternalData' + ); + } + + + + $resourcePath = '/employers/{employerId}/external-data/{id}/employees/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($externalEmployeeMapping)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($externalEmployeeMapping)); + } else { + $httpBody = $externalEmployeeMapping; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/FpsApi.php b/src/Api/FpsApi.php new file mode 100644 index 0000000..4bafdb6 --- /dev/null +++ b/src/Api/FpsApi.php @@ -0,0 +1,3852 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteFps' => [ + 'application/json', + ], + 'getFps' => [ + 'application/json', + ], + 'getXmlRequestFps' => [ + 'application/json', + ], + 'listFps' => [ + 'application/json', + ], + 'markAsAcceptedFps' => [ + 'application/json', + ], + 'mostRecentForEmployeeFps' => [ + 'application/json', + ], + 'requiringAttentionFps' => [ + 'application/json', + ], + 'submitFps' => [ + 'application/json', + ], + 'updateFps' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createFps + * + * Create FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Fps + */ + public function createFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['createFps'][0] + ): \SynergiTech\Staffology\Model\Fps + { + list($response) = $this->createFpsWithHttpInfo($employerId, $taxYear, $fps, $contentType); + return $response; + } + + /** + * Operation createFpsWithHttpInfo + * + * Create FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Fps, HTTP status code, HTTP response headers (array of strings) + */ + public function createFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['createFps'][0] + ): array + { + $request = $this->createFpsRequest($employerId, $taxYear, $fps, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Fps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Fps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Fps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Fps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Fps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createFpsAsync + * + * Create FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['createFps'][0] + ): PromiseInterface + { + return $this->createFpsAsyncWithHttpInfo($employerId, $taxYear, $fps, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createFpsAsyncWithHttpInfo + * + * Create FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $fps = null, + string $contentType = self::contentTypes['createFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Fps'; + $request = $this->createFpsRequest($employerId, $taxYear, $fps, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createFpsRequest( + $employerId, + $taxYear, + $fps = null, + string $contentType = self::contentTypes['createFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createFps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($fps)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fps)); + } else { + $httpBody = $fps; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFps + * + * Delete FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteFps'][0] + ): void + { + $this->deleteFpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteFpsWithHttpInfo + * + * Delete FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteFps'][0] + ): array + { + $request = $this->deleteFpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteFpsAsync + * + * Delete FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteFps'][0] + ): PromiseInterface + { + return $this->deleteFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFpsAsyncWithHttpInfo + * + * Delete FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteFps'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteFpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteFpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteFps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFps + * + * Get FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Fps + */ + public function getFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getFps'][0] + ): \SynergiTech\Staffology\Model\Fps + { + list($response) = $this->getFpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getFpsWithHttpInfo + * + * Get FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Fps, HTTP status code, HTTP response headers (array of strings) + */ + public function getFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getFps'][0] + ): array + { + $request = $this->getFpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Fps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Fps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Fps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Fps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Fps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFpsAsync + * + * Get FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getFps'][0] + ): PromiseInterface + { + return $this->getFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFpsAsyncWithHttpInfo + * + * Get FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Fps'; + $request = $this->getFpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getFps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestFps + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $compressed Indicates whether the FPS XML should be in compressed format. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $compressed = false, + string $contentType = self::contentTypes['getXmlRequestFps'][0] + ): string + { + list($response) = $this->getXmlRequestFpsWithHttpInfo($employerId, $taxYear, $id, $compressed, $contentType); + return $response; + } + + /** + * Operation getXmlRequestFpsWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $compressed Indicates whether the FPS XML should be in compressed format. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $compressed = false, + string $contentType = self::contentTypes['getXmlRequestFps'][0] + ): array + { + $request = $this->getXmlRequestFpsRequest($employerId, $taxYear, $id, $compressed, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestFpsAsync + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $compressed Indicates whether the FPS XML should be in compressed format. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $compressed = false, + string $contentType = self::contentTypes['getXmlRequestFps'][0] + ): PromiseInterface + { + return $this->getXmlRequestFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $compressed, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestFpsAsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $compressed Indicates whether the FPS XML should be in compressed format. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $compressed = false, + string $contentType = self::contentTypes['getXmlRequestFps'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestFpsRequest($employerId, $taxYear, $id, $compressed, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $compressed Indicates whether the FPS XML should be in compressed format. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestFpsRequest( + $employerId, + $taxYear, + $id, + $compressed = false, + string $contentType = self::contentTypes['getXmlRequestFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestFps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $compressed, + 'compressed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listFps + * + * List FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listFps'][0] + ): array + { + list($response) = $this->listFpsWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listFpsWithHttpInfo + * + * List FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listFps'][0] + ): array + { + $request = $this->listFpsRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listFpsAsync + * + * List FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listFps'][0] + ): PromiseInterface + { + return $this->listFpsAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFpsAsyncWithHttpInfo + * + * List FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listFpsRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listFpsRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listFps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedFps + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Fps + */ + public function markAsAcceptedFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedFps'][0] + ): \SynergiTech\Staffology\Model\Fps + { + list($response) = $this->markAsAcceptedFpsWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedFpsWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Fps, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedFps'][0] + ): array + { + $request = $this->markAsAcceptedFpsRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Fps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Fps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Fps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Fps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Fps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedFpsAsync + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedFps'][0] + ): PromiseInterface + { + return $this->markAsAcceptedFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedFpsAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Fps'; + $request = $this->markAsAcceptedFpsRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedFpsRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedFps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation mostRecentForEmployeeFps + * + * Get most recent FPS for Employee + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $employeeId employeeId (required) + * @param bool|null $correction Only search for FPS's submitted as a correction to a previous year (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mostRecentForEmployeeFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item + */ + public function mostRecentForEmployeeFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $employeeId, + ?bool $correction = false, + string $contentType = self::contentTypes['mostRecentForEmployeeFps'][0] + ): \SynergiTech\Staffology\Model\Item + { + list($response) = $this->mostRecentForEmployeeFpsWithHttpInfo($employerId, $taxYear, $employeeId, $correction, $contentType); + return $response; + } + + /** + * Operation mostRecentForEmployeeFpsWithHttpInfo + * + * Get most recent FPS for Employee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $employeeId (required) + * @param bool|null $correction Only search for FPS's submitted as a correction to a previous year (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mostRecentForEmployeeFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item, HTTP status code, HTTP response headers (array of strings) + */ + public function mostRecentForEmployeeFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $employeeId, + ?bool $correction = false, + string $contentType = self::contentTypes['mostRecentForEmployeeFps'][0] + ): array + { + $request = $this->mostRecentForEmployeeFpsRequest($employerId, $taxYear, $employeeId, $correction, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mostRecentForEmployeeFpsAsync + * + * Get most recent FPS for Employee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $employeeId (required) + * @param bool|null $correction Only search for FPS's submitted as a correction to a previous year (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mostRecentForEmployeeFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function mostRecentForEmployeeFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $employeeId, + ?bool $correction = false, + string $contentType = self::contentTypes['mostRecentForEmployeeFps'][0] + ): PromiseInterface + { + return $this->mostRecentForEmployeeFpsAsyncWithHttpInfo($employerId, $taxYear, $employeeId, $correction, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mostRecentForEmployeeFpsAsyncWithHttpInfo + * + * Get most recent FPS for Employee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $employeeId (required) + * @param bool|null $correction Only search for FPS's submitted as a correction to a previous year (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mostRecentForEmployeeFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function mostRecentForEmployeeFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $employeeId, + $correction = false, + string $contentType = self::contentTypes['mostRecentForEmployeeFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item'; + $request = $this->mostRecentForEmployeeFpsRequest($employerId, $taxYear, $employeeId, $correction, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'mostRecentForEmployeeFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $employeeId (required) + * @param bool|null $correction Only search for FPS's submitted as a correction to a previous year (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['mostRecentForEmployeeFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function mostRecentForEmployeeFpsRequest( + $employerId, + $taxYear, + $employeeId, + $correction = false, + string $contentType = self::contentTypes['mostRecentForEmployeeFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling mostRecentForEmployeeFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling mostRecentForEmployeeFps' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling mostRecentForEmployeeFps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/mostrecentforemployee/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $correction, + 'correction', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionFps + * + * FPS Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionFps( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionFps'][0] + ): array + { + list($response) = $this->requiringAttentionFpsWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionFpsWithHttpInfo + * + * FPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionFpsWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionFps'][0] + ): array + { + $request = $this->requiringAttentionFpsRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionFpsAsync + * + * FPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionFpsAsync( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionFps'][0] + ): PromiseInterface + { + return $this->requiringAttentionFpsAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionFpsAsyncWithHttpInfo + * + * FPS Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionFpsAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionFpsRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionFps' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionFpsRequest( + $employerId, + string $contentType = self::contentTypes['requiringAttentionFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionFps' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/fps/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitFps + * + * Submit FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Fps + */ + public function submitFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitFps'][0] + ): \SynergiTech\Staffology\Model\Fps + { + list($response) = $this->submitFpsWithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitFpsWithHttpInfo + * + * Submit FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Fps, HTTP status code, HTTP response headers (array of strings) + */ + public function submitFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitFps'][0] + ): array + { + $request = $this->submitFpsRequest($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Fps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Fps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Fps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Fps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Fps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitFpsAsync + * + * Submit FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitFps'][0] + ): PromiseInterface + { + return $this->submitFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitFpsAsyncWithHttpInfo + * + * Submit FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Fps'; + $request = $this->submitFpsRequest($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force If the FPS has already been accepted then you will need to set this to true to force it to be resubmitted (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitFpsRequest( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitFps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFps + * + * Update FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Fps + */ + public function updateFps( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['updateFps'][0] + ): \SynergiTech\Staffology\Model\Fps + { + list($response) = $this->updateFpsWithHttpInfo($employerId, $taxYear, $id, $fps, $contentType); + return $response; + } + + /** + * Operation updateFpsWithHttpInfo + * + * Update FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFps'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Fps, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFpsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['updateFps'][0] + ): array + { + $request = $this->updateFpsRequest($employerId, $taxYear, $id, $fps, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Fps', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Fps' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Fps', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Fps'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Fps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFpsAsync + * + * Update FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateFpsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Fps $fps = null, + string $contentType = self::contentTypes['updateFps'][0] + ): PromiseInterface + { + return $this->updateFpsAsyncWithHttpInfo($employerId, $taxYear, $id, $fps, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFpsAsyncWithHttpInfo + * + * Update FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateFpsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $fps = null, + string $contentType = self::contentTypes['updateFps'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Fps'; + $request = $this->updateFpsRequest($employerId, $taxYear, $id, $fps, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFps' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Fps|null $fps (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFps'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateFpsRequest( + $employerId, + $taxYear, + $id, + $fps = null, + string $contentType = self::contentTypes['updateFps'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateFps' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateFps' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateFps' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/fps/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($fps)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fps)); + } else { + $httpBody = $fps; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/HmrcPaymentApi.php b/src/Api/HmrcPaymentApi.php new file mode 100644 index 0000000..04bec39 --- /dev/null +++ b/src/Api/HmrcPaymentApi.php @@ -0,0 +1,1672 @@ + [ + 'application/json', + ], + 'getHmrcPayment' => [ + 'application/json', + ], + 'indexHmrcPayment' => [ + 'application/json', + ], + 'updateHmrcPayment' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation bankPaymentHmrcPayment + * + * HMRC Bank Payment + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \DateTime $periodEnding periodEnding (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse + */ + public function bankPaymentHmrcPayment( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['bankPaymentHmrcPayment'][0] + ): \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse + { + list($response) = $this->bankPaymentHmrcPaymentWithHttpInfo($employerId, $taxYear, $periodEnding, $accept, $contentType); + return $response; + } + + /** + * Operation bankPaymentHmrcPaymentWithHttpInfo + * + * HMRC Bank Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function bankPaymentHmrcPaymentWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['bankPaymentHmrcPayment'][0] + ): array + { + $request = $this->bankPaymentHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation bankPaymentHmrcPaymentAsync + * + * HMRC Bank Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function bankPaymentHmrcPaymentAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['bankPaymentHmrcPayment'][0] + ): PromiseInterface + { + return $this->bankPaymentHmrcPaymentAsyncWithHttpInfo($employerId, $taxYear, $periodEnding, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation bankPaymentHmrcPaymentAsyncWithHttpInfo + * + * HMRC Bank Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function bankPaymentHmrcPaymentAsyncWithHttpInfo( + $employerId, + $taxYear, + $periodEnding, + $accept = null, + string $contentType = self::contentTypes['bankPaymentHmrcPayment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse'; + $request = $this->bankPaymentHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'bankPaymentHmrcPayment' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bankPaymentHmrcPaymentRequest( + $employerId, + $taxYear, + $periodEnding, + $accept = null, + string $contentType = self::contentTypes['bankPaymentHmrcPayment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling bankPaymentHmrcPayment' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling bankPaymentHmrcPayment' + ); + } + + // verify the required parameter 'periodEnding' is set + if ($periodEnding === null || (is_array($periodEnding) && count($periodEnding) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodEnding when calling bankPaymentHmrcPayment' + ); + } + + + + $resourcePath = '/employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}/bankpayment'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodEnding !== null) { + $resourcePath = str_replace( + '{' . 'periodEnding' . '}', + ObjectSerializer::toPathValue($periodEnding), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getHmrcPayment + * + * Get HmrcLiability + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\HmrcLiability + */ + public function getHmrcPayment( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + string $contentType = self::contentTypes['getHmrcPayment'][0] + ): \SynergiTech\Staffology\Model\HmrcLiability + { + list($response) = $this->getHmrcPaymentWithHttpInfo($employerId, $taxYear, $periodEnding, $contentType); + return $response; + } + + /** + * Operation getHmrcPaymentWithHttpInfo + * + * Get HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\HmrcLiability, HTTP status code, HTTP response headers (array of strings) + */ + public function getHmrcPaymentWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + string $contentType = self::contentTypes['getHmrcPayment'][0] + ): array + { + $request = $this->getHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\HmrcLiability', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\HmrcLiability' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\HmrcLiability', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\HmrcLiability'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\HmrcLiability', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getHmrcPaymentAsync + * + * Get HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getHmrcPaymentAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + string $contentType = self::contentTypes['getHmrcPayment'][0] + ): PromiseInterface + { + return $this->getHmrcPaymentAsyncWithHttpInfo($employerId, $taxYear, $periodEnding, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getHmrcPaymentAsyncWithHttpInfo + * + * Get HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getHmrcPaymentAsyncWithHttpInfo( + $employerId, + $taxYear, + $periodEnding, + string $contentType = self::contentTypes['getHmrcPayment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\HmrcLiability'; + $request = $this->getHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getHmrcPayment' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getHmrcPaymentRequest( + $employerId, + $taxYear, + $periodEnding, + string $contentType = self::contentTypes['getHmrcPayment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getHmrcPayment' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getHmrcPayment' + ); + } + + // verify the required parameter 'periodEnding' is set + if ($periodEnding === null || (is_array($periodEnding) && count($periodEnding) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodEnding when calling getHmrcPayment' + ); + } + + + $resourcePath = '/employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodEnding !== null) { + $resourcePath = str_replace( + '{' . 'periodEnding' . '}', + ObjectSerializer::toPathValue($periodEnding), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexHmrcPayment + * + * List HmrcLiabilities + * + * @param string $employerId The Id of the Employer for which you want to list HMRC Payments (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexHmrcPayment( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['indexHmrcPayment'][0] + ): array + { + list($response) = $this->indexHmrcPaymentWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation indexHmrcPaymentWithHttpInfo + * + * List HmrcLiabilities + * + * @param string $employerId The Id of the Employer for which you want to list HMRC Payments (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexHmrcPaymentWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['indexHmrcPayment'][0] + ): array + { + $request = $this->indexHmrcPaymentRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexHmrcPaymentAsync + * + * List HmrcLiabilities + * + * @param string $employerId The Id of the Employer for which you want to list HMRC Payments (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexHmrcPaymentAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['indexHmrcPayment'][0] + ): PromiseInterface + { + return $this->indexHmrcPaymentAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexHmrcPaymentAsyncWithHttpInfo + * + * List HmrcLiabilities + * + * @param string $employerId The Id of the Employer for which you want to list HMRC Payments (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexHmrcPaymentAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['indexHmrcPayment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexHmrcPaymentRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexHmrcPayment' + * + * @param string $employerId The Id of the Employer for which you want to list HMRC Payments (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexHmrcPaymentRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['indexHmrcPayment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexHmrcPayment' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling indexHmrcPayment' + ); + } + + + $resourcePath = '/employers/{employerId}/hmrcpayment/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateHmrcPayment + * + * Update HmrcLiability + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param \SynergiTech\Staffology\Model\HmrcLiability|null $hmrcLiability hmrcLiability (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\HmrcLiability + */ + public function updateHmrcPayment( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?\SynergiTech\Staffology\Model\HmrcLiability $hmrcLiability = null, + string $contentType = self::contentTypes['updateHmrcPayment'][0] + ): \SynergiTech\Staffology\Model\HmrcLiability + { + list($response) = $this->updateHmrcPaymentWithHttpInfo($employerId, $taxYear, $periodEnding, $hmrcLiability, $contentType); + return $response; + } + + /** + * Operation updateHmrcPaymentWithHttpInfo + * + * Update HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param \SynergiTech\Staffology\Model\HmrcLiability|null $hmrcLiability (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHmrcPayment'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\HmrcLiability, HTTP status code, HTTP response headers (array of strings) + */ + public function updateHmrcPaymentWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?\SynergiTech\Staffology\Model\HmrcLiability $hmrcLiability = null, + string $contentType = self::contentTypes['updateHmrcPayment'][0] + ): array + { + $request = $this->updateHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $hmrcLiability, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\HmrcLiability', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\HmrcLiability' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\HmrcLiability', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\HmrcLiability'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\HmrcLiability', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateHmrcPaymentAsync + * + * Update HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param \SynergiTech\Staffology\Model\HmrcLiability|null $hmrcLiability (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateHmrcPaymentAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?\SynergiTech\Staffology\Model\HmrcLiability $hmrcLiability = null, + string $contentType = self::contentTypes['updateHmrcPayment'][0] + ): PromiseInterface + { + return $this->updateHmrcPaymentAsyncWithHttpInfo($employerId, $taxYear, $periodEnding, $hmrcLiability, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateHmrcPaymentAsyncWithHttpInfo + * + * Update HmrcLiability + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param \SynergiTech\Staffology\Model\HmrcLiability|null $hmrcLiability (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateHmrcPaymentAsyncWithHttpInfo( + $employerId, + $taxYear, + $periodEnding, + $hmrcLiability = null, + string $contentType = self::contentTypes['updateHmrcPayment'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\HmrcLiability'; + $request = $this->updateHmrcPaymentRequest($employerId, $taxYear, $periodEnding, $hmrcLiability, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateHmrcPayment' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding The final date of the month or quarter that the HmrcLiability is for. (required) + * @param \SynergiTech\Staffology\Model\HmrcLiability|null $hmrcLiability (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHmrcPayment'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateHmrcPaymentRequest( + $employerId, + $taxYear, + $periodEnding, + $hmrcLiability = null, + string $contentType = self::contentTypes['updateHmrcPayment'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateHmrcPayment' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateHmrcPayment' + ); + } + + // verify the required parameter 'periodEnding' is set + if ($periodEnding === null || (is_array($periodEnding) && count($periodEnding) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodEnding when calling updateHmrcPayment' + ); + } + + + + $resourcePath = '/employers/{employerId}/hmrcpayment/{taxYear}/{periodEnding}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodEnding !== null) { + $resourcePath = str_replace( + '{' . 'periodEnding' . '}', + ObjectSerializer::toPathValue($periodEnding), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($hmrcLiability)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($hmrcLiability)); + } else { + $httpBody = $hmrcLiability; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/HolidaySchemeApi.php b/src/Api/HolidaySchemeApi.php new file mode 100644 index 0000000..584b00d --- /dev/null +++ b/src/Api/HolidaySchemeApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteHolidayScheme' => [ + 'application/json', + ], + 'getByIdHolidayScheme' => [ + 'application/json', + ], + 'getHolidayScheme' => [ + 'application/json', + ], + 'updateHolidayScheme' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createHolidayScheme + * + * Create holiday scheme + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + */ + public function createHolidayScheme( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['createHolidayScheme'][0] + ): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + { + list($response) = $this->createHolidaySchemeWithHttpInfo($employerId, $contractHolidaySchemeRequest, $contentType); + return $response; + } + + /** + * Operation createHolidaySchemeWithHttpInfo + * + * Create holiday scheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createHolidaySchemeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['createHolidayScheme'][0] + ): array + { + $request = $this->createHolidaySchemeRequest($employerId, $contractHolidaySchemeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createHolidaySchemeAsync + * + * Create holiday scheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createHolidaySchemeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['createHolidayScheme'][0] + ): PromiseInterface + { + return $this->createHolidaySchemeAsyncWithHttpInfo($employerId, $contractHolidaySchemeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createHolidaySchemeAsyncWithHttpInfo + * + * Create holiday scheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createHolidaySchemeAsyncWithHttpInfo( + $employerId, + $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['createHolidayScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + $request = $this->createHolidaySchemeRequest($employerId, $contractHolidaySchemeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createHolidayScheme' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createHolidaySchemeRequest( + $employerId, + $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['createHolidayScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createHolidayScheme' + ); + } + + + + $resourcePath = '/employers/{employerId}/holidayscheme'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractHolidaySchemeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractHolidaySchemeRequest)); + } else { + $httpBody = $contractHolidaySchemeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteHolidayScheme + * + * Delete holiday scheme + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteHolidayScheme( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteHolidayScheme'][0] + ): void + { + $this->deleteHolidaySchemeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteHolidaySchemeWithHttpInfo + * + * Delete holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteHolidaySchemeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteHolidayScheme'][0] + ): array + { + $request = $this->deleteHolidaySchemeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteHolidaySchemeAsync + * + * Delete holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteHolidaySchemeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteHolidayScheme'][0] + ): PromiseInterface + { + return $this->deleteHolidaySchemeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteHolidaySchemeAsyncWithHttpInfo + * + * Delete holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteHolidaySchemeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteHolidayScheme'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteHolidaySchemeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteHolidayScheme' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteHolidaySchemeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteHolidayScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteHolidayScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteHolidayScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/holidayscheme/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getByIdHolidayScheme + * + * Get holiday scheme by Id + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByIdHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + */ + public function getByIdHolidayScheme( + string $employerId, + string $id, + string $contentType = self::contentTypes['getByIdHolidayScheme'][0] + ): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + { + list($response) = $this->getByIdHolidaySchemeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getByIdHolidaySchemeWithHttpInfo + * + * Get holiday scheme by Id + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByIdHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getByIdHolidaySchemeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getByIdHolidayScheme'][0] + ): array + { + $request = $this->getByIdHolidaySchemeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getByIdHolidaySchemeAsync + * + * Get holiday scheme by Id + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByIdHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByIdHolidaySchemeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getByIdHolidayScheme'][0] + ): PromiseInterface + { + return $this->getByIdHolidaySchemeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getByIdHolidaySchemeAsyncWithHttpInfo + * + * Get holiday scheme by Id + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByIdHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getByIdHolidaySchemeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getByIdHolidayScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + $request = $this->getByIdHolidaySchemeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getByIdHolidayScheme' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getByIdHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getByIdHolidaySchemeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getByIdHolidayScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getByIdHolidayScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getByIdHolidayScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/holidayscheme/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getHolidayScheme + * + * Get holiday scheme + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[] + */ + public function getHolidayScheme( + string $employerId, + string $contentType = self::contentTypes['getHolidayScheme'][0] + ): array + { + list($response) = $this->getHolidaySchemeWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getHolidaySchemeWithHttpInfo + * + * Get holiday scheme + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getHolidaySchemeWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getHolidayScheme'][0] + ): array + { + $request = $this->getHolidaySchemeRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getHolidaySchemeAsync + * + * Get holiday scheme + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getHolidaySchemeAsync( + string $employerId, + string $contentType = self::contentTypes['getHolidayScheme'][0] + ): PromiseInterface + { + return $this->getHolidaySchemeAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getHolidaySchemeAsyncWithHttpInfo + * + * Get holiday scheme + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getHolidaySchemeAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getHolidayScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse[]'; + $request = $this->getHolidaySchemeRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getHolidayScheme' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getHolidaySchemeRequest( + $employerId, + string $contentType = self::contentTypes['getHolidayScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getHolidayScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/holidayscheme'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateHolidayScheme + * + * Update holiday scheme + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + */ + public function updateHolidayScheme( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['updateHolidayScheme'][0] + ): \SynergiTech\Staffology\Model\ContractHolidaySchemeResponse + { + list($response) = $this->updateHolidaySchemeWithHttpInfo($employerId, $id, $contractHolidaySchemeRequest, $contentType); + return $response; + } + + /** + * Operation updateHolidaySchemeWithHttpInfo + * + * Update holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHolidayScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateHolidaySchemeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['updateHolidayScheme'][0] + ): array + { + $request = $this->updateHolidaySchemeRequest($employerId, $id, $contractHolidaySchemeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateHolidaySchemeAsync + * + * Update holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateHolidaySchemeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractHolidaySchemeRequest $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['updateHolidayScheme'][0] + ): PromiseInterface + { + return $this->updateHolidaySchemeAsyncWithHttpInfo($employerId, $id, $contractHolidaySchemeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateHolidaySchemeAsyncWithHttpInfo + * + * Update holiday scheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateHolidaySchemeAsyncWithHttpInfo( + $employerId, + $id, + $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['updateHolidayScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractHolidaySchemeResponse'; + $request = $this->updateHolidaySchemeRequest($employerId, $id, $contractHolidaySchemeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateHolidayScheme' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractHolidaySchemeRequest|null $contractHolidaySchemeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateHolidayScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateHolidaySchemeRequest( + $employerId, + $id, + $contractHolidaySchemeRequest = null, + string $contentType = self::contentTypes['updateHolidayScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateHolidayScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateHolidayScheme' + ); + } + + + + $resourcePath = '/employers/{employerId}/holidayscheme/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractHolidaySchemeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractHolidaySchemeRequest)); + } else { + $httpBody = $contractHolidaySchemeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ImportApi.php b/src/Api/ImportApi.php new file mode 100644 index 0000000..e10cbab --- /dev/null +++ b/src/Api/ImportApi.php @@ -0,0 +1,3957 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePaymentCsvMappingImport' => [ + 'application/json', + ], + 'employeeImportCsvImport' => [ + 'multipart/form-data', + ], + 'importEmployeePayImport' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'importLeaveImport' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'importPensionMembershipsImport' => [ + 'multipart/form-data', + ], + 'importRolesImport' => [ + 'multipart/form-data', + ], + 'listPaymentsCsvMappingsImport' => [ + 'application/json', + ], + 'paymentsCsvMappingCsvFileImport' => [ + 'application/json', + ], + 'paymentsCsvMappingImport' => [ + 'application/json', + ], + 'updatePaymentsCsvMappingImport' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPaymentsCsvMappingImport + * + * Create PaymentsCsvMapping + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createPaymentsCsvMappingImport( + string $employerId, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['createPaymentsCsvMappingImport'][0] + ): void + { + $this->createPaymentsCsvMappingImportWithHttpInfo($employerId, $paymentsCsvMapping, $contentType); + } + + /** + * Operation createPaymentsCsvMappingImportWithHttpInfo + * + * Create PaymentsCsvMapping + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createPaymentsCsvMappingImportWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['createPaymentsCsvMappingImport'][0] + ): array + { + $request = $this->createPaymentsCsvMappingImportRequest($employerId, $paymentsCsvMapping, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createPaymentsCsvMappingImportAsync + * + * Create PaymentsCsvMapping + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaymentsCsvMappingImportAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['createPaymentsCsvMappingImport'][0] + ): PromiseInterface + { + return $this->createPaymentsCsvMappingImportAsyncWithHttpInfo($employerId, $paymentsCsvMapping, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPaymentsCsvMappingImportAsyncWithHttpInfo + * + * Create PaymentsCsvMapping + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaymentsCsvMappingImportAsyncWithHttpInfo( + $employerId, + $paymentsCsvMapping = null, + string $contentType = self::contentTypes['createPaymentsCsvMappingImport'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createPaymentsCsvMappingImportRequest($employerId, $paymentsCsvMapping, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPaymentsCsvMappingImport' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPaymentsCsvMappingImportRequest( + $employerId, + $paymentsCsvMapping = null, + string $contentType = self::contentTypes['createPaymentsCsvMappingImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPaymentsCsvMappingImport' + ); + } + + + + $resourcePath = '/employers/{employerId}/import/payments/mappings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paymentsCsvMapping)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paymentsCsvMapping)); + } else { + $httpBody = $paymentsCsvMapping; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePaymentCsvMappingImport + * + * Delete PaymentsCsvMapping + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePaymentCsvMappingImport( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaymentCsvMappingImport'][0] + ): void + { + $this->deletePaymentCsvMappingImportWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePaymentCsvMappingImportWithHttpInfo + * + * Delete PaymentsCsvMapping + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePaymentCsvMappingImportWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaymentCsvMappingImport'][0] + ): array + { + $request = $this->deletePaymentCsvMappingImportRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePaymentCsvMappingImportAsync + * + * Delete PaymentsCsvMapping + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaymentCsvMappingImportAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaymentCsvMappingImport'][0] + ): PromiseInterface + { + return $this->deletePaymentCsvMappingImportAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePaymentCsvMappingImportAsyncWithHttpInfo + * + * Delete PaymentsCsvMapping + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaymentCsvMappingImportAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePaymentCsvMappingImport'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePaymentCsvMappingImportRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePaymentCsvMappingImport' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaymentCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePaymentCsvMappingImportRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePaymentCsvMappingImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePaymentCsvMappingImport' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePaymentCsvMappingImport' + ); + } + + + $resourcePath = '/employers/{employerId}/import/payments/mappings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeImportCsvImport + * + * Import Employees Asynchronously (Beta) + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The CSV format. (optional) + * @param bool|null $allowUpdates If set to true, and if the payroll code matches an existing employee, then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeImportCsvImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse + */ + public function employeeImportCsvImport( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['employeeImportCsvImport'][0] + ): \SynergiTech\Staffology\Model\ContractJobResponse + { + list($response) = $this->employeeImportCsvImportWithHttpInfo($employerId, $format, $allowUpdates, $file, $contentType); + return $response; + } + + /** + * Operation employeeImportCsvImportWithHttpInfo + * + * Import Employees Asynchronously (Beta) + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The CSV format. (optional) + * @param bool|null $allowUpdates If set to true, and if the payroll code matches an existing employee, then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeImportCsvImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeImportCsvImportWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['employeeImportCsvImport'][0] + ): array + { + $request = $this->employeeImportCsvImportRequest($employerId, $format, $allowUpdates, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeImportCsvImportAsync + * + * Import Employees Asynchronously (Beta) + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The CSV format. (optional) + * @param bool|null $allowUpdates If set to true, and if the payroll code matches an existing employee, then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeImportCsvImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeImportCsvImportAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\CsvFileFormat $format = null, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['employeeImportCsvImport'][0] + ): PromiseInterface + { + return $this->employeeImportCsvImportAsyncWithHttpInfo($employerId, $format, $allowUpdates, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeImportCsvImportAsyncWithHttpInfo + * + * Import Employees Asynchronously (Beta) + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The CSV format. (optional) + * @param bool|null $allowUpdates If set to true, and if the payroll code matches an existing employee, then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeImportCsvImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeImportCsvImportAsyncWithHttpInfo( + $employerId, + $format = null, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['employeeImportCsvImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + $request = $this->employeeImportCsvImportRequest($employerId, $format, $allowUpdates, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeImportCsvImport' + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\CsvFileFormat|null $format The CSV format. (optional) + * @param bool|null $allowUpdates If set to true, and if the payroll code matches an existing employee, then that employee will be updated. (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeImportCsvImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeImportCsvImportRequest( + $employerId, + $format = null, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['employeeImportCsvImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeeImportCsvImport' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/import/employees/async'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'CsvFileFormat', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allowUpdates, + 'allowUpdates', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importEmployeePayImport + * + * Import Pay To Employee + * + * @param string $employerId employerId (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeePayImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function importEmployeePayImport( + string $employerId, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importEmployeePayImport'][0] + ): void + { + $this->importEmployeePayImportWithHttpInfo($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + } + + /** + * Operation importEmployeePayImportWithHttpInfo + * + * Import Pay To Employee + * + * @param string $employerId (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeePayImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function importEmployeePayImportWithHttpInfo( + string $employerId, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importEmployeePayImport'][0] + ): array + { + $request = $this->importEmployeePayImportRequest($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation importEmployeePayImportAsync + * + * Import Pay To Employee + * + * @param string $employerId (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeePayImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importEmployeePayImportAsync( + string $employerId, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importEmployeePayImport'][0] + ): PromiseInterface + { + return $this->importEmployeePayImportAsyncWithHttpInfo($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importEmployeePayImportAsyncWithHttpInfo + * + * Import Pay To Employee + * + * @param string $employerId (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeePayImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importEmployeePayImportAsyncWithHttpInfo( + $employerId, + $linesOnly = false, + $append = false, + $updateExisting = false, + $validateOnly = false, + $payOptionsImport = null, + string $contentType = self::contentTypes['importEmployeePayImport'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->importEmployeePayImportRequest($employerId, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importEmployeePayImport' + * + * @param string $employerId (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the paycode of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importEmployeePayImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importEmployeePayImportRequest( + $employerId, + $linesOnly = false, + $append = false, + $updateExisting = false, + $validateOnly = false, + $payOptionsImport = null, + string $contentType = self::contentTypes['importEmployeePayImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importEmployeePayImport' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/import/pay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $linesOnly, + 'linesOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $append, + 'append', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updateExisting, + 'updateExisting', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $validateOnly, + 'validateOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payOptionsImport)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payOptionsImport)); + } else { + $httpBody = $payOptionsImport; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importLeaveImport + * + * Import Leave Asynchronously + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\ContractLeaveImportRequest[]|null $contractLeaveImportRequest The import leave items. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importLeaveImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse + */ + public function importLeaveImport( + string $employerId, + ?array $contractLeaveImportRequest = null, + string $contentType = self::contentTypes['importLeaveImport'][0] + ): \SynergiTech\Staffology\Model\ContractJobResponse + { + list($response) = $this->importLeaveImportWithHttpInfo($employerId, $contractLeaveImportRequest, $contentType); + return $response; + } + + /** + * Operation importLeaveImportWithHttpInfo + * + * Import Leave Asynchronously + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\ContractLeaveImportRequest[]|null $contractLeaveImportRequest The import leave items. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importLeaveImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function importLeaveImportWithHttpInfo( + string $employerId, + ?array $contractLeaveImportRequest = null, + string $contentType = self::contentTypes['importLeaveImport'][0] + ): array + { + $request = $this->importLeaveImportRequest($employerId, $contractLeaveImportRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importLeaveImportAsync + * + * Import Leave Asynchronously + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\ContractLeaveImportRequest[]|null $contractLeaveImportRequest The import leave items. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importLeaveImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importLeaveImportAsync( + string $employerId, + ?array $contractLeaveImportRequest = null, + string $contentType = self::contentTypes['importLeaveImport'][0] + ): PromiseInterface + { + return $this->importLeaveImportAsyncWithHttpInfo($employerId, $contractLeaveImportRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importLeaveImportAsyncWithHttpInfo + * + * Import Leave Asynchronously + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\ContractLeaveImportRequest[]|null $contractLeaveImportRequest The import leave items. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importLeaveImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importLeaveImportAsyncWithHttpInfo( + $employerId, + $contractLeaveImportRequest = null, + string $contentType = self::contentTypes['importLeaveImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + $request = $this->importLeaveImportRequest($employerId, $contractLeaveImportRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importLeaveImport' + * + * @param string $employerId The employer id. (required) + * @param \SynergiTech\Staffology\Model\ContractLeaveImportRequest[]|null $contractLeaveImportRequest The import leave items. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importLeaveImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importLeaveImportRequest( + $employerId, + $contractLeaveImportRequest = null, + string $contentType = self::contentTypes['importLeaveImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importLeaveImport' + ); + } + + + + $resourcePath = '/employers/{employerId}/import/leave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractLeaveImportRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractLeaveImportRequest)); + } else { + $httpBody = $contractLeaveImportRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importPensionMembershipsImport + * + * Import PensionMemberships from csv file + * + * @param string $employerId employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates allowUpdates (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPensionMembershipsImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importPensionMembershipsImport( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPensionMembershipsImport'][0] + ): array + { + list($response) = $this->importPensionMembershipsImportWithHttpInfo($employerId, $previewOnly, $allowUpdates, $file, $contentType); + return $response; + } + + /** + * Operation importPensionMembershipsImportWithHttpInfo + * + * Import PensionMemberships from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPensionMembershipsImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importPensionMembershipsImportWithHttpInfo( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPensionMembershipsImport'][0] + ): array + { + $request = $this->importPensionMembershipsImportRequest($employerId, $previewOnly, $allowUpdates, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importPensionMembershipsImportAsync + * + * Import PensionMemberships from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPensionMembershipsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPensionMembershipsImportAsync( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPensionMembershipsImport'][0] + ): PromiseInterface + { + return $this->importPensionMembershipsImportAsyncWithHttpInfo($employerId, $previewOnly, $allowUpdates, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importPensionMembershipsImportAsyncWithHttpInfo + * + * Import PensionMemberships from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPensionMembershipsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPensionMembershipsImportAsyncWithHttpInfo( + $employerId, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importPensionMembershipsImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importPensionMembershipsImportRequest($employerId, $previewOnly, $allowUpdates, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importPensionMembershipsImport' + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPensionMembershipsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importPensionMembershipsImportRequest( + $employerId, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importPensionMembershipsImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importPensionMembershipsImport' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/import/pensionmemberships'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $previewOnly, + 'previewOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allowUpdates, + 'allowUpdates', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importRolesImport + * + * Import EmployeeRoles from csv file + * + * @param string $employerId employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates allowUpdates (optional, default to false) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importRolesImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importRolesImport( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importRolesImport'][0] + ): array + { + list($response) = $this->importRolesImportWithHttpInfo($employerId, $previewOnly, $allowUpdates, $file, $contentType); + return $response; + } + + /** + * Operation importRolesImportWithHttpInfo + * + * Import EmployeeRoles from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importRolesImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importRolesImportWithHttpInfo( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importRolesImport'][0] + ): array + { + $request = $this->importRolesImportRequest($employerId, $previewOnly, $allowUpdates, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importRolesImportAsync + * + * Import EmployeeRoles from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importRolesImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importRolesImportAsync( + string $employerId, + ?bool $previewOnly = false, + ?bool $allowUpdates = false, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importRolesImport'][0] + ): PromiseInterface + { + return $this->importRolesImportAsyncWithHttpInfo($employerId, $previewOnly, $allowUpdates, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importRolesImportAsyncWithHttpInfo + * + * Import EmployeeRoles from csv file + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importRolesImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importRolesImportAsyncWithHttpInfo( + $employerId, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importRolesImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importRolesImportRequest($employerId, $previewOnly, $allowUpdates, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importRolesImport' + * + * @param string $employerId (required) + * @param bool|null $previewOnly Set to true and nothing will be imported but you'll be shown a preview of the data. (optional, default to false) + * @param bool|null $allowUpdates (optional, default to false) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importRolesImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importRolesImportRequest( + $employerId, + $previewOnly = false, + $allowUpdates = false, + $file = null, + string $contentType = self::contentTypes['importRolesImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importRolesImport' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/import/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $previewOnly, + 'previewOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allowUpdates, + 'allowUpdates', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listPaymentsCsvMappingsImport + * + * List PaymentsCsvMappings + * + * @param string $employerId The Id of the Employer for which you want to list mappings (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPaymentsCsvMappingsImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listPaymentsCsvMappingsImport( + string $employerId, + string $contentType = self::contentTypes['listPaymentsCsvMappingsImport'][0] + ): array + { + list($response) = $this->listPaymentsCsvMappingsImportWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation listPaymentsCsvMappingsImportWithHttpInfo + * + * List PaymentsCsvMappings + * + * @param string $employerId The Id of the Employer for which you want to list mappings (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPaymentsCsvMappingsImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listPaymentsCsvMappingsImportWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['listPaymentsCsvMappingsImport'][0] + ): array + { + $request = $this->listPaymentsCsvMappingsImportRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listPaymentsCsvMappingsImportAsync + * + * List PaymentsCsvMappings + * + * @param string $employerId The Id of the Employer for which you want to list mappings (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPaymentsCsvMappingsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPaymentsCsvMappingsImportAsync( + string $employerId, + string $contentType = self::contentTypes['listPaymentsCsvMappingsImport'][0] + ): PromiseInterface + { + return $this->listPaymentsCsvMappingsImportAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listPaymentsCsvMappingsImportAsyncWithHttpInfo + * + * List PaymentsCsvMappings + * + * @param string $employerId The Id of the Employer for which you want to list mappings (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPaymentsCsvMappingsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPaymentsCsvMappingsImportAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['listPaymentsCsvMappingsImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listPaymentsCsvMappingsImportRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listPaymentsCsvMappingsImport' + * + * @param string $employerId The Id of the Employer for which you want to list mappings (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPaymentsCsvMappingsImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listPaymentsCsvMappingsImportRequest( + $employerId, + string $contentType = self::contentTypes['listPaymentsCsvMappingsImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listPaymentsCsvMappingsImport' + ); + } + + + $resourcePath = '/employers/{employerId}/import/payments/mappings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation paymentsCsvMappingCsvFileImport + * + * Get PaymentsCsvMapping CSV File + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingCsvFileImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function paymentsCsvMappingCsvFileImport( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingCsvFileImport'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->paymentsCsvMappingCsvFileImportWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation paymentsCsvMappingCsvFileImportWithHttpInfo + * + * Get PaymentsCsvMapping CSV File + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingCsvFileImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function paymentsCsvMappingCsvFileImportWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingCsvFileImport'][0] + ): array + { + $request = $this->paymentsCsvMappingCsvFileImportRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation paymentsCsvMappingCsvFileImportAsync + * + * Get PaymentsCsvMapping CSV File + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingCsvFileImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsCsvMappingCsvFileImportAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingCsvFileImport'][0] + ): PromiseInterface + { + return $this->paymentsCsvMappingCsvFileImportAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation paymentsCsvMappingCsvFileImportAsyncWithHttpInfo + * + * Get PaymentsCsvMapping CSV File + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingCsvFileImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsCsvMappingCsvFileImportAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['paymentsCsvMappingCsvFileImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->paymentsCsvMappingCsvFileImportRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'paymentsCsvMappingCsvFileImport' + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingCsvFileImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function paymentsCsvMappingCsvFileImportRequest( + $employerId, + $id, + string $contentType = self::contentTypes['paymentsCsvMappingCsvFileImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling paymentsCsvMappingCsvFileImport' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling paymentsCsvMappingCsvFileImport' + ); + } + + + $resourcePath = '/employers/{employerId}/import/payments/mappings/{id}/csv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation paymentsCsvMappingImport + * + * Get PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaymentsCsvMapping + */ + public function paymentsCsvMappingImport( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingImport'][0] + ): \SynergiTech\Staffology\Model\PaymentsCsvMapping + { + list($response) = $this->paymentsCsvMappingImportWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation paymentsCsvMappingImportWithHttpInfo + * + * Get PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaymentsCsvMapping, HTTP status code, HTTP response headers (array of strings) + */ + public function paymentsCsvMappingImportWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingImport'][0] + ): array + { + $request = $this->paymentsCsvMappingImportRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaymentsCsvMapping', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaymentsCsvMapping' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaymentsCsvMapping', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaymentsCsvMapping'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaymentsCsvMapping', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation paymentsCsvMappingImportAsync + * + * Get PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsCsvMappingImportAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['paymentsCsvMappingImport'][0] + ): PromiseInterface + { + return $this->paymentsCsvMappingImportAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation paymentsCsvMappingImportAsyncWithHttpInfo + * + * Get PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paymentsCsvMappingImportAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['paymentsCsvMappingImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaymentsCsvMapping'; + $request = $this->paymentsCsvMappingImportRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'paymentsCsvMappingImport' + * + * @param string $employerId The Id of the Employer to which the PaymentCsvMapping belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function paymentsCsvMappingImportRequest( + $employerId, + $id, + string $contentType = self::contentTypes['paymentsCsvMappingImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling paymentsCsvMappingImport' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling paymentsCsvMappingImport' + ); + } + + + $resourcePath = '/employers/{employerId}/import/payments/mappings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePaymentsCsvMappingImport + * + * Update PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentsCsvMapping belongs. (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaymentsCsvMapping + */ + public function updatePaymentsCsvMappingImport( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['updatePaymentsCsvMappingImport'][0] + ): \SynergiTech\Staffology\Model\PaymentsCsvMapping + { + list($response) = $this->updatePaymentsCsvMappingImportWithHttpInfo($employerId, $id, $paymentsCsvMapping, $contentType); + return $response; + } + + /** + * Operation updatePaymentsCsvMappingImportWithHttpInfo + * + * Update PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentsCsvMapping belongs. (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaymentsCsvMapping, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePaymentsCsvMappingImportWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['updatePaymentsCsvMappingImport'][0] + ): array + { + $request = $this->updatePaymentsCsvMappingImportRequest($employerId, $id, $paymentsCsvMapping, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaymentsCsvMapping', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaymentsCsvMapping' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaymentsCsvMapping', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaymentsCsvMapping'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaymentsCsvMapping', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePaymentsCsvMappingImportAsync + * + * Update PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentsCsvMapping belongs. (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaymentsCsvMappingImportAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PaymentsCsvMapping $paymentsCsvMapping = null, + string $contentType = self::contentTypes['updatePaymentsCsvMappingImport'][0] + ): PromiseInterface + { + return $this->updatePaymentsCsvMappingImportAsyncWithHttpInfo($employerId, $id, $paymentsCsvMapping, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePaymentsCsvMappingImportAsyncWithHttpInfo + * + * Update PaymentsCsvMapping + * + * @param string $employerId The Id of the Employer to which the PaymentsCsvMapping belongs. (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaymentsCsvMappingImportAsyncWithHttpInfo( + $employerId, + $id, + $paymentsCsvMapping = null, + string $contentType = self::contentTypes['updatePaymentsCsvMappingImport'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaymentsCsvMapping'; + $request = $this->updatePaymentsCsvMappingImportRequest($employerId, $id, $paymentsCsvMapping, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePaymentsCsvMappingImport' + * + * @param string $employerId The Id of the Employer to which the PaymentsCsvMapping belongs. (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PaymentsCsvMapping|null $paymentsCsvMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentsCsvMappingImport'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePaymentsCsvMappingImportRequest( + $employerId, + $id, + $paymentsCsvMapping = null, + string $contentType = self::contentTypes['updatePaymentsCsvMappingImport'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePaymentsCsvMappingImport' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePaymentsCsvMappingImport' + ); + } + + + + $resourcePath = '/employers/{employerId}/import/payments/mappings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paymentsCsvMapping)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paymentsCsvMapping)); + } else { + $httpBody = $paymentsCsvMapping; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/InvitationApi.php b/src/Api/InvitationApi.php new file mode 100644 index 0000000..c40ba89 --- /dev/null +++ b/src/Api/InvitationApi.php @@ -0,0 +1,1720 @@ + [ + 'application/json', + ], + 'createInvitation' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteInvitation' => [ + 'application/json', + ], + 'getInvitation' => [ + 'application/json', + ], + 'indexInvitation' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation acceptInvitation + * + * Accept Invitation + * + * @param string $id id (required) + * @param bool|null $acceptInvitation Set to true to accept the invitation or false to decline it. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function acceptInvitation( + string $id, + ?bool $acceptInvitation = null, + string $contentType = self::contentTypes['acceptInvitation'][0] + ): void + { + $this->acceptInvitationWithHttpInfo($id, $acceptInvitation, $contentType); + } + + /** + * Operation acceptInvitationWithHttpInfo + * + * Accept Invitation + * + * @param string $id (required) + * @param bool|null $acceptInvitation Set to true to accept the invitation or false to decline it. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function acceptInvitationWithHttpInfo( + string $id, + ?bool $acceptInvitation = null, + string $contentType = self::contentTypes['acceptInvitation'][0] + ): array + { + $request = $this->acceptInvitationRequest($id, $acceptInvitation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation acceptInvitationAsync + * + * Accept Invitation + * + * @param string $id (required) + * @param bool|null $acceptInvitation Set to true to accept the invitation or false to decline it. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function acceptInvitationAsync( + string $id, + ?bool $acceptInvitation = null, + string $contentType = self::contentTypes['acceptInvitation'][0] + ): PromiseInterface + { + return $this->acceptInvitationAsyncWithHttpInfo($id, $acceptInvitation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation acceptInvitationAsyncWithHttpInfo + * + * Accept Invitation + * + * @param string $id (required) + * @param bool|null $acceptInvitation Set to true to accept the invitation or false to decline it. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function acceptInvitationAsyncWithHttpInfo( + $id, + $acceptInvitation = null, + string $contentType = self::contentTypes['acceptInvitation'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->acceptInvitationRequest($id, $acceptInvitation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'acceptInvitation' + * + * @param string $id (required) + * @param bool|null $acceptInvitation Set to true to accept the invitation or false to decline it. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function acceptInvitationRequest( + $id, + $acceptInvitation = null, + string $contentType = self::contentTypes['acceptInvitation'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling acceptInvitation' + ); + } + + + + $resourcePath = '/invitations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $acceptInvitation, + 'acceptInvitation', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createInvitation + * + * Create Invitation + * + * @param string $employerId employerId (required) + * @param bool|null $autoAccept This is useful for when you want to invite a user to an employer and automatically accept the invitation. (optional) + * @param \SynergiTech\Staffology\Model\Invitation|null $invitation invitation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Invitation + */ + public function createInvitation( + string $employerId, + ?bool $autoAccept = null, + ?\SynergiTech\Staffology\Model\Invitation $invitation = null, + string $contentType = self::contentTypes['createInvitation'][0] + ): \SynergiTech\Staffology\Model\Invitation + { + list($response) = $this->createInvitationWithHttpInfo($employerId, $autoAccept, $invitation, $contentType); + return $response; + } + + /** + * Operation createInvitationWithHttpInfo + * + * Create Invitation + * + * @param string $employerId (required) + * @param bool|null $autoAccept This is useful for when you want to invite a user to an employer and automatically accept the invitation. (optional) + * @param \SynergiTech\Staffology\Model\Invitation|null $invitation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Invitation, HTTP status code, HTTP response headers (array of strings) + */ + public function createInvitationWithHttpInfo( + string $employerId, + ?bool $autoAccept = null, + ?\SynergiTech\Staffology\Model\Invitation $invitation = null, + string $contentType = self::contentTypes['createInvitation'][0] + ): array + { + $request = $this->createInvitationRequest($employerId, $autoAccept, $invitation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Invitation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Invitation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Invitation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Invitation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Invitation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createInvitationAsync + * + * Create Invitation + * + * @param string $employerId (required) + * @param bool|null $autoAccept This is useful for when you want to invite a user to an employer and automatically accept the invitation. (optional) + * @param \SynergiTech\Staffology\Model\Invitation|null $invitation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createInvitationAsync( + string $employerId, + ?bool $autoAccept = null, + ?\SynergiTech\Staffology\Model\Invitation $invitation = null, + string $contentType = self::contentTypes['createInvitation'][0] + ): PromiseInterface + { + return $this->createInvitationAsyncWithHttpInfo($employerId, $autoAccept, $invitation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createInvitationAsyncWithHttpInfo + * + * Create Invitation + * + * @param string $employerId (required) + * @param bool|null $autoAccept This is useful for when you want to invite a user to an employer and automatically accept the invitation. (optional) + * @param \SynergiTech\Staffology\Model\Invitation|null $invitation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createInvitationAsyncWithHttpInfo( + $employerId, + $autoAccept = null, + $invitation = null, + string $contentType = self::contentTypes['createInvitation'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Invitation'; + $request = $this->createInvitationRequest($employerId, $autoAccept, $invitation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createInvitation' + * + * @param string $employerId (required) + * @param bool|null $autoAccept This is useful for when you want to invite a user to an employer and automatically accept the invitation. (optional) + * @param \SynergiTech\Staffology\Model\Invitation|null $invitation (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createInvitationRequest( + $employerId, + $autoAccept = null, + $invitation = null, + string $contentType = self::contentTypes['createInvitation'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createInvitation' + ); + } + + + + + $resourcePath = '/employers/{employerId}/invitation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $autoAccept, + 'autoAccept', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($invitation)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($invitation)); + } else { + $httpBody = $invitation; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteInvitation + * + * Delete Invitation + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteInvitation( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteInvitation'][0] + ): void + { + $this->deleteInvitationWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteInvitationWithHttpInfo + * + * Delete Invitation + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteInvitationWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteInvitation'][0] + ): array + { + $request = $this->deleteInvitationRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteInvitationAsync + * + * Delete Invitation + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteInvitationAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteInvitation'][0] + ): PromiseInterface + { + return $this->deleteInvitationAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteInvitationAsyncWithHttpInfo + * + * Delete Invitation + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteInvitationAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteInvitation'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteInvitationRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteInvitation' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteInvitationRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteInvitation'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteInvitation' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteInvitation' + ); + } + + + $resourcePath = '/employers/{employerId}/invitation/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getInvitation + * + * Get Invitation + * + * @param string $employerId The Id of the Employer to which the Invitation belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Invitation + */ + public function getInvitation( + string $employerId, + string $id, + string $contentType = self::contentTypes['getInvitation'][0] + ): \SynergiTech\Staffology\Model\Invitation + { + list($response) = $this->getInvitationWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getInvitationWithHttpInfo + * + * Get Invitation + * + * @param string $employerId The Id of the Employer to which the Invitation belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Invitation, HTTP status code, HTTP response headers (array of strings) + */ + public function getInvitationWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getInvitation'][0] + ): array + { + $request = $this->getInvitationRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Invitation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Invitation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Invitation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Invitation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Invitation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getInvitationAsync + * + * Get Invitation + * + * @param string $employerId The Id of the Employer to which the Invitation belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getInvitationAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getInvitation'][0] + ): PromiseInterface + { + return $this->getInvitationAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getInvitationAsyncWithHttpInfo + * + * Get Invitation + * + * @param string $employerId The Id of the Employer to which the Invitation belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getInvitationAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getInvitation'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Invitation'; + $request = $this->getInvitationRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getInvitation' + * + * @param string $employerId The Id of the Employer to which the Invitation belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getInvitationRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getInvitation'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getInvitation' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getInvitation' + ); + } + + + $resourcePath = '/employers/{employerId}/invitation/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexInvitation + * + * List Invitations + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexInvitation( + string $employerId, + string $contentType = self::contentTypes['indexInvitation'][0] + ): array + { + list($response) = $this->indexInvitationWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexInvitationWithHttpInfo + * + * List Invitations + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexInvitation'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexInvitationWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexInvitation'][0] + ): array + { + $request = $this->indexInvitationRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexInvitationAsync + * + * List Invitations + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexInvitationAsync( + string $employerId, + string $contentType = self::contentTypes['indexInvitation'][0] + ): PromiseInterface + { + return $this->indexInvitationAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexInvitationAsyncWithHttpInfo + * + * List Invitations + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexInvitationAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexInvitation'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexInvitationRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexInvitation' + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexInvitation'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexInvitationRequest( + $employerId, + string $contentType = self::contentTypes['indexInvitation'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexInvitation' + ); + } + + + $resourcePath = '/employers/{employerId}/invitation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/JobApi.php b/src/Api/JobApi.php new file mode 100644 index 0000000..67c759e --- /dev/null +++ b/src/Api/JobApi.php @@ -0,0 +1,1770 @@ + [ + 'application/json', + ], + 'getJobErrorsByJobIdJob' => [ + 'application/json', + ], + 'getJobJob' => [ + 'application/json', + ], + 'getJobsListJob' => [ + 'application/json', + ], + 'getReportJobResultJob' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation deleteCompletedJobsJob + * + * Delete Completed Jobs + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCompletedJobsJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteCompletedJobsJob( + string $contentType = self::contentTypes['deleteCompletedJobsJob'][0] + ): void + { + $this->deleteCompletedJobsJobWithHttpInfo($contentType); + } + + /** + * Operation deleteCompletedJobsJobWithHttpInfo + * + * Delete Completed Jobs + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCompletedJobsJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCompletedJobsJobWithHttpInfo( + string $contentType = self::contentTypes['deleteCompletedJobsJob'][0] + ): array + { + $request = $this->deleteCompletedJobsJobRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteCompletedJobsJobAsync + * + * Delete Completed Jobs + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCompletedJobsJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCompletedJobsJobAsync( + string $contentType = self::contentTypes['deleteCompletedJobsJob'][0] + ): PromiseInterface + { + return $this->deleteCompletedJobsJobAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCompletedJobsJobAsyncWithHttpInfo + * + * Delete Completed Jobs + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCompletedJobsJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteCompletedJobsJobAsyncWithHttpInfo( + string $contentType = self::contentTypes['deleteCompletedJobsJob'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteCompletedJobsJobRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCompletedJobsJob' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCompletedJobsJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCompletedJobsJobRequest( + string $contentType = self::contentTypes['deleteCompletedJobsJob'][0] + ): Request + { + + + $resourcePath = '/jobs/completed'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getJobErrorsByJobIdJob + * + * Get Job Errors + * + * @param string $jobId The job identifier. (required) + * @param int|null $pageNum pageNum (optional, default to 0) + * @param int|null $pageSize pageSize (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobErrorsByJobIdJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobErrorResponse[] + */ + public function getJobErrorsByJobIdJob( + string $jobId, + ?int $pageNum = 0, + ?int $pageSize = 10, + string $contentType = self::contentTypes['getJobErrorsByJobIdJob'][0] + ): array + { + list($response) = $this->getJobErrorsByJobIdJobWithHttpInfo($jobId, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation getJobErrorsByJobIdJobWithHttpInfo + * + * Get Job Errors + * + * @param string $jobId The job identifier. (required) + * @param int|null $pageNum (optional, default to 0) + * @param int|null $pageSize (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobErrorsByJobIdJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobErrorResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getJobErrorsByJobIdJobWithHttpInfo( + string $jobId, + ?int $pageNum = 0, + ?int $pageSize = 10, + string $contentType = self::contentTypes['getJobErrorsByJobIdJob'][0] + ): array + { + $request = $this->getJobErrorsByJobIdJobRequest($jobId, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJobErrorResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobErrorResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobErrorResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobErrorResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobErrorResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getJobErrorsByJobIdJobAsync + * + * Get Job Errors + * + * @param string $jobId The job identifier. (required) + * @param int|null $pageNum (optional, default to 0) + * @param int|null $pageSize (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobErrorsByJobIdJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobErrorsByJobIdJobAsync( + string $jobId, + ?int $pageNum = 0, + ?int $pageSize = 10, + string $contentType = self::contentTypes['getJobErrorsByJobIdJob'][0] + ): PromiseInterface + { + return $this->getJobErrorsByJobIdJobAsyncWithHttpInfo($jobId, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getJobErrorsByJobIdJobAsyncWithHttpInfo + * + * Get Job Errors + * + * @param string $jobId The job identifier. (required) + * @param int|null $pageNum (optional, default to 0) + * @param int|null $pageSize (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobErrorsByJobIdJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobErrorsByJobIdJobAsyncWithHttpInfo( + $jobId, + $pageNum = 0, + $pageSize = 10, + string $contentType = self::contentTypes['getJobErrorsByJobIdJob'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobErrorResponse[]'; + $request = $this->getJobErrorsByJobIdJobRequest($jobId, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getJobErrorsByJobIdJob' + * + * @param string $jobId The job identifier. (required) + * @param int|null $pageNum (optional, default to 0) + * @param int|null $pageSize (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobErrorsByJobIdJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getJobErrorsByJobIdJobRequest( + $jobId, + $pageNum = 0, + $pageSize = 10, + string $contentType = self::contentTypes['getJobErrorsByJobIdJob'][0] + ): Request + { + + // verify the required parameter 'jobId' is set + if ($jobId === null || (is_array($jobId) && count($jobId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $jobId when calling getJobErrorsByJobIdJob' + ); + } + + + + + $resourcePath = '/jobs/{jobId}/errors'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($jobId !== null) { + $resourcePath = str_replace( + '{' . 'jobId' . '}', + ObjectSerializer::toPathValue($jobId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getJobJob + * + * Get Job + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse + */ + public function getJobJob( + string $jobId, + string $contentType = self::contentTypes['getJobJob'][0] + ): \SynergiTech\Staffology\Model\ContractJobResponse + { + list($response) = $this->getJobJobWithHttpInfo($jobId, $contentType); + return $response; + } + + /** + * Operation getJobJobWithHttpInfo + * + * Get Job + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getJobJobWithHttpInfo( + string $jobId, + string $contentType = self::contentTypes['getJobJob'][0] + ): array + { + $request = $this->getJobJobRequest($jobId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getJobJobAsync + * + * Get Job + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobJobAsync( + string $jobId, + string $contentType = self::contentTypes['getJobJob'][0] + ): PromiseInterface + { + return $this->getJobJobAsyncWithHttpInfo($jobId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getJobJobAsyncWithHttpInfo + * + * Get Job + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobJobAsyncWithHttpInfo( + $jobId, + string $contentType = self::contentTypes['getJobJob'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + $request = $this->getJobJobRequest($jobId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getJobJob' + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getJobJobRequest( + $jobId, + string $contentType = self::contentTypes['getJobJob'][0] + ): Request + { + + // verify the required parameter 'jobId' is set + if ($jobId === null || (is_array($jobId) && count($jobId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $jobId when calling getJobJob' + ); + } + + + $resourcePath = '/jobs/{jobId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($jobId !== null) { + $resourcePath = str_replace( + '{' . 'jobId' . '}', + ObjectSerializer::toPathValue($jobId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getJobsListJob + * + * List Jobs + * + * @param string|null $employerId The employer identifier. (optional) + * @param \SynergiTech\Staffology\Model\JobType|null $jobType Type of the job. (optional) + * @param int|null $pageNum The page number. (optional) + * @param int|null $pageSize Size of the page. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobsListJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse[] + */ + public function getJobsListJob( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\JobType $jobType = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getJobsListJob'][0] + ): array + { + list($response) = $this->getJobsListJobWithHttpInfo($employerId, $jobType, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation getJobsListJobWithHttpInfo + * + * List Jobs + * + * @param string|null $employerId The employer identifier. (optional) + * @param \SynergiTech\Staffology\Model\JobType|null $jobType Type of the job. (optional) + * @param int|null $pageNum The page number. (optional) + * @param int|null $pageSize Size of the page. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobsListJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getJobsListJobWithHttpInfo( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\JobType $jobType = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getJobsListJob'][0] + ): array + { + $request = $this->getJobsListJobRequest($employerId, $jobType, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getJobsListJobAsync + * + * List Jobs + * + * @param string|null $employerId The employer identifier. (optional) + * @param \SynergiTech\Staffology\Model\JobType|null $jobType Type of the job. (optional) + * @param int|null $pageNum The page number. (optional) + * @param int|null $pageSize Size of the page. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobsListJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobsListJobAsync( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\JobType $jobType = null, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getJobsListJob'][0] + ): PromiseInterface + { + return $this->getJobsListJobAsyncWithHttpInfo($employerId, $jobType, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getJobsListJobAsyncWithHttpInfo + * + * List Jobs + * + * @param string|null $employerId The employer identifier. (optional) + * @param \SynergiTech\Staffology\Model\JobType|null $jobType Type of the job. (optional) + * @param int|null $pageNum The page number. (optional) + * @param int|null $pageSize Size of the page. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobsListJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJobsListJobAsyncWithHttpInfo( + $employerId = null, + $jobType = null, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['getJobsListJob'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse[]'; + $request = $this->getJobsListJobRequest($employerId, $jobType, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getJobsListJob' + * + * @param string|null $employerId The employer identifier. (optional) + * @param \SynergiTech\Staffology\Model\JobType|null $jobType Type of the job. (optional) + * @param int|null $pageNum The page number. (optional) + * @param int|null $pageSize Size of the page. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJobsListJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getJobsListJobRequest( + $employerId = null, + $jobType = null, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['getJobsListJob'][0] + ): Request + { + + + + + + + $resourcePath = '/jobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $jobType, + 'jobType', // param base name + 'JobType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportJobResultJob + * + * Get Job file + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportJobResultJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getReportJobResultJob( + string $jobId, + string $contentType = self::contentTypes['getReportJobResultJob'][0] + ): \SplFileObject + { + list($response) = $this->getReportJobResultJobWithHttpInfo($jobId, $contentType); + return $response; + } + + /** + * Operation getReportJobResultJobWithHttpInfo + * + * Get Job file + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportJobResultJob'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportJobResultJobWithHttpInfo( + string $jobId, + string $contentType = self::contentTypes['getReportJobResultJob'][0] + ): array + { + $request = $this->getReportJobResultJobRequest($jobId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReportJobResultJobAsync + * + * Get Job file + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportJobResultJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportJobResultJobAsync( + string $jobId, + string $contentType = self::contentTypes['getReportJobResultJob'][0] + ): PromiseInterface + { + return $this->getReportJobResultJobAsyncWithHttpInfo($jobId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportJobResultJobAsyncWithHttpInfo + * + * Get Job file + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportJobResultJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportJobResultJobAsyncWithHttpInfo( + $jobId, + string $contentType = self::contentTypes['getReportJobResultJob'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getReportJobResultJobRequest($jobId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportJobResultJob' + * + * @param string $jobId The job identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportJobResultJob'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportJobResultJobRequest( + $jobId, + string $contentType = self::contentTypes['getReportJobResultJob'][0] + ): Request + { + + // verify the required parameter 'jobId' is set + if ($jobId === null || (is_array($jobId) && count($jobId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $jobId when calling getReportJobResultJob' + ); + } + + + $resourcePath = '/jobs/{jobId}/document'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($jobId !== null) { + $resourcePath = str_replace( + '{' . 'jobId' . '}', + ObjectSerializer::toPathValue($jobId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/JournalTemplateApi.php b/src/Api/JournalTemplateApi.php new file mode 100644 index 0000000..a781d99 --- /dev/null +++ b/src/Api/JournalTemplateApi.php @@ -0,0 +1,1198 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'getJournalTemplate' => [ + 'application/json', + ], + 'updateJournalTemplate' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createJournalTemplate + * + * Create Journal Template + * + * @param string $employerId The Id of the Employer for which you want to create Journal Template (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\JournalTemplate + */ + public function createJournalTemplate( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['createJournalTemplate'][0] + ): \SynergiTech\Staffology\Model\JournalTemplate + { + list($response) = $this->createJournalTemplateWithHttpInfo($employerId, $contractJournalTemplateRequest, $contentType); + return $response; + } + + /** + * Operation createJournalTemplateWithHttpInfo + * + * Create Journal Template + * + * @param string $employerId The Id of the Employer for which you want to create Journal Template (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\JournalTemplate, HTTP status code, HTTP response headers (array of strings) + */ + public function createJournalTemplateWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['createJournalTemplate'][0] + ): array + { + $request = $this->createJournalTemplateRequest($employerId, $contractJournalTemplateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\JournalTemplate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\JournalTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\JournalTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\JournalTemplate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\JournalTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createJournalTemplateAsync + * + * Create Journal Template + * + * @param string $employerId The Id of the Employer for which you want to create Journal Template (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createJournalTemplateAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['createJournalTemplate'][0] + ): PromiseInterface + { + return $this->createJournalTemplateAsyncWithHttpInfo($employerId, $contractJournalTemplateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createJournalTemplateAsyncWithHttpInfo + * + * Create Journal Template + * + * @param string $employerId The Id of the Employer for which you want to create Journal Template (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createJournalTemplateAsyncWithHttpInfo( + $employerId, + $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['createJournalTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\JournalTemplate'; + $request = $this->createJournalTemplateRequest($employerId, $contractJournalTemplateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createJournalTemplate' + * + * @param string $employerId The Id of the Employer for which you want to create Journal Template (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createJournalTemplateRequest( + $employerId, + $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['createJournalTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createJournalTemplate' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltemplate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractJournalTemplateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractJournalTemplateRequest)); + } else { + $httpBody = $contractJournalTemplateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getJournalTemplate + * + * Get Journal Template + * + * @param string $employerId The Id of the Employer for which you want to get Journal Template (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractJournalTemplateResponse + */ + public function getJournalTemplate( + string $employerId, + string $contentType = self::contentTypes['getJournalTemplate'][0] + ): \SynergiTech\Staffology\Model\ContractJournalTemplateResponse + { + list($response) = $this->getJournalTemplateWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation getJournalTemplateWithHttpInfo + * + * Get Journal Template + * + * @param string $employerId The Id of the Employer for which you want to get Journal Template (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractJournalTemplateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getJournalTemplateWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['getJournalTemplate'][0] + ): array + { + $request = $this->getJournalTemplateRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getJournalTemplateAsync + * + * Get Journal Template + * + * @param string $employerId The Id of the Employer for which you want to get Journal Template (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJournalTemplateAsync( + string $employerId, + string $contentType = self::contentTypes['getJournalTemplate'][0] + ): PromiseInterface + { + return $this->getJournalTemplateAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getJournalTemplateAsyncWithHttpInfo + * + * Get Journal Template + * + * @param string $employerId The Id of the Employer for which you want to get Journal Template (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJournalTemplateAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['getJournalTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse'; + $request = $this->getJournalTemplateRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getJournalTemplate' + * + * @param string $employerId The Id of the Employer for which you want to get Journal Template (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getJournalTemplateRequest( + $employerId, + string $contentType = self::contentTypes['getJournalTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getJournalTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltemplate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateJournalTemplate + * + * Update Journal Template + * + * @param string $employerId The Id of the Employer for which you want to update Journal Template (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJournalTemplateResponse + */ + public function updateJournalTemplate( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['updateJournalTemplate'][0] + ): \SynergiTech\Staffology\Model\ContractJournalTemplateResponse + { + list($response) = $this->updateJournalTemplateWithHttpInfo($employerId, $id, $contractJournalTemplateRequest, $contentType); + return $response; + } + + /** + * Operation updateJournalTemplateWithHttpInfo + * + * Update Journal Template + * + * @param string $employerId The Id of the Employer for which you want to update Journal Template (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJournalTemplateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateJournalTemplateWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['updateJournalTemplate'][0] + ): array + { + $request = $this->updateJournalTemplateRequest($employerId, $id, $contractJournalTemplateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateJournalTemplateAsync + * + * Update Journal Template + * + * @param string $employerId The Id of the Employer for which you want to update Journal Template (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateJournalTemplateAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTemplateRequest $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['updateJournalTemplate'][0] + ): PromiseInterface + { + return $this->updateJournalTemplateAsyncWithHttpInfo($employerId, $id, $contractJournalTemplateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateJournalTemplateAsyncWithHttpInfo + * + * Update Journal Template + * + * @param string $employerId The Id of the Employer for which you want to update Journal Template (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateJournalTemplateAsyncWithHttpInfo( + $employerId, + $id, + $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['updateJournalTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTemplateResponse'; + $request = $this->updateJournalTemplateRequest($employerId, $id, $contractJournalTemplateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateJournalTemplate' + * + * @param string $employerId The Id of the Employer for which you want to update Journal Template (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTemplateRequest|null $contractJournalTemplateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateJournalTemplateRequest( + $employerId, + $id, + $contractJournalTemplateRequest = null, + string $contentType = self::contentTypes['updateJournalTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateJournalTemplate' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateJournalTemplate' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltemplate/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractJournalTemplateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractJournalTemplateRequest)); + } else { + $httpBody = $contractJournalTemplateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/JournalTokenApi.php b/src/Api/JournalTokenApi.php new file mode 100644 index 0000000..e5621fe --- /dev/null +++ b/src/Api/JournalTokenApi.php @@ -0,0 +1,4031 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createDepartmentJournalOverridesJournalToken' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createJournalToken' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteJournalToken' => [ + 'application/json', + ], + 'getCostCentreJournalOverridesListJournalToken' => [ + 'application/json', + ], + 'getDepartmentJournalOverridesListJournalToken' => [ + 'application/json', + ], + 'getJournalToken' => [ + 'application/json', + ], + 'indexJournalToken' => [ + 'application/json', + ], + 'updateCostCentreJournalOverridesJournalToken' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateDepartmentJournalOverridesJournalToken' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateJournalToken' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createCostCentreJournalOverridesJournalToken + * + * Create CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]|null $contractCostCentreJournalOverridesRequest contractCostCentreJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[] + */ + public function createCostCentreJournalOverridesJournalToken( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesRequest = null, + string $contentType = self::contentTypes['createCostCentreJournalOverridesJournalToken'][0] + ): array + { + list($response) = $this->createCostCentreJournalOverridesJournalTokenWithHttpInfo($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest, $contentType); + return $response; + } + + /** + * Operation createCostCentreJournalOverridesJournalTokenWithHttpInfo + * + * Create CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]|null $contractCostCentreJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function createCostCentreJournalOverridesJournalTokenWithHttpInfo( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesRequest = null, + string $contentType = self::contentTypes['createCostCentreJournalOverridesJournalToken'][0] + ): array + { + $request = $this->createCostCentreJournalOverridesJournalTokenRequest($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCostCentreJournalOverridesJournalTokenAsync + * + * Create CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]|null $contractCostCentreJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCostCentreJournalOverridesJournalTokenAsync( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesRequest = null, + string $contentType = self::contentTypes['createCostCentreJournalOverridesJournalToken'][0] + ): PromiseInterface + { + return $this->createCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo + * + * Create CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]|null $contractCostCentreJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo( + $employerId, + $costCentreId, + $contractCostCentreJournalOverridesRequest = null, + string $contentType = self::contentTypes['createCostCentreJournalOverridesJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]'; + $request = $this->createCostCentreJournalOverridesJournalTokenRequest($employerId, $costCentreId, $contractCostCentreJournalOverridesRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createCostCentreJournalOverridesJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesRequest[]|null $contractCostCentreJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createCostCentreJournalOverridesJournalTokenRequest( + $employerId, + $costCentreId, + $contractCostCentreJournalOverridesRequest = null, + string $contentType = self::contentTypes['createCostCentreJournalOverridesJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createCostCentreJournalOverridesJournalToken' + ); + } + + // verify the required parameter 'costCentreId' is set + if ($costCentreId === null || (is_array($costCentreId) && count($costCentreId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $costCentreId when calling createCostCentreJournalOverridesJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($costCentreId !== null) { + $resourcePath = str_replace( + '{' . 'costCentreId' . '}', + ObjectSerializer::toPathValue($costCentreId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractCostCentreJournalOverridesRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractCostCentreJournalOverridesRequest)); + } else { + $httpBody = $contractCostCentreJournalOverridesRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createDepartmentJournalOverridesJournalToken + * + * Create Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]|null $contractDepartmentJournalOverridesRequest contractDepartmentJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[] + */ + public function createDepartmentJournalOverridesJournalToken( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesRequest = null, + string $contentType = self::contentTypes['createDepartmentJournalOverridesJournalToken'][0] + ): array + { + list($response) = $this->createDepartmentJournalOverridesJournalTokenWithHttpInfo($employerId, $departmentId, $contractDepartmentJournalOverridesRequest, $contentType); + return $response; + } + + /** + * Operation createDepartmentJournalOverridesJournalTokenWithHttpInfo + * + * Create Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]|null $contractDepartmentJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function createDepartmentJournalOverridesJournalTokenWithHttpInfo( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesRequest = null, + string $contentType = self::contentTypes['createDepartmentJournalOverridesJournalToken'][0] + ): array + { + $request = $this->createDepartmentJournalOverridesJournalTokenRequest($employerId, $departmentId, $contractDepartmentJournalOverridesRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDepartmentJournalOverridesJournalTokenAsync + * + * Create Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]|null $contractDepartmentJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDepartmentJournalOverridesJournalTokenAsync( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesRequest = null, + string $contentType = self::contentTypes['createDepartmentJournalOverridesJournalToken'][0] + ): PromiseInterface + { + return $this->createDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo($employerId, $departmentId, $contractDepartmentJournalOverridesRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo + * + * Create Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]|null $contractDepartmentJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo( + $employerId, + $departmentId, + $contractDepartmentJournalOverridesRequest = null, + string $contentType = self::contentTypes['createDepartmentJournalOverridesJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]'; + $request = $this->createDepartmentJournalOverridesJournalTokenRequest($employerId, $departmentId, $contractDepartmentJournalOverridesRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDepartmentJournalOverridesJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to create Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to create Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesRequest[]|null $contractDepartmentJournalOverridesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDepartmentJournalOverridesJournalTokenRequest( + $employerId, + $departmentId, + $contractDepartmentJournalOverridesRequest = null, + string $contentType = self::contentTypes['createDepartmentJournalOverridesJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createDepartmentJournalOverridesJournalToken' + ); + } + + // verify the required parameter 'departmentId' is set + if ($departmentId === null || (is_array($departmentId) && count($departmentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $departmentId when calling createDepartmentJournalOverridesJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($departmentId !== null) { + $resourcePath = str_replace( + '{' . 'departmentId' . '}', + ObjectSerializer::toPathValue($departmentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractDepartmentJournalOverridesRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractDepartmentJournalOverridesRequest)); + } else { + $httpBody = $contractDepartmentJournalOverridesRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createJournalToken + * + * Create Journal Token + * + * @param string $employerId The Id of the Employer for which you want to create Journal Token (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractJournalTokenResponse + */ + public function createJournalToken( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['createJournalToken'][0] + ): \SynergiTech\Staffology\Model\ContractJournalTokenResponse + { + list($response) = $this->createJournalTokenWithHttpInfo($employerId, $contractJournalTokenRequest, $contentType); + return $response; + } + + /** + * Operation createJournalTokenWithHttpInfo + * + * Create Journal Token + * + * @param string $employerId The Id of the Employer for which you want to create Journal Token (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractJournalTokenResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createJournalTokenWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['createJournalToken'][0] + ): array + { + $request = $this->createJournalTokenRequest($employerId, $contractJournalTokenRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTokenResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTokenResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createJournalTokenAsync + * + * Create Journal Token + * + * @param string $employerId The Id of the Employer for which you want to create Journal Token (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createJournalTokenAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['createJournalToken'][0] + ): PromiseInterface + { + return $this->createJournalTokenAsyncWithHttpInfo($employerId, $contractJournalTokenRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createJournalTokenAsyncWithHttpInfo + * + * Create Journal Token + * + * @param string $employerId The Id of the Employer for which you want to create Journal Token (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createJournalTokenAsyncWithHttpInfo( + $employerId, + $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['createJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + $request = $this->createJournalTokenRequest($employerId, $contractJournalTokenRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to create Journal Token (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createJournalTokenRequest( + $employerId, + $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['createJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractJournalTokenRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractJournalTokenRequest)); + } else { + $httpBody = $contractJournalTokenRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteJournalToken + * + * Delete Journal Token + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteJournalToken( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteJournalToken'][0] + ): void + { + $this->deleteJournalTokenWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteJournalTokenWithHttpInfo + * + * Delete Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteJournalTokenWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteJournalToken'][0] + ): array + { + $request = $this->deleteJournalTokenRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteJournalTokenAsync + * + * Delete Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteJournalTokenAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteJournalToken'][0] + ): PromiseInterface + { + return $this->deleteJournalTokenAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteJournalTokenAsyncWithHttpInfo + * + * Delete Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteJournalTokenAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteJournalToken'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteJournalTokenRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteJournalToken' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteJournalTokenRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteJournalToken' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteJournalToken' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltokens/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCostCentreJournalOverridesListJournalToken + * + * List CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[] + */ + public function getCostCentreJournalOverridesListJournalToken( + string $employerId, + string $costCentreId, + string $contentType = self::contentTypes['getCostCentreJournalOverridesListJournalToken'][0] + ): array + { + list($response) = $this->getCostCentreJournalOverridesListJournalTokenWithHttpInfo($employerId, $costCentreId, $contentType); + return $response; + } + + /** + * Operation getCostCentreJournalOverridesListJournalTokenWithHttpInfo + * + * List CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[], HTTP status code, HTTP response headers (array of strings) + */ + public function getCostCentreJournalOverridesListJournalTokenWithHttpInfo( + string $employerId, + string $costCentreId, + string $contentType = self::contentTypes['getCostCentreJournalOverridesListJournalToken'][0] + ): array + { + $request = $this->getCostCentreJournalOverridesListJournalTokenRequest($employerId, $costCentreId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCostCentreJournalOverridesListJournalTokenAsync + * + * List CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreJournalOverridesListJournalTokenAsync( + string $employerId, + string $costCentreId, + string $contentType = self::contentTypes['getCostCentreJournalOverridesListJournalToken'][0] + ): PromiseInterface + { + return $this->getCostCentreJournalOverridesListJournalTokenAsyncWithHttpInfo($employerId, $costCentreId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCostCentreJournalOverridesListJournalTokenAsyncWithHttpInfo + * + * List CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getCostCentreJournalOverridesListJournalTokenAsyncWithHttpInfo( + $employerId, + $costCentreId, + string $contentType = self::contentTypes['getCostCentreJournalOverridesListJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponseItem[]'; + $request = $this->getCostCentreJournalOverridesListJournalTokenRequest($employerId, $costCentreId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCostCentreJournalOverridesListJournalToken' + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCostCentreJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCostCentreJournalOverridesListJournalTokenRequest( + $employerId, + $costCentreId, + string $contentType = self::contentTypes['getCostCentreJournalOverridesListJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getCostCentreJournalOverridesListJournalToken' + ); + } + + // verify the required parameter 'costCentreId' is set + if ($costCentreId === null || (is_array($costCentreId) && count($costCentreId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $costCentreId when calling getCostCentreJournalOverridesListJournalToken' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($costCentreId !== null) { + $resourcePath = str_replace( + '{' . 'costCentreId' . '}', + ObjectSerializer::toPathValue($costCentreId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDepartmentJournalOverridesListJournalToken + * + * List Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[] + */ + public function getDepartmentJournalOverridesListJournalToken( + string $employerId, + string $departmentId, + string $contentType = self::contentTypes['getDepartmentJournalOverridesListJournalToken'][0] + ): array + { + list($response) = $this->getDepartmentJournalOverridesListJournalTokenWithHttpInfo($employerId, $departmentId, $contentType); + return $response; + } + + /** + * Operation getDepartmentJournalOverridesListJournalTokenWithHttpInfo + * + * List Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[], HTTP status code, HTTP response headers (array of strings) + */ + public function getDepartmentJournalOverridesListJournalTokenWithHttpInfo( + string $employerId, + string $departmentId, + string $contentType = self::contentTypes['getDepartmentJournalOverridesListJournalToken'][0] + ): array + { + $request = $this->getDepartmentJournalOverridesListJournalTokenRequest($employerId, $departmentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDepartmentJournalOverridesListJournalTokenAsync + * + * List Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentJournalOverridesListJournalTokenAsync( + string $employerId, + string $departmentId, + string $contentType = self::contentTypes['getDepartmentJournalOverridesListJournalToken'][0] + ): PromiseInterface + { + return $this->getDepartmentJournalOverridesListJournalTokenAsyncWithHttpInfo($employerId, $departmentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDepartmentJournalOverridesListJournalTokenAsyncWithHttpInfo + * + * List Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDepartmentJournalOverridesListJournalTokenAsyncWithHttpInfo( + $employerId, + $departmentId, + string $contentType = self::contentTypes['getDepartmentJournalOverridesListJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponseItem[]'; + $request = $this->getDepartmentJournalOverridesListJournalTokenRequest($employerId, $departmentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDepartmentJournalOverridesListJournalToken' + * + * @param string $employerId The Id of the Employer for which you want list of Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want list of Journal Overrides (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDepartmentJournalOverridesListJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDepartmentJournalOverridesListJournalTokenRequest( + $employerId, + $departmentId, + string $contentType = self::contentTypes['getDepartmentJournalOverridesListJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDepartmentJournalOverridesListJournalToken' + ); + } + + // verify the required parameter 'departmentId' is set + if ($departmentId === null || (is_array($departmentId) && count($departmentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $departmentId when calling getDepartmentJournalOverridesListJournalToken' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($departmentId !== null) { + $resourcePath = str_replace( + '{' . 'departmentId' . '}', + ObjectSerializer::toPathValue($departmentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getJournalToken + * + * Get Journal Token + * + * @param string $employerId The Id of the Employer for which you want to get Journal Token (required) + * @param string $id The Id of the Journal Tokens for which you want to get Journal Token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractJournalTokenResponse + */ + public function getJournalToken( + string $employerId, + string $id, + string $contentType = self::contentTypes['getJournalToken'][0] + ): \SynergiTech\Staffology\Model\ContractJournalTokenResponse + { + list($response) = $this->getJournalTokenWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getJournalTokenWithHttpInfo + * + * Get Journal Token + * + * @param string $employerId The Id of the Employer for which you want to get Journal Token (required) + * @param string $id The Id of the Journal Tokens for which you want to get Journal Token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractJournalTokenResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getJournalTokenWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getJournalToken'][0] + ): array + { + $request = $this->getJournalTokenRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTokenResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTokenResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getJournalTokenAsync + * + * Get Journal Token + * + * @param string $employerId The Id of the Employer for which you want to get Journal Token (required) + * @param string $id The Id of the Journal Tokens for which you want to get Journal Token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJournalTokenAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getJournalToken'][0] + ): PromiseInterface + { + return $this->getJournalTokenAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getJournalTokenAsyncWithHttpInfo + * + * Get Journal Token + * + * @param string $employerId The Id of the Employer for which you want to get Journal Token (required) + * @param string $id The Id of the Journal Tokens for which you want to get Journal Token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getJournalTokenAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + $request = $this->getJournalTokenRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to get Journal Token (required) + * @param string $id The Id of the Journal Tokens for which you want to get Journal Token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getJournalTokenRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getJournalToken' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getJournalToken' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltokens/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexJournalToken + * + * List Journal Tokens + * + * @param string $employerId The Id of the Employer for which you want list of Journal Tokens (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[] + */ + public function indexJournalToken( + string $employerId, + string $contentType = self::contentTypes['indexJournalToken'][0] + ): array + { + list($response) = $this->indexJournalTokenWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexJournalTokenWithHttpInfo + * + * List Journal Tokens + * + * @param string $employerId The Id of the Employer for which you want list of Journal Tokens (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexJournalTokenWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexJournalToken'][0] + ): array + { + $request = $this->indexJournalTokenRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexJournalTokenAsync + * + * List Journal Tokens + * + * @param string $employerId The Id of the Employer for which you want list of Journal Tokens (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexJournalTokenAsync( + string $employerId, + string $contentType = self::contentTypes['indexJournalToken'][0] + ): PromiseInterface + { + return $this->indexJournalTokenAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexJournalTokenAsyncWithHttpInfo + * + * List Journal Tokens + * + * @param string $employerId The Id of the Employer for which you want list of Journal Tokens (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexJournalTokenAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponseItem[]'; + $request = $this->indexJournalTokenRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexJournalToken' + * + * @param string $employerId The Id of the Employer for which you want list of Journal Tokens (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexJournalTokenRequest( + $employerId, + string $contentType = self::contentTypes['indexJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexJournalToken' + ); + } + + + $resourcePath = '/employers/{employerId}/journaltokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCostCentreJournalOverridesJournalToken + * + * Update CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]|null $contractCostCentreJournalOverridesUpdateRequest contractCostCentreJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[] + */ + public function updateCostCentreJournalOverridesJournalToken( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateCostCentreJournalOverridesJournalToken'][0] + ): array + { + list($response) = $this->updateCostCentreJournalOverridesJournalTokenWithHttpInfo($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updateCostCentreJournalOverridesJournalTokenWithHttpInfo + * + * Update CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]|null $contractCostCentreJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateCostCentreJournalOverridesJournalTokenWithHttpInfo( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateCostCentreJournalOverridesJournalToken'][0] + ): array + { + $request = $this->updateCostCentreJournalOverridesJournalTokenRequest($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCostCentreJournalOverridesJournalTokenAsync + * + * Update CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]|null $contractCostCentreJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreJournalOverridesJournalTokenAsync( + string $employerId, + string $costCentreId, + ?array $contractCostCentreJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateCostCentreJournalOverridesJournalToken'][0] + ): PromiseInterface + { + return $this->updateCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo + * + * Update CostCentre Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]|null $contractCostCentreJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCostCentreJournalOverridesJournalTokenAsyncWithHttpInfo( + $employerId, + $costCentreId, + $contractCostCentreJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateCostCentreJournalOverridesJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesResponse[]'; + $request = $this->updateCostCentreJournalOverridesJournalTokenRequest($employerId, $costCentreId, $contractCostCentreJournalOverridesUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCostCentreJournalOverridesJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $costCentreId The Id of the CostCentre for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractCostCentreJournalOverridesUpdateRequest[]|null $contractCostCentreJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCostCentreJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCostCentreJournalOverridesJournalTokenRequest( + $employerId, + $costCentreId, + $contractCostCentreJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateCostCentreJournalOverridesJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateCostCentreJournalOverridesJournalToken' + ); + } + + // verify the required parameter 'costCentreId' is set + if ($costCentreId === null || (is_array($costCentreId) && count($costCentreId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $costCentreId when calling updateCostCentreJournalOverridesJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens/{costCentreId}/costcentrejournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($costCentreId !== null) { + $resourcePath = str_replace( + '{' . 'costCentreId' . '}', + ObjectSerializer::toPathValue($costCentreId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractCostCentreJournalOverridesUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractCostCentreJournalOverridesUpdateRequest)); + } else { + $httpBody = $contractCostCentreJournalOverridesUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDepartmentJournalOverridesJournalToken + * + * Update Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]|null $contractDepartmentJournalOverridesUpdateRequest contractDepartmentJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[] + */ + public function updateDepartmentJournalOverridesJournalToken( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateDepartmentJournalOverridesJournalToken'][0] + ): array + { + list($response) = $this->updateDepartmentJournalOverridesJournalTokenWithHttpInfo($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updateDepartmentJournalOverridesJournalTokenWithHttpInfo + * + * Update Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]|null $contractDepartmentJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateDepartmentJournalOverridesJournalTokenWithHttpInfo( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateDepartmentJournalOverridesJournalToken'][0] + ): array + { + $request = $this->updateDepartmentJournalOverridesJournalTokenRequest($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDepartmentJournalOverridesJournalTokenAsync + * + * Update Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]|null $contractDepartmentJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentJournalOverridesJournalTokenAsync( + string $employerId, + string $departmentId, + ?array $contractDepartmentJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateDepartmentJournalOverridesJournalToken'][0] + ): PromiseInterface + { + return $this->updateDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo + * + * Update Department Journal Overrides + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]|null $contractDepartmentJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDepartmentJournalOverridesJournalTokenAsyncWithHttpInfo( + $employerId, + $departmentId, + $contractDepartmentJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateDepartmentJournalOverridesJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesResponse[]'; + $request = $this->updateDepartmentJournalOverridesJournalTokenRequest($employerId, $departmentId, $contractDepartmentJournalOverridesUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDepartmentJournalOverridesJournalToken' + * + * @param string $employerId The Id of the Employer for which you want to update Journal Overrides (required) + * @param string $departmentId The Id of the Department for which you want to update Journal Overrides (required) + * @param \SynergiTech\Staffology\Model\ContractDepartmentJournalOverridesUpdateRequest[]|null $contractDepartmentJournalOverridesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDepartmentJournalOverridesJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDepartmentJournalOverridesJournalTokenRequest( + $employerId, + $departmentId, + $contractDepartmentJournalOverridesUpdateRequest = null, + string $contentType = self::contentTypes['updateDepartmentJournalOverridesJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateDepartmentJournalOverridesJournalToken' + ); + } + + // verify the required parameter 'departmentId' is set + if ($departmentId === null || (is_array($departmentId) && count($departmentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $departmentId when calling updateDepartmentJournalOverridesJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens/{departmentId}/departmentjournaloverrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($departmentId !== null) { + $resourcePath = str_replace( + '{' . 'departmentId' . '}', + ObjectSerializer::toPathValue($departmentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractDepartmentJournalOverridesUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractDepartmentJournalOverridesUpdateRequest)); + } else { + $httpBody = $contractDepartmentJournalOverridesUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateJournalToken + * + * Update Journal Token + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJournalTokenResponse + */ + public function updateJournalToken( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['updateJournalToken'][0] + ): \SynergiTech\Staffology\Model\ContractJournalTokenResponse + { + list($response) = $this->updateJournalTokenWithHttpInfo($employerId, $id, $contractJournalTokenRequest, $contentType); + return $response; + } + + /** + * Operation updateJournalTokenWithHttpInfo + * + * Update Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalToken'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJournalTokenResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateJournalTokenWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['updateJournalToken'][0] + ): array + { + $request = $this->updateJournalTokenRequest($employerId, $id, $contractJournalTokenRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractJournalTokenResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJournalTokenResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJournalTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateJournalTokenAsync + * + * Update Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateJournalTokenAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractJournalTokenRequest $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['updateJournalToken'][0] + ): PromiseInterface + { + return $this->updateJournalTokenAsyncWithHttpInfo($employerId, $id, $contractJournalTokenRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateJournalTokenAsyncWithHttpInfo + * + * Update Journal Token + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateJournalTokenAsyncWithHttpInfo( + $employerId, + $id, + $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['updateJournalToken'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJournalTokenResponse'; + $request = $this->updateJournalTokenRequest($employerId, $id, $contractJournalTokenRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateJournalToken' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractJournalTokenRequest|null $contractJournalTokenRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateJournalToken'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateJournalTokenRequest( + $employerId, + $id, + $contractJournalTokenRequest = null, + string $contentType = self::contentTypes['updateJournalToken'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateJournalToken' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateJournalToken' + ); + } + + + + $resourcePath = '/employers/{employerId}/journaltokens/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractJournalTokenRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractJournalTokenRequest)); + } else { + $httpBody = $contractJournalTokenRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/LeaveApi.php b/src/Api/LeaveApi.php new file mode 100644 index 0000000..dafa840 --- /dev/null +++ b/src/Api/LeaveApi.php @@ -0,0 +1,4214 @@ + [ + 'multipart/form-data', + ], + 'createLeave' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteDocumentLeave' => [ + 'application/json', + ], + 'deleteLeave' => [ + 'application/json', + ], + 'findLinkedPiwLeave' => [ + 'application/json', + ], + 'getDocumentLeave' => [ + 'application/json', + ], + 'getLeave' => [ + 'application/json', + ], + 'getMaternityLeaveScheduleLeave' => [ + 'application/json', + ], + 'getOccupationalMaternityScheduleLeave' => [ + 'application/json', + ], + 'indexLeave' => [ + 'application/json', + ], + 'updateLeave' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addDocumentLeave + * + * Add Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the leave you want to attach documents to (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addDocumentLeave( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLeave'][0] + ): void + { + $this->addDocumentLeaveWithHttpInfo($employerId, $employeeId, $id, $file, $contentType); + } + + /** + * Operation addDocumentLeaveWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the leave you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addDocumentLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLeave'][0] + ): array + { + $request = $this->addDocumentLeaveRequest($employerId, $employeeId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addDocumentLeaveAsync + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the leave you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentLeaveAsync( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLeave'][0] + ): PromiseInterface + { + return $this->addDocumentLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDocumentLeaveAsyncWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the leave you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentLeave'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addDocumentLeaveRequest($employerId, $employeeId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDocumentLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the leave you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addDocumentLeaveRequest( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addDocumentLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling addDocumentLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addDocumentLeave' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createLeave + * + * Create Leave + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createLeave( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['createLeave'][0] + ): void + { + $this->createLeaveWithHttpInfo($employerId, $employeeId, $leave, $contentType); + } + + /** + * Operation createLeaveWithHttpInfo + * + * Create Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createLeaveWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['createLeave'][0] + ): array + { + $request = $this->createLeaveRequest($employerId, $employeeId, $leave, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createLeaveAsync + * + * Create Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLeaveAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['createLeave'][0] + ): PromiseInterface + { + return $this->createLeaveAsyncWithHttpInfo($employerId, $employeeId, $leave, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLeaveAsyncWithHttpInfo + * + * Create Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $leave = null, + string $contentType = self::contentTypes['createLeave'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createLeaveRequest($employerId, $employeeId, $leave, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createLeaveRequest( + $employerId, + $employeeId, + $leave = null, + string $contentType = self::contentTypes['createLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createLeave' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($leave)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($leave)); + } else { + $httpBody = $leave; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocumentLeave + * + * Delete Leave Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDocumentLeave( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLeave'][0] + ): void + { + $this->deleteDocumentLeaveWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + } + + /** + * Operation deleteDocumentLeaveWithHttpInfo + * + * Delete Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLeave'][0] + ): array + { + $request = $this->deleteDocumentLeaveRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDocumentLeaveAsync + * + * Delete Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentLeaveAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLeave'][0] + ): PromiseInterface + { + return $this->deleteDocumentLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentLeaveAsyncWithHttpInfo + * + * Delete Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentLeave'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDocumentLeaveRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocumentLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentLeaveRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDocumentLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteDocumentLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocumentLeave' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling deleteDocumentLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLeave + * + * Delete Leave + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Leave you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteLeave( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLeave'][0] + ): void + { + $this->deleteLeaveWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteLeaveWithHttpInfo + * + * Delete Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLeave'][0] + ): array + { + $request = $this->deleteLeaveRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteLeaveAsync + * + * Delete Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLeaveAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLeave'][0] + ): PromiseInterface + { + return $this->deleteLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLeaveAsyncWithHttpInfo + * + * Delete Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteLeave'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteLeaveRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteLeaveRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation findLinkedPiwLeave + * + * Find Linked Piw + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of leave to you want to find a linked Piw for. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The type of leave pay to you want to find a linked Piw for. (optional) + * @param \DateTime|null $from The leave from date you want to find a linked Piw for. (optional) + * @param \DateTime|null $to The leave to date you want to find a linked Piw for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLinkedPiwLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\LinkedPiw + */ + public function findLinkedPiwLeave( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['findLinkedPiwLeave'][0] + ): \SynergiTech\Staffology\Model\LinkedPiw + { + list($response) = $this->findLinkedPiwLeaveWithHttpInfo($employerId, $employeeId, $leaveType, $leavePayType, $from, $to, $contentType); + return $response; + } + + /** + * Operation findLinkedPiwLeaveWithHttpInfo + * + * Find Linked Piw + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of leave to you want to find a linked Piw for. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The type of leave pay to you want to find a linked Piw for. (optional) + * @param \DateTime|null $from The leave from date you want to find a linked Piw for. (optional) + * @param \DateTime|null $to The leave to date you want to find a linked Piw for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLinkedPiwLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\LinkedPiw, HTTP status code, HTTP response headers (array of strings) + */ + public function findLinkedPiwLeaveWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['findLinkedPiwLeave'][0] + ): array + { + $request = $this->findLinkedPiwLeaveRequest($employerId, $employeeId, $leaveType, $leavePayType, $from, $to, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\LinkedPiw', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\LinkedPiw' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\LinkedPiw', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\LinkedPiw'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\LinkedPiw', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation findLinkedPiwLeaveAsync + * + * Find Linked Piw + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of leave to you want to find a linked Piw for. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The type of leave pay to you want to find a linked Piw for. (optional) + * @param \DateTime|null $from The leave from date you want to find a linked Piw for. (optional) + * @param \DateTime|null $to The leave to date you want to find a linked Piw for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLinkedPiwLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function findLinkedPiwLeaveAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\DateTime $from = null, + ?\DateTime $to = null, + string $contentType = self::contentTypes['findLinkedPiwLeave'][0] + ): PromiseInterface + { + return $this->findLinkedPiwLeaveAsyncWithHttpInfo($employerId, $employeeId, $leaveType, $leavePayType, $from, $to, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation findLinkedPiwLeaveAsyncWithHttpInfo + * + * Find Linked Piw + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of leave to you want to find a linked Piw for. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The type of leave pay to you want to find a linked Piw for. (optional) + * @param \DateTime|null $from The leave from date you want to find a linked Piw for. (optional) + * @param \DateTime|null $to The leave to date you want to find a linked Piw for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLinkedPiwLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function findLinkedPiwLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $leaveType = null, + $leavePayType = null, + $from = null, + $to = null, + string $contentType = self::contentTypes['findLinkedPiwLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\LinkedPiw'; + $request = $this->findLinkedPiwLeaveRequest($employerId, $employeeId, $leaveType, $leavePayType, $from, $to, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'findLinkedPiwLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType The type of leave to you want to find a linked Piw for. (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType The type of leave pay to you want to find a linked Piw for. (optional) + * @param \DateTime|null $from The leave from date you want to find a linked Piw for. (optional) + * @param \DateTime|null $to The leave to date you want to find a linked Piw for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLinkedPiwLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function findLinkedPiwLeaveRequest( + $employerId, + $employeeId, + $leaveType = null, + $leavePayType = null, + $from = null, + $to = null, + string $contentType = self::contentTypes['findLinkedPiwLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling findLinkedPiwLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling findLinkedPiwLeave' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/findlinkedpiw'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveType, + 'leaveType', // param base name + 'LeaveType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leavePayType, + 'leavePayType', // param base name + 'LeavePayType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from, + 'from', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to, + 'to', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentLeave + * + * Get Leave Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getDocumentLeave( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLeave'][0] + ): \SplFileObject + { + list($response) = $this->getDocumentLeaveWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + return $response; + } + + /** + * Operation getDocumentLeaveWithHttpInfo + * + * Get Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLeave'][0] + ): array + { + $request = $this->getDocumentLeaveRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentLeaveAsync + * + * Get Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentLeaveAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLeave'][0] + ): PromiseInterface + { + return $this->getDocumentLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentLeaveAsyncWithHttpInfo + * + * Get Leave Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentLeave'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getDocumentLeaveRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentLeaveRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDocumentLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDocumentLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDocumentLeave' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling getDocumentLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeave + * + * Get Leave + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Leave you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Leave + */ + public function getLeave( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLeave'][0] + ): \SynergiTech\Staffology\Model\Leave + { + list($response) = $this->getLeaveWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getLeaveWithHttpInfo + * + * Get Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Leave, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLeave'][0] + ): array + { + $request = $this->getLeaveRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Leave', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Leave' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Leave', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Leave'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Leave', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeaveAsync + * + * Get Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLeaveAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLeave'][0] + ): PromiseInterface + { + return $this->getLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeaveAsyncWithHttpInfo + * + * Get Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Leave'; + $request = $this->getLeaveRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLeaveRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMaternityLeaveScheduleLeave + * + * List Statutory Maternity Leave History + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \DateTime|null $babyDueDate babyDueDate (optional) + * @param \DateTime|null $leaveFrom leaveFrom (optional) + * @param \DateTime|null $leaveTo leaveTo (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType leaveType (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType leavePayType (optional) + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency payFrequency (optional) + * @param float|null $averageWeeklyEarnings averageWeeklyEarnings (optional, default to 0) + * @param bool|null $isReversed isReversed (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMaternityLeaveScheduleLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getMaternityLeaveScheduleLeave( + string $employerId, + string $employeeId, + ?\DateTime $babyDueDate = null, + ?\DateTime $leaveFrom = null, + ?\DateTime $leaveTo = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\SynergiTech\Staffology\Model\StatPayFrequency $payFrequency = null, + ?float $averageWeeklyEarnings = 0, + ?bool $isReversed = false, + string $contentType = self::contentTypes['getMaternityLeaveScheduleLeave'][0] + ): array + { + list($response) = $this->getMaternityLeaveScheduleLeaveWithHttpInfo($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed, $contentType); + return $response; + } + + /** + * Operation getMaternityLeaveScheduleLeaveWithHttpInfo + * + * List Statutory Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \DateTime|null $babyDueDate (optional) + * @param \DateTime|null $leaveFrom (optional) + * @param \DateTime|null $leaveTo (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType (optional) + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency (optional) + * @param float|null $averageWeeklyEarnings (optional, default to 0) + * @param bool|null $isReversed (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMaternityLeaveScheduleLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getMaternityLeaveScheduleLeaveWithHttpInfo( + string $employerId, + string $employeeId, + ?\DateTime $babyDueDate = null, + ?\DateTime $leaveFrom = null, + ?\DateTime $leaveTo = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\SynergiTech\Staffology\Model\StatPayFrequency $payFrequency = null, + ?float $averageWeeklyEarnings = 0, + ?bool $isReversed = false, + string $contentType = self::contentTypes['getMaternityLeaveScheduleLeave'][0] + ): array + { + $request = $this->getMaternityLeaveScheduleLeaveRequest($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMaternityLeaveScheduleLeaveAsync + * + * List Statutory Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \DateTime|null $babyDueDate (optional) + * @param \DateTime|null $leaveFrom (optional) + * @param \DateTime|null $leaveTo (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType (optional) + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency (optional) + * @param float|null $averageWeeklyEarnings (optional, default to 0) + * @param bool|null $isReversed (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMaternityLeaveScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMaternityLeaveScheduleLeaveAsync( + string $employerId, + string $employeeId, + ?\DateTime $babyDueDate = null, + ?\DateTime $leaveFrom = null, + ?\DateTime $leaveTo = null, + ?\SynergiTech\Staffology\Model\LeaveType $leaveType = null, + ?\SynergiTech\Staffology\Model\LeavePayType $leavePayType = null, + ?\SynergiTech\Staffology\Model\StatPayFrequency $payFrequency = null, + ?float $averageWeeklyEarnings = 0, + ?bool $isReversed = false, + string $contentType = self::contentTypes['getMaternityLeaveScheduleLeave'][0] + ): PromiseInterface + { + return $this->getMaternityLeaveScheduleLeaveAsyncWithHttpInfo($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMaternityLeaveScheduleLeaveAsyncWithHttpInfo + * + * List Statutory Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \DateTime|null $babyDueDate (optional) + * @param \DateTime|null $leaveFrom (optional) + * @param \DateTime|null $leaveTo (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType (optional) + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency (optional) + * @param float|null $averageWeeklyEarnings (optional, default to 0) + * @param bool|null $isReversed (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMaternityLeaveScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMaternityLeaveScheduleLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $babyDueDate = null, + $leaveFrom = null, + $leaveTo = null, + $leaveType = null, + $leavePayType = null, + $payFrequency = null, + $averageWeeklyEarnings = 0, + $isReversed = false, + string $contentType = self::contentTypes['getMaternityLeaveScheduleLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getMaternityLeaveScheduleLeaveRequest($employerId, $employeeId, $babyDueDate, $leaveFrom, $leaveTo, $leaveType, $leavePayType, $payFrequency, $averageWeeklyEarnings, $isReversed, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMaternityLeaveScheduleLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \DateTime|null $babyDueDate (optional) + * @param \DateTime|null $leaveFrom (optional) + * @param \DateTime|null $leaveTo (optional) + * @param \SynergiTech\Staffology\Model\LeaveType|null $leaveType (optional) + * @param \SynergiTech\Staffology\Model\LeavePayType|null $leavePayType (optional) + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency (optional) + * @param float|null $averageWeeklyEarnings (optional, default to 0) + * @param bool|null $isReversed (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMaternityLeaveScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMaternityLeaveScheduleLeaveRequest( + $employerId, + $employeeId, + $babyDueDate = null, + $leaveFrom = null, + $leaveTo = null, + $leaveType = null, + $leavePayType = null, + $payFrequency = null, + $averageWeeklyEarnings = 0, + $isReversed = false, + string $contentType = self::contentTypes['getMaternityLeaveScheduleLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getMaternityLeaveScheduleLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getMaternityLeaveScheduleLeave' + ); + } + + + + + + + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/statutorymaternityschedule'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $babyDueDate, + 'babyDueDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveFrom, + 'leaveFrom', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveTo, + 'leaveTo', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leaveType, + 'leaveType', // param base name + 'LeaveType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $leavePayType, + 'leavePayType', // param base name + 'LeavePayType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payFrequency, + 'payFrequency', // param base name + 'StatPayFrequency', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $averageWeeklyEarnings, + 'averageWeeklyEarnings', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $isReversed, + 'isReversed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOccupationalMaternityScheduleLeave + * + * List occupational Maternity Leave History + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalMaternityScheduleLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getOccupationalMaternityScheduleLeave( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalMaternityScheduleLeave'][0] + ): array + { + list($response) = $this->getOccupationalMaternityScheduleLeaveWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getOccupationalMaternityScheduleLeaveWithHttpInfo + * + * List occupational Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalMaternityScheduleLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getOccupationalMaternityScheduleLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalMaternityScheduleLeave'][0] + ): array + { + $request = $this->getOccupationalMaternityScheduleLeaveRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOccupationalMaternityScheduleLeaveAsync + * + * List occupational Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalMaternityScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalMaternityScheduleLeaveAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalMaternityScheduleLeave'][0] + ): PromiseInterface + { + return $this->getOccupationalMaternityScheduleLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOccupationalMaternityScheduleLeaveAsyncWithHttpInfo + * + * List occupational Maternity Leave History + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalMaternityScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalMaternityScheduleLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getOccupationalMaternityScheduleLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getOccupationalMaternityScheduleLeaveRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOccupationalMaternityScheduleLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalMaternityScheduleLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOccupationalMaternityScheduleLeaveRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getOccupationalMaternityScheduleLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getOccupationalMaternityScheduleLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getOccupationalMaternityScheduleLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getOccupationalMaternityScheduleLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/occupationalmaternityschedule/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexLeave + * + * List Leave + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexLeave( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLeave'][0] + ): array + { + list($response) = $this->indexLeaveWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexLeaveWithHttpInfo + * + * List Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLeave'][0] + ): array + { + $request = $this->indexLeaveRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexLeaveAsync + * + * List Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexLeaveAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLeave'][0] + ): PromiseInterface + { + return $this->indexLeaveAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexLeaveAsyncWithHttpInfo + * + * List Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexLeaveRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexLeaveRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexLeave' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLeave + * + * Update Leave + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Leave you want to update. (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Leave + */ + public function updateLeave( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['updateLeave'][0] + ): \SynergiTech\Staffology\Model\Leave + { + list($response) = $this->updateLeaveWithHttpInfo($employerId, $employeeId, $id, $leave, $contentType); + return $response; + } + + /** + * Operation updateLeaveWithHttpInfo + * + * Update Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to update. (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLeave'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Leave, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLeaveWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['updateLeave'][0] + ): array + { + $request = $this->updateLeaveRequest($employerId, $employeeId, $id, $leave, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Leave', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Leave' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Leave', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Leave'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Leave', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLeaveAsync + * + * Update Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to update. (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLeaveAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['updateLeave'][0] + ): PromiseInterface + { + return $this->updateLeaveAsyncWithHttpInfo($employerId, $employeeId, $id, $leave, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLeaveAsyncWithHttpInfo + * + * Update Leave + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to update. (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLeaveAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $leave = null, + string $contentType = self::contentTypes['updateLeave'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Leave'; + $request = $this->updateLeaveRequest($employerId, $employeeId, $id, $leave, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLeave' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Leave you want to update. (required) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLeave'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLeaveRequest( + $employerId, + $employeeId, + $id, + $leave = null, + string $contentType = self::contentTypes['updateLeave'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateLeave' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateLeave' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateLeave' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/leave/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($leave)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($leave)); + } else { + $httpBody = $leave; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/LoanApi.php b/src/Api/LoanApi.php new file mode 100644 index 0000000..d1880a9 --- /dev/null +++ b/src/Api/LoanApi.php @@ -0,0 +1,2884 @@ + [ + 'multipart/form-data', + ], + 'createLoan' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteDocumentLoan' => [ + 'application/json', + ], + 'deleteLoan' => [ + 'application/json', + ], + 'getDocumentLoan' => [ + 'application/json', + ], + 'getLoan' => [ + 'application/json', + ], + 'indexLoan' => [ + 'application/json', + ], + 'updateLoan' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addDocumentLoan + * + * Add Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Loan you want to attach documents to (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addDocumentLoan( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLoan'][0] + ): void + { + $this->addDocumentLoanWithHttpInfo($employerId, $employeeId, $id, $file, $contentType); + } + + /** + * Operation addDocumentLoanWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addDocumentLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLoan'][0] + ): array + { + $request = $this->addDocumentLoanRequest($employerId, $employeeId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addDocumentLoanAsync + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentLoanAsync( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentLoan'][0] + ): PromiseInterface + { + return $this->addDocumentLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDocumentLoanAsyncWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentLoan'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addDocumentLoanRequest($employerId, $employeeId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDocumentLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addDocumentLoanRequest( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addDocumentLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling addDocumentLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addDocumentLoan' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createLoan + * + * Create Loan + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createLoan( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['createLoan'][0] + ): void + { + $this->createLoanWithHttpInfo($employerId, $employeeId, $loan, $contentType); + } + + /** + * Operation createLoanWithHttpInfo + * + * Create Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createLoanWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['createLoan'][0] + ): array + { + $request = $this->createLoanRequest($employerId, $employeeId, $loan, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createLoanAsync + * + * Create Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLoanAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['createLoan'][0] + ): PromiseInterface + { + return $this->createLoanAsyncWithHttpInfo($employerId, $employeeId, $loan, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLoanAsyncWithHttpInfo + * + * Create Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $loan = null, + string $contentType = self::contentTypes['createLoan'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createLoanRequest($employerId, $employeeId, $loan, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createLoanRequest( + $employerId, + $employeeId, + $loan = null, + string $contentType = self::contentTypes['createLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createLoan' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($loan)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($loan)); + } else { + $httpBody = $loan; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocumentLoan + * + * Delete Loan Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDocumentLoan( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLoan'][0] + ): void + { + $this->deleteDocumentLoanWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + } + + /** + * Operation deleteDocumentLoanWithHttpInfo + * + * Delete Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLoan'][0] + ): array + { + $request = $this->deleteDocumentLoanRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDocumentLoanAsync + * + * Delete Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentLoanAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentLoan'][0] + ): PromiseInterface + { + return $this->deleteDocumentLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentLoanAsyncWithHttpInfo + * + * Delete Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentLoan'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDocumentLoanRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocumentLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentLoanRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDocumentLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteDocumentLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocumentLoan' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling deleteDocumentLoan' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLoan + * + * Delete Loan + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Loan you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteLoan( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLoan'][0] + ): void + { + $this->deleteLoanWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteLoanWithHttpInfo + * + * Delete Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLoan'][0] + ): array + { + $request = $this->deleteLoanRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteLoanAsync + * + * Delete Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLoanAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteLoan'][0] + ): PromiseInterface + { + return $this->deleteLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLoanAsyncWithHttpInfo + * + * Delete Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteLoan'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteLoanRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteLoanRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteLoan' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentLoan + * + * Get Loan Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getDocumentLoan( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLoan'][0] + ): \SplFileObject + { + list($response) = $this->getDocumentLoanWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + return $response; + } + + /** + * Operation getDocumentLoanWithHttpInfo + * + * Get Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLoan'][0] + ): array + { + $request = $this->getDocumentLoanRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentLoanAsync + * + * Get Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentLoanAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentLoan'][0] + ): PromiseInterface + { + return $this->getDocumentLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentLoanAsyncWithHttpInfo + * + * Get Loan Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentLoan'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getDocumentLoanRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentLoanRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDocumentLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDocumentLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDocumentLoan' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling getDocumentLoan' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLoan + * + * Get Loan + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Loan you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Loan + */ + public function getLoan( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLoan'][0] + ): \SynergiTech\Staffology\Model\Loan + { + list($response) = $this->getLoanWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getLoanWithHttpInfo + * + * Get Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Loan, HTTP status code, HTTP response headers (array of strings) + */ + public function getLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLoan'][0] + ): array + { + $request = $this->getLoanRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Loan', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Loan' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Loan', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Loan'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Loan', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLoanAsync + * + * Get Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLoanAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getLoan'][0] + ): PromiseInterface + { + return $this->getLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLoanAsyncWithHttpInfo + * + * Get Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getLoan'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Loan'; + $request = $this->getLoanRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLoanRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getLoan' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexLoan + * + * List Loans + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexLoan( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLoan'][0] + ): array + { + list($response) = $this->indexLoanWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexLoanWithHttpInfo + * + * List Loans + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLoan'][0] + ): array + { + $request = $this->indexLoanRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexLoanAsync + * + * List Loans + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexLoanAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexLoan'][0] + ): PromiseInterface + { + return $this->indexLoanAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexLoanAsyncWithHttpInfo + * + * List Loans + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexLoan'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexLoanRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexLoanRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexLoan' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLoan + * + * Update Loan + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Loan you want to update. (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Loan + */ + public function updateLoan( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['updateLoan'][0] + ): \SynergiTech\Staffology\Model\Loan + { + list($response) = $this->updateLoanWithHttpInfo($employerId, $employeeId, $id, $loan, $contentType); + return $response; + } + + /** + * Operation updateLoanWithHttpInfo + * + * Update Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to update. (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoan'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Loan, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLoanWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['updateLoan'][0] + ): array + { + $request = $this->updateLoanRequest($employerId, $employeeId, $id, $loan, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Loan', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Loan' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Loan', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Loan'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Loan', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLoanAsync + * + * Update Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to update. (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLoanAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Loan $loan = null, + string $contentType = self::contentTypes['updateLoan'][0] + ): PromiseInterface + { + return $this->updateLoanAsyncWithHttpInfo($employerId, $employeeId, $id, $loan, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLoanAsyncWithHttpInfo + * + * Update Loan + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to update. (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLoanAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $loan = null, + string $contentType = self::contentTypes['updateLoan'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Loan'; + $request = $this->updateLoanRequest($employerId, $employeeId, $id, $loan, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLoan' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Loan you want to update. (required) + * @param \SynergiTech\Staffology\Model\Loan|null $loan (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLoan'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLoanRequest( + $employerId, + $employeeId, + $id, + $loan = null, + string $contentType = self::contentTypes['updateLoan'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateLoan' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateLoan' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateLoan' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/loans/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($loan)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($loan)); + } else { + $httpBody = $loan; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/NoteApi.php b/src/Api/NoteApi.php new file mode 100644 index 0000000..9a5a02c --- /dev/null +++ b/src/Api/NoteApi.php @@ -0,0 +1,2884 @@ + [ + 'multipart/form-data', + ], + 'createNote' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteDocumentNote' => [ + 'application/json', + ], + 'deleteNote' => [ + 'application/json', + ], + 'getDocumentNote' => [ + 'application/json', + ], + 'getNote' => [ + 'application/json', + ], + 'indexNote' => [ + 'application/json', + ], + 'updateNote' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addDocumentNote + * + * Add Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Note you want to attach documents to (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addDocumentNote( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentNote'][0] + ): void + { + $this->addDocumentNoteWithHttpInfo($employerId, $employeeId, $id, $file, $contentType); + } + + /** + * Operation addDocumentNoteWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addDocumentNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentNote'][0] + ): array + { + $request = $this->addDocumentNoteRequest($employerId, $employeeId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addDocumentNoteAsync + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentNoteAsync( + string $employerId, + string $employeeId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentNote'][0] + ): PromiseInterface + { + return $this->addDocumentNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDocumentNoteAsyncWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addDocumentNoteRequest($employerId, $employeeId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDocumentNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addDocumentNoteRequest( + $employerId, + $employeeId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addDocumentNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling addDocumentNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addDocumentNote' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createNote + * + * Create Note + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\Note|null $note note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createNote( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['createNote'][0] + ): void + { + $this->createNoteWithHttpInfo($employerId, $employeeId, $note, $contentType); + } + + /** + * Operation createNoteWithHttpInfo + * + * Create Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createNoteWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['createNote'][0] + ): array + { + $request = $this->createNoteRequest($employerId, $employeeId, $note, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createNoteAsync + * + * Create Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNoteAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['createNote'][0] + ): PromiseInterface + { + return $this->createNoteAsyncWithHttpInfo($employerId, $employeeId, $note, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createNoteAsyncWithHttpInfo + * + * Create Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $note = null, + string $contentType = self::contentTypes['createNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createNoteRequest($employerId, $employeeId, $note, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createNoteRequest( + $employerId, + $employeeId, + $note = null, + string $contentType = self::contentTypes['createNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createNote' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($note)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($note)); + } else { + $httpBody = $note; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocumentNote + * + * Delete Note Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDocumentNote( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentNote'][0] + ): void + { + $this->deleteDocumentNoteWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + } + + /** + * Operation deleteDocumentNoteWithHttpInfo + * + * Delete Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentNote'][0] + ): array + { + $request = $this->deleteDocumentNoteRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDocumentNoteAsync + * + * Delete Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentNoteAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentNote'][0] + ): PromiseInterface + { + return $this->deleteDocumentNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentNoteAsyncWithHttpInfo + * + * Delete Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDocumentNoteRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocumentNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentNoteRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDocumentNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteDocumentNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocumentNote' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling deleteDocumentNote' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteNote + * + * Delete Note + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Note you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteNote( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteNote'][0] + ): void + { + $this->deleteNoteWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteNoteWithHttpInfo + * + * Delete Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteNote'][0] + ): array + { + $request = $this->deleteNoteRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteNoteAsync + * + * Delete Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNoteAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteNote'][0] + ): PromiseInterface + { + return $this->deleteNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteNoteAsyncWithHttpInfo + * + * Delete Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteNoteRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteNoteRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteNote' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentNote + * + * Get Note Document + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getDocumentNote( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentNote'][0] + ): \SplFileObject + { + list($response) = $this->getDocumentNoteWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType); + return $response; + } + + /** + * Operation getDocumentNoteWithHttpInfo + * + * Get Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentNote'][0] + ): array + { + $request = $this->getDocumentNoteRequest($employerId, $employeeId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentNoteAsync + * + * Get Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentNoteAsync( + string $employerId, + string $employeeId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentNote'][0] + ): PromiseInterface + { + return $this->getDocumentNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentNoteAsyncWithHttpInfo + * + * Get Note Document + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentNote'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getDocumentNoteRequest($employerId, $employeeId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentNoteRequest( + $employerId, + $employeeId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDocumentNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDocumentNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDocumentNote' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling getDocumentNote' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNote + * + * Get Note + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Note you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Note + */ + public function getNote( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getNote'][0] + ): \SynergiTech\Staffology\Model\Note + { + list($response) = $this->getNoteWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getNoteWithHttpInfo + * + * Get Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Note, HTTP status code, HTTP response headers (array of strings) + */ + public function getNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getNote'][0] + ): array + { + $request = $this->getNoteRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Note', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Note' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Note', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Note'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Note', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNoteAsync + * + * Get Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNoteAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getNote'][0] + ): PromiseInterface + { + return $this->getNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNoteAsyncWithHttpInfo + * + * Get Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Note'; + $request = $this->getNoteRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getNoteRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getNote' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexNote + * + * List Notes + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexNote( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexNote'][0] + ): array + { + list($response) = $this->indexNoteWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexNoteWithHttpInfo + * + * List Notes + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexNote'][0] + ): array + { + $request = $this->indexNoteRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexNoteAsync + * + * List Notes + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexNoteAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexNote'][0] + ): PromiseInterface + { + return $this->indexNoteAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexNoteAsyncWithHttpInfo + * + * List Notes + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexNoteRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexNoteRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexNote' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNote + * + * Update Note + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Note you want to update. (required) + * @param \SynergiTech\Staffology\Model\Note|null $note note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Note + */ + public function updateNote( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['updateNote'][0] + ): \SynergiTech\Staffology\Model\Note + { + list($response) = $this->updateNoteWithHttpInfo($employerId, $employeeId, $id, $note, $contentType); + return $response; + } + + /** + * Operation updateNoteWithHttpInfo + * + * Update Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to update. (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Note, HTTP status code, HTTP response headers (array of strings) + */ + public function updateNoteWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['updateNote'][0] + ): array + { + $request = $this->updateNoteRequest($employerId, $employeeId, $id, $note, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Note', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Note' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Note', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Note'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Note', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNoteAsync + * + * Update Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to update. (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNoteAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Note $note = null, + string $contentType = self::contentTypes['updateNote'][0] + ): PromiseInterface + { + return $this->updateNoteAsyncWithHttpInfo($employerId, $employeeId, $id, $note, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNoteAsyncWithHttpInfo + * + * Update Note + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to update. (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNoteAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $note = null, + string $contentType = self::contentTypes['updateNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Note'; + $request = $this->updateNoteRequest($employerId, $employeeId, $id, $note, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNote' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Note you want to update. (required) + * @param \SynergiTech\Staffology\Model\Note|null $note (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNoteRequest( + $employerId, + $employeeId, + $id, + $note = null, + string $contentType = self::contentTypes['updateNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateNote' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateNote' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($note)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($note)); + } else { + $httpBody = $note; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/NvrApi.php b/src/Api/NvrApi.php new file mode 100644 index 0000000..4d45050 --- /dev/null +++ b/src/Api/NvrApi.php @@ -0,0 +1,3432 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteNvr' => [ + 'application/json', + ], + 'getNvr' => [ + 'application/json', + ], + 'getXmlRequestNvr' => [ + 'application/json', + ], + 'listNvr' => [ + 'application/json', + ], + 'markAsAcceptedNvr' => [ + 'application/json', + ], + 'requiringAttentionNvr' => [ + 'application/json', + ], + 'submitNvr' => [ + 'application/json', + ], + 'updateNvr' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createNvr + * + * Create NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Nvr + */ + public function createNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['createNvr'][0] + ): \SynergiTech\Staffology\Model\Nvr + { + list($response) = $this->createNvrWithHttpInfo($employerId, $taxYear, $nvr, $contentType); + return $response; + } + + /** + * Operation createNvrWithHttpInfo + * + * Create NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Nvr, HTTP status code, HTTP response headers (array of strings) + */ + public function createNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['createNvr'][0] + ): array + { + $request = $this->createNvrRequest($employerId, $taxYear, $nvr, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Nvr', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Nvr' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Nvr', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Nvr', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createNvrAsync + * + * Create NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['createNvr'][0] + ): PromiseInterface + { + return $this->createNvrAsyncWithHttpInfo($employerId, $taxYear, $nvr, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createNvrAsyncWithHttpInfo + * + * Create NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $nvr = null, + string $contentType = self::contentTypes['createNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + $request = $this->createNvrRequest($employerId, $taxYear, $nvr, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createNvrRequest( + $employerId, + $taxYear, + $nvr = null, + string $contentType = self::contentTypes['createNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createNvr' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nvr)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nvr)); + } else { + $httpBody = $nvr; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteNvr + * + * Delete NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteNvr'][0] + ): void + { + $this->deleteNvrWithHttpInfo($employerId, $taxYear, $id, $contentType); + } + + /** + * Operation deleteNvrWithHttpInfo + * + * Delete NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteNvr'][0] + ): array + { + $request = $this->deleteNvrRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteNvrAsync + * + * Delete NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['deleteNvr'][0] + ): PromiseInterface + { + return $this->deleteNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteNvrAsyncWithHttpInfo + * + * Delete NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteNvr'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteNvrRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteNvrRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['deleteNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNvr + * + * Get NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Nvr + */ + public function getNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getNvr'][0] + ): \SynergiTech\Staffology\Model\Nvr + { + list($response) = $this->getNvrWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getNvrWithHttpInfo + * + * Get NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Nvr, HTTP status code, HTTP response headers (array of strings) + */ + public function getNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getNvr'][0] + ): array + { + $request = $this->getNvrRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Nvr', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Nvr' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Nvr', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Nvr', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNvrAsync + * + * Get NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getNvr'][0] + ): PromiseInterface + { + return $this->getNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNvrAsyncWithHttpInfo + * + * Get NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + $request = $this->getNvrRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getNvrRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getXmlRequestNvr + * + * Get XML Request + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function getXmlRequestNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestNvr'][0] + ): string + { + list($response) = $this->getXmlRequestNvrWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation getXmlRequestNvrWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function getXmlRequestNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestNvr'][0] + ): array + { + $request = $this->getXmlRequestNvrRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getXmlRequestNvrAsync + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['getXmlRequestNvr'][0] + ): PromiseInterface + { + return $this->getXmlRequestNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getXmlRequestNvrAsyncWithHttpInfo + * + * Get XML Request + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getXmlRequestNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestNvr'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->getXmlRequestNvrRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getXmlRequestNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getXmlRequestNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getXmlRequestNvrRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['getXmlRequestNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getXmlRequestNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getXmlRequestNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getXmlRequestNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}/xml/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listNvr + * + * List NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listNvr'][0] + ): array + { + list($response) = $this->listNvrWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation listNvrWithHttpInfo + * + * List NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listNvr'][0] + ): array + { + $request = $this->listNvrRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listNvrAsync + * + * List NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listNvr'][0] + ): PromiseInterface + { + return $this->listNvrAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listNvrAsyncWithHttpInfo + * + * List NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listNvrRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listNvrRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['listNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsAcceptedNvr + * + * Mark as Sent + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Nvr + */ + public function markAsAcceptedNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedNvr'][0] + ): \SynergiTech\Staffology\Model\Nvr + { + list($response) = $this->markAsAcceptedNvrWithHttpInfo($employerId, $taxYear, $id, $contentType); + return $response; + } + + /** + * Operation markAsAcceptedNvrWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Nvr, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsAcceptedNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedNvr'][0] + ): array + { + $request = $this->markAsAcceptedNvrRequest($employerId, $taxYear, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Nvr', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Nvr' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Nvr', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Nvr', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsAcceptedNvrAsync + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + string $contentType = self::contentTypes['markAsAcceptedNvr'][0] + ): PromiseInterface + { + return $this->markAsAcceptedNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsAcceptedNvrAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsAcceptedNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + $request = $this->markAsAcceptedNvrRequest($employerId, $taxYear, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsAcceptedNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsAcceptedNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsAcceptedNvrRequest( + $employerId, + $taxYear, + $id, + string $contentType = self::contentTypes['markAsAcceptedNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsAcceptedNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsAcceptedNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsAcceptedNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}/markasaccepted'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requiringAttentionNvr + * + * NVR Requiring Attention + * + * @param string $employerId employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function requiringAttentionNvr( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionNvr'][0] + ): array + { + list($response) = $this->requiringAttentionNvrWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation requiringAttentionNvrWithHttpInfo + * + * NVR Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function requiringAttentionNvrWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionNvr'][0] + ): array + { + $request = $this->requiringAttentionNvrRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requiringAttentionNvrAsync + * + * NVR Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionNvrAsync( + string $employerId, + string $contentType = self::contentTypes['requiringAttentionNvr'][0] + ): PromiseInterface + { + return $this->requiringAttentionNvrAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requiringAttentionNvrAsyncWithHttpInfo + * + * NVR Requiring Attention + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function requiringAttentionNvrAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['requiringAttentionNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->requiringAttentionNvrRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requiringAttentionNvr' + * + * @param string $employerId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requiringAttentionNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requiringAttentionNvrRequest( + $employerId, + string $contentType = self::contentTypes['requiringAttentionNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling requiringAttentionNvr' + ); + } + + + $resourcePath = '/employers/{employerId}/rti/nvr/requiringattention'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitNvr + * + * Submit an existing NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param bool|null $force force (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Nvr + */ + public function submitNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitNvr'][0] + ): \SynergiTech\Staffology\Model\Nvr + { + list($response) = $this->submitNvrWithHttpInfo($employerId, $taxYear, $id, $force, $contentType); + return $response; + } + + /** + * Operation submitNvrWithHttpInfo + * + * Submit an existing NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Nvr, HTTP status code, HTTP response headers (array of strings) + */ + public function submitNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitNvr'][0] + ): array + { + $request = $this->submitNvrRequest($employerId, $taxYear, $id, $force, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Nvr', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Nvr' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Nvr', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Nvr', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitNvrAsync + * + * Submit an existing NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $force = false, + string $contentType = self::contentTypes['submitNvr'][0] + ): PromiseInterface + { + return $this->submitNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $force, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitNvrAsyncWithHttpInfo + * + * Submit an existing NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function submitNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + $request = $this->submitNvrRequest($employerId, $taxYear, $id, $force, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param bool|null $force (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitNvrRequest( + $employerId, + $taxYear, + $id, + $force = false, + string $contentType = self::contentTypes['submitNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling submitNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling submitNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling submitNvr' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}/submit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force, + 'force', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNvr + * + * Update NVR + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Nvr + */ + public function updateNvr( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['updateNvr'][0] + ): \SynergiTech\Staffology\Model\Nvr + { + list($response) = $this->updateNvrWithHttpInfo($employerId, $taxYear, $id, $nvr, $contentType); + return $response; + } + + /** + * Operation updateNvrWithHttpInfo + * + * Update NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNvr'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Nvr, HTTP status code, HTTP response headers (array of strings) + */ + public function updateNvrWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['updateNvr'][0] + ): array + { + $request = $this->updateNvrRequest($employerId, $taxYear, $id, $nvr, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Nvr', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Nvr' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Nvr', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Nvr', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNvrAsync + * + * Update NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNvrAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?\SynergiTech\Staffology\Model\Nvr $nvr = null, + string $contentType = self::contentTypes['updateNvr'][0] + ): PromiseInterface + { + return $this->updateNvrAsyncWithHttpInfo($employerId, $taxYear, $id, $nvr, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNvrAsyncWithHttpInfo + * + * Update NVR + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNvrAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $nvr = null, + string $contentType = self::contentTypes['updateNvr'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Nvr'; + $request = $this->updateNvrRequest($employerId, $taxYear, $id, $nvr, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNvr' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Nvr|null $nvr (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNvr'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNvrRequest( + $employerId, + $taxYear, + $id, + $nvr = null, + string $contentType = self::contentTypes['updateNvr'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateNvr' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateNvr' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateNvr' + ); + } + + + + $resourcePath = '/employers/{employerId}/rti/nvr/{taxYear}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nvr)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nvr)); + } else { + $httpBody = $nvr; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/OccupationalPolicyApi.php b/src/Api/OccupationalPolicyApi.php new file mode 100644 index 0000000..fb16b2e --- /dev/null +++ b/src/Api/OccupationalPolicyApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteOccupationalPolicy' => [ + 'application/json', + ], + 'getOccupationalPolicy' => [ + 'application/json', + ], + 'indexOccupationalPolicy' => [ + 'application/json', + ], + 'updateOccupationalPolicy' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createOccupationalPolicy + * + * Create Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\OccupationalPolicy + */ + public function createOccupationalPolicy( + string $employerId, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['createOccupationalPolicy'][0] + ): \SynergiTech\Staffology\Model\OccupationalPolicy + { + list($response) = $this->createOccupationalPolicyWithHttpInfo($employerId, $occupationalPolicy, $contentType); + return $response; + } + + /** + * Operation createOccupationalPolicyWithHttpInfo + * + * Create Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\OccupationalPolicy, HTTP status code, HTTP response headers (array of strings) + */ + public function createOccupationalPolicyWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['createOccupationalPolicy'][0] + ): array + { + $request = $this->createOccupationalPolicyRequest($employerId, $occupationalPolicy, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\OccupationalPolicy', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalPolicy' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalPolicy', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalPolicy', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createOccupationalPolicyAsync + * + * Create Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createOccupationalPolicyAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['createOccupationalPolicy'][0] + ): PromiseInterface + { + return $this->createOccupationalPolicyAsyncWithHttpInfo($employerId, $occupationalPolicy, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createOccupationalPolicyAsyncWithHttpInfo + * + * Create Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createOccupationalPolicyAsyncWithHttpInfo( + $employerId, + $occupationalPolicy = null, + string $contentType = self::contentTypes['createOccupationalPolicy'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + $request = $this->createOccupationalPolicyRequest($employerId, $occupationalPolicy, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createOccupationalPolicy' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createOccupationalPolicyRequest( + $employerId, + $occupationalPolicy = null, + string $contentType = self::contentTypes['createOccupationalPolicy'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createOccupationalPolicy' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalpolicies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($occupationalPolicy)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($occupationalPolicy)); + } else { + $httpBody = $occupationalPolicy; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOccupationalPolicy + * + * Delete Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteOccupationalPolicy( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalPolicy'][0] + ): void + { + $this->deleteOccupationalPolicyWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteOccupationalPolicyWithHttpInfo + * + * Delete Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOccupationalPolicyWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalPolicy'][0] + ): array + { + $request = $this->deleteOccupationalPolicyRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteOccupationalPolicyAsync + * + * Delete Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteOccupationalPolicyAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalPolicy'][0] + ): PromiseInterface + { + return $this->deleteOccupationalPolicyAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOccupationalPolicyAsyncWithHttpInfo + * + * Delete Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteOccupationalPolicyAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteOccupationalPolicy'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteOccupationalPolicyRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOccupationalPolicy' + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteOccupationalPolicyRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteOccupationalPolicy'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteOccupationalPolicy' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOccupationalPolicy' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalpolicies/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOccupationalPolicy + * + * Get Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OccupationalPolicy + */ + public function getOccupationalPolicy( + string $employerId, + string $id, + string $contentType = self::contentTypes['getOccupationalPolicy'][0] + ): \SynergiTech\Staffology\Model\OccupationalPolicy + { + list($response) = $this->getOccupationalPolicyWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getOccupationalPolicyWithHttpInfo + * + * Get Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OccupationalPolicy, HTTP status code, HTTP response headers (array of strings) + */ + public function getOccupationalPolicyWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getOccupationalPolicy'][0] + ): array + { + $request = $this->getOccupationalPolicyRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OccupationalPolicy', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalPolicy' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalPolicy', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalPolicy', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOccupationalPolicyAsync + * + * Get Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalPolicyAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getOccupationalPolicy'][0] + ): PromiseInterface + { + return $this->getOccupationalPolicyAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOccupationalPolicyAsyncWithHttpInfo + * + * Get Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalPolicyAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getOccupationalPolicy'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + $request = $this->getOccupationalPolicyRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOccupationalPolicy' + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOccupationalPolicyRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getOccupationalPolicy'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getOccupationalPolicy' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getOccupationalPolicy' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalpolicies/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexOccupationalPolicy + * + * List Occupational Policies + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexOccupationalPolicy( + string $employerId, + string $contentType = self::contentTypes['indexOccupationalPolicy'][0] + ): array + { + list($response) = $this->indexOccupationalPolicyWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexOccupationalPolicyWithHttpInfo + * + * List Occupational Policies + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexOccupationalPolicyWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexOccupationalPolicy'][0] + ): array + { + $request = $this->indexOccupationalPolicyRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexOccupationalPolicyAsync + * + * List Occupational Policies + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexOccupationalPolicyAsync( + string $employerId, + string $contentType = self::contentTypes['indexOccupationalPolicy'][0] + ): PromiseInterface + { + return $this->indexOccupationalPolicyAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexOccupationalPolicyAsyncWithHttpInfo + * + * List Occupational Policies + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexOccupationalPolicyAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexOccupationalPolicy'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexOccupationalPolicyRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexOccupationalPolicy' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexOccupationalPolicyRequest( + $employerId, + string $contentType = self::contentTypes['indexOccupationalPolicy'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexOccupationalPolicy' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalpolicies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOccupationalPolicy + * + * Update Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OccupationalPolicy + */ + public function updateOccupationalPolicy( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['updateOccupationalPolicy'][0] + ): \SynergiTech\Staffology\Model\OccupationalPolicy + { + list($response) = $this->updateOccupationalPolicyWithHttpInfo($employerId, $id, $occupationalPolicy, $contentType); + return $response; + } + + /** + * Operation updateOccupationalPolicyWithHttpInfo + * + * Update Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalPolicy'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OccupationalPolicy, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOccupationalPolicyWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['updateOccupationalPolicy'][0] + ): array + { + $request = $this->updateOccupationalPolicyRequest($employerId, $id, $occupationalPolicy, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OccupationalPolicy', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalPolicy' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalPolicy', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalPolicy', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOccupationalPolicyAsync + * + * Update Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOccupationalPolicyAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalPolicy $occupationalPolicy = null, + string $contentType = self::contentTypes['updateOccupationalPolicy'][0] + ): PromiseInterface + { + return $this->updateOccupationalPolicyAsyncWithHttpInfo($employerId, $id, $occupationalPolicy, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOccupationalPolicyAsyncWithHttpInfo + * + * Update Occupational Policy + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOccupationalPolicyAsyncWithHttpInfo( + $employerId, + $id, + $occupationalPolicy = null, + string $contentType = self::contentTypes['updateOccupationalPolicy'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + $request = $this->updateOccupationalPolicyRequest($employerId, $id, $occupationalPolicy, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOccupationalPolicy' + * + * @param string $employerId The Id of the Employer to which the Occupational Policy belongs. (required) + * @param string $id The Id of the Occupational Policy which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalPolicy|null $occupationalPolicy (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalPolicy'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOccupationalPolicyRequest( + $employerId, + $id, + $occupationalPolicy = null, + string $contentType = self::contentTypes['updateOccupationalPolicy'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateOccupationalPolicy' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateOccupationalPolicy' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalpolicies/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($occupationalPolicy)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($occupationalPolicy)); + } else { + $httpBody = $occupationalPolicy; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/OccupationalSickLeaveHistoryApi.php b/src/Api/OccupationalSickLeaveHistoryApi.php new file mode 100644 index 0000000..42aa865 --- /dev/null +++ b/src/Api/OccupationalSickLeaveHistoryApi.php @@ -0,0 +1,2648 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteOccupationalSickLeaveHistory' => [ + 'application/json', + ], + 'getOccupationalSickLeaveHistory' => [ + 'application/json', + ], + 'importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory' => [ + 'multipart/form-data', + ], + 'occupationalSickLeaveHistoryOccupationalSickLeaveHistory' => [ + 'application/json', + ], + 'updateOccupationalSickLeaveHistory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'uploadOSPHistoryOccupationalSickLeaveHistory' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createOccupationalSickLeaveHistory + * + * Create OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer (required) + * @param string $employeeId The Id of the Employee to which the Occupational sick leave history belongs (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + */ + public function createOccupationalSickLeaveHistory( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['createOccupationalSickLeaveHistory'][0] + ): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + { + list($response) = $this->createOccupationalSickLeaveHistoryWithHttpInfo($employerId, $employeeId, $occupationalSickLeaveHistory, $contentType); + return $response; + } + + /** + * Operation createOccupationalSickLeaveHistoryWithHttpInfo + * + * Create OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer (required) + * @param string $employeeId The Id of the Employee to which the Occupational sick leave history belongs (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory, HTTP status code, HTTP response headers (array of strings) + */ + public function createOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['createOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->createOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $occupationalSickLeaveHistory, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createOccupationalSickLeaveHistoryAsync + * + * Create OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer (required) + * @param string $employeeId The Id of the Employee to which the Occupational sick leave history belongs (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createOccupationalSickLeaveHistoryAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['createOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->createOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $employeeId, $occupationalSickLeaveHistory, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Create OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer (required) + * @param string $employeeId The Id of the Employee to which the Occupational sick leave history belongs (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['createOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + $request = $this->createOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $occupationalSickLeaveHistory, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createOccupationalSickLeaveHistory' + * + * @param string $employerId The Id of the Employer (required) + * @param string $employeeId The Id of the Employee to which the Occupational sick leave history belongs (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createOccupationalSickLeaveHistoryRequest( + $employerId, + $employeeId, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['createOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createOccupationalSickLeaveHistory' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($occupationalSickLeaveHistory)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($occupationalSickLeaveHistory)); + } else { + $httpBody = $occupationalSickLeaveHistory; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOccupationalSickLeaveHistory + * + * Delete OccupationalSickLeaveHistory + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Occupational sick leave which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteOccupationalSickLeaveHistory( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalSickLeaveHistory'][0] + ): void + { + $this->deleteOccupationalSickLeaveHistoryWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deleteOccupationalSickLeaveHistoryWithHttpInfo + * + * Delete OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational sick leave which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->deleteOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteOccupationalSickLeaveHistoryAsync + * + * Delete OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational sick leave which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteOccupationalSickLeaveHistoryAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deleteOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->deleteOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Delete OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational sick leave which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOccupationalSickLeaveHistory' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational sick leave which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteOccupationalSickLeaveHistoryRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deleteOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOccupationalSickLeaveHistory' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOccupationalSickLeaveHistory + * + * Get OccupationalSickLeaveHistory + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + */ + public function getOccupationalSickLeaveHistory( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalSickLeaveHistory'][0] + ): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + { + list($response) = $this->getOccupationalSickLeaveHistoryWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getOccupationalSickLeaveHistoryWithHttpInfo + * + * Get OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory, HTTP status code, HTTP response headers (array of strings) + */ + public function getOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->getOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOccupationalSickLeaveHistoryAsync + * + * Get OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalSickLeaveHistoryAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->getOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Get OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + $request = $this->getOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOccupationalSickLeaveHistory' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOccupationalSickLeaveHistoryRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getOccupationalSickLeaveHistory' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory + * + * Import OccupationalSickLeaveHistory from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'][0] + ): array + { + list($response) = $this->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryWithHttpInfo($employerId, $file, $contentType); + return $response; + } + + /** + * Operation importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryWithHttpInfo + * + * Import OccupationalSickLeaveHistory from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryRequest($employerId, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryAsync + * + * Import OccupationalSickLeaveHistory from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryAsync( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Import OccupationalSickLeaveHistory from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $file = null, + string $contentType = self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryRequest($employerId, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory' + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistoryRequest( + $employerId, + $file = null, + string $contentType = self::contentTypes['importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importOccupationalSickLeaveHistoryCsvOccupationalSickLeaveHistory' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/importfile'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation occupationalSickLeaveHistoryOccupationalSickLeaveHistory + * + * List OccupationalSickLeaveHistory + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function occupationalSickLeaveHistoryOccupationalSickLeaveHistory( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'][0] + ): array + { + list($response) = $this->occupationalSickLeaveHistoryOccupationalSickLeaveHistoryWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation occupationalSickLeaveHistoryOccupationalSickLeaveHistoryWithHttpInfo + * + * List OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function occupationalSickLeaveHistoryOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->occupationalSickLeaveHistoryOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation occupationalSickLeaveHistoryOccupationalSickLeaveHistoryAsync + * + * List OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function occupationalSickLeaveHistoryOccupationalSickLeaveHistoryAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->occupationalSickLeaveHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation occupationalSickLeaveHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * List OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function occupationalSickLeaveHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->occupationalSickLeaveHistoryOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'occupationalSickLeaveHistoryOccupationalSickLeaveHistory' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function occupationalSickLeaveHistoryOccupationalSickLeaveHistoryRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['occupationalSickLeaveHistoryOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling occupationalSickLeaveHistoryOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling occupationalSickLeaveHistoryOccupationalSickLeaveHistory' + ); + } + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOccupationalSickLeaveHistory + * + * Update OccupationalSickLeaveHistory + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + */ + public function updateOccupationalSickLeaveHistory( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['updateOccupationalSickLeaveHistory'][0] + ): \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory + { + list($response) = $this->updateOccupationalSickLeaveHistoryWithHttpInfo($employerId, $employeeId, $id, $occupationalSickLeaveHistory, $contentType); + return $response; + } + + /** + * Operation updateOccupationalSickLeaveHistoryWithHttpInfo + * + * Update OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['updateOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->updateOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $occupationalSickLeaveHistory, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOccupationalSickLeaveHistoryAsync + * + * Update OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOccupationalSickLeaveHistoryAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['updateOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->updateOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $employeeId, $id, $occupationalSickLeaveHistory, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Update OccupationalSickLeaveHistory + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['updateOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalSickLeaveHistory'; + $request = $this->updateOccupationalSickLeaveHistoryRequest($employerId, $employeeId, $id, $occupationalSickLeaveHistory, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOccupationalSickLeaveHistory' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Occupational leave history which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOccupationalSickLeaveHistoryRequest( + $employerId, + $employeeId, + $id, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['updateOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateOccupationalSickLeaveHistory' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateOccupationalSickLeaveHistory' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/employees/{employeeId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($occupationalSickLeaveHistory)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($occupationalSickLeaveHistory)); + } else { + $httpBody = $occupationalSickLeaveHistory; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation uploadOSPHistoryOccupationalSickLeaveHistory + * + * Upload OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer to which the occupational sick leave history is to be uploaded. (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]|null $occupationalSickLeaveHistory occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Item[] + */ + public function uploadOSPHistoryOccupationalSickLeaveHistory( + string $employerId, + ?array $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'][0] + ): array + { + list($response) = $this->uploadOSPHistoryOccupationalSickLeaveHistoryWithHttpInfo($employerId, $occupationalSickLeaveHistory, $contentType); + return $response; + } + + /** + * Operation uploadOSPHistoryOccupationalSickLeaveHistoryWithHttpInfo + * + * Upload OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer to which the occupational sick leave history is to be uploaded. (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function uploadOSPHistoryOccupationalSickLeaveHistoryWithHttpInfo( + string $employerId, + ?array $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'][0] + ): array + { + $request = $this->uploadOSPHistoryOccupationalSickLeaveHistoryRequest($employerId, $occupationalSickLeaveHistory, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation uploadOSPHistoryOccupationalSickLeaveHistoryAsync + * + * Upload OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer to which the occupational sick leave history is to be uploaded. (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function uploadOSPHistoryOccupationalSickLeaveHistoryAsync( + string $employerId, + ?array $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + return $this->uploadOSPHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo($employerId, $occupationalSickLeaveHistory, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation uploadOSPHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo + * + * Upload OccupationalSickLeaveHistory + * + * @param string $employerId The Id of the Employer to which the occupational sick leave history is to be uploaded. (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function uploadOSPHistoryOccupationalSickLeaveHistoryAsyncWithHttpInfo( + $employerId, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->uploadOSPHistoryOccupationalSickLeaveHistoryRequest($employerId, $occupationalSickLeaveHistory, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'uploadOSPHistoryOccupationalSickLeaveHistory' + * + * @param string $employerId The Id of the Employer to which the occupational sick leave history is to be uploaded. (required) + * @param \SynergiTech\Staffology\Model\OccupationalSickLeaveHistory[]|null $occupationalSickLeaveHistory (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function uploadOSPHistoryOccupationalSickLeaveHistoryRequest( + $employerId, + $occupationalSickLeaveHistory = null, + string $contentType = self::contentTypes['uploadOSPHistoryOccupationalSickLeaveHistory'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling uploadOSPHistoryOccupationalSickLeaveHistory' + ); + } + + + + $resourcePath = '/employers/{employerId}/occupationalsickleavehistory/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($occupationalSickLeaveHistory)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($occupationalSickLeaveHistory)); + } else { + $httpBody = $occupationalSickLeaveHistory; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/OpeningBalancesApi.php b/src/Api/OpeningBalancesApi.php new file mode 100644 index 0000000..ca1fcd0 --- /dev/null +++ b/src/Api/OpeningBalancesApi.php @@ -0,0 +1,4235 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteNicSummaryOpeningBalances' => [ + 'application/json', + ], + 'getNicSummariesOpeningBalances' => [ + 'application/json', + ], + 'getNicSummaryOpeningBalances' => [ + 'application/json', + ], + 'getOpeningBalances' => [ + 'application/json', + ], + 'getOpeningBalancesTotalsOpeningBalances' => [ + 'application/json', + ], + 'updateNicSummariesOpeningBalances' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateNicSummaryOpeningBalances' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateOpeningBalances' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateP45OpeningBalances' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateTerminationPaymentsOpeningBalances' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createNicSummaryOpeningBalances + * + * Create NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createNicSummaryOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['createNicSummaryOpeningBalances'][0] + ): void + { + $this->createNicSummaryOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + } + + /** + * Operation createNicSummaryOpeningBalancesWithHttpInfo + * + * Create NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createNicSummaryOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['createNicSummaryOpeningBalances'][0] + ): array + { + $request = $this->createNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createNicSummaryOpeningBalancesAsync + * + * Create NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNicSummaryOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['createNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + return $this->createNicSummaryOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $nicSummary, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createNicSummaryOpeningBalancesAsyncWithHttpInfo + * + * Create NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNicSummaryOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $nicSummary = null, + string $contentType = self::contentTypes['createNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createNicSummaryOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createNicSummaryOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $nicSummary = null, + string $contentType = self::contentTypes['createNicSummaryOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createNicSummaryOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nicSummary)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nicSummary)); + } else { + $httpBody = $nicSummary; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteNicSummaryOpeningBalances + * + * Delete NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to delete the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteNicSummaryOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['deleteNicSummaryOpeningBalances'][0] + ): void + { + $this->deleteNicSummaryOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + } + + /** + * Operation deleteNicSummaryOpeningBalancesWithHttpInfo + * + * Delete NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to delete the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteNicSummaryOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['deleteNicSummaryOpeningBalances'][0] + ): array + { + $request = $this->deleteNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteNicSummaryOpeningBalancesAsync + * + * Delete NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to delete the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNicSummaryOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['deleteNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + return $this->deleteNicSummaryOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteNicSummaryOpeningBalancesAsyncWithHttpInfo + * + * Delete NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to delete the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteNicSummaryOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + string $contentType = self::contentTypes['deleteNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteNicSummaryOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to delete the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteNicSummaryOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + string $contentType = self::contentTypes['deleteNicSummaryOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'uniqueId' is set + if ($uniqueId === null || (is_array($uniqueId) && count($uniqueId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $uniqueId when calling deleteNicSummaryOpeningBalances' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($uniqueId !== null) { + $resourcePath = str_replace( + '{' . 'uniqueId' . '}', + ObjectSerializer::toPathValue($uniqueId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNicSummariesOpeningBalances + * + * Get NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param bool|null $openingBalancesOnly Limit the results to opening balance year to date (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NicSummary[] + */ + public function getNicSummariesOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $openingBalancesOnly = true, + string $contentType = self::contentTypes['getNicSummariesOpeningBalances'][0] + ): array + { + list($response) = $this->getNicSummariesOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $openingBalancesOnly, $contentType); + return $response; + } + + /** + * Operation getNicSummariesOpeningBalancesWithHttpInfo + * + * Get NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param bool|null $openingBalancesOnly Limit the results to opening balance year to date (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NicSummary[], HTTP status code, HTTP response headers (array of strings) + */ + public function getNicSummariesOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $openingBalancesOnly = true, + string $contentType = self::contentTypes['getNicSummariesOpeningBalances'][0] + ): array + { + $request = $this->getNicSummariesOpeningBalancesRequest($employerId, $employeeId, $taxYear, $openingBalancesOnly, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NicSummary[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NicSummary[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NicSummary[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NicSummary[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NicSummary[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNicSummariesOpeningBalancesAsync + * + * Get NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param bool|null $openingBalancesOnly Limit the results to opening balance year to date (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNicSummariesOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?bool $openingBalancesOnly = true, + string $contentType = self::contentTypes['getNicSummariesOpeningBalances'][0] + ): PromiseInterface + { + return $this->getNicSummariesOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $openingBalancesOnly, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNicSummariesOpeningBalancesAsyncWithHttpInfo + * + * Get NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param bool|null $openingBalancesOnly Limit the results to opening balance year to date (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNicSummariesOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $openingBalancesOnly = true, + string $contentType = self::contentTypes['getNicSummariesOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NicSummary[]'; + $request = $this->getNicSummariesOpeningBalancesRequest($employerId, $employeeId, $taxYear, $openingBalancesOnly, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNicSummariesOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param bool|null $openingBalancesOnly Limit the results to opening balance year to date (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getNicSummariesOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $openingBalancesOnly = true, + string $contentType = self::contentTypes['getNicSummariesOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getNicSummariesOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getNicSummariesOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getNicSummariesOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $openingBalancesOnly, + 'openingBalancesOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNicSummaryOpeningBalances + * + * Get NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NicSummary + */ + public function getNicSummaryOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['getNicSummaryOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\NicSummary + { + list($response) = $this->getNicSummaryOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + return $response; + } + + /** + * Operation getNicSummaryOpeningBalancesWithHttpInfo + * + * Get NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NicSummary, HTTP status code, HTTP response headers (array of strings) + */ + public function getNicSummaryOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['getNicSummaryOpeningBalances'][0] + ): array + { + $request = $this->getNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NicSummary', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NicSummary' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NicSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NicSummary'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NicSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNicSummaryOpeningBalancesAsync + * + * Get NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNicSummaryOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + string $contentType = self::contentTypes['getNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + return $this->getNicSummaryOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNicSummaryOpeningBalancesAsyncWithHttpInfo + * + * Get NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getNicSummaryOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + string $contentType = self::contentTypes['getNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NicSummary'; + $request = $this->getNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNicSummaryOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getNicSummaryOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + string $contentType = self::contentTypes['getNicSummaryOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'uniqueId' is set + if ($uniqueId === null || (is_array($uniqueId) && count($uniqueId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $uniqueId when calling getNicSummaryOpeningBalances' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($uniqueId !== null) { + $resourcePath = str_replace( + '{' . 'uniqueId' . '}', + ObjectSerializer::toPathValue($uniqueId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOpeningBalances + * + * Get Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OpeningBalances + */ + public function getOpeningBalances( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\OpeningBalances + { + list($response) = $this->getOpeningBalancesWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation getOpeningBalancesWithHttpInfo + * + * Get Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function getOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getOpeningBalances'][0] + ): array + { + $request = $this->getOpeningBalancesRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOpeningBalancesAsync + * + * Get Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOpeningBalancesAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getOpeningBalances'][0] + ): PromiseInterface + { + return $this->getOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOpeningBalancesAsyncWithHttpInfo + * + * Get Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + $request = $this->getOpeningBalancesRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOpeningBalancesRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getOpeningBalances' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOpeningBalancesTotalsOpeningBalances + * + * Totals of employee opening balances for a tax year + * + * @param string $employerId The Id of the Employer to search. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to Opening Balances totals. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalancesTotalsOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OpeningBalancesTotals + */ + public function getOpeningBalancesTotalsOpeningBalances( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getOpeningBalancesTotalsOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\OpeningBalancesTotals + { + list($response) = $this->getOpeningBalancesTotalsOpeningBalancesWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation getOpeningBalancesTotalsOpeningBalancesWithHttpInfo + * + * Totals of employee opening balances for a tax year + * + * @param string $employerId The Id of the Employer to search. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to Opening Balances totals. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalancesTotalsOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OpeningBalancesTotals, HTTP status code, HTTP response headers (array of strings) + */ + public function getOpeningBalancesTotalsOpeningBalancesWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getOpeningBalancesTotalsOpeningBalances'][0] + ): array + { + $request = $this->getOpeningBalancesTotalsOpeningBalancesRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OpeningBalancesTotals', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OpeningBalancesTotals' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OpeningBalancesTotals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OpeningBalancesTotals'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OpeningBalancesTotals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOpeningBalancesTotalsOpeningBalancesAsync + * + * Totals of employee opening balances for a tax year + * + * @param string $employerId The Id of the Employer to search. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to Opening Balances totals. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalancesTotalsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOpeningBalancesTotalsOpeningBalancesAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getOpeningBalancesTotalsOpeningBalances'][0] + ): PromiseInterface + { + return $this->getOpeningBalancesTotalsOpeningBalancesAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOpeningBalancesTotalsOpeningBalancesAsyncWithHttpInfo + * + * Totals of employee opening balances for a tax year + * + * @param string $employerId The Id of the Employer to search. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to Opening Balances totals. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalancesTotalsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getOpeningBalancesTotalsOpeningBalancesAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['getOpeningBalancesTotalsOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OpeningBalancesTotals'; + $request = $this->getOpeningBalancesTotalsOpeningBalancesRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOpeningBalancesTotalsOpeningBalances' + * + * @param string $employerId The Id of the Employer to search. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear for which you want to Opening Balances totals. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOpeningBalancesTotalsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOpeningBalancesTotalsOpeningBalancesRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['getOpeningBalancesTotalsOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getOpeningBalancesTotalsOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getOpeningBalancesTotalsOpeningBalances' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/openingbalances/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNicSummariesOpeningBalances + * + * Update NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummary nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NicSummary[] + */ + public function updateNicSummariesOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?array $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummariesOpeningBalances'][0] + ): array + { + list($response) = $this->updateNicSummariesOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + return $response; + } + + /** + * Operation updateNicSummariesOpeningBalancesWithHttpInfo + * + * Update NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NicSummary[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateNicSummariesOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?array $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummariesOpeningBalances'][0] + ): array + { + $request = $this->updateNicSummariesOpeningBalancesRequest($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NicSummary[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NicSummary[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NicSummary[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NicSummary[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NicSummary[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNicSummariesOpeningBalancesAsync + * + * Update NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNicSummariesOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?array $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummariesOpeningBalances'][0] + ): PromiseInterface + { + return $this->updateNicSummariesOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $nicSummary, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNicSummariesOpeningBalancesAsyncWithHttpInfo + * + * Update NicSummaries + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNicSummariesOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummariesOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NicSummary[]'; + $request = $this->updateNicSummariesOpeningBalancesRequest($employerId, $employeeId, $taxYear, $nicSummary, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNicSummariesOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve Opening Balances (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummaries apply to (required) + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummariesOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNicSummariesOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummariesOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateNicSummariesOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateNicSummariesOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateNicSummariesOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nicSummary)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nicSummary)); + } else { + $httpBody = $nicSummary; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNicSummaryOpeningBalances + * + * Update NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NicSummary + */ + public function updateNicSummaryOpeningBalances( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummaryOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\NicSummary + { + list($response) = $this->updateNicSummaryOpeningBalancesWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary, $contentType); + return $response; + } + + /** + * Operation updateNicSummaryOpeningBalancesWithHttpInfo + * + * Update NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NicSummary, HTTP status code, HTTP response headers (array of strings) + */ + public function updateNicSummaryOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummaryOpeningBalances'][0] + ): array + { + $request = $this->updateNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NicSummary', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NicSummary' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NicSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NicSummary'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NicSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNicSummaryOpeningBalancesAsync + * + * Update NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNicSummaryOpeningBalancesAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $uniqueId, + ?\SynergiTech\Staffology\Model\NicSummary $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + return $this->updateNicSummaryOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNicSummaryOpeningBalancesAsyncWithHttpInfo + * + * Update NicSummary + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNicSummaryOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummaryOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NicSummary'; + $request = $this->updateNicSummaryOpeningBalancesRequest($employerId, $employeeId, $taxYear, $uniqueId, $nicSummary, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNicSummaryOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Nic Summary (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the NicSummary applies to (required) + * @param string $uniqueId The Id of the NicSummary (required) + * @param \SynergiTech\Staffology\Model\NicSummary|null $nicSummary (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNicSummaryOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNicSummaryOpeningBalancesRequest( + $employerId, + $employeeId, + $taxYear, + $uniqueId, + $nicSummary = null, + string $contentType = self::contentTypes['updateNicSummaryOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updateNicSummaryOpeningBalances' + ); + } + + // verify the required parameter 'uniqueId' is set + if ($uniqueId === null || (is_array($uniqueId) && count($uniqueId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $uniqueId when calling updateNicSummaryOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/nic/{taxYear}/{uniqueId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($uniqueId !== null) { + $resourcePath = str_replace( + '{' . 'uniqueId' . '}', + ObjectSerializer::toPathValue($uniqueId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nicSummary)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nicSummary)); + } else { + $httpBody = $nicSummary; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOpeningBalances + * + * Update Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Opening Balances (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OpeningBalances + */ + public function updateOpeningBalances( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\OpeningBalances + { + list($response) = $this->updateOpeningBalancesWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType); + return $response; + } + + /** + * Operation updateOpeningBalancesWithHttpInfo + * + * Update Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Opening Balances (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateOpeningBalances'][0] + ): array + { + $request = $this->updateOpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOpeningBalancesAsync + * + * Update Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Opening Balances (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOpeningBalancesAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateOpeningBalances'][0] + ): PromiseInterface + { + return $this->updateOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOpeningBalancesAsyncWithHttpInfo + * + * Update Opening Balances + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Opening Balances (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + $request = $this->updateOpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Opening Balances (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOpeningBalancesRequest( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($openingBalances)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($openingBalances)); + } else { + $httpBody = $openingBalances; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateP45OpeningBalances + * + * Update P45 Value + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update P45 figures (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP45OpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OpeningBalances + */ + public function updateP45OpeningBalances( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateP45OpeningBalances'][0] + ): \SynergiTech\Staffology\Model\OpeningBalances + { + list($response) = $this->updateP45OpeningBalancesWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType); + return $response; + } + + /** + * Operation updateP45OpeningBalancesWithHttpInfo + * + * Update P45 Value + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update P45 figures (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP45OpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function updateP45OpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateP45OpeningBalances'][0] + ): array + { + $request = $this->updateP45OpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateP45OpeningBalancesAsync + * + * Update P45 Value + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update P45 figures (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP45OpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateP45OpeningBalancesAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateP45OpeningBalances'][0] + ): PromiseInterface + { + return $this->updateP45OpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateP45OpeningBalancesAsyncWithHttpInfo + * + * Update P45 Value + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update P45 figures (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP45OpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateP45OpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateP45OpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + $request = $this->updateP45OpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateP45OpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update P45 figures (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP45OpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateP45OpeningBalancesRequest( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateP45OpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateP45OpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateP45OpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/p45'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($openingBalances)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($openingBalances)); + } else { + $httpBody = $openingBalances; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTerminationPaymentsOpeningBalances + * + * Update Termination Pay + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Termination Payments (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTerminationPaymentsOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OpeningBalances + */ + public function updateTerminationPaymentsOpeningBalances( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateTerminationPaymentsOpeningBalances'][0] + ): \SynergiTech\Staffology\Model\OpeningBalances + { + list($response) = $this->updateTerminationPaymentsOpeningBalancesWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType); + return $response; + } + + /** + * Operation updateTerminationPaymentsOpeningBalancesWithHttpInfo + * + * Update Termination Pay + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Termination Payments (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTerminationPaymentsOpeningBalances'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OpeningBalances, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTerminationPaymentsOpeningBalancesWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateTerminationPaymentsOpeningBalances'][0] + ): array + { + $request = $this->updateTerminationPaymentsOpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OpeningBalances', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OpeningBalances' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OpeningBalances', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OpeningBalances', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTerminationPaymentsOpeningBalancesAsync + * + * Update Termination Pay + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Termination Payments (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTerminationPaymentsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTerminationPaymentsOpeningBalancesAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\OpeningBalances $openingBalances = null, + string $contentType = self::contentTypes['updateTerminationPaymentsOpeningBalances'][0] + ): PromiseInterface + { + return $this->updateTerminationPaymentsOpeningBalancesAsyncWithHttpInfo($employerId, $employeeId, $openingBalances, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTerminationPaymentsOpeningBalancesAsyncWithHttpInfo + * + * Update Termination Pay + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Termination Payments (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTerminationPaymentsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTerminationPaymentsOpeningBalancesAsyncWithHttpInfo( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateTerminationPaymentsOpeningBalances'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OpeningBalances'; + $request = $this->updateTerminationPaymentsOpeningBalancesRequest($employerId, $employeeId, $openingBalances, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTerminationPaymentsOpeningBalances' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update Termination Payments (required) + * @param \SynergiTech\Staffology\Model\OpeningBalances|null $openingBalances (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTerminationPaymentsOpeningBalances'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTerminationPaymentsOpeningBalancesRequest( + $employerId, + $employeeId, + $openingBalances = null, + string $contentType = self::contentTypes['updateTerminationPaymentsOpeningBalances'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateTerminationPaymentsOpeningBalances' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateTerminationPaymentsOpeningBalances' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/openingBalances/terminationpayments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($openingBalances)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($openingBalances)); + } else { + $httpBody = $openingBalances; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/P11HistoryApi.php b/src/Api/P11HistoryApi.php new file mode 100644 index 0000000..9d69ea8 --- /dev/null +++ b/src/Api/P11HistoryApi.php @@ -0,0 +1,1546 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteP11History' => [ + 'application/json', + ], + 'listPagedP11History' => [ + 'application/json', + ], + 'updateP11History' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createP11History + * + * Create P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest[]|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createP11History( + string $employerId, + string $employeeId, + ?array $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['createP11History'][0] + ): void + { + $this->createP11HistoryWithHttpInfo($employerId, $employeeId, $contractP11HistoryRequest, $contentType); + } + + /** + * Operation createP11HistoryWithHttpInfo + * + * Create P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest[]|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createP11HistoryWithHttpInfo( + string $employerId, + string $employeeId, + ?array $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['createP11History'][0] + ): array + { + $request = $this->createP11HistoryRequest($employerId, $employeeId, $contractP11HistoryRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createP11HistoryAsync + * + * Create P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest[]|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createP11HistoryAsync( + string $employerId, + string $employeeId, + ?array $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['createP11History'][0] + ): PromiseInterface + { + return $this->createP11HistoryAsyncWithHttpInfo($employerId, $employeeId, $contractP11HistoryRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createP11HistoryAsyncWithHttpInfo + * + * Create P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest[]|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createP11HistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['createP11History'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createP11HistoryRequest($employerId, $employeeId, $contractP11HistoryRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createP11History' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest[]|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createP11HistoryRequest( + $employerId, + $employeeId, + $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['createP11History'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createP11History' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createP11History' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/p11history'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractP11HistoryRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractP11HistoryRequest)); + } else { + $httpBody = $contractP11HistoryRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteP11History + * + * Delete P11 Historical data + * + * @param string $id (required) + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteP11History( + string $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteP11History'][0] + ): void + { + $this->deleteP11HistoryWithHttpInfo($id, $employerId, $employeeId, $contentType); + } + + /** + * Operation deleteP11HistoryWithHttpInfo + * + * Delete P11 Historical data + * + * @param string $id (required) + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteP11HistoryWithHttpInfo( + string $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteP11History'][0] + ): array + { + $request = $this->deleteP11HistoryRequest($id, $employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteP11HistoryAsync + * + * Delete P11 Historical data + * + * @param string $id (required) + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteP11HistoryAsync( + string $id, + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['deleteP11History'][0] + ): PromiseInterface + { + return $this->deleteP11HistoryAsyncWithHttpInfo($id, $employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteP11HistoryAsyncWithHttpInfo + * + * Delete P11 Historical data + * + * @param string $id (required) + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteP11HistoryAsyncWithHttpInfo( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['deleteP11History'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteP11HistoryRequest($id, $employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteP11History' + * + * @param string $id (required) + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteP11HistoryRequest( + $id, + $employerId, + $employeeId, + string $contentType = self::contentTypes['deleteP11History'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteP11History' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteP11History' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deleteP11History' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/p11history/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listPagedP11History + * + * Retrieve P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPagedP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractP11HistoryResponse[] + */ + public function listPagedP11History( + string $employerId, + string $employeeId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listPagedP11History'][0] + ): array + { + list($response) = $this->listPagedP11HistoryWithHttpInfo($employerId, $employeeId, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation listPagedP11HistoryWithHttpInfo + * + * Retrieve P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPagedP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractP11HistoryResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function listPagedP11HistoryWithHttpInfo( + string $employerId, + string $employeeId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listPagedP11History'][0] + ): array + { + $request = $this->listPagedP11HistoryRequest($employerId, $employeeId, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listPagedP11HistoryAsync + * + * Retrieve P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPagedP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPagedP11HistoryAsync( + string $employerId, + string $employeeId, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['listPagedP11History'][0] + ): PromiseInterface + { + return $this->listPagedP11HistoryAsyncWithHttpInfo($employerId, $employeeId, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listPagedP11HistoryAsyncWithHttpInfo + * + * Retrieve P11 Historical data + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPagedP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPagedP11HistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['listPagedP11History'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractP11HistoryResponse[]'; + $request = $this->listPagedP11HistoryRequest($employerId, $employeeId, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listPagedP11History' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPagedP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listPagedP11HistoryRequest( + $employerId, + $employeeId, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['listPagedP11History'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listPagedP11History' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling listPagedP11History' + ); + } + + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/p11history'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateP11History + * + * Update P11 Historical entry + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $id The unique id of the record (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractP11HistoryResponse|\SynergiTech\Staffology\Model\ContractP11HistoryResponse + */ + public function updateP11History( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractP11HistoryRequest $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['updateP11History'][0] + ): \SynergiTech\Staffology\Model\ContractP11HistoryResponse + { + list($response) = $this->updateP11HistoryWithHttpInfo($employerId, $employeeId, $id, $contractP11HistoryRequest, $contentType); + return $response; + } + + /** + * Operation updateP11HistoryWithHttpInfo + * + * Update P11 Historical entry + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $id The unique id of the record (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP11History'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractP11HistoryResponse|\SynergiTech\Staffology\Model\ContractP11HistoryResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateP11HistoryWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractP11HistoryRequest $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['updateP11History'][0] + ): array + { + $request = $this->updateP11HistoryRequest($employerId, $employeeId, $id, $contractP11HistoryRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractP11HistoryResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractP11HistoryResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractP11HistoryResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if (in_array('\SynergiTech\Staffology\Model\ContractP11HistoryResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractP11HistoryResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractP11HistoryResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractP11HistoryResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractP11HistoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractP11HistoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateP11HistoryAsync + * + * Update P11 Historical entry + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $id The unique id of the record (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateP11HistoryAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\ContractP11HistoryRequest $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['updateP11History'][0] + ): PromiseInterface + { + return $this->updateP11HistoryAsyncWithHttpInfo($employerId, $employeeId, $id, $contractP11HistoryRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateP11HistoryAsyncWithHttpInfo + * + * Update P11 Historical entry + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $id The unique id of the record (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateP11HistoryAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['updateP11History'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractP11HistoryResponse'; + $request = $this->updateP11HistoryRequest($employerId, $employeeId, $id, $contractP11HistoryRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateP11History' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param string $id The unique id of the record (required) + * @param \SynergiTech\Staffology\Model\ContractP11HistoryRequest|null $contractP11HistoryRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateP11History'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateP11HistoryRequest( + $employerId, + $employeeId, + $id, + $contractP11HistoryRequest = null, + string $contentType = self::contentTypes['updateP11History'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateP11History' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateP11History' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateP11History' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/p11history/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractP11HistoryRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractP11HistoryRequest)); + } else { + $httpBody = $contractP11HistoryRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayCodeApi.php b/src/Api/PayCodeApi.php new file mode 100644 index 0000000..26baea6 --- /dev/null +++ b/src/Api/PayCodeApi.php @@ -0,0 +1,3498 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePayCode' => [ + 'application/json', + ], + 'deletePayCodePayCode' => [ + 'application/json', + ], + 'getPayCode' => [ + 'application/json', + ], + 'getPayCodePayCode' => [ + 'application/json', + ], + 'indexPayCode' => [ + 'application/json', + ], + 'nominalCodeMappingsPayCode' => [ + 'application/json', + ], + 'updateNominalCodeMappingsPayCode' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePayCode' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePayCodePayCode' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPayCode + * + * Create PayCode + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\PayCode + */ + public function createPayCode( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['createPayCode'][0] + ): \SynergiTech\Staffology\Model\PayCode + { + list($response) = $this->createPayCodeWithHttpInfo($employerId, $payCode, $contentType); + return $response; + } + + /** + * Operation createPayCodeWithHttpInfo + * + * Create PayCode + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\PayCode, HTTP status code, HTTP response headers (array of strings) + */ + public function createPayCodeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['createPayCode'][0] + ): array + { + $request = $this->createPayCodeRequest($employerId, $payCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\PayCode', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPayCodeAsync + * + * Create PayCode + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayCodeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['createPayCode'][0] + ): PromiseInterface + { + return $this->createPayCodeAsyncWithHttpInfo($employerId, $payCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPayCodeAsyncWithHttpInfo + * + * Create PayCode + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayCodeAsyncWithHttpInfo( + $employerId, + $payCode = null, + string $contentType = self::contentTypes['createPayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + $request = $this->createPayCodeRequest($employerId, $payCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPayCode' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPayCodeRequest( + $employerId, + $payCode = null, + string $contentType = self::contentTypes['createPayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payCode)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payCode)); + } else { + $httpBody = $payCode; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayCode + * + * Delete PayCode (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayCode( + string $employerId, + string $code, + string $contentType = self::contentTypes['deletePayCode'][0] + ): void + { + $this->deletePayCodeWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deletePayCodeWithHttpInfo + * + * Delete PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayCodeWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['deletePayCode'][0] + ): array + { + $request = $this->deletePayCodeRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayCodeAsync + * + * Delete PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodeAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['deletePayCode'][0] + ): PromiseInterface + { + return $this->deletePayCodeAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayCodeAsyncWithHttpInfo + * + * Delete PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodeAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['deletePayCode'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayCodeRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayCode' + * + * @param string $employerId (required) + * @param string $code (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayCodeRequest( + $employerId, + $code, + string $contentType = self::contentTypes['deletePayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePayCode' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deletePayCode' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayCodePayCode + * + * Delete PayCode + * + * @param string $employerId employerId (required) + * @param string|null $code code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayCodePayCode( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deletePayCodePayCode'][0] + ): void + { + $this->deletePayCodePayCodeWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deletePayCodePayCodeWithHttpInfo + * + * Delete PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayCodePayCodeWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deletePayCodePayCode'][0] + ): array + { + $request = $this->deletePayCodePayCodeRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayCodePayCodeAsync + * + * Delete PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodePayCodeAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deletePayCodePayCode'][0] + ): PromiseInterface + { + return $this->deletePayCodePayCodeAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayCodePayCodeAsyncWithHttpInfo + * + * Delete PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodePayCodeAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['deletePayCodePayCode'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayCodePayCodeRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayCodePayCode' + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayCodePayCodeRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['deletePayCodePayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePayCodePayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes/paycode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayCode + * + * Get PayCode (deprecated) + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string $code The code of the Pay Code you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode + */ + public function getPayCode( + string $employerId, + string $code, + string $contentType = self::contentTypes['getPayCode'][0] + ): \SynergiTech\Staffology\Model\PayCode + { + list($response) = $this->getPayCodeWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getPayCodeWithHttpInfo + * + * Get PayCode (deprecated) + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string $code The code of the Pay Code you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayCodeWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['getPayCode'][0] + ): array + { + $request = $this->getPayCodeRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayCodeAsync + * + * Get PayCode (deprecated) + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string $code The code of the Pay Code you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodeAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['getPayCode'][0] + ): PromiseInterface + { + return $this->getPayCodeAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayCodeAsyncWithHttpInfo + * + * Get PayCode (deprecated) + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string $code The code of the Pay Code you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodeAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['getPayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + $request = $this->getPayCodeRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayCode' + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string $code The code of the Pay Code you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayCodeRequest( + $employerId, + $code, + string $contentType = self::contentTypes['getPayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayCode' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getPayCode' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayCodePayCode + * + * Get PayCode + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string|null $code The code of the Pay Code you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode + */ + public function getPayCodePayCode( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getPayCodePayCode'][0] + ): \SynergiTech\Staffology\Model\PayCode + { + list($response) = $this->getPayCodePayCodeWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getPayCodePayCodeWithHttpInfo + * + * Get PayCode + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string|null $code The code of the Pay Code you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayCodePayCodeWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getPayCodePayCode'][0] + ): array + { + $request = $this->getPayCodePayCodeRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayCodePayCodeAsync + * + * Get PayCode + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string|null $code The code of the Pay Code you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodePayCodeAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getPayCodePayCode'][0] + ): PromiseInterface + { + return $this->getPayCodePayCodeAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayCodePayCodeAsyncWithHttpInfo + * + * Get PayCode + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string|null $code The code of the Pay Code you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodePayCodeAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['getPayCodePayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + $request = $this->getPayCodePayCodeRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayCodePayCode' + * + * @param string $employerId The Id of the Employer to which the Pay Code belongs. (required) + * @param string|null $code The code of the Pay Code you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayCodePayCodeRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['getPayCodePayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayCodePayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes/paycode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPayCode + * + * List PayCodes + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param bool|null $verbose If provided and set to true then full details of all Pay Codes will be returned instead of just a summary (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode[] + */ + public function indexPayCode( + string $employerId, + ?bool $verbose = false, + string $contentType = self::contentTypes['indexPayCode'][0] + ): array + { + list($response) = $this->indexPayCodeWithHttpInfo($employerId, $verbose, $contentType); + return $response; + } + + /** + * Operation indexPayCodeWithHttpInfo + * + * List PayCodes + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param bool|null $verbose If provided and set to true then full details of all Pay Codes will be returned instead of just a summary (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPayCodeWithHttpInfo( + string $employerId, + ?bool $verbose = false, + string $contentType = self::contentTypes['indexPayCode'][0] + ): array + { + $request = $this->indexPayCodeRequest($employerId, $verbose, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPayCodeAsync + * + * List PayCodes + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param bool|null $verbose If provided and set to true then full details of all Pay Codes will be returned instead of just a summary (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayCodeAsync( + string $employerId, + ?bool $verbose = false, + string $contentType = self::contentTypes['indexPayCode'][0] + ): PromiseInterface + { + return $this->indexPayCodeAsyncWithHttpInfo($employerId, $verbose, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPayCodeAsyncWithHttpInfo + * + * List PayCodes + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param bool|null $verbose If provided and set to true then full details of all Pay Codes will be returned instead of just a summary (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayCodeAsyncWithHttpInfo( + $employerId, + $verbose = false, + string $contentType = self::contentTypes['indexPayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode[]'; + $request = $this->indexPayCodeRequest($employerId, $verbose, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPayCode' + * + * @param string $employerId The Id of the Employer for which you want to list Pay Codes (required) + * @param bool|null $verbose If provided and set to true then full details of all Pay Codes will be returned instead of just a summary (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPayCodeRequest( + $employerId, + $verbose = false, + string $contentType = self::contentTypes['indexPayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $verbose, + 'verbose', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation nominalCodeMappingsPayCode + * + * Get Nominal Code Mappings + * + * @param string $employerId The Id of the Employer for which you want to get the mapping (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NominalCodeMapping[] + */ + public function nominalCodeMappingsPayCode( + string $employerId, + string $contentType = self::contentTypes['nominalCodeMappingsPayCode'][0] + ): array + { + list($response) = $this->nominalCodeMappingsPayCodeWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation nominalCodeMappingsPayCodeWithHttpInfo + * + * Get Nominal Code Mappings + * + * @param string $employerId The Id of the Employer for which you want to get the mapping (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NominalCodeMapping[], HTTP status code, HTTP response headers (array of strings) + */ + public function nominalCodeMappingsPayCodeWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['nominalCodeMappingsPayCode'][0] + ): array + { + $request = $this->nominalCodeMappingsPayCodeRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NominalCodeMapping[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NominalCodeMapping[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NominalCodeMapping[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NominalCodeMapping[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NominalCodeMapping[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation nominalCodeMappingsPayCodeAsync + * + * Get Nominal Code Mappings + * + * @param string $employerId The Id of the Employer for which you want to get the mapping (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function nominalCodeMappingsPayCodeAsync( + string $employerId, + string $contentType = self::contentTypes['nominalCodeMappingsPayCode'][0] + ): PromiseInterface + { + return $this->nominalCodeMappingsPayCodeAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation nominalCodeMappingsPayCodeAsyncWithHttpInfo + * + * Get Nominal Code Mappings + * + * @param string $employerId The Id of the Employer for which you want to get the mapping (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function nominalCodeMappingsPayCodeAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['nominalCodeMappingsPayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NominalCodeMapping[]'; + $request = $this->nominalCodeMappingsPayCodeRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'nominalCodeMappingsPayCode' + * + * @param string $employerId The Id of the Employer for which you want to get the mapping (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['nominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function nominalCodeMappingsPayCodeRequest( + $employerId, + string $contentType = self::contentTypes['nominalCodeMappingsPayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling nominalCodeMappingsPayCode' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodes/nominalcodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNominalCodeMappingsPayCode + * + * Updates Nominal Code Mappings + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\NominalCodeMapping[]|null $nominalCodeMapping nominalCodeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NominalCodeMapping[] + */ + public function updateNominalCodeMappingsPayCode( + string $employerId, + ?array $nominalCodeMapping = null, + string $contentType = self::contentTypes['updateNominalCodeMappingsPayCode'][0] + ): array + { + list($response) = $this->updateNominalCodeMappingsPayCodeWithHttpInfo($employerId, $nominalCodeMapping, $contentType); + return $response; + } + + /** + * Operation updateNominalCodeMappingsPayCodeWithHttpInfo + * + * Updates Nominal Code Mappings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\NominalCodeMapping[]|null $nominalCodeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NominalCodeMapping[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateNominalCodeMappingsPayCodeWithHttpInfo( + string $employerId, + ?array $nominalCodeMapping = null, + string $contentType = self::contentTypes['updateNominalCodeMappingsPayCode'][0] + ): array + { + $request = $this->updateNominalCodeMappingsPayCodeRequest($employerId, $nominalCodeMapping, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NominalCodeMapping[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NominalCodeMapping[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NominalCodeMapping[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NominalCodeMapping[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NominalCodeMapping[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNominalCodeMappingsPayCodeAsync + * + * Updates Nominal Code Mappings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\NominalCodeMapping[]|null $nominalCodeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNominalCodeMappingsPayCodeAsync( + string $employerId, + ?array $nominalCodeMapping = null, + string $contentType = self::contentTypes['updateNominalCodeMappingsPayCode'][0] + ): PromiseInterface + { + return $this->updateNominalCodeMappingsPayCodeAsyncWithHttpInfo($employerId, $nominalCodeMapping, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNominalCodeMappingsPayCodeAsyncWithHttpInfo + * + * Updates Nominal Code Mappings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\NominalCodeMapping[]|null $nominalCodeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateNominalCodeMappingsPayCodeAsyncWithHttpInfo( + $employerId, + $nominalCodeMapping = null, + string $contentType = self::contentTypes['updateNominalCodeMappingsPayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NominalCodeMapping[]'; + $request = $this->updateNominalCodeMappingsPayCodeRequest($employerId, $nominalCodeMapping, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNominalCodeMappingsPayCode' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\NominalCodeMapping[]|null $nominalCodeMapping (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNominalCodeMappingsPayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNominalCodeMappingsPayCodeRequest( + $employerId, + $nominalCodeMapping = null, + string $contentType = self::contentTypes['updateNominalCodeMappingsPayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateNominalCodeMappingsPayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes/nominalcodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($nominalCodeMapping)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($nominalCodeMapping)); + } else { + $httpBody = $nominalCodeMapping; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayCode + * + * Update PayCode (deprecated) + * + * @param string $employerId employerId (required) + * @param string $code code (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode + */ + public function updatePayCode( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCode'][0] + ): \SynergiTech\Staffology\Model\PayCode + { + list($response) = $this->updatePayCodeWithHttpInfo($employerId, $code, $payCode, $contentType); + return $response; + } + + /** + * Operation updatePayCodeWithHttpInfo + * + * Update PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayCodeWithHttpInfo( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCode'][0] + ): array + { + $request = $this->updatePayCodeRequest($employerId, $code, $payCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayCodeAsync + * + * Update PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodeAsync( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCode'][0] + ): PromiseInterface + { + return $this->updatePayCodeAsyncWithHttpInfo($employerId, $code, $payCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayCodeAsyncWithHttpInfo + * + * Update PayCode (deprecated) + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodeAsyncWithHttpInfo( + $employerId, + $code, + $payCode = null, + string $contentType = self::contentTypes['updatePayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + $request = $this->updatePayCodeRequest($employerId, $code, $payCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayCode' + * + * @param string $employerId (required) + * @param string $code (required) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayCodeRequest( + $employerId, + $code, + $payCode = null, + string $contentType = self::contentTypes['updatePayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayCode' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updatePayCode' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodes/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payCode)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payCode)); + } else { + $httpBody = $payCode; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayCodePayCode + * + * Update PayCode + * + * @param string $employerId employerId (required) + * @param string|null $code code (optional) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode + */ + public function updatePayCodePayCode( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCodePayCode'][0] + ): \SynergiTech\Staffology\Model\PayCode + { + list($response) = $this->updatePayCodePayCodeWithHttpInfo($employerId, $code, $payCode, $contentType); + return $response; + } + + /** + * Operation updatePayCodePayCodeWithHttpInfo + * + * Update PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodePayCode'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayCodePayCodeWithHttpInfo( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCodePayCode'][0] + ): array + { + $request = $this->updatePayCodePayCodeRequest($employerId, $code, $payCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayCodePayCodeAsync + * + * Update PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodePayCodeAsync( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\PayCode $payCode = null, + string $contentType = self::contentTypes['updatePayCodePayCode'][0] + ): PromiseInterface + { + return $this->updatePayCodePayCodeAsyncWithHttpInfo($employerId, $code, $payCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayCodePayCodeAsyncWithHttpInfo + * + * Update PayCode + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodePayCodeAsyncWithHttpInfo( + $employerId, + $code = null, + $payCode = null, + string $contentType = self::contentTypes['updatePayCodePayCode'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode'; + $request = $this->updatePayCodePayCodeRequest($employerId, $code, $payCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayCodePayCode' + * + * @param string $employerId (required) + * @param string|null $code (optional) + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodePayCode'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayCodePayCodeRequest( + $employerId, + $code = null, + $payCode = null, + string $contentType = self::contentTypes['updatePayCodePayCode'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayCodePayCode' + ); + } + + + + + $resourcePath = '/employers/{employerId}/paycodes/paycode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payCode)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payCode)); + } else { + $httpBody = $payCode; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayCodeSetApi.php b/src/Api/PayCodeSetApi.php new file mode 100644 index 0000000..afd7ce2 --- /dev/null +++ b/src/Api/PayCodeSetApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePayCodeSet' => [ + 'application/json', + ], + 'getPayCodeSet' => [ + 'application/json', + ], + 'indexPayCodeSet' => [ + 'application/json', + ], + 'updatePayCodeSet' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPayCodeSet + * + * Create PayCodeSet + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\PayCodeSet + */ + public function createPayCodeSet( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['createPayCodeSet'][0] + ): \SynergiTech\Staffology\Model\PayCodeSet + { + list($response) = $this->createPayCodeSetWithHttpInfo($employerId, $payCodeSet, $contentType); + return $response; + } + + /** + * Operation createPayCodeSetWithHttpInfo + * + * Create PayCodeSet + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\PayCodeSet, HTTP status code, HTTP response headers (array of strings) + */ + public function createPayCodeSetWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['createPayCodeSet'][0] + ): array + { + $request = $this->createPayCodeSetRequest($employerId, $payCodeSet, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\PayCodeSet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCodeSet' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCodeSet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCodeSet', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPayCodeSetAsync + * + * Create PayCodeSet + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayCodeSetAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['createPayCodeSet'][0] + ): PromiseInterface + { + return $this->createPayCodeSetAsyncWithHttpInfo($employerId, $payCodeSet, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPayCodeSetAsyncWithHttpInfo + * + * Create PayCodeSet + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayCodeSetAsyncWithHttpInfo( + $employerId, + $payCodeSet = null, + string $contentType = self::contentTypes['createPayCodeSet'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + $request = $this->createPayCodeSetRequest($employerId, $payCodeSet, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPayCodeSet' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPayCodeSetRequest( + $employerId, + $payCodeSet = null, + string $contentType = self::contentTypes['createPayCodeSet'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPayCodeSet' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodesets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payCodeSet)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payCodeSet)); + } else { + $httpBody = $payCodeSet; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayCodeSet + * + * Delete PayCodeSet + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayCodeSet( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayCodeSet'][0] + ): void + { + $this->deletePayCodeSetWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePayCodeSetWithHttpInfo + * + * Delete PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayCodeSetWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayCodeSet'][0] + ): array + { + $request = $this->deletePayCodeSetRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayCodeSetAsync + * + * Delete PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodeSetAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayCodeSet'][0] + ): PromiseInterface + { + return $this->deletePayCodeSetAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayCodeSetAsyncWithHttpInfo + * + * Delete PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayCodeSetAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePayCodeSet'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayCodeSetRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayCodeSet' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayCodeSetRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePayCodeSet'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePayCodeSet' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePayCodeSet' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodesets/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayCodeSet + * + * Get PayCodeSet + * + * @param string $employerId The Id of the Employer to which the Pay Code Set belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\PayCodeSet + */ + public function getPayCodeSet( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayCodeSet'][0] + ): \SynergiTech\Staffology\Model\PayCodeSet + { + list($response) = $this->getPayCodeSetWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getPayCodeSetWithHttpInfo + * + * Get PayCodeSet + * + * @param string $employerId The Id of the Employer to which the Pay Code Set belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\PayCodeSet, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayCodeSetWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayCodeSet'][0] + ): array + { + $request = $this->getPayCodeSetRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCodeSet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCodeSet' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCodeSet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCodeSet', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayCodeSetAsync + * + * Get PayCodeSet + * + * @param string $employerId The Id of the Employer to which the Pay Code Set belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodeSetAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayCodeSet'][0] + ): PromiseInterface + { + return $this->getPayCodeSetAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayCodeSetAsyncWithHttpInfo + * + * Get PayCodeSet + * + * @param string $employerId The Id of the Employer to which the Pay Code Set belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayCodeSetAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getPayCodeSet'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + $request = $this->getPayCodeSetRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayCodeSet' + * + * @param string $employerId The Id of the Employer to which the Pay Code Set belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayCodeSetRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getPayCodeSet'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayCodeSet' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPayCodeSet' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodesets/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPayCodeSet + * + * List PayCodeSets + * + * @param string $employerId The Id of the Employer for which you want to list PayCodeSets (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexPayCodeSet( + string $employerId, + string $contentType = self::contentTypes['indexPayCodeSet'][0] + ): array + { + list($response) = $this->indexPayCodeSetWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexPayCodeSetWithHttpInfo + * + * List PayCodeSets + * + * @param string $employerId The Id of the Employer for which you want to list PayCodeSets (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPayCodeSetWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexPayCodeSet'][0] + ): array + { + $request = $this->indexPayCodeSetRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPayCodeSetAsync + * + * List PayCodeSets + * + * @param string $employerId The Id of the Employer for which you want to list PayCodeSets (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayCodeSetAsync( + string $employerId, + string $contentType = self::contentTypes['indexPayCodeSet'][0] + ): PromiseInterface + { + return $this->indexPayCodeSetAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPayCodeSetAsyncWithHttpInfo + * + * List PayCodeSets + * + * @param string $employerId The Id of the Employer for which you want to list PayCodeSets (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayCodeSetAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexPayCodeSet'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexPayCodeSetRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPayCodeSet' + * + * @param string $employerId The Id of the Employer for which you want to list PayCodeSets (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPayCodeSetRequest( + $employerId, + string $contentType = self::contentTypes['indexPayCodeSet'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPayCodeSet' + ); + } + + + $resourcePath = '/employers/{employerId}/paycodesets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayCodeSet + * + * Update PayCodeSet + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCodeSet + */ + public function updatePayCodeSet( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['updatePayCodeSet'][0] + ): \SynergiTech\Staffology\Model\PayCodeSet + { + list($response) = $this->updatePayCodeSetWithHttpInfo($employerId, $id, $payCodeSet, $contentType); + return $response; + } + + /** + * Operation updatePayCodeSetWithHttpInfo + * + * Update PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodeSet'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCodeSet, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayCodeSetWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['updatePayCodeSet'][0] + ): array + { + $request = $this->updatePayCodeSetRequest($employerId, $id, $payCodeSet, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCodeSet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCodeSet' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCodeSet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCodeSet', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayCodeSetAsync + * + * Update PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodeSetAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PayCodeSet $payCodeSet = null, + string $contentType = self::contentTypes['updatePayCodeSet'][0] + ): PromiseInterface + { + return $this->updatePayCodeSetAsyncWithHttpInfo($employerId, $id, $payCodeSet, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayCodeSetAsyncWithHttpInfo + * + * Update PayCodeSet + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayCodeSetAsyncWithHttpInfo( + $employerId, + $id, + $payCodeSet = null, + string $contentType = self::contentTypes['updatePayCodeSet'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCodeSet'; + $request = $this->updatePayCodeSetRequest($employerId, $id, $payCodeSet, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayCodeSet' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayCodeSet|null $payCodeSet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayCodeSet'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayCodeSetRequest( + $employerId, + $id, + $payCodeSet = null, + string $contentType = self::contentTypes['updatePayCodeSet'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayCodeSet' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePayCodeSet' + ); + } + + + + $resourcePath = '/employers/{employerId}/paycodesets/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payCodeSet)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payCodeSet)); + } else { + $httpBody = $payCodeSet; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayRunApi.php b/src/Api/PayRunApi.php new file mode 100644 index 0000000..ee51271 --- /dev/null +++ b/src/Api/PayRunApi.php @@ -0,0 +1,14217 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'aeoPayRun' => [ + 'application/json', + ], + 'calculateAverageHolidayPayPayRun' => [ + 'application/json', + ], + 'changesForPayRunEntryPayRun' => [ + 'application/json', + ], + 'changesPayRun' => [ + 'application/json', + ], + 'createNextPayRunPayRun' => [ + 'application/json', + ], + 'deletePayRun' => [ + 'application/json', + ], + 'emailMultipleP45sPayRun' => [ + 'application/json', + ], + 'finalisePayRunPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'getPayRunEntryPayRun' => [ + 'application/json', + ], + 'getPayRunEventsPayRun' => [ + 'application/json', + ], + 'getPayRunJournalPayRun' => [ + 'application/json', + ], + 'getPayRunPayCodesPayRun' => [ + 'application/json', + ], + 'getPayRunPayRun' => [ + 'application/json', + ], + 'getPayRunStateHistoryPayRun' => [ + 'application/json', + ], + 'getPayRunWarningsPayRun' => [ + 'application/json', + ], + 'getPayRunsPayRun' => [ + 'application/json', + ], + 'importPayPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'importTimeAndAttendancePayRun' => [ + 'application/json', + ], + 'importUmbrellaPayPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'lastPayRunEntryForEmployeePayRun' => [ + 'application/json', + ], + 'lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' => [ + 'application/json', + ], + 'leavePayRun' => [ + 'application/json', + ], + 'payRunEntryUmbrellaPaymentPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'reOpenPayRunPayRun' => [ + 'application/json', + ], + 'removePayRunEntriesPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'sendPayslipEmailsPayRun' => [ + 'application/json', + ], + 'startNextPayRunPayRun' => [ + 'application/json', + ], + 'updatePayRunEntryPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePayRunPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePaymentDatePayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'ytdPayRun' => [ + 'multipart/form-data', + ], + 'zeroisePayRunEntriesPayRun' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addPayRunEntriesPayRun + * + * Add PayRunEntries (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function addPayRunEntriesPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['addPayRunEntriesPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->addPayRunEntriesPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + return $response; + } + + /** + * Operation addPayRunEntriesPayRunWithHttpInfo + * + * Add PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function addPayRunEntriesPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['addPayRunEntriesPayRun'][0] + ): array + { + $request = $this->addPayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPayRunEntriesPayRunAsync + * + * Add PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addPayRunEntriesPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['addPayRunEntriesPayRun'][0] + ): PromiseInterface + { + return $this->addPayRunEntriesPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPayRunEntriesPayRunAsyncWithHttpInfo + * + * Add PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addPayRunEntriesPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['addPayRunEntriesPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->addPayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPayRunEntriesPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addPayRunEntriesPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['addPayRunEntriesPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addPayRunEntriesPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling addPayRunEntriesPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling addPayRunEntriesPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling addPayRunEntriesPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/addpayrunentries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aeoPayRun + * + * List AttachmentOrders related to a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function aeoPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['aeoPayRun'][0] + ): array + { + list($response) = $this->aeoPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation aeoPayRunWithHttpInfo + * + * List AttachmentOrders related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function aeoPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['aeoPayRun'][0] + ): array + { + $request = $this->aeoPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation aeoPayRunAsync + * + * List AttachmentOrders related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeoPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['aeoPayRun'][0] + ): PromiseInterface + { + return $this->aeoPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aeoPayRunAsyncWithHttpInfo + * + * List AttachmentOrders related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeoPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['aeoPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->aeoPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aeoPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aeoPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['aeoPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling aeoPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling aeoPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling aeoPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling aeoPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/aeo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation calculateAverageHolidayPayPayRun + * + * Calculate Average Holiday Pay Rate + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \DateTime $startDate The date we used to calculate average holiday pay from (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAverageHolidayPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return float + */ + public function calculateAverageHolidayPayPayRun( + string $employerId, + string $employeeId, + \DateTime $startDate, + string $contentType = self::contentTypes['calculateAverageHolidayPayPayRun'][0] + ): float + { + list($response) = $this->calculateAverageHolidayPayPayRunWithHttpInfo($employerId, $employeeId, $startDate, $contentType); + return $response; + } + + /** + * Operation calculateAverageHolidayPayPayRunWithHttpInfo + * + * Calculate Average Holiday Pay Rate + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \DateTime $startDate The date we used to calculate average holiday pay from (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAverageHolidayPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of float, HTTP status code, HTTP response headers (array of strings) + */ + public function calculateAverageHolidayPayPayRunWithHttpInfo( + string $employerId, + string $employeeId, + \DateTime $startDate, + string $contentType = self::contentTypes['calculateAverageHolidayPayPayRun'][0] + ): array + { + $request = $this->calculateAverageHolidayPayPayRunRequest($employerId, $employeeId, $startDate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation calculateAverageHolidayPayPayRunAsync + * + * Calculate Average Holiday Pay Rate + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \DateTime $startDate The date we used to calculate average holiday pay from (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAverageHolidayPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateAverageHolidayPayPayRunAsync( + string $employerId, + string $employeeId, + \DateTime $startDate, + string $contentType = self::contentTypes['calculateAverageHolidayPayPayRun'][0] + ): PromiseInterface + { + return $this->calculateAverageHolidayPayPayRunAsyncWithHttpInfo($employerId, $employeeId, $startDate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation calculateAverageHolidayPayPayRunAsyncWithHttpInfo + * + * Calculate Average Holiday Pay Rate + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \DateTime $startDate The date we used to calculate average holiday pay from (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAverageHolidayPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateAverageHolidayPayPayRunAsyncWithHttpInfo( + $employerId, + $employeeId, + $startDate, + string $contentType = self::contentTypes['calculateAverageHolidayPayPayRun'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->calculateAverageHolidayPayPayRunRequest($employerId, $employeeId, $startDate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'calculateAverageHolidayPayPayRun' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee (required) + * @param \DateTime $startDate The date we used to calculate average holiday pay from (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAverageHolidayPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function calculateAverageHolidayPayPayRunRequest( + $employerId, + $employeeId, + $startDate, + string $contentType = self::contentTypes['calculateAverageHolidayPayPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling calculateAverageHolidayPayPayRun' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling calculateAverageHolidayPayPayRun' + ); + } + + // verify the required parameter 'startDate' is set + if ($startDate === null || (is_array($startDate) && count($startDate) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $startDate when calling calculateAverageHolidayPayPayRun' + ); + } + + + $resourcePath = '/employers/{employerId}/payrun/employees/{employeeId}/averageholidaypayrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $startDate, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation changesForPayRunEntryPayRun + * + * List PayRun Changes for PayRunEntry + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $significantChangesOnly significantChangesOnly (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesForPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ChangeSummary[] + */ + public function changesForPayRunEntryPayRun( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $significantChangesOnly = false, + string $contentType = self::contentTypes['changesForPayRunEntryPayRun'][0] + ): array + { + list($response) = $this->changesForPayRunEntryPayRunWithHttpInfo($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly, $contentType); + return $response; + } + + /** + * Operation changesForPayRunEntryPayRunWithHttpInfo + * + * List PayRun Changes for PayRunEntry + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $significantChangesOnly (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesForPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ChangeSummary[], HTTP status code, HTTP response headers (array of strings) + */ + public function changesForPayRunEntryPayRunWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $significantChangesOnly = false, + string $contentType = self::contentTypes['changesForPayRunEntryPayRun'][0] + ): array + { + $request = $this->changesForPayRunEntryPayRunRequest($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ChangeSummary[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ChangeSummary[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ChangeSummary[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ChangeSummary[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ChangeSummary[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation changesForPayRunEntryPayRunAsync + * + * List PayRun Changes for PayRunEntry + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $significantChangesOnly (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesForPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesForPayRunEntryPayRunAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $significantChangesOnly = false, + string $contentType = self::contentTypes['changesForPayRunEntryPayRun'][0] + ): PromiseInterface + { + return $this->changesForPayRunEntryPayRunAsyncWithHttpInfo($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation changesForPayRunEntryPayRunAsyncWithHttpInfo + * + * List PayRun Changes for PayRunEntry + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $significantChangesOnly (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesForPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesForPayRunEntryPayRunAsyncWithHttpInfo( + $employerId, + $id, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $significantChangesOnly = false, + string $contentType = self::contentTypes['changesForPayRunEntryPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ChangeSummary[]'; + $request = $this->changesForPayRunEntryPayRunRequest($employerId, $id, $payPeriod, $periodNumber, $taxYear, $ordinal, $significantChangesOnly, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'changesForPayRunEntryPayRun' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $significantChangesOnly (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesForPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function changesForPayRunEntryPayRunRequest( + $employerId, + $id, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $significantChangesOnly = false, + string $contentType = self::contentTypes['changesForPayRunEntryPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling changesForPayRunEntryPayRun' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling changesForPayRunEntryPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling changesForPayRunEntryPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling changesForPayRunEntryPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling changesForPayRunEntryPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/changes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $significantChangesOnly, + 'significantChangesOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation changesPayRun + * + * List PayRun Changes + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunChanges + */ + public function changesPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['changesPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunChanges + { + list($response) = $this->changesPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation changesPayRunWithHttpInfo + * + * List PayRun Changes + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunChanges, HTTP status code, HTTP response headers (array of strings) + */ + public function changesPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['changesPayRun'][0] + ): array + { + $request = $this->changesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunChanges', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunChanges' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunChanges', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunChanges'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunChanges', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation changesPayRunAsync + * + * List PayRun Changes + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['changesPayRun'][0] + ): PromiseInterface + { + return $this->changesPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation changesPayRunAsyncWithHttpInfo + * + * List PayRun Changes + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['changesPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunChanges'; + $request = $this->changesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'changesPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function changesPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['changesPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling changesPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling changesPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling changesPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling changesPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/changes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createNextPayRunPayRun + * + * Starts the next PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNextPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function createNextPayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['createNextPayRunPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->createNextPayRunPayRunWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation createNextPayRunPayRunWithHttpInfo + * + * Starts the next PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNextPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function createNextPayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['createNextPayRunPayRun'][0] + ): array + { + $request = $this->createNextPayRunPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createNextPayRunPayRunAsync + * + * Starts the next PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNextPayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['createNextPayRunPayRun'][0] + ): PromiseInterface + { + return $this->createNextPayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createNextPayRunPayRunAsyncWithHttpInfo + * + * Starts the next PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createNextPayRunPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['createNextPayRunPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->createNextPayRunPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createNextPayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createNextPayRunPayRunRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['createNextPayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createNextPayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling createNextPayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createNextPayRunPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayRun + * + * Delete a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['deletePayRun'][0] + ): void + { + $this->deletePayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + } + + /** + * Operation deletePayRunWithHttpInfo + * + * Delete a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['deletePayRun'][0] + ): array + { + $request = $this->deletePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayRunAsync + * + * Delete a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['deletePayRun'][0] + ): PromiseInterface + { + return $this->deletePayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayRunAsyncWithHttpInfo + * + * Delete a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['deletePayRun'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['deletePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling deletePayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling deletePayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deletePayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailMultipleP45sPayRun + * + * (Re)send P45 Emails + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailMultipleP45sPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailMultipleP45sPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['emailMultipleP45sPayRun'][0] + ): void + { + $this->emailMultipleP45sPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + } + + /** + * Operation emailMultipleP45sPayRunWithHttpInfo + * + * (Re)send P45 Emails + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailMultipleP45sPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailMultipleP45sPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['emailMultipleP45sPayRun'][0] + ): array + { + $request = $this->emailMultipleP45sPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailMultipleP45sPayRunAsync + * + * (Re)send P45 Emails + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailMultipleP45sPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailMultipleP45sPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['emailMultipleP45sPayRun'][0] + ): PromiseInterface + { + return $this->emailMultipleP45sPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailMultipleP45sPayRunAsyncWithHttpInfo + * + * (Re)send P45 Emails + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailMultipleP45sPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailMultipleP45sPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['emailMultipleP45sPayRun'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailMultipleP45sPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailMultipleP45sPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailMultipleP45sPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailMultipleP45sPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['emailMultipleP45sPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailMultipleP45sPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling emailMultipleP45sPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling emailMultipleP45sPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling emailMultipleP45sPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/p45/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation finalisePayRunPayRun + * + * Finalise a PayRun (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param array|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['finalisePayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return bool + */ + public function finalisePayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['finalisePayRunPayRun'][0] + ): bool + { + list($response) = $this->finalisePayRunPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + return $response; + } + + /** + * Operation finalisePayRunPayRunWithHttpInfo + * + * Finalise a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param array|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['finalisePayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of bool, HTTP status code, HTTP response headers (array of strings) + */ + public function finalisePayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['finalisePayRunPayRun'][0] + ): array + { + $request = $this->finalisePayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('bool', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'bool', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'bool'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'bool', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation finalisePayRunPayRunAsync + * + * Finalise a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param array|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['finalisePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function finalisePayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['finalisePayRunPayRun'][0] + ): PromiseInterface + { + return $this->finalisePayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation finalisePayRunPayRunAsyncWithHttpInfo + * + * Finalise a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param array|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['finalisePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function finalisePayRunPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['finalisePayRunPayRun'][0] + ): PromiseInterface + { + $returnType = 'bool'; + $request = $this->finalisePayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'finalisePayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param array|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['finalisePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function finalisePayRunPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['finalisePayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling finalisePayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling finalisePayRunPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling finalisePayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling finalisePayRunPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/finalise'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunEntryPayRun + * + * Get a PayRunEntry + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function getPayRunEntryPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEntryPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->getPayRunEntryPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayRunEntryPayRunWithHttpInfo + * + * Get a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunEntryPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEntryPayRun'][0] + ): array + { + $request = $this->getPayRunEntryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunEntryPayRunAsync + * + * Get a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunEntryPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEntryPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunEntryPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunEntryPayRunAsyncWithHttpInfo + * + * Get a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunEntryPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEntryPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->getPayRunEntryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunEntryPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunEntryPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEntryPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunEntryPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunEntryPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunEntryPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunEntryPayRun' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPayRunEntryPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunEventsPayRun + * + * Get PayPeriodEvents + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEventsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedulePeriodEvent[] + */ + public function getPayRunEventsPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEventsPayRun'][0] + ): array + { + list($response) = $this->getPayRunEventsPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayRunEventsPayRunWithHttpInfo + * + * Get PayPeriodEvents + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEventsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedulePeriodEvent[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunEventsPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEventsPayRun'][0] + ): array + { + $request = $this->getPayRunEventsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunEventsPayRunAsync + * + * Get PayPeriodEvents + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEventsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunEventsPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEventsPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunEventsPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunEventsPayRunAsyncWithHttpInfo + * + * Get PayPeriodEvents + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEventsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunEventsPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEventsPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]'; + $request = $this->getPayRunEventsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunEventsPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunEventsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunEventsPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunEventsPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunEventsPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunEventsPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunEventsPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunEventsPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/events'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunJournalPayRun + * + * Get Journal for PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunJournalPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunJournal + */ + public function getPayRunJournalPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['getPayRunJournalPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunJournal + { + list($response) = $this->getPayRunJournalPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown, $contentType); + return $response; + } + + /** + * Operation getPayRunJournalPayRunWithHttpInfo + * + * Get Journal for PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunJournalPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunJournal, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunJournalPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['getPayRunJournalPayRun'][0] + ): array + { + $request = $this->getPayRunJournalPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunJournal', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunJournal' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunJournal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunJournal'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunJournal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunJournalPayRunAsync + * + * Get Journal for PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunJournalPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunJournalPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['getPayRunJournalPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunJournalPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunJournalPayRunAsyncWithHttpInfo + * + * Get Journal for PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunJournalPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunJournalPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $deptBreakdown = false, + string $contentType = self::contentTypes['getPayRunJournalPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunJournal'; + $request = $this->getPayRunJournalPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $deptBreakdown, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunJournalPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunJournalPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunJournalPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $deptBreakdown = false, + string $contentType = self::contentTypes['getPayRunJournalPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunJournalPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunJournalPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunJournalPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunJournalPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/journal'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptBreakdown, + 'deptBreakdown', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunPayCodesPayRun + * + * Get PayCodes for a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayCodesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayCode[] + */ + public function getPayRunPayCodesPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunPayCodesPayRun'][0] + ): array + { + list($response) = $this->getPayRunPayCodesPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayRunPayCodesPayRunWithHttpInfo + * + * Get PayCodes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayCodesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayCode[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunPayCodesPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunPayCodesPayRun'][0] + ): array + { + $request = $this->getPayRunPayCodesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayCode[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayCode[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayCode[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayCode[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayCode[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunPayCodesPayRunAsync + * + * Get PayCodes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayCodesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunPayCodesPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunPayCodesPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunPayCodesPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunPayCodesPayRunAsyncWithHttpInfo + * + * Get PayCodes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayCodesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunPayCodesPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunPayCodesPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayCode[]'; + $request = $this->getPayRunPayCodesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunPayCodesPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayCodesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunPayCodesPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunPayCodesPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunPayCodesPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunPayCodesPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunPayCodesPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunPayCodesPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunPayRun + * + * Get a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param string|null $searchTerm The option to filter on a search term (optional) + * @param \SynergiTech\Staffology\Model\ZeroPaidFilter|null $zeroPaid The option to filter pay run entries by negative paid, zero paid and non-zero paid (optional) + * @param string|null $departmentCode The option to filter on department code (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeavers The option to filter on whether the employee is a starter or leaver (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy The option to sort by a certain field. Default is Payroll Code (optional) + * @param bool|null $sortDescending Whether to sort in ascending or descending order (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function getPayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + ?string $searchTerm = null, + ?\SynergiTech\Staffology\Model\ZeroPaidFilter $zeroPaid = null, + ?string $departmentCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeavers = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['getPayRunPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->getPayRunPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending, $contentType); + return $response; + } + + /** + * Operation getPayRunPayRunWithHttpInfo + * + * Get a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param string|null $searchTerm The option to filter on a search term (optional) + * @param \SynergiTech\Staffology\Model\ZeroPaidFilter|null $zeroPaid The option to filter pay run entries by negative paid, zero paid and non-zero paid (optional) + * @param string|null $departmentCode The option to filter on department code (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeavers The option to filter on whether the employee is a starter or leaver (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy The option to sort by a certain field. Default is Payroll Code (optional) + * @param bool|null $sortDescending Whether to sort in ascending or descending order (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + ?string $searchTerm = null, + ?\SynergiTech\Staffology\Model\ZeroPaidFilter $zeroPaid = null, + ?string $departmentCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeavers = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['getPayRunPayRun'][0] + ): array + { + $request = $this->getPayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunPayRunAsync + * + * Get a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param string|null $searchTerm The option to filter on a search term (optional) + * @param \SynergiTech\Staffology\Model\ZeroPaidFilter|null $zeroPaid The option to filter pay run entries by negative paid, zero paid and non-zero paid (optional) + * @param string|null $departmentCode The option to filter on department code (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeavers The option to filter on whether the employee is a starter or leaver (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy The option to sort by a certain field. Default is Payroll Code (optional) + * @param bool|null $sortDescending Whether to sort in ascending or descending order (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + ?string $searchTerm = null, + ?\SynergiTech\Staffology\Model\ZeroPaidFilter $zeroPaid = null, + ?string $departmentCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeavers = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['getPayRunPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunPayRunAsyncWithHttpInfo + * + * Get a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param string|null $searchTerm The option to filter on a search term (optional) + * @param \SynergiTech\Staffology\Model\ZeroPaidFilter|null $zeroPaid The option to filter pay run entries by negative paid, zero paid and non-zero paid (optional) + * @param string|null $departmentCode The option to filter on department code (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeavers The option to filter on whether the employee is a starter or leaver (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy The option to sort by a certain field. Default is Payroll Code (optional) + * @param bool|null $sortDescending Whether to sort in ascending or descending order (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $pageNum = null, + $pageSize = null, + $searchTerm = null, + $zeroPaid = null, + $departmentCode = null, + $startersLeavers = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['getPayRunPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->getPayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $searchTerm, $zeroPaid, $departmentCode, $startersLeavers, $sortBy, $sortDescending, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum Zero-based page number, used in conjunction with pageSize (optional) + * @param int|null $pageSize The number of items per page (optional) + * @param string|null $searchTerm The option to filter on a search term (optional) + * @param \SynergiTech\Staffology\Model\ZeroPaidFilter|null $zeroPaid The option to filter pay run entries by negative paid, zero paid and non-zero paid (optional) + * @param string|null $departmentCode The option to filter on department code (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeavers The option to filter on whether the employee is a starter or leaver (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy The option to sort by a certain field. Default is Payroll Code (optional) + * @param bool|null $sortDescending Whether to sort in ascending or descending order (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $pageNum = null, + $pageSize = null, + $searchTerm = null, + $zeroPaid = null, + $departmentCode = null, + $startersLeavers = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['getPayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunPayRun' + ); + } + + + + + + + + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $searchTerm, + 'searchTerm', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $zeroPaid, + 'zeroPaid', // param base name + 'ZeroPaidFilter', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $departmentCode, + 'departmentCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $startersLeavers, + 'startersLeavers', // param base name + 'StartersLeaversFilter', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortBy, + 'sortBy', // param base name + 'PayRunEntrySortBy', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortDescending, + 'sortDescending', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunStateHistoryPayRun + * + * List PayRunStateHistory + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history (required) + * @param int $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The Tax Year for which you want to get the Pay Run history (required) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunStateHistoryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]|\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]|\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[] + */ + public function getPayRunStateHistoryPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunStateHistoryPayRun'][0] + ): array + { + list($response) = $this->getPayRunStateHistoryPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayRunStateHistoryPayRunWithHttpInfo + * + * List PayRunStateHistory + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history (required) + * @param int $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The Tax Year for which you want to get the Pay Run history (required) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunStateHistoryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]|\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]|\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunStateHistoryPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunStateHistoryPayRun'][0] + ): array + { + $request = $this->getPayRunStateHistoryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if (in_array('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if (in_array('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunStateHistoryPayRunAsync + * + * List PayRunStateHistory + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history (required) + * @param int $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The Tax Year for which you want to get the Pay Run history (required) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunStateHistoryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunStateHistoryPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunStateHistoryPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunStateHistoryPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunStateHistoryPayRunAsyncWithHttpInfo + * + * List PayRunStateHistory + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history (required) + * @param int $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The Tax Year for which you want to get the Pay Run history (required) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunStateHistoryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunStateHistoryPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunStateHistoryPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayRunStateHistoryResponse[]'; + $request = $this->getPayRunStateHistoryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunStateHistoryPayRun' + * + * @param string $employerId The Id of the Employer (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The Pay Period (i.e, Monthly, Weekly) for which you want to get the Pay Run history (required) + * @param int $periodNumber The Period (i.e, Tax Month, Tax Week) for which you want to get the Pay Run history (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The Tax Year for which you want to get the Pay Run history (required) + * @param int|null $ordinal Indicates whether it uses first, second, third (etc.) PaySchedule for the PayPeriod (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunStateHistoryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunStateHistoryPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunStateHistoryPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunStateHistoryPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunStateHistoryPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunStateHistoryPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunStateHistoryPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/stateHistory'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunWarningsPayRun + * + * Get PayRun Warnings + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunWarningsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getPayRunWarningsPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getPayRunWarningsPayRun'][0] + ): array + { + list($response) = $this->getPayRunWarningsPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation getPayRunWarningsPayRunWithHttpInfo + * + * Get PayRun Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunWarningsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunWarningsPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getPayRunWarningsPayRun'][0] + ): array + { + $request = $this->getPayRunWarningsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunWarningsPayRunAsync + * + * Get PayRun Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunWarningsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunWarningsPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['getPayRunWarningsPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunWarningsPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunWarningsPayRunAsyncWithHttpInfo + * + * Get PayRun Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunWarningsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunWarningsPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['getPayRunWarningsPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getPayRunWarningsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunWarningsPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunWarningsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunWarningsPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['getPayRunWarningsPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunWarningsPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunWarningsPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunWarningsPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunWarningsPayRun' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/warnings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunsPayRun + * + * List PayRuns + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getPayRunsPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunsPayRun'][0] + ): array + { + list($response) = $this->getPayRunsPayRunWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayRunsPayRunWithHttpInfo + * + * List PayRuns + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunsPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunsPayRun'][0] + ): array + { + $request = $this->getPayRunsPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunsPayRunAsync + * + * List PayRuns + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunsPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getPayRunsPayRun'][0] + ): PromiseInterface + { + return $this->getPayRunsPayRunAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunsPayRunAsyncWithHttpInfo + * + * List PayRuns + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunsPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunsPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getPayRunsPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunsPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunsPayRunRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['getPayRunsPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunsPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunsPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunsPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importPayPayRun + * + * Import Pay + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function importPayPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importPayPayRun'][0] + ): void + { + $this->importPayPayRunWithHttpInfo($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + } + + /** + * Operation importPayPayRunWithHttpInfo + * + * Import Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function importPayPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importPayPayRun'][0] + ): array + { + $request = $this->importPayPayRunRequest($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation importPayPayRunAsync + * + * Import Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?bool $linesOnly = false, + ?bool $append = false, + ?bool $updateExisting = false, + ?bool $validateOnly = false, + ?array $payOptionsImport = null, + string $contentType = self::contentTypes['importPayPayRun'][0] + ): PromiseInterface + { + return $this->importPayPayRunAsyncWithHttpInfo($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importPayPayRunAsyncWithHttpInfo + * + * Import Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $ordinal = 1, + $linesOnly = false, + $append = false, + $updateExisting = false, + $validateOnly = false, + $payOptionsImport = null, + string $contentType = self::contentTypes['importPayPayRun'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->importPayPayRunRequest($employerId, $payPeriod, $ordinal, $linesOnly, $append, $updateExisting, $validateOnly, $payOptionsImport, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importPayPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional, default to false) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional, default to false) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. (optional, default to false) + * @param bool|null $validateOnly If set to true, the import will only be validated for data correctness. If false, the import is validated and then imported. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayOptionsImport[]|null $payOptionsImport (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importPayPayRunRequest( + $employerId, + $payPeriod, + $ordinal = 1, + $linesOnly = false, + $append = false, + $updateExisting = false, + $validateOnly = false, + $payOptionsImport = null, + string $contentType = self::contentTypes['importPayPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importPayPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling importPayPayRun' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/payrun/{payPeriod}/importpay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $linesOnly, + 'linesOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $append, + 'append', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updateExisting, + 'updateExisting', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $validateOnly, + 'validateOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payOptionsImport)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payOptionsImport)); + } else { + $httpBody = $payOptionsImport; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importTimeAndAttendancePayRun + * + * Import Time And Attendance + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId providerId (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTimeAndAttendancePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayOptionsImport[] + */ + public function importTimeAndAttendancePayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\SynergiTech\Staffology\Model\ExternalDataProviderId $providerId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['importTimeAndAttendancePayRun'][0] + ): array + { + list($response) = $this->importTimeAndAttendancePayRunWithHttpInfo($employerId, $payPeriod, $providerId, $ordinal, $contentType); + return $response; + } + + /** + * Operation importTimeAndAttendancePayRunWithHttpInfo + * + * Import Time And Attendance + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTimeAndAttendancePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayOptionsImport[], HTTP status code, HTTP response headers (array of strings) + */ + public function importTimeAndAttendancePayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\SynergiTech\Staffology\Model\ExternalDataProviderId $providerId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['importTimeAndAttendancePayRun'][0] + ): array + { + $request = $this->importTimeAndAttendancePayRunRequest($employerId, $payPeriod, $providerId, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayOptionsImport[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayOptionsImport[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayOptionsImport[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayOptionsImport[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayOptionsImport[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importTimeAndAttendancePayRunAsync + * + * Import Time And Attendance + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTimeAndAttendancePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importTimeAndAttendancePayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\SynergiTech\Staffology\Model\ExternalDataProviderId $providerId = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['importTimeAndAttendancePayRun'][0] + ): PromiseInterface + { + return $this->importTimeAndAttendancePayRunAsyncWithHttpInfo($employerId, $payPeriod, $providerId, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importTimeAndAttendancePayRunAsyncWithHttpInfo + * + * Import Time And Attendance + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTimeAndAttendancePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importTimeAndAttendancePayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $providerId = null, + $ordinal = 1, + string $contentType = self::contentTypes['importTimeAndAttendancePayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayOptionsImport[]'; + $request = $this->importTimeAndAttendancePayRunRequest($employerId, $payPeriod, $providerId, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importTimeAndAttendancePayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTimeAndAttendancePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importTimeAndAttendancePayRunRequest( + $employerId, + $payPeriod, + $providerId = null, + $ordinal = 1, + string $contentType = self::contentTypes['importTimeAndAttendancePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importTimeAndAttendancePayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling importTimeAndAttendancePayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{payPeriod}/importtimeandattendance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $providerId, + 'providerId', // param base name + 'ExternalDataProviderId', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importUmbrellaPayPayRun + * + * Import Umbrella Pay + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment[]|null $umbrellaPayment umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importUmbrellaPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function importUmbrellaPayPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?array $umbrellaPayment = null, + string $contentType = self::contentTypes['importUmbrellaPayPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->importUmbrellaPayPayRunWithHttpInfo($employerId, $payPeriod, $ordinal, $umbrellaPayment, $contentType); + return $response; + } + + /** + * Operation importUmbrellaPayPayRunWithHttpInfo + * + * Import Umbrella Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment[]|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importUmbrellaPayPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function importUmbrellaPayPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?array $umbrellaPayment = null, + string $contentType = self::contentTypes['importUmbrellaPayPayRun'][0] + ): array + { + $request = $this->importUmbrellaPayPayRunRequest($employerId, $payPeriod, $ordinal, $umbrellaPayment, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importUmbrellaPayPayRunAsync + * + * Import Umbrella Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment[]|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importUmbrellaPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importUmbrellaPayPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?int $ordinal = 1, + ?array $umbrellaPayment = null, + string $contentType = self::contentTypes['importUmbrellaPayPayRun'][0] + ): PromiseInterface + { + return $this->importUmbrellaPayPayRunAsyncWithHttpInfo($employerId, $payPeriod, $ordinal, $umbrellaPayment, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importUmbrellaPayPayRunAsyncWithHttpInfo + * + * Import Umbrella Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment[]|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importUmbrellaPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importUmbrellaPayPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $ordinal = 1, + $umbrellaPayment = null, + string $contentType = self::contentTypes['importUmbrellaPayPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->importUmbrellaPayPayRunRequest($employerId, $payPeriod, $ordinal, $umbrellaPayment, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importUmbrellaPayPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment[]|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importUmbrellaPayPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importUmbrellaPayPayRunRequest( + $employerId, + $payPeriod, + $ordinal = 1, + $umbrellaPayment = null, + string $contentType = self::contentTypes['importUmbrellaPayPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importUmbrellaPayPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling importUmbrellaPayPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{payPeriod}/importumbrellapay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($umbrellaPayment)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($umbrellaPayment)); + } else { + $httpBody = $umbrellaPayment; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation lastPayRunEntryForEmployeePayRun + * + * Gets the last closed pay run entry for an employee. + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get last pay run entry for. (required) + * @param bool|null $isClosed isClosed (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryForEmployeePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function lastPayRunEntryForEmployeePayRun( + string $employerId, + string $employeeId, + ?bool $isClosed = null, + string $contentType = self::contentTypes['lastPayRunEntryForEmployeePayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->lastPayRunEntryForEmployeePayRunWithHttpInfo($employerId, $employeeId, $isClosed, $contentType); + return $response; + } + + /** + * Operation lastPayRunEntryForEmployeePayRunWithHttpInfo + * + * Gets the last closed pay run entry for an employee. + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get last pay run entry for. (required) + * @param bool|null $isClosed (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryForEmployeePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function lastPayRunEntryForEmployeePayRunWithHttpInfo( + string $employerId, + string $employeeId, + ?bool $isClosed = null, + string $contentType = self::contentTypes['lastPayRunEntryForEmployeePayRun'][0] + ): array + { + $request = $this->lastPayRunEntryForEmployeePayRunRequest($employerId, $employeeId, $isClosed, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastPayRunEntryForEmployeePayRunAsync + * + * Gets the last closed pay run entry for an employee. + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get last pay run entry for. (required) + * @param bool|null $isClosed (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryForEmployeePayRunAsync( + string $employerId, + string $employeeId, + ?bool $isClosed = null, + string $contentType = self::contentTypes['lastPayRunEntryForEmployeePayRun'][0] + ): PromiseInterface + { + return $this->lastPayRunEntryForEmployeePayRunAsyncWithHttpInfo($employerId, $employeeId, $isClosed, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastPayRunEntryForEmployeePayRunAsyncWithHttpInfo + * + * Gets the last closed pay run entry for an employee. + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get last pay run entry for. (required) + * @param bool|null $isClosed (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryForEmployeePayRunAsyncWithHttpInfo( + $employerId, + $employeeId, + $isClosed = null, + string $contentType = self::contentTypes['lastPayRunEntryForEmployeePayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->lastPayRunEntryForEmployeePayRunRequest($employerId, $employeeId, $isClosed, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'lastPayRunEntryForEmployeePayRun' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get last pay run entry for. (required) + * @param bool|null $isClosed (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastPayRunEntryForEmployeePayRunRequest( + $employerId, + $employeeId, + $isClosed = null, + string $contentType = self::contentTypes['lastPayRunEntryForEmployeePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling lastPayRunEntryForEmployeePayRun' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling lastPayRunEntryForEmployeePayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/employees/{employeeId}/Last'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $isClosed, + 'isClosed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePayRun + * + * Gets last PayRunEntry for a Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for. (required) + * @param string $pensionUniqueId pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePayRun( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePayRunWithHttpInfo($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + return $response; + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePayRunWithHttpInfo + * + * Gets last PayRunEntry for a Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for. (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePayRunWithHttpInfo( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'][0] + ): array + { + $request = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePayRunRequest($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePayRunAsync + * + * Gets last PayRunEntry for a Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for. (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePayRunAsync( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'][0] + ): PromiseInterface + { + return $this->lastPayRunEntryWithPensionYtdValuesForEmployeePayRunAsyncWithHttpInfo($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePayRunAsyncWithHttpInfo + * + * Gets last PayRunEntry for a Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for. (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePayRunAsyncWithHttpInfo( + $employerId, + $employeeId, + $pensionUniqueId, + $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePayRunRequest($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' + * + * @param string $employerId The Id of the Employer to which the Employee belongs. (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for. (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePayRunRequest( + $employerId, + $employeeId, + $pensionUniqueId, + $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' + ); + } + + // verify the required parameter 'pensionUniqueId' is set + if ($pensionUniqueId === null || (is_array($pensionUniqueId) && count($pensionUniqueId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pensionUniqueId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling lastPayRunEntryWithPensionYtdValuesForEmployeePayRun' + ); + } + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/employees/{employeeId}/pension/{pensionUniqueId}/pensionytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($pensionUniqueId !== null) { + $resourcePath = str_replace( + '{' . 'pensionUniqueId' . '}', + ObjectSerializer::toPathValue($pensionUniqueId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation leavePayRun + * + * List Leave related to a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leavePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function leavePayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['leavePayRun'][0] + ): array + { + list($response) = $this->leavePayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation leavePayRunWithHttpInfo + * + * List Leave related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leavePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function leavePayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['leavePayRun'][0] + ): array + { + $request = $this->leavePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation leavePayRunAsync + * + * List Leave related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leavePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function leavePayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['leavePayRun'][0] + ): PromiseInterface + { + return $this->leavePayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation leavePayRunAsyncWithHttpInfo + * + * List Leave related to a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leavePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function leavePayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['leavePayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->leavePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'leavePayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['leavePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function leavePayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['leavePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling leavePayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling leavePayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling leavePayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling leavePayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/leave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payRunEntryUmbrellaPaymentPayRun + * + * PayRunEntry Umbrella Payment + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntryUmbrellaPaymentPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function payRunEntryUmbrellaPaymentPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\UmbrellaPayment $umbrellaPayment = null, + string $contentType = self::contentTypes['payRunEntryUmbrellaPaymentPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->payRunEntryUmbrellaPaymentPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment, $contentType); + return $response; + } + + /** + * Operation payRunEntryUmbrellaPaymentPayRunWithHttpInfo + * + * PayRunEntry Umbrella Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntryUmbrellaPaymentPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function payRunEntryUmbrellaPaymentPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\UmbrellaPayment $umbrellaPayment = null, + string $contentType = self::contentTypes['payRunEntryUmbrellaPaymentPayRun'][0] + ): array + { + $request = $this->payRunEntryUmbrellaPaymentPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payRunEntryUmbrellaPaymentPayRunAsync + * + * PayRunEntry Umbrella Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntryUmbrellaPaymentPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunEntryUmbrellaPaymentPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\UmbrellaPayment $umbrellaPayment = null, + string $contentType = self::contentTypes['payRunEntryUmbrellaPaymentPayRun'][0] + ): PromiseInterface + { + return $this->payRunEntryUmbrellaPaymentPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payRunEntryUmbrellaPaymentPayRunAsyncWithHttpInfo + * + * PayRunEntry Umbrella Payment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntryUmbrellaPaymentPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunEntryUmbrellaPaymentPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $umbrellaPayment = null, + string $contentType = self::contentTypes['payRunEntryUmbrellaPaymentPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->payRunEntryUmbrellaPaymentPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $umbrellaPayment, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payRunEntryUmbrellaPaymentPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunEntryUmbrellaPaymentPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payRunEntryUmbrellaPaymentPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $umbrellaPayment = null, + string $contentType = self::contentTypes['payRunEntryUmbrellaPaymentPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payRunEntryUmbrellaPaymentPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payRunEntryUmbrellaPaymentPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payRunEntryUmbrellaPaymentPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payRunEntryUmbrellaPaymentPayRun' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payRunEntryUmbrellaPaymentPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}/umbrella'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($umbrellaPayment)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($umbrellaPayment)); + } else { + $httpBody = $umbrellaPayment; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation reOpenPayRunPayRun + * + * Re-open a PayRun (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reOpenPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function reOpenPayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['reOpenPayRunPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->reOpenPayRunPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation reOpenPayRunPayRunWithHttpInfo + * + * Re-open a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reOpenPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function reOpenPayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['reOpenPayRunPayRun'][0] + ): array + { + $request = $this->reOpenPayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation reOpenPayRunPayRunAsync + * + * Re-open a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reOpenPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reOpenPayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['reOpenPayRunPayRun'][0] + ): PromiseInterface + { + return $this->reOpenPayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation reOpenPayRunPayRunAsyncWithHttpInfo + * + * Re-open a PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reOpenPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function reOpenPayRunPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['reOpenPayRunPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->reOpenPayRunPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'reOpenPayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reOpenPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function reOpenPayRunPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['reOpenPayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling reOpenPayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling reOpenPayRunPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling reOpenPayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling reOpenPayRunPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/reopen'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removePayRunEntriesPayRun + * + * Remove PayRunEntries (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function removePayRunEntriesPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['removePayRunEntriesPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->removePayRunEntriesPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + return $response; + } + + /** + * Operation removePayRunEntriesPayRunWithHttpInfo + * + * Remove PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function removePayRunEntriesPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['removePayRunEntriesPayRun'][0] + ): array + { + $request = $this->removePayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation removePayRunEntriesPayRunAsync + * + * Remove PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removePayRunEntriesPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['removePayRunEntriesPayRun'][0] + ): PromiseInterface + { + return $this->removePayRunEntriesPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removePayRunEntriesPayRunAsyncWithHttpInfo + * + * Remove PayRunEntries (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removePayRunEntriesPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['removePayRunEntriesPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->removePayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removePayRunEntriesPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removePayRunEntriesPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['removePayRunEntriesPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling removePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling removePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling removePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling removePayRunEntriesPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/removepayrunentries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendPayslipEmailsPayRun + * + * (Re)send Payslip Emails + * + * @param string $employerId The ID of the employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay period of the pay run. (required) + * @param int $periodNumber The period number of the pay run. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year of the pay run. (required) + * @param int|null $ordinal The ordinal number of the pay run. (optional, default to 1) + * @param string|null $id The UniqueId of the pay run entry (optional). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPayslipEmailsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function sendPayslipEmailsPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $id = null, + string $contentType = self::contentTypes['sendPayslipEmailsPayRun'][0] + ): void + { + $this->sendPayslipEmailsPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id, $contentType); + } + + /** + * Operation sendPayslipEmailsPayRunWithHttpInfo + * + * (Re)send Payslip Emails + * + * @param string $employerId The ID of the employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay period of the pay run. (required) + * @param int $periodNumber The period number of the pay run. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year of the pay run. (required) + * @param int|null $ordinal The ordinal number of the pay run. (optional, default to 1) + * @param string|null $id The UniqueId of the pay run entry (optional). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPayslipEmailsPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendPayslipEmailsPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $id = null, + string $contentType = self::contentTypes['sendPayslipEmailsPayRun'][0] + ): array + { + $request = $this->sendPayslipEmailsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation sendPayslipEmailsPayRunAsync + * + * (Re)send Payslip Emails + * + * @param string $employerId The ID of the employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay period of the pay run. (required) + * @param int $periodNumber The period number of the pay run. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year of the pay run. (required) + * @param int|null $ordinal The ordinal number of the pay run. (optional, default to 1) + * @param string|null $id The UniqueId of the pay run entry (optional). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPayslipEmailsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function sendPayslipEmailsPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $id = null, + string $contentType = self::contentTypes['sendPayslipEmailsPayRun'][0] + ): PromiseInterface + { + return $this->sendPayslipEmailsPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendPayslipEmailsPayRunAsyncWithHttpInfo + * + * (Re)send Payslip Emails + * + * @param string $employerId The ID of the employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay period of the pay run. (required) + * @param int $periodNumber The period number of the pay run. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year of the pay run. (required) + * @param int|null $ordinal The ordinal number of the pay run. (optional, default to 1) + * @param string|null $id The UniqueId of the pay run entry (optional). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPayslipEmailsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function sendPayslipEmailsPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $id = null, + string $contentType = self::contentTypes['sendPayslipEmailsPayRun'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->sendPayslipEmailsPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendPayslipEmailsPayRun' + * + * @param string $employerId The ID of the employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay period of the pay run. (required) + * @param int $periodNumber The period number of the pay run. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year of the pay run. (required) + * @param int|null $ordinal The ordinal number of the pay run. (optional, default to 1) + * @param string|null $id The UniqueId of the pay run entry (optional). (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPayslipEmailsPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sendPayslipEmailsPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $id = null, + string $contentType = self::contentTypes['sendPayslipEmailsPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling sendPayslipEmailsPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling sendPayslipEmailsPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling sendPayslipEmailsPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling sendPayslipEmailsPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation startNextPayRunPayRun + * + * Starts the next PayRun (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startNextPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function startNextPayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['startNextPayRunPayRun'][0] + ): void + { + $this->startNextPayRunPayRunWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + } + + /** + * Operation startNextPayRunPayRunWithHttpInfo + * + * Starts the next PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startNextPayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function startNextPayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['startNextPayRunPayRun'][0] + ): array + { + $request = $this->startNextPayRunPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation startNextPayRunPayRunAsync + * + * Starts the next PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function startNextPayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['startNextPayRunPayRun'][0] + ): PromiseInterface + { + return $this->startNextPayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation startNextPayRunPayRunAsyncWithHttpInfo + * + * Starts the next PayRun (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function startNextPayRunPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['startNextPayRunPayRun'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->startNextPayRunPayRunRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'startNextPayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startNextPayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function startNextPayRunPayRunRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['startNextPayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling startNextPayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling startNextPayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling startNextPayRunPayRun' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayRunEntryPayRun + * + * Update a PayRunEntry + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $forceSyncEmployeePayOptions If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayRunEntry|null $payRunEntry payRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function updatePayRunEntryPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?bool $forceSyncEmployeePayOptions = false, + ?\SynergiTech\Staffology\Model\PayRunEntry $payRunEntry = null, + string $contentType = self::contentTypes['updatePayRunEntryPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->updatePayRunEntryPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry, $contentType); + return $response; + } + + /** + * Operation updatePayRunEntryPayRunWithHttpInfo + * + * Update a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forceSyncEmployeePayOptions If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayRunEntry|null $payRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunEntryPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayRunEntryPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?bool $forceSyncEmployeePayOptions = false, + ?\SynergiTech\Staffology\Model\PayRunEntry $payRunEntry = null, + string $contentType = self::contentTypes['updatePayRunEntryPayRun'][0] + ): array + { + $request = $this->updatePayRunEntryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayRunEntryPayRunAsync + * + * Update a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forceSyncEmployeePayOptions If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayRunEntry|null $payRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayRunEntryPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?bool $forceSyncEmployeePayOptions = false, + ?\SynergiTech\Staffology\Model\PayRunEntry $payRunEntry = null, + string $contentType = self::contentTypes['updatePayRunEntryPayRun'][0] + ): PromiseInterface + { + return $this->updatePayRunEntryPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayRunEntryPayRunAsyncWithHttpInfo + * + * Update a PayRunEntry + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forceSyncEmployeePayOptions If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayRunEntry|null $payRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayRunEntryPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $forceSyncEmployeePayOptions = false, + $payRunEntry = null, + string $contentType = self::contentTypes['updatePayRunEntryPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->updatePayRunEntryPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $forceSyncEmployeePayOptions, $payRunEntry, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayRunEntryPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forceSyncEmployeePayOptions If set to true then changes made to employee pay options will be reflected into the pay run entry. Defaults to false. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayRunEntry|null $payRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunEntryPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayRunEntryPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $forceSyncEmployeePayOptions = false, + $payRunEntry = null, + string $contentType = self::contentTypes['updatePayRunEntryPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayRunEntryPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling updatePayRunEntryPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling updatePayRunEntryPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updatePayRunEntryPayRun' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePayRunEntryPayRun' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $forceSyncEmployeePayOptions, + 'forceSyncEmployeePayOptions', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payRunEntry)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payRunEntry)); + } else { + $httpBody = $payRunEntry; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayRunPayRun + * + * Update PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function updatePayRunPayRun( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['updatePayRunPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->updatePayRunPayRunWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + return $response; + } + + /** + * Operation updatePayRunPayRunWithHttpInfo + * + * Update PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayRunPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['updatePayRunPayRun'][0] + ): array + { + $request = $this->updatePayRunPayRunRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayRunPayRunAsync + * + * Update PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['updatePayRunPayRun'][0] + ): PromiseInterface + { + return $this->updatePayRunPayRunAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayRunPayRunAsyncWithHttpInfo + * + * Update PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayRunPayRunAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $sendPayslipEmails = false, + $payslipReleaseType = null, + $payslipScheduledDateTime = null, + $payRunStateChange = null, + string $contentType = self::contentTypes['updatePayRunPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->updatePayRunPayRunRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayRunPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails Only relevant if setting the State to Finalised. Set to true if you want to have payslips emailed to employees. (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange Specify the PayRun state you want to change to and the reason for the change. Only Open and Finalised states are available at the moment. Other states are used with Bureau functionality which isn't currently generally available. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayRunPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayRunPayRunRequest( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $sendPayslipEmails = false, + $payslipReleaseType = null, + $payslipScheduledDateTime = null, + $payRunStateChange = null, + string $contentType = self::contentTypes['updatePayRunPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayRunPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updatePayRunPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling updatePayRunPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling updatePayRunPayRun' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sendPayslipEmails, + 'sendPayslipEmails', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payslipReleaseType, + 'payslipReleaseType', // param base name + 'PayslipReleaseType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payslipScheduledDateTime, + 'payslipScheduledDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payRunStateChange)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payRunStateChange)); + } else { + $httpBody = $payRunStateChange; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePaymentDatePayRun + * + * Set PaymentDate + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \DateTime|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDatePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function updatePaymentDatePayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?\DateTime $body = null, + string $contentType = self::contentTypes['updatePaymentDatePayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->updatePaymentDatePayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body, $contentType); + return $response; + } + + /** + * Operation updatePaymentDatePayRunWithHttpInfo + * + * Set PaymentDate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDatePayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePaymentDatePayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?\DateTime $body = null, + string $contentType = self::contentTypes['updatePaymentDatePayRun'][0] + ): array + { + $request = $this->updatePaymentDatePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePaymentDatePayRunAsync + * + * Set PaymentDate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDatePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaymentDatePayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?\DateTime $body = null, + string $contentType = self::contentTypes['updatePaymentDatePayRun'][0] + ): PromiseInterface + { + return $this->updatePaymentDatePayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePaymentDatePayRunAsyncWithHttpInfo + * + * Set PaymentDate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDatePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaymentDatePayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $body = null, + string $contentType = self::contentTypes['updatePaymentDatePayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->updatePaymentDatePayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePaymentDatePayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param \DateTime|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDatePayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePaymentDatePayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $body = null, + string $contentType = self::contentTypes['updatePaymentDatePayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePaymentDatePayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling updatePaymentDatePayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling updatePaymentDatePayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updatePaymentDatePayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/paymentdate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation ytdPayRun + * + * Update YTD + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeYtdValues[] + */ + public function ytdPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['ytdPayRun'][0] + ): array + { + list($response) = $this->ytdPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file, $contentType); + return $response; + } + + /** + * Operation ytdPayRunWithHttpInfo + * + * Update YTD + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeYtdValues[], HTTP status code, HTTP response headers (array of strings) + */ + public function ytdPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['ytdPayRun'][0] + ): array + { + $request = $this->ytdPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeYtdValues[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeYtdValues[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeYtdValues[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeYtdValues[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeYtdValues[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation ytdPayRunAsync + * + * Update YTD + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function ytdPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['ytdPayRun'][0] + ): PromiseInterface + { + return $this->ytdPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation ytdPayRunAsyncWithHttpInfo + * + * Update YTD + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function ytdPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $file = null, + string $contentType = self::contentTypes['ytdPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeYtdValues[]'; + $request = $this->ytdPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'ytdPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function ytdPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $file = null, + string $contentType = self::contentTypes['ytdPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling ytdPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling ytdPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling ytdPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling ytdPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/ytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation zeroisePayRunEntriesPayRun + * + * Zeroise PayRunEntries + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string[]|null $requestBody requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['zeroisePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun + */ + public function zeroisePayRunEntriesPayRun( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['zeroisePayRunEntriesPayRun'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->zeroisePayRunEntriesPayRunWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + return $response; + } + + /** + * Operation zeroisePayRunEntriesPayRunWithHttpInfo + * + * Zeroise PayRunEntries + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['zeroisePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function zeroisePayRunEntriesPayRunWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['zeroisePayRunEntriesPayRun'][0] + ): array + { + $request = $this->zeroisePayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation zeroisePayRunEntriesPayRunAsync + * + * Zeroise PayRunEntries + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['zeroisePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function zeroisePayRunEntriesPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?array $requestBody = null, + string $contentType = self::contentTypes['zeroisePayRunEntriesPayRun'][0] + ): PromiseInterface + { + return $this->zeroisePayRunEntriesPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation zeroisePayRunEntriesPayRunAsyncWithHttpInfo + * + * Zeroise PayRunEntries + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['zeroisePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function zeroisePayRunEntriesPayRunAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['zeroisePayRunEntriesPayRun'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->zeroisePayRunEntriesPayRunRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $requestBody, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'zeroisePayRunEntriesPayRun' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string[]|null $requestBody (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['zeroisePayRunEntriesPayRun'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function zeroisePayRunEntriesPayRunRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $requestBody = null, + string $contentType = self::contentTypes['zeroisePayRunEntriesPayRun'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling zeroisePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling zeroisePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling zeroisePayRunEntriesPayRun' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling zeroisePayRunEntriesPayRun' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/zeroise'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($requestBody)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } else { + $httpBody = $requestBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayRunAsyncApi.php b/src/Api/PayRunAsyncApi.php new file mode 100644 index 0000000..e34b60e --- /dev/null +++ b/src/Api/PayRunAsyncApi.php @@ -0,0 +1,1819 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'queueCreatePayRunPayRunAsync' => [ + 'application/json', + ], + 'queueDeletePayRunPayRunAsync' => [ + 'application/json', + ], + 'queueUpdatePayRunPayRunAsync' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation importPayPayRunAsync + * + * Import Pay (beta) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $ordinal ordinal (required) + * @param bool $throwOnError throwOnError (required) + * @param \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] $contractPayOptionsImportRequest contractPayOptionsImportRequest (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse + */ + public function importPayPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $ordinal, + bool $throwOnError, + array $contractPayOptionsImportRequest, + ?bool $linesOnly = null, + ?bool $append = null, + ?bool $updateExisting = null, + string $contentType = self::contentTypes['importPayPayRunAsync'][0] + ): \SynergiTech\Staffology\Model\ContractJobResponse + { + list($response) = $this->importPayPayRunAsyncWithHttpInfo($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting, $contentType); + return $response; + } + + /** + * Operation importPayPayRunAsyncWithHttpInfo + * + * Import Pay (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $ordinal (required) + * @param bool $throwOnError (required) + * @param \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] $contractPayOptionsImportRequest (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function importPayPayRunAsyncWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $ordinal, + bool $throwOnError, + array $contractPayOptionsImportRequest, + ?bool $linesOnly = null, + ?bool $append = null, + ?bool $updateExisting = null, + string $contentType = self::contentTypes['importPayPayRunAsync'][0] + ): array + { + $request = $this->importPayPayRunAsyncRequest($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importPayPayRunAsyncAsync + * + * Import Pay (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $ordinal (required) + * @param bool $throwOnError (required) + * @param \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] $contractPayOptionsImportRequest (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayPayRunAsyncAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $ordinal, + bool $throwOnError, + array $contractPayOptionsImportRequest, + ?bool $linesOnly = null, + ?bool $append = null, + ?bool $updateExisting = null, + string $contentType = self::contentTypes['importPayPayRunAsync'][0] + ): PromiseInterface + { + return $this->importPayPayRunAsyncAsyncWithHttpInfo($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importPayPayRunAsyncAsyncWithHttpInfo + * + * Import Pay (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $ordinal (required) + * @param bool $throwOnError (required) + * @param \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] $contractPayOptionsImportRequest (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayPayRunAsyncAsyncWithHttpInfo( + $employerId, + $payPeriod, + $ordinal, + $throwOnError, + $contractPayOptionsImportRequest, + $linesOnly = null, + $append = null, + $updateExisting = null, + string $contentType = self::contentTypes['importPayPayRunAsync'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + $request = $this->importPayPayRunAsyncRequest($employerId, $payPeriod, $ordinal, $throwOnError, $contractPayOptionsImportRequest, $linesOnly, $append, $updateExisting, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importPayPayRunAsync' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $ordinal (required) + * @param bool $throwOnError (required) + * @param \SynergiTech\Staffology\Model\ContractPayOptionsImportRequest[] $contractPayOptionsImportRequest (required) + * @param bool|null $linesOnly If set to true then only lines will be imported. Changes to regular pay will be ignored. Defaults to false. (optional) + * @param bool|null $append If set to true then the lines submitted will be appended to existing lines rather than replace them. Defaults to false. (optional) + * @param bool|null $updateExisting If set to true then any submitted lines that match the pay code of one (and only one) existing line will be used to update the value of that lines. Any unmatched lines will be appended to existing lines. Defaults to false. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importPayPayRunAsyncRequest( + $employerId, + $payPeriod, + $ordinal, + $throwOnError, + $contractPayOptionsImportRequest, + $linesOnly = null, + $append = null, + $updateExisting = null, + string $contentType = self::contentTypes['importPayPayRunAsync'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importPayPayRunAsync' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling importPayPayRunAsync' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling importPayPayRunAsync' + ); + } + + // verify the required parameter 'throwOnError' is set + if ($throwOnError === null || (is_array($throwOnError) && count($throwOnError) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $throwOnError when calling importPayPayRunAsync' + ); + } + + // verify the required parameter 'contractPayOptionsImportRequest' is set + if ($contractPayOptionsImportRequest === null || (is_array($contractPayOptionsImportRequest) && count($contractPayOptionsImportRequest) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $contractPayOptionsImportRequest when calling importPayPayRunAsync' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/payrun-async/{payPeriod}/importpay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $linesOnly, + 'LinesOnly', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $append, + 'Append', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updateExisting, + 'UpdateExisting', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $throwOnError, + 'throwOnError', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayOptionsImportRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayOptionsImportRequest)); + } else { + $httpBody = $contractPayOptionsImportRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation queueCreatePayRunPayRunAsync + * + * Registers a request to start the next PayRun (beta) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueCreatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function queueCreatePayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueCreatePayRunPayRunAsync'][0] + ): void + { + $this->queueCreatePayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + } + + /** + * Operation queueCreatePayRunPayRunAsyncWithHttpInfo + * + * Registers a request to start the next PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueCreatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function queueCreatePayRunPayRunAsyncWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueCreatePayRunPayRunAsync'][0] + ): array + { + $request = $this->queueCreatePayRunPayRunAsyncRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation queueCreatePayRunPayRunAsyncAsync + * + * Registers a request to start the next PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueCreatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueCreatePayRunPayRunAsyncAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueCreatePayRunPayRunAsync'][0] + ): PromiseInterface + { + return $this->queueCreatePayRunPayRunAsyncAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation queueCreatePayRunPayRunAsyncAsyncWithHttpInfo + * + * Registers a request to start the next PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueCreatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueCreatePayRunPayRunAsyncAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['queueCreatePayRunPayRunAsync'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->queueCreatePayRunPayRunAsyncRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'queueCreatePayRunPayRunAsync' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueCreatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queueCreatePayRunPayRunAsyncRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['queueCreatePayRunPayRunAsync'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling queueCreatePayRunPayRunAsync' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling queueCreatePayRunPayRunAsync' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling queueCreatePayRunPayRunAsync' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun-async/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation queueDeletePayRunPayRunAsync + * + * Registers a request to delete a PayRun (beta) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueDeletePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function queueDeletePayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueDeletePayRunPayRunAsync'][0] + ): void + { + $this->queueDeletePayRunPayRunAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + } + + /** + * Operation queueDeletePayRunPayRunAsyncWithHttpInfo + * + * Registers a request to delete a PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueDeletePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function queueDeletePayRunPayRunAsyncWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueDeletePayRunPayRunAsync'][0] + ): array + { + $request = $this->queueDeletePayRunPayRunAsyncRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation queueDeletePayRunPayRunAsyncAsync + * + * Registers a request to delete a PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueDeletePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueDeletePayRunPayRunAsyncAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + string $contentType = self::contentTypes['queueDeletePayRunPayRunAsync'][0] + ): PromiseInterface + { + return $this->queueDeletePayRunPayRunAsyncAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation queueDeletePayRunPayRunAsyncAsyncWithHttpInfo + * + * Registers a request to delete a PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueDeletePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueDeletePayRunPayRunAsyncAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['queueDeletePayRunPayRunAsync'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->queueDeletePayRunPayRunAsyncRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'queueDeletePayRunPayRunAsync' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueDeletePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queueDeletePayRunPayRunAsyncRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + string $contentType = self::contentTypes['queueDeletePayRunPayRunAsync'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling queueDeletePayRunPayRunAsync' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling queueDeletePayRunPayRunAsync' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling queueDeletePayRunPayRunAsync' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling queueDeletePayRunPayRunAsync' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation queueUpdatePayRunPayRunAsync + * + * Registers a request to update the PayRun (beta) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails sendPayslipEmails (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange payRunStateChange (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueUpdatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRun|\SynergiTech\Staffology\Model\PayRun + */ + public function queueUpdatePayRunPayRunAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['queueUpdatePayRunPayRunAsync'][0] + ): \SynergiTech\Staffology\Model\PayRun + { + list($response) = $this->queueUpdatePayRunPayRunAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + return $response; + } + + /** + * Operation queueUpdatePayRunPayRunAsyncWithHttpInfo + * + * Registers a request to update the PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueUpdatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRun|\SynergiTech\Staffology\Model\PayRun, HTTP status code, HTTP response headers (array of strings) + */ + public function queueUpdatePayRunPayRunAsyncWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['queueUpdatePayRunPayRunAsync'][0] + ): array + { + $request = $this->queueUpdatePayRunPayRunAsyncRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 202: + if (in_array('\SynergiTech\Staffology\Model\PayRun', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRun' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRun', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation queueUpdatePayRunPayRunAsyncAsync + * + * Registers a request to update the PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueUpdatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueUpdatePayRunPayRunAsyncAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?bool $sendPayslipEmails = false, + ?\SynergiTech\Staffology\Model\PayslipReleaseType $payslipReleaseType = null, + ?\DateTime $payslipScheduledDateTime = null, + ?\SynergiTech\Staffology\Model\PayRunStateChange $payRunStateChange = null, + string $contentType = self::contentTypes['queueUpdatePayRunPayRunAsync'][0] + ): PromiseInterface + { + return $this->queueUpdatePayRunPayRunAsyncAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation queueUpdatePayRunPayRunAsyncAsyncWithHttpInfo + * + * Registers a request to update the PayRun (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueUpdatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueUpdatePayRunPayRunAsyncAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $sendPayslipEmails = false, + $payslipReleaseType = null, + $payslipScheduledDateTime = null, + $payRunStateChange = null, + string $contentType = self::contentTypes['queueUpdatePayRunPayRunAsync'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRun'; + $request = $this->queueUpdatePayRunPayRunAsyncRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $sendPayslipEmails, $payslipReleaseType, $payslipScheduledDateTime, $payRunStateChange, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'queueUpdatePayRunPayRunAsync' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $sendPayslipEmails (optional, default to false) + * @param \SynergiTech\Staffology\Model\PayslipReleaseType|null $payslipReleaseType (optional) + * @param \DateTime|null $payslipScheduledDateTime (optional) + * @param \SynergiTech\Staffology\Model\PayRunStateChange|null $payRunStateChange (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueUpdatePayRunPayRunAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queueUpdatePayRunPayRunAsyncRequest( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $sendPayslipEmails = false, + $payslipReleaseType = null, + $payslipScheduledDateTime = null, + $payRunStateChange = null, + string $contentType = self::contentTypes['queueUpdatePayRunPayRunAsync'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling queueUpdatePayRunPayRunAsync' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling queueUpdatePayRunPayRunAsync' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling queueUpdatePayRunPayRunAsync' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling queueUpdatePayRunPayRunAsync' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/payrun-async/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sendPayslipEmails, + 'sendPayslipEmails', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payslipReleaseType, + 'payslipReleaseType', // param base name + 'PayslipReleaseType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payslipScheduledDateTime, + 'payslipScheduledDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payRunStateChange)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payRunStateChange)); + } else { + $httpBody = $payRunStateChange; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayScheduleApi.php b/src/Api/PayScheduleApi.php new file mode 100644 index 0000000..3c9cc5d --- /dev/null +++ b/src/Api/PayScheduleApi.php @@ -0,0 +1,4332 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createWithOptionalOrdinalPaySchedule' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePaySchedule' => [ + 'application/json', + ], + 'deleteWithOptionalOrdinalPaySchedule' => [ + 'application/json', + ], + 'getAllPaySchedule' => [ + 'application/json', + ], + 'getPaySchedule' => [ + 'application/json', + ], + 'getPeriodsPaySchedule' => [ + 'application/json', + ], + 'getWithOptionalOrdinalPaySchedule' => [ + 'application/json', + ], + 'savePaySchedule' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'saveWithOptionalOrdinalPaySchedule' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePaySchedulePeriodPaySchedule' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPaySchedule + * + * Create a PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createPaySchedule'][0] + ): void + { + $this->createPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + } + + /** + * Operation createPayScheduleWithHttpInfo + * + * Create a PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createPaySchedule'][0] + ): array + { + $request = $this->createPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createPayScheduleAsync + * + * Create a PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createPaySchedule'][0] + ): PromiseInterface + { + return $this->createPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPayScheduleAsyncWithHttpInfo + * + * Create a PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $paySchedule = null, + string $contentType = self::contentTypes['createPaySchedule'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $paySchedule = null, + string $contentType = self::contentTypes['createPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling createPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createPaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling createPaySchedule' + ); + } + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paySchedule)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paySchedule)); + } else { + $httpBody = $paySchedule; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createWithOptionalOrdinalPaySchedule + * + * Create a PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createWithOptionalOrdinalPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createWithOptionalOrdinalPaySchedule'][0] + ): void + { + $this->createWithOptionalOrdinalPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + } + + /** + * Operation createWithOptionalOrdinalPayScheduleWithHttpInfo + * + * Create a PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createWithOptionalOrdinalPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createWithOptionalOrdinalPaySchedule'][0] + ): array + { + $request = $this->createWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createWithOptionalOrdinalPayScheduleAsync + * + * Create a PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWithOptionalOrdinalPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['createWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + return $this->createWithOptionalOrdinalPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createWithOptionalOrdinalPayScheduleAsyncWithHttpInfo + * + * Create a PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWithOptionalOrdinalPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $paySchedule = null, + string $contentType = self::contentTypes['createWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createWithOptionalOrdinalPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createWithOptionalOrdinalPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $paySchedule = null, + string $contentType = self::contentTypes['createWithOptionalOrdinalPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling createWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createWithOptionalOrdinalPaySchedule' + ); + } + + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paySchedule)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paySchedule)); + } else { + $httpBody = $paySchedule; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePaySchedule + * + * Delete PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['deletePaySchedule'][0] + ): void + { + $this->deletePayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + } + + /** + * Operation deletePayScheduleWithHttpInfo + * + * Delete PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['deletePaySchedule'][0] + ): array + { + $request = $this->deletePayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayScheduleAsync + * + * Delete PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['deletePaySchedule'][0] + ): PromiseInterface + { + return $this->deletePayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayScheduleAsyncWithHttpInfo + * + * Delete PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + string $contentType = self::contentTypes['deletePaySchedule'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + string $contentType = self::contentTypes['deletePaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling deletePaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deletePaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling deletePaySchedule' + ); + } + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteWithOptionalOrdinalPaySchedule + * + * Delete PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteWithOptionalOrdinalPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['deleteWithOptionalOrdinalPaySchedule'][0] + ): void + { + $this->deleteWithOptionalOrdinalPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + } + + /** + * Operation deleteWithOptionalOrdinalPayScheduleWithHttpInfo + * + * Delete PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteWithOptionalOrdinalPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['deleteWithOptionalOrdinalPaySchedule'][0] + ): array + { + $request = $this->deleteWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteWithOptionalOrdinalPayScheduleAsync + * + * Delete PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWithOptionalOrdinalPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['deleteWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + return $this->deleteWithOptionalOrdinalPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteWithOptionalOrdinalPayScheduleAsyncWithHttpInfo + * + * Delete PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWithOptionalOrdinalPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + string $contentType = self::contentTypes['deleteWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteWithOptionalOrdinalPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteWithOptionalOrdinalPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + string $contentType = self::contentTypes['deleteWithOptionalOrdinalPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling deleteWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling deleteWithOptionalOrdinalPaySchedule' + ); + } + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAllPaySchedule + * + * Get PaySchedules + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedule[] + */ + public function getAllPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getAllPaySchedule'][0] + ): array + { + list($response) = $this->getAllPayScheduleWithHttpInfo($employerId, $taxYear, $contentType); + return $response; + } + + /** + * Operation getAllPayScheduleWithHttpInfo + * + * Get PaySchedules + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedule[], HTTP status code, HTTP response headers (array of strings) + */ + public function getAllPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getAllPaySchedule'][0] + ): array + { + $request = $this->getAllPayScheduleRequest($employerId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedule[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedule[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedule[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedule[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedule[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAllPayScheduleAsync + * + * Get PaySchedules + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['getAllPaySchedule'][0] + ): PromiseInterface + { + return $this->getAllPayScheduleAsyncWithHttpInfo($employerId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAllPayScheduleAsyncWithHttpInfo + * + * Get PaySchedules + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllPayScheduleAsyncWithHttpInfo( + $employerId, + $taxYear, + string $contentType = self::contentTypes['getAllPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedule[]'; + $request = $this->getAllPayScheduleRequest($employerId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAllPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAllPayScheduleRequest( + $employerId, + $taxYear, + string $contentType = self::contentTypes['getAllPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAllPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getAllPaySchedule' + ); + } + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPaySchedule + * + * Get PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedule + */ + public function getPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['getPaySchedule'][0] + ): \SynergiTech\Staffology\Model\PaySchedule + { + list($response) = $this->getPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getPayScheduleWithHttpInfo + * + * Get PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedule, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['getPaySchedule'][0] + ): array + { + $request = $this->getPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedule', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedule' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedule', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayScheduleAsync + * + * Get PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + string $contentType = self::contentTypes['getPaySchedule'][0] + ): PromiseInterface + { + return $this->getPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayScheduleAsyncWithHttpInfo + * + * Get PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + string $contentType = self::contentTypes['getPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + $request = $this->getPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + string $contentType = self::contentTypes['getPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling getPaySchedule' + ); + } + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPeriodsPaySchedule + * + * Get PaySchedulePeriods + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule periods (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for (required) + * @param int $ordinal Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) (required) + * @param int|null $periodNumber Optionally specify a period number to get a result just for that period (optional) + * @param bool|null $includeEvents includeEvents (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPeriodsPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedulePeriod[] + */ + public function getPeriodsPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?int $periodNumber = null, + ?bool $includeEvents = false, + string $contentType = self::contentTypes['getPeriodsPaySchedule'][0] + ): array + { + list($response) = $this->getPeriodsPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents, $contentType); + return $response; + } + + /** + * Operation getPeriodsPayScheduleWithHttpInfo + * + * Get PaySchedulePeriods + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule periods (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for (required) + * @param int $ordinal Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) (required) + * @param int|null $periodNumber Optionally specify a period number to get a result just for that period (optional) + * @param bool|null $includeEvents (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPeriodsPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedulePeriod[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPeriodsPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?int $periodNumber = null, + ?bool $includeEvents = false, + string $contentType = self::contentTypes['getPeriodsPaySchedule'][0] + ): array + { + $request = $this->getPeriodsPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedulePeriod[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedulePeriod[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedulePeriod[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriod[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedulePeriod[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPeriodsPayScheduleAsync + * + * Get PaySchedulePeriods + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule periods (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for (required) + * @param int $ordinal Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) (required) + * @param int|null $periodNumber Optionally specify a period number to get a result just for that period (optional) + * @param bool|null $includeEvents (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPeriodsPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPeriodsPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?int $periodNumber = null, + ?bool $includeEvents = false, + string $contentType = self::contentTypes['getPeriodsPaySchedule'][0] + ): PromiseInterface + { + return $this->getPeriodsPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPeriodsPayScheduleAsyncWithHttpInfo + * + * Get PaySchedulePeriods + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule periods (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for (required) + * @param int $ordinal Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) (required) + * @param int|null $periodNumber Optionally specify a period number to get a result just for that period (optional) + * @param bool|null $includeEvents (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPeriodsPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPeriodsPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $periodNumber = null, + $includeEvents = false, + string $contentType = self::contentTypes['getPeriodsPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriod[]'; + $request = $this->getPeriodsPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $includeEvents, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPeriodsPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule periods (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for (required) + * @param int $ordinal Optionally specify the second, third, fourth (etc) PaySchedule for this PayPeriod. Defaults to 1 (first) (required) + * @param int|null $periodNumber Optionally specify a period number to get a result just for that period (optional) + * @param bool|null $includeEvents (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPeriodsPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPeriodsPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $periodNumber = null, + $includeEvents = false, + string $contentType = self::contentTypes['getPeriodsPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPeriodsPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPeriodsPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPeriodsPaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling getPeriodsPaySchedule' + ); + } + + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodNumber, + 'periodNumber', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeEvents, + 'includeEvents', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWithOptionalOrdinalPaySchedule + * + * Get PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedule + */ + public function getWithOptionalOrdinalPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['getWithOptionalOrdinalPaySchedule'][0] + ): \SynergiTech\Staffology\Model\PaySchedule + { + list($response) = $this->getWithOptionalOrdinalPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + return $response; + } + + /** + * Operation getWithOptionalOrdinalPayScheduleWithHttpInfo + * + * Get PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedule, HTTP status code, HTTP response headers (array of strings) + */ + public function getWithOptionalOrdinalPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['getWithOptionalOrdinalPaySchedule'][0] + ): array + { + $request = $this->getWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedule', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedule' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedule', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWithOptionalOrdinalPayScheduleAsync + * + * Get PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getWithOptionalOrdinalPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + string $contentType = self::contentTypes['getWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + return $this->getWithOptionalOrdinalPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWithOptionalOrdinalPayScheduleAsyncWithHttpInfo + * + * Get PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getWithOptionalOrdinalPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + string $contentType = self::contentTypes['getWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + $request = $this->getWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWithOptionalOrdinalPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to get the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to retrieve details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that you want to retrieve details for. (required) + * @param int|null $ordinal (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getWithOptionalOrdinalPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + string $contentType = self::contentTypes['getWithOptionalOrdinalPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getWithOptionalOrdinalPaySchedule' + ); + } + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation savePaySchedule + * + * Update PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedule + */ + public function savePaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['savePaySchedule'][0] + ): \SynergiTech\Staffology\Model\PaySchedule + { + list($response) = $this->savePayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + return $response; + } + + /** + * Operation savePayScheduleWithHttpInfo + * + * Update PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedule, HTTP status code, HTTP response headers (array of strings) + */ + public function savePayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['savePaySchedule'][0] + ): array + { + $request = $this->savePayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedule', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedule' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedule', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation savePayScheduleAsync + * + * Update PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function savePayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['savePaySchedule'][0] + ): PromiseInterface + { + return $this->savePayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation savePayScheduleAsyncWithHttpInfo + * + * Update PaySchedule + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function savePayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $paySchedule = null, + string $contentType = self::contentTypes['savePaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + $request = $this->savePayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'savePaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int $ordinal Specify if this is the first, second, third (etc) PaySchedule for this PayPeriod. Use 1 for the first, 2 for the second, etc. (required) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function savePayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $paySchedule = null, + string $contentType = self::contentTypes['savePaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling savePaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling savePaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling savePaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling savePaySchedule' + ); + } + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paySchedule)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paySchedule)); + } else { + $httpBody = $paySchedule; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation saveWithOptionalOrdinalPaySchedule + * + * Update PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedule + */ + public function saveWithOptionalOrdinalPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['saveWithOptionalOrdinalPaySchedule'][0] + ): \SynergiTech\Staffology\Model\PaySchedule + { + list($response) = $this->saveWithOptionalOrdinalPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + return $response; + } + + /** + * Operation saveWithOptionalOrdinalPayScheduleWithHttpInfo + * + * Update PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedule, HTTP status code, HTTP response headers (array of strings) + */ + public function saveWithOptionalOrdinalPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['saveWithOptionalOrdinalPaySchedule'][0] + ): array + { + $request = $this->saveWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedule', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedule' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedule', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedule', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation saveWithOptionalOrdinalPayScheduleAsync + * + * Update PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function saveWithOptionalOrdinalPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\PaySchedule $paySchedule = null, + string $contentType = self::contentTypes['saveWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + return $this->saveWithOptionalOrdinalPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation saveWithOptionalOrdinalPayScheduleAsyncWithHttpInfo + * + * Update PaySchedule (deprecated) + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function saveWithOptionalOrdinalPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $paySchedule = null, + string $contentType = self::contentTypes['saveWithOptionalOrdinalPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedule'; + $request = $this->saveWithOptionalOrdinalPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $paySchedule, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'saveWithOptionalOrdinalPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedule (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for. (required) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\PaySchedule|null $paySchedule (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWithOptionalOrdinalPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function saveWithOptionalOrdinalPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $paySchedule = null, + string $contentType = self::contentTypes['saveWithOptionalOrdinalPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling saveWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling saveWithOptionalOrdinalPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling saveWithOptionalOrdinalPaySchedule' + ); + } + + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paySchedule)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paySchedule)); + } else { + $httpBody = $paySchedule; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePaySchedulePeriodPaySchedule + * + * Update PaySchedulePeriod + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedulePeriod (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for (required) + * @param int $ordinal Specify the first, second, third (etc) PaySchedule for this PayPeriod. (required) + * @param int $periodNumber Specify the number of the period that you want to update the PaymentDate for (required) + * @param \SynergiTech\Staffology\Model\PaySchedulePeriod|null $paySchedulePeriod paySchedulePeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySchedulePeriodPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySchedulePeriod + */ + public function updatePaySchedulePeriodPaySchedule( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + int $periodNumber, + ?\SynergiTech\Staffology\Model\PaySchedulePeriod $paySchedulePeriod = null, + string $contentType = self::contentTypes['updatePaySchedulePeriodPaySchedule'][0] + ): \SynergiTech\Staffology\Model\PaySchedulePeriod + { + list($response) = $this->updatePaySchedulePeriodPayScheduleWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod, $contentType); + return $response; + } + + /** + * Operation updatePaySchedulePeriodPayScheduleWithHttpInfo + * + * Update PaySchedulePeriod + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedulePeriod (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for (required) + * @param int $ordinal Specify the first, second, third (etc) PaySchedule for this PayPeriod. (required) + * @param int $periodNumber Specify the number of the period that you want to update the PaymentDate for (required) + * @param \SynergiTech\Staffology\Model\PaySchedulePeriod|null $paySchedulePeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySchedulePeriodPaySchedule'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySchedulePeriod, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePaySchedulePeriodPayScheduleWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + int $periodNumber, + ?\SynergiTech\Staffology\Model\PaySchedulePeriod $paySchedulePeriod = null, + string $contentType = self::contentTypes['updatePaySchedulePeriodPaySchedule'][0] + ): array + { + $request = $this->updatePaySchedulePeriodPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySchedulePeriod', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySchedulePeriod' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySchedulePeriod', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriod'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySchedulePeriod', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePaySchedulePeriodPayScheduleAsync + * + * Update PaySchedulePeriod + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedulePeriod (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for (required) + * @param int $ordinal Specify the first, second, third (etc) PaySchedule for this PayPeriod. (required) + * @param int $periodNumber Specify the number of the period that you want to update the PaymentDate for (required) + * @param \SynergiTech\Staffology\Model\PaySchedulePeriod|null $paySchedulePeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySchedulePeriodPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaySchedulePeriodPayScheduleAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $ordinal, + int $periodNumber, + ?\SynergiTech\Staffology\Model\PaySchedulePeriod $paySchedulePeriod = null, + string $contentType = self::contentTypes['updatePaySchedulePeriodPaySchedule'][0] + ): PromiseInterface + { + return $this->updatePaySchedulePeriodPayScheduleAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePaySchedulePeriodPayScheduleAsyncWithHttpInfo + * + * Update PaySchedulePeriod + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedulePeriod (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for (required) + * @param int $ordinal Specify the first, second, third (etc) PaySchedule for this PayPeriod. (required) + * @param int $periodNumber Specify the number of the period that you want to update the PaymentDate for (required) + * @param \SynergiTech\Staffology\Model\PaySchedulePeriod|null $paySchedulePeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySchedulePeriodPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaySchedulePeriodPayScheduleAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $periodNumber, + $paySchedulePeriod = null, + string $contentType = self::contentTypes['updatePaySchedulePeriodPaySchedule'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySchedulePeriod'; + $request = $this->updatePaySchedulePeriodPayScheduleRequest($employerId, $payPeriod, $taxYear, $ordinal, $periodNumber, $paySchedulePeriod, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePaySchedulePeriodPaySchedule' + * + * @param string $employerId The Id of the Employer for which you want to update the PaySchedulePeriod (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The PayPeriod (ie, Monthly) that you want to update details for (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The year that the PaySchedule is for (required) + * @param int $ordinal Specify the first, second, third (etc) PaySchedule for this PayPeriod. (required) + * @param int $periodNumber Specify the number of the period that you want to update the PaymentDate for (required) + * @param \SynergiTech\Staffology\Model\PaySchedulePeriod|null $paySchedulePeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySchedulePeriodPaySchedule'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePaySchedulePeriodPayScheduleRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal, + $periodNumber, + $paySchedulePeriod = null, + string $contentType = self::contentTypes['updatePaySchedulePeriodPaySchedule'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePaySchedulePeriodPaySchedule' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling updatePaySchedulePeriodPaySchedule' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling updatePaySchedulePeriodPaySchedule' + ); + } + + // verify the required parameter 'ordinal' is set + if ($ordinal === null || (is_array($ordinal) && count($ordinal) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $ordinal when calling updatePaySchedulePeriodPaySchedule' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling updatePaySchedulePeriodPaySchedule' + ); + } + + + + $resourcePath = '/employers/{employerId}/schedules/{taxYear}/{payPeriod}/{ordinal}/periods/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($ordinal !== null) { + $resourcePath = str_replace( + '{' . 'ordinal' . '}', + ObjectSerializer::toPathValue($ordinal), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($paySchedulePeriod)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($paySchedulePeriod)); + } else { + $httpBody = $paySchedulePeriod; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PaySpineApi.php b/src/Api/PaySpineApi.php new file mode 100644 index 0000000..bc70e49 --- /dev/null +++ b/src/Api/PaySpineApi.php @@ -0,0 +1,15610 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createLondonAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createMultipleAllowanceGradesPaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createMultiplePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createMultipleSpineAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createPaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createPaySpineGradePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createSpinalPointPaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createSpineAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteAllAllowanceGradesPaySpine' => [ + 'application/json', + ], + 'deleteAllSpinalPointsPaySpine' => [ + 'application/json', + ], + 'deleteAllSpineAllowancesPaySpine' => [ + 'application/json', + ], + 'deleteAllowanceGradePaySpine' => [ + 'application/json', + ], + 'deleteLondonAllowancePaySpine' => [ + 'application/json', + ], + 'deletePaySpine' => [ + 'application/json', + ], + 'deletePaySpineGradePaySpine' => [ + 'application/json', + ], + 'deleteSpinalPointPaySpine' => [ + 'application/json', + ], + 'deleteSpineAllowancePaySpine' => [ + 'application/json', + ], + 'getAllowanceGradePaySpine' => [ + 'application/json', + ], + 'getAllowanceGradesPaySpine' => [ + 'application/json', + ], + 'getAnnualValueFromSalaryFormulaPaySpine' => [ + 'application/json', + ], + 'getLondonAllowanceListPaySpine' => [ + 'application/json', + ], + 'getLondonAllowancePaySpine' => [ + 'application/json', + ], + 'getPaySpine' => [ + 'application/json', + ], + 'getPaySpineGradeListPaySpine' => [ + 'application/json', + ], + 'getPaySpineGradePaySpine' => [ + 'application/json', + ], + 'getSpinalPointListPaySpine' => [ + 'application/json', + ], + 'getSpinalPointPaySpine' => [ + 'application/json', + ], + 'getSpineAllowanceListPaySpine' => [ + 'application/json', + ], + 'getSpineAllowancePaySpine' => [ + 'application/json', + ], + 'importCsvPaySpine' => [ + 'multipart/form-data', + ], + 'importCsvPaySpinePaySpine' => [ + 'multipart/form-data', + ], + 'importPayspineGradeCsvPaySpine' => [ + 'multipart/form-data', + ], + 'indexPaySpine' => [ + 'application/json', + ], + 'updateAllowanceGradePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateLondonAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateMultipleAllowanceGradesPaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateMultiplePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateMultipleSpineAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePayGradePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateSpinalPointPaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateSpineAllowancePaySpine' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createAllowanceGradesPaySpine + * + * Create AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to create Allowance Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + */ + public function createAllowanceGradesPaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createAllowanceGradesPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + { + list($response) = $this->createAllowanceGradesPaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + return $response; + } + + /** + * Operation createAllowanceGradesPaySpineWithHttpInfo + * + * Create AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to create Allowance Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createAllowanceGradesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createAllowanceGradesPaySpine'][0] + ): array + { + $request = $this->createAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAllowanceGradesPaySpineAsync + * + * Create AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to create Allowance Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAllowanceGradesPaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + return $this->createAllowanceGradesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAllowanceGradesPaySpineAsyncWithHttpInfo + * + * Create AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to create Allowance Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createAllowanceGradesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + $request = $this->createAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAllowanceGradesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create Allowance Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createAllowanceGradesPaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createAllowanceGradesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling createAllowanceGradesPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAllowanceGradesRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAllowanceGradesRequest)); + } else { + $httpBody = $contractAllowanceGradesRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createLondonAllowancePaySpine + * + * Create LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to create London Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + */ + public function createLondonAllowancePaySpine( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['createLondonAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + { + list($response) = $this->createLondonAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $contractLondonAllowanceRequest, $contentType); + return $response; + } + + /** + * Operation createLondonAllowancePaySpineWithHttpInfo + * + * Create LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to create London Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createLondonAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['createLondonAllowancePaySpine'][0] + ): array + { + $request = $this->createLondonAllowancePaySpineRequest($employerId, $paySpineId, $contractLondonAllowanceRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createLondonAllowancePaySpineAsync + * + * Create LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to create London Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLondonAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['createLondonAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->createLondonAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractLondonAllowanceRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLondonAllowancePaySpineAsyncWithHttpInfo + * + * Create LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to create London Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createLondonAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['createLondonAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + $request = $this->createLondonAllowancePaySpineRequest($employerId, $paySpineId, $contractLondonAllowanceRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createLondonAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create London Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createLondonAllowancePaySpineRequest( + $employerId, + $paySpineId, + $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['createLondonAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createLondonAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/londonallowances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractLondonAllowanceRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractLondonAllowanceRequest)); + } else { + $httpBody = $contractLondonAllowanceRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createMultipleAllowanceGradesPaySpine + * + * Create Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to create multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]|null $contractAllowanceGradesRequest contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] + */ + public function createMultipleAllowanceGradesPaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createMultipleAllowanceGradesPaySpine'][0] + ): array + { + list($response) = $this->createMultipleAllowanceGradesPaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + return $response; + } + + /** + * Operation createMultipleAllowanceGradesPaySpineWithHttpInfo + * + * Create Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to create multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function createMultipleAllowanceGradesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createMultipleAllowanceGradesPaySpine'][0] + ): array + { + $request = $this->createMultipleAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createMultipleAllowanceGradesPaySpineAsync + * + * Create Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to create multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultipleAllowanceGradesPaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createMultipleAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + return $this->createMultipleAllowanceGradesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createMultipleAllowanceGradesPaySpineAsyncWithHttpInfo + * + * Create Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to create multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultipleAllowanceGradesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createMultipleAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + $request = $this->createMultipleAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createMultipleAllowanceGradesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to create multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest[]|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createMultipleAllowanceGradesPaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['createMultipleAllowanceGradesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createMultipleAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createMultipleAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling createMultipleAllowanceGradesPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/create/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAllowanceGradesRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAllowanceGradesRequest)); + } else { + $httpBody = $contractAllowanceGradesRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createMultiplePaySpine + * + * Create Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to create multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest[]|null $contractSpinalPointRequest contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultiplePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] + */ + public function createMultiplePaySpine( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createMultiplePaySpine'][0] + ): array + { + list($response) = $this->createMultiplePaySpineWithHttpInfo($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + return $response; + } + + /** + * Operation createMultiplePaySpineWithHttpInfo + * + * Create Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to create multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest[]|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultiplePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpinalPointResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function createMultiplePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createMultiplePaySpine'][0] + ): array + { + $request = $this->createMultiplePaySpineRequest($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createMultiplePaySpineAsync + * + * Create Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to create multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest[]|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultiplePaySpineAsync( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createMultiplePaySpine'][0] + ): PromiseInterface + { + return $this->createMultiplePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpinalPointRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createMultiplePaySpineAsyncWithHttpInfo + * + * Create Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to create multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest[]|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultiplePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createMultiplePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + $request = $this->createMultiplePaySpineRequest($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createMultiplePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest[]|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createMultiplePaySpineRequest( + $employerId, + $paySpineId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createMultiplePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createMultiplePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createMultiplePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpinalPointRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpinalPointRequest)); + } else { + $httpBody = $contractSpinalPointRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createMultipleSpineAllowancePaySpine + * + * Create Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to create multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]|null $contractSpineAllowanceRequest contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] + */ + public function createMultipleSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createMultipleSpineAllowancePaySpine'][0] + ): array + { + list($response) = $this->createMultipleSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + return $response; + } + + /** + * Operation createMultipleSpineAllowancePaySpineWithHttpInfo + * + * Create Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to create multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function createMultipleSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createMultipleSpineAllowancePaySpine'][0] + ): array + { + $request = $this->createMultipleSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createMultipleSpineAllowancePaySpineAsync + * + * Create Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to create multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultipleSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createMultipleSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->createMultipleSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createMultipleSpineAllowancePaySpineAsyncWithHttpInfo + * + * Create Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to create multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createMultipleSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createMultipleSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + $request = $this->createMultipleSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createMultipleSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to create multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest[]|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createMultipleSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createMultipleSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createMultipleSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createMultipleSpineAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/create/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpineAllowanceRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpineAllowanceRequest)); + } else { + $httpBody = $contractSpineAllowanceRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createPaySpine + * + * Create PaySpine + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineRequest|null $contractPaySpineRequest contractPaySpineRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractPaySpineResponse + */ + public function createPaySpine( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractPaySpineRequest $contractPaySpineRequest = null, + string $contentType = self::contentTypes['createPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineResponse + { + list($response) = $this->createPaySpineWithHttpInfo($employerId, $contractPaySpineRequest, $contentType); + return $response; + } + + /** + * Operation createPaySpineWithHttpInfo + * + * Create PaySpine + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineRequest|null $contractPaySpineRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractPaySpineResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createPaySpineWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractPaySpineRequest $contractPaySpineRequest = null, + string $contentType = self::contentTypes['createPaySpine'][0] + ): array + { + $request = $this->createPaySpineRequest($employerId, $contractPaySpineRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPaySpineAsync + * + * Create PaySpine + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineRequest|null $contractPaySpineRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaySpineAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractPaySpineRequest $contractPaySpineRequest = null, + string $contentType = self::contentTypes['createPaySpine'][0] + ): PromiseInterface + { + return $this->createPaySpineAsyncWithHttpInfo($employerId, $contractPaySpineRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPaySpineAsyncWithHttpInfo + * + * Create PaySpine + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineRequest|null $contractPaySpineRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaySpineAsyncWithHttpInfo( + $employerId, + $contractPaySpineRequest = null, + string $contentType = self::contentTypes['createPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + $request = $this->createPaySpineRequest($employerId, $contractPaySpineRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPaySpine' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineRequest|null $contractPaySpineRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPaySpineRequest( + $employerId, + $contractPaySpineRequest = null, + string $contentType = self::contentTypes['createPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPaySpineRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPaySpineRequest)); + } else { + $httpBody = $contractPaySpineRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createPaySpineGradePaySpine + * + * Create PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to create PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + */ + public function createPaySpineGradePaySpine( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['createPaySpineGradePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + { + list($response) = $this->createPaySpineGradePaySpineWithHttpInfo($employerId, $paySpineId, $contractPaySpineGradeRequest, $contentType); + return $response; + } + + /** + * Operation createPaySpineGradePaySpineWithHttpInfo + * + * Create PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to create PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createPaySpineGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['createPaySpineGradePaySpine'][0] + ): array + { + $request = $this->createPaySpineGradePaySpineRequest($employerId, $paySpineId, $contractPaySpineGradeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPaySpineGradePaySpineAsync + * + * Create PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to create PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaySpineGradePaySpineAsync( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['createPaySpineGradePaySpine'][0] + ): PromiseInterface + { + return $this->createPaySpineGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractPaySpineGradeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPaySpineGradePaySpineAsyncWithHttpInfo + * + * Create PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to create PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPaySpineGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['createPaySpineGradePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + $request = $this->createPaySpineGradePaySpineRequest($employerId, $paySpineId, $contractPaySpineGradeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPaySpineGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPaySpineGradePaySpineRequest( + $employerId, + $paySpineId, + $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['createPaySpineGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPaySpineGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createPaySpineGradePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/paygrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPaySpineGradeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPaySpineGradeRequest)); + } else { + $httpBody = $contractPaySpineGradeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSpinalPointPaySpine + * + * Create SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to create Spinal Point (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractSpinalPointResponse + */ + public function createSpinalPointPaySpine( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createSpinalPointPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpinalPointResponse + { + list($response) = $this->createSpinalPointPaySpineWithHttpInfo($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + return $response; + } + + /** + * Operation createSpinalPointPaySpineWithHttpInfo + * + * Create SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to create Spinal Point (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractSpinalPointResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createSpinalPointPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createSpinalPointPaySpine'][0] + ): array + { + $request = $this->createSpinalPointPaySpineRequest($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSpinalPointPaySpineAsync + * + * Create SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to create Spinal Point (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createSpinalPointPaySpineAsync( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createSpinalPointPaySpine'][0] + ): PromiseInterface + { + return $this->createSpinalPointPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpinalPointRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSpinalPointPaySpineAsyncWithHttpInfo + * + * Create SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to create Spinal Point (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createSpinalPointPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createSpinalPointPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + $request = $this->createSpinalPointPaySpineRequest($employerId, $paySpineId, $contractSpinalPointRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSpinalPointPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create Spinal Point (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSpinalPointPaySpineRequest( + $employerId, + $paySpineId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['createSpinalPointPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createSpinalPointPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createSpinalPointPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpinalPointRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpinalPointRequest)); + } else { + $httpBody = $contractSpinalPointRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSpineAllowancePaySpine + * + * Create SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to create Spine Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + */ + public function createSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createSpineAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + { + list($response) = $this->createSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + return $response; + } + + /** + * Operation createSpineAllowancePaySpineWithHttpInfo + * + * Create SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to create Spine Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createSpineAllowancePaySpine'][0] + ): array + { + $request = $this->createSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSpineAllowancePaySpineAsync + * + * Create SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to create Spine Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->createSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSpineAllowancePaySpineAsyncWithHttpInfo + * + * Create SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to create Spine Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + $request = $this->createSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to create Spine Allowance (required) + * @param string $paySpineId The Id of the Pay spine for which you want to create Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['createSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling createSpineAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpineAllowanceRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpineAllowanceRequest)); + } else { + $httpBody = $contractSpineAllowanceRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAllAllowanceGradesPaySpine + * + * Delete All AllowanceGrades Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAllAllowanceGradesPaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['deleteAllAllowanceGradesPaySpine'][0] + ): void + { + $this->deleteAllAllowanceGradesPaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $contentType); + } + + /** + * Operation deleteAllAllowanceGradesPaySpineWithHttpInfo + * + * Delete All AllowanceGrades Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAllAllowanceGradesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['deleteAllAllowanceGradesPaySpine'][0] + ): array + { + $request = $this->deleteAllAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAllAllowanceGradesPaySpineAsync + * + * Delete All AllowanceGrades Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllAllowanceGradesPaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['deleteAllAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + return $this->deleteAllAllowanceGradesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAllAllowanceGradesPaySpineAsyncWithHttpInfo + * + * Delete All AllowanceGrades Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllAllowanceGradesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + string $contentType = self::contentTypes['deleteAllAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAllAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAllAllowanceGradesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAllAllowanceGradesPaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + string $contentType = self::contentTypes['deleteAllAllowanceGradesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAllAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteAllAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling deleteAllAllowanceGradesPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAllSpinalPointsPaySpine + * + * Delete All SpinalPoints Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpinalPointsPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAllSpinalPointsPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpinalPointsPaySpine'][0] + ): void + { + $this->deleteAllSpinalPointsPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + } + + /** + * Operation deleteAllSpinalPointsPaySpineWithHttpInfo + * + * Delete All SpinalPoints Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpinalPointsPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAllSpinalPointsPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpinalPointsPaySpine'][0] + ): array + { + $request = $this->deleteAllSpinalPointsPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAllSpinalPointsPaySpineAsync + * + * Delete All SpinalPoints Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpinalPointsPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllSpinalPointsPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpinalPointsPaySpine'][0] + ): PromiseInterface + { + return $this->deleteAllSpinalPointsPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAllSpinalPointsPaySpineAsyncWithHttpInfo + * + * Delete All SpinalPoints Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpinalPointsPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllSpinalPointsPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['deleteAllSpinalPointsPaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAllSpinalPointsPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAllSpinalPointsPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpinalPointsPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAllSpinalPointsPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['deleteAllSpinalPointsPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAllSpinalPointsPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteAllSpinalPointsPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAllSpineAllowancesPaySpine + * + * Delete All SpineAllowances Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete SpineAllowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete SpineAllowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpineAllowancesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAllSpineAllowancesPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpineAllowancesPaySpine'][0] + ): void + { + $this->deleteAllSpineAllowancesPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + } + + /** + * Operation deleteAllSpineAllowancesPaySpineWithHttpInfo + * + * Delete All SpineAllowances Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete SpineAllowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete SpineAllowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpineAllowancesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAllSpineAllowancesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpineAllowancesPaySpine'][0] + ): array + { + $request = $this->deleteAllSpineAllowancesPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAllSpineAllowancesPaySpineAsync + * + * Delete All SpineAllowances Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete SpineAllowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete SpineAllowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpineAllowancesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllSpineAllowancesPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['deleteAllSpineAllowancesPaySpine'][0] + ): PromiseInterface + { + return $this->deleteAllSpineAllowancesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAllSpineAllowancesPaySpineAsyncWithHttpInfo + * + * Delete All SpineAllowances Associated with a PaySpine + * + * @param string $employerId The Id of the Employer for which you want to delete SpineAllowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete SpineAllowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpineAllowancesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllSpineAllowancesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['deleteAllSpineAllowancesPaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAllSpineAllowancesPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAllSpineAllowancesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete SpineAllowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete SpineAllowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllSpineAllowancesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAllSpineAllowancesPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['deleteAllSpineAllowancesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAllSpineAllowancesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteAllSpineAllowancesPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAllowanceGradePaySpine + * + * Delete AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to delete Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteAllowanceGradePaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['deleteAllowanceGradePaySpine'][0] + ): void + { + $this->deleteAllowanceGradePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + } + + /** + * Operation deleteAllowanceGradePaySpineWithHttpInfo + * + * Delete AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to delete Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAllowanceGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['deleteAllowanceGradePaySpine'][0] + ): array + { + $request = $this->deleteAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteAllowanceGradePaySpineAsync + * + * Delete AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to delete Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllowanceGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['deleteAllowanceGradePaySpine'][0] + ): PromiseInterface + { + return $this->deleteAllowanceGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAllowanceGradePaySpineAsyncWithHttpInfo + * + * Delete AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to delete Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteAllowanceGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + string $contentType = self::contentTypes['deleteAllowanceGradePaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAllowanceGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to delete Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to delete Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAllowanceGradePaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + string $contentType = self::contentTypes['deleteAllowanceGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling deleteAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceGradeId' is set + if ($allowanceGradeId === null || (is_array($allowanceGradeId) && count($allowanceGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceGradeId when calling deleteAllowanceGradePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + // path params + if ($allowanceGradeId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceGradeId' . '}', + ObjectSerializer::toPathValue($allowanceGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLondonAllowancePaySpine + * + * Delete LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete London Allowance (required) + * @param string $londonAllowanceId The Id of the Spinal Point for which you want to delete London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteLondonAllowancePaySpine( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['deleteLondonAllowancePaySpine'][0] + ): void + { + $this->deleteLondonAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contentType); + } + + /** + * Operation deleteLondonAllowancePaySpineWithHttpInfo + * + * Delete LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete London Allowance (required) + * @param string $londonAllowanceId The Id of the Spinal Point for which you want to delete London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLondonAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['deleteLondonAllowancePaySpine'][0] + ): array + { + $request = $this->deleteLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteLondonAllowancePaySpineAsync + * + * Delete LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete London Allowance (required) + * @param string $londonAllowanceId The Id of the Spinal Point for which you want to delete London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLondonAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['deleteLondonAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->deleteLondonAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLondonAllowancePaySpineAsyncWithHttpInfo + * + * Delete LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete London Allowance (required) + * @param string $londonAllowanceId The Id of the Spinal Point for which you want to delete London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteLondonAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $londonAllowanceId, + string $contentType = self::contentTypes['deleteLondonAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLondonAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete London Allowance (required) + * @param string $londonAllowanceId The Id of the Spinal Point for which you want to delete London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteLondonAllowancePaySpineRequest( + $employerId, + $paySpineId, + $londonAllowanceId, + string $contentType = self::contentTypes['deleteLondonAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'londonAllowanceId' is set + if ($londonAllowanceId === null || (is_array($londonAllowanceId) && count($londonAllowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $londonAllowanceId when calling deleteLondonAllowancePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($londonAllowanceId !== null) { + $resourcePath = str_replace( + '{' . 'londonAllowanceId' . '}', + ObjectSerializer::toPathValue($londonAllowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePaySpine + * + * Delete PaySpine + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePaySpine( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaySpine'][0] + ): void + { + $this->deletePaySpineWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePaySpineWithHttpInfo + * + * Delete PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePaySpineWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaySpine'][0] + ): array + { + $request = $this->deletePaySpineRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePaySpineAsync + * + * Delete PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaySpineAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePaySpine'][0] + ): PromiseInterface + { + return $this->deletePaySpineAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePaySpineAsyncWithHttpInfo + * + * Delete PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaySpineAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePaySpineRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePaySpine' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePaySpineRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePaySpine' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePaySpineGradePaySpine + * + * Delete PaySpine Grade + * + * @param string $employerId employerId (required) + * @param string $paySpineId paySpineId (required) + * @param string $payGradeId payGradeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePaySpineGradePaySpine( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['deletePaySpineGradePaySpine'][0] + ): void + { + $this->deletePaySpineGradePaySpineWithHttpInfo($employerId, $paySpineId, $payGradeId, $contentType); + } + + /** + * Operation deletePaySpineGradePaySpineWithHttpInfo + * + * Delete PaySpine Grade + * + * @param string $employerId (required) + * @param string $paySpineId (required) + * @param string $payGradeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePaySpineGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['deletePaySpineGradePaySpine'][0] + ): array + { + $request = $this->deletePaySpineGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePaySpineGradePaySpineAsync + * + * Delete PaySpine Grade + * + * @param string $employerId (required) + * @param string $paySpineId (required) + * @param string $payGradeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaySpineGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['deletePaySpineGradePaySpine'][0] + ): PromiseInterface + { + return $this->deletePaySpineGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $payGradeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePaySpineGradePaySpineAsyncWithHttpInfo + * + * Delete PaySpine Grade + * + * @param string $employerId (required) + * @param string $paySpineId (required) + * @param string $payGradeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePaySpineGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $payGradeId, + string $contentType = self::contentTypes['deletePaySpineGradePaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePaySpineGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePaySpineGradePaySpine' + * + * @param string $employerId (required) + * @param string $paySpineId (required) + * @param string $payGradeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePaySpineGradePaySpineRequest( + $employerId, + $paySpineId, + $payGradeId, + string $contentType = self::contentTypes['deletePaySpineGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePaySpineGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deletePaySpineGradePaySpine' + ); + } + + // verify the required parameter 'payGradeId' is set + if ($payGradeId === null || (is_array($payGradeId) && count($payGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payGradeId when calling deletePaySpineGradePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($payGradeId !== null) { + $resourcePath = str_replace( + '{' . 'payGradeId' . '}', + ObjectSerializer::toPathValue($payGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSpinalPointPaySpine + * + * Delete SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point List (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteSpinalPointPaySpine( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['deleteSpinalPointPaySpine'][0] + ): void + { + $this->deleteSpinalPointPaySpineWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contentType); + } + + /** + * Operation deleteSpinalPointPaySpineWithHttpInfo + * + * Delete SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point List (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSpinalPointPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['deleteSpinalPointPaySpine'][0] + ): array + { + $request = $this->deleteSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteSpinalPointPaySpineAsync + * + * Delete SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point List (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteSpinalPointPaySpineAsync( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['deleteSpinalPointPaySpine'][0] + ): PromiseInterface + { + return $this->deleteSpinalPointPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSpinalPointPaySpineAsyncWithHttpInfo + * + * Delete SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point List (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteSpinalPointPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $spinalPointId, + string $contentType = self::contentTypes['deleteSpinalPointPaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSpinalPointPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point List (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point List (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSpinalPointPaySpineRequest( + $employerId, + $paySpineId, + $spinalPointId, + string $contentType = self::contentTypes['deleteSpinalPointPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteSpinalPointPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteSpinalPointPaySpine' + ); + } + + // verify the required parameter 'spinalPointId' is set + if ($spinalPointId === null || (is_array($spinalPointId) && count($spinalPointId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $spinalPointId when calling deleteSpinalPointPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($spinalPointId !== null) { + $resourcePath = str_replace( + '{' . 'spinalPointId' . '}', + ObjectSerializer::toPathValue($spinalPointId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSpineAllowancePaySpine + * + * Delete SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to delete Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['deleteSpineAllowancePaySpine'][0] + ): void + { + $this->deleteSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceid, $contentType); + } + + /** + * Operation deleteSpineAllowancePaySpineWithHttpInfo + * + * Delete SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to delete Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['deleteSpineAllowancePaySpine'][0] + ): array + { + $request = $this->deleteSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteSpineAllowancePaySpineAsync + * + * Delete SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to delete Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['deleteSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->deleteSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceid, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSpineAllowancePaySpineAsyncWithHttpInfo + * + * Delete SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to delete Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to delete Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceid, + string $contentType = self::contentTypes['deleteSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to delete Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to delete Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to delete Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $allowanceid, + string $contentType = self::contentTypes['deleteSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling deleteSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'allowanceid' is set + if ($allowanceid === null || (is_array($allowanceid) && count($allowanceid) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceid when calling deleteSpineAllowancePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceid !== null) { + $resourcePath = str_replace( + '{' . 'allowanceid' . '}', + ObjectSerializer::toPathValue($allowanceid), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAllowanceGradePaySpine + * + * Get AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + */ + public function getAllowanceGradePaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['getAllowanceGradePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + { + list($response) = $this->getAllowanceGradePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + return $response; + } + + /** + * Operation getAllowanceGradePaySpineWithHttpInfo + * + * Get AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAllowanceGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['getAllowanceGradePaySpine'][0] + ): array + { + $request = $this->getAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAllowanceGradePaySpineAsync + * + * Get AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllowanceGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + string $contentType = self::contentTypes['getAllowanceGradePaySpine'][0] + ): PromiseInterface + { + return $this->getAllowanceGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAllowanceGradePaySpineAsyncWithHttpInfo + * + * Get AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllowanceGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + string $contentType = self::contentTypes['getAllowanceGradePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + $request = $this->getAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAllowanceGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want Allowance Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAllowanceGradePaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + string $contentType = self::contentTypes['getAllowanceGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling getAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceGradeId' is set + if ($allowanceGradeId === null || (is_array($allowanceGradeId) && count($allowanceGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceGradeId when calling getAllowanceGradePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + // path params + if ($allowanceGradeId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceGradeId' . '}', + ObjectSerializer::toPathValue($allowanceGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAllowanceGradesPaySpine + * + * List AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want list of Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want list of Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] + */ + public function getAllowanceGradesPaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['getAllowanceGradesPaySpine'][0] + ): array + { + list($response) = $this->getAllowanceGradesPaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $contentType); + return $response; + } + + /** + * Operation getAllowanceGradesPaySpineWithHttpInfo + * + * List AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want list of Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want list of Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getAllowanceGradesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['getAllowanceGradesPaySpine'][0] + ): array + { + $request = $this->getAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAllowanceGradesPaySpineAsync + * + * List AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want list of Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want list of Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllowanceGradesPaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + string $contentType = self::contentTypes['getAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + return $this->getAllowanceGradesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAllowanceGradesPaySpineAsyncWithHttpInfo + * + * List AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want list of Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want list of Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAllowanceGradesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + string $contentType = self::contentTypes['getAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + $request = $this->getAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAllowanceGradesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want list of Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want list of Allowance Grades (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAllowanceGradesPaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + string $contentType = self::contentTypes['getAllowanceGradesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling getAllowanceGradesPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAnnualValueFromSalaryFormulaPaySpine + * + * Get Annual Value from pay spines formula + * + * @param string $employerId The Employer id. (required) + * @param string $id The selected PaySpine Id. (required) + * @param string|null $employeeId The Employee id. (optional) + * @param string|null $paySpineGradeId The selected PaySpineGrade Id. (optional) + * @param string|null $spinalPointId The selected SpinalPoint Id. (optional) + * @param int|null $londonAllowanceType The London Allowance Id of PayLine. (optional) + * @param \DateTime|null $effectiveFrom The PayLine effective from. (optional) + * @param string|null $workingPatternId workingPatternId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaylineCalculationData + */ + public function getAnnualValueFromSalaryFormulaPaySpine( + string $employerId, + string $id, + ?string $employeeId = null, + ?string $paySpineGradeId = null, + ?string $spinalPointId = null, + ?int $londonAllowanceType = null, + ?\DateTime $effectiveFrom = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'][0] + ): \SynergiTech\Staffology\Model\PaylineCalculationData + { + list($response) = $this->getAnnualValueFromSalaryFormulaPaySpineWithHttpInfo($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId, $contentType); + return $response; + } + + /** + * Operation getAnnualValueFromSalaryFormulaPaySpineWithHttpInfo + * + * Get Annual Value from pay spines formula + * + * @param string $employerId The Employer id. (required) + * @param string $id The selected PaySpine Id. (required) + * @param string|null $employeeId The Employee id. (optional) + * @param string|null $paySpineGradeId The selected PaySpineGrade Id. (optional) + * @param string|null $spinalPointId The selected SpinalPoint Id. (optional) + * @param int|null $londonAllowanceType The London Allowance Id of PayLine. (optional) + * @param \DateTime|null $effectiveFrom The PayLine effective from. (optional) + * @param string|null $workingPatternId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaylineCalculationData, HTTP status code, HTTP response headers (array of strings) + */ + public function getAnnualValueFromSalaryFormulaPaySpineWithHttpInfo( + string $employerId, + string $id, + ?string $employeeId = null, + ?string $paySpineGradeId = null, + ?string $spinalPointId = null, + ?int $londonAllowanceType = null, + ?\DateTime $effectiveFrom = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'][0] + ): array + { + $request = $this->getAnnualValueFromSalaryFormulaPaySpineRequest($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaylineCalculationData', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaylineCalculationData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaylineCalculationData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaylineCalculationData'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaylineCalculationData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAnnualValueFromSalaryFormulaPaySpineAsync + * + * Get Annual Value from pay spines formula + * + * @param string $employerId The Employer id. (required) + * @param string $id The selected PaySpine Id. (required) + * @param string|null $employeeId The Employee id. (optional) + * @param string|null $paySpineGradeId The selected PaySpineGrade Id. (optional) + * @param string|null $spinalPointId The selected SpinalPoint Id. (optional) + * @param int|null $londonAllowanceType The London Allowance Id of PayLine. (optional) + * @param \DateTime|null $effectiveFrom The PayLine effective from. (optional) + * @param string|null $workingPatternId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnnualValueFromSalaryFormulaPaySpineAsync( + string $employerId, + string $id, + ?string $employeeId = null, + ?string $paySpineGradeId = null, + ?string $spinalPointId = null, + ?int $londonAllowanceType = null, + ?\DateTime $effectiveFrom = null, + ?string $workingPatternId = null, + string $contentType = self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'][0] + ): PromiseInterface + { + return $this->getAnnualValueFromSalaryFormulaPaySpineAsyncWithHttpInfo($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAnnualValueFromSalaryFormulaPaySpineAsyncWithHttpInfo + * + * Get Annual Value from pay spines formula + * + * @param string $employerId The Employer id. (required) + * @param string $id The selected PaySpine Id. (required) + * @param string|null $employeeId The Employee id. (optional) + * @param string|null $paySpineGradeId The selected PaySpineGrade Id. (optional) + * @param string|null $spinalPointId The selected SpinalPoint Id. (optional) + * @param int|null $londonAllowanceType The London Allowance Id of PayLine. (optional) + * @param \DateTime|null $effectiveFrom The PayLine effective from. (optional) + * @param string|null $workingPatternId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAnnualValueFromSalaryFormulaPaySpineAsyncWithHttpInfo( + $employerId, + $id, + $employeeId = null, + $paySpineGradeId = null, + $spinalPointId = null, + $londonAllowanceType = null, + $effectiveFrom = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaylineCalculationData'; + $request = $this->getAnnualValueFromSalaryFormulaPaySpineRequest($employerId, $id, $employeeId, $paySpineGradeId, $spinalPointId, $londonAllowanceType, $effectiveFrom, $workingPatternId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAnnualValueFromSalaryFormulaPaySpine' + * + * @param string $employerId The Employer id. (required) + * @param string $id The selected PaySpine Id. (required) + * @param string|null $employeeId The Employee id. (optional) + * @param string|null $paySpineGradeId The selected PaySpineGrade Id. (optional) + * @param string|null $spinalPointId The selected SpinalPoint Id. (optional) + * @param int|null $londonAllowanceType The London Allowance Id of PayLine. (optional) + * @param \DateTime|null $effectiveFrom The PayLine effective from. (optional) + * @param string|null $workingPatternId (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAnnualValueFromSalaryFormulaPaySpineRequest( + $employerId, + $id, + $employeeId = null, + $paySpineGradeId = null, + $spinalPointId = null, + $londonAllowanceType = null, + $effectiveFrom = null, + $workingPatternId = null, + string $contentType = self::contentTypes['getAnnualValueFromSalaryFormulaPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAnnualValueFromSalaryFormulaPaySpine' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAnnualValueFromSalaryFormulaPaySpine' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/payspines/{id}/annualsalarybypayspines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paySpineGradeId, + 'paySpineGradeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $spinalPointId, + 'spinalPointId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $londonAllowanceType, + 'londonAllowanceType', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveFrom, + 'effectiveFrom', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $workingPatternId, + 'workingPatternId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLondonAllowanceListPaySpine + * + * List LondonAllowances + * + * @param string $employerId The Id of the Employer for which you want list of London Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of London Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\LondonAllowance[] + */ + public function getLondonAllowanceListPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getLondonAllowanceListPaySpine'][0] + ): array + { + list($response) = $this->getLondonAllowanceListPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + return $response; + } + + /** + * Operation getLondonAllowanceListPaySpineWithHttpInfo + * + * List LondonAllowances + * + * @param string $employerId The Id of the Employer for which you want list of London Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of London Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\LondonAllowance[], HTTP status code, HTTP response headers (array of strings) + */ + public function getLondonAllowanceListPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getLondonAllowanceListPaySpine'][0] + ): array + { + $request = $this->getLondonAllowanceListPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\LondonAllowance[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\LondonAllowance[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\LondonAllowance[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\LondonAllowance[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\LondonAllowance[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLondonAllowanceListPaySpineAsync + * + * List LondonAllowances + * + * @param string $employerId The Id of the Employer for which you want list of London Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of London Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLondonAllowanceListPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getLondonAllowanceListPaySpine'][0] + ): PromiseInterface + { + return $this->getLondonAllowanceListPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLondonAllowanceListPaySpineAsyncWithHttpInfo + * + * List LondonAllowances + * + * @param string $employerId The Id of the Employer for which you want list of London Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of London Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLondonAllowanceListPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getLondonAllowanceListPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\LondonAllowance[]'; + $request = $this->getLondonAllowanceListPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLondonAllowanceListPaySpine' + * + * @param string $employerId The Id of the Employer for which you want list of London Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of London Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLondonAllowanceListPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getLondonAllowanceListPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLondonAllowanceListPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getLondonAllowanceListPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/londonallowances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLondonAllowancePaySpine + * + * Get LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to get London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to get London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + */ + public function getLondonAllowancePaySpine( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['getLondonAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + { + list($response) = $this->getLondonAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contentType); + return $response; + } + + /** + * Operation getLondonAllowancePaySpineWithHttpInfo + * + * Get LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to get London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to get London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getLondonAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['getLondonAllowancePaySpine'][0] + ): array + { + $request = $this->getLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLondonAllowancePaySpineAsync + * + * Get LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to get London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to get London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLondonAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + string $contentType = self::contentTypes['getLondonAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->getLondonAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLondonAllowancePaySpineAsyncWithHttpInfo + * + * Get LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to get London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to get London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getLondonAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $londonAllowanceId, + string $contentType = self::contentTypes['getLondonAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + $request = $this->getLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLondonAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to get London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to get London Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getLondonAllowancePaySpineRequest( + $employerId, + $paySpineId, + $londonAllowanceId, + string $contentType = self::contentTypes['getLondonAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'londonAllowanceId' is set + if ($londonAllowanceId === null || (is_array($londonAllowanceId) && count($londonAllowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $londonAllowanceId when calling getLondonAllowancePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($londonAllowanceId !== null) { + $resourcePath = str_replace( + '{' . 'londonAllowanceId' . '}', + ObjectSerializer::toPathValue($londonAllowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPaySpine + * + * Get PaySpine + * + * @param string $employerId The Id of the Employer to which the PaySpine belongs. (required) + * @param string $id The Id of the PaySpine which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPaySpineResponse + */ + public function getPaySpine( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineResponse + { + list($response) = $this->getPaySpineWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getPaySpineWithHttpInfo + * + * Get PaySpine + * + * @param string $employerId The Id of the Employer to which the PaySpine belongs. (required) + * @param string $id The Id of the PaySpine which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPaySpineResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPaySpineWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPaySpine'][0] + ): array + { + $request = $this->getPaySpineRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPaySpineAsync + * + * Get PaySpine + * + * @param string $employerId The Id of the Employer to which the PaySpine belongs. (required) + * @param string $id The Id of the PaySpine which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPaySpine'][0] + ): PromiseInterface + { + return $this->getPaySpineAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPaySpineAsyncWithHttpInfo + * + * Get PaySpine + * + * @param string $employerId The Id of the Employer to which the PaySpine belongs. (required) + * @param string $id The Id of the PaySpine which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + $request = $this->getPaySpineRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPaySpine' + * + * @param string $employerId The Id of the Employer to which the PaySpine belongs. (required) + * @param string $id The Id of the PaySpine which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPaySpineRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPaySpine' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPaySpineGradeListPaySpine + * + * List PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade List (required) + * @param string $paySpineId The Id of the PaySpine Grade for which you want PaySpine Grade List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradeListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[] + */ + public function getPaySpineGradeListPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getPaySpineGradeListPaySpine'][0] + ): array + { + list($response) = $this->getPaySpineGradeListPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + return $response; + } + + /** + * Operation getPaySpineGradeListPaySpineWithHttpInfo + * + * List PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade List (required) + * @param string $paySpineId The Id of the PaySpine Grade for which you want PaySpine Grade List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradeListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPaySpineGradeListPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getPaySpineGradeListPaySpine'][0] + ): array + { + $request = $this->getPaySpineGradeListPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPaySpineGradeListPaySpineAsync + * + * List PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade List (required) + * @param string $paySpineId The Id of the PaySpine Grade for which you want PaySpine Grade List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradeListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineGradeListPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getPaySpineGradeListPaySpine'][0] + ): PromiseInterface + { + return $this->getPaySpineGradeListPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPaySpineGradeListPaySpineAsyncWithHttpInfo + * + * List PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade List (required) + * @param string $paySpineId The Id of the PaySpine Grade for which you want PaySpine Grade List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradeListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineGradeListPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getPaySpineGradeListPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse[]'; + $request = $this->getPaySpineGradeListPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPaySpineGradeListPaySpine' + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade List (required) + * @param string $paySpineId The Id of the PaySpine Grade for which you want PaySpine Grade List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradeListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPaySpineGradeListPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getPaySpineGradeListPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPaySpineGradeListPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getPaySpineGradeListPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/paygrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPaySpineGradePaySpine + * + * Get PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want PaySpine Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + */ + public function getPaySpineGradePaySpine( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['getPaySpineGradePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + { + list($response) = $this->getPaySpineGradePaySpineWithHttpInfo($employerId, $paySpineId, $payGradeId, $contentType); + return $response; + } + + /** + * Operation getPaySpineGradePaySpineWithHttpInfo + * + * Get PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want PaySpine Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPaySpineGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['getPaySpineGradePaySpine'][0] + ): array + { + $request = $this->getPaySpineGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPaySpineGradePaySpineAsync + * + * Get PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want PaySpine Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $payGradeId, + string $contentType = self::contentTypes['getPaySpineGradePaySpine'][0] + ): PromiseInterface + { + return $this->getPaySpineGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $payGradeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPaySpineGradePaySpineAsyncWithHttpInfo + * + * Get PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want PaySpine Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPaySpineGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $payGradeId, + string $contentType = self::contentTypes['getPaySpineGradePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + $request = $this->getPaySpineGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPaySpineGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want PaySpine Grade (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaySpineGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPaySpineGradePaySpineRequest( + $employerId, + $paySpineId, + $payGradeId, + string $contentType = self::contentTypes['getPaySpineGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPaySpineGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getPaySpineGradePaySpine' + ); + } + + // verify the required parameter 'payGradeId' is set + if ($payGradeId === null || (is_array($payGradeId) && count($payGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payGradeId when calling getPaySpineGradePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($payGradeId !== null) { + $resourcePath = str_replace( + '{' . 'payGradeId' . '}', + ObjectSerializer::toPathValue($payGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSpinalPointListPaySpine + * + * List SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want Spinal Point List (required) + * @param string $paySpineId The Id of the Spinal Point for which you want Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] + */ + public function getSpinalPointListPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpinalPointListPaySpine'][0] + ): array + { + list($response) = $this->getSpinalPointListPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + return $response; + } + + /** + * Operation getSpinalPointListPaySpineWithHttpInfo + * + * List SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want Spinal Point List (required) + * @param string $paySpineId The Id of the Spinal Point for which you want Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpinalPointResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getSpinalPointListPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpinalPointListPaySpine'][0] + ): array + { + $request = $this->getSpinalPointListPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSpinalPointListPaySpineAsync + * + * List SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want Spinal Point List (required) + * @param string $paySpineId The Id of the Spinal Point for which you want Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpinalPointListPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpinalPointListPaySpine'][0] + ): PromiseInterface + { + return $this->getSpinalPointListPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSpinalPointListPaySpineAsyncWithHttpInfo + * + * List SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want Spinal Point List (required) + * @param string $paySpineId The Id of the Spinal Point for which you want Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpinalPointListPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getSpinalPointListPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + $request = $this->getSpinalPointListPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSpinalPointListPaySpine' + * + * @param string $employerId The Id of the Employer for which you want Spinal Point List (required) + * @param string $paySpineId The Id of the Spinal Point for which you want Spinal Point List (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSpinalPointListPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getSpinalPointListPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getSpinalPointListPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getSpinalPointListPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSpinalPointPaySpine + * + * Get SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want Spinal Point (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpinalPointResponse + */ + public function getSpinalPointPaySpine( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['getSpinalPointPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpinalPointResponse + { + list($response) = $this->getSpinalPointPaySpineWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contentType); + return $response; + } + + /** + * Operation getSpinalPointPaySpineWithHttpInfo + * + * Get SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want Spinal Point (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpinalPointResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSpinalPointPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['getSpinalPointPaySpine'][0] + ): array + { + $request = $this->getSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSpinalPointPaySpineAsync + * + * Get SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want Spinal Point (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpinalPointPaySpineAsync( + string $employerId, + string $paySpineId, + string $spinalPointId, + string $contentType = self::contentTypes['getSpinalPointPaySpine'][0] + ): PromiseInterface + { + return $this->getSpinalPointPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSpinalPointPaySpineAsyncWithHttpInfo + * + * Get SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want Spinal Point (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpinalPointPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $spinalPointId, + string $contentType = self::contentTypes['getSpinalPointPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + $request = $this->getSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSpinalPointPaySpine' + * + * @param string $employerId The Id of the Employer for which you want Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want Spinal Point (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSpinalPointPaySpineRequest( + $employerId, + $paySpineId, + $spinalPointId, + string $contentType = self::contentTypes['getSpinalPointPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getSpinalPointPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getSpinalPointPaySpine' + ); + } + + // verify the required parameter 'spinalPointId' is set + if ($spinalPointId === null || (is_array($spinalPointId) && count($spinalPointId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $spinalPointId when calling getSpinalPointPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($spinalPointId !== null) { + $resourcePath = str_replace( + '{' . 'spinalPointId' . '}', + ObjectSerializer::toPathValue($spinalPointId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSpineAllowanceListPaySpine + * + * List SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want list of Spine Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Spine Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] + */ + public function getSpineAllowanceListPaySpine( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpineAllowanceListPaySpine'][0] + ): array + { + list($response) = $this->getSpineAllowanceListPaySpineWithHttpInfo($employerId, $paySpineId, $contentType); + return $response; + } + + /** + * Operation getSpineAllowanceListPaySpineWithHttpInfo + * + * List SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want list of Spine Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Spine Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function getSpineAllowanceListPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpineAllowanceListPaySpine'][0] + ): array + { + $request = $this->getSpineAllowanceListPaySpineRequest($employerId, $paySpineId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSpineAllowanceListPaySpineAsync + * + * List SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want list of Spine Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Spine Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpineAllowanceListPaySpineAsync( + string $employerId, + string $paySpineId, + string $contentType = self::contentTypes['getSpineAllowanceListPaySpine'][0] + ): PromiseInterface + { + return $this->getSpineAllowanceListPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSpineAllowanceListPaySpineAsyncWithHttpInfo + * + * List SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want list of Spine Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Spine Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpineAllowanceListPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getSpineAllowanceListPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + $request = $this->getSpineAllowanceListPaySpineRequest($employerId, $paySpineId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSpineAllowanceListPaySpine' + * + * @param string $employerId The Id of the Employer for which you want list of Spine Allowances (required) + * @param string $paySpineId The Id of the Pay Spine for which you want list of Spine Allowances (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowanceListPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSpineAllowanceListPaySpineRequest( + $employerId, + $paySpineId, + string $contentType = self::contentTypes['getSpineAllowanceListPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getSpineAllowanceListPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getSpineAllowanceListPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSpineAllowancePaySpine + * + * Get SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to get Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to get Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + */ + public function getSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['getSpineAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + { + list($response) = $this->getSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceid, $contentType); + return $response; + } + + /** + * Operation getSpineAllowancePaySpineWithHttpInfo + * + * Get SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to get Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to get Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['getSpineAllowancePaySpine'][0] + ): array + { + $request = $this->getSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSpineAllowancePaySpineAsync + * + * Get SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to get Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to get Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceid, + string $contentType = self::contentTypes['getSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->getSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceid, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSpineAllowancePaySpineAsyncWithHttpInfo + * + * Get SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to get Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to get Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceid, + string $contentType = self::contentTypes['getSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + $request = $this->getSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to get Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to get Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to get Spine Allowance (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $allowanceid, + string $contentType = self::contentTypes['getSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling getSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'allowanceid' is set + if ($allowanceid === null || (is_array($allowanceid) && count($allowanceid) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceid when calling getSpineAllowancePaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceid !== null) { + $resourcePath = str_replace( + '{' . 'allowanceid' . '}', + ObjectSerializer::toPathValue($allowanceid), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCsvPaySpine + * + * Import SpinalPoints from csv file + * + * @param string $employerId employerId (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importCsvPaySpine( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpine'][0] + ): array + { + list($response) = $this->importCsvPaySpineWithHttpInfo($employerId, $file, $contentType); + return $response; + } + + /** + * Operation importCsvPaySpineWithHttpInfo + * + * Import SpinalPoints from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importCsvPaySpineWithHttpInfo( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpine'][0] + ): array + { + $request = $this->importCsvPaySpineRequest($employerId, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCsvPaySpineAsync + * + * Import SpinalPoints from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvPaySpineAsync( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpine'][0] + ): PromiseInterface + { + return $this->importCsvPaySpineAsyncWithHttpInfo($employerId, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCsvPaySpineAsyncWithHttpInfo + * + * Import SpinalPoints from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvPaySpineAsyncWithHttpInfo( + $employerId, + $file = null, + string $contentType = self::contentTypes['importCsvPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importCsvPaySpineRequest($employerId, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCsvPaySpine' + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importCsvPaySpineRequest( + $employerId, + $file = null, + string $contentType = self::contentTypes['importCsvPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importCsvPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/spinalpoints/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCsvPaySpinePaySpine + * + * Import PaySpine from csv file + * + * @param string $employerId employerId (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpinePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importCsvPaySpinePaySpine( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpinePaySpine'][0] + ): array + { + list($response) = $this->importCsvPaySpinePaySpineWithHttpInfo($employerId, $file, $contentType); + return $response; + } + + /** + * Operation importCsvPaySpinePaySpineWithHttpInfo + * + * Import PaySpine from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpinePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importCsvPaySpinePaySpineWithHttpInfo( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpinePaySpine'][0] + ): array + { + $request = $this->importCsvPaySpinePaySpineRequest($employerId, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCsvPaySpinePaySpineAsync + * + * Import PaySpine from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpinePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvPaySpinePaySpineAsync( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importCsvPaySpinePaySpine'][0] + ): PromiseInterface + { + return $this->importCsvPaySpinePaySpineAsyncWithHttpInfo($employerId, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCsvPaySpinePaySpineAsyncWithHttpInfo + * + * Import PaySpine from csv file + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpinePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importCsvPaySpinePaySpineAsyncWithHttpInfo( + $employerId, + $file = null, + string $contentType = self::contentTypes['importCsvPaySpinePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importCsvPaySpinePaySpineRequest($employerId, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCsvPaySpinePaySpine' + * + * @param string $employerId (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importCsvPaySpinePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importCsvPaySpinePaySpineRequest( + $employerId, + $file = null, + string $contentType = self::contentTypes['importCsvPaySpinePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importCsvPaySpinePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importPayspineGradeCsvPaySpine + * + * Import SpineGrades from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayspineGradeCsvPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function importPayspineGradeCsvPaySpine( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPayspineGradeCsvPaySpine'][0] + ): array + { + list($response) = $this->importPayspineGradeCsvPaySpineWithHttpInfo($employerId, $file, $contentType); + return $response; + } + + /** + * Operation importPayspineGradeCsvPaySpineWithHttpInfo + * + * Import SpineGrades from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayspineGradeCsvPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function importPayspineGradeCsvPaySpineWithHttpInfo( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPayspineGradeCsvPaySpine'][0] + ): array + { + $request = $this->importPayspineGradeCsvPaySpineRequest($employerId, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importPayspineGradeCsvPaySpineAsync + * + * Import SpineGrades from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayspineGradeCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayspineGradeCsvPaySpineAsync( + string $employerId, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['importPayspineGradeCsvPaySpine'][0] + ): PromiseInterface + { + return $this->importPayspineGradeCsvPaySpineAsyncWithHttpInfo($employerId, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importPayspineGradeCsvPaySpineAsyncWithHttpInfo + * + * Import SpineGrades from csv file + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayspineGradeCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function importPayspineGradeCsvPaySpineAsyncWithHttpInfo( + $employerId, + $file = null, + string $contentType = self::contentTypes['importPayspineGradeCsvPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->importPayspineGradeCsvPaySpineRequest($employerId, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importPayspineGradeCsvPaySpine' + * + * @param string $employerId The Id of the Employer (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importPayspineGradeCsvPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importPayspineGradeCsvPaySpineRequest( + $employerId, + $file = null, + string $contentType = self::contentTypes['importPayspineGradeCsvPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling importPayspineGradeCsvPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/paygrades/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPaySpine + * + * List PaySpine + * + * @param string $employerId The Id of the Employer for which you want to list PaySpine (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexPaySpine( + string $employerId, + string $contentType = self::contentTypes['indexPaySpine'][0] + ): array + { + list($response) = $this->indexPaySpineWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexPaySpineWithHttpInfo + * + * List PaySpine + * + * @param string $employerId The Id of the Employer for which you want to list PaySpine (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPaySpineWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexPaySpine'][0] + ): array + { + $request = $this->indexPaySpineRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPaySpineAsync + * + * List PaySpine + * + * @param string $employerId The Id of the Employer for which you want to list PaySpine (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPaySpineAsync( + string $employerId, + string $contentType = self::contentTypes['indexPaySpine'][0] + ): PromiseInterface + { + return $this->indexPaySpineAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPaySpineAsyncWithHttpInfo + * + * List PaySpine + * + * @param string $employerId The Id of the Employer for which you want to list PaySpine (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPaySpineAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexPaySpineRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to list PaySpine (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPaySpineRequest( + $employerId, + string $contentType = self::contentTypes['indexPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPaySpine' + ); + } + + + $resourcePath = '/employers/{employerId}/payspines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAllowanceGradePaySpine + * + * Update AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to update Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to update Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + */ + public function updateAllowanceGradePaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['updateAllowanceGradePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse + { + list($response) = $this->updateAllowanceGradePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest, $contentType); + return $response; + } + + /** + * Operation updateAllowanceGradePaySpineWithHttpInfo + * + * Update AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to update Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to update Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAllowanceGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['updateAllowanceGradePaySpine'][0] + ): array + { + $request = $this->updateAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAllowanceGradePaySpineAsync + * + * Update AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to update Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to update Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAllowanceGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + string $allowanceGradeId, + ?\SynergiTech\Staffology\Model\ContractAllowanceGradesRequest $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['updateAllowanceGradePaySpine'][0] + ): PromiseInterface + { + return $this->updateAllowanceGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAllowanceGradePaySpineAsyncWithHttpInfo + * + * Update AllowanceGrade + * + * @param string $employerId The Id of the Employer for which you want to update Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to update Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateAllowanceGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['updateAllowanceGradePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse'; + $request = $this->updateAllowanceGradePaySpineRequest($employerId, $paySpineId, $allowanceId, $allowanceGradeId, $contractAllowanceGradesRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAllowanceGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update Allowance Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Allowance Grade (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update Allowance Grade (required) + * @param string $allowanceGradeId The Id of the Allowance Grade for which you want to update Allowance Grade (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesRequest|null $contractAllowanceGradesRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAllowanceGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAllowanceGradePaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $allowanceGradeId, + $contractAllowanceGradesRequest = null, + string $contentType = self::contentTypes['updateAllowanceGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling updateAllowanceGradePaySpine' + ); + } + + // verify the required parameter 'allowanceGradeId' is set + if ($allowanceGradeId === null || (is_array($allowanceGradeId) && count($allowanceGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceGradeId when calling updateAllowanceGradePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/{allowanceGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + // path params + if ($allowanceGradeId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceGradeId' . '}', + ObjectSerializer::toPathValue($allowanceGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAllowanceGradesRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAllowanceGradesRequest)); + } else { + $httpBody = $contractAllowanceGradesRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLondonAllowancePaySpine + * + * Update LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to update London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to update London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + */ + public function updateLondonAllowancePaySpine( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['updateLondonAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse + { + list($response) = $this->updateLondonAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest, $contentType); + return $response; + } + + /** + * Operation updateLondonAllowancePaySpineWithHttpInfo + * + * Update LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to update London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to update London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractLondonAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLondonAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['updateLondonAllowancePaySpine'][0] + ): array + { + $request = $this->updateLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLondonAllowancePaySpineAsync + * + * Update LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to update London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to update London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLondonAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $londonAllowanceId, + ?\SynergiTech\Staffology\Model\ContractLondonAllowanceRequest $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['updateLondonAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->updateLondonAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLondonAllowancePaySpineAsyncWithHttpInfo + * + * Update LondonAllowance + * + * @param string $employerId The Id of the Employer for which you want to update London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to update London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLondonAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $londonAllowanceId, + $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['updateLondonAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractLondonAllowanceResponse'; + $request = $this->updateLondonAllowancePaySpineRequest($employerId, $paySpineId, $londonAllowanceId, $contractLondonAllowanceRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLondonAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update London Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update London Allowance (required) + * @param string $londonAllowanceId The Id of the London Allowance for which you want to update London Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractLondonAllowanceRequest|null $contractLondonAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLondonAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLondonAllowancePaySpineRequest( + $employerId, + $paySpineId, + $londonAllowanceId, + $contractLondonAllowanceRequest = null, + string $contentType = self::contentTypes['updateLondonAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateLondonAllowancePaySpine' + ); + } + + // verify the required parameter 'londonAllowanceId' is set + if ($londonAllowanceId === null || (is_array($londonAllowanceId) && count($londonAllowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $londonAllowanceId when calling updateLondonAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/londonallowances/{londonAllowanceId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($londonAllowanceId !== null) { + $resourcePath = str_replace( + '{' . 'londonAllowanceId' . '}', + ObjectSerializer::toPathValue($londonAllowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractLondonAllowanceRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractLondonAllowanceRequest)); + } else { + $httpBody = $contractLondonAllowanceRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMultipleAllowanceGradesPaySpine + * + * Update Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to update multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]|null $contractAllowanceGradesUpdateRequest contractAllowanceGradesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[] + */ + public function updateMultipleAllowanceGradesPaySpine( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleAllowanceGradesPaySpine'][0] + ): array + { + list($response) = $this->updateMultipleAllowanceGradesPaySpineWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updateMultipleAllowanceGradesPaySpineWithHttpInfo + * + * Update Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to update multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]|null $contractAllowanceGradesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateMultipleAllowanceGradesPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleAllowanceGradesPaySpine'][0] + ): array + { + $request = $this->updateMultipleAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMultipleAllowanceGradesPaySpineAsync + * + * Update Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to update multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]|null $contractAllowanceGradesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultipleAllowanceGradesPaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceId, + ?array $contractAllowanceGradesUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + return $this->updateMultipleAllowanceGradesPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMultipleAllowanceGradesPaySpineAsyncWithHttpInfo + * + * Update Multiple AllowanceGrades + * + * @param string $employerId The Id of the Employer for which you want to update multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]|null $contractAllowanceGradesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultipleAllowanceGradesPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleAllowanceGradesPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractAllowanceGradesResponse[]'; + $request = $this->updateMultipleAllowanceGradesPaySpineRequest($employerId, $paySpineId, $allowanceId, $contractAllowanceGradesUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMultipleAllowanceGradesPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update multiple Allowance Grades (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Allowance Grades (required) + * @param string $allowanceId The Id of the Spine Allowance for which you want to update multiple Allowance Grades (required) + * @param \SynergiTech\Staffology\Model\ContractAllowanceGradesUpdateRequest[]|null $contractAllowanceGradesUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleAllowanceGradesPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateMultipleAllowanceGradesPaySpineRequest( + $employerId, + $paySpineId, + $allowanceId, + $contractAllowanceGradesUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleAllowanceGradesPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateMultipleAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateMultipleAllowanceGradesPaySpine' + ); + } + + // verify the required parameter 'allowanceId' is set + if ($allowanceId === null || (is_array($allowanceId) && count($allowanceId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceId when calling updateMultipleAllowanceGradesPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceId}/allowancegrades/update/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceId !== null) { + $resourcePath = str_replace( + '{' . 'allowanceId' . '}', + ObjectSerializer::toPathValue($allowanceId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractAllowanceGradesUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractAllowanceGradesUpdateRequest)); + } else { + $httpBody = $contractAllowanceGradesUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMultiplePaySpine + * + * Update Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to update multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]|null $contractSpinalPointUpdateRequest contractSpinalPointUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultiplePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpinalPointResponse[] + */ + public function updateMultiplePaySpine( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointUpdateRequest = null, + string $contentType = self::contentTypes['updateMultiplePaySpine'][0] + ): array + { + list($response) = $this->updateMultiplePaySpineWithHttpInfo($employerId, $paySpineId, $contractSpinalPointUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updateMultiplePaySpineWithHttpInfo + * + * Update Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to update multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]|null $contractSpinalPointUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultiplePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpinalPointResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateMultiplePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointUpdateRequest = null, + string $contentType = self::contentTypes['updateMultiplePaySpine'][0] + ): array + { + $request = $this->updateMultiplePaySpineRequest($employerId, $paySpineId, $contractSpinalPointUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMultiplePaySpineAsync + * + * Update Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to update multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]|null $contractSpinalPointUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultiplePaySpineAsync( + string $employerId, + string $paySpineId, + ?array $contractSpinalPointUpdateRequest = null, + string $contentType = self::contentTypes['updateMultiplePaySpine'][0] + ): PromiseInterface + { + return $this->updateMultiplePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpinalPointUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMultiplePaySpineAsyncWithHttpInfo + * + * Update Multiple SpinalPoints + * + * @param string $employerId The Id of the Employer for which you want to update multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]|null $contractSpinalPointUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultiplePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpinalPointUpdateRequest = null, + string $contentType = self::contentTypes['updateMultiplePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse[]'; + $request = $this->updateMultiplePaySpineRequest($employerId, $paySpineId, $contractSpinalPointUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMultiplePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update multiple Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointUpdateRequest[]|null $contractSpinalPointUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultiplePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateMultiplePaySpineRequest( + $employerId, + $paySpineId, + $contractSpinalPointUpdateRequest = null, + string $contentType = self::contentTypes['updateMultiplePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateMultiplePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateMultiplePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpinalPointUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpinalPointUpdateRequest)); + } else { + $httpBody = $contractSpinalPointUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMultipleSpineAllowancePaySpine + * + * Update Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to update multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]|null $contractSpineAllowanceUpdateRequest contractSpineAllowanceUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[] + */ + public function updateMultipleSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleSpineAllowancePaySpine'][0] + ): array + { + list($response) = $this->updateMultipleSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updateMultipleSpineAllowancePaySpineWithHttpInfo + * + * Update Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to update multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]|null $contractSpineAllowanceUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateMultipleSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleSpineAllowancePaySpine'][0] + ): array + { + $request = $this->updateMultipleSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMultipleSpineAllowancePaySpineAsync + * + * Update Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to update multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]|null $contractSpineAllowanceUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultipleSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + ?array $contractSpineAllowanceUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->updateMultipleSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMultipleSpineAllowancePaySpineAsyncWithHttpInfo + * + * Update Multiple SpineAllowances + * + * @param string $employerId The Id of the Employer for which you want to update multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]|null $contractSpineAllowanceUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMultipleSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $contractSpineAllowanceUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse[]'; + $request = $this->updateMultipleSpineAllowancePaySpineRequest($employerId, $paySpineId, $contractSpineAllowanceUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMultipleSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update multiple SpineAllowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update multiple SpineAllowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceUpdateRequest[]|null $contractSpineAllowanceUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMultipleSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateMultipleSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $contractSpineAllowanceUpdateRequest = null, + string $contentType = self::contentTypes['updateMultipleSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateMultipleSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateMultipleSpineAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/update/bulk'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpineAllowanceUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpineAllowanceUpdateRequest)); + } else { + $httpBody = $contractSpineAllowanceUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayGradePaySpine + * + * Update PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to update PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want to update PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + */ + public function updatePayGradePaySpine( + string $employerId, + string $paySpineId, + string $payGradeId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['updatePayGradePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse + { + list($response) = $this->updatePayGradePaySpineWithHttpInfo($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest, $contentType); + return $response; + } + + /** + * Operation updatePayGradePaySpineWithHttpInfo + * + * Update PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to update PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want to update PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayGradePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPaySpineGradeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayGradePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $payGradeId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['updatePayGradePaySpine'][0] + ): array + { + $request = $this->updatePayGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayGradePaySpineAsync + * + * Update PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to update PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want to update PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayGradePaySpineAsync( + string $employerId, + string $paySpineId, + string $payGradeId, + ?\SynergiTech\Staffology\Model\ContractPaySpineGradeRequest $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['updatePayGradePaySpine'][0] + ): PromiseInterface + { + return $this->updatePayGradePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayGradePaySpineAsyncWithHttpInfo + * + * Update PaySpine Grade + * + * @param string $employerId The Id of the Employer for which you want to update PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want to update PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayGradePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $payGradeId, + $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['updatePayGradePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineGradeResponse'; + $request = $this->updatePayGradePaySpineRequest($employerId, $paySpineId, $payGradeId, $contractPaySpineGradeRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayGradePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update PaySpine Grade (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update PaySpine Grade (required) + * @param string $payGradeId The Id of the PaySpine Grade for which you want to update PaySpine Grade (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineGradeRequest|null $contractPaySpineGradeRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayGradePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayGradePaySpineRequest( + $employerId, + $paySpineId, + $payGradeId, + $contractPaySpineGradeRequest = null, + string $contentType = self::contentTypes['updatePayGradePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayGradePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updatePayGradePaySpine' + ); + } + + // verify the required parameter 'payGradeId' is set + if ($payGradeId === null || (is_array($payGradeId) && count($payGradeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payGradeId when calling updatePayGradePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/paygrades/{payGradeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($payGradeId !== null) { + $resourcePath = str_replace( + '{' . 'payGradeId' . '}', + ObjectSerializer::toPathValue($payGradeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPaySpineGradeRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPaySpineGradeRequest)); + } else { + $httpBody = $contractPaySpineGradeRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePaySpine + * + * Update PaySpine + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest|null $contractPaySpineUpdateRequest contractPaySpineUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPaySpineResponse + */ + public function updatePaySpine( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest $contractPaySpineUpdateRequest = null, + string $contentType = self::contentTypes['updatePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractPaySpineResponse + { + list($response) = $this->updatePaySpineWithHttpInfo($employerId, $id, $contractPaySpineUpdateRequest, $contentType); + return $response; + } + + /** + * Operation updatePaySpineWithHttpInfo + * + * Update PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest|null $contractPaySpineUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPaySpineResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePaySpineWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest $contractPaySpineUpdateRequest = null, + string $contentType = self::contentTypes['updatePaySpine'][0] + ): array + { + $request = $this->updatePaySpineRequest($employerId, $id, $contractPaySpineUpdateRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPaySpineResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPaySpineResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPaySpineResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPaySpineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePaySpineAsync + * + * Update PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest|null $contractPaySpineUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaySpineAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest $contractPaySpineUpdateRequest = null, + string $contentType = self::contentTypes['updatePaySpine'][0] + ): PromiseInterface + { + return $this->updatePaySpineAsyncWithHttpInfo($employerId, $id, $contractPaySpineUpdateRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePaySpineAsyncWithHttpInfo + * + * Update PaySpine + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest|null $contractPaySpineUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePaySpineAsyncWithHttpInfo( + $employerId, + $id, + $contractPaySpineUpdateRequest = null, + string $contentType = self::contentTypes['updatePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPaySpineResponse'; + $request = $this->updatePaySpineRequest($employerId, $id, $contractPaySpineUpdateRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePaySpine' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractPaySpineUpdateRequest|null $contractPaySpineUpdateRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePaySpineRequest( + $employerId, + $id, + $contractPaySpineUpdateRequest = null, + string $contentType = self::contentTypes['updatePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePaySpine' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPaySpineUpdateRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPaySpineUpdateRequest)); + } else { + $httpBody = $contractPaySpineUpdateRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSpinalPointPaySpine + * + * Update SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpinalPointResponse + */ + public function updateSpinalPointPaySpine( + string $employerId, + string $paySpineId, + string $spinalPointId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['updateSpinalPointPaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpinalPointResponse + { + list($response) = $this->updateSpinalPointPaySpineWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest, $contentType); + return $response; + } + + /** + * Operation updateSpinalPointPaySpineWithHttpInfo + * + * Update SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpinalPointResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSpinalPointPaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $spinalPointId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['updateSpinalPointPaySpine'][0] + ): array + { + $request = $this->updateSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpinalPointResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpinalPointResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpinalPointResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSpinalPointPaySpineAsync + * + * Update SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSpinalPointPaySpineAsync( + string $employerId, + string $paySpineId, + string $spinalPointId, + ?\SynergiTech\Staffology\Model\ContractSpinalPointRequest $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['updateSpinalPointPaySpine'][0] + ): PromiseInterface + { + return $this->updateSpinalPointPaySpineAsyncWithHttpInfo($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSpinalPointPaySpineAsyncWithHttpInfo + * + * Update SpinalPoint + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSpinalPointPaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $spinalPointId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['updateSpinalPointPaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpinalPointResponse'; + $request = $this->updateSpinalPointPaySpineRequest($employerId, $paySpineId, $spinalPointId, $contractSpinalPointRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSpinalPointPaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update Spinal Point (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spinal Point (required) + * @param string $spinalPointId The Id of the Spinal Point for which you want to update Spinal Point (required) + * @param \SynergiTech\Staffology\Model\ContractSpinalPointRequest|null $contractSpinalPointRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpinalPointPaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSpinalPointPaySpineRequest( + $employerId, + $paySpineId, + $spinalPointId, + $contractSpinalPointRequest = null, + string $contentType = self::contentTypes['updateSpinalPointPaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateSpinalPointPaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateSpinalPointPaySpine' + ); + } + + // verify the required parameter 'spinalPointId' is set + if ($spinalPointId === null || (is_array($spinalPointId) && count($spinalPointId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $spinalPointId when calling updateSpinalPointPaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/spinalpoints/{spinalPointId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($spinalPointId !== null) { + $resourcePath = str_replace( + '{' . 'spinalPointId' . '}', + ObjectSerializer::toPathValue($spinalPointId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpinalPointRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpinalPointRequest)); + } else { + $httpBody = $contractSpinalPointRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSpineAllowancePaySpine + * + * Update SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to update Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to update Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + */ + public function updateSpineAllowancePaySpine( + string $employerId, + string $paySpineId, + string $allowanceid, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['updateSpineAllowancePaySpine'][0] + ): \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse + { + list($response) = $this->updateSpineAllowancePaySpineWithHttpInfo($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest, $contentType); + return $response; + } + + /** + * Operation updateSpineAllowancePaySpineWithHttpInfo + * + * Update SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to update Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to update Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractSpineAllowanceResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSpineAllowancePaySpineWithHttpInfo( + string $employerId, + string $paySpineId, + string $allowanceid, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['updateSpineAllowancePaySpine'][0] + ): array + { + $request = $this->updateSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSpineAllowancePaySpineAsync + * + * Update SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to update Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to update Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSpineAllowancePaySpineAsync( + string $employerId, + string $paySpineId, + string $allowanceid, + ?\SynergiTech\Staffology\Model\ContractSpineAllowanceRequest $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['updateSpineAllowancePaySpine'][0] + ): PromiseInterface + { + return $this->updateSpineAllowancePaySpineAsyncWithHttpInfo($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSpineAllowancePaySpineAsyncWithHttpInfo + * + * Update SpineAllowance + * + * @param string $employerId The Id of the Employer for which you want to update Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to update Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateSpineAllowancePaySpineAsyncWithHttpInfo( + $employerId, + $paySpineId, + $allowanceid, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['updateSpineAllowancePaySpine'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractSpineAllowanceResponse'; + $request = $this->updateSpineAllowancePaySpineRequest($employerId, $paySpineId, $allowanceid, $contractSpineAllowanceRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSpineAllowancePaySpine' + * + * @param string $employerId The Id of the Employer for which you want to update Spine Allowance (required) + * @param string $paySpineId The Id of the Pay Spine for which you want to update Spine Allowance (required) + * @param string $allowanceid The Id of the Spine Allowance for which you want to update Spine Allowance (required) + * @param \SynergiTech\Staffology\Model\ContractSpineAllowanceRequest|null $contractSpineAllowanceRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSpineAllowancePaySpine'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSpineAllowancePaySpineRequest( + $employerId, + $paySpineId, + $allowanceid, + $contractSpineAllowanceRequest = null, + string $contentType = self::contentTypes['updateSpineAllowancePaySpine'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'paySpineId' is set + if ($paySpineId === null || (is_array($paySpineId) && count($paySpineId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $paySpineId when calling updateSpineAllowancePaySpine' + ); + } + + // verify the required parameter 'allowanceid' is set + if ($allowanceid === null || (is_array($allowanceid) && count($allowanceid) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $allowanceid when calling updateSpineAllowancePaySpine' + ); + } + + + + $resourcePath = '/employers/{employerId}/payspines/{paySpineId}/allowances/{allowanceid}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($paySpineId !== null) { + $resourcePath = str_replace( + '{' . 'paySpineId' . '}', + ObjectSerializer::toPathValue($paySpineId), + $resourcePath + ); + } + // path params + if ($allowanceid !== null) { + $resourcePath = str_replace( + '{' . 'allowanceid' . '}', + ObjectSerializer::toPathValue($allowanceid), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractSpineAllowanceRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractSpineAllowanceRequest)); + } else { + $httpBody = $contractSpineAllowanceRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PayeeApi.php b/src/Api/PayeeApi.php new file mode 100644 index 0000000..205c62a --- /dev/null +++ b/src/Api/PayeeApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePayee' => [ + 'application/json', + ], + 'getPayee' => [ + 'application/json', + ], + 'indexPayee' => [ + 'application/json', + ], + 'updatePayee' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPayee + * + * Create Payee + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Payee + */ + public function createPayee( + string $employerId, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['createPayee'][0] + ): \SynergiTech\Staffology\Model\Payee + { + list($response) = $this->createPayeeWithHttpInfo($employerId, $payee, $contentType); + return $response; + } + + /** + * Operation createPayeeWithHttpInfo + * + * Create Payee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Payee, HTTP status code, HTTP response headers (array of strings) + */ + public function createPayeeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['createPayee'][0] + ): array + { + $request = $this->createPayeeRequest($employerId, $payee, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Payee', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Payee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Payee', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Payee'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Payee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPayeeAsync + * + * Create Payee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayeeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['createPayee'][0] + ): PromiseInterface + { + return $this->createPayeeAsyncWithHttpInfo($employerId, $payee, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPayeeAsyncWithHttpInfo + * + * Create Payee + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayeeAsyncWithHttpInfo( + $employerId, + $payee = null, + string $contentType = self::contentTypes['createPayee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Payee'; + $request = $this->createPayeeRequest($employerId, $payee, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPayee' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPayeeRequest( + $employerId, + $payee = null, + string $contentType = self::contentTypes['createPayee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPayee' + ); + } + + + + $resourcePath = '/employers/{employerId}/payees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payee)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payee)); + } else { + $httpBody = $payee; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayee + * + * Delete Payee + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayee( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayee'][0] + ): void + { + $this->deletePayeeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePayeeWithHttpInfo + * + * Delete Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayee'][0] + ): array + { + $request = $this->deletePayeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayeeAsync + * + * Delete Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePayee'][0] + ): PromiseInterface + { + return $this->deletePayeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayeeAsyncWithHttpInfo + * + * Delete Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePayee'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayee' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePayee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePayee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePayee' + ); + } + + + $resourcePath = '/employers/{employerId}/payees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayee + * + * Get Payee + * + * @param string $employerId The Id of the Employer to which the Payee belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Payee + */ + public function getPayee( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayee'][0] + ): \SynergiTech\Staffology\Model\Payee + { + list($response) = $this->getPayeeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getPayeeWithHttpInfo + * + * Get Payee + * + * @param string $employerId The Id of the Employer to which the Payee belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Payee, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayeeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayee'][0] + ): array + { + $request = $this->getPayeeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Payee', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Payee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Payee', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Payee'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Payee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayeeAsync + * + * Get Payee + * + * @param string $employerId The Id of the Employer to which the Payee belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayeeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPayee'][0] + ): PromiseInterface + { + return $this->getPayeeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayeeAsyncWithHttpInfo + * + * Get Payee + * + * @param string $employerId The Id of the Employer to which the Payee belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayeeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getPayee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Payee'; + $request = $this->getPayeeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayee' + * + * @param string $employerId The Id of the Employer to which the Payee belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayeeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getPayee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPayee' + ); + } + + + $resourcePath = '/employers/{employerId}/payees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPayee + * + * List Payees + * + * @param string $employerId The Id of the Employer for which you want to list Payees (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexPayee( + string $employerId, + string $contentType = self::contentTypes['indexPayee'][0] + ): array + { + list($response) = $this->indexPayeeWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexPayeeWithHttpInfo + * + * List Payees + * + * @param string $employerId The Id of the Employer for which you want to list Payees (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPayeeWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexPayee'][0] + ): array + { + $request = $this->indexPayeeRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPayeeAsync + * + * List Payees + * + * @param string $employerId The Id of the Employer for which you want to list Payees (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayeeAsync( + string $employerId, + string $contentType = self::contentTypes['indexPayee'][0] + ): PromiseInterface + { + return $this->indexPayeeAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPayeeAsyncWithHttpInfo + * + * List Payees + * + * @param string $employerId The Id of the Employer for which you want to list Payees (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPayeeAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexPayee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexPayeeRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPayee' + * + * @param string $employerId The Id of the Employer for which you want to list Payees (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPayeeRequest( + $employerId, + string $contentType = self::contentTypes['indexPayee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPayee' + ); + } + + + $resourcePath = '/employers/{employerId}/payees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayee + * + * Update Payee + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Payee + */ + public function updatePayee( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['updatePayee'][0] + ): \SynergiTech\Staffology\Model\Payee + { + list($response) = $this->updatePayeeWithHttpInfo($employerId, $id, $payee, $contentType); + return $response; + } + + /** + * Operation updatePayeeWithHttpInfo + * + * Update Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayee'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Payee, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePayeeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['updatePayee'][0] + ): array + { + $request = $this->updatePayeeRequest($employerId, $id, $payee, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Payee', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Payee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Payee', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Payee'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Payee', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePayeeAsync + * + * Update Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayeeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Payee $payee = null, + string $contentType = self::contentTypes['updatePayee'][0] + ): PromiseInterface + { + return $this->updatePayeeAsyncWithHttpInfo($employerId, $id, $payee, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePayeeAsyncWithHttpInfo + * + * Update Payee + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePayeeAsyncWithHttpInfo( + $employerId, + $id, + $payee = null, + string $contentType = self::contentTypes['updatePayee'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Payee'; + $request = $this->updatePayeeRequest($employerId, $id, $payee, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayee' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Payee|null $payee (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayee'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePayeeRequest( + $employerId, + $id, + $payee = null, + string $contentType = self::contentTypes['updatePayee'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePayee' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePayee' + ); + } + + + + $resourcePath = '/employers/{employerId}/payees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payee)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payee)); + } else { + $httpBody = $payee; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PensionApi.php b/src/Api/PensionApi.php new file mode 100644 index 0000000..f4f1129 --- /dev/null +++ b/src/Api/PensionApi.php @@ -0,0 +1,3342 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'getDeprecatedPension' => [ + 'application/json', + ], + 'getPension' => [ + 'application/json', + ], + 'lastPayRunEntryWithPensionYtdValuesForEmployeePension' => [ + 'application/json', + ], + 'listPension' => [ + 'application/json', + ], + 'removeDeprecatedPension' => [ + 'application/json', + ], + 'removePension' => [ + 'application/json', + ], + 'updateDeprecatedPension' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updatePension' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPension + * + * Create Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create a Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Pension + */ + public function createPension( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['createPension'][0] + ): \SynergiTech\Staffology\Model\Pension + { + list($response) = $this->createPensionWithHttpInfo($employerId, $employeeId, $pension, $contentType); + return $response; + } + + /** + * Operation createPensionWithHttpInfo + * + * Create Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create a Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Pension, HTTP status code, HTTP response headers (array of strings) + */ + public function createPensionWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['createPension'][0] + ): array + { + $request = $this->createPensionRequest($employerId, $employeeId, $pension, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Pension', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Pension' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Pension', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Pension'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Pension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPensionAsync + * + * Create Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create a Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['createPension'][0] + ): PromiseInterface + { + return $this->createPensionAsyncWithHttpInfo($employerId, $employeeId, $pension, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPensionAsyncWithHttpInfo + * + * Create Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create a Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $pension = null, + string $contentType = self::contentTypes['createPension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Pension'; + $request = $this->createPensionRequest($employerId, $employeeId, $pension, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to create a Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPensionRequest( + $employerId, + $employeeId, + $pension = null, + string $contentType = self::contentTypes['createPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createPension' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pension)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pension)); + } else { + $httpBody = $pension; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeprecatedPension + * + * Get Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Pension + */ + public function getDeprecatedPension( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getDeprecatedPension'][0] + ): \SynergiTech\Staffology\Model\Pension + { + list($response) = $this->getDeprecatedPensionWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation getDeprecatedPensionWithHttpInfo + * + * Get Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Pension, HTTP status code, HTTP response headers (array of strings) + */ + public function getDeprecatedPensionWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getDeprecatedPension'][0] + ): array + { + $request = $this->getDeprecatedPensionRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Pension', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Pension' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Pension', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Pension'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Pension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDeprecatedPensionAsync + * + * Get Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDeprecatedPensionAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['getDeprecatedPension'][0] + ): PromiseInterface + { + return $this->getDeprecatedPensionAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDeprecatedPensionAsyncWithHttpInfo + * + * Get Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDeprecatedPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getDeprecatedPension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Pension'; + $request = $this->getDeprecatedPensionRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDeprecatedPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDeprecatedPensionRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['getDeprecatedPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDeprecatedPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getDeprecatedPension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPension + * + * Get Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Pension + */ + public function getPension( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPension'][0] + ): \SynergiTech\Staffology\Model\Pension + { + list($response) = $this->getPensionWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getPensionWithHttpInfo + * + * Get Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Pension, HTTP status code, HTTP response headers (array of strings) + */ + public function getPensionWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPension'][0] + ): array + { + $request = $this->getPensionRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Pension', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Pension' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Pension', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Pension'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Pension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPensionAsync + * + * Get Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPension'][0] + ): PromiseInterface + { + return $this->getPensionAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPensionAsyncWithHttpInfo + * + * Get Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getPension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Pension'; + $request = $this->getPensionRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to retrieve the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPensionRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getPension' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePension + * + * Get last PayRunEntry for a Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for (required) + * @param string $pensionUniqueId pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunEntry + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePension( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'][0] + ): \SynergiTech\Staffology\Model\PayRunEntry + { + list($response) = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePensionWithHttpInfo($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + return $response; + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePensionWithHttpInfo + * + * Get last PayRunEntry for a Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunEntry, HTTP status code, HTTP response headers (array of strings) + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePensionWithHttpInfo( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'][0] + ): array + { + $request = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePensionRequest($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunEntry', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunEntry' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunEntry', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunEntry', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePensionAsync + * + * Get last PayRunEntry for a Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePensionAsync( + string $employerId, + string $employeeId, + string $pensionUniqueId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'][0] + ): PromiseInterface + { + return $this->lastPayRunEntryWithPensionYtdValuesForEmployeePensionAsyncWithHttpInfo($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation lastPayRunEntryWithPensionYtdValuesForEmployeePensionAsyncWithHttpInfo + * + * Get last PayRunEntry for a Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $pensionUniqueId, + $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunEntry'; + $request = $this->lastPayRunEntryWithPensionYtdValuesForEmployeePensionRequest($employerId, $employeeId, $pensionUniqueId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'lastPayRunEntryWithPensionYtdValuesForEmployeePension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee you want to get pay run entry for (required) + * @param string $pensionUniqueId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function lastPayRunEntryWithPensionYtdValuesForEmployeePensionRequest( + $employerId, + $employeeId, + $pensionUniqueId, + $taxYear, + string $contentType = self::contentTypes['lastPayRunEntryWithPensionYtdValuesForEmployeePension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePension' + ); + } + + // verify the required parameter 'pensionUniqueId' is set + if ($pensionUniqueId === null || (is_array($pensionUniqueId) && count($pensionUniqueId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pensionUniqueId when calling lastPayRunEntryWithPensionYtdValuesForEmployeePension' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling lastPayRunEntryWithPensionYtdValuesForEmployeePension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension/{pensionUniqueId}/{taxYear}/pensionytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($pensionUniqueId !== null) { + $resourcePath = str_replace( + '{' . 'pensionUniqueId' . '}', + ObjectSerializer::toPathValue($pensionUniqueId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listPension + * + * List Pensions + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to list Pensions (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listPension( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listPension'][0] + ): array + { + list($response) = $this->listPensionWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation listPensionWithHttpInfo + * + * List Pensions + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to list Pensions (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listPensionWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listPension'][0] + ): array + { + $request = $this->listPensionRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listPensionAsync + * + * List Pensions + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to list Pensions (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPensionAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['listPension'][0] + ): PromiseInterface + { + return $this->listPensionAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listPensionAsyncWithHttpInfo + * + * List Pensions + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to list Pensions (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['listPension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listPensionRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to list Pensions (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listPensionRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['listPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling listPension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension/list'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeDeprecatedPension + * + * Remove Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function removeDeprecatedPension( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['removeDeprecatedPension'][0] + ): void + { + $this->removeDeprecatedPensionWithHttpInfo($employerId, $employeeId, $contentType); + } + + /** + * Operation removeDeprecatedPensionWithHttpInfo + * + * Remove Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeDeprecatedPensionWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['removeDeprecatedPension'][0] + ): array + { + $request = $this->removeDeprecatedPensionRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation removeDeprecatedPensionAsync + * + * Remove Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeDeprecatedPensionAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['removeDeprecatedPension'][0] + ): PromiseInterface + { + return $this->removeDeprecatedPensionAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeDeprecatedPensionAsyncWithHttpInfo + * + * Remove Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeDeprecatedPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['removeDeprecatedPension'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->removeDeprecatedPensionRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeDeprecatedPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeDeprecatedPensionRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['removeDeprecatedPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling removeDeprecatedPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling removeDeprecatedPension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removePension + * + * Remove Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function removePension( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['removePension'][0] + ): void + { + $this->removePensionWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation removePensionWithHttpInfo + * + * Remove Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removePensionWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['removePension'][0] + ): array + { + $request = $this->removePensionRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation removePensionAsync + * + * Remove Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removePensionAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['removePension'][0] + ): PromiseInterface + { + return $this->removePensionAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removePensionAsyncWithHttpInfo + * + * Remove Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removePensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['removePension'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->removePensionRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removePension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to remove the Pension (required) + * @param string $id The Id of the Pension (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removePensionRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['removePension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling removePension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling removePension' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling removePension' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDeprecatedPension + * + * Update Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Pension + */ + public function updateDeprecatedPension( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updateDeprecatedPension'][0] + ): \SynergiTech\Staffology\Model\Pension + { + list($response) = $this->updateDeprecatedPensionWithHttpInfo($employerId, $employeeId, $pension, $contentType); + return $response; + } + + /** + * Operation updateDeprecatedPensionWithHttpInfo + * + * Update Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDeprecatedPension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Pension, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDeprecatedPensionWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updateDeprecatedPension'][0] + ): array + { + $request = $this->updateDeprecatedPensionRequest($employerId, $employeeId, $pension, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Pension', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Pension' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Pension', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Pension'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Pension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDeprecatedPensionAsync + * + * Update Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDeprecatedPensionAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updateDeprecatedPension'][0] + ): PromiseInterface + { + return $this->updateDeprecatedPensionAsyncWithHttpInfo($employerId, $employeeId, $pension, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDeprecatedPensionAsyncWithHttpInfo + * + * Update Pension (deprecated) + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateDeprecatedPensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $pension = null, + string $contentType = self::contentTypes['updateDeprecatedPension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Pension'; + $request = $this->updateDeprecatedPensionRequest($employerId, $employeeId, $pension, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDeprecatedPension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDeprecatedPension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDeprecatedPensionRequest( + $employerId, + $employeeId, + $pension = null, + string $contentType = self::contentTypes['updateDeprecatedPension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateDeprecatedPension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updateDeprecatedPension' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pension)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pension)); + } else { + $httpBody = $pension; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePension + * + * Update Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param string $id The Id of the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Pension + */ + public function updatePension( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updatePension'][0] + ): \SynergiTech\Staffology\Model\Pension + { + list($response) = $this->updatePensionWithHttpInfo($employerId, $employeeId, $id, $pension, $contentType); + return $response; + } + + /** + * Operation updatePensionWithHttpInfo + * + * Update Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param string $id The Id of the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePension'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Pension, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePensionWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updatePension'][0] + ): array + { + $request = $this->updatePensionRequest($employerId, $employeeId, $id, $pension, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Pension', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Pension' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Pension', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Pension'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Pension', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePensionAsync + * + * Update Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param string $id The Id of the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\Pension $pension = null, + string $contentType = self::contentTypes['updatePension'][0] + ): PromiseInterface + { + return $this->updatePensionAsyncWithHttpInfo($employerId, $employeeId, $id, $pension, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePensionAsyncWithHttpInfo + * + * Update Pension + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param string $id The Id of the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $pension = null, + string $contentType = self::contentTypes['updatePension'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Pension'; + $request = $this->updatePensionRequest($employerId, $employeeId, $id, $pension, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePension' + * + * @param string $employerId The Id of the Employer to which the Employee belongs (required) + * @param string $employeeId The Id of the Employee for which you want to update the Pension (required) + * @param string $id The Id of the Pension (required) + * @param \SynergiTech\Staffology\Model\Pension|null $pension (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePension'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePensionRequest( + $employerId, + $employeeId, + $id, + $pension = null, + string $contentType = self::contentTypes['updatePension'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePension' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updatePension' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePension' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pension/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pension)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pension)); + } else { + $httpBody = $pension; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PensionRefundApi.php b/src/Api/PensionRefundApi.php new file mode 100644 index 0000000..4cf3822 --- /dev/null +++ b/src/Api/PensionRefundApi.php @@ -0,0 +1,2586 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePensionRefund' => [ + 'application/json', + ], + 'getPensionRefund' => [ + 'application/json', + ], + 'indexPensionRefund' => [ + 'application/json', + ], + 'issueRefundForCurrentPensionSchemePensionRefund' => [ + 'application/json', + ], + 'issueRefundForPensionPensionRefund' => [ + 'application/json', + ], + 'updatePensionRefund' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createPensionRefund + * + * Create Pension Refund + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createPensionRefund( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['createPensionRefund'][0] + ): void + { + $this->createPensionRefundWithHttpInfo($employerId, $employeeId, $pensionRefund, $contentType); + } + + /** + * Operation createPensionRefundWithHttpInfo + * + * Create Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createPensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['createPensionRefund'][0] + ): array + { + $request = $this->createPensionRefundRequest($employerId, $employeeId, $pensionRefund, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createPensionRefundAsync + * + * Create Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionRefundAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['createPensionRefund'][0] + ): PromiseInterface + { + return $this->createPensionRefundAsyncWithHttpInfo($employerId, $employeeId, $pensionRefund, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPensionRefundAsyncWithHttpInfo + * + * Create Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + $pensionRefund = null, + string $contentType = self::contentTypes['createPensionRefund'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createPensionRefundRequest($employerId, $employeeId, $pensionRefund, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPensionRefundRequest( + $employerId, + $employeeId, + $pensionRefund = null, + string $contentType = self::contentTypes['createPensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling createPensionRefund' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pensionRefund)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pensionRefund)); + } else { + $httpBody = $pensionRefund; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePensionRefund + * + * Delete Pension Refund + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Pension Refund you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePensionRefund( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deletePensionRefund'][0] + ): void + { + $this->deletePensionRefundWithHttpInfo($employerId, $employeeId, $id, $contentType); + } + + /** + * Operation deletePensionRefundWithHttpInfo + * + * Delete Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deletePensionRefund'][0] + ): array + { + $request = $this->deletePensionRefundRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePensionRefundAsync + * + * Delete Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePensionRefundAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['deletePensionRefund'][0] + ): PromiseInterface + { + return $this->deletePensionRefundAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePensionRefundAsyncWithHttpInfo + * + * Delete Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deletePensionRefund'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePensionRefundRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePensionRefundRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['deletePensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling deletePensionRefund' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePensionRefund' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPensionRefund + * + * Get Pension Refund + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Pension Refund you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionRefund + */ + public function getPensionRefund( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPensionRefund'][0] + ): \SynergiTech\Staffology\Model\PensionRefund + { + list($response) = $this->getPensionRefundWithHttpInfo($employerId, $employeeId, $id, $contentType); + return $response; + } + + /** + * Operation getPensionRefundWithHttpInfo + * + * Get Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionRefund, HTTP status code, HTTP response headers (array of strings) + */ + public function getPensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPensionRefund'][0] + ): array + { + $request = $this->getPensionRefundRequest($employerId, $employeeId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionRefund', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionRefund' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionRefund', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionRefund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPensionRefundAsync + * + * Get Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionRefundAsync( + string $employerId, + string $employeeId, + string $id, + string $contentType = self::contentTypes['getPensionRefund'][0] + ): PromiseInterface + { + return $this->getPensionRefundAsyncWithHttpInfo($employerId, $employeeId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPensionRefundAsyncWithHttpInfo + * + * Get Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getPensionRefund'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + $request = $this->getPensionRefundRequest($employerId, $employeeId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPensionRefundRequest( + $employerId, + $employeeId, + $id, + string $contentType = self::contentTypes['getPensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling getPensionRefund' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPensionRefund' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPensionRefund + * + * List Pension Refunds + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexPensionRefund( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexPensionRefund'][0] + ): array + { + list($response) = $this->indexPensionRefundWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation indexPensionRefundWithHttpInfo + * + * List Pension Refunds + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexPensionRefund'][0] + ): array + { + $request = $this->indexPensionRefundRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPensionRefundAsync + * + * List Pension Refunds + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPensionRefundAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['indexPensionRefund'][0] + ): PromiseInterface + { + return $this->indexPensionRefundAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPensionRefundAsyncWithHttpInfo + * + * List Pension Refunds + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexPensionRefund'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexPensionRefundRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPensionRefundRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['indexPensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling indexPensionRefund' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation issueRefundForCurrentPensionSchemePensionRefund + * + * Issue Pension Refund (deprecated) + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionRefund + */ + public function issueRefundForCurrentPensionSchemePensionRefund( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'][0] + ): \SynergiTech\Staffology\Model\PensionRefund + { + list($response) = $this->issueRefundForCurrentPensionSchemePensionRefundWithHttpInfo($employerId, $employeeId, $contentType); + return $response; + } + + /** + * Operation issueRefundForCurrentPensionSchemePensionRefundWithHttpInfo + * + * Issue Pension Refund (deprecated) + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionRefund, HTTP status code, HTTP response headers (array of strings) + */ + public function issueRefundForCurrentPensionSchemePensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'][0] + ): array + { + $request = $this->issueRefundForCurrentPensionSchemePensionRefundRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionRefund', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionRefund' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionRefund', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionRefund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation issueRefundForCurrentPensionSchemePensionRefundAsync + * + * Issue Pension Refund (deprecated) + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function issueRefundForCurrentPensionSchemePensionRefundAsync( + string $employerId, + string $employeeId, + string $contentType = self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'][0] + ): PromiseInterface + { + return $this->issueRefundForCurrentPensionSchemePensionRefundAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation issueRefundForCurrentPensionSchemePensionRefundAsyncWithHttpInfo + * + * Issue Pension Refund (deprecated) + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function issueRefundForCurrentPensionSchemePensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + string $contentType = self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + $request = $this->issueRefundForCurrentPensionSchemePensionRefundRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'issueRefundForCurrentPensionSchemePensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function issueRefundForCurrentPensionSchemePensionRefundRequest( + $employerId, + $employeeId, + string $contentType = self::contentTypes['issueRefundForCurrentPensionSchemePensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling issueRefundForCurrentPensionSchemePensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling issueRefundForCurrentPensionSchemePensionRefund' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund/autocalculated'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation issueRefundForPensionPensionRefund + * + * Issue Pension Refund + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $pensionId The Id of the pension for which you want to issue a refund. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForPensionPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionRefund + */ + public function issueRefundForPensionPensionRefund( + string $employerId, + string $employeeId, + string $pensionId, + string $contentType = self::contentTypes['issueRefundForPensionPensionRefund'][0] + ): \SynergiTech\Staffology\Model\PensionRefund + { + list($response) = $this->issueRefundForPensionPensionRefundWithHttpInfo($employerId, $employeeId, $pensionId, $contentType); + return $response; + } + + /** + * Operation issueRefundForPensionPensionRefundWithHttpInfo + * + * Issue Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $pensionId The Id of the pension for which you want to issue a refund. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForPensionPensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionRefund, HTTP status code, HTTP response headers (array of strings) + */ + public function issueRefundForPensionPensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $pensionId, + string $contentType = self::contentTypes['issueRefundForPensionPensionRefund'][0] + ): array + { + $request = $this->issueRefundForPensionPensionRefundRequest($employerId, $employeeId, $pensionId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionRefund', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionRefund' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionRefund', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionRefund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation issueRefundForPensionPensionRefundAsync + * + * Issue Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $pensionId The Id of the pension for which you want to issue a refund. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForPensionPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function issueRefundForPensionPensionRefundAsync( + string $employerId, + string $employeeId, + string $pensionId, + string $contentType = self::contentTypes['issueRefundForPensionPensionRefund'][0] + ): PromiseInterface + { + return $this->issueRefundForPensionPensionRefundAsyncWithHttpInfo($employerId, $employeeId, $pensionId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation issueRefundForPensionPensionRefundAsyncWithHttpInfo + * + * Issue Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $pensionId The Id of the pension for which you want to issue a refund. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForPensionPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function issueRefundForPensionPensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + $pensionId, + string $contentType = self::contentTypes['issueRefundForPensionPensionRefund'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + $request = $this->issueRefundForPensionPensionRefundRequest($employerId, $employeeId, $pensionId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'issueRefundForPensionPensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $pensionId The Id of the pension for which you want to issue a refund. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['issueRefundForPensionPensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function issueRefundForPensionPensionRefundRequest( + $employerId, + $employeeId, + $pensionId, + string $contentType = self::contentTypes['issueRefundForPensionPensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling issueRefundForPensionPensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling issueRefundForPensionPensionRefund' + ); + } + + // verify the required parameter 'pensionId' is set + if ($pensionId === null || (is_array($pensionId) && count($pensionId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pensionId when calling issueRefundForPensionPensionRefund' + ); + } + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund/{pensionId}/autocalculated'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($pensionId !== null) { + $resourcePath = str_replace( + '{' . 'pensionId' . '}', + ObjectSerializer::toPathValue($pensionId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePensionRefund + * + * Update Pension Refund + * + * @param string $employerId employerId (required) + * @param string $employeeId employeeId (required) + * @param string $id The Id of the Pension Refund you want to update. (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionRefund + */ + public function updatePensionRefund( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['updatePensionRefund'][0] + ): \SynergiTech\Staffology\Model\PensionRefund + { + list($response) = $this->updatePensionRefundWithHttpInfo($employerId, $employeeId, $id, $pensionRefund, $contentType); + return $response; + } + + /** + * Operation updatePensionRefundWithHttpInfo + * + * Update Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to update. (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionRefund'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionRefund, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePensionRefundWithHttpInfo( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['updatePensionRefund'][0] + ): array + { + $request = $this->updatePensionRefundRequest($employerId, $employeeId, $id, $pensionRefund, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionRefund', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionRefund' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionRefund', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionRefund', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePensionRefundAsync + * + * Update Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to update. (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionRefundAsync( + string $employerId, + string $employeeId, + string $id, + ?\SynergiTech\Staffology\Model\PensionRefund $pensionRefund = null, + string $contentType = self::contentTypes['updatePensionRefund'][0] + ): PromiseInterface + { + return $this->updatePensionRefundAsyncWithHttpInfo($employerId, $employeeId, $id, $pensionRefund, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePensionRefundAsyncWithHttpInfo + * + * Update Pension Refund + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to update. (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionRefundAsyncWithHttpInfo( + $employerId, + $employeeId, + $id, + $pensionRefund = null, + string $contentType = self::contentTypes['updatePensionRefund'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionRefund'; + $request = $this->updatePensionRefundRequest($employerId, $employeeId, $id, $pensionRefund, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePensionRefund' + * + * @param string $employerId (required) + * @param string $employeeId (required) + * @param string $id The Id of the Pension Refund you want to update. (required) + * @param \SynergiTech\Staffology\Model\PensionRefund|null $pensionRefund (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionRefund'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePensionRefundRequest( + $employerId, + $employeeId, + $id, + $pensionRefund = null, + string $contentType = self::contentTypes['updatePensionRefund'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePensionRefund' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling updatePensionRefund' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePensionRefund' + ); + } + + + + $resourcePath = '/employers/{employerId}/employees/{employeeId}/pensionrefund/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pensionRefund)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pensionRefund)); + } else { + $httpBody = $pensionRefund; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/PensionSchemeApi.php b/src/Api/PensionSchemeApi.php new file mode 100644 index 0000000..ae4a0a6 --- /dev/null +++ b/src/Api/PensionSchemeApi.php @@ -0,0 +1,4126 @@ + [ + 'application/json', + ], + 'contributionsPensionScheme' => [ + 'application/json', + ], + 'createPensionScheme' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePensionScheme' => [ + 'application/json', + ], + 'employeesPensionScheme' => [ + 'application/json', + ], + 'getPensionScheme' => [ + 'application/json', + ], + 'indexPensionScheme' => [ + 'application/json', + ], + 'listContributionsPensionScheme' => [ + 'application/json', + ], + 'markAsSentPensionScheme' => [ + 'application/json', + ], + 'resubmitContributionsPensionScheme' => [ + 'application/json', + ], + 'updatePensionScheme' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation contributionsForPayrunPensionScheme + * + * Contributions for Payrun + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsForPayrunPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\PensionContributionsSubmission + */ + public function contributionsForPayrunPensionScheme( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + string $contentType = self::contentTypes['contributionsForPayrunPensionScheme'][0] + ): \SynergiTech\Staffology\Model\PensionContributionsSubmission + { + list($response) = $this->contributionsForPayrunPensionSchemeWithHttpInfo($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal, $contentType); + return $response; + } + + /** + * Operation contributionsForPayrunPensionSchemeWithHttpInfo + * + * Contributions for Payrun + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsForPayrunPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\PensionContributionsSubmission, HTTP status code, HTTP response headers (array of strings) + */ + public function contributionsForPayrunPensionSchemeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + string $contentType = self::contentTypes['contributionsForPayrunPensionScheme'][0] + ): array + { + $request = $this->contributionsForPayrunPensionSchemeRequest($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionContributionsSubmission', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionContributionsSubmission' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionContributionsSubmission', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionContributionsSubmission'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionContributionsSubmission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation contributionsForPayrunPensionSchemeAsync + * + * Contributions for Payrun + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsForPayrunPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function contributionsForPayrunPensionSchemeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + string $contentType = self::contentTypes['contributionsForPayrunPensionScheme'][0] + ): PromiseInterface + { + return $this->contributionsForPayrunPensionSchemeAsyncWithHttpInfo($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation contributionsForPayrunPensionSchemeAsyncWithHttpInfo + * + * Contributions for Payrun + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsForPayrunPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function contributionsForPayrunPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + string $contentType = self::contentTypes['contributionsForPayrunPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionContributionsSubmission'; + $request = $this->contributionsForPayrunPensionSchemeRequest($employerId, $id, $taxYear, $payPeriod, $periodNumber, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'contributionsForPayrunPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsForPayrunPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function contributionsForPayrunPensionSchemeRequest( + $employerId, + $id, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + string $contentType = self::contentTypes['contributionsForPayrunPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling contributionsForPayrunPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling contributionsForPayrunPensionScheme' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling contributionsForPayrunPensionScheme' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling contributionsForPayrunPensionScheme' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling contributionsForPayrunPensionScheme' + ); + } + + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{payPeriod}/{periodNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation contributionsPensionScheme + * + * Contributions Data + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExternalProviderConversation + */ + public function contributionsPensionScheme( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['contributionsPensionScheme'][0] + ): \SynergiTech\Staffology\Model\ExternalProviderConversation + { + list($response) = $this->contributionsPensionSchemeWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType); + return $response; + } + + /** + * Operation contributionsPensionSchemeWithHttpInfo + * + * Contributions Data + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExternalProviderConversation, HTTP status code, HTTP response headers (array of strings) + */ + public function contributionsPensionSchemeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['contributionsPensionScheme'][0] + ): array + { + $request = $this->contributionsPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalProviderConversation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalProviderConversation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalProviderConversation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalProviderConversation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalProviderConversation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation contributionsPensionSchemeAsync + * + * Contributions Data + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function contributionsPensionSchemeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['contributionsPensionScheme'][0] + ): PromiseInterface + { + return $this->contributionsPensionSchemeAsyncWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation contributionsPensionSchemeAsyncWithHttpInfo + * + * Contributions Data + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function contributionsPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['contributionsPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalProviderConversation'; + $request = $this->contributionsPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'contributionsPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['contributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function contributionsPensionSchemeRequest( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['contributionsPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling contributionsPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling contributionsPensionScheme' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling contributionsPensionScheme' + ); + } + + // verify the required parameter 'submissionId' is set + if ($submissionId === null || (is_array($submissionId) && count($submissionId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $submissionId when calling contributionsPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($submissionId !== null) { + $resourcePath = str_replace( + '{' . 'submissionId' . '}', + ObjectSerializer::toPathValue($submissionId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createPensionScheme + * + * Create a PensionScheme + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\PensionScheme + */ + public function createPensionScheme( + string $employerId, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['createPensionScheme'][0] + ): \SynergiTech\Staffology\Model\PensionScheme + { + list($response) = $this->createPensionSchemeWithHttpInfo($employerId, $pensionScheme, $contentType); + return $response; + } + + /** + * Operation createPensionSchemeWithHttpInfo + * + * Create a PensionScheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\PensionScheme, HTTP status code, HTTP response headers (array of strings) + */ + public function createPensionSchemeWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['createPensionScheme'][0] + ): array + { + $request = $this->createPensionSchemeRequest($employerId, $pensionScheme, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\PensionScheme', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionScheme' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionScheme', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionScheme', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPensionSchemeAsync + * + * Create a PensionScheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionSchemeAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['createPensionScheme'][0] + ): PromiseInterface + { + return $this->createPensionSchemeAsyncWithHttpInfo($employerId, $pensionScheme, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPensionSchemeAsyncWithHttpInfo + * + * Create a PensionScheme + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPensionSchemeAsyncWithHttpInfo( + $employerId, + $pensionScheme = null, + string $contentType = self::contentTypes['createPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + $request = $this->createPensionSchemeRequest($employerId, $pensionScheme, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPensionScheme' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPensionSchemeRequest( + $employerId, + $pensionScheme = null, + string $contentType = self::contentTypes['createPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createPensionScheme' + ); + } + + + + $resourcePath = '/employers/{employerId}/pensionschemes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pensionScheme)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pensionScheme)); + } else { + $httpBody = $pensionScheme; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePensionScheme + * + * Delete a PensionScheme + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePensionScheme( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePensionScheme'][0] + ): void + { + $this->deletePensionSchemeWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deletePensionSchemeWithHttpInfo + * + * Delete a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePensionSchemeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePensionScheme'][0] + ): array + { + $request = $this->deletePensionSchemeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePensionSchemeAsync + * + * Delete a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePensionSchemeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deletePensionScheme'][0] + ): PromiseInterface + { + return $this->deletePensionSchemeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePensionSchemeAsyncWithHttpInfo + * + * Delete a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deletePensionScheme'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePensionSchemeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePensionScheme' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePensionSchemeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deletePensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deletePensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeesPensionScheme + * + * Get Employees + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve Employees for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employeesPensionScheme( + string $employerId, + string $id, + string $contentType = self::contentTypes['employeesPensionScheme'][0] + ): array + { + list($response) = $this->employeesPensionSchemeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation employeesPensionSchemeWithHttpInfo + * + * Get Employees + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve Employees for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employeesPensionSchemeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['employeesPensionScheme'][0] + ): array + { + $request = $this->employeesPensionSchemeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeesPensionSchemeAsync + * + * Get Employees + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve Employees for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeesPensionSchemeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['employeesPensionScheme'][0] + ): PromiseInterface + { + return $this->employeesPensionSchemeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeesPensionSchemeAsyncWithHttpInfo + * + * Get Employees + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve Employees for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeesPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['employeesPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employeesPensionSchemeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeesPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve Employees for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeesPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeesPensionSchemeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['employeesPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeesPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employeesPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPensionScheme + * + * Get a PensionScheme + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionScheme + */ + public function getPensionScheme( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPensionScheme'][0] + ): \SynergiTech\Staffology\Model\PensionScheme + { + list($response) = $this->getPensionSchemeWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getPensionSchemeWithHttpInfo + * + * Get a PensionScheme + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionScheme, HTTP status code, HTTP response headers (array of strings) + */ + public function getPensionSchemeWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPensionScheme'][0] + ): array + { + $request = $this->getPensionSchemeRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionScheme', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionScheme' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionScheme', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionScheme', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPensionSchemeAsync + * + * Get a PensionScheme + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionSchemeAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getPensionScheme'][0] + ): PromiseInterface + { + return $this->getPensionSchemeAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPensionSchemeAsyncWithHttpInfo + * + * Get a PensionScheme + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + $request = $this->getPensionSchemeRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPensionSchemeRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexPensionScheme + * + * List PensionSchemes + * + * @param string $employerId The Id of the Employer for which you want to list PensionSchemes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexPensionScheme( + string $employerId, + string $contentType = self::contentTypes['indexPensionScheme'][0] + ): array + { + list($response) = $this->indexPensionSchemeWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexPensionSchemeWithHttpInfo + * + * List PensionSchemes + * + * @param string $employerId The Id of the Employer for which you want to list PensionSchemes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexPensionSchemeWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexPensionScheme'][0] + ): array + { + $request = $this->indexPensionSchemeRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexPensionSchemeAsync + * + * List PensionSchemes + * + * @param string $employerId The Id of the Employer for which you want to list PensionSchemes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPensionSchemeAsync( + string $employerId, + string $contentType = self::contentTypes['indexPensionScheme'][0] + ): PromiseInterface + { + return $this->indexPensionSchemeAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexPensionSchemeAsyncWithHttpInfo + * + * List PensionSchemes + * + * @param string $employerId The Id of the Employer for which you want to list PensionSchemes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexPensionSchemeAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexPensionSchemeRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexPensionScheme' + * + * @param string $employerId The Id of the Employer for which you want to list PensionSchemes (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexPensionSchemeRequest( + $employerId, + string $contentType = self::contentTypes['indexPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listContributionsPensionScheme + * + * List Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listContributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listContributionsPensionScheme( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listContributionsPensionScheme'][0] + ): array + { + list($response) = $this->listContributionsPensionSchemeWithHttpInfo($employerId, $id, $taxYear, $contentType); + return $response; + } + + /** + * Operation listContributionsPensionSchemeWithHttpInfo + * + * List Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listContributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listContributionsPensionSchemeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listContributionsPensionScheme'][0] + ): array + { + $request = $this->listContributionsPensionSchemeRequest($employerId, $id, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listContributionsPensionSchemeAsync + * + * List Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listContributionsPensionSchemeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $contentType = self::contentTypes['listContributionsPensionScheme'][0] + ): PromiseInterface + { + return $this->listContributionsPensionSchemeAsyncWithHttpInfo($employerId, $id, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listContributionsPensionSchemeAsyncWithHttpInfo + * + * List Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listContributionsPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + string $contentType = self::contentTypes['listContributionsPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listContributionsPensionSchemeRequest($employerId, $id, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listContributionsPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear to query (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listContributionsPensionSchemeRequest( + $employerId, + $id, + $taxYear, + string $contentType = self::contentTypes['listContributionsPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listContributionsPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling listContributionsPensionScheme' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listContributionsPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation markAsSentPensionScheme + * + * Mark as Sent + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsSentPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExternalProviderConversation + */ + public function markAsSentPensionScheme( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['markAsSentPensionScheme'][0] + ): \SynergiTech\Staffology\Model\ExternalProviderConversation + { + list($response) = $this->markAsSentPensionSchemeWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType); + return $response; + } + + /** + * Operation markAsSentPensionSchemeWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsSentPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExternalProviderConversation, HTTP status code, HTTP response headers (array of strings) + */ + public function markAsSentPensionSchemeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['markAsSentPensionScheme'][0] + ): array + { + $request = $this->markAsSentPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExternalProviderConversation', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExternalProviderConversation' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExternalProviderConversation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExternalProviderConversation'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExternalProviderConversation', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation markAsSentPensionSchemeAsync + * + * Mark as Sent + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsSentPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsSentPensionSchemeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['markAsSentPensionScheme'][0] + ): PromiseInterface + { + return $this->markAsSentPensionSchemeAsyncWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation markAsSentPensionSchemeAsyncWithHttpInfo + * + * Mark as Sent + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsSentPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function markAsSentPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['markAsSentPensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExternalProviderConversation'; + $request = $this->markAsSentPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'markAsSentPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['markAsSentPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function markAsSentPensionSchemeRequest( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['markAsSentPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling markAsSentPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling markAsSentPensionScheme' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling markAsSentPensionScheme' + ); + } + + // verify the required parameter 'submissionId' is set + if ($submissionId === null || (is_array($submissionId) && count($submissionId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $submissionId when calling markAsSentPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}/markassent'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($submissionId !== null) { + $resourcePath = str_replace( + '{' . 'submissionId' . '}', + ObjectSerializer::toPathValue($submissionId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation resubmitContributionsPensionScheme + * + * Re-submit Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission to re-submit. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resubmitContributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function resubmitContributionsPensionScheme( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['resubmitContributionsPensionScheme'][0] + ): void + { + $this->resubmitContributionsPensionSchemeWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType); + } + + /** + * Operation resubmitContributionsPensionSchemeWithHttpInfo + * + * Re-submit Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission to re-submit. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resubmitContributionsPensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function resubmitContributionsPensionSchemeWithHttpInfo( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['resubmitContributionsPensionScheme'][0] + ): array + { + $request = $this->resubmitContributionsPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation resubmitContributionsPensionSchemeAsync + * + * Re-submit Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission to re-submit. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resubmitContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resubmitContributionsPensionSchemeAsync( + string $employerId, + string $id, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $submissionId, + string $contentType = self::contentTypes['resubmitContributionsPensionScheme'][0] + ): PromiseInterface + { + return $this->resubmitContributionsPensionSchemeAsyncWithHttpInfo($employerId, $id, $taxYear, $submissionId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation resubmitContributionsPensionSchemeAsyncWithHttpInfo + * + * Re-submit Contributions + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission to re-submit. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resubmitContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resubmitContributionsPensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['resubmitContributionsPensionScheme'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->resubmitContributionsPensionSchemeRequest($employerId, $id, $taxYear, $submissionId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'resubmitContributionsPensionScheme' + * + * @param string $employerId The Id of the Employer to which the PensionScheme belongs. (required) + * @param string $id The Id of the PensionScheme. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear of the submission (required) + * @param string $submissionId The Id of the Submission to re-submit. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resubmitContributionsPensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function resubmitContributionsPensionSchemeRequest( + $employerId, + $id, + $taxYear, + $submissionId, + string $contentType = self::contentTypes['resubmitContributionsPensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling resubmitContributionsPensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling resubmitContributionsPensionScheme' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling resubmitContributionsPensionScheme' + ); + } + + // verify the required parameter 'submissionId' is set + if ($submissionId === null || (is_array($submissionId) && count($submissionId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $submissionId when calling resubmitContributionsPensionScheme' + ); + } + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}/contributions/{taxYear}/{submissionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($submissionId !== null) { + $resourcePath = str_replace( + '{' . 'submissionId' . '}', + ObjectSerializer::toPathValue($submissionId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePensionScheme + * + * Update a PensionScheme + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionScheme + */ + public function updatePensionScheme( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['updatePensionScheme'][0] + ): \SynergiTech\Staffology\Model\PensionScheme + { + list($response) = $this->updatePensionSchemeWithHttpInfo($employerId, $id, $pensionScheme, $contentType); + return $response; + } + + /** + * Operation updatePensionSchemeWithHttpInfo + * + * Update a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionScheme'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionScheme, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePensionSchemeWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['updatePensionScheme'][0] + ): array + { + $request = $this->updatePensionSchemeRequest($employerId, $id, $pensionScheme, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionScheme', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionScheme' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionScheme', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionScheme', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePensionSchemeAsync + * + * Update a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionSchemeAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme = null, + string $contentType = self::contentTypes['updatePensionScheme'][0] + ): PromiseInterface + { + return $this->updatePensionSchemeAsyncWithHttpInfo($employerId, $id, $pensionScheme, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePensionSchemeAsyncWithHttpInfo + * + * Update a PensionScheme + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePensionSchemeAsyncWithHttpInfo( + $employerId, + $id, + $pensionScheme = null, + string $contentType = self::contentTypes['updatePensionScheme'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionScheme'; + $request = $this->updatePensionSchemeRequest($employerId, $id, $pensionScheme, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePensionScheme' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePensionScheme'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePensionSchemeRequest( + $employerId, + $id, + $pensionScheme = null, + string $contentType = self::contentTypes['updatePensionScheme'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updatePensionScheme' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePensionScheme' + ); + } + + + + $resourcePath = '/employers/{employerId}/pensionschemes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pensionScheme)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pensionScheme)); + } else { + $httpBody = $pensionScheme; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ProcessingNoteApi.php b/src/Api/ProcessingNoteApi.php new file mode 100644 index 0000000..97314e8 --- /dev/null +++ b/src/Api/ProcessingNoteApi.php @@ -0,0 +1,2911 @@ + [ + 'multipart/form-data', + ], + 'createProcessingNote' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteDocumentProcessingNote' => [ + 'application/json', + ], + 'getDocumentProcessingNote' => [ + 'application/json', + ], + 'getProcessingNote' => [ + 'application/json', + ], + 'listProcessingNote' => [ + 'application/json', + ], + 'setStatusProcessingNote' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addDocumentProcessingNote + * + * Add Document + * + * @param string $employerId employerId (required) + * @param string $id The Id of the ProcessingNote you want to attach documents to (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addDocumentProcessingNote( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentProcessingNote'][0] + ): void + { + $this->addDocumentProcessingNoteWithHttpInfo($employerId, $id, $file, $contentType); + } + + /** + * Operation addDocumentProcessingNoteWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $id The Id of the ProcessingNote you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addDocumentProcessingNoteWithHttpInfo( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentProcessingNote'][0] + ): array + { + $request = $this->addDocumentProcessingNoteRequest($employerId, $id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addDocumentProcessingNoteAsync + * + * Add Document + * + * @param string $employerId (required) + * @param string $id The Id of the ProcessingNote you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentProcessingNoteAsync( + string $employerId, + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['addDocumentProcessingNote'][0] + ): PromiseInterface + { + return $this->addDocumentProcessingNoteAsyncWithHttpInfo($employerId, $id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDocumentProcessingNoteAsyncWithHttpInfo + * + * Add Document + * + * @param string $employerId (required) + * @param string $id The Id of the ProcessingNote you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addDocumentProcessingNoteAsyncWithHttpInfo( + $employerId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentProcessingNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addDocumentProcessingNoteRequest($employerId, $id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDocumentProcessingNote' + * + * @param string $employerId (required) + * @param string $id The Id of the ProcessingNote you want to attach documents to (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addDocumentProcessingNoteRequest( + $employerId, + $id, + $file = null, + string $contentType = self::contentTypes['addDocumentProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling addDocumentProcessingNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addDocumentProcessingNote' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{id}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createProcessingNote + * + * Create ProcessingNote + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\ProcessingNote|null $processingNote processingNote (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ProcessingNote + */ + public function createProcessingNote( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\ProcessingNote $processingNote = null, + string $contentType = self::contentTypes['createProcessingNote'][0] + ): \SynergiTech\Staffology\Model\ProcessingNote + { + list($response) = $this->createProcessingNoteWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote, $contentType); + return $response; + } + + /** + * Operation createProcessingNoteWithHttpInfo + * + * Create ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\ProcessingNote|null $processingNote (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ProcessingNote, HTTP status code, HTTP response headers (array of strings) + */ + public function createProcessingNoteWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\ProcessingNote $processingNote = null, + string $contentType = self::contentTypes['createProcessingNote'][0] + ): array + { + $request = $this->createProcessingNoteRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ProcessingNote', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ProcessingNote' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ProcessingNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ProcessingNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createProcessingNoteAsync + * + * Create ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\ProcessingNote|null $processingNote (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createProcessingNoteAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\ProcessingNote $processingNote = null, + string $contentType = self::contentTypes['createProcessingNote'][0] + ): PromiseInterface + { + return $this->createProcessingNoteAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createProcessingNoteAsyncWithHttpInfo + * + * Create ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\ProcessingNote|null $processingNote (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createProcessingNoteAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $processingNote = null, + string $contentType = self::contentTypes['createProcessingNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + $request = $this->createProcessingNoteRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $processingNote, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createProcessingNote' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\ProcessingNote|null $processingNote (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createProcessingNoteRequest( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $processingNote = null, + string $contentType = self::contentTypes['createProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createProcessingNote' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling createProcessingNote' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling createProcessingNote' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling createProcessingNote' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($processingNote)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($processingNote)); + } else { + $httpBody = $processingNote; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocumentProcessingNote + * + * Delete ProcessingNote Document + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteDocumentProcessingNote( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentProcessingNote'][0] + ): void + { + $this->deleteDocumentProcessingNoteWithHttpInfo($employerId, $id, $documentId, $contentType); + } + + /** + * Operation deleteDocumentProcessingNoteWithHttpInfo + * + * Delete ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentProcessingNoteWithHttpInfo( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentProcessingNote'][0] + ): array + { + $request = $this->deleteDocumentProcessingNoteRequest($employerId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDocumentProcessingNoteAsync + * + * Delete ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentProcessingNoteAsync( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['deleteDocumentProcessingNote'][0] + ): PromiseInterface + { + return $this->deleteDocumentProcessingNoteAsyncWithHttpInfo($employerId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentProcessingNoteAsyncWithHttpInfo + * + * Delete ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteDocumentProcessingNoteAsyncWithHttpInfo( + $employerId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentProcessingNote'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteDocumentProcessingNoteRequest($employerId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocumentProcessingNote' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentProcessingNoteRequest( + $employerId, + $id, + $documentId, + string $contentType = self::contentTypes['deleteDocumentProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteDocumentProcessingNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocumentProcessingNote' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling deleteDocumentProcessingNote' + ); + } + + + $resourcePath = '/employers/{employerId}/payrun/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentProcessingNote + * + * Get ProcessingNote Document + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SplFileObject + */ + public function getDocumentProcessingNote( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentProcessingNote'][0] + ): \SplFileObject + { + list($response) = $this->getDocumentProcessingNoteWithHttpInfo($employerId, $id, $documentId, $contentType); + return $response; + } + + /** + * Operation getDocumentProcessingNoteWithHttpInfo + * + * Get ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentProcessingNoteWithHttpInfo( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentProcessingNote'][0] + ): array + { + $request = $this->getDocumentProcessingNoteRequest($employerId, $id, $documentId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SplFileObject'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentProcessingNoteAsync + * + * Get ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentProcessingNoteAsync( + string $employerId, + string $id, + string $documentId, + string $contentType = self::contentTypes['getDocumentProcessingNote'][0] + ): PromiseInterface + { + return $this->getDocumentProcessingNoteAsyncWithHttpInfo($employerId, $id, $documentId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentProcessingNoteAsyncWithHttpInfo + * + * Get ProcessingNote Document + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getDocumentProcessingNoteAsyncWithHttpInfo( + $employerId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentProcessingNote'][0] + ): PromiseInterface + { + $returnType = '\SplFileObject'; + $request = $this->getDocumentProcessingNoteRequest($employerId, $id, $documentId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentProcessingNote' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $documentId The Id of the Document you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentProcessingNoteRequest( + $employerId, + $id, + $documentId, + string $contentType = self::contentTypes['getDocumentProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getDocumentProcessingNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getDocumentProcessingNote' + ); + } + + // verify the required parameter 'documentId' is set + if ($documentId === null || (is_array($documentId) && count($documentId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $documentId when calling getDocumentProcessingNote' + ); + } + + + $resourcePath = '/employers/{employerId}/payrun/{id}/documents/{documentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($documentId !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($documentId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProcessingNote + * + * Get a ProcessingNote + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ProcessingNote + */ + public function getProcessingNote( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getProcessingNote'][0] + ): \SynergiTech\Staffology\Model\ProcessingNote + { + list($response) = $this->getProcessingNoteWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + return $response; + } + + /** + * Operation getProcessingNoteWithHttpInfo + * + * Get a ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ProcessingNote, HTTP status code, HTTP response headers (array of strings) + */ + public function getProcessingNoteWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getProcessingNote'][0] + ): array + { + $request = $this->getProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ProcessingNote', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ProcessingNote' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ProcessingNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ProcessingNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProcessingNoteAsync + * + * Get a ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getProcessingNoteAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + string $contentType = self::contentTypes['getProcessingNote'][0] + ): PromiseInterface + { + return $this->getProcessingNoteAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProcessingNoteAsyncWithHttpInfo + * + * Get a ProcessingNote + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getProcessingNoteAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + string $contentType = self::contentTypes['getProcessingNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + $request = $this->getProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProcessingNote' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProcessingNoteRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + string $contentType = self::contentTypes['getProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getProcessingNote' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getProcessingNote' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getProcessingNote' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getProcessingNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getProcessingNote' + ); + } + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listProcessingNote + * + * List ProcessingNotes for a PayRun + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $payrunEntryId Optionally filter ProcessingNotes to just those for the specified PayRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function listProcessingNote( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $payrunEntryId = null, + string $contentType = self::contentTypes['listProcessingNote'][0] + ): array + { + list($response) = $this->listProcessingNoteWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId, $contentType); + return $response; + } + + /** + * Operation listProcessingNoteWithHttpInfo + * + * List ProcessingNotes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $payrunEntryId Optionally filter ProcessingNotes to just those for the specified PayRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function listProcessingNoteWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $payrunEntryId = null, + string $contentType = self::contentTypes['listProcessingNote'][0] + ): array + { + $request = $this->listProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listProcessingNoteAsync + * + * List ProcessingNotes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $payrunEntryId Optionally filter ProcessingNotes to just those for the specified PayRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listProcessingNoteAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = 1, + ?string $payrunEntryId = null, + string $contentType = self::contentTypes['listProcessingNote'][0] + ): PromiseInterface + { + return $this->listProcessingNoteAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listProcessingNoteAsyncWithHttpInfo + * + * List ProcessingNotes for a PayRun + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $payrunEntryId Optionally filter ProcessingNotes to just those for the specified PayRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function listProcessingNoteAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $payrunEntryId = null, + string $contentType = self::contentTypes['listProcessingNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->listProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $payrunEntryId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listProcessingNote' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $payrunEntryId Optionally filter ProcessingNotes to just those for the specified PayRunEntry (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listProcessingNoteRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = 1, + $payrunEntryId = null, + string $contentType = self::contentTypes['listProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling listProcessingNote' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling listProcessingNote' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling listProcessingNote' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling listProcessingNote' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payrunEntryId, + 'payrunEntryId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setStatusProcessingNote + * + * Set a ProcessingNote status + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id id (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStatusProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ProcessingNote + */ + public function setStatusProcessingNote( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?string $body = null, + string $contentType = self::contentTypes['setStatusProcessingNote'][0] + ): \SynergiTech\Staffology\Model\ProcessingNote + { + list($response) = $this->setStatusProcessingNoteWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body, $contentType); + return $response; + } + + /** + * Operation setStatusProcessingNoteWithHttpInfo + * + * Set a ProcessingNote status + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStatusProcessingNote'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ProcessingNote, HTTP status code, HTTP response headers (array of strings) + */ + public function setStatusProcessingNoteWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?string $body = null, + string $contentType = self::contentTypes['setStatusProcessingNote'][0] + ): array + { + $request = $this->setStatusProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ProcessingNote', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ProcessingNote' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ProcessingNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ProcessingNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation setStatusProcessingNoteAsync + * + * Set a ProcessingNote status + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStatusProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setStatusProcessingNoteAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?int $ordinal = 1, + ?string $body = null, + string $contentType = self::contentTypes['setStatusProcessingNote'][0] + ): PromiseInterface + { + return $this->setStatusProcessingNoteAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setStatusProcessingNoteAsyncWithHttpInfo + * + * Set a ProcessingNote status + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStatusProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setStatusProcessingNoteAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $body = null, + string $contentType = self::contentTypes['setStatusProcessingNote'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ProcessingNote'; + $request = $this->setStatusProcessingNoteRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $ordinal, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setStatusProcessingNote' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id (required) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setStatusProcessingNote'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setStatusProcessingNoteRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $ordinal = 1, + $body = null, + string $contentType = self::contentTypes['setStatusProcessingNote'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling setStatusProcessingNote' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling setStatusProcessingNote' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling setStatusProcessingNote' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling setStatusProcessingNote' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setStatusProcessingNote' + ); + } + + + + + $resourcePath = '/employers/{employerId}/payrun/{taxYear}/{payPeriod}/{periodNumber}/processingnotes/{id}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ReportPackApi.php b/src/Api/ReportPackApi.php new file mode 100644 index 0000000..4b5c873 --- /dev/null +++ b/src/Api/ReportPackApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteReportPack' => [ + 'application/json', + ], + 'getReportPack' => [ + 'application/json', + ], + 'indexReportPack' => [ + 'application/json', + ], + 'updateReportPack' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createReportPack + * + * Create ReportPack + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ReportPack + */ + public function createReportPack( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['createReportPack'][0] + ): \SynergiTech\Staffology\Model\ReportPack + { + list($response) = $this->createReportPackWithHttpInfo($employerId, $reportPack, $contentType); + return $response; + } + + /** + * Operation createReportPackWithHttpInfo + * + * Create ReportPack + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ReportPack, HTTP status code, HTTP response headers (array of strings) + */ + public function createReportPackWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['createReportPack'][0] + ): array + { + $request = $this->createReportPackRequest($employerId, $reportPack, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ReportPack', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportPack' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportPack', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportPack', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createReportPackAsync + * + * Create ReportPack + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createReportPackAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['createReportPack'][0] + ): PromiseInterface + { + return $this->createReportPackAsyncWithHttpInfo($employerId, $reportPack, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createReportPackAsyncWithHttpInfo + * + * Create ReportPack + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createReportPackAsyncWithHttpInfo( + $employerId, + $reportPack = null, + string $contentType = self::contentTypes['createReportPack'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + $request = $this->createReportPackRequest($employerId, $reportPack, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createReportPack' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createReportPackRequest( + $employerId, + $reportPack = null, + string $contentType = self::contentTypes['createReportPack'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createReportPack' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/packs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($reportPack)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($reportPack)); + } else { + $httpBody = $reportPack; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteReportPack + * + * Delete ReportPack + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteReportPack( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportPack'][0] + ): void + { + $this->deleteReportPackWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteReportPackWithHttpInfo + * + * Delete ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteReportPackWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportPack'][0] + ): array + { + $request = $this->deleteReportPackRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteReportPackAsync + * + * Delete ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteReportPackAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportPack'][0] + ): PromiseInterface + { + return $this->deleteReportPackAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteReportPackAsyncWithHttpInfo + * + * Delete ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteReportPackAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteReportPack'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteReportPackRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteReportPack' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteReportPackRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteReportPack'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteReportPack' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteReportPack' + ); + } + + + $resourcePath = '/employers/{employerId}/reports/packs/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportPack + * + * Get ReportPack + * + * @param string $employerId The Id of the Employer to which the ReportPack belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportPack + */ + public function getReportPack( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportPack'][0] + ): \SynergiTech\Staffology\Model\ReportPack + { + list($response) = $this->getReportPackWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getReportPackWithHttpInfo + * + * Get ReportPack + * + * @param string $employerId The Id of the Employer to which the ReportPack belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportPack, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportPackWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportPack'][0] + ): array + { + $request = $this->getReportPackRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportPack', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportPack' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportPack', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportPack', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReportPackAsync + * + * Get ReportPack + * + * @param string $employerId The Id of the Employer to which the ReportPack belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportPackAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportPack'][0] + ): PromiseInterface + { + return $this->getReportPackAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportPackAsyncWithHttpInfo + * + * Get ReportPack + * + * @param string $employerId The Id of the Employer to which the ReportPack belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportPackAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getReportPack'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + $request = $this->getReportPackRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportPack' + * + * @param string $employerId The Id of the Employer to which the ReportPack belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportPackRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getReportPack'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getReportPack' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getReportPack' + ); + } + + + $resourcePath = '/employers/{employerId}/reports/packs/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexReportPack + * + * List ReportPacks + * + * @param string $employerId The Id of the Employer for which you want to list ReportPacks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexReportPack( + string $employerId, + string $contentType = self::contentTypes['indexReportPack'][0] + ): array + { + list($response) = $this->indexReportPackWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexReportPackWithHttpInfo + * + * List ReportPacks + * + * @param string $employerId The Id of the Employer for which you want to list ReportPacks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexReportPackWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexReportPack'][0] + ): array + { + $request = $this->indexReportPackRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexReportPackAsync + * + * List ReportPacks + * + * @param string $employerId The Id of the Employer for which you want to list ReportPacks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexReportPackAsync( + string $employerId, + string $contentType = self::contentTypes['indexReportPack'][0] + ): PromiseInterface + { + return $this->indexReportPackAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexReportPackAsyncWithHttpInfo + * + * List ReportPacks + * + * @param string $employerId The Id of the Employer for which you want to list ReportPacks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexReportPackAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexReportPack'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexReportPackRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexReportPack' + * + * @param string $employerId The Id of the Employer for which you want to list ReportPacks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexReportPackRequest( + $employerId, + string $contentType = self::contentTypes['indexReportPack'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexReportPack' + ); + } + + + $resourcePath = '/employers/{employerId}/reports/packs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateReportPack + * + * Update ReportPack + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportPack + */ + public function updateReportPack( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['updateReportPack'][0] + ): \SynergiTech\Staffology\Model\ReportPack + { + list($response) = $this->updateReportPackWithHttpInfo($employerId, $id, $reportPack, $contentType); + return $response; + } + + /** + * Operation updateReportPackWithHttpInfo + * + * Update ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportPack'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportPack, HTTP status code, HTTP response headers (array of strings) + */ + public function updateReportPackWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['updateReportPack'][0] + ): array + { + $request = $this->updateReportPackRequest($employerId, $id, $reportPack, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportPack', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportPack' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportPack', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportPack', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateReportPackAsync + * + * Update ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateReportPackAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportPack $reportPack = null, + string $contentType = self::contentTypes['updateReportPack'][0] + ): PromiseInterface + { + return $this->updateReportPackAsyncWithHttpInfo($employerId, $id, $reportPack, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateReportPackAsyncWithHttpInfo + * + * Update ReportPack + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateReportPackAsyncWithHttpInfo( + $employerId, + $id, + $reportPack = null, + string $contentType = self::contentTypes['updateReportPack'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportPack'; + $request = $this->updateReportPackRequest($employerId, $id, $reportPack, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateReportPack' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ReportPack|null $reportPack (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportPack'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateReportPackRequest( + $employerId, + $id, + $reportPack = null, + string $contentType = self::contentTypes['updateReportPack'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateReportPack' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateReportPack' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/packs/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($reportPack)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($reportPack)); + } else { + $httpBody = $reportPack; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ReportTemplateApi.php b/src/Api/ReportTemplateApi.php new file mode 100644 index 0000000..9f3b18d --- /dev/null +++ b/src/Api/ReportTemplateApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteReportTemplate' => [ + 'application/json', + ], + 'getReportTemplate' => [ + 'application/json', + ], + 'indexReportTemplate' => [ + 'application/json', + ], + 'updateReportTemplate' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createReportTemplate + * + * Create Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\ReportTemplate + */ + public function createReportTemplate( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['createReportTemplate'][0] + ): \SynergiTech\Staffology\Model\ReportTemplate + { + list($response) = $this->createReportTemplateWithHttpInfo($employerId, $reportTemplate, $contentType); + return $response; + } + + /** + * Operation createReportTemplateWithHttpInfo + * + * Create Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\ReportTemplate, HTTP status code, HTTP response headers (array of strings) + */ + public function createReportTemplateWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['createReportTemplate'][0] + ): array + { + $request = $this->createReportTemplateRequest($employerId, $reportTemplate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ReportTemplate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportTemplate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createReportTemplateAsync + * + * Create Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createReportTemplateAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['createReportTemplate'][0] + ): PromiseInterface + { + return $this->createReportTemplateAsyncWithHttpInfo($employerId, $reportTemplate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createReportTemplateAsyncWithHttpInfo + * + * Create Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createReportTemplateAsyncWithHttpInfo( + $employerId, + $reportTemplate = null, + string $contentType = self::contentTypes['createReportTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportTemplate'; + $request = $this->createReportTemplateRequest($employerId, $reportTemplate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createReportTemplate' + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createReportTemplateRequest( + $employerId, + $reportTemplate = null, + string $contentType = self::contentTypes['createReportTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createReportTemplate' + ); + } + + + + $resourcePath = '/employers/{employerId}/reporttemplates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($reportTemplate)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($reportTemplate)); + } else { + $httpBody = $reportTemplate; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteReportTemplate + * + * Delete Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteReportTemplate( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportTemplate'][0] + ): void + { + $this->deleteReportTemplateWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteReportTemplateWithHttpInfo + * + * Delete Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteReportTemplateWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportTemplate'][0] + ): array + { + $request = $this->deleteReportTemplateRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteReportTemplateAsync + * + * Delete Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteReportTemplateAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteReportTemplate'][0] + ): PromiseInterface + { + return $this->deleteReportTemplateAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteReportTemplateAsyncWithHttpInfo + * + * Delete Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteReportTemplateAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteReportTemplate'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteReportTemplateRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteReportTemplate' + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteReportTemplateRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteReportTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteReportTemplate' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteReportTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/reporttemplates/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportTemplate + * + * Get Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportTemplate + */ + public function getReportTemplate( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportTemplate'][0] + ): \SynergiTech\Staffology\Model\ReportTemplate + { + list($response) = $this->getReportTemplateWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getReportTemplateWithHttpInfo + * + * Get Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportTemplate, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportTemplateWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportTemplate'][0] + ): array + { + $request = $this->getReportTemplateRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportTemplate', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportTemplate'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReportTemplateAsync + * + * Get Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportTemplateAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getReportTemplate'][0] + ): PromiseInterface + { + return $this->getReportTemplateAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportTemplateAsyncWithHttpInfo + * + * Get Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getReportTemplateAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getReportTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportTemplate'; + $request = $this->getReportTemplateRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportTemplate' + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportTemplateRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getReportTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getReportTemplate' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getReportTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/reporttemplates/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexReportTemplate + * + * List Report Templates (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexReportTemplate( + string $employerId, + string $contentType = self::contentTypes['indexReportTemplate'][0] + ): array + { + list($response) = $this->indexReportTemplateWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexReportTemplateWithHttpInfo + * + * List Report Templates (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexReportTemplateWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexReportTemplate'][0] + ): array + { + $request = $this->indexReportTemplateRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexReportTemplateAsync + * + * List Report Templates (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexReportTemplateAsync( + string $employerId, + string $contentType = self::contentTypes['indexReportTemplate'][0] + ): PromiseInterface + { + return $this->indexReportTemplateAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexReportTemplateAsyncWithHttpInfo + * + * List Report Templates (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexReportTemplateAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexReportTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexReportTemplateRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexReportTemplate' + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexReportTemplateRequest( + $employerId, + string $contentType = self::contentTypes['indexReportTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexReportTemplate' + ); + } + + + $resourcePath = '/employers/{employerId}/reporttemplates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateReportTemplate + * + * Update Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\OccupationalPolicy + */ + public function updateReportTemplate( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['updateReportTemplate'][0] + ): \SynergiTech\Staffology\Model\OccupationalPolicy + { + list($response) = $this->updateReportTemplateWithHttpInfo($employerId, $id, $reportTemplate, $contentType); + return $response; + } + + /** + * Operation updateReportTemplateWithHttpInfo + * + * Update Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportTemplate'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\OccupationalPolicy, HTTP status code, HTTP response headers (array of strings) + */ + public function updateReportTemplateWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['updateReportTemplate'][0] + ): array + { + $request = $this->updateReportTemplateRequest($employerId, $id, $reportTemplate, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\OccupationalPolicy', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\OccupationalPolicy' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\OccupationalPolicy', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\OccupationalPolicy', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateReportTemplateAsync + * + * Update Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateReportTemplateAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ReportTemplate $reportTemplate = null, + string $contentType = self::contentTypes['updateReportTemplate'][0] + ): PromiseInterface + { + return $this->updateReportTemplateAsyncWithHttpInfo($employerId, $id, $reportTemplate, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateReportTemplateAsyncWithHttpInfo + * + * Update Report Template (beta) + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateReportTemplateAsyncWithHttpInfo( + $employerId, + $id, + $reportTemplate = null, + string $contentType = self::contentTypes['updateReportTemplate'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\OccupationalPolicy'; + $request = $this->updateReportTemplateRequest($employerId, $id, $reportTemplate, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateReportTemplate' + * + * @param string $employerId The Id of the Employer to which the Report Template belongs. (required) + * @param string $id The Id of the Report Template which you want to fetch (required) + * @param \SynergiTech\Staffology\Model\ReportTemplate|null $reportTemplate (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateReportTemplate'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateReportTemplateRequest( + $employerId, + $id, + $reportTemplate = null, + string $contentType = self::contentTypes['updateReportTemplate'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateReportTemplate' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateReportTemplate' + ); + } + + + + $resourcePath = '/employers/{employerId}/reporttemplates/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($reportTemplate)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($reportTemplate)); + } else { + $httpBody = $reportTemplate; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ReportsApi.php b/src/Api/ReportsApi.php new file mode 100644 index 0000000..e658a67 --- /dev/null +++ b/src/Api/ReportsApi.php @@ -0,0 +1,31018 @@ + [ + 'application/json', + ], + 'aeAssessmentsReports' => [ + 'application/json', + ], + 'aeoStatementReports' => [ + 'application/json', + ], + 'analysisReports' => [ + 'application/json', + ], + 'apprenticeshipLevyDetailsReports' => [ + 'application/json', + ], + 'attachmentOrdersReports' => [ + 'application/json', + ], + 'averageHolidayPayRateReports' => [ + 'application/json', + ], + 'bankPaymentInstructionsReports' => [ + 'application/json', + ], + 'changesReports' => [ + 'application/json', + ], + 'cis300Reports' => [ + 'application/json', + ], + 'cisStatementReports' => [ + 'application/json', + ], + 'cisSubContractorSummaryReports' => [ + 'application/json', + ], + 'costAnalysisReports' => [ + 'application/json', + ], + 'costOfEmploymentReports' => [ + 'application/json', + ], + 'downloadMaternitySchedulesReports' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'emailP11DMultipleReports' => [ + 'application/json', + ], + 'emailP11DReports' => [ + 'application/json', + ], + 'emailP45Reports' => [ + 'application/json', + ], + 'emailP60MultipleReports' => [ + 'application/json', + ], + 'emailP60Reports' => [ + 'application/json', + ], + 'employeeBenefitsReports' => [ + 'application/json', + ], + 'employeeExportReports' => [ + 'application/json', + ], + 'employeeLeaveReports' => [ + 'application/json', + ], + 'employeeRoleExportReports' => [ + 'application/json', + ], + 'employerChangesReports' => [ + 'application/json', + ], + 'employerExportReports' => [ + 'application/json', + ], + 'examplePayslipReports' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'exbReports' => [ + 'application/json', + ], + 'fpsReports' => [ + 'application/json', + ], + 'fullSummaryOfPayReports' => [ + 'application/json', + ], + 'furloughReportReports' => [ + 'application/json', + ], + 'genderPayGapReports' => [ + 'application/json', + ], + 'getPayRunCsvReports' => [ + 'application/json', + ], + 'grossToNetReports' => [ + 'application/json', + ], + 'holidayReports' => [ + 'application/json', + ], + 'hourlyPayReports' => [ + 'application/json', + ], + 'loanBalancesReports' => [ + 'application/json', + ], + 'niLetterValidationReportEmployeesReports' => [ + 'application/json', + ], + 'niLetterValidationReportReports' => [ + 'application/json', + ], + 'niYtdReports' => [ + 'application/json', + ], + 'p11DMultipleReports' => [ + 'application/json', + ], + 'p11DReports' => [ + 'application/json', + ], + 'p11DetailedMultipleReports' => [ + 'application/json', + ], + 'p11DetailedReports' => [ + 'application/json', + ], + 'p11Reports' => [ + 'application/json', + ], + 'p30Reports' => [ + 'application/json', + ], + 'p32Reports' => [ + 'application/json', + ], + 'p45Reports' => [ + 'application/json', + ], + 'p60MultipleReports' => [ + 'application/json', + ], + 'p60Reports' => [ + 'application/json', + ], + 'papdisFileReports' => [ + 'application/json', + ], + 'payCodeExportReports' => [ + 'application/json', + ], + 'payElementReports' => [ + 'application/json', + ], + 'payGradesReports' => [ + 'application/json', + ], + 'payRunCsvReports' => [ + 'application/json', + ], + 'payRunPaymentsReports' => [ + 'application/json', + ], + 'payRunSummaryReports' => [ + 'application/json', + ], + 'paySpineReports' => [ + 'application/json', + ], + 'payrollAnalysisCostBreakdownReports' => [ + 'application/json', + ], + 'payrollAnalysisEmployeeRoleBreakdownReports' => [ + 'application/json', + ], + 'payrollJournalCsvReportReports' => [ + 'application/json', + ], + 'payrunNiYtdReports' => [ + 'application/json', + ], + 'payrunYtdReports' => [ + 'application/json', + ], + 'payslipReports' => [ + 'application/json', + ], + 'payslipsReports' => [ + 'application/json', + ], + 'pensionMembershipsReports' => [ + 'application/json', + ], + 'rightToWorkReports' => [ + 'application/json', + ], + 'spinePointReports' => [ + 'application/json', + ], + 'statutoryPayReports' => [ + 'application/json', + ], + 'taxCodeChangesReports' => [ + 'application/json', + ], + 'teachersPensionEoyReports' => [ + 'application/json', + ], + 'umbrellaReconciliationReports' => [ + 'application/json', + ], + 'varianceReportReports' => [ + 'application/json', + ], + 'warningsReports' => [ + 'application/json', + ], + 'ytdReports' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation advancedVarianceReportReports + * + * Advanced Variance Report + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod (optional) + * @param int|null $ordinal ordinal (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param int|null $period period (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare taxYearCompare (optional) + * @param int|null $periodCompare periodCompare (optional) + * @param string|null $payCodes payCodes (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['advancedVarianceReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse + */ + public function advancedVarianceReportReports( + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $period = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $periodCompare = null, + ?string $payCodes = null, + ?string $accept = null, + string $contentType = self::contentTypes['advancedVarianceReportReports'][0] + ): \SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse + { + list($response) = $this->advancedVarianceReportReportsWithHttpInfo($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept, $contentType); + return $response; + } + + /** + * Operation advancedVarianceReportReportsWithHttpInfo + * + * Advanced Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param int|null $period (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $periodCompare (optional) + * @param string|null $payCodes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['advancedVarianceReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function advancedVarianceReportReportsWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $period = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $periodCompare = null, + ?string $payCodes = null, + ?string $accept = null, + string $contentType = self::contentTypes['advancedVarianceReportReports'][0] + ): array + { + $request = $this->advancedVarianceReportReportsRequest($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation advancedVarianceReportReportsAsync + * + * Advanced Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param int|null $period (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $periodCompare (optional) + * @param string|null $payCodes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['advancedVarianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function advancedVarianceReportReportsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?int $ordinal = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?int $period = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $periodCompare = null, + ?string $payCodes = null, + ?string $accept = null, + string $contentType = self::contentTypes['advancedVarianceReportReports'][0] + ): PromiseInterface + { + return $this->advancedVarianceReportReportsAsyncWithHttpInfo($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation advancedVarianceReportReportsAsyncWithHttpInfo + * + * Advanced Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param int|null $period (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $periodCompare (optional) + * @param string|null $payCodes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['advancedVarianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function advancedVarianceReportReportsAsyncWithHttpInfo( + $employerId, + $payPeriod = null, + $ordinal = null, + $taxYear = null, + $period = null, + $taxYearCompare = null, + $periodCompare = null, + $payCodes = null, + $accept = null, + string $contentType = self::contentTypes['advancedVarianceReportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AdvancedVarianceReportReportResponse'; + $request = $this->advancedVarianceReportReportsRequest($employerId, $payPeriod, $ordinal, $taxYear, $period, $taxYearCompare, $periodCompare, $payCodes, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'advancedVarianceReportReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param int|null $ordinal (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param int|null $period (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $periodCompare (optional) + * @param string|null $payCodes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['advancedVarianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function advancedVarianceReportReportsRequest( + $employerId, + $payPeriod = null, + $ordinal = null, + $taxYear = null, + $period = null, + $taxYearCompare = null, + $periodCompare = null, + $payCodes = null, + $accept = null, + string $contentType = self::contentTypes['advancedVarianceReportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling advancedVarianceReportReports' + ); + } + + + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/advancedvariance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period, + 'period', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYearCompare, + 'taxYearCompare', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $periodCompare, + 'periodCompare', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payCodes, + 'payCodes', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aeAssessmentsReports + * + * AutoEnrolment Assessments + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeAssessmentsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ItemListReportResponse + */ + public function aeAssessmentsReports( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['aeAssessmentsReports'][0] + ): \SynergiTech\Staffology\Model\ItemListReportResponse + { + list($response) = $this->aeAssessmentsReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation aeAssessmentsReportsWithHttpInfo + * + * AutoEnrolment Assessments + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeAssessmentsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ItemListReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function aeAssessmentsReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['aeAssessmentsReports'][0] + ): array + { + $request = $this->aeAssessmentsReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ItemListReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ItemListReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ItemListReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ItemListReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ItemListReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation aeAssessmentsReportsAsync + * + * AutoEnrolment Assessments + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeAssessmentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeAssessmentsReportsAsync( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['aeAssessmentsReports'][0] + ): PromiseInterface + { + return $this->aeAssessmentsReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aeAssessmentsReportsAsyncWithHttpInfo + * + * AutoEnrolment Assessments + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeAssessmentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeAssessmentsReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + string $contentType = self::contentTypes['aeAssessmentsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ItemListReportResponse'; + $request = $this->aeAssessmentsReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aeAssessmentsReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeAssessmentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aeAssessmentsReportsRequest( + $employerId, + $accept = null, + string $contentType = self::contentTypes['aeAssessmentsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling aeAssessmentsReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/AeAssessments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aeoStatementReports + * + * AEO Statement + * + * @param string $employeeId employeeId (required) + * @param string $id The id of the AttachmentOrder (required) + * @param string|null $employerId employerId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoStatementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AttachmentOrderReportResponse + */ + public function aeoStatementReports( + string $employeeId, + string $id, + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['aeoStatementReports'][0] + ): \SynergiTech\Staffology\Model\AttachmentOrderReportResponse + { + list($response) = $this->aeoStatementReportsWithHttpInfo($employeeId, $id, $employerId, $accept, $contentType); + return $response; + } + + /** + * Operation aeoStatementReportsWithHttpInfo + * + * AEO Statement + * + * @param string $employeeId (required) + * @param string $id The id of the AttachmentOrder (required) + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoStatementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AttachmentOrderReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function aeoStatementReportsWithHttpInfo( + string $employeeId, + string $id, + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['aeoStatementReports'][0] + ): array + { + $request = $this->aeoStatementReportsRequest($employeeId, $id, $employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AttachmentOrderReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AttachmentOrderReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AttachmentOrderReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrderReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AttachmentOrderReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation aeoStatementReportsAsync + * + * AEO Statement + * + * @param string $employeeId (required) + * @param string $id The id of the AttachmentOrder (required) + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeoStatementReportsAsync( + string $employeeId, + string $id, + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['aeoStatementReports'][0] + ): PromiseInterface + { + return $this->aeoStatementReportsAsyncWithHttpInfo($employeeId, $id, $employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aeoStatementReportsAsyncWithHttpInfo + * + * AEO Statement + * + * @param string $employeeId (required) + * @param string $id The id of the AttachmentOrder (required) + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function aeoStatementReportsAsyncWithHttpInfo( + $employeeId, + $id, + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['aeoStatementReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrderReportResponse'; + $request = $this->aeoStatementReportsRequest($employeeId, $id, $employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aeoStatementReports' + * + * @param string $employeeId (required) + * @param string $id The id of the AttachmentOrder (required) + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aeoStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aeoStatementReportsRequest( + $employeeId, + $id, + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['aeoStatementReports'][0] + ): Request + { + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling aeoStatementReports' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling aeoStatementReports' + ); + } + + + + + $resourcePath = '/aeo/{employeeId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation analysisReports + * + * Analysis + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $showPayPeriodBreakdown If set to true, then the report will show a breakdown of each period for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['analysisReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AnalysisReportReportResponse + */ + public function analysisReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $showPayPeriodBreakdown = false, + string $contentType = self::contentTypes['analysisReports'][0] + ): \SynergiTech\Staffology\Model\AnalysisReportReportResponse + { + list($response) = $this->analysisReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown, $contentType); + return $response; + } + + /** + * Operation analysisReportsWithHttpInfo + * + * Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $showPayPeriodBreakdown If set to true, then the report will show a breakdown of each period for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['analysisReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AnalysisReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function analysisReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $showPayPeriodBreakdown = false, + string $contentType = self::contentTypes['analysisReports'][0] + ): array + { + $request = $this->analysisReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AnalysisReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AnalysisReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AnalysisReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AnalysisReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AnalysisReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation analysisReportsAsync + * + * Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $showPayPeriodBreakdown If set to true, then the report will show a breakdown of each period for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['analysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function analysisReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $showPayPeriodBreakdown = false, + string $contentType = self::contentTypes['analysisReports'][0] + ): PromiseInterface + { + return $this->analysisReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation analysisReportsAsyncWithHttpInfo + * + * Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $showPayPeriodBreakdown If set to true, then the report will show a breakdown of each period for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['analysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function analysisReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + $showPayPeriodBreakdown = false, + string $contentType = self::contentTypes['analysisReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AnalysisReportReportResponse'; + $request = $this->analysisReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $showPayPeriodBreakdown, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'analysisReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $showPayPeriodBreakdown If set to true, then the report will show a breakdown of each period for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['analysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function analysisReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + $showPayPeriodBreakdown = false, + string $contentType = self::contentTypes['analysisReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling analysisReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling analysisReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling analysisReports' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysis'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $showPayPeriodBreakdown, + 'showPayPeriodBreakdown', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apprenticeshipLevyDetailsReports + * + * Apprenticeship Levy Details + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear that the Apprenticeship Levy is for. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyDetailsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function apprenticeshipLevyDetailsReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['apprenticeshipLevyDetailsReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->apprenticeshipLevyDetailsReportsWithHttpInfo($employerId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation apprenticeshipLevyDetailsReportsWithHttpInfo + * + * Apprenticeship Levy Details + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear that the Apprenticeship Levy is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyDetailsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apprenticeshipLevyDetailsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['apprenticeshipLevyDetailsReports'][0] + ): array + { + $request = $this->apprenticeshipLevyDetailsReportsRequest($employerId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation apprenticeshipLevyDetailsReportsAsync + * + * Apprenticeship Levy Details + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear that the Apprenticeship Levy is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyDetailsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function apprenticeshipLevyDetailsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['apprenticeshipLevyDetailsReports'][0] + ): PromiseInterface + { + return $this->apprenticeshipLevyDetailsReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apprenticeshipLevyDetailsReportsAsyncWithHttpInfo + * + * Apprenticeship Levy Details + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear that the Apprenticeship Levy is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyDetailsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function apprenticeshipLevyDetailsReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['apprenticeshipLevyDetailsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->apprenticeshipLevyDetailsReportsRequest($employerId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apprenticeshipLevyDetailsReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear that the Apprenticeship Levy is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apprenticeshipLevyDetailsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apprenticeshipLevyDetailsReportsRequest( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['apprenticeshipLevyDetailsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling apprenticeshipLevyDetailsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling apprenticeshipLevyDetailsReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/apprenticeshiplevy'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation attachmentOrdersReports + * + * Attachment Orders + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attachmentOrdersReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse + */ + public function attachmentOrdersReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['attachmentOrdersReports'][0] + ): \SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse + { + list($response) = $this->attachmentOrdersReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation attachmentOrdersReportsWithHttpInfo + * + * Attachment Orders + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attachmentOrdersReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function attachmentOrdersReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['attachmentOrdersReports'][0] + ): array + { + $request = $this->attachmentOrdersReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation attachmentOrdersReportsAsync + * + * Attachment Orders + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attachmentOrdersReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function attachmentOrdersReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['attachmentOrdersReports'][0] + ): PromiseInterface + { + return $this->attachmentOrdersReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation attachmentOrdersReportsAsyncWithHttpInfo + * + * Attachment Orders + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attachmentOrdersReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function attachmentOrdersReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['attachmentOrdersReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AttachmentOrdersReportReportResponse'; + $request = $this->attachmentOrdersReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'attachmentOrdersReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['attachmentOrdersReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function attachmentOrdersReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['attachmentOrdersReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling attachmentOrdersReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling attachmentOrdersReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling attachmentOrdersReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/attachmentorders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation averageHolidayPayRateReports + * + * Average Holiday Pay Rate + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $period period (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageHolidayPayRateReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse + */ + public function averageHolidayPayRateReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['averageHolidayPayRateReports'][0] + ): \SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse + { + list($response) = $this->averageHolidayPayRateReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation averageHolidayPayRateReportsWithHttpInfo + * + * Average Holiday Pay Rate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageHolidayPayRateReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function averageHolidayPayRateReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['averageHolidayPayRateReports'][0] + ): array + { + $request = $this->averageHolidayPayRateReportsRequest($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation averageHolidayPayRateReportsAsync + * + * Average Holiday Pay Rate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageHolidayPayRateReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function averageHolidayPayRateReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['averageHolidayPayRateReports'][0] + ): PromiseInterface + { + return $this->averageHolidayPayRateReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation averageHolidayPayRateReportsAsyncWithHttpInfo + * + * Average Holiday Pay Rate + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageHolidayPayRateReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function averageHolidayPayRateReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $period = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['averageHolidayPayRateReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\AverageHolidayPayRateReportReportResponse'; + $request = $this->averageHolidayPayRateReportsRequest($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'averageHolidayPayRateReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['averageHolidayPayRateReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function averageHolidayPayRateReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $period = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['averageHolidayPayRateReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling averageHolidayPayRateReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling averageHolidayPayRateReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling averageHolidayPayRateReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/averageholidaypayrate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period, + 'period', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation bankPaymentInstructionsReports + * + * Bank Payment Instructions + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param \DateTime|null $paymentDate paymentDate (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $incPensions Set to true and we'll include any payment due to Pension Providers (optional, default to false) + * @param bool|null $incHmrc Set to true and we'll include any payment due to HMRC (optional, default to false) + * @param bool|null $incAeos Set to true and we'll include any payment due as a result of AttachmentOrders (optional, default to false) + * @param bool|null $incDeductions Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentInstructionsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse + */ + public function bankPaymentInstructionsReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\DateTime $paymentDate = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $incPensions = false, + ?bool $incHmrc = false, + ?bool $incAeos = false, + ?bool $incDeductions = false, + string $contentType = self::contentTypes['bankPaymentInstructionsReports'][0] + ): \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse + { + list($response) = $this->bankPaymentInstructionsReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions, $contentType); + return $response; + } + + /** + * Operation bankPaymentInstructionsReportsWithHttpInfo + * + * Bank Payment Instructions + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \DateTime|null $paymentDate (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $incPensions Set to true and we'll include any payment due to Pension Providers (optional, default to false) + * @param bool|null $incHmrc Set to true and we'll include any payment due to HMRC (optional, default to false) + * @param bool|null $incAeos Set to true and we'll include any payment due as a result of AttachmentOrders (optional, default to false) + * @param bool|null $incDeductions Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentInstructionsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function bankPaymentInstructionsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\DateTime $paymentDate = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $incPensions = false, + ?bool $incHmrc = false, + ?bool $incAeos = false, + ?bool $incDeductions = false, + string $contentType = self::contentTypes['bankPaymentInstructionsReports'][0] + ): array + { + $request = $this->bankPaymentInstructionsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation bankPaymentInstructionsReportsAsync + * + * Bank Payment Instructions + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \DateTime|null $paymentDate (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $incPensions Set to true and we'll include any payment due to Pension Providers (optional, default to false) + * @param bool|null $incHmrc Set to true and we'll include any payment due to HMRC (optional, default to false) + * @param bool|null $incAeos Set to true and we'll include any payment due as a result of AttachmentOrders (optional, default to false) + * @param bool|null $incDeductions Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentInstructionsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function bankPaymentInstructionsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\DateTime $paymentDate = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $incPensions = false, + ?bool $incHmrc = false, + ?bool $incAeos = false, + ?bool $incDeductions = false, + string $contentType = self::contentTypes['bankPaymentInstructionsReports'][0] + ): PromiseInterface + { + return $this->bankPaymentInstructionsReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation bankPaymentInstructionsReportsAsyncWithHttpInfo + * + * Bank Payment Instructions + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \DateTime|null $paymentDate (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $incPensions Set to true and we'll include any payment due to Pension Providers (optional, default to false) + * @param bool|null $incHmrc Set to true and we'll include any payment due to HMRC (optional, default to false) + * @param bool|null $incAeos Set to true and we'll include any payment due as a result of AttachmentOrders (optional, default to false) + * @param bool|null $incDeductions Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentInstructionsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function bankPaymentInstructionsReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $paymentDate = null, + $bankHoliday = null, + $ordinal = 1, + $incPensions = false, + $incHmrc = false, + $incAeos = false, + $incDeductions = false, + string $contentType = self::contentTypes['bankPaymentInstructionsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\BankPaymentInstructionReportResponse'; + $request = $this->bankPaymentInstructionsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $paymentDate, $bankHoliday, $ordinal, $incPensions, $incHmrc, $incAeos, $incDeductions, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'bankPaymentInstructionsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \DateTime|null $paymentDate (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $incPensions Set to true and we'll include any payment due to Pension Providers (optional, default to false) + * @param bool|null $incHmrc Set to true and we'll include any payment due to HMRC (optional, default to false) + * @param bool|null $incAeos Set to true and we'll include any payment due as a result of AttachmentOrders (optional, default to false) + * @param bool|null $incDeductions Set to true and we'll include any payment due to Deductions that are set to be paid to a Payee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bankPaymentInstructionsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bankPaymentInstructionsReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $paymentDate = null, + $bankHoliday = null, + $ordinal = 1, + $incPensions = false, + $incHmrc = false, + $incAeos = false, + $incDeductions = false, + string $contentType = self::contentTypes['bankPaymentInstructionsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling bankPaymentInstructionsReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling bankPaymentInstructionsReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling bankPaymentInstructionsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling bankPaymentInstructionsReports' + ); + } + + + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee/credit'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paymentDate, + 'paymentDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $bankHoliday, + 'bankHoliday', // param base name + 'BankHolidayCollection', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incPensions, + 'incPensions', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incHmrc, + 'incHmrc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incAeos, + 'incAeos', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incDeductions, + 'incDeductions', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'application/zip', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation changesReports + * + * Gets audit changes of all employees within a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate fromDate (optional) + * @param \DateTime|null $toDate toDate (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse + */ + public function changesReports( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['changesReports'][0] + ): \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse + { + list($response) = $this->changesReportsWithHttpInfo($employerId, $fromDate, $toDate, $accept, $contentType); + return $response; + } + + /** + * Operation changesReportsWithHttpInfo + * + * Gets audit changes of all employees within a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function changesReportsWithHttpInfo( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['changesReports'][0] + ): array + { + $request = $this->changesReportsRequest($employerId, $fromDate, $toDate, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation changesReportsAsync + * + * Gets audit changes of all employees within a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesReportsAsync( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['changesReports'][0] + ): PromiseInterface + { + return $this->changesReportsAsyncWithHttpInfo($employerId, $fromDate, $toDate, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation changesReportsAsyncWithHttpInfo + * + * Gets audit changes of all employees within a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function changesReportsAsyncWithHttpInfo( + $employerId, + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['changesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse'; + $request = $this->changesReportsRequest($employerId, $fromDate, $toDate, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'changesReports' + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function changesReportsRequest( + $employerId, + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['changesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling changesReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/changes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromDate, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toDate, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cis300Reports + * + * CIS300 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id The Id of CIS300. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cis300Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Cis300ReportResponse + */ + public function cis300Reports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['cis300Reports'][0] + ): \SynergiTech\Staffology\Model\Cis300ReportResponse + { + list($response) = $this->cis300ReportsWithHttpInfo($employerId, $taxYear, $id, $accept, $contentType); + return $response; + } + + /** + * Operation cis300ReportsWithHttpInfo + * + * CIS300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of CIS300. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cis300Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Cis300ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function cis300ReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['cis300Reports'][0] + ): array + { + $request = $this->cis300ReportsRequest($employerId, $taxYear, $id, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Cis300ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Cis300ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Cis300ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Cis300ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Cis300ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cis300ReportsAsync + * + * CIS300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of CIS300. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cis300Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cis300ReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['cis300Reports'][0] + ): PromiseInterface + { + return $this->cis300ReportsAsyncWithHttpInfo($employerId, $taxYear, $id, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cis300ReportsAsyncWithHttpInfo + * + * CIS300 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of CIS300. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cis300Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cis300ReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $accept = null, + string $contentType = self::contentTypes['cis300Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Cis300ReportResponse'; + $request = $this->cis300ReportsRequest($employerId, $taxYear, $id, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cis300Reports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of CIS300. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cis300Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cis300ReportsRequest( + $employerId, + $taxYear, + $id, + $accept = null, + string $contentType = self::contentTypes['cis300Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling cis300Reports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling cis300Reports' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling cis300Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/cis300/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cisStatementReports + * + * CIS Statement + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int $taxMonth taxMonth (required) + * @param string|null $employeeId Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisStatementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisStatementListReportResponse + */ + public function cisStatementReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['cisStatementReports'][0] + ): \SynergiTech\Staffology\Model\CisStatementListReportResponse + { + list($response) = $this->cisStatementReportsWithHttpInfo($employerId, $taxYear, $taxMonth, $employeeId, $accept, $contentType); + return $response; + } + + /** + * Operation cisStatementReportsWithHttpInfo + * + * CIS Statement + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string|null $employeeId Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisStatementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisStatementListReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function cisStatementReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['cisStatementReports'][0] + ): array + { + $request = $this->cisStatementReportsRequest($employerId, $taxYear, $taxMonth, $employeeId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisStatementListReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisStatementListReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisStatementListReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisStatementListReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisStatementListReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cisStatementReportsAsync + * + * CIS Statement + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string|null $employeeId Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cisStatementReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $taxMonth, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['cisStatementReports'][0] + ): PromiseInterface + { + return $this->cisStatementReportsAsyncWithHttpInfo($employerId, $taxYear, $taxMonth, $employeeId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cisStatementReportsAsyncWithHttpInfo + * + * CIS Statement + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string|null $employeeId Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cisStatementReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $taxMonth, + $employeeId = null, + $accept = null, + string $contentType = self::contentTypes['cisStatementReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisStatementListReportResponse'; + $request = $this->cisStatementReportsRequest($employerId, $taxYear, $taxMonth, $employeeId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cisStatementReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $taxMonth (required) + * @param string|null $employeeId Specify an employeeId to get a single statement. If you don't provide a value then all Subcontractors will be included. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisStatementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cisStatementReportsRequest( + $employerId, + $taxYear, + $taxMonth, + $employeeId = null, + $accept = null, + string $contentType = self::contentTypes['cisStatementReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling cisStatementReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling cisStatementReports' + ); + } + + // verify the required parameter 'taxMonth' is set + if ($taxMonth === null || (is_array($taxMonth) && count($taxMonth) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxMonth when calling cisStatementReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/cisstatement/{taxMonth}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($taxMonth !== null) { + $resourcePath = str_replace( + '{' . 'taxMonth' . '}', + ObjectSerializer::toPathValue($taxMonth), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cisSubContractorSummaryReports + * + * CIS Subcontractor Summary + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisSubContractorSummaryReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse + */ + public function cisSubContractorSummaryReports( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['cisSubContractorSummaryReports'][0] + ): \SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse + { + list($response) = $this->cisSubContractorSummaryReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation cisSubContractorSummaryReportsWithHttpInfo + * + * CIS Subcontractor Summary + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisSubContractorSummaryReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function cisSubContractorSummaryReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['cisSubContractorSummaryReports'][0] + ): array + { + $request = $this->cisSubContractorSummaryReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cisSubContractorSummaryReportsAsync + * + * CIS Subcontractor Summary + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisSubContractorSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cisSubContractorSummaryReportsAsync( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['cisSubContractorSummaryReports'][0] + ): PromiseInterface + { + return $this->cisSubContractorSummaryReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cisSubContractorSummaryReportsAsyncWithHttpInfo + * + * CIS Subcontractor Summary + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisSubContractorSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function cisSubContractorSummaryReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + string $contentType = self::contentTypes['cisSubContractorSummaryReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CisSubContractorSummaryListReportResponse'; + $request = $this->cisSubContractorSummaryReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cisSubContractorSummaryReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cisSubContractorSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cisSubContractorSummaryReportsRequest( + $employerId, + $accept = null, + string $contentType = self::contentTypes['cisSubContractorSummaryReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling cisSubContractorSummaryReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/cissummary'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'text/html', 'text/csv', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation costAnalysisReports + * + * Cost Analysis + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costAnalysisReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostAnalysisReportReportResponse + */ + public function costAnalysisReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costAnalysisReports'][0] + ): \SynergiTech\Staffology\Model\CostAnalysisReportReportResponse + { + list($response) = $this->costAnalysisReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation costAnalysisReportsWithHttpInfo + * + * Cost Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costAnalysisReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostAnalysisReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function costAnalysisReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costAnalysisReports'][0] + ): array + { + $request = $this->costAnalysisReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation costAnalysisReportsAsync + * + * Cost Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costAnalysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function costAnalysisReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costAnalysisReports'][0] + ): PromiseInterface + { + return $this->costAnalysisReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation costAnalysisReportsAsyncWithHttpInfo + * + * Cost Analysis + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costAnalysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function costAnalysisReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['costAnalysisReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostAnalysisReportReportResponse'; + $request = $this->costAnalysisReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'costAnalysisReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costAnalysisReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function costAnalysisReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['costAnalysisReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling costAnalysisReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling costAnalysisReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling costAnalysisReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/costanalysis'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation costOfEmploymentReports + * + * Cost Of Employment + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costOfEmploymentReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse + */ + public function costOfEmploymentReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costOfEmploymentReports'][0] + ): \SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse + { + list($response) = $this->costOfEmploymentReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation costOfEmploymentReportsWithHttpInfo + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costOfEmploymentReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function costOfEmploymentReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costOfEmploymentReports'][0] + ): array + { + $request = $this->costOfEmploymentReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation costOfEmploymentReportsAsync + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costOfEmploymentReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function costOfEmploymentReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['costOfEmploymentReports'][0] + ): PromiseInterface + { + return $this->costOfEmploymentReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation costOfEmploymentReportsAsyncWithHttpInfo + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costOfEmploymentReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function costOfEmploymentReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['costOfEmploymentReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\CostOfEmploymentReportReportResponse'; + $request = $this->costOfEmploymentReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'costOfEmploymentReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['costOfEmploymentReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function costOfEmploymentReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['costOfEmploymentReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling costOfEmploymentReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling costOfEmploymentReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling costOfEmploymentReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/costofemployment'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation downloadMaternitySchedulesReports + * + * Download Maternity Payment Schedule + * + * @param string $employerId employerId (required) + * @param string|null $employeeId employeeId (optional) + * @param string|null $id id (optional) + * @param \SynergiTech\Staffology\Model\Leave|null $leave leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadMaternitySchedulesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function downloadMaternitySchedulesReports( + string $employerId, + ?string $employeeId = null, + ?string $id = null, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['downloadMaternitySchedulesReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->downloadMaternitySchedulesReportsWithHttpInfo($employerId, $employeeId, $id, $leave, $contentType); + return $response; + } + + /** + * Operation downloadMaternitySchedulesReportsWithHttpInfo + * + * Download Maternity Payment Schedule + * + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $id (optional) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadMaternitySchedulesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadMaternitySchedulesReportsWithHttpInfo( + string $employerId, + ?string $employeeId = null, + ?string $id = null, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['downloadMaternitySchedulesReports'][0] + ): array + { + $request = $this->downloadMaternitySchedulesReportsRequest($employerId, $employeeId, $id, $leave, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadMaternitySchedulesReportsAsync + * + * Download Maternity Payment Schedule + * + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $id (optional) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadMaternitySchedulesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function downloadMaternitySchedulesReportsAsync( + string $employerId, + ?string $employeeId = null, + ?string $id = null, + ?\SynergiTech\Staffology\Model\Leave $leave = null, + string $contentType = self::contentTypes['downloadMaternitySchedulesReports'][0] + ): PromiseInterface + { + return $this->downloadMaternitySchedulesReportsAsyncWithHttpInfo($employerId, $employeeId, $id, $leave, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadMaternitySchedulesReportsAsyncWithHttpInfo + * + * Download Maternity Payment Schedule + * + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $id (optional) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadMaternitySchedulesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function downloadMaternitySchedulesReportsAsyncWithHttpInfo( + $employerId, + $employeeId = null, + $id = null, + $leave = null, + string $contentType = self::contentTypes['downloadMaternitySchedulesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->downloadMaternitySchedulesReportsRequest($employerId, $employeeId, $id, $leave, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadMaternitySchedulesReports' + * + * @param string $employerId (required) + * @param string|null $employeeId (optional) + * @param string|null $id (optional) + * @param \SynergiTech\Staffology\Model\Leave|null $leave (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadMaternitySchedulesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function downloadMaternitySchedulesReportsRequest( + $employerId, + $employeeId = null, + $id = null, + $leave = null, + string $contentType = self::contentTypes['downloadMaternitySchedulesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling downloadMaternitySchedulesReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/downloadmaternityschedules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($leave)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($leave)); + } else { + $httpBody = $leave; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailP11DMultipleReports + * + * Email P11D to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param bool|null $excludeEmployeesWithP11DEmailSent Exclude Employees with Already Sent P11D Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailP11DMultipleReports( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP11DEmailSent = false, + string $contentType = self::contentTypes['emailP11DMultipleReports'][0] + ): void + { + $this->emailP11DMultipleReportsWithHttpInfo($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent, $contentType); + } + + /** + * Operation emailP11DMultipleReportsWithHttpInfo + * + * Email P11D to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param bool|null $excludeEmployeesWithP11DEmailSent Exclude Employees with Already Sent P11D Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailP11DMultipleReportsWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP11DEmailSent = false, + string $contentType = self::contentTypes['emailP11DMultipleReports'][0] + ): array + { + $request = $this->emailP11DMultipleReportsRequest($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailP11DMultipleReportsAsync + * + * Email P11D to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param bool|null $excludeEmployeesWithP11DEmailSent Exclude Employees with Already Sent P11D Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP11DMultipleReportsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP11DEmailSent = false, + string $contentType = self::contentTypes['emailP11DMultipleReports'][0] + ): PromiseInterface + { + return $this->emailP11DMultipleReportsAsyncWithHttpInfo($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailP11DMultipleReportsAsyncWithHttpInfo + * + * Email P11D to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param bool|null $excludeEmployeesWithP11DEmailSent Exclude Employees with Already Sent P11D Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP11DMultipleReportsAsyncWithHttpInfo( + $employerId, + $taxYear = null, + $excludeEmployeesWithP11DEmailSent = false, + string $contentType = self::contentTypes['emailP11DMultipleReports'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailP11DMultipleReportsRequest($employerId, $taxYear, $excludeEmployeesWithP11DEmailSent, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailP11DMultipleReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param bool|null $excludeEmployeesWithP11DEmailSent Exclude Employees with Already Sent P11D Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailP11DMultipleReportsRequest( + $employerId, + $taxYear = null, + $excludeEmployeesWithP11DEmailSent = false, + string $contentType = self::contentTypes['emailP11DMultipleReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailP11DMultipleReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/p11d/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $excludeEmployeesWithP11DEmailSent, + 'excludeEmployeesWithP11DEmailSent', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailP11DReports + * + * Email P11D to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P11D to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailP11DReports( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP11DReports'][0] + ): void + { + $this->emailP11DReportsWithHttpInfo($employerId, $employeeId, $taxYear, $contentType); + } + + /** + * Operation emailP11DReportsWithHttpInfo + * + * Email P11D to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P11D to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailP11DReportsWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP11DReports'][0] + ): array + { + $request = $this->emailP11DReportsRequest($employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailP11DReportsAsync + * + * Email P11D to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P11D to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP11DReportsAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP11DReports'][0] + ): PromiseInterface + { + return $this->emailP11DReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailP11DReportsAsyncWithHttpInfo + * + * Email P11D to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P11D to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP11DReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear = null, + string $contentType = self::contentTypes['emailP11DReports'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailP11DReportsRequest($employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailP11DReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P11D to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P11Ds for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailP11DReportsRequest( + $employerId, + $employeeId, + $taxYear = null, + string $contentType = self::contentTypes['emailP11DReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailP11DReports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling emailP11DReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/p11d/email/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailP45Reports + * + * Email P45 to Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want the email a P45 to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP45Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailP45Reports( + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['emailP45Reports'][0] + ): void + { + $this->emailP45ReportsWithHttpInfo($employerId, $employeeId, $contentType); + } + + /** + * Operation emailP45ReportsWithHttpInfo + * + * Email P45 to Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want the email a P45 to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP45Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailP45ReportsWithHttpInfo( + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['emailP45Reports'][0] + ): array + { + $request = $this->emailP45ReportsRequest($employerId, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailP45ReportsAsync + * + * Email P45 to Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want the email a P45 to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP45ReportsAsync( + string $employerId, + ?string $employeeId = null, + string $contentType = self::contentTypes['emailP45Reports'][0] + ): PromiseInterface + { + return $this->emailP45ReportsAsyncWithHttpInfo($employerId, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailP45ReportsAsyncWithHttpInfo + * + * Email P45 to Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want the email a P45 to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP45ReportsAsyncWithHttpInfo( + $employerId, + $employeeId = null, + string $contentType = self::contentTypes['emailP45Reports'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailP45ReportsRequest($employerId, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailP45Reports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want the email a P45 to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailP45ReportsRequest( + $employerId, + $employeeId = null, + string $contentType = self::contentTypes['emailP45Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailP45Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/p45/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailP60MultipleReports + * + * Email P60 to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60MultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailP60MultipleReports( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['emailP60MultipleReports'][0] + ): void + { + $this->emailP60MultipleReportsWithHttpInfo($employerId, $taxYear, $excludeEmployeesWithP60EmailSent, $contentType); + } + + /** + * Operation emailP60MultipleReportsWithHttpInfo + * + * Email P60 to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60MultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailP60MultipleReportsWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['emailP60MultipleReports'][0] + ): array + { + $request = $this->emailP60MultipleReportsRequest($employerId, $taxYear, $excludeEmployeesWithP60EmailSent, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailP60MultipleReportsAsync + * + * Email P60 to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP60MultipleReportsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['emailP60MultipleReports'][0] + ): PromiseInterface + { + return $this->emailP60MultipleReportsAsyncWithHttpInfo($employerId, $taxYear, $excludeEmployeesWithP60EmailSent, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailP60MultipleReportsAsyncWithHttpInfo + * + * Email P60 to all Employees + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP60MultipleReportsAsyncWithHttpInfo( + $employerId, + $taxYear = null, + $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['emailP60MultipleReports'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailP60MultipleReportsRequest($employerId, $taxYear, $excludeEmployeesWithP60EmailSent, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailP60MultipleReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailP60MultipleReportsRequest( + $employerId, + $taxYear = null, + $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['emailP60MultipleReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailP60MultipleReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/p60/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $excludeEmployeesWithP60EmailSent, + 'excludeEmployeesWithP60EmailSent', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailP60Reports + * + * Email P60 to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P60 to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function emailP60Reports( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP60Reports'][0] + ): void + { + $this->emailP60ReportsWithHttpInfo($employerId, $employeeId, $taxYear, $contentType); + } + + /** + * Operation emailP60ReportsWithHttpInfo + * + * Email P60 to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P60 to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function emailP60ReportsWithHttpInfo( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP60Reports'][0] + ): array + { + $request = $this->emailP60ReportsRequest($employerId, $employeeId, $taxYear, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation emailP60ReportsAsync + * + * Email P60 to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P60 to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP60ReportsAsync( + string $employerId, + string $employeeId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + string $contentType = self::contentTypes['emailP60Reports'][0] + ): PromiseInterface + { + return $this->emailP60ReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailP60ReportsAsyncWithHttpInfo + * + * Email P60 to an Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P60 to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function emailP60ReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear = null, + string $contentType = self::contentTypes['emailP60Reports'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->emailP60ReportsRequest($employerId, $employeeId, $taxYear, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailP60Reports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee you want the email a P60 to. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear The TaxYear you want P60s for. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['emailP60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function emailP60ReportsRequest( + $employerId, + $employeeId, + $taxYear = null, + string $contentType = self::contentTypes['emailP60Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling emailP60Reports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling emailP60Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/p60/email/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeBenefitsReports + * + * Employee Benefits + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $reportType reportType (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeBenefitsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse + */ + public function employeeBenefitsReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $reportType = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeBenefitsReports'][0] + ): \SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse + { + list($response) = $this->employeeBenefitsReportsWithHttpInfo($employerId, $taxYear, $reportType, $accept, $contentType); + return $response; + } + + /** + * Operation employeeBenefitsReportsWithHttpInfo + * + * Employee Benefits + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $reportType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeBenefitsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeBenefitsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $reportType = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeBenefitsReports'][0] + ): array + { + $request = $this->employeeBenefitsReportsRequest($employerId, $taxYear, $reportType, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeBenefitsReportsAsync + * + * Employee Benefits + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $reportType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeBenefitsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeBenefitsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $reportType = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeBenefitsReports'][0] + ): PromiseInterface + { + return $this->employeeBenefitsReportsAsyncWithHttpInfo($employerId, $taxYear, $reportType, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeBenefitsReportsAsyncWithHttpInfo + * + * Employee Benefits + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $reportType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeBenefitsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeBenefitsReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $reportType = null, + $accept = null, + string $contentType = self::contentTypes['employeeBenefitsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeBenefitsReportReportResponse'; + $request = $this->employeeBenefitsReportsRequest($employerId, $taxYear, $reportType, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeBenefitsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $reportType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeBenefitsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeBenefitsReportsRequest( + $employerId, + $taxYear, + $reportType = null, + $accept = null, + string $contentType = self::contentTypes['employeeBenefitsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeeBenefitsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling employeeBenefitsReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/EmployeeBenefits'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $reportType, + 'reportType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeExportReports + * + * Employee Export Details + * + * @param string|null $employerId employerId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param bool|null $includeBankAccountDetails includeBankAccountDetails (optional) + * @param bool|null $includeYtd includeYtd (optional) + * @param bool|null $incPensionInfo incPensionInfo (optional) + * @param bool|null $includePayInfo includePayInfo (optional) + * @param bool|null $includeNotes includeNotes (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function employeeExportReports( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $includeBankAccountDetails = null, + ?bool $includeYtd = null, + ?bool $incPensionInfo = null, + ?bool $includePayInfo = null, + ?bool $includeNotes = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeExportReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->employeeExportReportsWithHttpInfo($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept, $contentType); + return $response; + } + + /** + * Operation employeeExportReportsWithHttpInfo + * + * Employee Export Details + * + * @param string|null $employerId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $includeBankAccountDetails (optional) + * @param bool|null $includeYtd (optional) + * @param bool|null $incPensionInfo (optional) + * @param bool|null $includePayInfo (optional) + * @param bool|null $includeNotes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeExportReportsWithHttpInfo( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $includeBankAccountDetails = null, + ?bool $includeYtd = null, + ?bool $incPensionInfo = null, + ?bool $includePayInfo = null, + ?bool $includeNotes = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeExportReports'][0] + ): array + { + $request = $this->employeeExportReportsRequest($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeExportReportsAsync + * + * Employee Export Details + * + * @param string|null $employerId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $includeBankAccountDetails (optional) + * @param bool|null $includeYtd (optional) + * @param bool|null $incPensionInfo (optional) + * @param bool|null $includePayInfo (optional) + * @param bool|null $includeNotes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeExportReportsAsync( + ?string $employerId = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?bool $includeBankAccountDetails = null, + ?bool $includeYtd = null, + ?bool $incPensionInfo = null, + ?bool $includePayInfo = null, + ?bool $includeNotes = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeExportReports'][0] + ): PromiseInterface + { + return $this->employeeExportReportsAsyncWithHttpInfo($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeExportReportsAsyncWithHttpInfo + * + * Employee Export Details + * + * @param string|null $employerId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $includeBankAccountDetails (optional) + * @param bool|null $includeYtd (optional) + * @param bool|null $incPensionInfo (optional) + * @param bool|null $includePayInfo (optional) + * @param bool|null $includeNotes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeExportReportsAsyncWithHttpInfo( + $employerId = null, + $taxYear = null, + $includeBankAccountDetails = null, + $includeYtd = null, + $incPensionInfo = null, + $includePayInfo = null, + $includeNotes = null, + $accept = null, + string $contentType = self::contentTypes['employeeExportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->employeeExportReportsRequest($employerId, $taxYear, $includeBankAccountDetails, $includeYtd, $incPensionInfo, $includePayInfo, $includeNotes, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeExportReports' + * + * @param string|null $employerId (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param bool|null $includeBankAccountDetails (optional) + * @param bool|null $includeYtd (optional) + * @param bool|null $incPensionInfo (optional) + * @param bool|null $includePayInfo (optional) + * @param bool|null $includeNotes (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeExportReportsRequest( + $employerId = null, + $taxYear = null, + $includeBankAccountDetails = null, + $includeYtd = null, + $incPensionInfo = null, + $includePayInfo = null, + $includeNotes = null, + $accept = null, + string $contentType = self::contentTypes['employeeExportReports'][0] + ): Request + { + + + + + + + + + + + $resourcePath = '/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeBankAccountDetails, + 'includeBankAccountDetails', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeYtd, + 'includeYtd', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incPensionInfo, + 'incPensionInfo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includePayInfo, + 'includePayInfo', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeNotes, + 'includeNotes', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeLeaveReports + * + * Employee Leave + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLeaveReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse + */ + public function employeeLeaveReports( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeLeaveReports'][0] + ): \SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse + { + list($response) = $this->employeeLeaveReportsWithHttpInfo($employerId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation employeeLeaveReportsWithHttpInfo + * + * Employee Leave + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLeaveReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeLeaveReportsWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeLeaveReports'][0] + ): array + { + $request = $this->employeeLeaveReportsRequest($employerId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeLeaveReportsAsync + * + * Employee Leave + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLeaveReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeLeaveReportsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\TaxYear $taxYear = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeLeaveReports'][0] + ): PromiseInterface + { + return $this->employeeLeaveReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeLeaveReportsAsyncWithHttpInfo + * + * Employee Leave + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLeaveReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeLeaveReportsAsyncWithHttpInfo( + $employerId, + $taxYear = null, + $accept = null, + string $contentType = self::contentTypes['employeeLeaveReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployeeLeaveReportReportResponse'; + $request = $this->employeeLeaveReportsRequest($employerId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeLeaveReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeLeaveReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeLeaveReportsRequest( + $employerId, + $taxYear = null, + $accept = null, + string $contentType = self::contentTypes['employeeLeaveReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employeeLeaveReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/employeeleave'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYear, + 'taxYear', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employeeRoleExportReports + * + * Employee Export Roles Details + * + * @param string|null $employerId employerId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeRoleExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function employeeRoleExportReports( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeRoleExportReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->employeeRoleExportReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation employeeRoleExportReportsWithHttpInfo + * + * Employee Export Roles Details + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeRoleExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employeeRoleExportReportsWithHttpInfo( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeRoleExportReports'][0] + ): array + { + $request = $this->employeeRoleExportReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employeeRoleExportReportsAsync + * + * Employee Export Roles Details + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeRoleExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeRoleExportReportsAsync( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['employeeRoleExportReports'][0] + ): PromiseInterface + { + return $this->employeeRoleExportReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employeeRoleExportReportsAsyncWithHttpInfo + * + * Employee Export Roles Details + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeRoleExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employeeRoleExportReportsAsyncWithHttpInfo( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['employeeRoleExportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->employeeRoleExportReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employeeRoleExportReports' + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employeeRoleExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employeeRoleExportReportsRequest( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['employeeRoleExportReports'][0] + ): Request + { + + + + + $resourcePath = '/employeeroles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employerChangesReports + * + * Gets audit changes for a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate fromDate (optional) + * @param \DateTime|null $toDate toDate (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerChangesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse + */ + public function employerChangesReports( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['employerChangesReports'][0] + ): \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse + { + list($response) = $this->employerChangesReportsWithHttpInfo($employerId, $fromDate, $toDate, $accept, $contentType); + return $response; + } + + /** + * Operation employerChangesReportsWithHttpInfo + * + * Gets audit changes for a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerChangesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ChangeSummaryListReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employerChangesReportsWithHttpInfo( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['employerChangesReports'][0] + ): array + { + $request = $this->employerChangesReportsRequest($employerId, $fromDate, $toDate, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employerChangesReportsAsync + * + * Gets audit changes for a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerChangesReportsAsync( + string $employerId, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + string $contentType = self::contentTypes['employerChangesReports'][0] + ): PromiseInterface + { + return $this->employerChangesReportsAsyncWithHttpInfo($employerId, $fromDate, $toDate, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerChangesReportsAsyncWithHttpInfo + * + * Gets audit changes for a company. + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerChangesReportsAsyncWithHttpInfo( + $employerId, + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['employerChangesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ChangeSummaryListReportResponse'; + $request = $this->employerChangesReportsRequest($employerId, $fromDate, $toDate, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerChangesReports' + * + * @param string $employerId The Id of any employer to which you have access. (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerChangesReportsRequest( + $employerId, + $fromDate = null, + $toDate = null, + $accept = null, + string $contentType = self::contentTypes['employerChangesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employerChangesReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/employerchanges'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromDate, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toDate, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employerExportReports + * + * Employer Export + * + * @param string $employerId The Id of any employer to which you have access. It wont affect the report results. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function employerExportReports( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['employerExportReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->employerExportReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation employerExportReportsWithHttpInfo + * + * Employer Export + * + * @param string $employerId The Id of any employer to which you have access. It wont affect the report results. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function employerExportReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['employerExportReports'][0] + ): array + { + $request = $this->employerExportReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employerExportReportsAsync + * + * Employer Export + * + * @param string $employerId The Id of any employer to which you have access. It wont affect the report results. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerExportReportsAsync( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['employerExportReports'][0] + ): PromiseInterface + { + return $this->employerExportReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerExportReportsAsyncWithHttpInfo + * + * Employer Export + * + * @param string $employerId The Id of any employer to which you have access. It wont affect the report results. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerExportReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + string $contentType = self::contentTypes['employerExportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->employerExportReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerExportReports' + * + * @param string $employerId The Id of any employer to which you have access. It wont affect the report results. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerExportReportsRequest( + $employerId, + $accept = null, + string $contentType = self::contentTypes['employerExportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employerExportReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation examplePayslipReports + * + * Example Payslip + * + * @param string|null $employerId employerId (optional) + * @param string|null $accept accept (optional) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation Your PayslipCustomisation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['examplePayslipReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function examplePayslipReports( + ?string $employerId = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['examplePayslipReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->examplePayslipReportsWithHttpInfo($employerId, $accept, $payslipCustomisation, $contentType); + return $response; + } + + /** + * Operation examplePayslipReportsWithHttpInfo + * + * Example Payslip + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation Your PayslipCustomisation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['examplePayslipReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function examplePayslipReportsWithHttpInfo( + ?string $employerId = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['examplePayslipReports'][0] + ): array + { + $request = $this->examplePayslipReportsRequest($employerId, $accept, $payslipCustomisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation examplePayslipReportsAsync + * + * Example Payslip + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation Your PayslipCustomisation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['examplePayslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function examplePayslipReportsAsync( + ?string $employerId = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\PayslipCustomisation $payslipCustomisation = null, + string $contentType = self::contentTypes['examplePayslipReports'][0] + ): PromiseInterface + { + return $this->examplePayslipReportsAsyncWithHttpInfo($employerId, $accept, $payslipCustomisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation examplePayslipReportsAsyncWithHttpInfo + * + * Example Payslip + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation Your PayslipCustomisation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['examplePayslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function examplePayslipReportsAsyncWithHttpInfo( + $employerId = null, + $accept = null, + $payslipCustomisation = null, + string $contentType = self::contentTypes['examplePayslipReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->examplePayslipReportsRequest($employerId, $accept, $payslipCustomisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'examplePayslipReports' + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\PayslipCustomisation|null $payslipCustomisation Your PayslipCustomisation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['examplePayslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function examplePayslipReportsRequest( + $employerId = null, + $accept = null, + $payslipCustomisation = null, + string $contentType = self::contentTypes['examplePayslipReports'][0] + ): Request + { + + + + + + $resourcePath = '/payslip/example/pdf'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payslipCustomisation)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payslipCustomisation)); + } else { + $httpBody = $payslipCustomisation; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation exbReports + * + * EXB + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id The Id of EXB. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exbReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ExbReportResponse + */ + public function exbReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['exbReports'][0] + ): \SynergiTech\Staffology\Model\ExbReportResponse + { + list($response) = $this->exbReportsWithHttpInfo($employerId, $taxYear, $id, $accept, $contentType); + return $response; + } + + /** + * Operation exbReportsWithHttpInfo + * + * EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of EXB. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exbReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ExbReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function exbReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['exbReports'][0] + ): array + { + $request = $this->exbReportsRequest($employerId, $taxYear, $id, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ExbReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ExbReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ExbReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ExbReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ExbReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exbReportsAsync + * + * EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of EXB. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exbReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function exbReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + string $contentType = self::contentTypes['exbReports'][0] + ): PromiseInterface + { + return $this->exbReportsAsyncWithHttpInfo($employerId, $taxYear, $id, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exbReportsAsyncWithHttpInfo + * + * EXB + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of EXB. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exbReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function exbReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $accept = null, + string $contentType = self::contentTypes['exbReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ExbReportResponse'; + $request = $this->exbReportsRequest($employerId, $taxYear, $id, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'exbReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of EXB. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exbReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function exbReportsRequest( + $employerId, + $taxYear, + $id, + $accept = null, + string $contentType = self::contentTypes['exbReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling exbReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling exbReports' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling exbReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/exb/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fpsReports + * + * FPS + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id The Id of FPS. (required) + * @param bool|null $incAllEmployees If true, then any employees that were paid earlier in the year but not on this FPS will also be included (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fpsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\FpsReportResponse + */ + public function fpsReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $incAllEmployees = null, + ?string $accept = null, + string $contentType = self::contentTypes['fpsReports'][0] + ): \SynergiTech\Staffology\Model\FpsReportResponse + { + list($response) = $this->fpsReportsWithHttpInfo($employerId, $taxYear, $id, $incAllEmployees, $accept, $contentType); + return $response; + } + + /** + * Operation fpsReportsWithHttpInfo + * + * FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of FPS. (required) + * @param bool|null $incAllEmployees If true, then any employees that were paid earlier in the year but not on this FPS will also be included (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fpsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\FpsReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function fpsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $incAllEmployees = null, + ?string $accept = null, + string $contentType = self::contentTypes['fpsReports'][0] + ): array + { + $request = $this->fpsReportsRequest($employerId, $taxYear, $id, $incAllEmployees, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\FpsReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\FpsReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\FpsReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\FpsReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\FpsReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fpsReportsAsync + * + * FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of FPS. (required) + * @param bool|null $incAllEmployees If true, then any employees that were paid earlier in the year but not on this FPS will also be included (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fpsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function fpsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?bool $incAllEmployees = null, + ?string $accept = null, + string $contentType = self::contentTypes['fpsReports'][0] + ): PromiseInterface + { + return $this->fpsReportsAsyncWithHttpInfo($employerId, $taxYear, $id, $incAllEmployees, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fpsReportsAsyncWithHttpInfo + * + * FPS + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of FPS. (required) + * @param bool|null $incAllEmployees If true, then any employees that were paid earlier in the year but not on this FPS will also be included (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fpsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function fpsReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $id, + $incAllEmployees = null, + $accept = null, + string $contentType = self::contentTypes['fpsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\FpsReportResponse'; + $request = $this->fpsReportsRequest($employerId, $taxYear, $id, $incAllEmployees, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fpsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of FPS. (required) + * @param bool|null $incAllEmployees If true, then any employees that were paid earlier in the year but not on this FPS will also be included (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fpsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fpsReportsRequest( + $employerId, + $taxYear, + $id, + $incAllEmployees = null, + $accept = null, + string $contentType = self::contentTypes['fpsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling fpsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling fpsReports' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling fpsReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/fps/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $incAllEmployees, + 'incAllEmployees', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fullSummaryOfPayReports + * + * Cost Of Employment + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $period period (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fullSummaryOfPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse + */ + public function fullSummaryOfPayReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['fullSummaryOfPayReports'][0] + ): \SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse + { + list($response) = $this->fullSummaryOfPayReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation fullSummaryOfPayReportsWithHttpInfo + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fullSummaryOfPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function fullSummaryOfPayReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['fullSummaryOfPayReports'][0] + ): array + { + $request = $this->fullSummaryOfPayReportsRequest($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fullSummaryOfPayReportsAsync + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fullSummaryOfPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function fullSummaryOfPayReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $period = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['fullSummaryOfPayReports'][0] + ): PromiseInterface + { + return $this->fullSummaryOfPayReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fullSummaryOfPayReportsAsyncWithHttpInfo + * + * Cost Of Employment + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fullSummaryOfPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function fullSummaryOfPayReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $period = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['fullSummaryOfPayReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\FullSummaryOfPayReportReportResponse'; + $request = $this->fullSummaryOfPayReportsRequest($employerId, $payPeriod, $taxYear, $period, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fullSummaryOfPayReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $period (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fullSummaryOfPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fullSummaryOfPayReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $period = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['fullSummaryOfPayReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling fullSummaryOfPayReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling fullSummaryOfPayReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling fullSummaryOfPayReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/fullsummaryofpay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $period, + 'period', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation furloughReportReports + * + * FurloughReport + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int $periodNumber periodNumber (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['furloughReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\FurloughReportReportResponse + */ + public function furloughReportReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['furloughReportReports'][0] + ): \SynergiTech\Staffology\Model\FurloughReportReportResponse + { + list($response) = $this->furloughReportReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation furloughReportReportsWithHttpInfo + * + * FurloughReport + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['furloughReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\FurloughReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function furloughReportReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['furloughReportReports'][0] + ): array + { + $request = $this->furloughReportReportsRequest($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\FurloughReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\FurloughReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\FurloughReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\FurloughReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\FurloughReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation furloughReportReportsAsync + * + * FurloughReport + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['furloughReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function furloughReportReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['furloughReportReports'][0] + ): PromiseInterface + { + return $this->furloughReportReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation furloughReportReportsAsyncWithHttpInfo + * + * FurloughReport + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['furloughReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function furloughReportReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['furloughReportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\FurloughReportReportResponse'; + $request = $this->furloughReportReportsRequest($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'furloughReportReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['furloughReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function furloughReportReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['furloughReportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling furloughReportReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling furloughReportReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling furloughReportReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling furloughReportReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/furlough'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation genderPayGapReports + * + * Gender Pay Gap + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate|null $genderPayGapSnapShotDate genderPayGapSnapShotDate (optional) + * @param string|null $ordinaryPayCodeSetId ordinaryPayCodeSetId (optional) + * @param string|null $bonusPayCodeSetId bonusPayCodeSetId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['genderPayGapReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\GenderPayGapReportReportResponse + */ + public function genderPayGapReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\GenderPayGapSnapShotDate $genderPayGapSnapShotDate = null, + ?string $ordinaryPayCodeSetId = null, + ?string $bonusPayCodeSetId = null, + ?string $accept = null, + string $contentType = self::contentTypes['genderPayGapReports'][0] + ): \SynergiTech\Staffology\Model\GenderPayGapReportReportResponse + { + list($response) = $this->genderPayGapReportsWithHttpInfo($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept, $contentType); + return $response; + } + + /** + * Operation genderPayGapReportsWithHttpInfo + * + * Gender Pay Gap + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate|null $genderPayGapSnapShotDate (optional) + * @param string|null $ordinaryPayCodeSetId (optional) + * @param string|null $bonusPayCodeSetId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['genderPayGapReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\GenderPayGapReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function genderPayGapReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\GenderPayGapSnapShotDate $genderPayGapSnapShotDate = null, + ?string $ordinaryPayCodeSetId = null, + ?string $bonusPayCodeSetId = null, + ?string $accept = null, + string $contentType = self::contentTypes['genderPayGapReports'][0] + ): array + { + $request = $this->genderPayGapReportsRequest($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation genderPayGapReportsAsync + * + * Gender Pay Gap + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate|null $genderPayGapSnapShotDate (optional) + * @param string|null $ordinaryPayCodeSetId (optional) + * @param string|null $bonusPayCodeSetId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['genderPayGapReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function genderPayGapReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\GenderPayGapSnapShotDate $genderPayGapSnapShotDate = null, + ?string $ordinaryPayCodeSetId = null, + ?string $bonusPayCodeSetId = null, + ?string $accept = null, + string $contentType = self::contentTypes['genderPayGapReports'][0] + ): PromiseInterface + { + return $this->genderPayGapReportsAsyncWithHttpInfo($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation genderPayGapReportsAsyncWithHttpInfo + * + * Gender Pay Gap + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate|null $genderPayGapSnapShotDate (optional) + * @param string|null $ordinaryPayCodeSetId (optional) + * @param string|null $bonusPayCodeSetId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['genderPayGapReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function genderPayGapReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $genderPayGapSnapShotDate = null, + $ordinaryPayCodeSetId = null, + $bonusPayCodeSetId = null, + $accept = null, + string $contentType = self::contentTypes['genderPayGapReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\GenderPayGapReportReportResponse'; + $request = $this->genderPayGapReportsRequest($employerId, $taxYear, $genderPayGapSnapShotDate, $ordinaryPayCodeSetId, $bonusPayCodeSetId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'genderPayGapReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\GenderPayGapSnapShotDate|null $genderPayGapSnapShotDate (optional) + * @param string|null $ordinaryPayCodeSetId (optional) + * @param string|null $bonusPayCodeSetId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['genderPayGapReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function genderPayGapReportsRequest( + $employerId, + $taxYear, + $genderPayGapSnapShotDate = null, + $ordinaryPayCodeSetId = null, + $bonusPayCodeSetId = null, + $accept = null, + string $contentType = self::contentTypes['genderPayGapReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling genderPayGapReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling genderPayGapReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/GenderPayGap'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $genderPayGapSnapShotDate, + 'genderPayGapSnapShotDate', // param base name + 'GenderPayGapSnapShotDate', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinaryPayCodeSetId, + 'ordinaryPayCodeSetId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $bonusPayCodeSetId, + 'bonusPayCodeSetId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayRunCsvReports + * + * Get PayRun CSV + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PayRunCsvType|null $csvType Choose the type of CSV you want to generate (optional) + * @param string|null $mappingId If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly (optional) + * @param string|null $accept accept (optional, default to 'application/json') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunCsvReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getPayRunCsvReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PayRunCsvType $csvType = null, + ?string $mappingId = null, + ?string $accept = 'application/json', + string $contentType = self::contentTypes['getPayRunCsvReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getPayRunCsvReportsWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept, $contentType); + return $response; + } + + /** + * Operation getPayRunCsvReportsWithHttpInfo + * + * Get PayRun CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PayRunCsvType|null $csvType Choose the type of CSV you want to generate (optional) + * @param string|null $mappingId If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly (optional) + * @param string|null $accept (optional, default to 'application/json') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunCsvReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayRunCsvReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PayRunCsvType $csvType = null, + ?string $mappingId = null, + ?string $accept = 'application/json', + string $contentType = self::contentTypes['getPayRunCsvReports'][0] + ): array + { + $request = $this->getPayRunCsvReportsRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayRunCsvReportsAsync + * + * Get PayRun CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PayRunCsvType|null $csvType Choose the type of CSV you want to generate (optional) + * @param string|null $mappingId If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly (optional) + * @param string|null $accept (optional, default to 'application/json') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunCsvReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PayRunCsvType $csvType = null, + ?string $mappingId = null, + ?string $accept = 'application/json', + string $contentType = self::contentTypes['getPayRunCsvReports'][0] + ): PromiseInterface + { + return $this->getPayRunCsvReportsAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayRunCsvReportsAsyncWithHttpInfo + * + * Get PayRun CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PayRunCsvType|null $csvType Choose the type of CSV you want to generate (optional) + * @param string|null $mappingId If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly (optional) + * @param string|null $accept (optional, default to 'application/json') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayRunCsvReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $csvType = null, + $mappingId = null, + $accept = 'application/json', + string $contentType = self::contentTypes['getPayRunCsvReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getPayRunCsvReportsRequest($employerId, $taxYear, $payPeriod, $periodNumber, $ordinal, $csvType, $mappingId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayRunCsvReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PayRunCsvType|null $csvType Choose the type of CSV you want to generate (optional) + * @param string|null $mappingId If you provide the id of a PaymentCsvMapping that is column based then we'll return the CSV formatted accordingly (optional) + * @param string|null $accept (optional, default to 'application/json') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayRunCsvReportsRequest( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $ordinal = 1, + $csvType = null, + $mappingId = null, + $accept = 'application/json', + string $contentType = self::contentTypes['getPayRunCsvReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getPayRunCsvReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling getPayRunCsvReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling getPayRunCsvReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling getPayRunCsvReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payruncsv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $csvType, + 'csvType', // param base name + 'PayRunCsvType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $mappingId, + 'mappingId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation grossToNetReports + * + * Gross To Net + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy Defines the way to sort the data. Defaults to sorting by PayrollCode. (optional) + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $forCis If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['grossToNetReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\GrossToNetReportReportResponse + */ + public function grossToNetReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\ReportSortBy $sortBy = null, + ?bool $sortDescending = null, + ?int $ordinal = 1, + ?bool $forCis = false, + string $contentType = self::contentTypes['grossToNetReports'][0] + ): \SynergiTech\Staffology\Model\GrossToNetReportReportResponse + { + list($response) = $this->grossToNetReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis, $contentType); + return $response; + } + + /** + * Operation grossToNetReportsWithHttpInfo + * + * Gross To Net + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy Defines the way to sort the data. Defaults to sorting by PayrollCode. (optional) + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forCis If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['grossToNetReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\GrossToNetReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function grossToNetReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\ReportSortBy $sortBy = null, + ?bool $sortDescending = null, + ?int $ordinal = 1, + ?bool $forCis = false, + string $contentType = self::contentTypes['grossToNetReports'][0] + ): array + { + $request = $this->grossToNetReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\GrossToNetReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\GrossToNetReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\GrossToNetReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\GrossToNetReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\GrossToNetReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation grossToNetReportsAsync + * + * Gross To Net + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy Defines the way to sort the data. Defaults to sorting by PayrollCode. (optional) + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forCis If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['grossToNetReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function grossToNetReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\ReportSortBy $sortBy = null, + ?bool $sortDescending = null, + ?int $ordinal = 1, + ?bool $forCis = false, + string $contentType = self::contentTypes['grossToNetReports'][0] + ): PromiseInterface + { + return $this->grossToNetReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation grossToNetReportsAsyncWithHttpInfo + * + * Gross To Net + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy Defines the way to sort the data. Defaults to sorting by PayrollCode. (optional) + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forCis If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['grossToNetReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function grossToNetReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $sortBy = null, + $sortDescending = null, + $ordinal = 1, + $forCis = false, + string $contentType = self::contentTypes['grossToNetReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\GrossToNetReportReportResponse'; + $request = $this->grossToNetReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $sortBy, $sortDescending, $ordinal, $forCis, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'grossToNetReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy Defines the way to sort the data. Defaults to sorting by PayrollCode. (optional) + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $forCis If true then CIS Subcontractors are reported on. If all your employees are CIS Subcontractors then this will default to true, otherwise it defaults to false (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['grossToNetReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function grossToNetReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $sortBy = null, + $sortDescending = null, + $ordinal = 1, + $forCis = false, + string $contentType = self::contentTypes['grossToNetReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling grossToNetReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling grossToNetReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling grossToNetReports' + ); + } + + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/gross-to-net'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortBy, + 'sortBy', // param base name + 'ReportSortBy', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortDescending, + 'sortDescending', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $forCis, + 'forCis', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation holidayReports + * + * Holiday + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param bool|null $accruals If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. (optional, default to false) + * @param bool|null $accrualsHrs If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['holidayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\HolidayReportReportResponse + */ + public function holidayReports( + string $employerId, + ?string $accept = null, + ?bool $accruals = false, + ?bool $accrualsHrs = false, + string $contentType = self::contentTypes['holidayReports'][0] + ): \SynergiTech\Staffology\Model\HolidayReportReportResponse + { + list($response) = $this->holidayReportsWithHttpInfo($employerId, $accept, $accruals, $accrualsHrs, $contentType); + return $response; + } + + /** + * Operation holidayReportsWithHttpInfo + * + * Holiday + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param bool|null $accruals If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. (optional, default to false) + * @param bool|null $accrualsHrs If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['holidayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\HolidayReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function holidayReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + ?bool $accruals = false, + ?bool $accrualsHrs = false, + string $contentType = self::contentTypes['holidayReports'][0] + ): array + { + $request = $this->holidayReportsRequest($employerId, $accept, $accruals, $accrualsHrs, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\HolidayReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\HolidayReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\HolidayReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\HolidayReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\HolidayReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation holidayReportsAsync + * + * Holiday + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param bool|null $accruals If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. (optional, default to false) + * @param bool|null $accrualsHrs If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['holidayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function holidayReportsAsync( + string $employerId, + ?string $accept = null, + ?bool $accruals = false, + ?bool $accrualsHrs = false, + string $contentType = self::contentTypes['holidayReports'][0] + ): PromiseInterface + { + return $this->holidayReportsAsyncWithHttpInfo($employerId, $accept, $accruals, $accrualsHrs, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation holidayReportsAsyncWithHttpInfo + * + * Holiday + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param bool|null $accruals If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. (optional, default to false) + * @param bool|null $accrualsHrs If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['holidayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function holidayReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + $accruals = false, + $accrualsHrs = false, + string $contentType = self::contentTypes['holidayReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\HolidayReportReportResponse'; + $request = $this->holidayReportsRequest($employerId, $accept, $accruals, $accrualsHrs, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'holidayReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param bool|null $accruals If set to true then you'll receive a report for holiday pay accruals instead of holiday allowances. Defaults to false. (optional, default to false) + * @param bool|null $accrualsHrs If set to true then you'll receive a report for holiday pay accruals hours. Defaults to false. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['holidayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function holidayReportsRequest( + $employerId, + $accept = null, + $accruals = false, + $accrualsHrs = false, + string $contentType = self::contentTypes['holidayReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling holidayReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/holiday'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $accruals, + 'accruals', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $accrualsHrs, + 'accrualsHrs', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation hourlyPayReports + * + * Hourly Pay + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hourlyPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\HourlyPayReportReportResponse + */ + public function hourlyPayReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['hourlyPayReports'][0] + ): \SynergiTech\Staffology\Model\HourlyPayReportReportResponse + { + list($response) = $this->hourlyPayReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation hourlyPayReportsWithHttpInfo + * + * Hourly Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hourlyPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\HourlyPayReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function hourlyPayReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['hourlyPayReports'][0] + ): array + { + $request = $this->hourlyPayReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\HourlyPayReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\HourlyPayReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\HourlyPayReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\HourlyPayReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\HourlyPayReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation hourlyPayReportsAsync + * + * Hourly Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hourlyPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function hourlyPayReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['hourlyPayReports'][0] + ): PromiseInterface + { + return $this->hourlyPayReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation hourlyPayReportsAsyncWithHttpInfo + * + * Hourly Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hourlyPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function hourlyPayReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['hourlyPayReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\HourlyPayReportReportResponse'; + $request = $this->hourlyPayReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'hourlyPayReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hourlyPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function hourlyPayReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['hourlyPayReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling hourlyPayReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling hourlyPayReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling hourlyPayReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/hourly-pay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation loanBalancesReports + * + * Loan Balances + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loanBalancesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\LoanBalancesReportReportResponse + */ + public function loanBalancesReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['loanBalancesReports'][0] + ): \SynergiTech\Staffology\Model\LoanBalancesReportReportResponse + { + list($response) = $this->loanBalancesReportsWithHttpInfo($employerId, $payPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation loanBalancesReportsWithHttpInfo + * + * Loan Balances + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loanBalancesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\LoanBalancesReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function loanBalancesReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['loanBalancesReports'][0] + ): array + { + $request = $this->loanBalancesReportsRequest($employerId, $payPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation loanBalancesReportsAsync + * + * Loan Balances + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loanBalancesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function loanBalancesReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['loanBalancesReports'][0] + ): PromiseInterface + { + return $this->loanBalancesReportsAsyncWithHttpInfo($employerId, $payPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation loanBalancesReportsAsyncWithHttpInfo + * + * Loan Balances + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loanBalancesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function loanBalancesReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['loanBalancesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\LoanBalancesReportReportResponse'; + $request = $this->loanBalancesReportsRequest($employerId, $payPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'loanBalancesReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loanBalancesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function loanBalancesReportsRequest( + $employerId, + $payPeriod, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['loanBalancesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling loanBalancesReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling loanBalancesReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{payPeriod}/loanbalances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation niLetterValidationReportEmployeesReports + * + * NI Letter Validation (Employees) + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param \DateTime|null $payDate payDate (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportEmployeesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse + */ + public function niLetterValidationReportEmployeesReports( + string $employerId, + ?string $accept = null, + ?\DateTime $payDate = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['niLetterValidationReportEmployeesReports'][0] + ): \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse + { + list($response) = $this->niLetterValidationReportEmployeesReportsWithHttpInfo($employerId, $accept, $payDate, $payPeriod, $contentType); + return $response; + } + + /** + * Operation niLetterValidationReportEmployeesReportsWithHttpInfo + * + * NI Letter Validation (Employees) + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param \DateTime|null $payDate (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportEmployeesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function niLetterValidationReportEmployeesReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + ?\DateTime $payDate = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['niLetterValidationReportEmployeesReports'][0] + ): array + { + $request = $this->niLetterValidationReportEmployeesReportsRequest($employerId, $accept, $payDate, $payPeriod, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation niLetterValidationReportEmployeesReportsAsync + * + * NI Letter Validation (Employees) + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param \DateTime|null $payDate (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportEmployeesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niLetterValidationReportEmployeesReportsAsync( + string $employerId, + ?string $accept = null, + ?\DateTime $payDate = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + string $contentType = self::contentTypes['niLetterValidationReportEmployeesReports'][0] + ): PromiseInterface + { + return $this->niLetterValidationReportEmployeesReportsAsyncWithHttpInfo($employerId, $accept, $payDate, $payPeriod, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation niLetterValidationReportEmployeesReportsAsyncWithHttpInfo + * + * NI Letter Validation (Employees) + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param \DateTime|null $payDate (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportEmployeesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niLetterValidationReportEmployeesReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + $payDate = null, + $payPeriod = null, + string $contentType = self::contentTypes['niLetterValidationReportEmployeesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse'; + $request = $this->niLetterValidationReportEmployeesReportsRequest($employerId, $accept, $payDate, $payPeriod, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'niLetterValidationReportEmployeesReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param \DateTime|null $payDate (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportEmployeesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function niLetterValidationReportEmployeesReportsRequest( + $employerId, + $accept = null, + $payDate = null, + $payPeriod = null, + string $contentType = self::contentTypes['niLetterValidationReportEmployeesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling niLetterValidationReportEmployeesReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/NiLetterValidationReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payDate, + 'payDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation niLetterValidationReportReports + * + * NI Letter Validation (Payrun) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int $periodNumber periodNumber (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse + */ + public function niLetterValidationReportReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['niLetterValidationReportReports'][0] + ): \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse + { + list($response) = $this->niLetterValidationReportReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation niLetterValidationReportReportsWithHttpInfo + * + * NI Letter Validation (Payrun) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function niLetterValidationReportReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['niLetterValidationReportReports'][0] + ): array + { + $request = $this->niLetterValidationReportReportsRequest($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation niLetterValidationReportReportsAsync + * + * NI Letter Validation (Payrun) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niLetterValidationReportReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['niLetterValidationReportReports'][0] + ): PromiseInterface + { + return $this->niLetterValidationReportReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation niLetterValidationReportReportsAsyncWithHttpInfo + * + * NI Letter Validation (Payrun) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niLetterValidationReportReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['niLetterValidationReportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NiLetterValidationReportReportResponse'; + $request = $this->niLetterValidationReportReportsRequest($employerId, $payPeriod, $taxYear, $periodNumber, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'niLetterValidationReportReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niLetterValidationReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function niLetterValidationReportReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['niLetterValidationReportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling niLetterValidationReportReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling niLetterValidationReportReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling niLetterValidationReportReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling niLetterValidationReportReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/NiLetterValidationReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation niYtdReports + * + * NI Year To Date Values + * + * @param string|null $employerId employerId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function niYtdReports( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['niYtdReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->niYtdReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation niYtdReportsWithHttpInfo + * + * NI Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function niYtdReportsWithHttpInfo( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['niYtdReports'][0] + ): array + { + $request = $this->niYtdReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation niYtdReportsAsync + * + * NI Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niYtdReportsAsync( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['niYtdReports'][0] + ): PromiseInterface + { + return $this->niYtdReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation niYtdReportsAsyncWithHttpInfo + * + * NI Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function niYtdReportsAsyncWithHttpInfo( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['niYtdReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->niYtdReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'niYtdReports' + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['niYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function niYtdReportsRequest( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['niYtdReports'][0] + ): Request + { + + + + + $resourcePath = '/niytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p11DMultipleReports + * + * All P11Ds For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P11Ds for. (required) + * @param string|null $accept accept (optional) + * @param bool|null $excludeEmployeesWithP11dEmailSent Exclude Employees with Already Sent P11Ds Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p11DMultipleReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP11dEmailSent = false, + string $contentType = self::contentTypes['p11DMultipleReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p11DMultipleReportsWithHttpInfo($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent, $contentType); + return $response; + } + + /** + * Operation p11DMultipleReportsWithHttpInfo + * + * All P11Ds For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P11Ds for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP11dEmailSent Exclude Employees with Already Sent P11Ds Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p11DMultipleReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP11dEmailSent = false, + string $contentType = self::contentTypes['p11DMultipleReports'][0] + ): array + { + $request = $this->p11DMultipleReportsRequest($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p11DMultipleReportsAsync + * + * All P11Ds For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P11Ds for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP11dEmailSent Exclude Employees with Already Sent P11Ds Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DMultipleReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP11dEmailSent = false, + string $contentType = self::contentTypes['p11DMultipleReports'][0] + ): PromiseInterface + { + return $this->p11DMultipleReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p11DMultipleReportsAsyncWithHttpInfo + * + * All P11Ds For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P11Ds for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP11dEmailSent Exclude Employees with Already Sent P11Ds Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DMultipleReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + $excludeEmployeesWithP11dEmailSent = false, + string $contentType = self::contentTypes['p11DMultipleReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p11DMultipleReportsRequest($employerId, $taxYear, $accept, $excludeEmployeesWithP11dEmailSent, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p11DMultipleReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P11Ds for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP11dEmailSent Exclude Employees with Already Sent P11Ds Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p11DMultipleReportsRequest( + $employerId, + $taxYear, + $accept = null, + $excludeEmployeesWithP11dEmailSent = false, + string $contentType = self::contentTypes['p11DMultipleReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p11DMultipleReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p11DMultipleReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p11d'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $excludeEmployeesWithP11dEmailSent, + 'excludeEmployeesWithP11dEmailSent', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p11DReports + * + * P11D For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p11DReports( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p11DReportsWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p11DReportsWithHttpInfo + * + * P11D For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p11DReportsWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DReports'][0] + ): array + { + $request = $this->p11DReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p11DReportsAsync + * + * P11D For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DReportsAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DReports'][0] + ): PromiseInterface + { + return $this->p11DReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p11DReportsAsyncWithHttpInfo + * + * P11D For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p11DReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p11DReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p11DReportsRequest( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p11DReports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling p11DReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p11DReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p11d/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p11DetailedMultipleReports + * + * All Detailed P11s For TaxYear + * + * @param string $employerId The Id of the employer you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p11DetailedMultipleReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedMultipleReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p11DetailedMultipleReportsWithHttpInfo($employerId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p11DetailedMultipleReportsWithHttpInfo + * + * All Detailed P11s For TaxYear + * + * @param string $employerId The Id of the employer you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedMultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p11DetailedMultipleReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedMultipleReports'][0] + ): array + { + $request = $this->p11DetailedMultipleReportsRequest($employerId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p11DetailedMultipleReportsAsync + * + * All Detailed P11s For TaxYear + * + * @param string $employerId The Id of the employer you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DetailedMultipleReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedMultipleReports'][0] + ): PromiseInterface + { + return $this->p11DetailedMultipleReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p11DetailedMultipleReportsAsyncWithHttpInfo + * + * All Detailed P11s For TaxYear + * + * @param string $employerId The Id of the employer you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DetailedMultipleReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DetailedMultipleReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p11DetailedMultipleReportsRequest($employerId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p11DetailedMultipleReports' + * + * @param string $employerId The Id of the employer you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedMultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p11DetailedMultipleReportsRequest( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DetailedMultipleReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p11DetailedMultipleReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p11DetailedMultipleReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p11detailed'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p11DetailedReports + * + * P11 (Detailed) + * + * @param string $employerId employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\P11DetailedReportResponse + */ + public function p11DetailedReports( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedReports'][0] + ): \SynergiTech\Staffology\Model\P11DetailedReportResponse + { + list($response) = $this->p11DetailedReportsWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p11DetailedReportsWithHttpInfo + * + * P11 (Detailed) + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\P11DetailedReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p11DetailedReportsWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedReports'][0] + ): array + { + $request = $this->p11DetailedReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\P11DetailedReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\P11DetailedReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\P11DetailedReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\P11DetailedReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\P11DetailedReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p11DetailedReportsAsync + * + * P11 (Detailed) + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DetailedReportsAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11DetailedReports'][0] + ): PromiseInterface + { + return $this->p11DetailedReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p11DetailedReportsAsyncWithHttpInfo + * + * P11 (Detailed) + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11DetailedReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DetailedReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\P11DetailedReportResponse'; + $request = $this->p11DetailedReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p11DetailedReports' + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11DetailedReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p11DetailedReportsRequest( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11DetailedReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p11DetailedReports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling p11DetailedReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p11DetailedReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{employeeId}/p11detailed'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p11Reports + * + * P11 + * + * @param string $employerId employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\P11ReportResponse + */ + public function p11Reports( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11Reports'][0] + ): \SynergiTech\Staffology\Model\P11ReportResponse + { + list($response) = $this->p11ReportsWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p11ReportsWithHttpInfo + * + * P11 + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\P11ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p11ReportsWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11Reports'][0] + ): array + { + $request = $this->p11ReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\P11ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\P11ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\P11ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\P11ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\P11ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p11ReportsAsync + * + * P11 + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11ReportsAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p11Reports'][0] + ): PromiseInterface + { + return $this->p11ReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p11ReportsAsyncWithHttpInfo + * + * P11 + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p11ReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\P11ReportResponse'; + $request = $this->p11ReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p11Reports' + * + * @param string $employerId (required) + * @param string $employeeId The employee Id of the employee you want to report on (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The tax year you want to report on. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p11Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p11ReportsRequest( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p11Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p11Reports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling p11Reports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p11Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{employeeId}/p11'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p30Reports + * + * P30 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \DateTime $periodEnding periodEnding (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p30Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p30Reports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['p30Reports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p30ReportsWithHttpInfo($employerId, $taxYear, $periodEnding, $accept, $contentType); + return $response; + } + + /** + * Operation p30ReportsWithHttpInfo + * + * P30 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p30Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p30ReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['p30Reports'][0] + ): array + { + $request = $this->p30ReportsRequest($employerId, $taxYear, $periodEnding, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p30ReportsAsync + * + * P30 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p30Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p30ReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \DateTime $periodEnding, + ?string $accept = null, + string $contentType = self::contentTypes['p30Reports'][0] + ): PromiseInterface + { + return $this->p30ReportsAsyncWithHttpInfo($employerId, $taxYear, $periodEnding, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p30ReportsAsyncWithHttpInfo + * + * P30 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p30Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p30ReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $periodEnding, + $accept = null, + string $contentType = self::contentTypes['p30Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p30ReportsRequest($employerId, $taxYear, $periodEnding, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p30Reports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \DateTime $periodEnding (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p30Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p30ReportsRequest( + $employerId, + $taxYear, + $periodEnding, + $accept = null, + string $contentType = self::contentTypes['p30Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p30Reports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p30Reports' + ); + } + + // verify the required parameter 'periodEnding' is set + if ($periodEnding === null || (is_array($periodEnding) && count($periodEnding) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodEnding when calling p30Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p30/{periodEnding}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($periodEnding !== null) { + $resourcePath = str_replace( + '{' . 'periodEnding' . '}', + ObjectSerializer::toPathValue($periodEnding), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p32Reports + * + * P32 + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p32Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\P32ReportResponse + */ + public function p32Reports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p32Reports'][0] + ): \SynergiTech\Staffology\Model\P32ReportResponse + { + list($response) = $this->p32ReportsWithHttpInfo($employerId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p32ReportsWithHttpInfo + * + * P32 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p32Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\P32ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p32ReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p32Reports'][0] + ): array + { + $request = $this->p32ReportsRequest($employerId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\P32ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\P32ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\P32ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\P32ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\P32ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p32ReportsAsync + * + * P32 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p32Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p32ReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p32Reports'][0] + ): PromiseInterface + { + return $this->p32ReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p32ReportsAsyncWithHttpInfo + * + * P32 + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p32Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p32ReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p32Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\P32ReportResponse'; + $request = $this->p32ReportsRequest($employerId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p32Reports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p32Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p32ReportsRequest( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p32Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p32Reports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p32Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p32'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/html', 'application/pdf', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p45Reports + * + * P45 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want a P45 for. (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p45Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p45Reports( + string $employerId, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['p45Reports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p45ReportsWithHttpInfo($employerId, $employeeId, $accept, $contentType); + return $response; + } + + /** + * Operation p45ReportsWithHttpInfo + * + * P45 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want a P45 for. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p45Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p45ReportsWithHttpInfo( + string $employerId, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['p45Reports'][0] + ): array + { + $request = $this->p45ReportsRequest($employerId, $employeeId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p45ReportsAsync + * + * P45 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want a P45 for. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p45ReportsAsync( + string $employerId, + ?string $employeeId = null, + ?string $accept = null, + string $contentType = self::contentTypes['p45Reports'][0] + ): PromiseInterface + { + return $this->p45ReportsAsyncWithHttpInfo($employerId, $employeeId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p45ReportsAsyncWithHttpInfo + * + * P45 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want a P45 for. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p45ReportsAsyncWithHttpInfo( + $employerId, + $employeeId = null, + $accept = null, + string $contentType = self::contentTypes['p45Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p45ReportsRequest($employerId, $employeeId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p45Reports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string|null $employeeId The Id of the Employee you want a P45 for. (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p45Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p45ReportsRequest( + $employerId, + $employeeId = null, + $accept = null, + string $contentType = self::contentTypes['p45Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p45Reports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/p45'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p60MultipleReports + * + * All P60s For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P60s for. (required) + * @param string|null $accept accept (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60MultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p60MultipleReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['p60MultipleReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p60MultipleReportsWithHttpInfo($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent, $contentType); + return $response; + } + + /** + * Operation p60MultipleReportsWithHttpInfo + * + * All P60s For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P60s for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60MultipleReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p60MultipleReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['p60MultipleReports'][0] + ): array + { + $request = $this->p60MultipleReportsRequest($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p60MultipleReportsAsync + * + * All P60s For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P60s for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p60MultipleReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?bool $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['p60MultipleReports'][0] + ): PromiseInterface + { + return $this->p60MultipleReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p60MultipleReportsAsyncWithHttpInfo + * + * All P60s For TaxYear + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P60s for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p60MultipleReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['p60MultipleReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p60MultipleReportsRequest($employerId, $taxYear, $accept, $excludeEmployeesWithP60EmailSent, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p60MultipleReports' + * + * @param string $employerId The Id of the Employer. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear you want P60s for. (required) + * @param string|null $accept (optional) + * @param bool|null $excludeEmployeesWithP60EmailSent Exclude Employees with Already Sent P60 Emails. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60MultipleReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p60MultipleReportsRequest( + $employerId, + $taxYear, + $accept = null, + $excludeEmployeesWithP60EmailSent = false, + string $contentType = self::contentTypes['p60MultipleReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p60MultipleReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p60MultipleReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p60'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $excludeEmployeesWithP60EmailSent, + 'excludeEmployeesWithP60EmailSent', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation p60Reports + * + * P60 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function p60Reports( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p60Reports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->p60ReportsWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation p60ReportsWithHttpInfo + * + * P60 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60Reports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function p60ReportsWithHttpInfo( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p60Reports'][0] + ): array + { + $request = $this->p60ReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation p60ReportsAsync + * + * P60 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p60ReportsAsync( + string $employerId, + string $employeeId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['p60Reports'][0] + ): PromiseInterface + { + return $this->p60ReportsAsyncWithHttpInfo($employerId, $employeeId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation p60ReportsAsyncWithHttpInfo + * + * P60 For Employee + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function p60ReportsAsyncWithHttpInfo( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p60Reports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->p60ReportsRequest($employerId, $employeeId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'p60Reports' + * + * @param string $employerId The Id of the Employer. (required) + * @param string $employeeId The Id of the Employee. (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear The TaxYear the P60 is for. (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['p60Reports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function p60ReportsRequest( + $employerId, + $employeeId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['p60Reports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling p60Reports' + ); + } + + // verify the required parameter 'employeeId' is set + if ($employeeId === null || (is_array($employeeId) && count($employeeId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeeId when calling p60Reports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling p60Reports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/p60/{employeeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($employeeId !== null) { + $resourcePath = str_replace( + '{' . 'employeeId' . '}', + ObjectSerializer::toPathValue($employeeId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'application/pdf', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation papdisFileReports + * + * PAPDIS File + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat csvFormat (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['papdisFileReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PapdisDocumentReportResponse + */ + public function papdisFileReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?string $accept = null, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PensionCsvFormat $csvFormat = null, + string $contentType = self::contentTypes['papdisFileReports'][0] + ): \SynergiTech\Staffology\Model\PapdisDocumentReportResponse + { + list($response) = $this->papdisFileReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat, $contentType); + return $response; + } + + /** + * Operation papdisFileReportsWithHttpInfo + * + * PAPDIS File + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['papdisFileReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PapdisDocumentReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function papdisFileReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?string $accept = null, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PensionCsvFormat $csvFormat = null, + string $contentType = self::contentTypes['papdisFileReports'][0] + ): array + { + $request = $this->papdisFileReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PapdisDocumentReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PapdisDocumentReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PapdisDocumentReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PapdisDocumentReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PapdisDocumentReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation papdisFileReportsAsync + * + * PAPDIS File + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['papdisFileReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function papdisFileReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $schemeId = null, + ?string $accept = null, + ?int $ordinal = 1, + ?\SynergiTech\Staffology\Model\PensionCsvFormat $csvFormat = null, + string $contentType = self::contentTypes['papdisFileReports'][0] + ): PromiseInterface + { + return $this->papdisFileReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation papdisFileReportsAsyncWithHttpInfo + * + * PAPDIS File + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['papdisFileReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function papdisFileReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $schemeId = null, + $accept = null, + $ordinal = 1, + $csvFormat = null, + string $contentType = self::contentTypes['papdisFileReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PapdisDocumentReportResponse'; + $request = $this->papdisFileReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $schemeId, $accept, $ordinal, $csvFormat, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'papdisFileReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $schemeId The Id of the Pension Scheme you want a file for. (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['papdisFileReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function papdisFileReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $schemeId = null, + $accept = null, + $ordinal = 1, + $csvFormat = null, + string $contentType = self::contentTypes['papdisFileReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling papdisFileReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling papdisFileReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling papdisFileReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling papdisFileReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/papdis'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $schemeId, + 'schemeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $csvFormat, + 'csvFormat', // param base name + 'PensionCsvFormat', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/csv', 'text/xml', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payCodeExportReports + * + * Pay Code Export Details + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payCodeExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function payCodeExportReports( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['payCodeExportReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->payCodeExportReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation payCodeExportReportsWithHttpInfo + * + * Pay Code Export Details + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payCodeExportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payCodeExportReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['payCodeExportReports'][0] + ): array + { + $request = $this->payCodeExportReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payCodeExportReportsAsync + * + * Pay Code Export Details + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payCodeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payCodeExportReportsAsync( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['payCodeExportReports'][0] + ): PromiseInterface + { + return $this->payCodeExportReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payCodeExportReportsAsyncWithHttpInfo + * + * Pay Code Export Details + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payCodeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payCodeExportReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + string $contentType = self::contentTypes['payCodeExportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->payCodeExportReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payCodeExportReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payCodeExportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payCodeExportReportsRequest( + $employerId, + $accept = null, + string $contentType = self::contentTypes['payCodeExportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payCodeExportReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/paycodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payElementReports + * + * Pay Element + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $payCodes Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payElementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayElementReportReportResponse + */ + public function payElementReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $payCodes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payElementReports'][0] + ): \SynergiTech\Staffology\Model\PayElementReportReportResponse + { + list($response) = $this->payElementReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation payElementReportsWithHttpInfo + * + * Pay Element + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $payCodes Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payElementReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayElementReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payElementReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $payCodes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payElementReports'][0] + ): array + { + $request = $this->payElementReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayElementReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayElementReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayElementReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayElementReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayElementReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payElementReportsAsync + * + * Pay Element + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $payCodes Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payElementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payElementReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $payCodes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payElementReports'][0] + ): PromiseInterface + { + return $this->payElementReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payElementReportsAsyncWithHttpInfo + * + * Pay Element + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $payCodes Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payElementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payElementReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $payCodes = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['payElementReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayElementReportReportResponse'; + $request = $this->payElementReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $payCodes, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payElementReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $payCodes Comma separated values of pay codes, e.g., (BASIC,BASICANNUAL,BASICDAILY) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payElementReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payElementReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $payCodes = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['payElementReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payElementReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payElementReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payElementReports' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/pay-element'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payCodes, + 'payCodes', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payGradesReports + * + * Pay Grade + * + * @param string $employerId employerId (required) + * @param string|null $effectiveDateFrom effectiveDateFrom (optional) + * @param string|null $effectiveDateTo effectiveDateTo (optional) + * @param string|null $paySpineId paySpineId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payGradesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayGradesReportReportResponse + */ + public function payGradesReports( + string $employerId, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['payGradesReports'][0] + ): \SynergiTech\Staffology\Model\PayGradesReportReportResponse + { + list($response) = $this->payGradesReportsWithHttpInfo($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept, $contentType); + return $response; + } + + /** + * Operation payGradesReportsWithHttpInfo + * + * Pay Grade + * + * @param string $employerId (required) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payGradesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayGradesReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payGradesReportsWithHttpInfo( + string $employerId, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['payGradesReports'][0] + ): array + { + $request = $this->payGradesReportsRequest($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayGradesReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayGradesReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayGradesReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayGradesReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayGradesReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payGradesReportsAsync + * + * Pay Grade + * + * @param string $employerId (required) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payGradesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payGradesReportsAsync( + string $employerId, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['payGradesReports'][0] + ): PromiseInterface + { + return $this->payGradesReportsAsyncWithHttpInfo($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payGradesReportsAsyncWithHttpInfo + * + * Pay Grade + * + * @param string $employerId (required) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payGradesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payGradesReportsAsyncWithHttpInfo( + $employerId, + $effectiveDateFrom = null, + $effectiveDateTo = null, + $paySpineId = null, + $accept = null, + string $contentType = self::contentTypes['payGradesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayGradesReportReportResponse'; + $request = $this->payGradesReportsRequest($employerId, $effectiveDateFrom, $effectiveDateTo, $paySpineId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payGradesReports' + * + * @param string $employerId (required) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payGradesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payGradesReportsRequest( + $employerId, + $effectiveDateFrom = null, + $effectiveDateTo = null, + $paySpineId = null, + $accept = null, + string $contentType = self::contentTypes['payGradesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payGradesReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/payGrades'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveDateFrom, + 'effectiveDateFrom', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveDateTo, + 'effectiveDateTo', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paySpineId, + 'paySpineId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payRunCsvReports + * + * PayRun CSV (deprecated) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $summary If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunCsvReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function payRunCsvReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $summary = false, + string $contentType = self::contentTypes['payRunCsvReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->payRunCsvReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary, $contentType); + return $response; + } + + /** + * Operation payRunCsvReportsWithHttpInfo + * + * PayRun CSV (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $summary If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunCsvReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payRunCsvReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $summary = false, + string $contentType = self::contentTypes['payRunCsvReports'][0] + ): array + { + $request = $this->payRunCsvReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payRunCsvReportsAsync + * + * PayRun CSV (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $summary If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunCsvReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $summary = false, + string $contentType = self::contentTypes['payRunCsvReports'][0] + ): PromiseInterface + { + return $this->payRunCsvReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payRunCsvReportsAsyncWithHttpInfo + * + * PayRun CSV (deprecated) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $summary If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunCsvReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $summary = false, + string $contentType = self::contentTypes['payRunCsvReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->payRunCsvReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $summary, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payRunCsvReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $summary If set to true then instead of a line-by-line CSV, you'll receive a summary for each employee (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunCsvReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payRunCsvReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $summary = false, + string $contentType = self::contentTypes['payRunCsvReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payRunCsvReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payRunCsvReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payRunCsvReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payRunCsvReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrun-csv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $summary, + 'summary', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payRunPaymentsReports + * + * PayRun Payments + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $includeNonEmployeePayments If set to true then we'll also include payments that need to be made to HMRC and PensionProviders (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunPaymentsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse + */ + public function payRunPaymentsReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $includeNonEmployeePayments = false, + string $contentType = self::contentTypes['payRunPaymentsReports'][0] + ): \SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse + { + list($response) = $this->payRunPaymentsReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments, $contentType); + return $response; + } + + /** + * Operation payRunPaymentsReportsWithHttpInfo + * + * PayRun Payments + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $includeNonEmployeePayments If set to true then we'll also include payments that need to be made to HMRC and PensionProviders (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunPaymentsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payRunPaymentsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $includeNonEmployeePayments = false, + string $contentType = self::contentTypes['payRunPaymentsReports'][0] + ): array + { + $request = $this->payRunPaymentsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payRunPaymentsReportsAsync + * + * PayRun Payments + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $includeNonEmployeePayments If set to true then we'll also include payments that need to be made to HMRC and PensionProviders (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunPaymentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunPaymentsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHoliday = null, + ?int $ordinal = 1, + ?bool $includeNonEmployeePayments = false, + string $contentType = self::contentTypes['payRunPaymentsReports'][0] + ): PromiseInterface + { + return $this->payRunPaymentsReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payRunPaymentsReportsAsyncWithHttpInfo + * + * PayRun Payments + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $includeNonEmployeePayments If set to true then we'll also include payments that need to be made to HMRC and PensionProviders (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunPaymentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunPaymentsReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $bankHoliday = null, + $ordinal = 1, + $includeNonEmployeePayments = false, + string $contentType = self::contentTypes['payRunPaymentsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayrunPaymentsReportReportResponse'; + $request = $this->payRunPaymentsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $bankHoliday, $ordinal, $includeNonEmployeePayments, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payRunPaymentsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHoliday Specifies the region whose bank holidays are to be considered in the operation. (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $includeNonEmployeePayments If set to true then we'll also include payments that need to be made to HMRC and PensionProviders (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunPaymentsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payRunPaymentsReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $bankHoliday = null, + $ordinal = 1, + $includeNonEmployeePayments = false, + string $contentType = self::contentTypes['payRunPaymentsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payRunPaymentsReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payRunPaymentsReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payRunPaymentsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payRunPaymentsReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payments/employee'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $bankHoliday, + 'bankHoliday', // param base name + 'BankHolidayCollection', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeNonEmployeePayments, + 'includeNonEmployeePayments', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payRunSummaryReports + * + * PayRunSummary + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $includeQty If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunSummaryReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse + */ + public function payRunSummaryReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $includeQty = false, + string $contentType = self::contentTypes['payRunSummaryReports'][0] + ): \SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse + { + list($response) = $this->payRunSummaryReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty, $contentType); + return $response; + } + + /** + * Operation payRunSummaryReportsWithHttpInfo + * + * PayRunSummary + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $includeQty If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunSummaryReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payRunSummaryReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $includeQty = false, + string $contentType = self::contentTypes['payRunSummaryReports'][0] + ): array + { + $request = $this->payRunSummaryReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payRunSummaryReportsAsync + * + * PayRunSummary + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $includeQty If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunSummaryReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + ?bool $includeQty = false, + string $contentType = self::contentTypes['payRunSummaryReports'][0] + ): PromiseInterface + { + return $this->payRunSummaryReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payRunSummaryReportsAsyncWithHttpInfo + * + * PayRunSummary + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $includeQty If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payRunSummaryReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + $includeQty = false, + string $contentType = self::contentTypes['payRunSummaryReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayRunSummaryLineIEnumerableReportResponse'; + $request = $this->payRunSummaryReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $includeQty, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payRunSummaryReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param bool|null $includeQty If set to true and acceptType is text/csv, then where a PayCode on a PayLine is a multiplier code we'll include a Qty value for the number of days/hours (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payRunSummaryReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payRunSummaryReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + $includeQty = false, + string $contentType = self::contentTypes['payRunSummaryReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payRunSummaryReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payRunSummaryReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payRunSummaryReports' + ); + } + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/payrunsummary'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeQty, + 'includeQty', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation paySpineReports + * + * Pay Spine + * + * @param string $employerId employerId (required) + * @param string|null $paySpineId paySpineId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paySpineReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PaySpineReportReportResponse + */ + public function paySpineReports( + string $employerId, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['paySpineReports'][0] + ): \SynergiTech\Staffology\Model\PaySpineReportReportResponse + { + list($response) = $this->paySpineReportsWithHttpInfo($employerId, $paySpineId, $accept, $contentType); + return $response; + } + + /** + * Operation paySpineReportsWithHttpInfo + * + * Pay Spine + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paySpineReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PaySpineReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function paySpineReportsWithHttpInfo( + string $employerId, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['paySpineReports'][0] + ): array + { + $request = $this->paySpineReportsRequest($employerId, $paySpineId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PaySpineReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PaySpineReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PaySpineReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PaySpineReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PaySpineReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation paySpineReportsAsync + * + * Pay Spine + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paySpineReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paySpineReportsAsync( + string $employerId, + ?string $paySpineId = null, + ?string $accept = null, + string $contentType = self::contentTypes['paySpineReports'][0] + ): PromiseInterface + { + return $this->paySpineReportsAsyncWithHttpInfo($employerId, $paySpineId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation paySpineReportsAsyncWithHttpInfo + * + * Pay Spine + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paySpineReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function paySpineReportsAsyncWithHttpInfo( + $employerId, + $paySpineId = null, + $accept = null, + string $contentType = self::contentTypes['paySpineReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PaySpineReportReportResponse'; + $request = $this->paySpineReportsRequest($employerId, $paySpineId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'paySpineReports' + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['paySpineReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function paySpineReportsRequest( + $employerId, + $paySpineId = null, + $accept = null, + string $contentType = self::contentTypes['paySpineReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling paySpineReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/payspines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paySpineId, + 'paySpineId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrollAnalysisCostBreakdownReports + * + * Analysis Cost Breakdown + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisCostBreakdownReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse + */ + public function payrollAnalysisCostBreakdownReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisCostBreakdownReports'][0] + ): \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse + { + list($response) = $this->payrollAnalysisCostBreakdownReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + return $response; + } + + /** + * Operation payrollAnalysisCostBreakdownReportsWithHttpInfo + * + * Analysis Cost Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisCostBreakdownReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrollAnalysisCostBreakdownReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisCostBreakdownReports'][0] + ): array + { + $request = $this->payrollAnalysisCostBreakdownReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrollAnalysisCostBreakdownReportsAsync + * + * Analysis Cost Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisCostBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollAnalysisCostBreakdownReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisCostBreakdownReports'][0] + ): PromiseInterface + { + return $this->payrollAnalysisCostBreakdownReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrollAnalysisCostBreakdownReportsAsyncWithHttpInfo + * + * Analysis Cost Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisCostBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollAnalysisCostBreakdownReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisCostBreakdownReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportReportResponse'; + $request = $this->payrollAnalysisCostBreakdownReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrollAnalysisCostBreakdownReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode If specified then only employees assigned to this department code at the time of the payrun will be included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisCostBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrollAnalysisCostBreakdownReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisCostBreakdownReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payrollAnalysisCostBreakdownReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payrollAnalysisCostBreakdownReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payrollAnalysisCostBreakdownReports' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysiscostbreakdown'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrollAnalysisEmployeeRoleBreakdownReports + * + * Payroll Analysis with Employee Role Breakdown + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $deptCode Optional. Filters employees by department code. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse + */ + public function payrollAnalysisEmployeeRoleBreakdownReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'][0] + ): \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse + { + list($response) = $this->payrollAnalysisEmployeeRoleBreakdownReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + return $response; + } + + /** + * Operation payrollAnalysisEmployeeRoleBreakdownReportsWithHttpInfo + * + * Payroll Analysis with Employee Role Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode Optional. Filters employees by department code. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrollAnalysisEmployeeRoleBreakdownReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'][0] + ): array + { + $request = $this->payrollAnalysisEmployeeRoleBreakdownReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrollAnalysisEmployeeRoleBreakdownReportsAsync + * + * Payroll Analysis with Employee Role Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode Optional. Filters employees by department code. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollAnalysisEmployeeRoleBreakdownReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'][0] + ): PromiseInterface + { + return $this->payrollAnalysisEmployeeRoleBreakdownReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrollAnalysisEmployeeRoleBreakdownReportsAsyncWithHttpInfo + * + * Payroll Analysis with Employee Role Breakdown + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode Optional. Filters employees by department code. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollAnalysisEmployeeRoleBreakdownReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportReportResponse'; + $request = $this->payrollAnalysisEmployeeRoleBreakdownReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $deptCode, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrollAnalysisEmployeeRoleBreakdownReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $deptCode Optional. Filters employees by department code. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrollAnalysisEmployeeRoleBreakdownReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $deptCode = null, + string $contentType = self::contentTypes['payrollAnalysisEmployeeRoleBreakdownReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payrollAnalysisEmployeeRoleBreakdownReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payrollAnalysisEmployeeRoleBreakdownReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payrollAnalysisEmployeeRoleBreakdownReports' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/analysisemployeerolebreakdown'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrollJournalCsvReportReports + * + * Payroll Journal CSV + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollJournalCsvReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function payrollJournalCsvReportReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['payrollJournalCsvReportReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->payrollJournalCsvReportReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown, $contentType); + return $response; + } + + /** + * Operation payrollJournalCsvReportReportsWithHttpInfo + * + * Payroll Journal CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollJournalCsvReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrollJournalCsvReportReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['payrollJournalCsvReportReports'][0] + ): array + { + $request = $this->payrollJournalCsvReportReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrollJournalCsvReportReportsAsync + * + * Payroll Journal CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollJournalCsvReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollJournalCsvReportReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $deptBreakdown = false, + string $contentType = self::contentTypes['payrollJournalCsvReportReports'][0] + ): PromiseInterface + { + return $this->payrollJournalCsvReportReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrollJournalCsvReportReportsAsyncWithHttpInfo + * + * Payroll Journal CSV + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollJournalCsvReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollJournalCsvReportReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $deptBreakdown = false, + string $contentType = self::contentTypes['payrollJournalCsvReportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->payrollJournalCsvReportReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $deptBreakdown, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrollJournalCsvReportReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $deptBreakdown Set to true and the journal will be split between any relevant Departments (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollJournalCsvReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrollJournalCsvReportReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $deptBreakdown = false, + string $contentType = self::contentTypes['payrollJournalCsvReportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payrollJournalCsvReportReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payrollJournalCsvReportReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payrollJournalCsvReportReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payrollJournalCsvReportReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payrolljournalcsv'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptBreakdown, + 'deptBreakdown', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrunNiYtdReports + * + * NI Year To Date Values + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunNiYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\NiYtdReportReportResponse + */ + public function payrunNiYtdReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunNiYtdReports'][0] + ): \SynergiTech\Staffology\Model\NiYtdReportReportResponse + { + list($response) = $this->payrunNiYtdReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + return $response; + } + + /** + * Operation payrunNiYtdReportsWithHttpInfo + * + * NI Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunNiYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\NiYtdReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrunNiYtdReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunNiYtdReports'][0] + ): array + { + $request = $this->payrunNiYtdReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\NiYtdReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\NiYtdReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\NiYtdReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\NiYtdReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\NiYtdReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrunNiYtdReportsAsync + * + * NI Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunNiYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrunNiYtdReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunNiYtdReports'][0] + ): PromiseInterface + { + return $this->payrunNiYtdReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrunNiYtdReportsAsyncWithHttpInfo + * + * NI Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunNiYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrunNiYtdReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $accept = null, + string $contentType = self::contentTypes['payrunNiYtdReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\NiYtdReportReportResponse'; + $request = $this->payrunNiYtdReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrunNiYtdReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunNiYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrunNiYtdReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $accept = null, + string $contentType = self::contentTypes['payrunNiYtdReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payrunNiYtdReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payrunNiYtdReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payrunNiYtdReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payrunNiYtdReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/niytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrunYtdReports + * + * Year To Date Values + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\YtdReportReportResponse + */ + public function payrunYtdReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunYtdReports'][0] + ): \SynergiTech\Staffology\Model\YtdReportReportResponse + { + list($response) = $this->payrunYtdReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + return $response; + } + + /** + * Operation payrunYtdReportsWithHttpInfo + * + * Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunYtdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\YtdReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrunYtdReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunYtdReports'][0] + ): array + { + $request = $this->payrunYtdReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\YtdReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\YtdReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\YtdReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\YtdReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\YtdReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrunYtdReportsAsync + * + * Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrunYtdReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?string $accept = null, + string $contentType = self::contentTypes['payrunYtdReports'][0] + ): PromiseInterface + { + return $this->payrunYtdReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrunYtdReportsAsyncWithHttpInfo + * + * Year To Date Values + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrunYtdReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $accept = null, + string $contentType = self::contentTypes['payrunYtdReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\YtdReportReportResponse'; + $request = $this->payrunYtdReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $ordinal, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrunYtdReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrunYtdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrunYtdReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $ordinal = null, + $accept = null, + string $contentType = self::contentTypes['payrunYtdReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payrunYtdReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payrunYtdReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payrunYtdReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payrunYtdReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/ytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payslipReports + * + * Payslip + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string $id The Id of the PayRunEntry. (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PayslipReportResponse + */ + public function payslipReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payslipReports'][0] + ): \SynergiTech\Staffology\Model\PayslipReportResponse + { + list($response) = $this->payslipReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation payslipReportsWithHttpInfo + * + * Payslip + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of the PayRunEntry. (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PayslipReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payslipReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payslipReports'][0] + ): array + { + $request = $this->payslipReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PayslipReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PayslipReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PayslipReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PayslipReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PayslipReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payslipReportsAsync + * + * Payslip + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of the PayRunEntry. (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payslipReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + string $id, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['payslipReports'][0] + ): PromiseInterface + { + return $this->payslipReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payslipReportsAsyncWithHttpInfo + * + * Payslip + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of the PayRunEntry. (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payslipReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['payslipReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PayslipReportResponse'; + $request = $this->payslipReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $id, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payslipReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string $id The Id of the PayRunEntry. (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payslipReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $id, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['payslipReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payslipReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payslipReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payslipReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payslipReports' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payslipReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/{id}/payslip'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', 'text/html', 'application/octet-stream', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payslipsReports + * + * Payslips + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param bool|null $unemailed Set this to True if you only want the Payslips that haven't been sent by email (optional, default to false) + * @param string|null $deptCode Set if you want to filter by department (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeaversFilter startersLeaversFilter (optional) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy sortBy (optional) + * @param bool|null $sortDescending sortDescending (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function payslipsReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $unemailed = false, + ?string $deptCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeaversFilter = null, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['payslipsReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->payslipsReportsWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending, $contentType); + return $response; + } + + /** + * Operation payslipsReportsWithHttpInfo + * + * Payslips + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $unemailed Set this to True if you only want the Payslips that haven't been sent by email (optional, default to false) + * @param string|null $deptCode Set if you want to filter by department (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeaversFilter (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy (optional) + * @param bool|null $sortDescending (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payslipsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $unemailed = false, + ?string $deptCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeaversFilter = null, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['payslipsReports'][0] + ): array + { + $request = $this->payslipsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payslipsReportsAsync + * + * Payslips + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $unemailed Set this to True if you only want the Payslips that haven't been sent by email (optional, default to false) + * @param string|null $deptCode Set if you want to filter by department (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeaversFilter (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy (optional) + * @param bool|null $sortDescending (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payslipsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + ?int $ordinal = 1, + ?bool $unemailed = false, + ?string $deptCode = null, + ?\SynergiTech\Staffology\Model\StartersLeaversFilter $startersLeaversFilter = null, + ?int $pageNum = null, + ?int $pageSize = null, + ?\SynergiTech\Staffology\Model\PayRunEntrySortBy $sortBy = null, + ?bool $sortDescending = false, + string $contentType = self::contentTypes['payslipsReports'][0] + ): PromiseInterface + { + return $this->payslipsReportsAsyncWithHttpInfo($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payslipsReportsAsyncWithHttpInfo + * + * Payslips + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $unemailed Set this to True if you only want the Payslips that haven't been sent by email (optional, default to false) + * @param string|null $deptCode Set if you want to filter by department (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeaversFilter (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy (optional) + * @param bool|null $sortDescending (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payslipsReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $unemailed = false, + $deptCode = null, + $startersLeaversFilter = null, + $pageNum = null, + $pageSize = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['payslipsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->payslipsReportsRequest($employerId, $payPeriod, $periodNumber, $taxYear, $accept, $ordinal, $unemailed, $deptCode, $startersLeaversFilter, $pageNum, $pageSize, $sortBy, $sortDescending, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payslipsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param bool|null $unemailed Set this to True if you only want the Payslips that haven't been sent by email (optional, default to false) + * @param string|null $deptCode Set if you want to filter by department (optional) + * @param \SynergiTech\Staffology\Model\StartersLeaversFilter|null $startersLeaversFilter (optional) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param \SynergiTech\Staffology\Model\PayRunEntrySortBy|null $sortBy (optional) + * @param bool|null $sortDescending (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payslipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payslipsReportsRequest( + $employerId, + $payPeriod, + $periodNumber, + $taxYear, + $accept = null, + $ordinal = 1, + $unemailed = false, + $deptCode = null, + $startersLeaversFilter = null, + $pageNum = null, + $pageSize = null, + $sortBy = null, + $sortDescending = false, + string $contentType = self::contentTypes['payslipsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payslipsReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling payslipsReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling payslipsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling payslipsReports' + ); + } + + + + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/payslips'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $unemailed, + 'unemailed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $deptCode, + 'deptCode', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $startersLeaversFilter, + 'startersLeaversFilter', // param base name + 'StartersLeaversFilter', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortBy, + 'sortBy', // param base name + 'PayRunEntrySortBy', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortDescending, + 'sortDescending', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pensionMembershipsReports + * + * Export Multiple Pension Memberships Report + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionMembershipsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse + */ + public function pensionMembershipsReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionMembershipsReports'][0] + ): \SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse + { + list($response) = $this->pensionMembershipsReportsWithHttpInfo($employerId, $taxYear, $payPeriod, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation pensionMembershipsReportsWithHttpInfo + * + * Export Multiple Pension Memberships Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionMembershipsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function pensionMembershipsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionMembershipsReports'][0] + ): array + { + $request = $this->pensionMembershipsReportsRequest($employerId, $taxYear, $payPeriod, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pensionMembershipsReportsAsync + * + * Export Multiple Pension Memberships Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionMembershipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pensionMembershipsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['pensionMembershipsReports'][0] + ): PromiseInterface + { + return $this->pensionMembershipsReportsAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pensionMembershipsReportsAsyncWithHttpInfo + * + * Export Multiple Pension Memberships Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionMembershipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function pensionMembershipsReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['pensionMembershipsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PensionMembershipsReportReportResponse'; + $request = $this->pensionMembershipsReportsRequest($employerId, $taxYear, $payPeriod, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pensionMembershipsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pensionMembershipsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pensionMembershipsReportsRequest( + $employerId, + $taxYear, + $payPeriod = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['pensionMembershipsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling pensionMembershipsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling pensionMembershipsReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/pensionmemberships'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'payPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation rightToWorkReports + * + * RightToWork + * + * @param string $employerId employerId (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rightToWorkReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\RightToWorkReportReportResponse + */ + public function rightToWorkReports( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['rightToWorkReports'][0] + ): \SynergiTech\Staffology\Model\RightToWorkReportReportResponse + { + list($response) = $this->rightToWorkReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation rightToWorkReportsWithHttpInfo + * + * RightToWork + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rightToWorkReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\RightToWorkReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function rightToWorkReportsWithHttpInfo( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['rightToWorkReports'][0] + ): array + { + $request = $this->rightToWorkReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\RightToWorkReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\RightToWorkReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\RightToWorkReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\RightToWorkReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\RightToWorkReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation rightToWorkReportsAsync + * + * RightToWork + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rightToWorkReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function rightToWorkReportsAsync( + string $employerId, + ?string $accept = null, + string $contentType = self::contentTypes['rightToWorkReports'][0] + ): PromiseInterface + { + return $this->rightToWorkReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation rightToWorkReportsAsyncWithHttpInfo + * + * RightToWork + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rightToWorkReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function rightToWorkReportsAsyncWithHttpInfo( + $employerId, + $accept = null, + string $contentType = self::contentTypes['rightToWorkReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\RightToWorkReportReportResponse'; + $request = $this->rightToWorkReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'rightToWorkReports' + * + * @param string $employerId (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rightToWorkReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function rightToWorkReportsRequest( + $employerId, + $accept = null, + string $contentType = self::contentTypes['rightToWorkReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling rightToWorkReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/right-to-work'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation spinePointReports + * + * Spine Point + * + * @param string $employerId employerId (required) + * @param string|null $paySpineId paySpineId (optional) + * @param string|null $effectiveDateFrom effectiveDateFrom (optional) + * @param string|null $effectiveDateTo effectiveDateTo (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spinePointReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\SpinePointReportReportResponse + */ + public function spinePointReports( + string $employerId, + ?string $paySpineId = null, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $accept = null, + string $contentType = self::contentTypes['spinePointReports'][0] + ): \SynergiTech\Staffology\Model\SpinePointReportReportResponse + { + list($response) = $this->spinePointReportsWithHttpInfo($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept, $contentType); + return $response; + } + + /** + * Operation spinePointReportsWithHttpInfo + * + * Spine Point + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spinePointReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\SpinePointReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function spinePointReportsWithHttpInfo( + string $employerId, + ?string $paySpineId = null, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $accept = null, + string $contentType = self::contentTypes['spinePointReports'][0] + ): array + { + $request = $this->spinePointReportsRequest($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\SpinePointReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\SpinePointReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\SpinePointReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\SpinePointReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\SpinePointReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spinePointReportsAsync + * + * Spine Point + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spinePointReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function spinePointReportsAsync( + string $employerId, + ?string $paySpineId = null, + ?string $effectiveDateFrom = null, + ?string $effectiveDateTo = null, + ?string $accept = null, + string $contentType = self::contentTypes['spinePointReports'][0] + ): PromiseInterface + { + return $this->spinePointReportsAsyncWithHttpInfo($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spinePointReportsAsyncWithHttpInfo + * + * Spine Point + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spinePointReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function spinePointReportsAsyncWithHttpInfo( + $employerId, + $paySpineId = null, + $effectiveDateFrom = null, + $effectiveDateTo = null, + $accept = null, + string $contentType = self::contentTypes['spinePointReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\SpinePointReportReportResponse'; + $request = $this->spinePointReportsRequest($employerId, $paySpineId, $effectiveDateFrom, $effectiveDateTo, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spinePointReports' + * + * @param string $employerId (required) + * @param string|null $paySpineId (optional) + * @param string|null $effectiveDateFrom (optional) + * @param string|null $effectiveDateTo (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spinePointReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spinePointReportsRequest( + $employerId, + $paySpineId = null, + $effectiveDateFrom = null, + $effectiveDateTo = null, + $accept = null, + string $contentType = self::contentTypes['spinePointReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling spinePointReports' + ); + } + + + + + + + $resourcePath = '/employers/{employerId}/reports/spinepoints'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paySpineId, + 'paySpineId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveDateFrom, + 'effectiveDateFrom', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $effectiveDateTo, + 'effectiveDateTo', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation statutoryPayReports + * + * Statutory Pay + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $statutoryPayTypes Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statutoryPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\StatutoryPayReportReportResponse + */ + public function statutoryPayReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $statutoryPayTypes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['statutoryPayReports'][0] + ): \SynergiTech\Staffology\Model\StatutoryPayReportReportResponse + { + list($response) = $this->statutoryPayReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation statutoryPayReportsWithHttpInfo + * + * Statutory Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $statutoryPayTypes Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statutoryPayReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\StatutoryPayReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function statutoryPayReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $statutoryPayTypes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['statutoryPayReports'][0] + ): array + { + $request = $this->statutoryPayReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation statutoryPayReportsAsync + * + * Statutory Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $statutoryPayTypes Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statutoryPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function statutoryPayReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $statutoryPayTypes = null, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['statutoryPayReports'][0] + ): PromiseInterface + { + return $this->statutoryPayReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation statutoryPayReportsAsyncWithHttpInfo + * + * Statutory Pay + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $statutoryPayTypes Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statutoryPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function statutoryPayReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $statutoryPayTypes = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['statutoryPayReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\StatutoryPayReportReportResponse'; + $request = $this->statutoryPayReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $statutoryPayTypes, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'statutoryPayReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $statutoryPayTypes Comma separated values from (SAP, SHPP, SMP, SPBP, SPP) (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['statutoryPayReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function statutoryPayReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $statutoryPayTypes = null, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['statutoryPayReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling statutoryPayReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling statutoryPayReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling statutoryPayReports' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/statutory-pay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $statutoryPayTypes, + 'statutoryPayTypes', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation taxCodeChangesReports + * + * Taxcode Change + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['taxCodeChangesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse + */ + public function taxCodeChangesReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['taxCodeChangesReports'][0] + ): \SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse + { + list($response) = $this->taxCodeChangesReportsWithHttpInfo($employerId, $taxYear, $accept, $contentType); + return $response; + } + + /** + * Operation taxCodeChangesReportsWithHttpInfo + * + * Taxcode Change + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['taxCodeChangesReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function taxCodeChangesReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['taxCodeChangesReports'][0] + ): array + { + $request = $this->taxCodeChangesReportsRequest($employerId, $taxYear, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation taxCodeChangesReportsAsync + * + * Taxcode Change + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['taxCodeChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function taxCodeChangesReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $accept = null, + string $contentType = self::contentTypes['taxCodeChangesReports'][0] + ): PromiseInterface + { + return $this->taxCodeChangesReportsAsyncWithHttpInfo($employerId, $taxYear, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation taxCodeChangesReportsAsyncWithHttpInfo + * + * Taxcode Change + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['taxCodeChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function taxCodeChangesReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['taxCodeChangesReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\TaxCodeChangeReportReportResponse'; + $request = $this->taxCodeChangesReportsRequest($employerId, $taxYear, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'taxCodeChangesReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['taxCodeChangesReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function taxCodeChangesReportsRequest( + $employerId, + $taxYear, + $accept = null, + string $contentType = self::contentTypes['taxCodeChangesReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling taxCodeChangesReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling taxCodeChangesReports' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/taxcode'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation teachersPensionEoyReports + * + * Teachers Pension Eoy Report + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param string|null $localAuthorityNumber localAuthorityNumber (optional) + * @param string|null $schoolEmployerType schoolEmployerType (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teachersPensionEoyReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse + */ + public function teachersPensionEoyReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $localAuthorityNumber = null, + ?string $schoolEmployerType = null, + ?string $accept = null, + string $contentType = self::contentTypes['teachersPensionEoyReports'][0] + ): \SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse + { + list($response) = $this->teachersPensionEoyReportsWithHttpInfo($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept, $contentType); + return $response; + } + + /** + * Operation teachersPensionEoyReportsWithHttpInfo + * + * Teachers Pension Eoy Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $localAuthorityNumber (optional) + * @param string|null $schoolEmployerType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teachersPensionEoyReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function teachersPensionEoyReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $localAuthorityNumber = null, + ?string $schoolEmployerType = null, + ?string $accept = null, + string $contentType = self::contentTypes['teachersPensionEoyReports'][0] + ): array + { + $request = $this->teachersPensionEoyReportsRequest($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation teachersPensionEoyReportsAsync + * + * Teachers Pension Eoy Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $localAuthorityNumber (optional) + * @param string|null $schoolEmployerType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teachersPensionEoyReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function teachersPensionEoyReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?string $localAuthorityNumber = null, + ?string $schoolEmployerType = null, + ?string $accept = null, + string $contentType = self::contentTypes['teachersPensionEoyReports'][0] + ): PromiseInterface + { + return $this->teachersPensionEoyReportsAsyncWithHttpInfo($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation teachersPensionEoyReportsAsyncWithHttpInfo + * + * Teachers Pension Eoy Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $localAuthorityNumber (optional) + * @param string|null $schoolEmployerType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teachersPensionEoyReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function teachersPensionEoyReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $localAuthorityNumber = null, + $schoolEmployerType = null, + $accept = null, + string $contentType = self::contentTypes['teachersPensionEoyReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\TeachersPensionEoyReportReportResponse'; + $request = $this->teachersPensionEoyReportsRequest($employerId, $taxYear, $localAuthorityNumber, $schoolEmployerType, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'teachersPensionEoyReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param string|null $localAuthorityNumber (optional) + * @param string|null $schoolEmployerType (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teachersPensionEoyReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function teachersPensionEoyReportsRequest( + $employerId, + $taxYear, + $localAuthorityNumber = null, + $schoolEmployerType = null, + $accept = null, + string $contentType = self::contentTypes['teachersPensionEoyReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling teachersPensionEoyReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling teachersPensionEoyReports' + ); + } + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/teachersPensionEoy'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $localAuthorityNumber, + 'localAuthorityNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $schoolEmployerType, + 'schoolEmployerType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation umbrellaReconciliationReports + * + * Umbrella Reconciliation + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string|null $employeeId Specify an employee id to report on just that employee, otherwise all employees will be included. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['umbrellaReconciliationReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse + */ + public function umbrellaReconciliationReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['umbrellaReconciliationReports'][0] + ): \SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse + { + list($response) = $this->umbrellaReconciliationReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId, $contentType); + return $response; + } + + /** + * Operation umbrellaReconciliationReportsWithHttpInfo + * + * Umbrella Reconciliation + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId Specify an employee id to report on just that employee, otherwise all employees will be included. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['umbrellaReconciliationReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function umbrellaReconciliationReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['umbrellaReconciliationReports'][0] + ): array + { + $request = $this->umbrellaReconciliationReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation umbrellaReconciliationReportsAsync + * + * Umbrella Reconciliation + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId Specify an employee id to report on just that employee, otherwise all employees will be included. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['umbrellaReconciliationReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function umbrellaReconciliationReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?string $accept = null, + ?int $ordinal = 1, + ?string $employeeId = null, + string $contentType = self::contentTypes['umbrellaReconciliationReports'][0] + ): PromiseInterface + { + return $this->umbrellaReconciliationReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation umbrellaReconciliationReportsAsyncWithHttpInfo + * + * Umbrella Reconciliation + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId Specify an employee id to report on just that employee, otherwise all employees will be included. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['umbrellaReconciliationReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function umbrellaReconciliationReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $employeeId = null, + string $contentType = self::contentTypes['umbrellaReconciliationReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\UmbrellaReconciliationReportReportResponse'; + $request = $this->umbrellaReconciliationReportsRequest($employerId, $payPeriod, $taxYear, $fromPeriod, $toPeriod, $accept, $ordinal, $employeeId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'umbrellaReconciliationReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string|null $employeeId Specify an employee id to report on just that employee, otherwise all employees will be included. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['umbrellaReconciliationReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function umbrellaReconciliationReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $fromPeriod = null, + $toPeriod = null, + $accept = null, + $ordinal = 1, + $employeeId = null, + string $contentType = self::contentTypes['umbrellaReconciliationReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling umbrellaReconciliationReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling umbrellaReconciliationReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling umbrellaReconciliationReports' + ); + } + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/umbrella-reconciliation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeId, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation varianceReportReports + * + * Variance Report + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param int|null $ordinal ordinal (optional) + * @param int|null $fromPeriod fromPeriod (optional) + * @param int|null $toPeriod toPeriod (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriodCompare payPeriodCompare (optional) + * @param int|null $ordinalCompare ordinalCompare (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare taxYearCompare (optional) + * @param int|null $fromPeriodCompare fromPeriodCompare (optional) + * @param int|null $toPeriodCompare toPeriodCompare (optional) + * @param bool|null $showPercentage If true then any variations will be shown as a percentage. (optional) + * @param float|null $minChange Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['varianceReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\VarianceReportReportResponse + */ + public function varianceReportReports( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriodCompare = null, + ?int $ordinalCompare = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $fromPeriodCompare = null, + ?int $toPeriodCompare = null, + ?bool $showPercentage = null, + ?float $minChange = null, + ?string $accept = null, + string $contentType = self::contentTypes['varianceReportReports'][0] + ): \SynergiTech\Staffology\Model\VarianceReportReportResponse + { + list($response) = $this->varianceReportReportsWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept, $contentType); + return $response; + } + + /** + * Operation varianceReportReportsWithHttpInfo + * + * Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriodCompare (optional) + * @param int|null $ordinalCompare (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $fromPeriodCompare (optional) + * @param int|null $toPeriodCompare (optional) + * @param bool|null $showPercentage If true then any variations will be shown as a percentage. (optional) + * @param float|null $minChange Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['varianceReportReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\VarianceReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function varianceReportReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriodCompare = null, + ?int $ordinalCompare = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $fromPeriodCompare = null, + ?int $toPeriodCompare = null, + ?bool $showPercentage = null, + ?float $minChange = null, + ?string $accept = null, + string $contentType = self::contentTypes['varianceReportReports'][0] + ): array + { + $request = $this->varianceReportReportsRequest($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\VarianceReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\VarianceReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\VarianceReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\VarianceReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\VarianceReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation varianceReportReportsAsync + * + * Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriodCompare (optional) + * @param int|null $ordinalCompare (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $fromPeriodCompare (optional) + * @param int|null $toPeriodCompare (optional) + * @param bool|null $showPercentage If true then any variations will be shown as a percentage. (optional) + * @param float|null $minChange Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['varianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function varianceReportReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + ?int $ordinal = null, + ?int $fromPeriod = null, + ?int $toPeriod = null, + ?\SynergiTech\Staffology\Model\PayPeriods $payPeriodCompare = null, + ?int $ordinalCompare = null, + ?\SynergiTech\Staffology\Model\TaxYear $taxYearCompare = null, + ?int $fromPeriodCompare = null, + ?int $toPeriodCompare = null, + ?bool $showPercentage = null, + ?float $minChange = null, + ?string $accept = null, + string $contentType = self::contentTypes['varianceReportReports'][0] + ): PromiseInterface + { + return $this->varianceReportReportsAsyncWithHttpInfo($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation varianceReportReportsAsyncWithHttpInfo + * + * Variance Report + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriodCompare (optional) + * @param int|null $ordinalCompare (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $fromPeriodCompare (optional) + * @param int|null $toPeriodCompare (optional) + * @param bool|null $showPercentage If true then any variations will be shown as a percentage. (optional) + * @param float|null $minChange Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['varianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function varianceReportReportsAsyncWithHttpInfo( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $fromPeriod = null, + $toPeriod = null, + $payPeriodCompare = null, + $ordinalCompare = null, + $taxYearCompare = null, + $fromPeriodCompare = null, + $toPeriodCompare = null, + $showPercentage = null, + $minChange = null, + $accept = null, + string $contentType = self::contentTypes['varianceReportReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\VarianceReportReportResponse'; + $request = $this->varianceReportReportsRequest($employerId, $payPeriod, $taxYear, $ordinal, $fromPeriod, $toPeriod, $payPeriodCompare, $ordinalCompare, $taxYearCompare, $fromPeriodCompare, $toPeriodCompare, $showPercentage, $minChange, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'varianceReportReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param int|null $ordinal (optional) + * @param int|null $fromPeriod (optional) + * @param int|null $toPeriod (optional) + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriodCompare (optional) + * @param int|null $ordinalCompare (optional) + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYearCompare (optional) + * @param int|null $fromPeriodCompare (optional) + * @param int|null $toPeriodCompare (optional) + * @param bool|null $showPercentage If true then any variations will be shown as a percentage. (optional) + * @param float|null $minChange Set a threshold for reporting variance. Ie, provide 0.10 and any variance below 10% will be ignored (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['varianceReportReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function varianceReportReportsRequest( + $employerId, + $payPeriod, + $taxYear, + $ordinal = null, + $fromPeriod = null, + $toPeriod = null, + $payPeriodCompare = null, + $ordinalCompare = null, + $taxYearCompare = null, + $fromPeriodCompare = null, + $toPeriodCompare = null, + $showPercentage = null, + $minChange = null, + $accept = null, + string $contentType = self::contentTypes['varianceReportReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling varianceReportReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling varianceReportReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling varianceReportReports' + ); + } + + + + + + + + + + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/variance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriod, + 'fromPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriod, + 'toPeriod', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriodCompare, + 'payPeriodCompare', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinalCompare, + 'ordinalCompare', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $taxYearCompare, + 'taxYearCompare', // param base name + 'TaxYear', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromPeriodCompare, + 'fromPeriodCompare', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toPeriodCompare, + 'toPeriodCompare', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $showPercentage, + 'showPercentage', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $minChange, + 'minChange', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'text/html', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation warningsReports + * + * Export Payroll Run Warnings + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod payPeriod (required) + * @param int $periodNumber periodNumber (required) + * @param string|null $accept accept (optional) + * @param int|null $ordinal ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['warningsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\WarningsReportReportResponse + */ + public function warningsReports( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['warningsReports'][0] + ): \SynergiTech\Staffology\Model\WarningsReportReportResponse + { + list($response) = $this->warningsReportsWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal, $contentType); + return $response; + } + + /** + * Operation warningsReportsWithHttpInfo + * + * Export Payroll Run Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['warningsReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\WarningsReportReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function warningsReportsWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['warningsReports'][0] + ): array + { + $request = $this->warningsReportsRequest($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\WarningsReportReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\WarningsReportReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\WarningsReportReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\WarningsReportReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\WarningsReportReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation warningsReportsAsync + * + * Export Payroll Run Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['warningsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function warningsReportsAsync( + string $employerId, + \SynergiTech\Staffology\Model\TaxYear $taxYear, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + int $periodNumber, + ?string $accept = null, + ?int $ordinal = 1, + string $contentType = self::contentTypes['warningsReports'][0] + ): PromiseInterface + { + return $this->warningsReportsAsyncWithHttpInfo($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation warningsReportsAsyncWithHttpInfo + * + * Export Payroll Run Warnings + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['warningsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function warningsReportsAsyncWithHttpInfo( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['warningsReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\WarningsReportReportResponse'; + $request = $this->warningsReportsRequest($employerId, $taxYear, $payPeriod, $periodNumber, $accept, $ordinal, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'warningsReports' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\TaxYear $taxYear (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod (required) + * @param int $periodNumber (required) + * @param string|null $accept (optional) + * @param int|null $ordinal (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['warningsReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function warningsReportsRequest( + $employerId, + $taxYear, + $payPeriod, + $periodNumber, + $accept = null, + $ordinal = 1, + string $contentType = self::contentTypes['warningsReports'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling warningsReports' + ); + } + + // verify the required parameter 'taxYear' is set + if ($taxYear === null || (is_array($taxYear) && count($taxYear) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $taxYear when calling warningsReports' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling warningsReports' + ); + } + + // verify the required parameter 'periodNumber' is set + if ($periodNumber === null || (is_array($periodNumber) && count($periodNumber) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $periodNumber when calling warningsReports' + ); + } + + + + + $resourcePath = '/employers/{employerId}/reports/{taxYear}/{payPeriod}/{periodNumber}/PayrollRunWarnings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ordinal, + 'ordinal', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($taxYear !== null) { + $resourcePath = str_replace( + '{' . 'taxYear' . '}', + ObjectSerializer::toPathValue($taxYear), + $resourcePath + ); + } + // path params + if ($payPeriod !== null) { + $resourcePath = str_replace( + '{' . 'payPeriod' . '}', + ObjectSerializer::toPathValue($payPeriod), + $resourcePath + ); + } + // path params + if ($periodNumber !== null) { + $resourcePath = str_replace( + '{' . 'periodNumber' . '}', + ObjectSerializer::toPathValue($periodNumber), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', 'application/pdf', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation ytdReports + * + * Year To Date Values + * + * @param string|null $employerId employerId (optional) + * @param string|null $accept accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function ytdReports( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['ytdReports'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->ytdReportsWithHttpInfo($employerId, $accept, $contentType); + return $response; + } + + /** + * Operation ytdReportsWithHttpInfo + * + * Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdReports'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function ytdReportsWithHttpInfo( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['ytdReports'][0] + ): array + { + $request = $this->ytdReportsRequest($employerId, $accept, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation ytdReportsAsync + * + * Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function ytdReportsAsync( + ?string $employerId = null, + ?string $accept = null, + string $contentType = self::contentTypes['ytdReports'][0] + ): PromiseInterface + { + return $this->ytdReportsAsyncWithHttpInfo($employerId, $accept, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation ytdReportsAsyncWithHttpInfo + * + * Year To Date Values + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function ytdReportsAsyncWithHttpInfo( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['ytdReports'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->ytdReportsRequest($employerId, $accept, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'ytdReports' + * + * @param string|null $employerId (optional) + * @param string|null $accept (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['ytdReports'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function ytdReportsRequest( + $employerId = null, + $accept = null, + string $contentType = self::contentTypes['ytdReports'][0] + ): Request + { + + + + + $resourcePath = '/ytd'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employerId, + 'employerId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ReportsAsyncApi.php b/src/Api/ReportsAsyncApi.php new file mode 100644 index 0000000..9c6c065 --- /dev/null +++ b/src/Api/ReportsAsyncApi.php @@ -0,0 +1,492 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation queueGrossToNetReportReportsAsync + * + * Gross To Net async (beta) + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest|null $contractGrossToNetReportRequest The request payload for the gross to net report (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueGrossToNetReportReportsAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractJobResponse + */ + public function queueGrossToNetReportReportsAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractGrossToNetReportRequest $contractGrossToNetReportRequest = null, + string $contentType = self::contentTypes['queueGrossToNetReportReportsAsync'][0] + ): \SynergiTech\Staffology\Model\ContractJobResponse + { + list($response) = $this->queueGrossToNetReportReportsAsyncWithHttpInfo($employerId, $contractGrossToNetReportRequest, $contentType); + return $response; + } + + /** + * Operation queueGrossToNetReportReportsAsyncWithHttpInfo + * + * Gross To Net async (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest|null $contractGrossToNetReportRequest The request payload for the gross to net report (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueGrossToNetReportReportsAsync'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractJobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function queueGrossToNetReportReportsAsyncWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractGrossToNetReportRequest $contractGrossToNetReportRequest = null, + string $contentType = self::contentTypes['queueGrossToNetReportReportsAsync'][0] + ): array + { + $request = $this->queueGrossToNetReportReportsAsyncRequest($employerId, $contractGrossToNetReportRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if (in_array('\SynergiTech\Staffology\Model\ContractJobResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractJobResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractJobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractJobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation queueGrossToNetReportReportsAsyncAsync + * + * Gross To Net async (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest|null $contractGrossToNetReportRequest The request payload for the gross to net report (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueGrossToNetReportReportsAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueGrossToNetReportReportsAsyncAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractGrossToNetReportRequest $contractGrossToNetReportRequest = null, + string $contentType = self::contentTypes['queueGrossToNetReportReportsAsync'][0] + ): PromiseInterface + { + return $this->queueGrossToNetReportReportsAsyncAsyncWithHttpInfo($employerId, $contractGrossToNetReportRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation queueGrossToNetReportReportsAsyncAsyncWithHttpInfo + * + * Gross To Net async (beta) + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest|null $contractGrossToNetReportRequest The request payload for the gross to net report (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueGrossToNetReportReportsAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function queueGrossToNetReportReportsAsyncAsyncWithHttpInfo( + $employerId, + $contractGrossToNetReportRequest = null, + string $contentType = self::contentTypes['queueGrossToNetReportReportsAsync'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractJobResponse'; + $request = $this->queueGrossToNetReportReportsAsyncRequest($employerId, $contractGrossToNetReportRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'queueGrossToNetReportReportsAsync' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractGrossToNetReportRequest|null $contractGrossToNetReportRequest The request payload for the gross to net report (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['queueGrossToNetReportReportsAsync'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queueGrossToNetReportReportsAsyncRequest( + $employerId, + $contractGrossToNetReportRequest = null, + string $contentType = self::contentTypes['queueGrossToNetReportReportsAsync'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling queueGrossToNetReportReportsAsync' + ); + } + + + + $resourcePath = '/employers/{employerId}/reports-async/gross-to-net'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractGrossToNetReportRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractGrossToNetReportRequest)); + } else { + $httpBody = $contractGrossToNetReportRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TagApi.php b/src/Api/TagApi.php new file mode 100644 index 0000000..4a188e7 --- /dev/null +++ b/src/Api/TagApi.php @@ -0,0 +1,2797 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteTag' => [ + 'application/json', + ], + 'deleteTagTag' => [ + 'application/json', + ], + 'getTag' => [ + 'application/json', + ], + 'getTagTag' => [ + 'application/json', + ], + 'indexTag' => [ + 'application/json', + ], + 'updateTag' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateTagTag' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createTag + * + * Create Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\Tag + */ + public function createTag( + string $employerId, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['createTag'][0] + ): \SynergiTech\Staffology\Model\Tag + { + list($response) = $this->createTagWithHttpInfo($employerId, $tag, $contentType); + return $response; + } + + /** + * Operation createTagWithHttpInfo + * + * Create Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\Tag, HTTP status code, HTTP response headers (array of strings) + */ + public function createTagWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['createTag'][0] + ): array + { + $request = $this->createTagRequest($employerId, $tag, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Tag', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tag' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tag', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tag'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tag', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTagAsync + * + * Create Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTagAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['createTag'][0] + ): PromiseInterface + { + return $this->createTagAsyncWithHttpInfo($employerId, $tag, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTagAsyncWithHttpInfo + * + * Create Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTagAsyncWithHttpInfo( + $employerId, + $tag = null, + string $contentType = self::contentTypes['createTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tag'; + $request = $this->createTagRequest($employerId, $tag, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createTagRequest( + $employerId, + $tag = null, + string $contentType = self::contentTypes['createTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createTag' + ); + } + + + + $resourcePath = '/employers/{employerId}/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tag)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tag)); + } else { + $httpBody = $tag; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteTag + * + * Delete Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteTag( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteTag'][0] + ): void + { + $this->deleteTagWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteTagWithHttpInfo + * + * Delete Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteTagWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteTag'][0] + ): array + { + $request = $this->deleteTagRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteTagAsync + * + * Delete Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTagAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['deleteTag'][0] + ): PromiseInterface + { + return $this->deleteTagAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteTagAsyncWithHttpInfo + * + * Delete Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTagAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['deleteTag'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteTagRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteTagRequest( + $employerId, + $code, + string $contentType = self::contentTypes['deleteTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteTag' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling deleteTag' + ); + } + + + $resourcePath = '/employers/{employerId}/tags/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteTagTag + * + * Delete Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteTagTag( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteTagTag'][0] + ): void + { + $this->deleteTagTagWithHttpInfo($employerId, $code, $contentType); + } + + /** + * Operation deleteTagTagWithHttpInfo + * + * Delete Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteTagTagWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteTagTag'][0] + ): array + { + $request = $this->deleteTagTagRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteTagTagAsync + * + * Delete Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTagTagAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['deleteTagTag'][0] + ): PromiseInterface + { + return $this->deleteTagTagAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteTagTagAsyncWithHttpInfo + * + * Delete Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTagTagAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteTagTag'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteTagTagRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTagTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to delete. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteTagTagRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['deleteTagTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteTagTag' + ); + } + + + + $resourcePath = '/employers/{employerId}/tags/tag'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTag + * + * Get Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tag + */ + public function getTag( + string $employerId, + string $code, + string $contentType = self::contentTypes['getTag'][0] + ): \SynergiTech\Staffology\Model\Tag + { + list($response) = $this->getTagWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getTagWithHttpInfo + * + * Get Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tag, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagWithHttpInfo( + string $employerId, + string $code, + string $contentType = self::contentTypes['getTag'][0] + ): array + { + $request = $this->getTagRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tag', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tag' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tag', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tag'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tag', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTagAsync + * + * Get Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTagAsync( + string $employerId, + string $code, + string $contentType = self::contentTypes['getTag'][0] + ): PromiseInterface + { + return $this->getTagAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTagAsyncWithHttpInfo + * + * Get Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTagAsyncWithHttpInfo( + $employerId, + $code, + string $contentType = self::contentTypes['getTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tag'; + $request = $this->getTagRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The code of the Tag you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTagRequest( + $employerId, + $code, + string $contentType = self::contentTypes['getTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getTag' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling getTag' + ); + } + + + $resourcePath = '/employers/{employerId}/tags/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTagTag + * + * Get Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tag + */ + public function getTagTag( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getTagTag'][0] + ): \SynergiTech\Staffology\Model\Tag + { + list($response) = $this->getTagTagWithHttpInfo($employerId, $code, $contentType); + return $response; + } + + /** + * Operation getTagTagWithHttpInfo + * + * Get Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tag, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagTagWithHttpInfo( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getTagTag'][0] + ): array + { + $request = $this->getTagTagRequest($employerId, $code, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tag', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tag' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tag', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tag'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tag', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTagTagAsync + * + * Get Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTagTagAsync( + string $employerId, + ?string $code = null, + string $contentType = self::contentTypes['getTagTag'][0] + ): PromiseInterface + { + return $this->getTagTagAsyncWithHttpInfo($employerId, $code, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTagTagAsyncWithHttpInfo + * + * Get Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTagTagAsyncWithHttpInfo( + $employerId, + $code = null, + string $contentType = self::contentTypes['getTagTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tag'; + $request = $this->getTagTagRequest($employerId, $code, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTagTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The code of the Tag you want to retrieve. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTagTagRequest( + $employerId, + $code = null, + string $contentType = self::contentTypes['getTagTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getTagTag' + ); + } + + + + $resourcePath = '/employers/{employerId}/tags/Tag'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexTag + * + * List Tags + * + * @param string $employerId The Id of the Employer for which you want to list Tags (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexTag( + string $employerId, + string $contentType = self::contentTypes['indexTag'][0] + ): array + { + list($response) = $this->indexTagWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexTagWithHttpInfo + * + * List Tags + * + * @param string $employerId The Id of the Employer for which you want to list Tags (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexTagWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexTag'][0] + ): array + { + $request = $this->indexTagRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexTagAsync + * + * List Tags + * + * @param string $employerId The Id of the Employer for which you want to list Tags (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTagAsync( + string $employerId, + string $contentType = self::contentTypes['indexTag'][0] + ): PromiseInterface + { + return $this->indexTagAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexTagAsyncWithHttpInfo + * + * List Tags + * + * @param string $employerId The Id of the Employer for which you want to list Tags (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTagAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexTagRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexTag' + * + * @param string $employerId The Id of the Employer for which you want to list Tags (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexTagRequest( + $employerId, + string $contentType = self::contentTypes['indexTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexTag' + ); + } + + + $resourcePath = '/employers/{employerId}/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTag + * + * Update Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The existing code of the Tag you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tag + */ + public function updateTag( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTag'][0] + ): \SynergiTech\Staffology\Model\Tag + { + list($response) = $this->updateTagWithHttpInfo($employerId, $code, $tag, $contentType); + return $response; + } + + /** + * Operation updateTagWithHttpInfo + * + * Update Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The existing code of the Tag you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tag, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTagWithHttpInfo( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTag'][0] + ): array + { + $request = $this->updateTagRequest($employerId, $code, $tag, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tag', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tag' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tag', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tag'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tag', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTagAsync + * + * Update Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The existing code of the Tag you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTagAsync( + string $employerId, + string $code, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTag'][0] + ): PromiseInterface + { + return $this->updateTagAsyncWithHttpInfo($employerId, $code, $tag, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTagAsyncWithHttpInfo + * + * Update Tag (deprecated) + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The existing code of the Tag you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTagAsyncWithHttpInfo( + $employerId, + $code, + $tag = null, + string $contentType = self::contentTypes['updateTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tag'; + $request = $this->updateTagRequest($employerId, $code, $tag, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string $code The existing code of the Tag you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTagRequest( + $employerId, + $code, + $tag = null, + string $contentType = self::contentTypes['updateTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateTag' + ); + } + + // verify the required parameter 'code' is set + if ($code === null || (is_array($code) && count($code) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $code when calling updateTag' + ); + } + + + + $resourcePath = '/employers/{employerId}/tags/{code}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($code !== null) { + $resourcePath = str_replace( + '{' . 'code' . '}', + ObjectSerializer::toPathValue($code), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tag)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tag)); + } else { + $httpBody = $tag; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTagTag + * + * Update Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The existing code of the Tag you want to update. (optional) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tag + */ + public function updateTagTag( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTagTag'][0] + ): \SynergiTech\Staffology\Model\Tag + { + list($response) = $this->updateTagTagWithHttpInfo($employerId, $code, $tag, $contentType); + return $response; + } + + /** + * Operation updateTagTagWithHttpInfo + * + * Update Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The existing code of the Tag you want to update. (optional) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTagTag'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tag, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTagTagWithHttpInfo( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTagTag'][0] + ): array + { + $request = $this->updateTagTagRequest($employerId, $code, $tag, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tag', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tag' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tag', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tag'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tag', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTagTagAsync + * + * Update Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The existing code of the Tag you want to update. (optional) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTagTagAsync( + string $employerId, + ?string $code = null, + ?\SynergiTech\Staffology\Model\Tag $tag = null, + string $contentType = self::contentTypes['updateTagTag'][0] + ): PromiseInterface + { + return $this->updateTagTagAsyncWithHttpInfo($employerId, $code, $tag, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTagTagAsyncWithHttpInfo + * + * Update Tag + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The existing code of the Tag you want to update. (optional) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTagTagAsyncWithHttpInfo( + $employerId, + $code = null, + $tag = null, + string $contentType = self::contentTypes['updateTagTag'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tag'; + $request = $this->updateTagTagRequest($employerId, $code, $tag, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTagTag' + * + * @param string $employerId The Id of the Employer to which the Tag belongs. (required) + * @param string|null $code The existing code of the Tag you want to update. (optional) + * @param \SynergiTech\Staffology\Model\Tag|null $tag The new values for the Tag you want to update. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTagTag'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTagTagRequest( + $employerId, + $code = null, + $tag = null, + string $contentType = self::contentTypes['updateTagTag'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateTagTag' + ); + } + + + + + $resourcePath = '/employers/{employerId}/tags/tag'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $code, + 'code', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tag)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tag)); + } else { + $httpBody = $tag; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TenantApi.php b/src/Api/TenantApi.php new file mode 100644 index 0000000..85fd369 --- /dev/null +++ b/src/Api/TenantApi.php @@ -0,0 +1,18769 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'adminUsersTenant' => [ + 'application/json', + ], + 'billTenant' => [ + 'application/json', + ], + 'billsTenant' => [ + 'application/json', + ], + 'createBillsTenant' => [ + 'application/json', + ], + 'createPayrollSquadTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createPricingTableTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'createTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deletePayrollSquadMemberTenant' => [ + 'application/json', + ], + 'deletePayrollSquadTenant' => [ + 'application/json', + ], + 'deletePricingTableTenant' => [ + 'application/json', + ], + 'disabledTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'employerCreationTenant' => [ + 'application/json', + ], + 'employerUsageTenant' => [ + 'application/json', + ], + 'employerUsersTenant' => [ + 'application/json', + ], + 'getApiMailingListReportByIdTenant' => [ + 'application/json', + ], + 'getApiMailingListReportTenant' => [ + 'application/json', + ], + 'getEmployersTenant' => [ + 'application/json', + ], + 'getPayrollSquadTenant' => [ + 'application/json', + ], + 'getPayrollSquadsTenant' => [ + 'application/json', + ], + 'getPricingTableTenant' => [ + 'application/json', + ], + 'getPricingTablesTenant' => [ + 'application/json', + ], + 'getRtiSubmissionSettingsTenant' => [ + 'application/json', + ], + 'getTenant' => [ + 'application/json', + ], + 'getUsersWithNoBillableActivityTenant' => [ + 'application/json', + ], + 'netSuiteBillingTenant' => [ + 'application/json', + ], + 'payrollSquadAddMemberTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'payrollSquadUpdateEmployersTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'removeAdminUserTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setAccountingIdTenant' => [ + 'application/json', + ], + 'setAddressTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setBureauRedirectEmailAddressTenant' => [ + 'application/json', + ], + 'setBusinessNameTenant' => [ + 'application/json', + ], + 'setCountryTenant' => [ + 'application/json', + ], + 'setEmployeeCountTenant' => [ + 'application/json', + ], + 'setEvcTenant' => [ + 'application/json', + ], + 'setIndustryTenant' => [ + 'application/json', + ], + 'setMonthlyMinimumTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'setPricingTableIdTenant' => [ + 'application/json', + ], + 'setTenantTenant' => [ + 'application/json', + ], + 'updateBillTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateCssColorsTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateCssTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateFavIconTenant' => [ + 'multipart/form-data', + ], + 'updateLogoTenant' => [ + 'multipart/form-data', + ], + 'updatePricingTableTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateRtiSubmissionSettingsTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'updateUserTenant' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'usageTenant' => [ + 'application/json', + ], + 'userBillsTenant' => [ + 'application/json', + ], + 'userEmployersTenant' => [ + 'application/json', + ], + 'userTenant' => [ + 'application/json', + ], + 'usersSearchTenant' => [ + 'application/json', + ], + 'usersTenant' => [ + 'application/json', + ], + 'weeklyActivityTenant' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation addAdminUserTenant + * + * Add Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAdminUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function addAdminUserTenant( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['addAdminUserTenant'][0] + ): void + { + $this->addAdminUserTenantWithHttpInfo($id, $body, $contentType); + } + + /** + * Operation addAdminUserTenantWithHttpInfo + * + * Add Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAdminUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function addAdminUserTenantWithHttpInfo( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['addAdminUserTenant'][0] + ): array + { + $request = $this->addAdminUserTenantRequest($id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation addAdminUserTenantAsync + * + * Add Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addAdminUserTenantAsync( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['addAdminUserTenant'][0] + ): PromiseInterface + { + return $this->addAdminUserTenantAsyncWithHttpInfo($id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addAdminUserTenantAsyncWithHttpInfo + * + * Add Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function addAdminUserTenantAsyncWithHttpInfo( + $id, + $body = null, + string $contentType = self::contentTypes['addAdminUserTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->addAdminUserTenantRequest($id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addAdminUserTenant' + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function addAdminUserTenantRequest( + $id, + $body = null, + string $contentType = self::contentTypes['addAdminUserTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling addAdminUserTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/admins'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation adminUsersTenant + * + * List Admin Users + * + * @param string $id The Id of the Tenant you want to list admin Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['adminUsersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function adminUsersTenant( + string $id, + string $contentType = self::contentTypes['adminUsersTenant'][0] + ): array + { + list($response) = $this->adminUsersTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation adminUsersTenantWithHttpInfo + * + * List Admin Users + * + * @param string $id The Id of the Tenant you want to list admin Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['adminUsersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function adminUsersTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['adminUsersTenant'][0] + ): array + { + $request = $this->adminUsersTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation adminUsersTenantAsync + * + * List Admin Users + * + * @param string $id The Id of the Tenant you want to list admin Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['adminUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function adminUsersTenantAsync( + string $id, + string $contentType = self::contentTypes['adminUsersTenant'][0] + ): PromiseInterface + { + return $this->adminUsersTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation adminUsersTenantAsyncWithHttpInfo + * + * List Admin Users + * + * @param string $id The Id of the Tenant you want to list admin Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['adminUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function adminUsersTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['adminUsersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->adminUsersTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'adminUsersTenant' + * + * @param string $id The Id of the Tenant you want to list admin Users for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['adminUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function adminUsersTenantRequest( + $id, + string $contentType = self::contentTypes['adminUsersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling adminUsersTenant' + ); + } + + + $resourcePath = '/tenants/{id}/users/admins'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation billTenant + * + * Get Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year year (required) + * @param int $month month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\UsageBill + */ + public function billTenant( + string $id, + int $year, + int $month, + string $billId, + string $contentType = self::contentTypes['billTenant'][0] + ): \SynergiTech\Staffology\Model\UsageBill + { + list($response) = $this->billTenantWithHttpInfo($id, $year, $month, $billId, $contentType); + return $response; + } + + /** + * Operation billTenantWithHttpInfo + * + * Get Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\UsageBill, HTTP status code, HTTP response headers (array of strings) + */ + public function billTenantWithHttpInfo( + string $id, + int $year, + int $month, + string $billId, + string $contentType = self::contentTypes['billTenant'][0] + ): array + { + $request = $this->billTenantRequest($id, $year, $month, $billId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\UsageBill', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\UsageBill' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\UsageBill', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\UsageBill', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation billTenantAsync + * + * Get Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billTenantAsync( + string $id, + int $year, + int $month, + string $billId, + string $contentType = self::contentTypes['billTenant'][0] + ): PromiseInterface + { + return $this->billTenantAsyncWithHttpInfo($id, $year, $month, $billId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation billTenantAsyncWithHttpInfo + * + * Get Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billTenantAsyncWithHttpInfo( + $id, + $year, + $month, + $billId, + string $contentType = self::contentTypes['billTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + $request = $this->billTenantRequest($id, $year, $month, $billId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'billTenant' + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function billTenantRequest( + $id, + $year, + $month, + $billId, + string $contentType = self::contentTypes['billTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling billTenant' + ); + } + + // verify the required parameter 'year' is set + if ($year === null || (is_array($year) && count($year) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $year when calling billTenant' + ); + } + + // verify the required parameter 'month' is set + if ($month === null || (is_array($month) && count($month) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $month when calling billTenant' + ); + } + + // verify the required parameter 'billId' is set + if ($billId === null || (is_array($billId) && count($billId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $billId when calling billTenant' + ); + } + + + $resourcePath = '/tenants/{id}/bills/{year}/{month}/{billId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($year !== null) { + $resourcePath = str_replace( + '{' . 'year' . '}', + ObjectSerializer::toPathValue($year), + $resourcePath + ); + } + // path params + if ($month !== null) { + $resourcePath = str_replace( + '{' . 'month' . '}', + ObjectSerializer::toPathValue($month), + $resourcePath + ); + } + // path params + if ($billId !== null) { + $resourcePath = str_replace( + '{' . 'billId' . '}', + ObjectSerializer::toPathValue($billId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation billsTenant + * + * Get Bills + * + * @param string $id The Id of the Tenant you want to list bills for. (required) + * @param int $year year (required) + * @param int $month month (required) + * @param bool|null $includeNetSuiteBills includeNetSuiteBills (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function billsTenant( + string $id, + int $year, + int $month, + ?bool $includeNetSuiteBills = false, + string $contentType = self::contentTypes['billsTenant'][0] + ): array + { + list($response) = $this->billsTenantWithHttpInfo($id, $year, $month, $includeNetSuiteBills, $contentType); + return $response; + } + + /** + * Operation billsTenantWithHttpInfo + * + * Get Bills + * + * @param string $id The Id of the Tenant you want to list bills for. (required) + * @param int $year (required) + * @param int $month (required) + * @param bool|null $includeNetSuiteBills (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function billsTenantWithHttpInfo( + string $id, + int $year, + int $month, + ?bool $includeNetSuiteBills = false, + string $contentType = self::contentTypes['billsTenant'][0] + ): array + { + $request = $this->billsTenantRequest($id, $year, $month, $includeNetSuiteBills, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation billsTenantAsync + * + * Get Bills + * + * @param string $id The Id of the Tenant you want to list bills for. (required) + * @param int $year (required) + * @param int $month (required) + * @param bool|null $includeNetSuiteBills (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billsTenantAsync( + string $id, + int $year, + int $month, + ?bool $includeNetSuiteBills = false, + string $contentType = self::contentTypes['billsTenant'][0] + ): PromiseInterface + { + return $this->billsTenantAsyncWithHttpInfo($id, $year, $month, $includeNetSuiteBills, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation billsTenantAsyncWithHttpInfo + * + * Get Bills + * + * @param string $id The Id of the Tenant you want to list bills for. (required) + * @param int $year (required) + * @param int $month (required) + * @param bool|null $includeNetSuiteBills (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function billsTenantAsyncWithHttpInfo( + $id, + $year, + $month, + $includeNetSuiteBills = false, + string $contentType = self::contentTypes['billsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->billsTenantRequest($id, $year, $month, $includeNetSuiteBills, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'billsTenant' + * + * @param string $id The Id of the Tenant you want to list bills for. (required) + * @param int $year (required) + * @param int $month (required) + * @param bool|null $includeNetSuiteBills (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['billsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function billsTenantRequest( + $id, + $year, + $month, + $includeNetSuiteBills = false, + string $contentType = self::contentTypes['billsTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling billsTenant' + ); + } + + // verify the required parameter 'year' is set + if ($year === null || (is_array($year) && count($year) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $year when calling billsTenant' + ); + } + + // verify the required parameter 'month' is set + if ($month === null || (is_array($month) && count($month) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $month when calling billsTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/bills/{year}/{month}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $includeNetSuiteBills, + 'includeNetSuiteBills', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($year !== null) { + $resourcePath = str_replace( + '{' . 'year' . '}', + ObjectSerializer::toPathValue($year), + $resourcePath + ); + } + // path params + if ($month !== null) { + $resourcePath = str_replace( + '{' . 'month' . '}', + ObjectSerializer::toPathValue($month), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createBillsTenant + * + * Create Bills for Period + * + * @param int|null $month month (optional) + * @param int|null $year year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBillsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createBillsTenant( + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['createBillsTenant'][0] + ): void + { + $this->createBillsTenantWithHttpInfo($month, $year, $contentType); + } + + /** + * Operation createBillsTenantWithHttpInfo + * + * Create Bills for Period + * + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBillsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createBillsTenantWithHttpInfo( + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['createBillsTenant'][0] + ): array + { + $request = $this->createBillsTenantRequest($month, $year, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createBillsTenantAsync + * + * Create Bills for Period + * + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createBillsTenantAsync( + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['createBillsTenant'][0] + ): PromiseInterface + { + return $this->createBillsTenantAsyncWithHttpInfo($month, $year, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createBillsTenantAsyncWithHttpInfo + * + * Create Bills for Period + * + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createBillsTenantAsyncWithHttpInfo( + $month = null, + $year = null, + string $contentType = self::contentTypes['createBillsTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createBillsTenantRequest($month, $year, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createBillsTenant' + * + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createBillsTenantRequest( + $month = null, + $year = null, + string $contentType = self::contentTypes['createBillsTenant'][0] + ): Request + { + + + + + $resourcePath = '/tenants/bills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $month, + 'month', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $year, + 'year', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createPayrollSquadTenant + * + * Create Payroll Squad + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadRequest|null $contractPayrollSquadRequest contractPayrollSquadRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayrollSquadResponse + */ + public function createPayrollSquadTenant( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadRequest $contractPayrollSquadRequest = null, + string $contentType = self::contentTypes['createPayrollSquadTenant'][0] + ): \SynergiTech\Staffology\Model\ContractPayrollSquadResponse + { + list($response) = $this->createPayrollSquadTenantWithHttpInfo($id, $contractPayrollSquadRequest, $contentType); + return $response; + } + + /** + * Operation createPayrollSquadTenantWithHttpInfo + * + * Create Payroll Squad + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadRequest|null $contractPayrollSquadRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayrollSquadResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createPayrollSquadTenantWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadRequest $contractPayrollSquadRequest = null, + string $contentType = self::contentTypes['createPayrollSquadTenant'][0] + ): array + { + $request = $this->createPayrollSquadTenantRequest($id, $contractPayrollSquadRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPayrollSquadTenantAsync + * + * Create Payroll Squad + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadRequest|null $contractPayrollSquadRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayrollSquadTenantAsync( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadRequest $contractPayrollSquadRequest = null, + string $contentType = self::contentTypes['createPayrollSquadTenant'][0] + ): PromiseInterface + { + return $this->createPayrollSquadTenantAsyncWithHttpInfo($id, $contractPayrollSquadRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPayrollSquadTenantAsyncWithHttpInfo + * + * Create Payroll Squad + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadRequest|null $contractPayrollSquadRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPayrollSquadTenantAsyncWithHttpInfo( + $id, + $contractPayrollSquadRequest = null, + string $contentType = self::contentTypes['createPayrollSquadTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse'; + $request = $this->createPayrollSquadTenantRequest($id, $contractPayrollSquadRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPayrollSquadTenant' + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadRequest|null $contractPayrollSquadRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPayrollSquadTenantRequest( + $id, + $contractPayrollSquadRequest = null, + string $contentType = self::contentTypes['createPayrollSquadTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling createPayrollSquadTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/payrollsquad'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayrollSquadRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayrollSquadRequest)); + } else { + $httpBody = $contractPayrollSquadRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createPricingTableTenant + * + * Create PricingTable + * + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PricingTable + */ + public function createPricingTableTenant( + string $id, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['createPricingTableTenant'][0] + ): \SynergiTech\Staffology\Model\PricingTable + { + list($response) = $this->createPricingTableTenantWithHttpInfo($id, $pricingTable, $contentType); + return $response; + } + + /** + * Operation createPricingTableTenantWithHttpInfo + * + * Create PricingTable + * + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PricingTable, HTTP status code, HTTP response headers (array of strings) + */ + public function createPricingTableTenantWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['createPricingTableTenant'][0] + ): array + { + $request = $this->createPricingTableTenantRequest($id, $pricingTable, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\PricingTable', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PricingTable' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PricingTable', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PricingTable', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPricingTableTenantAsync + * + * Create PricingTable + * + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPricingTableTenantAsync( + string $id, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['createPricingTableTenant'][0] + ): PromiseInterface + { + return $this->createPricingTableTenantAsyncWithHttpInfo($id, $pricingTable, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPricingTableTenantAsyncWithHttpInfo + * + * Create PricingTable + * + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createPricingTableTenantAsyncWithHttpInfo( + $id, + $pricingTable = null, + string $contentType = self::contentTypes['createPricingTableTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + $request = $this->createPricingTableTenantRequest($id, $pricingTable, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPricingTableTenant' + * + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPricingTableTenantRequest( + $id, + $pricingTable = null, + string $contentType = self::contentTypes['createPricingTableTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling createPricingTableTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/pricingtables'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pricingTable)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pricingTable)); + } else { + $httpBody = $pricingTable; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createTenant + * + * Create a Tenant + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function createTenant( + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['createTenant'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->createTenantWithHttpInfo($tenant, $contentType); + return $response; + } + + /** + * Operation createTenantWithHttpInfo + * + * Create a Tenant + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function createTenantWithHttpInfo( + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['createTenant'][0] + ): array + { + $request = $this->createTenantRequest($tenant, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTenantAsync + * + * Create a Tenant + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTenantAsync( + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['createTenant'][0] + ): PromiseInterface + { + return $this->createTenantAsyncWithHttpInfo($tenant, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTenantAsyncWithHttpInfo + * + * Create a Tenant + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTenantAsyncWithHttpInfo( + $tenant = null, + string $contentType = self::contentTypes['createTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->createTenantRequest($tenant, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createTenant' + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createTenantRequest( + $tenant = null, + string $contentType = self::contentTypes['createTenant'][0] + ): Request + { + + + + $resourcePath = '/tenants'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tenant)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tenant)); + } else { + $httpBody = $tenant; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayrollSquadMemberTenant + * + * Delete Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $payrollSquadMemberId The id of payroll squad member (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadMemberTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayrollSquadMemberTenant( + string $id, + string $payrollSquadId, + string $payrollSquadMemberId, + string $contentType = self::contentTypes['deletePayrollSquadMemberTenant'][0] + ): void + { + $this->deletePayrollSquadMemberTenantWithHttpInfo($id, $payrollSquadId, $payrollSquadMemberId, $contentType); + } + + /** + * Operation deletePayrollSquadMemberTenantWithHttpInfo + * + * Delete Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $payrollSquadMemberId The id of payroll squad member (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadMemberTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayrollSquadMemberTenantWithHttpInfo( + string $id, + string $payrollSquadId, + string $payrollSquadMemberId, + string $contentType = self::contentTypes['deletePayrollSquadMemberTenant'][0] + ): array + { + $request = $this->deletePayrollSquadMemberTenantRequest($id, $payrollSquadId, $payrollSquadMemberId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayrollSquadMemberTenantAsync + * + * Delete Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $payrollSquadMemberId The id of payroll squad member (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayrollSquadMemberTenantAsync( + string $id, + string $payrollSquadId, + string $payrollSquadMemberId, + string $contentType = self::contentTypes['deletePayrollSquadMemberTenant'][0] + ): PromiseInterface + { + return $this->deletePayrollSquadMemberTenantAsyncWithHttpInfo($id, $payrollSquadId, $payrollSquadMemberId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayrollSquadMemberTenantAsyncWithHttpInfo + * + * Delete Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $payrollSquadMemberId The id of payroll squad member (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayrollSquadMemberTenantAsyncWithHttpInfo( + $id, + $payrollSquadId, + $payrollSquadMemberId, + string $contentType = self::contentTypes['deletePayrollSquadMemberTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayrollSquadMemberTenantRequest($id, $payrollSquadId, $payrollSquadMemberId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayrollSquadMemberTenant' + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $payrollSquadMemberId The id of payroll squad member (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayrollSquadMemberTenantRequest( + $id, + $payrollSquadId, + $payrollSquadMemberId, + string $contentType = self::contentTypes['deletePayrollSquadMemberTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePayrollSquadMemberTenant' + ); + } + + // verify the required parameter 'payrollSquadId' is set + if ($payrollSquadId === null || (is_array($payrollSquadId) && count($payrollSquadId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payrollSquadId when calling deletePayrollSquadMemberTenant' + ); + } + + // verify the required parameter 'payrollSquadMemberId' is set + if ($payrollSquadMemberId === null || (is_array($payrollSquadMemberId) && count($payrollSquadMemberId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payrollSquadMemberId when calling deletePayrollSquadMemberTenant' + ); + } + + + $resourcePath = '/tenants/{id}/payrollsquad/{payrollSquadId}/member/{payrollSquadMemberId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($payrollSquadId !== null) { + $resourcePath = str_replace( + '{' . 'payrollSquadId' . '}', + ObjectSerializer::toPathValue($payrollSquadId), + $resourcePath + ); + } + // path params + if ($payrollSquadMemberId !== null) { + $resourcePath = str_replace( + '{' . 'payrollSquadMemberId' . '}', + ObjectSerializer::toPathValue($payrollSquadMemberId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayrollSquadTenant + * + * Delete Payroll Squad and it's Members and Employers. + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePayrollSquadTenant( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['deletePayrollSquadTenant'][0] + ): void + { + $this->deletePayrollSquadTenantWithHttpInfo($id, $payrollSquadId, $contentType); + } + + /** + * Operation deletePayrollSquadTenantWithHttpInfo + * + * Delete Payroll Squad and it's Members and Employers. + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePayrollSquadTenantWithHttpInfo( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['deletePayrollSquadTenant'][0] + ): array + { + $request = $this->deletePayrollSquadTenantRequest($id, $payrollSquadId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePayrollSquadTenantAsync + * + * Delete Payroll Squad and it's Members and Employers. + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayrollSquadTenantAsync( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['deletePayrollSquadTenant'][0] + ): PromiseInterface + { + return $this->deletePayrollSquadTenantAsyncWithHttpInfo($id, $payrollSquadId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePayrollSquadTenantAsyncWithHttpInfo + * + * Delete Payroll Squad and it's Members and Employers. + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePayrollSquadTenantAsyncWithHttpInfo( + $id, + $payrollSquadId, + string $contentType = self::contentTypes['deletePayrollSquadTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePayrollSquadTenantRequest($id, $payrollSquadId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayrollSquadTenant' + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePayrollSquadTenantRequest( + $id, + $payrollSquadId, + string $contentType = self::contentTypes['deletePayrollSquadTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePayrollSquadTenant' + ); + } + + // verify the required parameter 'payrollSquadId' is set + if ($payrollSquadId === null || (is_array($payrollSquadId) && count($payrollSquadId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payrollSquadId when calling deletePayrollSquadTenant' + ); + } + + + $resourcePath = '/tenants/{id}/payrollsquad/{payrollSquadId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($payrollSquadId !== null) { + $resourcePath = str_replace( + '{' . 'payrollSquadId' . '}', + ObjectSerializer::toPathValue($payrollSquadId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePricingTableTenant + * + * Delete PricingTable + * + * @param string $id id (required) + * @param string $pricingTableId pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deletePricingTableTenant( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['deletePricingTableTenant'][0] + ): void + { + $this->deletePricingTableTenantWithHttpInfo($id, $pricingTableId, $contentType); + } + + /** + * Operation deletePricingTableTenantWithHttpInfo + * + * Delete PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePricingTableTenantWithHttpInfo( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['deletePricingTableTenant'][0] + ): array + { + $request = $this->deletePricingTableTenantRequest($id, $pricingTableId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deletePricingTableTenantAsync + * + * Delete PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePricingTableTenantAsync( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['deletePricingTableTenant'][0] + ): PromiseInterface + { + return $this->deletePricingTableTenantAsyncWithHttpInfo($id, $pricingTableId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePricingTableTenantAsyncWithHttpInfo + * + * Delete PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deletePricingTableTenantAsyncWithHttpInfo( + $id, + $pricingTableId, + string $contentType = self::contentTypes['deletePricingTableTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deletePricingTableTenantRequest($id, $pricingTableId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePricingTableTenant' + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePricingTableTenantRequest( + $id, + $pricingTableId, + string $contentType = self::contentTypes['deletePricingTableTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deletePricingTableTenant' + ); + } + + // verify the required parameter 'pricingTableId' is set + if ($pricingTableId === null || (is_array($pricingTableId) && count($pricingTableId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pricingTableId when calling deletePricingTableTenant' + ); + } + + + $resourcePath = '/tenants/{id}/pricingtables/{pricingTableId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($pricingTableId !== null) { + $resourcePath = str_replace( + '{' . 'pricingTableId' . '}', + ObjectSerializer::toPathValue($pricingTableId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation disabledTenant + * + * Disable User Account + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param bool|null $disabled Whether or not the account should be disabled. (optional) + * @param bool|null $loginDisabled Whether or not the account should have log in permissions. (optional) + * @param string|null $body A message to show the user explaining why the account is disabled. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disabledTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function disabledTenant( + string $id, + string $userId, + ?bool $disabled = null, + ?bool $loginDisabled = null, + ?string $body = null, + string $contentType = self::contentTypes['disabledTenant'][0] + ): void + { + $this->disabledTenantWithHttpInfo($id, $userId, $disabled, $loginDisabled, $body, $contentType); + } + + /** + * Operation disabledTenantWithHttpInfo + * + * Disable User Account + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $disabled Whether or not the account should be disabled. (optional) + * @param bool|null $loginDisabled Whether or not the account should have log in permissions. (optional) + * @param string|null $body A message to show the user explaining why the account is disabled. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disabledTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function disabledTenantWithHttpInfo( + string $id, + string $userId, + ?bool $disabled = null, + ?bool $loginDisabled = null, + ?string $body = null, + string $contentType = self::contentTypes['disabledTenant'][0] + ): array + { + $request = $this->disabledTenantRequest($id, $userId, $disabled, $loginDisabled, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation disabledTenantAsync + * + * Disable User Account + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $disabled Whether or not the account should be disabled. (optional) + * @param bool|null $loginDisabled Whether or not the account should have log in permissions. (optional) + * @param string|null $body A message to show the user explaining why the account is disabled. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disabledTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function disabledTenantAsync( + string $id, + string $userId, + ?bool $disabled = null, + ?bool $loginDisabled = null, + ?string $body = null, + string $contentType = self::contentTypes['disabledTenant'][0] + ): PromiseInterface + { + return $this->disabledTenantAsyncWithHttpInfo($id, $userId, $disabled, $loginDisabled, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation disabledTenantAsyncWithHttpInfo + * + * Disable User Account + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $disabled Whether or not the account should be disabled. (optional) + * @param bool|null $loginDisabled Whether or not the account should have log in permissions. (optional) + * @param string|null $body A message to show the user explaining why the account is disabled. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disabledTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function disabledTenantAsyncWithHttpInfo( + $id, + $userId, + $disabled = null, + $loginDisabled = null, + $body = null, + string $contentType = self::contentTypes['disabledTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->disabledTenantRequest($id, $userId, $disabled, $loginDisabled, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'disabledTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $disabled Whether or not the account should be disabled. (optional) + * @param bool|null $loginDisabled Whether or not the account should have log in permissions. (optional) + * @param string|null $body A message to show the user explaining why the account is disabled. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disabledTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function disabledTenantRequest( + $id, + $userId, + $disabled = null, + $loginDisabled = null, + $body = null, + string $contentType = self::contentTypes['disabledTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling disabledTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling disabledTenant' + ); + } + + + + + + $resourcePath = '/tenants/{id}/users/{userId}/disabled'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $disabled, + 'disabled', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $loginDisabled, + 'loginDisabled', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employerCreationTenant + * + * Enable Employer Creation + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param bool|null $enabled Whether or not the account can create employers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerCreationTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function employerCreationTenant( + string $id, + string $userId, + ?bool $enabled = null, + string $contentType = self::contentTypes['employerCreationTenant'][0] + ): void + { + $this->employerCreationTenantWithHttpInfo($id, $userId, $enabled, $contentType); + } + + /** + * Operation employerCreationTenantWithHttpInfo + * + * Enable Employer Creation + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $enabled Whether or not the account can create employers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerCreationTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function employerCreationTenantWithHttpInfo( + string $id, + string $userId, + ?bool $enabled = null, + string $contentType = self::contentTypes['employerCreationTenant'][0] + ): array + { + $request = $this->employerCreationTenantRequest($id, $userId, $enabled, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation employerCreationTenantAsync + * + * Enable Employer Creation + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $enabled Whether or not the account can create employers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerCreationTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerCreationTenantAsync( + string $id, + string $userId, + ?bool $enabled = null, + string $contentType = self::contentTypes['employerCreationTenant'][0] + ): PromiseInterface + { + return $this->employerCreationTenantAsyncWithHttpInfo($id, $userId, $enabled, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerCreationTenantAsyncWithHttpInfo + * + * Enable Employer Creation + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $enabled Whether or not the account can create employers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerCreationTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerCreationTenantAsyncWithHttpInfo( + $id, + $userId, + $enabled = null, + string $contentType = self::contentTypes['employerCreationTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->employerCreationTenantRequest($id, $userId, $enabled, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerCreationTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param bool|null $enabled Whether or not the account can create employers. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerCreationTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerCreationTenantRequest( + $id, + $userId, + $enabled = null, + string $contentType = self::contentTypes['employerCreationTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employerCreationTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling employerCreationTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/employercreation'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $enabled, + 'enabled', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employerUsageTenant + * + * Get Employer Usage + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsageTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employerUsageTenant( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsageTenant'][0] + ): array + { + list($response) = $this->employerUsageTenantWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation employerUsageTenantWithHttpInfo + * + * Get Employer Usage + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsageTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employerUsageTenantWithHttpInfo( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsageTenant'][0] + ): array + { + $request = $this->employerUsageTenantRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employerUsageTenantAsync + * + * Get Employer Usage + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerUsageTenantAsync( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsageTenant'][0] + ): PromiseInterface + { + return $this->employerUsageTenantAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerUsageTenantAsyncWithHttpInfo + * + * Get Employer Usage + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerUsageTenantAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['employerUsageTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employerUsageTenantRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerUsageTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerUsageTenantRequest( + $id, + $employerId, + string $contentType = self::contentTypes['employerUsageTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employerUsageTenant' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employerUsageTenant' + ); + } + + + $resourcePath = '/tenants/{id}/employers/{employerId}/usage'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation employerUsersTenant + * + * Get Employer Users + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function employerUsersTenant( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsersTenant'][0] + ): array + { + list($response) = $this->employerUsersTenantWithHttpInfo($id, $employerId, $contentType); + return $response; + } + + /** + * Operation employerUsersTenantWithHttpInfo + * + * Get Employer Users + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function employerUsersTenantWithHttpInfo( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsersTenant'][0] + ): array + { + $request = $this->employerUsersTenantRequest($id, $employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation employerUsersTenantAsync + * + * Get Employer Users + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerUsersTenantAsync( + string $id, + string $employerId, + string $contentType = self::contentTypes['employerUsersTenant'][0] + ): PromiseInterface + { + return $this->employerUsersTenantAsyncWithHttpInfo($id, $employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation employerUsersTenantAsyncWithHttpInfo + * + * Get Employer Users + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function employerUsersTenantAsyncWithHttpInfo( + $id, + $employerId, + string $contentType = self::contentTypes['employerUsersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->employerUsersTenantRequest($id, $employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'employerUsersTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $employerId The Id of the Employer. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['employerUsersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function employerUsersTenantRequest( + $id, + $employerId, + string $contentType = self::contentTypes['employerUsersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling employerUsersTenant' + ); + } + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling employerUsersTenant' + ); + } + + + $resourcePath = '/tenants/{id}/employers/{employerId}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiMailingListReportByIdTenant + * + * Api Mailing List Report + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportByIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getApiMailingListReportByIdTenant( + string $id, + string $contentType = self::contentTypes['getApiMailingListReportByIdTenant'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getApiMailingListReportByIdTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getApiMailingListReportByIdTenantWithHttpInfo + * + * Api Mailing List Report + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportByIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiMailingListReportByIdTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getApiMailingListReportByIdTenant'][0] + ): array + { + $request = $this->getApiMailingListReportByIdTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiMailingListReportByIdTenantAsync + * + * Api Mailing List Report + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportByIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiMailingListReportByIdTenantAsync( + string $id, + string $contentType = self::contentTypes['getApiMailingListReportByIdTenant'][0] + ): PromiseInterface + { + return $this->getApiMailingListReportByIdTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiMailingListReportByIdTenantAsyncWithHttpInfo + * + * Api Mailing List Report + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportByIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiMailingListReportByIdTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getApiMailingListReportByIdTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getApiMailingListReportByIdTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiMailingListReportByIdTenant' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportByIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiMailingListReportByIdTenantRequest( + $id, + string $contentType = self::contentTypes['getApiMailingListReportByIdTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getApiMailingListReportByIdTenant' + ); + } + + + $resourcePath = '/tenants/{id}/reports/apimailinglist'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getApiMailingListReportTenant + * + * Api Mailing List Report + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getApiMailingListReportTenant( + string $contentType = self::contentTypes['getApiMailingListReportTenant'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getApiMailingListReportTenantWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getApiMailingListReportTenantWithHttpInfo + * + * Api Mailing List Report + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiMailingListReportTenantWithHttpInfo( + string $contentType = self::contentTypes['getApiMailingListReportTenant'][0] + ): array + { + $request = $this->getApiMailingListReportTenantRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiMailingListReportTenantAsync + * + * Api Mailing List Report + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiMailingListReportTenantAsync( + string $contentType = self::contentTypes['getApiMailingListReportTenant'][0] + ): PromiseInterface + { + return $this->getApiMailingListReportTenantAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiMailingListReportTenantAsyncWithHttpInfo + * + * Api Mailing List Report + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getApiMailingListReportTenantAsyncWithHttpInfo( + string $contentType = self::contentTypes['getApiMailingListReportTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getApiMailingListReportTenantRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiMailingListReportTenant' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiMailingListReportTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiMailingListReportTenantRequest( + string $contentType = self::contentTypes['getApiMailingListReportTenant'][0] + ): Request + { + + + $resourcePath = '/tenants/reports/apimailinglist'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmployersTenant + * + * Get Employers + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getEmployersTenant( + string $id, + string $contentType = self::contentTypes['getEmployersTenant'][0] + ): array + { + list($response) = $this->getEmployersTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getEmployersTenantWithHttpInfo + * + * Get Employers + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getEmployersTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getEmployersTenant'][0] + ): array + { + $request = $this->getEmployersTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmployersTenantAsync + * + * Get Employers + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployersTenantAsync( + string $id, + string $contentType = self::contentTypes['getEmployersTenant'][0] + ): PromiseInterface + { + return $this->getEmployersTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmployersTenantAsyncWithHttpInfo + * + * Get Employers + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmployersTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getEmployersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getEmployersTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmployersTenant' + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmployersTenantRequest( + $id, + string $contentType = self::contentTypes['getEmployersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmployersTenant' + ); + } + + + $resourcePath = '/tenants/{id}/users/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayrollSquadTenant + * + * Get Payroll Squad + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayrollSquadResponse|\SynergiTech\Staffology\Model\ContractPayrollSquadResponse + */ + public function getPayrollSquadTenant( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['getPayrollSquadTenant'][0] + ): \SynergiTech\Staffology\Model\ContractPayrollSquadResponse + { + list($response) = $this->getPayrollSquadTenantWithHttpInfo($id, $payrollSquadId, $contentType); + return $response; + } + + /** + * Operation getPayrollSquadTenantWithHttpInfo + * + * Get Payroll Squad + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayrollSquadResponse|\SynergiTech\Staffology\Model\ContractPayrollSquadResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPayrollSquadTenantWithHttpInfo( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['getPayrollSquadTenant'][0] + ): array + { + $request = $this->getPayrollSquadTenantRequest($id, $payrollSquadId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if (in_array('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayrollSquadResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayrollSquadTenantAsync + * + * Get Payroll Squad + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayrollSquadTenantAsync( + string $id, + string $payrollSquadId, + string $contentType = self::contentTypes['getPayrollSquadTenant'][0] + ): PromiseInterface + { + return $this->getPayrollSquadTenantAsyncWithHttpInfo($id, $payrollSquadId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayrollSquadTenantAsyncWithHttpInfo + * + * Get Payroll Squad + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayrollSquadTenantAsyncWithHttpInfo( + $id, + $payrollSquadId, + string $contentType = self::contentTypes['getPayrollSquadTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadResponse'; + $request = $this->getPayrollSquadTenantRequest($id, $payrollSquadId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayrollSquadTenant' + * + * @param string $id Current tenant id (required) + * @param string $payrollSquadId The id of payroll squad (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayrollSquadTenantRequest( + $id, + $payrollSquadId, + string $contentType = self::contentTypes['getPayrollSquadTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPayrollSquadTenant' + ); + } + + // verify the required parameter 'payrollSquadId' is set + if ($payrollSquadId === null || (is_array($payrollSquadId) && count($payrollSquadId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payrollSquadId when calling getPayrollSquadTenant' + ); + } + + + $resourcePath = '/tenants/{id}/payrollsquad/{payrollSquadId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($payrollSquadId !== null) { + $resourcePath = str_replace( + '{' . 'payrollSquadId' . '}', + ObjectSerializer::toPathValue($payrollSquadId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayrollSquadsTenant + * + * Get Payroll Squads + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getPayrollSquadsTenant( + string $id, + string $contentType = self::contentTypes['getPayrollSquadsTenant'][0] + ): array + { + list($response) = $this->getPayrollSquadsTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getPayrollSquadsTenantWithHttpInfo + * + * Get Payroll Squads + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPayrollSquadsTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getPayrollSquadsTenant'][0] + ): array + { + $request = $this->getPayrollSquadsTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPayrollSquadsTenantAsync + * + * Get Payroll Squads + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayrollSquadsTenantAsync( + string $id, + string $contentType = self::contentTypes['getPayrollSquadsTenant'][0] + ): PromiseInterface + { + return $this->getPayrollSquadsTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPayrollSquadsTenantAsyncWithHttpInfo + * + * Get Payroll Squads + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPayrollSquadsTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getPayrollSquadsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getPayrollSquadsTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayrollSquadsTenant' + * + * @param string $id Current tenant id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayrollSquadsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPayrollSquadsTenantRequest( + $id, + string $contentType = self::contentTypes['getPayrollSquadsTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPayrollSquadsTenant' + ); + } + + + $resourcePath = '/tenants/{id}/payrollsquad'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPricingTableTenant + * + * Get PricingTable + * + * @param string $id id (required) + * @param string $pricingTableId pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PricingTable|\SynergiTech\Staffology\Model\PricingTable + */ + public function getPricingTableTenant( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['getPricingTableTenant'][0] + ): \SynergiTech\Staffology\Model\PricingTable + { + list($response) = $this->getPricingTableTenantWithHttpInfo($id, $pricingTableId, $contentType); + return $response; + } + + /** + * Operation getPricingTableTenantWithHttpInfo + * + * Get PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PricingTable|\SynergiTech\Staffology\Model\PricingTable, HTTP status code, HTTP response headers (array of strings) + */ + public function getPricingTableTenantWithHttpInfo( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['getPricingTableTenant'][0] + ): array + { + $request = $this->getPricingTableTenantRequest($id, $pricingTableId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PricingTable', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PricingTable' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PricingTable', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if (in_array('\SynergiTech\Staffology\Model\PricingTable', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PricingTable' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PricingTable', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PricingTable', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PricingTable', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPricingTableTenantAsync + * + * Get PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPricingTableTenantAsync( + string $id, + string $pricingTableId, + string $contentType = self::contentTypes['getPricingTableTenant'][0] + ): PromiseInterface + { + return $this->getPricingTableTenantAsyncWithHttpInfo($id, $pricingTableId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricingTableTenantAsyncWithHttpInfo + * + * Get PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPricingTableTenantAsyncWithHttpInfo( + $id, + $pricingTableId, + string $contentType = self::contentTypes['getPricingTableTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + $request = $this->getPricingTableTenantRequest($id, $pricingTableId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPricingTableTenant' + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPricingTableTenantRequest( + $id, + $pricingTableId, + string $contentType = self::contentTypes['getPricingTableTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPricingTableTenant' + ); + } + + // verify the required parameter 'pricingTableId' is set + if ($pricingTableId === null || (is_array($pricingTableId) && count($pricingTableId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pricingTableId when calling getPricingTableTenant' + ); + } + + + $resourcePath = '/tenants/{id}/pricingtables/{pricingTableId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($pricingTableId !== null) { + $resourcePath = str_replace( + '{' . 'pricingTableId' . '}', + ObjectSerializer::toPathValue($pricingTableId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPricingTablesTenant + * + * Get PricingTables + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTablesTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function getPricingTablesTenant( + string $id, + string $contentType = self::contentTypes['getPricingTablesTenant'][0] + ): array + { + list($response) = $this->getPricingTablesTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getPricingTablesTenantWithHttpInfo + * + * Get PricingTables + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTablesTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function getPricingTablesTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getPricingTablesTenant'][0] + ): array + { + $request = $this->getPricingTablesTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPricingTablesTenantAsync + * + * Get PricingTables + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTablesTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPricingTablesTenantAsync( + string $id, + string $contentType = self::contentTypes['getPricingTablesTenant'][0] + ): PromiseInterface + { + return $this->getPricingTablesTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricingTablesTenantAsyncWithHttpInfo + * + * Get PricingTables + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTablesTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getPricingTablesTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getPricingTablesTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->getPricingTablesTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPricingTablesTenant' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricingTablesTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPricingTablesTenantRequest( + $id, + string $contentType = self::contentTypes['getPricingTablesTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getPricingTablesTenant' + ); + } + + + $resourcePath = '/tenants/{id}/pricingtables'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRtiSubmissionSettingsTenant + * + * Get RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\RtiSubmissionSettings + */ + public function getRtiSubmissionSettingsTenant( + ?string $id = null, + string $contentType = self::contentTypes['getRtiSubmissionSettingsTenant'][0] + ): \SynergiTech\Staffology\Model\RtiSubmissionSettings + { + list($response) = $this->getRtiSubmissionSettingsTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getRtiSubmissionSettingsTenantWithHttpInfo + * + * Get RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\RtiSubmissionSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getRtiSubmissionSettingsTenantWithHttpInfo( + ?string $id = null, + string $contentType = self::contentTypes['getRtiSubmissionSettingsTenant'][0] + ): array + { + $request = $this->getRtiSubmissionSettingsTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\RtiSubmissionSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\RtiSubmissionSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\RtiSubmissionSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\RtiSubmissionSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\RtiSubmissionSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRtiSubmissionSettingsTenantAsync + * + * Get RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRtiSubmissionSettingsTenantAsync( + ?string $id = null, + string $contentType = self::contentTypes['getRtiSubmissionSettingsTenant'][0] + ): PromiseInterface + { + return $this->getRtiSubmissionSettingsTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRtiSubmissionSettingsTenantAsyncWithHttpInfo + * + * Get RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getRtiSubmissionSettingsTenantAsyncWithHttpInfo( + $id = null, + string $contentType = self::contentTypes['getRtiSubmissionSettingsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\RtiSubmissionSettings'; + $request = $this->getRtiSubmissionSettingsTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRtiSubmissionSettingsTenant' + * + * @param string|null $id The Id of the Tenant. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRtiSubmissionSettingsTenantRequest( + $id = null, + string $contentType = self::contentTypes['getRtiSubmissionSettingsTenant'][0] + ): Request + { + + + + $resourcePath = '/tenants/ritsubmissionsettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTenant + * + * Get a Tenant + * + * @param string $id The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function getTenant( + string $id, + string $contentType = self::contentTypes['getTenant'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->getTenantWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getTenantWithHttpInfo + * + * Get a Tenant + * + * @param string $id The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function getTenantWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getTenant'][0] + ): array + { + $request = $this->getTenantRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTenantAsync + * + * Get a Tenant + * + * @param string $id The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantAsync( + string $id, + string $contentType = self::contentTypes['getTenant'][0] + ): PromiseInterface + { + return $this->getTenantAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTenantAsyncWithHttpInfo + * + * Get a Tenant + * + * @param string $id The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTenantAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->getTenantRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTenant' + * + * @param string $id The Id of the Tenant you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTenantRequest( + $id, + string $contentType = self::contentTypes['getTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getTenant' + ); + } + + + $resourcePath = '/tenants/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUsersWithNoBillableActivityTenant + * + * Get Users with no Billable Activity. + * + * @param string $id The Id of the Tenant (required) + * @param int|null $month month (optional) + * @param int|null $year year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersWithNoBillableActivityTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function getUsersWithNoBillableActivityTenant( + string $id, + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['getUsersWithNoBillableActivityTenant'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->getUsersWithNoBillableActivityTenantWithHttpInfo($id, $month, $year, $contentType); + return $response; + } + + /** + * Operation getUsersWithNoBillableActivityTenantWithHttpInfo + * + * Get Users with no Billable Activity. + * + * @param string $id The Id of the Tenant (required) + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersWithNoBillableActivityTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getUsersWithNoBillableActivityTenantWithHttpInfo( + string $id, + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['getUsersWithNoBillableActivityTenant'][0] + ): array + { + $request = $this->getUsersWithNoBillableActivityTenantRequest($id, $month, $year, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUsersWithNoBillableActivityTenantAsync + * + * Get Users with no Billable Activity. + * + * @param string $id The Id of the Tenant (required) + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersWithNoBillableActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUsersWithNoBillableActivityTenantAsync( + string $id, + ?int $month = null, + ?int $year = null, + string $contentType = self::contentTypes['getUsersWithNoBillableActivityTenant'][0] + ): PromiseInterface + { + return $this->getUsersWithNoBillableActivityTenantAsyncWithHttpInfo($id, $month, $year, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUsersWithNoBillableActivityTenantAsyncWithHttpInfo + * + * Get Users with no Billable Activity. + * + * @param string $id The Id of the Tenant (required) + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersWithNoBillableActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getUsersWithNoBillableActivityTenantAsyncWithHttpInfo( + $id, + $month = null, + $year = null, + string $contentType = self::contentTypes['getUsersWithNoBillableActivityTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->getUsersWithNoBillableActivityTenantRequest($id, $month, $year, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUsersWithNoBillableActivityTenant' + * + * @param string $id The Id of the Tenant (required) + * @param int|null $month (optional) + * @param int|null $year (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUsersWithNoBillableActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUsersWithNoBillableActivityTenantRequest( + $id, + $month = null, + $year = null, + string $contentType = self::contentTypes['getUsersWithNoBillableActivityTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getUsersWithNoBillableActivityTenant' + ); + } + + + + + $resourcePath = '/tenants/{id}/reports/users/nobillableactivity'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $month, + 'month', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $year, + 'year', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation netSuiteBillingTenant + * + * NetSuite Billing Report + * + * @param string $id The Id of the Tenant (required) + * @param int|null $year The year of the billing period (optional) + * @param int|null $month The month of the billing period (optional) + * @param string|null $accept accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['netSuiteBillingTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function netSuiteBillingTenant( + string $id, + ?int $year = null, + ?int $month = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['netSuiteBillingTenant'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->netSuiteBillingTenantWithHttpInfo($id, $year, $month, $accept, $allTenants, $contentType); + return $response; + } + + /** + * Operation netSuiteBillingTenantWithHttpInfo + * + * NetSuite Billing Report + * + * @param string $id The Id of the Tenant (required) + * @param int|null $year The year of the billing period (optional) + * @param int|null $month The month of the billing period (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['netSuiteBillingTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function netSuiteBillingTenantWithHttpInfo( + string $id, + ?int $year = null, + ?int $month = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['netSuiteBillingTenant'][0] + ): array + { + $request = $this->netSuiteBillingTenantRequest($id, $year, $month, $accept, $allTenants, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation netSuiteBillingTenantAsync + * + * NetSuite Billing Report + * + * @param string $id The Id of the Tenant (required) + * @param int|null $year The year of the billing period (optional) + * @param int|null $month The month of the billing period (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['netSuiteBillingTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function netSuiteBillingTenantAsync( + string $id, + ?int $year = null, + ?int $month = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['netSuiteBillingTenant'][0] + ): PromiseInterface + { + return $this->netSuiteBillingTenantAsyncWithHttpInfo($id, $year, $month, $accept, $allTenants, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation netSuiteBillingTenantAsyncWithHttpInfo + * + * NetSuite Billing Report + * + * @param string $id The Id of the Tenant (required) + * @param int|null $year The year of the billing period (optional) + * @param int|null $month The month of the billing period (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['netSuiteBillingTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function netSuiteBillingTenantAsyncWithHttpInfo( + $id, + $year = null, + $month = null, + $accept = null, + $allTenants = false, + string $contentType = self::contentTypes['netSuiteBillingTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->netSuiteBillingTenantRequest($id, $year, $month, $accept, $allTenants, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'netSuiteBillingTenant' + * + * @param string $id The Id of the Tenant (required) + * @param int|null $year The year of the billing period (optional) + * @param int|null $month The month of the billing period (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['netSuiteBillingTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function netSuiteBillingTenantRequest( + $id, + $year = null, + $month = null, + $accept = null, + $allTenants = false, + string $contentType = self::contentTypes['netSuiteBillingTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling netSuiteBillingTenant' + ); + } + + + + + + + $resourcePath = '/tenants/{id}/reports/netsuitebills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $year, + 'year', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $month, + 'month', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allTenants, + 'allTenants', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrollSquadAddMemberTenant + * + * Add Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest|null $contractPayrollSquadMemberRequest contractPayrollSquadMemberRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadAddMemberTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse + */ + public function payrollSquadAddMemberTenant( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest $contractPayrollSquadMemberRequest = null, + string $contentType = self::contentTypes['payrollSquadAddMemberTenant'][0] + ): \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse + { + list($response) = $this->payrollSquadAddMemberTenantWithHttpInfo($id, $contractPayrollSquadMemberRequest, $contentType); + return $response; + } + + /** + * Operation payrollSquadAddMemberTenantWithHttpInfo + * + * Add Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest|null $contractPayrollSquadMemberRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadAddMemberTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function payrollSquadAddMemberTenantWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest $contractPayrollSquadMemberRequest = null, + string $contentType = self::contentTypes['payrollSquadAddMemberTenant'][0] + ): array + { + $request = $this->payrollSquadAddMemberTenantRequest($id, $contractPayrollSquadMemberRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrollSquadAddMemberTenantAsync + * + * Add Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest|null $contractPayrollSquadMemberRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadAddMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollSquadAddMemberTenantAsync( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest $contractPayrollSquadMemberRequest = null, + string $contentType = self::contentTypes['payrollSquadAddMemberTenant'][0] + ): PromiseInterface + { + return $this->payrollSquadAddMemberTenantAsyncWithHttpInfo($id, $contractPayrollSquadMemberRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrollSquadAddMemberTenantAsyncWithHttpInfo + * + * Add Payroll Squad Member + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest|null $contractPayrollSquadMemberRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadAddMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollSquadAddMemberTenantAsyncWithHttpInfo( + $id, + $contractPayrollSquadMemberRequest = null, + string $contentType = self::contentTypes['payrollSquadAddMemberTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse'; + $request = $this->payrollSquadAddMemberTenantRequest($id, $contractPayrollSquadMemberRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrollSquadAddMemberTenant' + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberRequest|null $contractPayrollSquadMemberRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadAddMemberTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrollSquadAddMemberTenantRequest( + $id, + $contractPayrollSquadMemberRequest = null, + string $contentType = self::contentTypes['payrollSquadAddMemberTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payrollSquadAddMemberTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/payrollsquad/member'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayrollSquadMemberRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayrollSquadMemberRequest)); + } else { + $httpBody = $contractPayrollSquadMemberRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payrollSquadUpdateEmployersTenant + * + * Update Payroll Squad Employers + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest|null $contractPayrollSquadEmployerRequest contractPayrollSquadEmployerRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadUpdateEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[] + */ + public function payrollSquadUpdateEmployersTenant( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest $contractPayrollSquadEmployerRequest = null, + string $contentType = self::contentTypes['payrollSquadUpdateEmployersTenant'][0] + ): array + { + list($response) = $this->payrollSquadUpdateEmployersTenantWithHttpInfo($id, $contractPayrollSquadEmployerRequest, $contentType); + return $response; + } + + /** + * Operation payrollSquadUpdateEmployersTenantWithHttpInfo + * + * Update Payroll Squad Employers + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest|null $contractPayrollSquadEmployerRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadUpdateEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function payrollSquadUpdateEmployersTenantWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest $contractPayrollSquadEmployerRequest = null, + string $contentType = self::contentTypes['payrollSquadUpdateEmployersTenant'][0] + ): array + { + $request = $this->payrollSquadUpdateEmployersTenantRequest($id, $contractPayrollSquadEmployerRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payrollSquadUpdateEmployersTenantAsync + * + * Update Payroll Squad Employers + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest|null $contractPayrollSquadEmployerRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadUpdateEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollSquadUpdateEmployersTenantAsync( + string $id, + ?\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest $contractPayrollSquadEmployerRequest = null, + string $contentType = self::contentTypes['payrollSquadUpdateEmployersTenant'][0] + ): PromiseInterface + { + return $this->payrollSquadUpdateEmployersTenantAsyncWithHttpInfo($id, $contractPayrollSquadEmployerRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payrollSquadUpdateEmployersTenantAsyncWithHttpInfo + * + * Update Payroll Squad Employers + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest|null $contractPayrollSquadEmployerRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadUpdateEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payrollSquadUpdateEmployersTenantAsyncWithHttpInfo( + $id, + $contractPayrollSquadEmployerRequest = null, + string $contentType = self::contentTypes['payrollSquadUpdateEmployersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractPayrollSquadEmployerResponse[]'; + $request = $this->payrollSquadUpdateEmployersTenantRequest($id, $contractPayrollSquadEmployerRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payrollSquadUpdateEmployersTenant' + * + * @param string $id Current tenant id (required) + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadEmployerRequest|null $contractPayrollSquadEmployerRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payrollSquadUpdateEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payrollSquadUpdateEmployersTenantRequest( + $id, + $contractPayrollSquadEmployerRequest = null, + string $contentType = self::contentTypes['payrollSquadUpdateEmployersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payrollSquadUpdateEmployersTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/payrollsquad/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractPayrollSquadEmployerRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractPayrollSquadEmployerRequest)); + } else { + $httpBody = $contractPayrollSquadEmployerRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeAdminUserTenant + * + * Remove Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeAdminUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function removeAdminUserTenant( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['removeAdminUserTenant'][0] + ): void + { + $this->removeAdminUserTenantWithHttpInfo($id, $body, $contentType); + } + + /** + * Operation removeAdminUserTenantWithHttpInfo + * + * Remove Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeAdminUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeAdminUserTenantWithHttpInfo( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['removeAdminUserTenant'][0] + ): array + { + $request = $this->removeAdminUserTenantRequest($id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation removeAdminUserTenantAsync + * + * Remove Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeAdminUserTenantAsync( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['removeAdminUserTenant'][0] + ): PromiseInterface + { + return $this->removeAdminUserTenantAsyncWithHttpInfo($id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeAdminUserTenantAsyncWithHttpInfo + * + * Remove Admin User + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function removeAdminUserTenantAsyncWithHttpInfo( + $id, + $body = null, + string $contentType = self::contentTypes['removeAdminUserTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->removeAdminUserTenantRequest($id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeAdminUserTenant' + * + * @param string $id The Id of the Tenant you want to remove the admin User from. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeAdminUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeAdminUserTenantRequest( + $id, + $body = null, + string $contentType = self::contentTypes['removeAdminUserTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling removeAdminUserTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/admins'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setAccountingIdTenant + * + * Set User Accounting Id + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param string|null $accountingId The CustomerAccountingId for the user. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAccountingIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setAccountingIdTenant( + string $id, + string $userId, + ?string $accountingId = null, + string $contentType = self::contentTypes['setAccountingIdTenant'][0] + ): void + { + $this->setAccountingIdTenantWithHttpInfo($id, $userId, $accountingId, $contentType); + } + + /** + * Operation setAccountingIdTenantWithHttpInfo + * + * Set User Accounting Id + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $accountingId The CustomerAccountingId for the user. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAccountingIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setAccountingIdTenantWithHttpInfo( + string $id, + string $userId, + ?string $accountingId = null, + string $contentType = self::contentTypes['setAccountingIdTenant'][0] + ): array + { + $request = $this->setAccountingIdTenantRequest($id, $userId, $accountingId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setAccountingIdTenantAsync + * + * Set User Accounting Id + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $accountingId The CustomerAccountingId for the user. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAccountingIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setAccountingIdTenantAsync( + string $id, + string $userId, + ?string $accountingId = null, + string $contentType = self::contentTypes['setAccountingIdTenant'][0] + ): PromiseInterface + { + return $this->setAccountingIdTenantAsyncWithHttpInfo($id, $userId, $accountingId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setAccountingIdTenantAsyncWithHttpInfo + * + * Set User Accounting Id + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $accountingId The CustomerAccountingId for the user. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAccountingIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setAccountingIdTenantAsyncWithHttpInfo( + $id, + $userId, + $accountingId = null, + string $contentType = self::contentTypes['setAccountingIdTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setAccountingIdTenantRequest($id, $userId, $accountingId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setAccountingIdTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $accountingId The CustomerAccountingId for the user. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAccountingIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setAccountingIdTenantRequest( + $id, + $userId, + $accountingId = null, + string $contentType = self::contentTypes['setAccountingIdTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setAccountingIdTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setAccountingIdTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/accounting'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $accountingId, + 'accountingId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setAddressTenant + * + * Set Address + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAddressTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setAddressTenant( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['setAddressTenant'][0] + ): void + { + $this->setAddressTenantWithHttpInfo($id, $userId, $user, $contentType); + } + + /** + * Operation setAddressTenantWithHttpInfo + * + * Set Address + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAddressTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setAddressTenantWithHttpInfo( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['setAddressTenant'][0] + ): array + { + $request = $this->setAddressTenantRequest($id, $userId, $user, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setAddressTenantAsync + * + * Set Address + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setAddressTenantAsync( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['setAddressTenant'][0] + ): PromiseInterface + { + return $this->setAddressTenantAsyncWithHttpInfo($id, $userId, $user, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setAddressTenantAsyncWithHttpInfo + * + * Set Address + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setAddressTenantAsyncWithHttpInfo( + $id, + $userId, + $user = null, + string $contentType = self::contentTypes['setAddressTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setAddressTenantRequest($id, $userId, $user, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setAddressTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setAddressTenantRequest( + $id, + $userId, + $user = null, + string $contentType = self::contentTypes['setAddressTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setAddressTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setAddressTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/address'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($user)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($user)); + } else { + $httpBody = $user; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setBureauRedirectEmailAddressTenant + * + * Set Bureau Redirect + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param string|null $emailAddress The email address to redirect to, or an empty string to remove the redirect. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBureauRedirectEmailAddressTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setBureauRedirectEmailAddressTenant( + string $id, + string $userId, + ?string $emailAddress = null, + string $contentType = self::contentTypes['setBureauRedirectEmailAddressTenant'][0] + ): void + { + $this->setBureauRedirectEmailAddressTenantWithHttpInfo($id, $userId, $emailAddress, $contentType); + } + + /** + * Operation setBureauRedirectEmailAddressTenantWithHttpInfo + * + * Set Bureau Redirect + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $emailAddress The email address to redirect to, or an empty string to remove the redirect. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBureauRedirectEmailAddressTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setBureauRedirectEmailAddressTenantWithHttpInfo( + string $id, + string $userId, + ?string $emailAddress = null, + string $contentType = self::contentTypes['setBureauRedirectEmailAddressTenant'][0] + ): array + { + $request = $this->setBureauRedirectEmailAddressTenantRequest($id, $userId, $emailAddress, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setBureauRedirectEmailAddressTenantAsync + * + * Set Bureau Redirect + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $emailAddress The email address to redirect to, or an empty string to remove the redirect. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBureauRedirectEmailAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setBureauRedirectEmailAddressTenantAsync( + string $id, + string $userId, + ?string $emailAddress = null, + string $contentType = self::contentTypes['setBureauRedirectEmailAddressTenant'][0] + ): PromiseInterface + { + return $this->setBureauRedirectEmailAddressTenantAsyncWithHttpInfo($id, $userId, $emailAddress, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setBureauRedirectEmailAddressTenantAsyncWithHttpInfo + * + * Set Bureau Redirect + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $emailAddress The email address to redirect to, or an empty string to remove the redirect. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBureauRedirectEmailAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setBureauRedirectEmailAddressTenantAsyncWithHttpInfo( + $id, + $userId, + $emailAddress = null, + string $contentType = self::contentTypes['setBureauRedirectEmailAddressTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setBureauRedirectEmailAddressTenantRequest($id, $userId, $emailAddress, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setBureauRedirectEmailAddressTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $emailAddress The email address to redirect to, or an empty string to remove the redirect. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBureauRedirectEmailAddressTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setBureauRedirectEmailAddressTenantRequest( + $id, + $userId, + $emailAddress = null, + string $contentType = self::contentTypes['setBureauRedirectEmailAddressTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setBureauRedirectEmailAddressTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setBureauRedirectEmailAddressTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/bureauredir'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $emailAddress, + 'emailAddress', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setBusinessNameTenant + * + * Set User Business Name + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param string|null $businessName The Business Name for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBusinessNameTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setBusinessNameTenant( + string $id, + string $userId, + ?string $businessName = null, + string $contentType = self::contentTypes['setBusinessNameTenant'][0] + ): void + { + $this->setBusinessNameTenantWithHttpInfo($id, $userId, $businessName, $contentType); + } + + /** + * Operation setBusinessNameTenantWithHttpInfo + * + * Set User Business Name + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param string|null $businessName The Business Name for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBusinessNameTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setBusinessNameTenantWithHttpInfo( + string $id, + string $userId, + ?string $businessName = null, + string $contentType = self::contentTypes['setBusinessNameTenant'][0] + ): array + { + $request = $this->setBusinessNameTenantRequest($id, $userId, $businessName, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setBusinessNameTenantAsync + * + * Set User Business Name + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param string|null $businessName The Business Name for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBusinessNameTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setBusinessNameTenantAsync( + string $id, + string $userId, + ?string $businessName = null, + string $contentType = self::contentTypes['setBusinessNameTenant'][0] + ): PromiseInterface + { + return $this->setBusinessNameTenantAsyncWithHttpInfo($id, $userId, $businessName, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setBusinessNameTenantAsyncWithHttpInfo + * + * Set User Business Name + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param string|null $businessName The Business Name for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBusinessNameTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setBusinessNameTenantAsyncWithHttpInfo( + $id, + $userId, + $businessName = null, + string $contentType = self::contentTypes['setBusinessNameTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setBusinessNameTenantRequest($id, $userId, $businessName, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setBusinessNameTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param string|null $businessName The Business Name for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setBusinessNameTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setBusinessNameTenantRequest( + $id, + $userId, + $businessName = null, + string $contentType = self::contentTypes['setBusinessNameTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setBusinessNameTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setBusinessNameTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/businessname'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $businessName, + 'businessName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setCountryTenant + * + * Set Country + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\Country|null $country The Country for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCountryTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setCountryTenant( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\Country $country = null, + string $contentType = self::contentTypes['setCountryTenant'][0] + ): void + { + $this->setCountryTenantWithHttpInfo($id, $userId, $country, $contentType); + } + + /** + * Operation setCountryTenantWithHttpInfo + * + * Set Country + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\Country|null $country The Country for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCountryTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setCountryTenantWithHttpInfo( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\Country $country = null, + string $contentType = self::contentTypes['setCountryTenant'][0] + ): array + { + $request = $this->setCountryTenantRequest($id, $userId, $country, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setCountryTenantAsync + * + * Set Country + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\Country|null $country The Country for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCountryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCountryTenantAsync( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\Country $country = null, + string $contentType = self::contentTypes['setCountryTenant'][0] + ): PromiseInterface + { + return $this->setCountryTenantAsyncWithHttpInfo($id, $userId, $country, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setCountryTenantAsyncWithHttpInfo + * + * Set Country + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\Country|null $country The Country for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCountryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setCountryTenantAsyncWithHttpInfo( + $id, + $userId, + $country = null, + string $contentType = self::contentTypes['setCountryTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setCountryTenantRequest($id, $userId, $country, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setCountryTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\Country|null $country The Country for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setCountryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setCountryTenantRequest( + $id, + $userId, + $country = null, + string $contentType = self::contentTypes['setCountryTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setCountryTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setCountryTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/country'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $country, + 'country', // param base name + 'Country', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEmployeeCountTenant + * + * Set Employee Count + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param int|null $employeeCount The Employee Count for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCountTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setEmployeeCountTenant( + string $id, + string $userId, + ?int $employeeCount = null, + string $contentType = self::contentTypes['setEmployeeCountTenant'][0] + ): void + { + $this->setEmployeeCountTenantWithHttpInfo($id, $userId, $employeeCount, $contentType); + } + + /** + * Operation setEmployeeCountTenantWithHttpInfo + * + * Set Employee Count + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param int|null $employeeCount The Employee Count for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCountTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setEmployeeCountTenantWithHttpInfo( + string $id, + string $userId, + ?int $employeeCount = null, + string $contentType = self::contentTypes['setEmployeeCountTenant'][0] + ): array + { + $request = $this->setEmployeeCountTenantRequest($id, $userId, $employeeCount, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setEmployeeCountTenantAsync + * + * Set Employee Count + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param int|null $employeeCount The Employee Count for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCountTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeCountTenantAsync( + string $id, + string $userId, + ?int $employeeCount = null, + string $contentType = self::contentTypes['setEmployeeCountTenant'][0] + ): PromiseInterface + { + return $this->setEmployeeCountTenantAsyncWithHttpInfo($id, $userId, $employeeCount, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEmployeeCountTenantAsyncWithHttpInfo + * + * Set Employee Count + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param int|null $employeeCount The Employee Count for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCountTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEmployeeCountTenantAsyncWithHttpInfo( + $id, + $userId, + $employeeCount = null, + string $contentType = self::contentTypes['setEmployeeCountTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setEmployeeCountTenantRequest($id, $userId, $employeeCount, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEmployeeCountTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param int|null $employeeCount The Employee Count for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEmployeeCountTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEmployeeCountTenantRequest( + $id, + $userId, + $employeeCount = null, + string $contentType = self::contentTypes['setEmployeeCountTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setEmployeeCountTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setEmployeeCountTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/employeecount'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeeCount, + 'employeeCount', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setEvcTenant + * + * Set Evc + * + * @param string $id The Id of the tenant (required) + * @param bool|null $disableEvc A boolean value indicating whether to disable or enable EVC at tenant level. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setEvcTenant( + string $id, + ?bool $disableEvc = null, + string $contentType = self::contentTypes['setEvcTenant'][0] + ): void + { + $this->setEvcTenantWithHttpInfo($id, $disableEvc, $contentType); + } + + /** + * Operation setEvcTenantWithHttpInfo + * + * Set Evc + * + * @param string $id The Id of the tenant (required) + * @param bool|null $disableEvc A boolean value indicating whether to disable or enable EVC at tenant level. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setEvcTenantWithHttpInfo( + string $id, + ?bool $disableEvc = null, + string $contentType = self::contentTypes['setEvcTenant'][0] + ): array + { + $request = $this->setEvcTenantRequest($id, $disableEvc, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setEvcTenantAsync + * + * Set Evc + * + * @param string $id The Id of the tenant (required) + * @param bool|null $disableEvc A boolean value indicating whether to disable or enable EVC at tenant level. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEvcTenantAsync( + string $id, + ?bool $disableEvc = null, + string $contentType = self::contentTypes['setEvcTenant'][0] + ): PromiseInterface + { + return $this->setEvcTenantAsyncWithHttpInfo($id, $disableEvc, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setEvcTenantAsyncWithHttpInfo + * + * Set Evc + * + * @param string $id The Id of the tenant (required) + * @param bool|null $disableEvc A boolean value indicating whether to disable or enable EVC at tenant level. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setEvcTenantAsyncWithHttpInfo( + $id, + $disableEvc = null, + string $contentType = self::contentTypes['setEvcTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setEvcTenantRequest($id, $disableEvc, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setEvcTenant' + * + * @param string $id The Id of the tenant (required) + * @param bool|null $disableEvc A boolean value indicating whether to disable or enable EVC at tenant level. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setEvcTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setEvcTenantRequest( + $id, + $disableEvc = null, + string $contentType = self::contentTypes['setEvcTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setEvcTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/admin/evc'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $disableEvc, + 'disableEvc', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setIndustryTenant + * + * Set Industry + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry The Industry for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setIndustryTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setIndustryTenant( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\UserIndustry $industry = null, + string $contentType = self::contentTypes['setIndustryTenant'][0] + ): void + { + $this->setIndustryTenantWithHttpInfo($id, $userId, $industry, $contentType); + } + + /** + * Operation setIndustryTenantWithHttpInfo + * + * Set Industry + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry The Industry for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setIndustryTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setIndustryTenantWithHttpInfo( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\UserIndustry $industry = null, + string $contentType = self::contentTypes['setIndustryTenant'][0] + ): array + { + $request = $this->setIndustryTenantRequest($id, $userId, $industry, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setIndustryTenantAsync + * + * Set Industry + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry The Industry for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setIndustryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setIndustryTenantAsync( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\UserIndustry $industry = null, + string $contentType = self::contentTypes['setIndustryTenant'][0] + ): PromiseInterface + { + return $this->setIndustryTenantAsyncWithHttpInfo($id, $userId, $industry, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setIndustryTenantAsyncWithHttpInfo + * + * Set Industry + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry The Industry for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setIndustryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setIndustryTenantAsyncWithHttpInfo( + $id, + $userId, + $industry = null, + string $contentType = self::contentTypes['setIndustryTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setIndustryTenantRequest($id, $userId, $industry, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setIndustryTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry The Industry for the User. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setIndustryTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setIndustryTenantRequest( + $id, + $userId, + $industry = null, + string $contentType = self::contentTypes['setIndustryTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setIndustryTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setIndustryTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/industry'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $industry, + 'industry', // param base name + 'UserIndustry', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setMonthlyMinimumTenant + * + * Set Monthly Minimum + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum monthlyMinimum (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMonthlyMinimumTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setMonthlyMinimumTenant( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\MonthlyMinimum $monthlyMinimum = null, + string $contentType = self::contentTypes['setMonthlyMinimumTenant'][0] + ): void + { + $this->setMonthlyMinimumTenantWithHttpInfo($id, $userId, $monthlyMinimum, $contentType); + } + + /** + * Operation setMonthlyMinimumTenantWithHttpInfo + * + * Set Monthly Minimum + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMonthlyMinimumTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setMonthlyMinimumTenantWithHttpInfo( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\MonthlyMinimum $monthlyMinimum = null, + string $contentType = self::contentTypes['setMonthlyMinimumTenant'][0] + ): array + { + $request = $this->setMonthlyMinimumTenantRequest($id, $userId, $monthlyMinimum, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setMonthlyMinimumTenantAsync + * + * Set Monthly Minimum + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMonthlyMinimumTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setMonthlyMinimumTenantAsync( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\MonthlyMinimum $monthlyMinimum = null, + string $contentType = self::contentTypes['setMonthlyMinimumTenant'][0] + ): PromiseInterface + { + return $this->setMonthlyMinimumTenantAsyncWithHttpInfo($id, $userId, $monthlyMinimum, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setMonthlyMinimumTenantAsyncWithHttpInfo + * + * Set Monthly Minimum + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMonthlyMinimumTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setMonthlyMinimumTenantAsyncWithHttpInfo( + $id, + $userId, + $monthlyMinimum = null, + string $contentType = self::contentTypes['setMonthlyMinimumTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setMonthlyMinimumTenantRequest($id, $userId, $monthlyMinimum, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setMonthlyMinimumTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMonthlyMinimumTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setMonthlyMinimumTenantRequest( + $id, + $userId, + $monthlyMinimum = null, + string $contentType = self::contentTypes['setMonthlyMinimumTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setMonthlyMinimumTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setMonthlyMinimumTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/monthlyminimum'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($monthlyMinimum)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($monthlyMinimum)); + } else { + $httpBody = $monthlyMinimum; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setPricingTableIdTenant + * + * Set User PricingTableId + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId userId (required) + * @param string|null $pricingTableId The PricingTable Id for the user. Provide null and the user will use the Tenant default (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setPricingTableIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setPricingTableIdTenant( + string $id, + string $userId, + ?string $pricingTableId = null, + string $contentType = self::contentTypes['setPricingTableIdTenant'][0] + ): void + { + $this->setPricingTableIdTenantWithHttpInfo($id, $userId, $pricingTableId, $contentType); + } + + /** + * Operation setPricingTableIdTenantWithHttpInfo + * + * Set User PricingTableId + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $pricingTableId The PricingTable Id for the user. Provide null and the user will use the Tenant default (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setPricingTableIdTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setPricingTableIdTenantWithHttpInfo( + string $id, + string $userId, + ?string $pricingTableId = null, + string $contentType = self::contentTypes['setPricingTableIdTenant'][0] + ): array + { + $request = $this->setPricingTableIdTenantRequest($id, $userId, $pricingTableId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setPricingTableIdTenantAsync + * + * Set User PricingTableId + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $pricingTableId The PricingTable Id for the user. Provide null and the user will use the Tenant default (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setPricingTableIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setPricingTableIdTenantAsync( + string $id, + string $userId, + ?string $pricingTableId = null, + string $contentType = self::contentTypes['setPricingTableIdTenant'][0] + ): PromiseInterface + { + return $this->setPricingTableIdTenantAsyncWithHttpInfo($id, $userId, $pricingTableId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setPricingTableIdTenantAsyncWithHttpInfo + * + * Set User PricingTableId + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $pricingTableId The PricingTable Id for the user. Provide null and the user will use the Tenant default (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setPricingTableIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setPricingTableIdTenantAsyncWithHttpInfo( + $id, + $userId, + $pricingTableId = null, + string $contentType = self::contentTypes['setPricingTableIdTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setPricingTableIdTenantRequest($id, $userId, $pricingTableId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setPricingTableIdTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param string $userId (required) + * @param string|null $pricingTableId The PricingTable Id for the user. Provide null and the user will use the Tenant default (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setPricingTableIdTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setPricingTableIdTenantRequest( + $id, + $userId, + $pricingTableId = null, + string $contentType = self::contentTypes['setPricingTableIdTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setPricingTableIdTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setPricingTableIdTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/pricingtable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pricingTableId, + 'pricingTableId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation setTenantTenant + * + * Set User Tenant + * + * @param string $id The Id of the Tenant the user is currently assigned to. (required) + * @param string $userId userId (required) + * @param string|null $newTenantId The Id of the Tenant the user is to be assigned to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTenantTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function setTenantTenant( + string $id, + string $userId, + ?string $newTenantId = null, + string $contentType = self::contentTypes['setTenantTenant'][0] + ): void + { + $this->setTenantTenantWithHttpInfo($id, $userId, $newTenantId, $contentType); + } + + /** + * Operation setTenantTenantWithHttpInfo + * + * Set User Tenant + * + * @param string $id The Id of the Tenant the user is currently assigned to. (required) + * @param string $userId (required) + * @param string|null $newTenantId The Id of the Tenant the user is to be assigned to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTenantTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function setTenantTenantWithHttpInfo( + string $id, + string $userId, + ?string $newTenantId = null, + string $contentType = self::contentTypes['setTenantTenant'][0] + ): array + { + $request = $this->setTenantTenantRequest($id, $userId, $newTenantId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation setTenantTenantAsync + * + * Set User Tenant + * + * @param string $id The Id of the Tenant the user is currently assigned to. (required) + * @param string $userId (required) + * @param string|null $newTenantId The Id of the Tenant the user is to be assigned to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTenantTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setTenantTenantAsync( + string $id, + string $userId, + ?string $newTenantId = null, + string $contentType = self::contentTypes['setTenantTenant'][0] + ): PromiseInterface + { + return $this->setTenantTenantAsyncWithHttpInfo($id, $userId, $newTenantId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation setTenantTenantAsyncWithHttpInfo + * + * Set User Tenant + * + * @param string $id The Id of the Tenant the user is currently assigned to. (required) + * @param string $userId (required) + * @param string|null $newTenantId The Id of the Tenant the user is to be assigned to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTenantTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function setTenantTenantAsyncWithHttpInfo( + $id, + $userId, + $newTenantId = null, + string $contentType = self::contentTypes['setTenantTenant'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->setTenantTenantRequest($id, $userId, $newTenantId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'setTenantTenant' + * + * @param string $id The Id of the Tenant the user is currently assigned to. (required) + * @param string $userId (required) + * @param string|null $newTenantId The Id of the Tenant the user is to be assigned to. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setTenantTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function setTenantTenantRequest( + $id, + $userId, + $newTenantId = null, + string $contentType = self::contentTypes['setTenantTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling setTenantTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling setTenantTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}/tenant'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $newTenantId, + 'newTenantId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateBillTenant + * + * Update Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year year (required) + * @param int $month month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param \SynergiTech\Staffology\Model\UsageBill|null $usageBill usageBill (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBillTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\UsageBill + */ + public function updateBillTenant( + string $id, + int $year, + int $month, + string $billId, + ?\SynergiTech\Staffology\Model\UsageBill $usageBill = null, + string $contentType = self::contentTypes['updateBillTenant'][0] + ): \SynergiTech\Staffology\Model\UsageBill + { + list($response) = $this->updateBillTenantWithHttpInfo($id, $year, $month, $billId, $usageBill, $contentType); + return $response; + } + + /** + * Operation updateBillTenantWithHttpInfo + * + * Update Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param \SynergiTech\Staffology\Model\UsageBill|null $usageBill (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBillTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\UsageBill, HTTP status code, HTTP response headers (array of strings) + */ + public function updateBillTenantWithHttpInfo( + string $id, + int $year, + int $month, + string $billId, + ?\SynergiTech\Staffology\Model\UsageBill $usageBill = null, + string $contentType = self::contentTypes['updateBillTenant'][0] + ): array + { + $request = $this->updateBillTenantRequest($id, $year, $month, $billId, $usageBill, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\UsageBill', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\UsageBill' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\UsageBill', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\UsageBill', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateBillTenantAsync + * + * Update Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param \SynergiTech\Staffology\Model\UsageBill|null $usageBill (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBillTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateBillTenantAsync( + string $id, + int $year, + int $month, + string $billId, + ?\SynergiTech\Staffology\Model\UsageBill $usageBill = null, + string $contentType = self::contentTypes['updateBillTenant'][0] + ): PromiseInterface + { + return $this->updateBillTenantAsyncWithHttpInfo($id, $year, $month, $billId, $usageBill, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateBillTenantAsyncWithHttpInfo + * + * Update Bill + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param \SynergiTech\Staffology\Model\UsageBill|null $usageBill (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBillTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateBillTenantAsyncWithHttpInfo( + $id, + $year, + $month, + $billId, + $usageBill = null, + string $contentType = self::contentTypes['updateBillTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\UsageBill'; + $request = $this->updateBillTenantRequest($id, $year, $month, $billId, $usageBill, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateBillTenant' + * + * @param string $id The Id of the Tenant the bill belongs to. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $billId The Id of the UsageBill. (required) + * @param \SynergiTech\Staffology\Model\UsageBill|null $usageBill (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBillTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateBillTenantRequest( + $id, + $year, + $month, + $billId, + $usageBill = null, + string $contentType = self::contentTypes['updateBillTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateBillTenant' + ); + } + + // verify the required parameter 'year' is set + if ($year === null || (is_array($year) && count($year) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $year when calling updateBillTenant' + ); + } + + // verify the required parameter 'month' is set + if ($month === null || (is_array($month) && count($month) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $month when calling updateBillTenant' + ); + } + + // verify the required parameter 'billId' is set + if ($billId === null || (is_array($billId) && count($billId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $billId when calling updateBillTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/bills/{year}/{month}/{billId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($year !== null) { + $resourcePath = str_replace( + '{' . 'year' . '}', + ObjectSerializer::toPathValue($year), + $resourcePath + ); + } + // path params + if ($month !== null) { + $resourcePath = str_replace( + '{' . 'month' . '}', + ObjectSerializer::toPathValue($month), + $resourcePath + ); + } + // path params + if ($billId !== null) { + $resourcePath = str_replace( + '{' . 'billId' . '}', + ObjectSerializer::toPathValue($billId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($usageBill)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($usageBill)); + } else { + $httpBody = $usageBill; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCssColorsTenant + * + * Update CSS Colors + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair stringStringKeyValuePair (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssColorsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\StringStringKeyValuePair[] + */ + public function updateCssColorsTenant( + string $id, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['updateCssColorsTenant'][0] + ): array + { + list($response) = $this->updateCssColorsTenantWithHttpInfo($id, $stringStringKeyValuePair, $contentType); + return $response; + } + + /** + * Operation updateCssColorsTenantWithHttpInfo + * + * Update CSS Colors + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssColorsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\StringStringKeyValuePair[], HTTP status code, HTTP response headers (array of strings) + */ + public function updateCssColorsTenantWithHttpInfo( + string $id, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['updateCssColorsTenant'][0] + ): array + { + $request = $this->updateCssColorsTenantRequest($id, $stringStringKeyValuePair, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\StringStringKeyValuePair[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\StringStringKeyValuePair[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\StringStringKeyValuePair[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\StringStringKeyValuePair[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\StringStringKeyValuePair[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCssColorsTenantAsync + * + * Update CSS Colors + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssColorsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCssColorsTenantAsync( + string $id, + ?array $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['updateCssColorsTenant'][0] + ): PromiseInterface + { + return $this->updateCssColorsTenantAsyncWithHttpInfo($id, $stringStringKeyValuePair, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCssColorsTenantAsyncWithHttpInfo + * + * Update CSS Colors + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssColorsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCssColorsTenantAsyncWithHttpInfo( + $id, + $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['updateCssColorsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\StringStringKeyValuePair[]'; + $request = $this->updateCssColorsTenantRequest($id, $stringStringKeyValuePair, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCssColorsTenant' + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\StringStringKeyValuePair[]|null $stringStringKeyValuePair (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssColorsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCssColorsTenantRequest( + $id, + $stringStringKeyValuePair = null, + string $contentType = self::contentTypes['updateCssColorsTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateCssColorsTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/css/colors'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($stringStringKeyValuePair)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($stringStringKeyValuePair)); + } else { + $httpBody = $stringStringKeyValuePair; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCssTenant + * + * Update CSS + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param string|null $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return string + */ + public function updateCssTenant( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['updateCssTenant'][0] + ): string + { + list($response) = $this->updateCssTenantWithHttpInfo($id, $body, $contentType); + return $response; + } + + /** + * Operation updateCssTenantWithHttpInfo + * + * Update CSS + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCssTenantWithHttpInfo( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['updateCssTenant'][0] + ): array + { + $request = $this->updateCssTenantRequest($id, $body, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'string'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCssTenantAsync + * + * Update CSS + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCssTenantAsync( + string $id, + ?string $body = null, + string $contentType = self::contentTypes['updateCssTenant'][0] + ): PromiseInterface + { + return $this->updateCssTenantAsyncWithHttpInfo($id, $body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCssTenantAsyncWithHttpInfo + * + * Update CSS + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateCssTenantAsyncWithHttpInfo( + $id, + $body = null, + string $contentType = self::contentTypes['updateCssTenant'][0] + ): PromiseInterface + { + $returnType = 'string'; + $request = $this->updateCssTenantRequest($id, $body, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCssTenant' + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param string|null $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCssTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCssTenantRequest( + $id, + $body = null, + string $contentType = self::contentTypes['updateCssTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateCssTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/css'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); + } else { + $httpBody = $body; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFavIconTenant + * + * Upload Favicon + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFavIconTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function updateFavIconTenant( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateFavIconTenant'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->updateFavIconTenantWithHttpInfo($id, $file, $contentType); + return $response; + } + + /** + * Operation updateFavIconTenantWithHttpInfo + * + * Upload Favicon + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFavIconTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFavIconTenantWithHttpInfo( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateFavIconTenant'][0] + ): array + { + $request = $this->updateFavIconTenantRequest($id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFavIconTenantAsync + * + * Upload Favicon + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFavIconTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateFavIconTenantAsync( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateFavIconTenant'][0] + ): PromiseInterface + { + return $this->updateFavIconTenantAsyncWithHttpInfo($id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFavIconTenantAsyncWithHttpInfo + * + * Upload Favicon + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFavIconTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateFavIconTenantAsyncWithHttpInfo( + $id, + $file = null, + string $contentType = self::contentTypes['updateFavIconTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->updateFavIconTenantRequest($id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFavIconTenant' + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFavIconTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateFavIconTenantRequest( + $id, + $file = null, + string $contentType = self::contentTypes['updateFavIconTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateFavIconTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/favicon'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLogoTenant + * + * Upload Logo + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function updateLogoTenant( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoTenant'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->updateLogoTenantWithHttpInfo($id, $file, $contentType); + return $response; + } + + /** + * Operation updateLogoTenantWithHttpInfo + * + * Upload Logo + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLogoTenantWithHttpInfo( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoTenant'][0] + ): array + { + $request = $this->updateLogoTenantRequest($id, $file, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLogoTenantAsync + * + * Upload Logo + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLogoTenantAsync( + string $id, + ?\SplFileObject $file = null, + string $contentType = self::contentTypes['updateLogoTenant'][0] + ): PromiseInterface + { + return $this->updateLogoTenantAsyncWithHttpInfo($id, $file, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLogoTenantAsyncWithHttpInfo + * + * Upload Logo + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateLogoTenantAsyncWithHttpInfo( + $id, + $file = null, + string $contentType = self::contentTypes['updateLogoTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->updateLogoTenantRequest($id, $file, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLogoTenant' + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SplFileObject|null $file (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLogoTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLogoTenantRequest( + $id, + $file = null, + string $contentType = self::contentTypes['updateLogoTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateLogoTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/logo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface + ? $paramFile + : \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePricingTableTenant + * + * Update PricingTable + * + * @param string $id id (required) + * @param string $pricingTableId pricingTableId (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\PricingTable + */ + public function updatePricingTableTenant( + string $id, + string $pricingTableId, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['updatePricingTableTenant'][0] + ): \SynergiTech\Staffology\Model\PricingTable + { + list($response) = $this->updatePricingTableTenantWithHttpInfo($id, $pricingTableId, $pricingTable, $contentType); + return $response; + } + + /** + * Operation updatePricingTableTenantWithHttpInfo + * + * Update PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePricingTableTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\PricingTable, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePricingTableTenantWithHttpInfo( + string $id, + string $pricingTableId, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['updatePricingTableTenant'][0] + ): array + { + $request = $this->updatePricingTableTenantRequest($id, $pricingTableId, $pricingTable, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\PricingTable', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\PricingTable' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\PricingTable', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\PricingTable', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePricingTableTenantAsync + * + * Update PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePricingTableTenantAsync( + string $id, + string $pricingTableId, + ?\SynergiTech\Staffology\Model\PricingTable $pricingTable = null, + string $contentType = self::contentTypes['updatePricingTableTenant'][0] + ): PromiseInterface + { + return $this->updatePricingTableTenantAsyncWithHttpInfo($id, $pricingTableId, $pricingTable, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePricingTableTenantAsyncWithHttpInfo + * + * Update PricingTable + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updatePricingTableTenantAsyncWithHttpInfo( + $id, + $pricingTableId, + $pricingTable = null, + string $contentType = self::contentTypes['updatePricingTableTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\PricingTable'; + $request = $this->updatePricingTableTenantRequest($id, $pricingTableId, $pricingTable, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePricingTableTenant' + * + * @param string $id (required) + * @param string $pricingTableId (required) + * @param \SynergiTech\Staffology\Model\PricingTable|null $pricingTable (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePricingTableTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePricingTableTenantRequest( + $id, + $pricingTableId, + $pricingTable = null, + string $contentType = self::contentTypes['updatePricingTableTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updatePricingTableTenant' + ); + } + + // verify the required parameter 'pricingTableId' is set + if ($pricingTableId === null || (is_array($pricingTableId) && count($pricingTableId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $pricingTableId when calling updatePricingTableTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/pricingtables/{pricingTableId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($pricingTableId !== null) { + $resourcePath = str_replace( + '{' . 'pricingTableId' . '}', + ObjectSerializer::toPathValue($pricingTableId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($pricingTable)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pricingTable)); + } else { + $httpBody = $pricingTable; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateRtiSubmissionSettingsTenant + * + * Update RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings rtiSubmissionSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\RtiSubmissionSettings + */ + public function updateRtiSubmissionSettingsTenant( + ?string $id = null, + ?\SynergiTech\Staffology\Model\RtiSubmissionSettings $rtiSubmissionSettings = null, + string $contentType = self::contentTypes['updateRtiSubmissionSettingsTenant'][0] + ): \SynergiTech\Staffology\Model\RtiSubmissionSettings + { + list($response) = $this->updateRtiSubmissionSettingsTenantWithHttpInfo($id, $rtiSubmissionSettings, $contentType); + return $response; + } + + /** + * Operation updateRtiSubmissionSettingsTenantWithHttpInfo + * + * Update RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\RtiSubmissionSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateRtiSubmissionSettingsTenantWithHttpInfo( + ?string $id = null, + ?\SynergiTech\Staffology\Model\RtiSubmissionSettings $rtiSubmissionSettings = null, + string $contentType = self::contentTypes['updateRtiSubmissionSettingsTenant'][0] + ): array + { + $request = $this->updateRtiSubmissionSettingsTenantRequest($id, $rtiSubmissionSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\RtiSubmissionSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\RtiSubmissionSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\RtiSubmissionSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\RtiSubmissionSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\RtiSubmissionSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateRtiSubmissionSettingsTenantAsync + * + * Update RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateRtiSubmissionSettingsTenantAsync( + ?string $id = null, + ?\SynergiTech\Staffology\Model\RtiSubmissionSettings $rtiSubmissionSettings = null, + string $contentType = self::contentTypes['updateRtiSubmissionSettingsTenant'][0] + ): PromiseInterface + { + return $this->updateRtiSubmissionSettingsTenantAsyncWithHttpInfo($id, $rtiSubmissionSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateRtiSubmissionSettingsTenantAsyncWithHttpInfo + * + * Update RtiSubmissionSettings + * + * @param string|null $id The Id of the Tenant. (optional) + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateRtiSubmissionSettingsTenantAsyncWithHttpInfo( + $id = null, + $rtiSubmissionSettings = null, + string $contentType = self::contentTypes['updateRtiSubmissionSettingsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\RtiSubmissionSettings'; + $request = $this->updateRtiSubmissionSettingsTenantRequest($id, $rtiSubmissionSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateRtiSubmissionSettingsTenant' + * + * @param string|null $id The Id of the Tenant. (optional) + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRtiSubmissionSettingsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateRtiSubmissionSettingsTenantRequest( + $id = null, + $rtiSubmissionSettings = null, + string $contentType = self::contentTypes['updateRtiSubmissionSettingsTenant'][0] + ): Request + { + + + + + $resourcePath = '/tenants/ritsubmissionsettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $id, + 'id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($rtiSubmissionSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($rtiSubmissionSettings)); + } else { + $httpBody = $rtiSubmissionSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTenant + * + * Update a Tenant + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Tenant + */ + public function updateTenant( + string $id, + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['updateTenant'][0] + ): \SynergiTech\Staffology\Model\Tenant + { + list($response) = $this->updateTenantWithHttpInfo($id, $tenant, $contentType); + return $response; + } + + /** + * Operation updateTenantWithHttpInfo + * + * Update a Tenant + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Tenant, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTenantWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['updateTenant'][0] + ): array + { + $request = $this->updateTenantRequest($id, $tenant, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Tenant', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Tenant' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Tenant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Tenant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTenantAsync + * + * Update a Tenant + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTenantAsync( + string $id, + ?\SynergiTech\Staffology\Model\Tenant $tenant = null, + string $contentType = self::contentTypes['updateTenant'][0] + ): PromiseInterface + { + return $this->updateTenantAsyncWithHttpInfo($id, $tenant, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTenantAsyncWithHttpInfo + * + * Update a Tenant + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTenantAsyncWithHttpInfo( + $id, + $tenant = null, + string $contentType = self::contentTypes['updateTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Tenant'; + $request = $this->updateTenantRequest($id, $tenant, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTenant' + * + * @param string $id The Id of the Tenant you want to update. (required) + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTenantRequest( + $id, + $tenant = null, + string $contentType = self::contentTypes['updateTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateTenant' + ); + } + + + + $resourcePath = '/tenants/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tenant)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tenant)); + } else { + $httpBody = $tenant; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateUserTenant + * + * Update a User + * + * @param string $id The Id of the Tenant you want to update a User for. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user The User details. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function updateUserTenant( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['updateUserTenant'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->updateUserTenantWithHttpInfo($id, $userId, $user, $contentType); + return $response; + } + + /** + * Operation updateUserTenantWithHttpInfo + * + * Update a User + * + * @param string $id The Id of the Tenant you want to update a User for. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user The User details. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUserTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function updateUserTenantWithHttpInfo( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['updateUserTenant'][0] + ): array + { + $request = $this->updateUserTenantRequest($id, $userId, $user, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateUserTenantAsync + * + * Update a User + * + * @param string $id The Id of the Tenant you want to update a User for. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user The User details. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateUserTenantAsync( + string $id, + string $userId, + ?\SynergiTech\Staffology\Model\User $user = null, + string $contentType = self::contentTypes['updateUserTenant'][0] + ): PromiseInterface + { + return $this->updateUserTenantAsyncWithHttpInfo($id, $userId, $user, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateUserTenantAsyncWithHttpInfo + * + * Update a User + * + * @param string $id The Id of the Tenant you want to update a User for. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user The User details. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateUserTenantAsyncWithHttpInfo( + $id, + $userId, + $user = null, + string $contentType = self::contentTypes['updateUserTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->updateUserTenantRequest($id, $userId, $user, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateUserTenant' + * + * @param string $id The Id of the Tenant you want to update a User for. (required) + * @param string $userId The Id of the User. (required) + * @param \SynergiTech\Staffology\Model\User|null $user The User details. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUserTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateUserTenantRequest( + $id, + $userId, + $user = null, + string $contentType = self::contentTypes['updateUserTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateUserTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling updateUserTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/{userId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($user)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($user)); + } else { + $httpBody = $user; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation usageTenant + * + * Get Usage + * + * @param string $id The Id of the Tenant. (required) + * @param int $year year (required) + * @param int $month month (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usageTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function usageTenant( + string $id, + int $year, + int $month, + string $contentType = self::contentTypes['usageTenant'][0] + ): array + { + list($response) = $this->usageTenantWithHttpInfo($id, $year, $month, $contentType); + return $response; + } + + /** + * Operation usageTenantWithHttpInfo + * + * Get Usage + * + * @param string $id The Id of the Tenant. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usageTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function usageTenantWithHttpInfo( + string $id, + int $year, + int $month, + string $contentType = self::contentTypes['usageTenant'][0] + ): array + { + $request = $this->usageTenantRequest($id, $year, $month, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation usageTenantAsync + * + * Get Usage + * + * @param string $id The Id of the Tenant. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usageTenantAsync( + string $id, + int $year, + int $month, + string $contentType = self::contentTypes['usageTenant'][0] + ): PromiseInterface + { + return $this->usageTenantAsyncWithHttpInfo($id, $year, $month, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation usageTenantAsyncWithHttpInfo + * + * Get Usage + * + * @param string $id The Id of the Tenant. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usageTenantAsyncWithHttpInfo( + $id, + $year, + $month, + string $contentType = self::contentTypes['usageTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->usageTenantRequest($id, $year, $month, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'usageTenant' + * + * @param string $id The Id of the Tenant. (required) + * @param int $year (required) + * @param int $month (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usageTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function usageTenantRequest( + $id, + $year, + $month, + string $contentType = self::contentTypes['usageTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling usageTenant' + ); + } + + // verify the required parameter 'year' is set + if ($year === null || (is_array($year) && count($year) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $year when calling usageTenant' + ); + } + + // verify the required parameter 'month' is set + if ($month === null || (is_array($month) && count($month) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $month when calling usageTenant' + ); + } + + + $resourcePath = '/tenants/{id}/usage/{year}/{month}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($year !== null) { + $resourcePath = str_replace( + '{' . 'year' . '}', + ObjectSerializer::toPathValue($year), + $resourcePath + ); + } + // path params + if ($month !== null) { + $resourcePath = str_replace( + '{' . 'month' . '}', + ObjectSerializer::toPathValue($month), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation userBillsTenant + * + * Get User Bills + * + * @param string $id The Id of the Tenant you want to get a Users UsageBills for. (required) + * @param string $userId userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userBillsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function userBillsTenant( + string $id, + string $userId, + string $contentType = self::contentTypes['userBillsTenant'][0] + ): array + { + list($response) = $this->userBillsTenantWithHttpInfo($id, $userId, $contentType); + return $response; + } + + /** + * Operation userBillsTenantWithHttpInfo + * + * Get User Bills + * + * @param string $id The Id of the Tenant you want to get a Users UsageBills for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userBillsTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function userBillsTenantWithHttpInfo( + string $id, + string $userId, + string $contentType = self::contentTypes['userBillsTenant'][0] + ): array + { + $request = $this->userBillsTenantRequest($id, $userId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation userBillsTenantAsync + * + * Get User Bills + * + * @param string $id The Id of the Tenant you want to get a Users UsageBills for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userBillsTenantAsync( + string $id, + string $userId, + string $contentType = self::contentTypes['userBillsTenant'][0] + ): PromiseInterface + { + return $this->userBillsTenantAsyncWithHttpInfo($id, $userId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation userBillsTenantAsyncWithHttpInfo + * + * Get User Bills + * + * @param string $id The Id of the Tenant you want to get a Users UsageBills for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userBillsTenantAsyncWithHttpInfo( + $id, + $userId, + string $contentType = self::contentTypes['userBillsTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->userBillsTenantRequest($id, $userId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'userBillsTenant' + * + * @param string $id The Id of the Tenant you want to get a Users UsageBills for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userBillsTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function userBillsTenantRequest( + $id, + $userId, + string $contentType = self::contentTypes['userBillsTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling userBillsTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling userBillsTenant' + ); + } + + + $resourcePath = '/tenants/{id}/users/{userId}/bills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation userEmployersTenant + * + * Get User Employers + * + * @param string $id The Id of the Tenant you want to get User Employers for. (required) + * @param string $userId userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function userEmployersTenant( + string $id, + string $userId, + string $contentType = self::contentTypes['userEmployersTenant'][0] + ): array + { + list($response) = $this->userEmployersTenantWithHttpInfo($id, $userId, $contentType); + return $response; + } + + /** + * Operation userEmployersTenantWithHttpInfo + * + * Get User Employers + * + * @param string $id The Id of the Tenant you want to get User Employers for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userEmployersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function userEmployersTenantWithHttpInfo( + string $id, + string $userId, + string $contentType = self::contentTypes['userEmployersTenant'][0] + ): array + { + $request = $this->userEmployersTenantRequest($id, $userId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation userEmployersTenantAsync + * + * Get User Employers + * + * @param string $id The Id of the Tenant you want to get User Employers for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userEmployersTenantAsync( + string $id, + string $userId, + string $contentType = self::contentTypes['userEmployersTenant'][0] + ): PromiseInterface + { + return $this->userEmployersTenantAsyncWithHttpInfo($id, $userId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation userEmployersTenantAsyncWithHttpInfo + * + * Get User Employers + * + * @param string $id The Id of the Tenant you want to get User Employers for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userEmployersTenantAsyncWithHttpInfo( + $id, + $userId, + string $contentType = self::contentTypes['userEmployersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->userEmployersTenantRequest($id, $userId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'userEmployersTenant' + * + * @param string $id The Id of the Tenant you want to get User Employers for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userEmployersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function userEmployersTenantRequest( + $id, + $userId, + string $contentType = self::contentTypes['userEmployersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling userEmployersTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling userEmployersTenant' + ); + } + + + $resourcePath = '/tenants/{id}/users/{userId}/employers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation userTenant + * + * Get a User + * + * @param string $id The Id of the Tenant you want to get a User for. (required) + * @param string $userId userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\User + */ + public function userTenant( + string $id, + string $userId, + string $contentType = self::contentTypes['userTenant'][0] + ): \SynergiTech\Staffology\Model\User + { + list($response) = $this->userTenantWithHttpInfo($id, $userId, $contentType); + return $response; + } + + /** + * Operation userTenantWithHttpInfo + * + * Get a User + * + * @param string $id The Id of the Tenant you want to get a User for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\User, HTTP status code, HTTP response headers (array of strings) + */ + public function userTenantWithHttpInfo( + string $id, + string $userId, + string $contentType = self::contentTypes['userTenant'][0] + ): array + { + $request = $this->userTenantRequest($id, $userId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\User' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\User'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation userTenantAsync + * + * Get a User + * + * @param string $id The Id of the Tenant you want to get a User for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userTenantAsync( + string $id, + string $userId, + string $contentType = self::contentTypes['userTenant'][0] + ): PromiseInterface + { + return $this->userTenantAsyncWithHttpInfo($id, $userId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation userTenantAsyncWithHttpInfo + * + * Get a User + * + * @param string $id The Id of the Tenant you want to get a User for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function userTenantAsyncWithHttpInfo( + $id, + $userId, + string $contentType = self::contentTypes['userTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\User'; + $request = $this->userTenantRequest($id, $userId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'userTenant' + * + * @param string $id The Id of the Tenant you want to get a User for. (required) + * @param string $userId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['userTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function userTenantRequest( + $id, + $userId, + string $contentType = self::contentTypes['userTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling userTenant' + ); + } + + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $userId when calling userTenant' + ); + } + + + $resourcePath = '/tenants/{id}/users/{userId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation usersSearchTenant + * + * Search Users + * + * @param string $id The Id of the Tenant you want to search Users for. (required) + * @param string|null $q q (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersSearchTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function usersSearchTenant( + string $id, + ?string $q = null, + string $contentType = self::contentTypes['usersSearchTenant'][0] + ): array + { + list($response) = $this->usersSearchTenantWithHttpInfo($id, $q, $contentType); + return $response; + } + + /** + * Operation usersSearchTenantWithHttpInfo + * + * Search Users + * + * @param string $id The Id of the Tenant you want to search Users for. (required) + * @param string|null $q (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersSearchTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function usersSearchTenantWithHttpInfo( + string $id, + ?string $q = null, + string $contentType = self::contentTypes['usersSearchTenant'][0] + ): array + { + $request = $this->usersSearchTenantRequest($id, $q, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation usersSearchTenantAsync + * + * Search Users + * + * @param string $id The Id of the Tenant you want to search Users for. (required) + * @param string|null $q (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersSearchTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usersSearchTenantAsync( + string $id, + ?string $q = null, + string $contentType = self::contentTypes['usersSearchTenant'][0] + ): PromiseInterface + { + return $this->usersSearchTenantAsyncWithHttpInfo($id, $q, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation usersSearchTenantAsyncWithHttpInfo + * + * Search Users + * + * @param string $id The Id of the Tenant you want to search Users for. (required) + * @param string|null $q (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersSearchTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usersSearchTenantAsyncWithHttpInfo( + $id, + $q = null, + string $contentType = self::contentTypes['usersSearchTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->usersSearchTenantRequest($id, $q, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'usersSearchTenant' + * + * @param string $id The Id of the Tenant you want to search Users for. (required) + * @param string|null $q (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersSearchTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function usersSearchTenantRequest( + $id, + $q = null, + string $contentType = self::contentTypes['usersSearchTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling usersSearchTenant' + ); + } + + + + $resourcePath = '/tenants/{id}/users/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $q, + 'q', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation usersTenant + * + * List Users + * + * @param string $id The Id of the Tenant you want to list Users for. (required) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param bool|null $sortByLastLogin sortByLastLogin (optional, default to false) + * @param \SynergiTech\Staffology\Model\UserCategory|null $category category (optional) + * @param bool|null $isBureauMember isBureauMember (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function usersTenant( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + ?bool $sortByLastLogin = false, + ?\SynergiTech\Staffology\Model\UserCategory $category = null, + ?bool $isBureauMember = null, + string $contentType = self::contentTypes['usersTenant'][0] + ): array + { + list($response) = $this->usersTenantWithHttpInfo($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember, $contentType); + return $response; + } + + /** + * Operation usersTenantWithHttpInfo + * + * List Users + * + * @param string $id The Id of the Tenant you want to list Users for. (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param bool|null $sortByLastLogin (optional, default to false) + * @param \SynergiTech\Staffology\Model\UserCategory|null $category (optional) + * @param bool|null $isBureauMember (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function usersTenantWithHttpInfo( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + ?bool $sortByLastLogin = false, + ?\SynergiTech\Staffology\Model\UserCategory $category = null, + ?bool $isBureauMember = null, + string $contentType = self::contentTypes['usersTenant'][0] + ): array + { + $request = $this->usersTenantRequest($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation usersTenantAsync + * + * List Users + * + * @param string $id The Id of the Tenant you want to list Users for. (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param bool|null $sortByLastLogin (optional, default to false) + * @param \SynergiTech\Staffology\Model\UserCategory|null $category (optional) + * @param bool|null $isBureauMember (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usersTenantAsync( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + ?bool $sortByLastLogin = false, + ?\SynergiTech\Staffology\Model\UserCategory $category = null, + ?bool $isBureauMember = null, + string $contentType = self::contentTypes['usersTenant'][0] + ): PromiseInterface + { + return $this->usersTenantAsyncWithHttpInfo($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation usersTenantAsyncWithHttpInfo + * + * List Users + * + * @param string $id The Id of the Tenant you want to list Users for. (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param bool|null $sortByLastLogin (optional, default to false) + * @param \SynergiTech\Staffology\Model\UserCategory|null $category (optional) + * @param bool|null $isBureauMember (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function usersTenantAsyncWithHttpInfo( + $id, + $pageNum = null, + $pageSize = null, + $sortByLastLogin = false, + $category = null, + $isBureauMember = null, + string $contentType = self::contentTypes['usersTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->usersTenantRequest($id, $pageNum, $pageSize, $sortByLastLogin, $category, $isBureauMember, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'usersTenant' + * + * @param string $id The Id of the Tenant you want to list Users for. (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param bool|null $sortByLastLogin (optional, default to false) + * @param \SynergiTech\Staffology\Model\UserCategory|null $category (optional) + * @param bool|null $isBureauMember (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['usersTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function usersTenantRequest( + $id, + $pageNum = null, + $pageSize = null, + $sortByLastLogin = false, + $category = null, + $isBureauMember = null, + string $contentType = self::contentTypes['usersTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling usersTenant' + ); + } + + + + + + + + $resourcePath = '/tenants/{id}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sortByLastLogin, + 'sortByLastLogin', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category, + 'category', // param base name + 'UserCategory', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $isBureauMember, + 'isBureauMember', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation weeklyActivityTenant + * + * Weekly Activity Report + * + * @param string $id The Id of the Tenant (required) + * @param \DateTime|null $fromDate fromDate (optional) + * @param \DateTime|null $toDate toDate (optional) + * @param string|null $accept accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['weeklyActivityTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ReportResponse + */ + public function weeklyActivityTenant( + string $id, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['weeklyActivityTenant'][0] + ): \SynergiTech\Staffology\Model\ReportResponse + { + list($response) = $this->weeklyActivityTenantWithHttpInfo($id, $fromDate, $toDate, $accept, $allTenants, $contentType); + return $response; + } + + /** + * Operation weeklyActivityTenantWithHttpInfo + * + * Weekly Activity Report + * + * @param string $id The Id of the Tenant (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['weeklyActivityTenant'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ReportResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function weeklyActivityTenantWithHttpInfo( + string $id, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['weeklyActivityTenant'][0] + ): array + { + $request = $this->weeklyActivityTenantRequest($id, $fromDate, $toDate, $accept, $allTenants, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ReportResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ReportResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ReportResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation weeklyActivityTenantAsync + * + * Weekly Activity Report + * + * @param string $id The Id of the Tenant (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['weeklyActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function weeklyActivityTenantAsync( + string $id, + ?\DateTime $fromDate = null, + ?\DateTime $toDate = null, + ?string $accept = null, + ?bool $allTenants = false, + string $contentType = self::contentTypes['weeklyActivityTenant'][0] + ): PromiseInterface + { + return $this->weeklyActivityTenantAsyncWithHttpInfo($id, $fromDate, $toDate, $accept, $allTenants, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation weeklyActivityTenantAsyncWithHttpInfo + * + * Weekly Activity Report + * + * @param string $id The Id of the Tenant (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['weeklyActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function weeklyActivityTenantAsyncWithHttpInfo( + $id, + $fromDate = null, + $toDate = null, + $accept = null, + $allTenants = false, + string $contentType = self::contentTypes['weeklyActivityTenant'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ReportResponse'; + $request = $this->weeklyActivityTenantRequest($id, $fromDate, $toDate, $accept, $allTenants, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'weeklyActivityTenant' + * + * @param string $id The Id of the Tenant (required) + * @param \DateTime|null $fromDate (optional) + * @param \DateTime|null $toDate (optional) + * @param string|null $accept (optional) + * @param bool|null $allTenants If set to true then the report will include all Tenants to which you have access (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['weeklyActivityTenant'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function weeklyActivityTenantRequest( + $id, + $fromDate = null, + $toDate = null, + $accept = null, + $allTenants = false, + string $contentType = self::contentTypes['weeklyActivityTenant'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling weeklyActivityTenant' + ); + } + + + + + + + $resourcePath = '/tenants/{id}/reports/weeklyactivity'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fromDate, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $toDate, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $allTenants, + 'allTenants', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + // header params + if ($accept !== null) { + $headerParams['accept'] = ObjectSerializer::toHeaderValue($accept); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/csv', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TenantEmailApi.php b/src/Api/TenantEmailApi.php new file mode 100644 index 0000000..1fc9efd --- /dev/null +++ b/src/Api/TenantEmailApi.php @@ -0,0 +1,2252 @@ + [ + 'application/json', + ], + 'getMailSettingsTenantEmail' => [ + 'application/json', + ], + 'indexTenantEmail' => [ + 'application/json', + ], + 'resendEmailTenantEmail' => [ + 'application/json', + ], + 'testMailSettingsTenantEmail' => [ + 'application/json', + ], + 'updateMailSettingsTenantEmail' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation getEmailTenantEmail + * + * Get Email + * + * @param string $id id (required) + * @param string $emailId emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\TenantEmail + */ + public function getEmailTenantEmail( + string $id, + string $emailId, + string $contentType = self::contentTypes['getEmailTenantEmail'][0] + ): \SynergiTech\Staffology\Model\TenantEmail + { + list($response) = $this->getEmailTenantEmailWithHttpInfo($id, $emailId, $contentType); + return $response; + } + + /** + * Operation getEmailTenantEmailWithHttpInfo + * + * Get Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\TenantEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailTenantEmailWithHttpInfo( + string $id, + string $emailId, + string $contentType = self::contentTypes['getEmailTenantEmail'][0] + ): array + { + $request = $this->getEmailTenantEmailRequest($id, $emailId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\TenantEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\TenantEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\TenantEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\TenantEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\TenantEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailTenantEmailAsync + * + * Get Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmailTenantEmailAsync( + string $id, + string $emailId, + string $contentType = self::contentTypes['getEmailTenantEmail'][0] + ): PromiseInterface + { + return $this->getEmailTenantEmailAsyncWithHttpInfo($id, $emailId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailTenantEmailAsyncWithHttpInfo + * + * Get Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getEmailTenantEmailAsyncWithHttpInfo( + $id, + $emailId, + string $contentType = self::contentTypes['getEmailTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\TenantEmail'; + $request = $this->getEmailTenantEmailRequest($id, $emailId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmailTenantEmail' + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getEmailTenantEmailRequest( + $id, + $emailId, + string $contentType = self::contentTypes['getEmailTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getEmailTenantEmail' + ); + } + + // verify the required parameter 'emailId' is set + if ($emailId === null || (is_array($emailId) && count($emailId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $emailId when calling getEmailTenantEmail' + ); + } + + + $resourcePath = '/tenants/{id}/email/{emailId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($emailId !== null) { + $resourcePath = str_replace( + '{' . 'emailId' . '}', + ObjectSerializer::toPathValue($emailId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailSettingsTenantEmail + * + * Get MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\MailSettings + */ + public function getMailSettingsTenantEmail( + string $id, + string $contentType = self::contentTypes['getMailSettingsTenantEmail'][0] + ): \SynergiTech\Staffology\Model\MailSettings + { + list($response) = $this->getMailSettingsTenantEmailWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getMailSettingsTenantEmailWithHttpInfo + * + * Get MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\MailSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailSettingsTenantEmailWithHttpInfo( + string $id, + string $contentType = self::contentTypes['getMailSettingsTenantEmail'][0] + ): array + { + $request = $this->getMailSettingsTenantEmailRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\MailSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\MailSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\MailSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\MailSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailSettingsTenantEmailAsync + * + * Get MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMailSettingsTenantEmailAsync( + string $id, + string $contentType = self::contentTypes['getMailSettingsTenantEmail'][0] + ): PromiseInterface + { + return $this->getMailSettingsTenantEmailAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailSettingsTenantEmailAsyncWithHttpInfo + * + * Get MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getMailSettingsTenantEmailAsyncWithHttpInfo( + $id, + string $contentType = self::contentTypes['getMailSettingsTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + $request = $this->getMailSettingsTenantEmailRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailSettingsTenantEmail' + * + * @param string $id The Id of the Tenant (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMailSettingsTenantEmailRequest( + $id, + string $contentType = self::contentTypes['getMailSettingsTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getMailSettingsTenantEmail' + ); + } + + + $resourcePath = '/tenants/{id}/email/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexTenantEmail + * + * List Emails + * + * @param string $id id (required) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexTenantEmail( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexTenantEmail'][0] + ): array + { + list($response) = $this->indexTenantEmailWithHttpInfo($id, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation indexTenantEmailWithHttpInfo + * + * List Emails + * + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexTenantEmailWithHttpInfo( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexTenantEmail'][0] + ): array + { + $request = $this->indexTenantEmailRequest($id, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexTenantEmailAsync + * + * List Emails + * + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTenantEmailAsync( + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['indexTenantEmail'][0] + ): PromiseInterface + { + return $this->indexTenantEmailAsyncWithHttpInfo($id, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexTenantEmailAsyncWithHttpInfo + * + * List Emails + * + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTenantEmailAsyncWithHttpInfo( + $id, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['indexTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexTenantEmailRequest($id, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexTenantEmail' + * + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexTenantEmailRequest( + $id, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['indexTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling indexTenantEmail' + ); + } + + + + + $resourcePath = '/tenants/{id}/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation resendEmailTenantEmail + * + * Re-send Email + * + * @param string $id id (required) + * @param string $emailId emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\TenantEmail + */ + public function resendEmailTenantEmail( + string $id, + string $emailId, + string $contentType = self::contentTypes['resendEmailTenantEmail'][0] + ): \SynergiTech\Staffology\Model\TenantEmail + { + list($response) = $this->resendEmailTenantEmailWithHttpInfo($id, $emailId, $contentType); + return $response; + } + + /** + * Operation resendEmailTenantEmailWithHttpInfo + * + * Re-send Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\TenantEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function resendEmailTenantEmailWithHttpInfo( + string $id, + string $emailId, + string $contentType = self::contentTypes['resendEmailTenantEmail'][0] + ): array + { + $request = $this->resendEmailTenantEmailRequest($id, $emailId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\TenantEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\TenantEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\TenantEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\TenantEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\TenantEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation resendEmailTenantEmailAsync + * + * Re-send Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resendEmailTenantEmailAsync( + string $id, + string $emailId, + string $contentType = self::contentTypes['resendEmailTenantEmail'][0] + ): PromiseInterface + { + return $this->resendEmailTenantEmailAsyncWithHttpInfo($id, $emailId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation resendEmailTenantEmailAsyncWithHttpInfo + * + * Re-send Email + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function resendEmailTenantEmailAsyncWithHttpInfo( + $id, + $emailId, + string $contentType = self::contentTypes['resendEmailTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\TenantEmail'; + $request = $this->resendEmailTenantEmailRequest($id, $emailId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'resendEmailTenantEmail' + * + * @param string $id (required) + * @param string $emailId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resendEmailTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function resendEmailTenantEmailRequest( + $id, + $emailId, + string $contentType = self::contentTypes['resendEmailTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling resendEmailTenantEmail' + ); + } + + // verify the required parameter 'emailId' is set + if ($emailId === null || (is_array($emailId) && count($emailId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $emailId when calling resendEmailTenantEmail' + ); + } + + + $resourcePath = '/tenants/{id}/email/{emailId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($emailId !== null) { + $resourcePath = str_replace( + '{' . 'emailId' . '}', + ObjectSerializer::toPathValue($emailId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation testMailSettingsTenantEmail + * + * Send test email + * + * @param string $id The Id of the Tenant (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\EmployerEmail + */ + public function testMailSettingsTenantEmail( + string $id, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsTenantEmail'][0] + ): \SynergiTech\Staffology\Model\EmployerEmail + { + list($response) = $this->testMailSettingsTenantEmailWithHttpInfo($id, $email, $contentType); + return $response; + } + + /** + * Operation testMailSettingsTenantEmailWithHttpInfo + * + * Send test email + * + * @param string $id The Id of the Tenant (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\EmployerEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function testMailSettingsTenantEmailWithHttpInfo( + string $id, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsTenantEmail'][0] + ): array + { + $request = $this->testMailSettingsTenantEmailRequest($id, $email, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\EmployerEmail', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\EmployerEmail' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\EmployerEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\EmployerEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation testMailSettingsTenantEmailAsync + * + * Send test email + * + * @param string $id The Id of the Tenant (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testMailSettingsTenantEmailAsync( + string $id, + ?string $email = null, + string $contentType = self::contentTypes['testMailSettingsTenantEmail'][0] + ): PromiseInterface + { + return $this->testMailSettingsTenantEmailAsyncWithHttpInfo($id, $email, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testMailSettingsTenantEmailAsyncWithHttpInfo + * + * Send test email + * + * @param string $id The Id of the Tenant (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testMailSettingsTenantEmailAsyncWithHttpInfo( + $id, + $email = null, + string $contentType = self::contentTypes['testMailSettingsTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\EmployerEmail'; + $request = $this->testMailSettingsTenantEmailRequest($id, $email, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testMailSettingsTenantEmail' + * + * @param string $id The Id of the Tenant (required) + * @param string|null $email The address to send a test email to (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testMailSettingsTenantEmailRequest( + $id, + $email = null, + string $contentType = self::contentTypes['testMailSettingsTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling testMailSettingsTenantEmail' + ); + } + + + + $resourcePath = '/tenants/{id}/email/settings/test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $email, + 'email', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMailSettingsTenantEmail + * + * Update MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\MailSettings + */ + public function updateMailSettingsTenantEmail( + string $id, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsTenantEmail'][0] + ): \SynergiTech\Staffology\Model\MailSettings + { + list($response) = $this->updateMailSettingsTenantEmailWithHttpInfo($id, $mailSettings, $contentType); + return $response; + } + + /** + * Operation updateMailSettingsTenantEmailWithHttpInfo + * + * Update MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\MailSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function updateMailSettingsTenantEmailWithHttpInfo( + string $id, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsTenantEmail'][0] + ): array + { + $request = $this->updateMailSettingsTenantEmailRequest($id, $mailSettings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\MailSettings', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\MailSettings' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\MailSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\MailSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMailSettingsTenantEmailAsync + * + * Update MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMailSettingsTenantEmailAsync( + string $id, + ?\SynergiTech\Staffology\Model\MailSettings $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsTenantEmail'][0] + ): PromiseInterface + { + return $this->updateMailSettingsTenantEmailAsyncWithHttpInfo($id, $mailSettings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMailSettingsTenantEmailAsyncWithHttpInfo + * + * Update MailSettings + * + * @param string $id The Id of the Tenant (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateMailSettingsTenantEmailAsyncWithHttpInfo( + $id, + $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsTenantEmail'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\MailSettings'; + $request = $this->updateMailSettingsTenantEmailRequest($id, $mailSettings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMailSettingsTenantEmail' + * + * @param string $id The Id of the Tenant (required) + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMailSettingsTenantEmail'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateMailSettingsTenantEmailRequest( + $id, + $mailSettings = null, + string $contentType = self::contentTypes['updateMailSettingsTenantEmail'][0] + ): Request + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateMailSettingsTenantEmail' + ); + } + + + + $resourcePath = '/tenants/{id}/email/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($mailSettings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($mailSettings)); + } else { + $httpBody = $mailSettings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TermCalendarApi.php b/src/Api/TermCalendarApi.php new file mode 100644 index 0000000..48e3890 --- /dev/null +++ b/src/Api/TermCalendarApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteTermCalendar' => [ + 'application/json', + ], + 'getTermCalendar' => [ + 'application/json', + ], + 'indexTermCalendar' => [ + 'application/json', + ], + 'updateTermCalendar' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createTermCalendar + * + * Create Term Calendar + * + * @param string $employerId The Id of the Employer to which new Term Calendar will be created. (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarResponse + */ + public function createTermCalendar( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['createTermCalendar'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarResponse + { + list($response) = $this->createTermCalendarWithHttpInfo($employerId, $contractTermCalendarRequest, $contentType); + return $response; + } + + /** + * Operation createTermCalendarWithHttpInfo + * + * Create Term Calendar + * + * @param string $employerId The Id of the Employer to which new Term Calendar will be created. (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createTermCalendarWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['createTermCalendar'][0] + ): array + { + $request = $this->createTermCalendarRequest($employerId, $contractTermCalendarRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTermCalendarAsync + * + * Create Term Calendar + * + * @param string $employerId The Id of the Employer to which new Term Calendar will be created. (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTermCalendarAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['createTermCalendar'][0] + ): PromiseInterface + { + return $this->createTermCalendarAsyncWithHttpInfo($employerId, $contractTermCalendarRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTermCalendarAsyncWithHttpInfo + * + * Create Term Calendar + * + * @param string $employerId The Id of the Employer to which new Term Calendar will be created. (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTermCalendarAsyncWithHttpInfo( + $employerId, + $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['createTermCalendar'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + $request = $this->createTermCalendarRequest($employerId, $contractTermCalendarRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createTermCalendar' + * + * @param string $employerId The Id of the Employer to which new Term Calendar will be created. (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createTermCalendarRequest( + $employerId, + $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['createTermCalendar'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createTermCalendar' + ); + } + + + + $resourcePath = '/employers/{employerId}/termcalendars'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractTermCalendarRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractTermCalendarRequest)); + } else { + $httpBody = $contractTermCalendarRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteTermCalendar + * + * Delete Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteTermCalendar( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendar'][0] + ): void + { + $this->deleteTermCalendarWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteTermCalendarWithHttpInfo + * + * Delete Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteTermCalendarWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendar'][0] + ): array + { + $request = $this->deleteTermCalendarRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteTermCalendarAsync + * + * Delete Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTermCalendarAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendar'][0] + ): PromiseInterface + { + return $this->deleteTermCalendarAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteTermCalendarAsyncWithHttpInfo + * + * Delete Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTermCalendarAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteTermCalendar'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteTermCalendarRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTermCalendar' + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteTermCalendarRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteTermCalendar'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteTermCalendar' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteTermCalendar' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendars/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTermCalendar + * + * Get Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarResponse + */ + public function getTermCalendar( + string $employerId, + string $id, + string $contentType = self::contentTypes['getTermCalendar'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarResponse + { + list($response) = $this->getTermCalendarWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getTermCalendarWithHttpInfo + * + * Get Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getTermCalendarWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getTermCalendar'][0] + ): array + { + $request = $this->getTermCalendarRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTermCalendarAsync + * + * Get Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTermCalendarAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getTermCalendar'][0] + ): PromiseInterface + { + return $this->getTermCalendarAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTermCalendarAsyncWithHttpInfo + * + * Get Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTermCalendarAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getTermCalendar'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + $request = $this->getTermCalendarRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTermCalendar' + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTermCalendarRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getTermCalendar'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getTermCalendar' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getTermCalendar' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendars/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexTermCalendar + * + * List Term Calendars + * + * @param string $employerId The Id of the Employer for which you want to get the Term Calendar list (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarResponse[] + */ + public function indexTermCalendar( + string $employerId, + string $contentType = self::contentTypes['indexTermCalendar'][0] + ): array + { + list($response) = $this->indexTermCalendarWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexTermCalendarWithHttpInfo + * + * List Term Calendars + * + * @param string $employerId The Id of the Employer for which you want to get the Term Calendar list (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexTermCalendarWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexTermCalendar'][0] + ): array + { + $request = $this->indexTermCalendarRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexTermCalendarAsync + * + * List Term Calendars + * + * @param string $employerId The Id of the Employer for which you want to get the Term Calendar list (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTermCalendarAsync( + string $employerId, + string $contentType = self::contentTypes['indexTermCalendar'][0] + ): PromiseInterface + { + return $this->indexTermCalendarAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexTermCalendarAsyncWithHttpInfo + * + * List Term Calendars + * + * @param string $employerId The Id of the Employer for which you want to get the Term Calendar list (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTermCalendarAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexTermCalendar'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse[]'; + $request = $this->indexTermCalendarRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexTermCalendar' + * + * @param string $employerId The Id of the Employer for which you want to get the Term Calendar list (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexTermCalendarRequest( + $employerId, + string $contentType = self::contentTypes['indexTermCalendar'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexTermCalendar' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendars'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTermCalendar + * + * Update Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to update (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarResponse + */ + public function updateTermCalendar( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['updateTermCalendar'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarResponse + { + list($response) = $this->updateTermCalendarWithHttpInfo($employerId, $id, $contractTermCalendarRequest, $contentType); + return $response; + } + + /** + * Operation updateTermCalendarWithHttpInfo + * + * Update Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to update (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendar'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTermCalendarWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['updateTermCalendar'][0] + ): array + { + $request = $this->updateTermCalendarRequest($employerId, $id, $contractTermCalendarRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTermCalendarAsync + * + * Update Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to update (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTermCalendarAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarRequest $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['updateTermCalendar'][0] + ): PromiseInterface + { + return $this->updateTermCalendarAsyncWithHttpInfo($employerId, $id, $contractTermCalendarRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTermCalendarAsyncWithHttpInfo + * + * Update Term Calendar + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to update (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTermCalendarAsyncWithHttpInfo( + $employerId, + $id, + $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['updateTermCalendar'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarResponse'; + $request = $this->updateTermCalendarRequest($employerId, $id, $contractTermCalendarRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTermCalendar' + * + * @param string $employerId The Id of the Employer to which the Term Calendar belongs. (required) + * @param string $id The Id of the Term Calendar which you want to update (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarRequest|null $contractTermCalendarRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendar'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTermCalendarRequest( + $employerId, + $id, + $contractTermCalendarRequest = null, + string $contentType = self::contentTypes['updateTermCalendar'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateTermCalendar' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateTermCalendar' + ); + } + + + + $resourcePath = '/employers/{employerId}/termcalendars/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractTermCalendarRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractTermCalendarRequest)); + } else { + $httpBody = $contractTermCalendarRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TermCalendarYearApi.php b/src/Api/TermCalendarYearApi.php new file mode 100644 index 0000000..c77e086 --- /dev/null +++ b/src/Api/TermCalendarYearApi.php @@ -0,0 +1,1942 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteTermCalendarYear' => [ + 'application/json', + ], + 'getTermCalendarYear' => [ + 'application/json', + ], + 'indexTermCalendarYear' => [ + 'application/json', + ], + 'updateTermCalendarYear' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createTermCalendarYear + * + * Create Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to add a new year (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + */ + public function createTermCalendarYear( + string $employerId, + string $termCalendarId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['createTermCalendarYear'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + { + list($response) = $this->createTermCalendarYearWithHttpInfo($employerId, $termCalendarId, $contractTermCalendarYearRequest, $contentType); + return $response; + } + + /** + * Operation createTermCalendarYearWithHttpInfo + * + * Create Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to add a new year (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createTermCalendarYearWithHttpInfo( + string $employerId, + string $termCalendarId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['createTermCalendarYear'][0] + ): array + { + $request = $this->createTermCalendarYearRequest($employerId, $termCalendarId, $contractTermCalendarYearRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTermCalendarYearAsync + * + * Create Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to add a new year (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTermCalendarYearAsync( + string $employerId, + string $termCalendarId, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['createTermCalendarYear'][0] + ): PromiseInterface + { + return $this->createTermCalendarYearAsyncWithHttpInfo($employerId, $termCalendarId, $contractTermCalendarYearRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTermCalendarYearAsyncWithHttpInfo + * + * Create Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to add a new year (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createTermCalendarYearAsyncWithHttpInfo( + $employerId, + $termCalendarId, + $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['createTermCalendarYear'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + $request = $this->createTermCalendarYearRequest($employerId, $termCalendarId, $contractTermCalendarYearRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createTermCalendarYear' + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to add a new year (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createTermCalendarYearRequest( + $employerId, + $termCalendarId, + $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['createTermCalendarYear'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createTermCalendarYear' + ); + } + + // verify the required parameter 'termCalendarId' is set + if ($termCalendarId === null || (is_array($termCalendarId) && count($termCalendarId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $termCalendarId when calling createTermCalendarYear' + ); + } + + + + $resourcePath = '/employers/{employerId}/termcalendaryears/{termCalendarId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($termCalendarId !== null) { + $resourcePath = str_replace( + '{' . 'termCalendarId' . '}', + ObjectSerializer::toPathValue($termCalendarId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractTermCalendarYearRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractTermCalendarYearRequest)); + } else { + $httpBody = $contractTermCalendarYearRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteTermCalendarYear + * + * Delete Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to delete a year (required) + * @param string $id The Id of the Term Calendar Year which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteTermCalendarYear( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendarYear'][0] + ): void + { + $this->deleteTermCalendarYearWithHttpInfo($employerId, $termCalendarId, $id, $contentType); + } + + /** + * Operation deleteTermCalendarYearWithHttpInfo + * + * Delete Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to delete a year (required) + * @param string $id The Id of the Term Calendar Year which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteTermCalendarYearWithHttpInfo( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendarYear'][0] + ): array + { + $request = $this->deleteTermCalendarYearRequest($employerId, $termCalendarId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteTermCalendarYearAsync + * + * Delete Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to delete a year (required) + * @param string $id The Id of the Term Calendar Year which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTermCalendarYearAsync( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['deleteTermCalendarYear'][0] + ): PromiseInterface + { + return $this->deleteTermCalendarYearAsyncWithHttpInfo($employerId, $termCalendarId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteTermCalendarYearAsyncWithHttpInfo + * + * Delete Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to delete a year (required) + * @param string $id The Id of the Term Calendar Year which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteTermCalendarYearAsyncWithHttpInfo( + $employerId, + $termCalendarId, + $id, + string $contentType = self::contentTypes['deleteTermCalendarYear'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteTermCalendarYearRequest($employerId, $termCalendarId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTermCalendarYear' + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to delete a year (required) + * @param string $id The Id of the Term Calendar Year which you want to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteTermCalendarYearRequest( + $employerId, + $termCalendarId, + $id, + string $contentType = self::contentTypes['deleteTermCalendarYear'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteTermCalendarYear' + ); + } + + // verify the required parameter 'termCalendarId' is set + if ($termCalendarId === null || (is_array($termCalendarId) && count($termCalendarId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $termCalendarId when calling deleteTermCalendarYear' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteTermCalendarYear' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendaryears/{termCalendarId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($termCalendarId !== null) { + $resourcePath = str_replace( + '{' . 'termCalendarId' . '}', + ObjectSerializer::toPathValue($termCalendarId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTermCalendarYear + * + * Get Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar to which the Year belongs (required) + * @param string $id The Id of the Term Calendar Year which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + */ + public function getTermCalendarYear( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['getTermCalendarYear'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + { + list($response) = $this->getTermCalendarYearWithHttpInfo($employerId, $termCalendarId, $id, $contentType); + return $response; + } + + /** + * Operation getTermCalendarYearWithHttpInfo + * + * Get Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar to which the Year belongs (required) + * @param string $id The Id of the Term Calendar Year which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getTermCalendarYearWithHttpInfo( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['getTermCalendarYear'][0] + ): array + { + $request = $this->getTermCalendarYearRequest($employerId, $termCalendarId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTermCalendarYearAsync + * + * Get Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar to which the Year belongs (required) + * @param string $id The Id of the Term Calendar Year which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTermCalendarYearAsync( + string $employerId, + string $termCalendarId, + string $id, + string $contentType = self::contentTypes['getTermCalendarYear'][0] + ): PromiseInterface + { + return $this->getTermCalendarYearAsyncWithHttpInfo($employerId, $termCalendarId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTermCalendarYearAsyncWithHttpInfo + * + * Get Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar to which the Year belongs (required) + * @param string $id The Id of the Term Calendar Year which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTermCalendarYearAsyncWithHttpInfo( + $employerId, + $termCalendarId, + $id, + string $contentType = self::contentTypes['getTermCalendarYear'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + $request = $this->getTermCalendarYearRequest($employerId, $termCalendarId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTermCalendarYear' + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar to which the Year belongs (required) + * @param string $id The Id of the Term Calendar Year which you want to fetch (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTermCalendarYearRequest( + $employerId, + $termCalendarId, + $id, + string $contentType = self::contentTypes['getTermCalendarYear'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getTermCalendarYear' + ); + } + + // verify the required parameter 'termCalendarId' is set + if ($termCalendarId === null || (is_array($termCalendarId) && count($termCalendarId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $termCalendarId when calling getTermCalendarYear' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getTermCalendarYear' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendaryears/{termCalendarId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($termCalendarId !== null) { + $resourcePath = str_replace( + '{' . 'termCalendarId' . '}', + ObjectSerializer::toPathValue($termCalendarId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexTermCalendarYear + * + * List Term Calendar Years + * + * @param string $employerId The Id of the Employer for which you want to get Term Calendar Year list (required) + * @param string $termCalendarId The Id of the Term Calendar for which you want to list Years (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[] + */ + public function indexTermCalendarYear( + string $employerId, + string $termCalendarId, + string $contentType = self::contentTypes['indexTermCalendarYear'][0] + ): array + { + list($response) = $this->indexTermCalendarYearWithHttpInfo($employerId, $termCalendarId, $contentType); + return $response; + } + + /** + * Operation indexTermCalendarYearWithHttpInfo + * + * List Term Calendar Years + * + * @param string $employerId The Id of the Employer for which you want to get Term Calendar Year list (required) + * @param string $termCalendarId The Id of the Term Calendar for which you want to list Years (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexTermCalendarYearWithHttpInfo( + string $employerId, + string $termCalendarId, + string $contentType = self::contentTypes['indexTermCalendarYear'][0] + ): array + { + $request = $this->indexTermCalendarYearRequest($employerId, $termCalendarId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexTermCalendarYearAsync + * + * List Term Calendar Years + * + * @param string $employerId The Id of the Employer for which you want to get Term Calendar Year list (required) + * @param string $termCalendarId The Id of the Term Calendar for which you want to list Years (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTermCalendarYearAsync( + string $employerId, + string $termCalendarId, + string $contentType = self::contentTypes['indexTermCalendarYear'][0] + ): PromiseInterface + { + return $this->indexTermCalendarYearAsyncWithHttpInfo($employerId, $termCalendarId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexTermCalendarYearAsyncWithHttpInfo + * + * List Term Calendar Years + * + * @param string $employerId The Id of the Employer for which you want to get Term Calendar Year list (required) + * @param string $termCalendarId The Id of the Term Calendar for which you want to list Years (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexTermCalendarYearAsyncWithHttpInfo( + $employerId, + $termCalendarId, + string $contentType = self::contentTypes['indexTermCalendarYear'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse[]'; + $request = $this->indexTermCalendarYearRequest($employerId, $termCalendarId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexTermCalendarYear' + * + * @param string $employerId The Id of the Employer for which you want to get Term Calendar Year list (required) + * @param string $termCalendarId The Id of the Term Calendar for which you want to list Years (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexTermCalendarYearRequest( + $employerId, + $termCalendarId, + string $contentType = self::contentTypes['indexTermCalendarYear'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexTermCalendarYear' + ); + } + + // verify the required parameter 'termCalendarId' is set + if ($termCalendarId === null || (is_array($termCalendarId) && count($termCalendarId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $termCalendarId when calling indexTermCalendarYear' + ); + } + + + $resourcePath = '/employers/{employerId}/termcalendaryears/{termCalendarId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($termCalendarId !== null) { + $resourcePath = str_replace( + '{' . 'termCalendarId' . '}', + ObjectSerializer::toPathValue($termCalendarId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTermCalendarYear + * + * Update Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to update existing year (required) + * @param string $id The Id of the Term Calendar Year which you want to update data (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + */ + public function updateTermCalendarYear( + string $employerId, + string $termCalendarId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['updateTermCalendarYear'][0] + ): \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse + { + list($response) = $this->updateTermCalendarYearWithHttpInfo($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest, $contentType); + return $response; + } + + /** + * Operation updateTermCalendarYearWithHttpInfo + * + * Update Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to update existing year (required) + * @param string $id The Id of the Term Calendar Year which you want to update data (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendarYear'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractTermCalendarYearResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTermCalendarYearWithHttpInfo( + string $employerId, + string $termCalendarId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['updateTermCalendarYear'][0] + ): array + { + $request = $this->updateTermCalendarYearRequest($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTermCalendarYearAsync + * + * Update Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to update existing year (required) + * @param string $id The Id of the Term Calendar Year which you want to update data (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTermCalendarYearAsync( + string $employerId, + string $termCalendarId, + string $id, + ?\SynergiTech\Staffology\Model\ContractTermCalendarYearRequest $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['updateTermCalendarYear'][0] + ): PromiseInterface + { + return $this->updateTermCalendarYearAsyncWithHttpInfo($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTermCalendarYearAsyncWithHttpInfo + * + * Update Term Calendar Year + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to update existing year (required) + * @param string $id The Id of the Term Calendar Year which you want to update data (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateTermCalendarYearAsyncWithHttpInfo( + $employerId, + $termCalendarId, + $id, + $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['updateTermCalendarYear'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractTermCalendarYearResponse'; + $request = $this->updateTermCalendarYearRequest($employerId, $termCalendarId, $id, $contractTermCalendarYearRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTermCalendarYear' + * + * @param string $employerId The Id of the Employer to which the Term Calendar Year belongs. (required) + * @param string $termCalendarId The Id of the Term Calendar which you want to update existing year (required) + * @param string $id The Id of the Term Calendar Year which you want to update data (required) + * @param \SynergiTech\Staffology\Model\ContractTermCalendarYearRequest|null $contractTermCalendarYearRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTermCalendarYear'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTermCalendarYearRequest( + $employerId, + $termCalendarId, + $id, + $contractTermCalendarYearRequest = null, + string $contentType = self::contentTypes['updateTermCalendarYear'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateTermCalendarYear' + ); + } + + // verify the required parameter 'termCalendarId' is set + if ($termCalendarId === null || (is_array($termCalendarId) && count($termCalendarId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $termCalendarId when calling updateTermCalendarYear' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateTermCalendarYear' + ); + } + + + + $resourcePath = '/employers/{employerId}/termcalendaryears/{termCalendarId}/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($termCalendarId !== null) { + $resourcePath = str_replace( + '{' . 'termCalendarId' . '}', + ObjectSerializer::toPathValue($termCalendarId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractTermCalendarYearRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractTermCalendarYearRequest)); + } else { + $httpBody = $contractTermCalendarYearRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/TierablePayApi.php b/src/Api/TierablePayApi.php new file mode 100644 index 0000000..a2f44a0 --- /dev/null +++ b/src/Api/TierablePayApi.php @@ -0,0 +1,496 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation getTierablePay + * + * Calculate tierable pay + * + * @param string $employerId Employer ID (required) + * @param string $payrunEntryId Payrun entry ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierablePay'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |float + */ + public function getTierablePay( + string $employerId, + string $payrunEntryId, + string $contentType = self::contentTypes['getTierablePay'][0] + ): float + { + list($response) = $this->getTierablePayWithHttpInfo($employerId, $payrunEntryId, $contentType); + return $response; + } + + /** + * Operation getTierablePayWithHttpInfo + * + * Calculate tierable pay + * + * @param string $employerId Employer ID (required) + * @param string $payrunEntryId Payrun entry ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierablePay'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |float, HTTP status code, HTTP response headers (array of strings) + */ + public function getTierablePayWithHttpInfo( + string $employerId, + string $payrunEntryId, + string $contentType = self::contentTypes['getTierablePay'][0] + ): array + { + $request = $this->getTierablePayRequest($employerId, $payrunEntryId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('float' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'float'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'float', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTierablePayAsync + * + * Calculate tierable pay + * + * @param string $employerId Employer ID (required) + * @param string $payrunEntryId Payrun entry ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierablePay'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTierablePayAsync( + string $employerId, + string $payrunEntryId, + string $contentType = self::contentTypes['getTierablePay'][0] + ): PromiseInterface + { + return $this->getTierablePayAsyncWithHttpInfo($employerId, $payrunEntryId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTierablePayAsyncWithHttpInfo + * + * Calculate tierable pay + * + * @param string $employerId Employer ID (required) + * @param string $payrunEntryId Payrun entry ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierablePay'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getTierablePayAsyncWithHttpInfo( + $employerId, + $payrunEntryId, + string $contentType = self::contentTypes['getTierablePay'][0] + ): PromiseInterface + { + $returnType = 'float'; + $request = $this->getTierablePayRequest($employerId, $payrunEntryId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTierablePay' + * + * @param string $employerId Employer ID (required) + * @param string $payrunEntryId Payrun entry ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTierablePay'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTierablePayRequest( + $employerId, + $payrunEntryId, + string $contentType = self::contentTypes['getTierablePay'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getTierablePay' + ); + } + + // verify the required parameter 'payrunEntryId' is set + if ($payrunEntryId === null || (is_array($payrunEntryId) && count($payrunEntryId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payrunEntryId when calling getTierablePay' + ); + } + + + $resourcePath = '/employers/{employerId}/tierablepay/{payrunEntryId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($payrunEntryId !== null) { + $resourcePath = str_replace( + '{' . 'payrunEntryId' . '}', + ObjectSerializer::toPathValue($payrunEntryId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/ToolsApi.php b/src/Api/ToolsApi.php new file mode 100644 index 0000000..975a1cf --- /dev/null +++ b/src/Api/ToolsApi.php @@ -0,0 +1,792 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation calculateNetOfOnCostsTools + * + * Calculate Net of On Costs + * + * @param float $notionalDayRate The total chargeable rate per day. (required) + * @param float $fee The charge for providing this service, per pay period. (required) + * @param bool $feeIsPercentage If true, 'Fee' will be treated as a percentage. (required) + * @param float $employersPensionContribution The employers pension contributions, per pay period. (required) + * @param bool $employersPensionContributionIsPercentage If true, EmployersPensionContribution will be treated as a percentage. (required) + * @param float $employeesPensionContribution The employees pension contributions, per pay period. (required) + * @param bool $employeesPensionContributionIsPercentage If true, EmployeesPensionContribution will be used as a percentage. (required) + * @param bool $useAeBandings If true, legislative Ae Bandings will be applied during calculation. (required) + * @param float $holidayWeeks The holiday weeks to use for the calculation. (required) + * @param int $daysWorkedPerWeek Number of days the employee works per week. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay frequency to be used for the calculation. (required) + * @param \DateTime|null $calculationDate Used to find associated legislative values, default Today. (optional) + * @param float|null $apprenticeshipLevyRateOverride Override the Apprenticeship Levy Rate. 0.50 for 0.5%. (optional) + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule The type of pension scheme being enrolled into, default SalarySacrifice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNetOfOnCostsTools'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse + */ + public function calculateNetOfOnCostsTools( + float $notionalDayRate, + float $fee, + bool $feeIsPercentage, + float $employersPensionContribution, + bool $employersPensionContributionIsPercentage, + float $employeesPensionContribution, + bool $employeesPensionContributionIsPercentage, + bool $useAeBandings, + float $holidayWeeks, + int $daysWorkedPerWeek, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $calculationDate = null, + ?float $apprenticeshipLevyRateOverride = null, + ?\SynergiTech\Staffology\Model\PensionRule $pensionRule = null, + string $contentType = self::contentTypes['calculateNetOfOnCostsTools'][0] + ): \SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse + { + list($response) = $this->calculateNetOfOnCostsToolsWithHttpInfo($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule, $contentType); + return $response; + } + + /** + * Operation calculateNetOfOnCostsToolsWithHttpInfo + * + * Calculate Net of On Costs + * + * @param float $notionalDayRate The total chargeable rate per day. (required) + * @param float $fee The charge for providing this service, per pay period. (required) + * @param bool $feeIsPercentage If true, 'Fee' will be treated as a percentage. (required) + * @param float $employersPensionContribution The employers pension contributions, per pay period. (required) + * @param bool $employersPensionContributionIsPercentage If true, EmployersPensionContribution will be treated as a percentage. (required) + * @param float $employeesPensionContribution The employees pension contributions, per pay period. (required) + * @param bool $employeesPensionContributionIsPercentage If true, EmployeesPensionContribution will be used as a percentage. (required) + * @param bool $useAeBandings If true, legislative Ae Bandings will be applied during calculation. (required) + * @param float $holidayWeeks The holiday weeks to use for the calculation. (required) + * @param int $daysWorkedPerWeek Number of days the employee works per week. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay frequency to be used for the calculation. (required) + * @param \DateTime|null $calculationDate Used to find associated legislative values, default Today. (optional) + * @param float|null $apprenticeshipLevyRateOverride Override the Apprenticeship Levy Rate. 0.50 for 0.5%. (optional) + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule The type of pension scheme being enrolled into, default SalarySacrifice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNetOfOnCostsTools'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function calculateNetOfOnCostsToolsWithHttpInfo( + float $notionalDayRate, + float $fee, + bool $feeIsPercentage, + float $employersPensionContribution, + bool $employersPensionContributionIsPercentage, + float $employeesPensionContribution, + bool $employeesPensionContributionIsPercentage, + bool $useAeBandings, + float $holidayWeeks, + int $daysWorkedPerWeek, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $calculationDate = null, + ?float $apprenticeshipLevyRateOverride = null, + ?\SynergiTech\Staffology\Model\PensionRule $pensionRule = null, + string $contentType = self::contentTypes['calculateNetOfOnCostsTools'][0] + ): array + { + $request = $this->calculateNetOfOnCostsToolsRequest($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation calculateNetOfOnCostsToolsAsync + * + * Calculate Net of On Costs + * + * @param float $notionalDayRate The total chargeable rate per day. (required) + * @param float $fee The charge for providing this service, per pay period. (required) + * @param bool $feeIsPercentage If true, 'Fee' will be treated as a percentage. (required) + * @param float $employersPensionContribution The employers pension contributions, per pay period. (required) + * @param bool $employersPensionContributionIsPercentage If true, EmployersPensionContribution will be treated as a percentage. (required) + * @param float $employeesPensionContribution The employees pension contributions, per pay period. (required) + * @param bool $employeesPensionContributionIsPercentage If true, EmployeesPensionContribution will be used as a percentage. (required) + * @param bool $useAeBandings If true, legislative Ae Bandings will be applied during calculation. (required) + * @param float $holidayWeeks The holiday weeks to use for the calculation. (required) + * @param int $daysWorkedPerWeek Number of days the employee works per week. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay frequency to be used for the calculation. (required) + * @param \DateTime|null $calculationDate Used to find associated legislative values, default Today. (optional) + * @param float|null $apprenticeshipLevyRateOverride Override the Apprenticeship Levy Rate. 0.50 for 0.5%. (optional) + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule The type of pension scheme being enrolled into, default SalarySacrifice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNetOfOnCostsTools'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateNetOfOnCostsToolsAsync( + float $notionalDayRate, + float $fee, + bool $feeIsPercentage, + float $employersPensionContribution, + bool $employersPensionContributionIsPercentage, + float $employeesPensionContribution, + bool $employeesPensionContributionIsPercentage, + bool $useAeBandings, + float $holidayWeeks, + int $daysWorkedPerWeek, + \SynergiTech\Staffology\Model\PayPeriods $payPeriod, + ?\DateTime $calculationDate = null, + ?float $apprenticeshipLevyRateOverride = null, + ?\SynergiTech\Staffology\Model\PensionRule $pensionRule = null, + string $contentType = self::contentTypes['calculateNetOfOnCostsTools'][0] + ): PromiseInterface + { + return $this->calculateNetOfOnCostsToolsAsyncWithHttpInfo($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation calculateNetOfOnCostsToolsAsyncWithHttpInfo + * + * Calculate Net of On Costs + * + * @param float $notionalDayRate The total chargeable rate per day. (required) + * @param float $fee The charge for providing this service, per pay period. (required) + * @param bool $feeIsPercentage If true, 'Fee' will be treated as a percentage. (required) + * @param float $employersPensionContribution The employers pension contributions, per pay period. (required) + * @param bool $employersPensionContributionIsPercentage If true, EmployersPensionContribution will be treated as a percentage. (required) + * @param float $employeesPensionContribution The employees pension contributions, per pay period. (required) + * @param bool $employeesPensionContributionIsPercentage If true, EmployeesPensionContribution will be used as a percentage. (required) + * @param bool $useAeBandings If true, legislative Ae Bandings will be applied during calculation. (required) + * @param float $holidayWeeks The holiday weeks to use for the calculation. (required) + * @param int $daysWorkedPerWeek Number of days the employee works per week. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay frequency to be used for the calculation. (required) + * @param \DateTime|null $calculationDate Used to find associated legislative values, default Today. (optional) + * @param float|null $apprenticeshipLevyRateOverride Override the Apprenticeship Levy Rate. 0.50 for 0.5%. (optional) + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule The type of pension scheme being enrolled into, default SalarySacrifice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNetOfOnCostsTools'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function calculateNetOfOnCostsToolsAsyncWithHttpInfo( + $notionalDayRate, + $fee, + $feeIsPercentage, + $employersPensionContribution, + $employersPensionContributionIsPercentage, + $employeesPensionContribution, + $employeesPensionContributionIsPercentage, + $useAeBandings, + $holidayWeeks, + $daysWorkedPerWeek, + $payPeriod, + $calculationDate = null, + $apprenticeshipLevyRateOverride = null, + $pensionRule = null, + string $contentType = self::contentTypes['calculateNetOfOnCostsTools'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractNetOfOnCostsResponse'; + $request = $this->calculateNetOfOnCostsToolsRequest($notionalDayRate, $fee, $feeIsPercentage, $employersPensionContribution, $employersPensionContributionIsPercentage, $employeesPensionContribution, $employeesPensionContributionIsPercentage, $useAeBandings, $holidayWeeks, $daysWorkedPerWeek, $payPeriod, $calculationDate, $apprenticeshipLevyRateOverride, $pensionRule, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'calculateNetOfOnCostsTools' + * + * @param float $notionalDayRate The total chargeable rate per day. (required) + * @param float $fee The charge for providing this service, per pay period. (required) + * @param bool $feeIsPercentage If true, 'Fee' will be treated as a percentage. (required) + * @param float $employersPensionContribution The employers pension contributions, per pay period. (required) + * @param bool $employersPensionContributionIsPercentage If true, EmployersPensionContribution will be treated as a percentage. (required) + * @param float $employeesPensionContribution The employees pension contributions, per pay period. (required) + * @param bool $employeesPensionContributionIsPercentage If true, EmployeesPensionContribution will be used as a percentage. (required) + * @param bool $useAeBandings If true, legislative Ae Bandings will be applied during calculation. (required) + * @param float $holidayWeeks The holiday weeks to use for the calculation. (required) + * @param int $daysWorkedPerWeek Number of days the employee works per week. (required) + * @param \SynergiTech\Staffology\Model\PayPeriods $payPeriod The pay frequency to be used for the calculation. (required) + * @param \DateTime|null $calculationDate Used to find associated legislative values, default Today. (optional) + * @param float|null $apprenticeshipLevyRateOverride Override the Apprenticeship Levy Rate. 0.50 for 0.5%. (optional) + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule The type of pension scheme being enrolled into, default SalarySacrifice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateNetOfOnCostsTools'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function calculateNetOfOnCostsToolsRequest( + $notionalDayRate, + $fee, + $feeIsPercentage, + $employersPensionContribution, + $employersPensionContributionIsPercentage, + $employeesPensionContribution, + $employeesPensionContributionIsPercentage, + $useAeBandings, + $holidayWeeks, + $daysWorkedPerWeek, + $payPeriod, + $calculationDate = null, + $apprenticeshipLevyRateOverride = null, + $pensionRule = null, + string $contentType = self::contentTypes['calculateNetOfOnCostsTools'][0] + ): Request + { + + // verify the required parameter 'notionalDayRate' is set + if ($notionalDayRate === null || (is_array($notionalDayRate) && count($notionalDayRate) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $notionalDayRate when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'fee' is set + if ($fee === null || (is_array($fee) && count($fee) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fee when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'feeIsPercentage' is set + if ($feeIsPercentage === null || (is_array($feeIsPercentage) && count($feeIsPercentage) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $feeIsPercentage when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'employersPensionContribution' is set + if ($employersPensionContribution === null || (is_array($employersPensionContribution) && count($employersPensionContribution) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employersPensionContribution when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'employersPensionContributionIsPercentage' is set + if ($employersPensionContributionIsPercentage === null || (is_array($employersPensionContributionIsPercentage) && count($employersPensionContributionIsPercentage) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employersPensionContributionIsPercentage when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'employeesPensionContribution' is set + if ($employeesPensionContribution === null || (is_array($employeesPensionContribution) && count($employeesPensionContribution) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeesPensionContribution when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'employeesPensionContributionIsPercentage' is set + if ($employeesPensionContributionIsPercentage === null || (is_array($employeesPensionContributionIsPercentage) && count($employeesPensionContributionIsPercentage) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employeesPensionContributionIsPercentage when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'useAeBandings' is set + if ($useAeBandings === null || (is_array($useAeBandings) && count($useAeBandings) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $useAeBandings when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'holidayWeeks' is set + if ($holidayWeeks === null || (is_array($holidayWeeks) && count($holidayWeeks) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $holidayWeeks when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'daysWorkedPerWeek' is set + if ($daysWorkedPerWeek === null || (is_array($daysWorkedPerWeek) && count($daysWorkedPerWeek) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $daysWorkedPerWeek when calling calculateNetOfOnCostsTools' + ); + } + + // verify the required parameter 'payPeriod' is set + if ($payPeriod === null || (is_array($payPeriod) && count($payPeriod) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payPeriod when calling calculateNetOfOnCostsTools' + ); + } + + + + + + $resourcePath = '/tools/calculate-net-of-on-costs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $notionalDayRate, + 'NotionalDayRate', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $calculationDate, + 'CalculationDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fee, + 'Fee', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $feeIsPercentage, + 'FeeIsPercentage', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $apprenticeshipLevyRateOverride, + 'ApprenticeshipLevyRateOverride', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employersPensionContribution, + 'EmployersPensionContribution', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employersPensionContributionIsPercentage, + 'EmployersPensionContributionIsPercentage', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeesPensionContribution, + 'EmployeesPensionContribution', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employeesPensionContributionIsPercentage, + 'EmployeesPensionContributionIsPercentage', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $useAeBandings, + 'UseAeBandings', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $holidayWeeks, + 'HolidayWeeks', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $daysWorkedPerWeek, + 'DaysWorkedPerWeek', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payPeriod, + 'PayPeriod', // param base name + 'PayPeriods', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pensionRule, + 'PensionRule', // param base name + 'PensionRule', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/WebhookApi.php b/src/Api/WebhookApi.php new file mode 100644 index 0000000..75fe884 --- /dev/null +++ b/src/Api/WebhookApi.php @@ -0,0 +1,2856 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteWebhook' => [ + 'application/json', + ], + 'getWebhook' => [ + 'application/json', + ], + 'indexWebhook' => [ + 'application/json', + ], + 'payloadWebhook' => [ + 'application/json', + ], + 'payloadsWebhook' => [ + 'application/json', + ], + 'sampleWebhook' => [ + 'application/json', + ], + 'updateWebhook' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createWebhook + * + * Create Webhook + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function createWebhook( + string $employerId, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['createWebhook'][0] + ): void + { + $this->createWebhookWithHttpInfo($employerId, $webhook, $contentType); + } + + /** + * Operation createWebhookWithHttpInfo + * + * Create Webhook + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createWebhookWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['createWebhook'][0] + ): array + { + $request = $this->createWebhookRequest($employerId, $webhook, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation createWebhookAsync + * + * Create Webhook + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWebhookAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['createWebhook'][0] + ): PromiseInterface + { + return $this->createWebhookAsyncWithHttpInfo($employerId, $webhook, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createWebhookAsyncWithHttpInfo + * + * Create Webhook + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWebhookAsyncWithHttpInfo( + $employerId, + $webhook = null, + string $contentType = self::contentTypes['createWebhook'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->createWebhookRequest($employerId, $webhook, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createWebhook' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createWebhookRequest( + $employerId, + $webhook = null, + string $contentType = self::contentTypes['createWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createWebhook' + ); + } + + + + $resourcePath = '/employers/{employerId}/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($webhook)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($webhook)); + } else { + $httpBody = $webhook; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteWebhook + * + * Delete Webhook + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteWebhook( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWebhook'][0] + ): void + { + $this->deleteWebhookWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteWebhookWithHttpInfo + * + * Delete Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteWebhookWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWebhook'][0] + ): array + { + $request = $this->deleteWebhookRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteWebhookAsync + * + * Delete Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWebhookAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWebhook'][0] + ): PromiseInterface + { + return $this->deleteWebhookAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteWebhookAsyncWithHttpInfo + * + * Delete Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWebhookAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteWebhook'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteWebhookRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteWebhook' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteWebhookRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteWebhook' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteWebhook' + ); + } + + + $resourcePath = '/employers/{employerId}/webhooks/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhook + * + * Get Webhook + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Webhook + */ + public function getWebhook( + string $employerId, + string $id, + string $contentType = self::contentTypes['getWebhook'][0] + ): \SynergiTech\Staffology\Model\Webhook + { + list($response) = $this->getWebhookWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getWebhookWithHttpInfo + * + * Get Webhook + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Webhook, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhookWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getWebhook'][0] + ): array + { + $request = $this->getWebhookRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Webhook', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Webhook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Webhook', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Webhook'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Webhook', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhookAsync + * + * Get Webhook + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getWebhookAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getWebhook'][0] + ): PromiseInterface + { + return $this->getWebhookAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhookAsyncWithHttpInfo + * + * Get Webhook + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getWebhookAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getWebhook'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Webhook'; + $request = $this->getWebhookRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhook' + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getWebhookRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getWebhook' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getWebhook' + ); + } + + + $resourcePath = '/employers/{employerId}/webhooks/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexWebhook + * + * List Webhooks + * + * @param string $employerId The Id of the Employer for which you want to list Webhooks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexWebhook( + string $employerId, + string $contentType = self::contentTypes['indexWebhook'][0] + ): array + { + list($response) = $this->indexWebhookWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexWebhookWithHttpInfo + * + * List Webhooks + * + * @param string $employerId The Id of the Employer for which you want to list Webhooks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexWebhookWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexWebhook'][0] + ): array + { + $request = $this->indexWebhookRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexWebhookAsync + * + * List Webhooks + * + * @param string $employerId The Id of the Employer for which you want to list Webhooks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexWebhookAsync( + string $employerId, + string $contentType = self::contentTypes['indexWebhook'][0] + ): PromiseInterface + { + return $this->indexWebhookAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexWebhookAsyncWithHttpInfo + * + * List Webhooks + * + * @param string $employerId The Id of the Employer for which you want to list Webhooks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexWebhookAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexWebhook'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexWebhookRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexWebhook' + * + * @param string $employerId The Id of the Employer for which you want to list Webhooks (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexWebhookRequest( + $employerId, + string $contentType = self::contentTypes['indexWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexWebhook' + ); + } + + + $resourcePath = '/employers/{employerId}/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payloadWebhook + * + * Get WebhookPayload + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $payloadId payloadId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\WebhookPayload + */ + public function payloadWebhook( + string $employerId, + string $id, + string $payloadId, + string $contentType = self::contentTypes['payloadWebhook'][0] + ): \SynergiTech\Staffology\Model\WebhookPayload + { + list($response) = $this->payloadWebhookWithHttpInfo($employerId, $id, $payloadId, $contentType); + return $response; + } + + /** + * Operation payloadWebhookWithHttpInfo + * + * Get WebhookPayload + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $payloadId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\WebhookPayload, HTTP status code, HTTP response headers (array of strings) + */ + public function payloadWebhookWithHttpInfo( + string $employerId, + string $id, + string $payloadId, + string $contentType = self::contentTypes['payloadWebhook'][0] + ): array + { + $request = $this->payloadWebhookRequest($employerId, $id, $payloadId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\WebhookPayload', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\WebhookPayload' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\WebhookPayload', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\WebhookPayload'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\WebhookPayload', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payloadWebhookAsync + * + * Get WebhookPayload + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $payloadId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payloadWebhookAsync( + string $employerId, + string $id, + string $payloadId, + string $contentType = self::contentTypes['payloadWebhook'][0] + ): PromiseInterface + { + return $this->payloadWebhookAsyncWithHttpInfo($employerId, $id, $payloadId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payloadWebhookAsyncWithHttpInfo + * + * Get WebhookPayload + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $payloadId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payloadWebhookAsyncWithHttpInfo( + $employerId, + $id, + $payloadId, + string $contentType = self::contentTypes['payloadWebhook'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\WebhookPayload'; + $request = $this->payloadWebhookRequest($employerId, $id, $payloadId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payloadWebhook' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $payloadId (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payloadWebhookRequest( + $employerId, + $id, + $payloadId, + string $contentType = self::contentTypes['payloadWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payloadWebhook' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payloadWebhook' + ); + } + + // verify the required parameter 'payloadId' is set + if ($payloadId === null || (is_array($payloadId) && count($payloadId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $payloadId when calling payloadWebhook' + ); + } + + + $resourcePath = '/employers/{employerId}/webhooks/{id}/payloads/{payloadId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($payloadId !== null) { + $resourcePath = str_replace( + '{' . 'payloadId' . '}', + ObjectSerializer::toPathValue($payloadId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation payloadsWebhook + * + * List WebhookPayloads + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param int|null $pageNum pageNum (optional) + * @param int|null $pageSize pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadsWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function payloadsWebhook( + string $employerId, + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['payloadsWebhook'][0] + ): array + { + list($response) = $this->payloadsWebhookWithHttpInfo($employerId, $id, $pageNum, $pageSize, $contentType); + return $response; + } + + /** + * Operation payloadsWebhookWithHttpInfo + * + * List WebhookPayloads + * + * @param string $employerId (required) + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadsWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function payloadsWebhookWithHttpInfo( + string $employerId, + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['payloadsWebhook'][0] + ): array + { + $request = $this->payloadsWebhookRequest($employerId, $id, $pageNum, $pageSize, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation payloadsWebhookAsync + * + * List WebhookPayloads + * + * @param string $employerId (required) + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadsWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payloadsWebhookAsync( + string $employerId, + string $id, + ?int $pageNum = null, + ?int $pageSize = null, + string $contentType = self::contentTypes['payloadsWebhook'][0] + ): PromiseInterface + { + return $this->payloadsWebhookAsyncWithHttpInfo($employerId, $id, $pageNum, $pageSize, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation payloadsWebhookAsyncWithHttpInfo + * + * List WebhookPayloads + * + * @param string $employerId (required) + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadsWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function payloadsWebhookAsyncWithHttpInfo( + $employerId, + $id, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['payloadsWebhook'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->payloadsWebhookRequest($employerId, $id, $pageNum, $pageSize, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'payloadsWebhook' + * + * @param string $employerId (required) + * @param string $id (required) + * @param int|null $pageNum (optional) + * @param int|null $pageSize (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['payloadsWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function payloadsWebhookRequest( + $employerId, + $id, + $pageNum = null, + $pageSize = null, + string $contentType = self::contentTypes['payloadsWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling payloadsWebhook' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling payloadsWebhook' + ); + } + + + + + $resourcePath = '/employers/{employerId}/webhooks/{id}/payloads'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageNum, + 'pageNum', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pageSize, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sampleWebhook + * + * Sample Value + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent The WebhookEvent that you want a sample value for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sampleWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return mixed + */ + public function sampleWebhook( + string $employerId, + \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent, + string $contentType = self::contentTypes['sampleWebhook'][0] + ): mixed + { + list($response) = $this->sampleWebhookWithHttpInfo($employerId, $webhookEvent, $contentType); + return $response; + } + + /** + * Operation sampleWebhookWithHttpInfo + * + * Sample Value + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent The WebhookEvent that you want a sample value for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sampleWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of mixed, HTTP status code, HTTP response headers (array of strings) + */ + public function sampleWebhookWithHttpInfo( + string $employerId, + \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent, + string $contentType = self::contentTypes['sampleWebhook'][0] + ): array + { + $request = $this->sampleWebhookRequest($employerId, $webhookEvent, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('mixed', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'mixed', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = 'mixed'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'mixed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sampleWebhookAsync + * + * Sample Value + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent The WebhookEvent that you want a sample value for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sampleWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function sampleWebhookAsync( + string $employerId, + \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent, + string $contentType = self::contentTypes['sampleWebhook'][0] + ): PromiseInterface + { + return $this->sampleWebhookAsyncWithHttpInfo($employerId, $webhookEvent, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sampleWebhookAsyncWithHttpInfo + * + * Sample Value + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent The WebhookEvent that you want a sample value for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sampleWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function sampleWebhookAsyncWithHttpInfo( + $employerId, + $webhookEvent, + string $contentType = self::contentTypes['sampleWebhook'][0] + ): PromiseInterface + { + $returnType = 'mixed'; + $request = $this->sampleWebhookRequest($employerId, $webhookEvent, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sampleWebhook' + * + * @param string $employerId The Id of the Employer to which the Webhook belongs. (required) + * @param \SynergiTech\Staffology\Model\WebhookEvent $webhookEvent The WebhookEvent that you want a sample value for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sampleWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sampleWebhookRequest( + $employerId, + $webhookEvent, + string $contentType = self::contentTypes['sampleWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling sampleWebhook' + ); + } + + // verify the required parameter 'webhookEvent' is set + if ($webhookEvent === null || (is_array($webhookEvent) && count($webhookEvent) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $webhookEvent when calling sampleWebhook' + ); + } + + + $resourcePath = '/employers/{employerId}/webhooks/samples/{webhookEvent}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($webhookEvent !== null) { + $resourcePath = str_replace( + '{' . 'webhookEvent' . '}', + ObjectSerializer::toPathValue($webhookEvent), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateWebhook + * + * Update Webhook + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Webhook + */ + public function updateWebhook( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['updateWebhook'][0] + ): \SynergiTech\Staffology\Model\Webhook + { + list($response) = $this->updateWebhookWithHttpInfo($employerId, $id, $webhook, $contentType); + return $response; + } + + /** + * Operation updateWebhookWithHttpInfo + * + * Update Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Webhook, HTTP status code, HTTP response headers (array of strings) + */ + public function updateWebhookWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['updateWebhook'][0] + ): array + { + $request = $this->updateWebhookRequest($employerId, $id, $webhook, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Webhook', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Webhook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Webhook', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Webhook'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Webhook', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWebhookAsync + * + * Update Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateWebhookAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\Webhook $webhook = null, + string $contentType = self::contentTypes['updateWebhook'][0] + ): PromiseInterface + { + return $this->updateWebhookAsyncWithHttpInfo($employerId, $id, $webhook, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWebhookAsyncWithHttpInfo + * + * Update Webhook + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateWebhookAsyncWithHttpInfo( + $employerId, + $id, + $webhook = null, + string $contentType = self::contentTypes['updateWebhook'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Webhook'; + $request = $this->updateWebhookRequest($employerId, $id, $webhook, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateWebhook' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\Webhook|null $webhook (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWebhook'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateWebhookRequest( + $employerId, + $id, + $webhook = null, + string $contentType = self::contentTypes['updateWebhook'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateWebhook' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateWebhook' + ); + } + + + + $resourcePath = '/employers/{employerId}/webhooks/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($webhook)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($webhook)); + } else { + $httpBody = $webhook; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Api/WorkingPatternApi.php b/src/Api/WorkingPatternApi.php new file mode 100644 index 0000000..045e16e --- /dev/null +++ b/src/Api/WorkingPatternApi.php @@ -0,0 +1,1817 @@ + [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + 'deleteWorkingPattern' => [ + 'application/json', + ], + 'getAsyncWorkingPattern' => [ + 'application/json', + ], + 'indexAsyncWorkingPattern' => [ + 'application/json', + ], + 'updateWorkingPattern' => [ + 'application/json-patch+json', + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface|null $client + * @param Configuration|null $config + * @param HeaderSelector|null $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex(): int + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig(): Configuration + { + return $this->config; + } + + /** + * Operation createWorkingPattern + * + * Create WorkingPattern + * + * @param string $employerId employerId (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return |\SynergiTech\Staffology\Model\WorkingPattern + */ + public function createWorkingPattern( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['createWorkingPattern'][0] + ): \SynergiTech\Staffology\Model\WorkingPattern + { + list($response) = $this->createWorkingPatternWithHttpInfo($employerId, $contractWorkingPatternRequest, $contentType); + return $response; + } + + /** + * Operation createWorkingPatternWithHttpInfo + * + * Create WorkingPattern + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of |\SynergiTech\Staffology\Model\WorkingPattern, HTTP status code, HTTP response headers (array of strings) + */ + public function createWorkingPatternWithHttpInfo( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['createWorkingPattern'][0] + ): array + { + $request = $this->createWorkingPatternRequest($employerId, $contractWorkingPatternRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + if (in_array('\SynergiTech\Staffology\Model\WorkingPattern', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\WorkingPattern' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\WorkingPattern', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\WorkingPattern'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\WorkingPattern', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createWorkingPatternAsync + * + * Create WorkingPattern + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWorkingPatternAsync( + string $employerId, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['createWorkingPattern'][0] + ): PromiseInterface + { + return $this->createWorkingPatternAsyncWithHttpInfo($employerId, $contractWorkingPatternRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createWorkingPatternAsyncWithHttpInfo + * + * Create WorkingPattern + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function createWorkingPatternAsyncWithHttpInfo( + $employerId, + $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['createWorkingPattern'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\WorkingPattern'; + $request = $this->createWorkingPatternRequest($employerId, $contractWorkingPatternRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createWorkingPattern' + * + * @param string $employerId (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createWorkingPatternRequest( + $employerId, + $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['createWorkingPattern'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling createWorkingPattern' + ); + } + + + + $resourcePath = '/employers/{employerId}/workingpatterns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractWorkingPatternRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractWorkingPatternRequest)); + } else { + $httpBody = $contractWorkingPatternRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteWorkingPattern + * + * Delete WorkingPattern + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function deleteWorkingPattern( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWorkingPattern'][0] + ): void + { + $this->deleteWorkingPatternWithHttpInfo($employerId, $id, $contentType); + } + + /** + * Operation deleteWorkingPatternWithHttpInfo + * + * Delete WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteWorkingPatternWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWorkingPattern'][0] + ): array + { + $request = $this->deleteWorkingPatternRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteWorkingPatternAsync + * + * Delete WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWorkingPatternAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['deleteWorkingPattern'][0] + ): PromiseInterface + { + return $this->deleteWorkingPatternAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteWorkingPatternAsyncWithHttpInfo + * + * Delete WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function deleteWorkingPatternAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['deleteWorkingPattern'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->deleteWorkingPatternRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteWorkingPattern' + * + * @param string $employerId (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteWorkingPatternRequest( + $employerId, + $id, + string $contentType = self::contentTypes['deleteWorkingPattern'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling deleteWorkingPattern' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling deleteWorkingPattern' + ); + } + + + $resourcePath = '/employers/{employerId}/workingpatterns/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAsyncWorkingPattern + * + * Get WorkingPattern + * + * @param string $employerId The Id of the Employer to which the WorkingPattern belongs. (required) + * @param string $id The id of the WorkingPattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractWorkingPatternResponse + */ + public function getAsyncWorkingPattern( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAsyncWorkingPattern'][0] + ): \SynergiTech\Staffology\Model\ContractWorkingPatternResponse + { + list($response) = $this->getAsyncWorkingPatternWithHttpInfo($employerId, $id, $contentType); + return $response; + } + + /** + * Operation getAsyncWorkingPatternWithHttpInfo + * + * Get WorkingPattern + * + * @param string $employerId The Id of the Employer to which the WorkingPattern belongs. (required) + * @param string $id The id of the WorkingPattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractWorkingPatternResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAsyncWorkingPatternWithHttpInfo( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAsyncWorkingPattern'][0] + ): array + { + $request = $this->getAsyncWorkingPatternRequest($employerId, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractWorkingPatternResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAsyncWorkingPatternAsync + * + * Get WorkingPattern + * + * @param string $employerId The Id of the Employer to which the WorkingPattern belongs. (required) + * @param string $id The id of the WorkingPattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAsyncWorkingPatternAsync( + string $employerId, + string $id, + string $contentType = self::contentTypes['getAsyncWorkingPattern'][0] + ): PromiseInterface + { + return $this->getAsyncWorkingPatternAsyncWithHttpInfo($employerId, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAsyncWorkingPatternAsyncWithHttpInfo + * + * Get WorkingPattern + * + * @param string $employerId The Id of the Employer to which the WorkingPattern belongs. (required) + * @param string $id The id of the WorkingPattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function getAsyncWorkingPatternAsyncWithHttpInfo( + $employerId, + $id, + string $contentType = self::contentTypes['getAsyncWorkingPattern'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse'; + $request = $this->getAsyncWorkingPatternRequest($employerId, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAsyncWorkingPattern' + * + * @param string $employerId The Id of the Employer to which the WorkingPattern belongs. (required) + * @param string $id The id of the WorkingPattern you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAsyncWorkingPatternRequest( + $employerId, + $id, + string $contentType = self::contentTypes['getAsyncWorkingPattern'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling getAsyncWorkingPattern' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling getAsyncWorkingPattern' + ); + } + + + $resourcePath = '/employers/{employerId}/workingpatterns/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation indexAsyncWorkingPattern + * + * List WorkingPatterns + * + * @param string $employerId The Id of the Employer for which you want to list WorkingPattern (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\Item[] + */ + public function indexAsyncWorkingPattern( + string $employerId, + string $contentType = self::contentTypes['indexAsyncWorkingPattern'][0] + ): array + { + list($response) = $this->indexAsyncWorkingPatternWithHttpInfo($employerId, $contentType); + return $response; + } + + /** + * Operation indexAsyncWorkingPatternWithHttpInfo + * + * List WorkingPatterns + * + * @param string $employerId The Id of the Employer for which you want to list WorkingPattern (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\Item[], HTTP status code, HTTP response headers (array of strings) + */ + public function indexAsyncWorkingPatternWithHttpInfo( + string $employerId, + string $contentType = self::contentTypes['indexAsyncWorkingPattern'][0] + ): array + { + $request = $this->indexAsyncWorkingPatternRequest($employerId, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\Item[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\Item[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\Item[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\Item[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation indexAsyncWorkingPatternAsync + * + * List WorkingPatterns + * + * @param string $employerId The Id of the Employer for which you want to list WorkingPattern (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAsyncWorkingPatternAsync( + string $employerId, + string $contentType = self::contentTypes['indexAsyncWorkingPattern'][0] + ): PromiseInterface + { + return $this->indexAsyncWorkingPatternAsyncWithHttpInfo($employerId, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation indexAsyncWorkingPatternAsyncWithHttpInfo + * + * List WorkingPatterns + * + * @param string $employerId The Id of the Employer for which you want to list WorkingPattern (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function indexAsyncWorkingPatternAsyncWithHttpInfo( + $employerId, + string $contentType = self::contentTypes['indexAsyncWorkingPattern'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\Item[]'; + $request = $this->indexAsyncWorkingPatternRequest($employerId, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'indexAsyncWorkingPattern' + * + * @param string $employerId The Id of the Employer for which you want to list WorkingPattern (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['indexAsyncWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function indexAsyncWorkingPatternRequest( + $employerId, + string $contentType = self::contentTypes['indexAsyncWorkingPattern'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling indexAsyncWorkingPattern' + ); + } + + + $resourcePath = '/employers/{employerId}/workingpatterns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateWorkingPattern + * + * Update WorkingPattern + * + * @param string $employerId employerId (required) + * @param string $id id (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return \SynergiTech\Staffology\Model\ContractWorkingPatternResponse + */ + public function updateWorkingPattern( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateWorkingPattern'][0] + ): \SynergiTech\Staffology\Model\ContractWorkingPatternResponse + { + list($response) = $this->updateWorkingPatternWithHttpInfo($employerId, $id, $contractWorkingPatternRequest, $contentType); + return $response; + } + + /** + * Operation updateWorkingPatternWithHttpInfo + * + * Update WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWorkingPattern'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of \SynergiTech\Staffology\Model\ContractWorkingPatternResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateWorkingPatternWithHttpInfo( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateWorkingPattern'][0] + ): array + { + $request = $this->updateWorkingPatternRequest($employerId, $id, $contractWorkingPatternRequest, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if (in_array('\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SynergiTech\Staffology\Model\ContractWorkingPatternResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse'; + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWorkingPatternAsync + * + * Update WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateWorkingPatternAsync( + string $employerId, + string $id, + ?\SynergiTech\Staffology\Model\ContractWorkingPatternRequest $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateWorkingPattern'][0] + ): PromiseInterface + { + return $this->updateWorkingPatternAsyncWithHttpInfo($employerId, $id, $contractWorkingPatternRequest, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWorkingPatternAsyncWithHttpInfo + * + * Update WorkingPattern + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function updateWorkingPatternAsyncWithHttpInfo( + $employerId, + $id, + $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateWorkingPattern'][0] + ): PromiseInterface + { + $returnType = '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse'; + $request = $this->updateWorkingPatternRequest($employerId, $id, $contractWorkingPatternRequest, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateWorkingPattern' + * + * @param string $employerId (required) + * @param string $id (required) + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternRequest|null $contractWorkingPatternRequest (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWorkingPattern'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateWorkingPatternRequest( + $employerId, + $id, + $contractWorkingPatternRequest = null, + string $contentType = self::contentTypes['updateWorkingPattern'][0] + ): Request + { + + // verify the required parameter 'employerId' is set + if ($employerId === null || (is_array($employerId) && count($employerId) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $employerId when calling updateWorkingPattern' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $id when calling updateWorkingPattern' + ); + } + + + + $resourcePath = '/employers/{employerId}/workingpatterns/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($employerId !== null) { + $resourcePath = str_replace( + '{' . 'employerId' . '}', + ObjectSerializer::toPathValue($employerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($contractWorkingPatternRequest)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($contractWorkingPatternRequest)); + } else { + $httpBody = $contractWorkingPatternRequest; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption(): array + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/ApiException.php b/src/ApiException.php new file mode 100644 index 0000000..2d84ae8 --- /dev/null +++ b/src/ApiException.php @@ -0,0 +1,119 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[][]|null HTTP response header + */ + public function getResponseHeaders(): ?array + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody(): stdClass|string|null + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject(mixed $obj): void + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject(): mixed + { + return $this->responseObject; + } +} diff --git a/src/Configuration.php b/src/Configuration.php new file mode 100644 index 0000000..bc2ed79 --- /dev/null +++ b/src/Configuration.php @@ -0,0 +1,528 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey(string $apiKeyIdentifier, string $key): static + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey(string $apiKeyIdentifier): ?string + { + return $this->apiKeys[$apiKeyIdentifier] ?? null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): static + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix(string $apiKeyIdentifier): ?string + { + return $this->apiKeyPrefixes[$apiKeyIdentifier] ?? null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken(string $accessToken): static + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken(): string + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat): static + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername(string $username): static + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername(): string + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword(string $password): static + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword(): string + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost(string $host): static + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost(): string + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws InvalidArgumentException + * @return $this + */ + public function setUserAgent(string $userAgent): static + { + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent(): string + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug(bool $debug): static + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug(): bool + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile(string $debugFile): static + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile(): string + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath(string $tempFolderPath): static + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath(): string + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration(): Configuration + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config): void + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport(): string + { + $report = 'PHP SDK (SynergiTech\Staffology) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: v1' . PHP_EOL; + $report .= ' SDK Package Version: 1.0.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings(): array + { + return [ + [ + "url" => "", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + } + + $host = $hostSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings(int $index, ?array $variables = null): string + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php new file mode 100644 index 0000000..feab95f --- /dev/null +++ b/src/HeaderSelector.php @@ -0,0 +1,244 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/src/Model/Address.php b/src/Model/Address.php new file mode 100644 index 0000000..80033e9 --- /dev/null +++ b/src/Model/Address.php @@ -0,0 +1,751 @@ + + */ +class Address implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'line4' => 'string', + 'line5' => 'string', + 'postCode' => 'string', + 'country' => '\SynergiTech\Staffology\Model\Country', + 'foreignCountry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'line4' => null, + 'line5' => null, + 'postCode' => null, + 'country' => null, + 'foreignCountry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'line1' => true, + 'line2' => true, + 'line3' => true, + 'line4' => true, + 'line5' => true, + 'postCode' => true, + 'country' => false, + 'foreignCountry' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'line4' => 'line4', + 'line5' => 'line5', + 'postCode' => 'postCode', + 'country' => 'country', + 'foreignCountry' => 'foreignCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'line4' => 'setLine4', + 'line5' => 'setLine5', + 'postCode' => 'setPostCode', + 'country' => 'setCountry', + 'foreignCountry' => 'setForeignCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'line4' => 'getLine4', + 'line5' => 'getLine5', + 'postCode' => 'getPostCode', + 'country' => 'getCountry', + 'foreignCountry' => 'getForeignCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('line4', $data ?? [], null); + $this->setIfExists('line5', $data ?? [], null); + $this->setIfExists('postCode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('foreignCountry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) > 100)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) > 100)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line3']) && (mb_strlen($this->container['line3']) > 100)) { + $invalidProperties[] = "invalid value for 'line3', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line4']) && (mb_strlen($this->container['line4']) > 100)) { + $invalidProperties[] = "invalid value for 'line4', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line5']) && (mb_strlen($this->container['line5']) > 100)) { + $invalidProperties[] = "invalid value for 'line5', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['postCode']) && (mb_strlen($this->container['postCode']) > 10)) { + $invalidProperties[] = "invalid value for 'postCode', the character length must be smaller than or equal to 10."; + } + + if (!is_null($this->container['foreignCountry']) && (mb_strlen($this->container['foreignCountry']) > 35)) { + $invalidProperties[] = "invalid value for 'foreignCountry', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1(): ?string + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 line1 + * + * @return $this + */ + public function setLine1(?string $line1): static + { + if (is_null($line1)) { + array_push($this->openAPINullablesSetToNull, 'line1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line1) && (mb_strlen($line1) > 100)) { + throw new InvalidArgumentException('invalid length for $line1 when calling Address., must be smaller than or equal to 100.'); + } + + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2(): ?string + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 line2 + * + * @return $this + */ + public function setLine2(?string $line2): static + { + if (is_null($line2)) { + array_push($this->openAPINullablesSetToNull, 'line2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line2) && (mb_strlen($line2) > 100)) { + throw new InvalidArgumentException('invalid length for $line2 when calling Address., must be smaller than or equal to 100.'); + } + + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3(): ?string + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 line3 + * + * @return $this + */ + public function setLine3(?string $line3): static + { + if (is_null($line3)) { + array_push($this->openAPINullablesSetToNull, 'line3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line3) && (mb_strlen($line3) > 100)) { + throw new InvalidArgumentException('invalid length for $line3 when calling Address., must be smaller than or equal to 100.'); + } + + $this->container['line3'] = $line3; + + return $this; + } + + /** + * Gets line4 + * + * @return string|null + */ + public function getLine4(): ?string + { + return $this->container['line4']; + } + + /** + * Sets line4 + * + * @param string|null $line4 line4 + * + * @return $this + */ + public function setLine4(?string $line4): static + { + if (is_null($line4)) { + array_push($this->openAPINullablesSetToNull, 'line4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line4) && (mb_strlen($line4) > 100)) { + throw new InvalidArgumentException('invalid length for $line4 when calling Address., must be smaller than or equal to 100.'); + } + + $this->container['line4'] = $line4; + + return $this; + } + + /** + * Gets line5 + * + * @return string|null + */ + public function getLine5(): ?string + { + return $this->container['line5']; + } + + /** + * Sets line5 + * + * @param string|null $line5 line5 + * + * @return $this + */ + public function setLine5(?string $line5): static + { + if (is_null($line5)) { + array_push($this->openAPINullablesSetToNull, 'line5'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line5', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line5) && (mb_strlen($line5) > 100)) { + throw new InvalidArgumentException('invalid length for $line5 when calling Address., must be smaller than or equal to 100.'); + } + + $this->container['line5'] = $line5; + + return $this; + } + + /** + * Gets postCode + * + * @return string|null + */ + public function getPostCode(): ?string + { + return $this->container['postCode']; + } + + /** + * Sets postCode + * + * @param string|null $postCode postCode + * + * @return $this + */ + public function setPostCode(?string $postCode): static + { + if (is_null($postCode)) { + array_push($this->openAPINullablesSetToNull, 'postCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($postCode) && (mb_strlen($postCode) > 10)) { + throw new InvalidArgumentException('invalid length for $postCode when calling Address., must be smaller than or equal to 10.'); + } + + $this->container['postCode'] = $postCode; + + return $this; + } + + /** + * Gets country + * + * @return \SynergiTech\Staffology\Model\Country|null + */ + public function getCountry(): ?\SynergiTech\Staffology\Model\Country + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param \SynergiTech\Staffology\Model\Country|null $country country + * + * @return $this + */ + public function setCountry(?\SynergiTech\Staffology\Model\Country $country): static + { + if (is_null($country)) { + throw new InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets foreignCountry + * + * @return string|null + */ + public function getForeignCountry(): ?string + { + return $this->container['foreignCountry']; + } + + /** + * Sets foreignCountry + * + * @param string|null $foreignCountry foreignCountry + * + * @return $this + */ + public function setForeignCountry(?string $foreignCountry): static + { + if (is_null($foreignCountry)) { + array_push($this->openAPINullablesSetToNull, 'foreignCountry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignCountry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($foreignCountry) && (mb_strlen($foreignCountry) > 35)) { + throw new InvalidArgumentException('invalid length for $foreignCountry when calling Address., must be smaller than or equal to 35.'); + } + + $this->container['foreignCountry'] = $foreignCountry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AdvancedVarianceReport.php b/src/Model/AdvancedVarianceReport.php new file mode 100644 index 0000000..018184f --- /dev/null +++ b/src/Model/AdvancedVarianceReport.php @@ -0,0 +1,681 @@ + + */ +class AdvancedVarianceReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdvancedVarianceReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\AdvancedVarianceReportLine[]', + 'payCodes' => '\SynergiTech\Staffology\Model\PayCode[]', + 'primaryPeriodName' => 'string', + 'secondaryPeriodName' => 'string', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'payCodes' => null, + 'primaryPeriodName' => null, + 'secondaryPeriodName' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'payCodes' => true, + 'primaryPeriodName' => true, + 'secondaryPeriodName' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'payCodes' => 'payCodes', + 'primaryPeriodName' => 'primaryPeriodName', + 'secondaryPeriodName' => 'secondaryPeriodName', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'payCodes' => 'setPayCodes', + 'primaryPeriodName' => 'setPrimaryPeriodName', + 'secondaryPeriodName' => 'setSecondaryPeriodName', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'payCodes' => 'getPayCodes', + 'primaryPeriodName' => 'getPrimaryPeriodName', + 'secondaryPeriodName' => 'getSecondaryPeriodName', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('primaryPeriodName', $data ?? [], null); + $this->setIfExists('secondaryPeriodName', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\AdvancedVarianceReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\AdvancedVarianceReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets payCodes + * + * @return \SynergiTech\Staffology\Model\PayCode[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param \SynergiTech\Staffology\Model\PayCode[]|null $payCodes payCodes + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets primaryPeriodName + * + * @return string|null + */ + public function getPrimaryPeriodName(): ?string + { + return $this->container['primaryPeriodName']; + } + + /** + * Sets primaryPeriodName + * + * @param string|null $primaryPeriodName primaryPeriodName + * + * @return $this + */ + public function setPrimaryPeriodName(?string $primaryPeriodName): static + { + if (is_null($primaryPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'primaryPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryPeriodName'] = $primaryPeriodName; + + return $this; + } + + /** + * Gets secondaryPeriodName + * + * @return string|null + */ + public function getSecondaryPeriodName(): ?string + { + return $this->container['secondaryPeriodName']; + } + + /** + * Sets secondaryPeriodName + * + * @param string|null $secondaryPeriodName secondaryPeriodName + * + * @return $this + */ + public function setSecondaryPeriodName(?string $secondaryPeriodName): static + { + if (is_null($secondaryPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'secondaryPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryPeriodName'] = $secondaryPeriodName; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AdvancedVarianceReportLine.php b/src/Model/AdvancedVarianceReportLine.php new file mode 100644 index 0000000..508d737 --- /dev/null +++ b/src/Model/AdvancedVarianceReportLine.php @@ -0,0 +1,1153 @@ + + */ +class AdvancedVarianceReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdvancedVarianceReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeCode' => 'string', + 'employeeName' => 'string', + 'department' => 'string', + 'costCentre' => 'string', + 'primaryGrossTotal' => 'float', + 'secondaryGrossTotal' => 'float', + 'primaryGrossTaxable' => 'float', + 'secondaryGrossTaxable' => 'float', + 'primaryNetPay' => 'float', + 'secondaryNetPay' => 'float', + 'primaryTax' => 'float', + 'secondaryTax' => 'float', + 'primaryEmployeeNi' => 'float', + 'secondaryEmployeeNi' => 'float', + 'primaryEmployerNi' => 'float', + 'secondaryEmployerNi' => 'float', + 'primaryStudentOrPgLoan' => 'float', + 'secondaryStudentOrPgLoan' => 'float', + 'payCodeVarianceLines' => '\SynergiTech\Staffology\Model\PayCodeVarianceLine[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeCode' => null, + 'employeeName' => null, + 'department' => null, + 'costCentre' => null, + 'primaryGrossTotal' => 'double', + 'secondaryGrossTotal' => 'double', + 'primaryGrossTaxable' => 'double', + 'secondaryGrossTaxable' => 'double', + 'primaryNetPay' => 'double', + 'secondaryNetPay' => 'double', + 'primaryTax' => 'double', + 'secondaryTax' => 'double', + 'primaryEmployeeNi' => 'double', + 'secondaryEmployeeNi' => 'double', + 'primaryEmployerNi' => 'double', + 'secondaryEmployerNi' => 'double', + 'primaryStudentOrPgLoan' => 'double', + 'secondaryStudentOrPgLoan' => 'double', + 'payCodeVarianceLines' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeCode' => true, + 'employeeName' => true, + 'department' => true, + 'costCentre' => true, + 'primaryGrossTotal' => true, + 'secondaryGrossTotal' => true, + 'primaryGrossTaxable' => true, + 'secondaryGrossTaxable' => true, + 'primaryNetPay' => true, + 'secondaryNetPay' => true, + 'primaryTax' => true, + 'secondaryTax' => true, + 'primaryEmployeeNi' => true, + 'secondaryEmployeeNi' => true, + 'primaryEmployerNi' => true, + 'secondaryEmployerNi' => true, + 'primaryStudentOrPgLoan' => true, + 'secondaryStudentOrPgLoan' => true, + 'payCodeVarianceLines' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeCode' => 'employeeCode', + 'employeeName' => 'employeeName', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'primaryGrossTotal' => 'primaryGrossTotal', + 'secondaryGrossTotal' => 'secondaryGrossTotal', + 'primaryGrossTaxable' => 'primaryGrossTaxable', + 'secondaryGrossTaxable' => 'secondaryGrossTaxable', + 'primaryNetPay' => 'primaryNetPay', + 'secondaryNetPay' => 'secondaryNetPay', + 'primaryTax' => 'primaryTax', + 'secondaryTax' => 'secondaryTax', + 'primaryEmployeeNi' => 'primaryEmployeeNi', + 'secondaryEmployeeNi' => 'secondaryEmployeeNi', + 'primaryEmployerNi' => 'primaryEmployerNi', + 'secondaryEmployerNi' => 'secondaryEmployerNi', + 'primaryStudentOrPgLoan' => 'primaryStudentOrPgLoan', + 'secondaryStudentOrPgLoan' => 'secondaryStudentOrPgLoan', + 'payCodeVarianceLines' => 'payCodeVarianceLines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeCode' => 'setEmployeeCode', + 'employeeName' => 'setEmployeeName', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'primaryGrossTotal' => 'setPrimaryGrossTotal', + 'secondaryGrossTotal' => 'setSecondaryGrossTotal', + 'primaryGrossTaxable' => 'setPrimaryGrossTaxable', + 'secondaryGrossTaxable' => 'setSecondaryGrossTaxable', + 'primaryNetPay' => 'setPrimaryNetPay', + 'secondaryNetPay' => 'setSecondaryNetPay', + 'primaryTax' => 'setPrimaryTax', + 'secondaryTax' => 'setSecondaryTax', + 'primaryEmployeeNi' => 'setPrimaryEmployeeNi', + 'secondaryEmployeeNi' => 'setSecondaryEmployeeNi', + 'primaryEmployerNi' => 'setPrimaryEmployerNi', + 'secondaryEmployerNi' => 'setSecondaryEmployerNi', + 'primaryStudentOrPgLoan' => 'setPrimaryStudentOrPgLoan', + 'secondaryStudentOrPgLoan' => 'setSecondaryStudentOrPgLoan', + 'payCodeVarianceLines' => 'setPayCodeVarianceLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeCode' => 'getEmployeeCode', + 'employeeName' => 'getEmployeeName', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'primaryGrossTotal' => 'getPrimaryGrossTotal', + 'secondaryGrossTotal' => 'getSecondaryGrossTotal', + 'primaryGrossTaxable' => 'getPrimaryGrossTaxable', + 'secondaryGrossTaxable' => 'getSecondaryGrossTaxable', + 'primaryNetPay' => 'getPrimaryNetPay', + 'secondaryNetPay' => 'getSecondaryNetPay', + 'primaryTax' => 'getPrimaryTax', + 'secondaryTax' => 'getSecondaryTax', + 'primaryEmployeeNi' => 'getPrimaryEmployeeNi', + 'secondaryEmployeeNi' => 'getSecondaryEmployeeNi', + 'primaryEmployerNi' => 'getPrimaryEmployerNi', + 'secondaryEmployerNi' => 'getSecondaryEmployerNi', + 'primaryStudentOrPgLoan' => 'getPrimaryStudentOrPgLoan', + 'secondaryStudentOrPgLoan' => 'getSecondaryStudentOrPgLoan', + 'payCodeVarianceLines' => 'getPayCodeVarianceLines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeCode', $data ?? [], null); + $this->setIfExists('employeeName', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('primaryGrossTotal', $data ?? [], null); + $this->setIfExists('secondaryGrossTotal', $data ?? [], null); + $this->setIfExists('primaryGrossTaxable', $data ?? [], null); + $this->setIfExists('secondaryGrossTaxable', $data ?? [], null); + $this->setIfExists('primaryNetPay', $data ?? [], null); + $this->setIfExists('secondaryNetPay', $data ?? [], null); + $this->setIfExists('primaryTax', $data ?? [], null); + $this->setIfExists('secondaryTax', $data ?? [], null); + $this->setIfExists('primaryEmployeeNi', $data ?? [], null); + $this->setIfExists('secondaryEmployeeNi', $data ?? [], null); + $this->setIfExists('primaryEmployerNi', $data ?? [], null); + $this->setIfExists('secondaryEmployerNi', $data ?? [], null); + $this->setIfExists('primaryStudentOrPgLoan', $data ?? [], null); + $this->setIfExists('secondaryStudentOrPgLoan', $data ?? [], null); + $this->setIfExists('payCodeVarianceLines', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeCode + * + * @return string|null + */ + public function getEmployeeCode(): ?string + { + return $this->container['employeeCode']; + } + + /** + * Sets employeeCode + * + * @param string|null $employeeCode employeeCode + * + * @return $this + */ + public function setEmployeeCode(?string $employeeCode): static + { + if (is_null($employeeCode)) { + array_push($this->openAPINullablesSetToNull, 'employeeCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeCode'] = $employeeCode; + + return $this; + } + + /** + * Gets employeeName + * + * @return string|null + */ + public function getEmployeeName(): ?string + { + return $this->container['employeeName']; + } + + /** + * Sets employeeName + * + * @param string|null $employeeName employeeName + * + * @return $this + */ + public function setEmployeeName(?string $employeeName): static + { + if (is_null($employeeName)) { + array_push($this->openAPINullablesSetToNull, 'employeeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeName'] = $employeeName; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre costCentre + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets primaryGrossTotal + * + * @return float|null + */ + public function getPrimaryGrossTotal(): ?float + { + return $this->container['primaryGrossTotal']; + } + + /** + * Sets primaryGrossTotal + * + * @param float|null $primaryGrossTotal primaryGrossTotal + * + * @return $this + */ + public function setPrimaryGrossTotal(?float $primaryGrossTotal): static + { + if (is_null($primaryGrossTotal)) { + array_push($this->openAPINullablesSetToNull, 'primaryGrossTotal'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryGrossTotal', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryGrossTotal'] = $primaryGrossTotal; + + return $this; + } + + /** + * Gets secondaryGrossTotal + * + * @return float|null + */ + public function getSecondaryGrossTotal(): ?float + { + return $this->container['secondaryGrossTotal']; + } + + /** + * Sets secondaryGrossTotal + * + * @param float|null $secondaryGrossTotal secondaryGrossTotal + * + * @return $this + */ + public function setSecondaryGrossTotal(?float $secondaryGrossTotal): static + { + if (is_null($secondaryGrossTotal)) { + array_push($this->openAPINullablesSetToNull, 'secondaryGrossTotal'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryGrossTotal', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryGrossTotal'] = $secondaryGrossTotal; + + return $this; + } + + /** + * Gets primaryGrossTaxable + * + * @return float|null + */ + public function getPrimaryGrossTaxable(): ?float + { + return $this->container['primaryGrossTaxable']; + } + + /** + * Sets primaryGrossTaxable + * + * @param float|null $primaryGrossTaxable primaryGrossTaxable + * + * @return $this + */ + public function setPrimaryGrossTaxable(?float $primaryGrossTaxable): static + { + if (is_null($primaryGrossTaxable)) { + array_push($this->openAPINullablesSetToNull, 'primaryGrossTaxable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryGrossTaxable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryGrossTaxable'] = $primaryGrossTaxable; + + return $this; + } + + /** + * Gets secondaryGrossTaxable + * + * @return float|null + */ + public function getSecondaryGrossTaxable(): ?float + { + return $this->container['secondaryGrossTaxable']; + } + + /** + * Sets secondaryGrossTaxable + * + * @param float|null $secondaryGrossTaxable secondaryGrossTaxable + * + * @return $this + */ + public function setSecondaryGrossTaxable(?float $secondaryGrossTaxable): static + { + if (is_null($secondaryGrossTaxable)) { + array_push($this->openAPINullablesSetToNull, 'secondaryGrossTaxable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryGrossTaxable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryGrossTaxable'] = $secondaryGrossTaxable; + + return $this; + } + + /** + * Gets primaryNetPay + * + * @return float|null + */ + public function getPrimaryNetPay(): ?float + { + return $this->container['primaryNetPay']; + } + + /** + * Sets primaryNetPay + * + * @param float|null $primaryNetPay primaryNetPay + * + * @return $this + */ + public function setPrimaryNetPay(?float $primaryNetPay): static + { + if (is_null($primaryNetPay)) { + array_push($this->openAPINullablesSetToNull, 'primaryNetPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryNetPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryNetPay'] = $primaryNetPay; + + return $this; + } + + /** + * Gets secondaryNetPay + * + * @return float|null + */ + public function getSecondaryNetPay(): ?float + { + return $this->container['secondaryNetPay']; + } + + /** + * Sets secondaryNetPay + * + * @param float|null $secondaryNetPay secondaryNetPay + * + * @return $this + */ + public function setSecondaryNetPay(?float $secondaryNetPay): static + { + if (is_null($secondaryNetPay)) { + array_push($this->openAPINullablesSetToNull, 'secondaryNetPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryNetPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryNetPay'] = $secondaryNetPay; + + return $this; + } + + /** + * Gets primaryTax + * + * @return float|null + */ + public function getPrimaryTax(): ?float + { + return $this->container['primaryTax']; + } + + /** + * Sets primaryTax + * + * @param float|null $primaryTax primaryTax + * + * @return $this + */ + public function setPrimaryTax(?float $primaryTax): static + { + if (is_null($primaryTax)) { + array_push($this->openAPINullablesSetToNull, 'primaryTax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryTax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryTax'] = $primaryTax; + + return $this; + } + + /** + * Gets secondaryTax + * + * @return float|null + */ + public function getSecondaryTax(): ?float + { + return $this->container['secondaryTax']; + } + + /** + * Sets secondaryTax + * + * @param float|null $secondaryTax secondaryTax + * + * @return $this + */ + public function setSecondaryTax(?float $secondaryTax): static + { + if (is_null($secondaryTax)) { + array_push($this->openAPINullablesSetToNull, 'secondaryTax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryTax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryTax'] = $secondaryTax; + + return $this; + } + + /** + * Gets primaryEmployeeNi + * + * @return float|null + */ + public function getPrimaryEmployeeNi(): ?float + { + return $this->container['primaryEmployeeNi']; + } + + /** + * Sets primaryEmployeeNi + * + * @param float|null $primaryEmployeeNi primaryEmployeeNi + * + * @return $this + */ + public function setPrimaryEmployeeNi(?float $primaryEmployeeNi): static + { + if (is_null($primaryEmployeeNi)) { + array_push($this->openAPINullablesSetToNull, 'primaryEmployeeNi'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryEmployeeNi', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryEmployeeNi'] = $primaryEmployeeNi; + + return $this; + } + + /** + * Gets secondaryEmployeeNi + * + * @return float|null + */ + public function getSecondaryEmployeeNi(): ?float + { + return $this->container['secondaryEmployeeNi']; + } + + /** + * Sets secondaryEmployeeNi + * + * @param float|null $secondaryEmployeeNi secondaryEmployeeNi + * + * @return $this + */ + public function setSecondaryEmployeeNi(?float $secondaryEmployeeNi): static + { + if (is_null($secondaryEmployeeNi)) { + array_push($this->openAPINullablesSetToNull, 'secondaryEmployeeNi'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryEmployeeNi', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryEmployeeNi'] = $secondaryEmployeeNi; + + return $this; + } + + /** + * Gets primaryEmployerNi + * + * @return float|null + */ + public function getPrimaryEmployerNi(): ?float + { + return $this->container['primaryEmployerNi']; + } + + /** + * Sets primaryEmployerNi + * + * @param float|null $primaryEmployerNi primaryEmployerNi + * + * @return $this + */ + public function setPrimaryEmployerNi(?float $primaryEmployerNi): static + { + if (is_null($primaryEmployerNi)) { + array_push($this->openAPINullablesSetToNull, 'primaryEmployerNi'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryEmployerNi', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryEmployerNi'] = $primaryEmployerNi; + + return $this; + } + + /** + * Gets secondaryEmployerNi + * + * @return float|null + */ + public function getSecondaryEmployerNi(): ?float + { + return $this->container['secondaryEmployerNi']; + } + + /** + * Sets secondaryEmployerNi + * + * @param float|null $secondaryEmployerNi secondaryEmployerNi + * + * @return $this + */ + public function setSecondaryEmployerNi(?float $secondaryEmployerNi): static + { + if (is_null($secondaryEmployerNi)) { + array_push($this->openAPINullablesSetToNull, 'secondaryEmployerNi'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryEmployerNi', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryEmployerNi'] = $secondaryEmployerNi; + + return $this; + } + + /** + * Gets primaryStudentOrPgLoan + * + * @return float|null + */ + public function getPrimaryStudentOrPgLoan(): ?float + { + return $this->container['primaryStudentOrPgLoan']; + } + + /** + * Sets primaryStudentOrPgLoan + * + * @param float|null $primaryStudentOrPgLoan primaryStudentOrPgLoan + * + * @return $this + */ + public function setPrimaryStudentOrPgLoan(?float $primaryStudentOrPgLoan): static + { + if (is_null($primaryStudentOrPgLoan)) { + array_push($this->openAPINullablesSetToNull, 'primaryStudentOrPgLoan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryStudentOrPgLoan', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryStudentOrPgLoan'] = $primaryStudentOrPgLoan; + + return $this; + } + + /** + * Gets secondaryStudentOrPgLoan + * + * @return float|null + */ + public function getSecondaryStudentOrPgLoan(): ?float + { + return $this->container['secondaryStudentOrPgLoan']; + } + + /** + * Sets secondaryStudentOrPgLoan + * + * @param float|null $secondaryStudentOrPgLoan secondaryStudentOrPgLoan + * + * @return $this + */ + public function setSecondaryStudentOrPgLoan(?float $secondaryStudentOrPgLoan): static + { + if (is_null($secondaryStudentOrPgLoan)) { + array_push($this->openAPINullablesSetToNull, 'secondaryStudentOrPgLoan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryStudentOrPgLoan', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryStudentOrPgLoan'] = $secondaryStudentOrPgLoan; + + return $this; + } + + /** + * Gets payCodeVarianceLines + * + * @return \SynergiTech\Staffology\Model\PayCodeVarianceLine[]|null + */ + public function getPayCodeVarianceLines(): ?array + { + return $this->container['payCodeVarianceLines']; + } + + /** + * Sets payCodeVarianceLines + * + * @param \SynergiTech\Staffology\Model\PayCodeVarianceLine[]|null $payCodeVarianceLines payCodeVarianceLines + * + * @return $this + */ + public function setPayCodeVarianceLines(?array $payCodeVarianceLines): static + { + if (is_null($payCodeVarianceLines)) { + array_push($this->openAPINullablesSetToNull, 'payCodeVarianceLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeVarianceLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeVarianceLines'] = $payCodeVarianceLines; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AdvancedVarianceReportReportResponse.php b/src/Model/AdvancedVarianceReportReportResponse.php new file mode 100644 index 0000000..ac7a39c --- /dev/null +++ b/src/Model/AdvancedVarianceReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class AdvancedVarianceReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdvancedVarianceReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\AdvancedVarianceReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\AdvancedVarianceReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\AdvancedVarianceReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\AdvancedVarianceReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\AdvancedVarianceReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AeAction.php b/src/Model/AeAction.php new file mode 100644 index 0000000..b02f16d --- /dev/null +++ b/src/Model/AeAction.php @@ -0,0 +1,53 @@ + + */ +class AeAssessment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AeAssessment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'assessmentDate' => '\DateTime', + 'employeeState' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'age' => 'int', + 'ukWorker' => '\SynergiTech\Staffology\Model\AeUKWorker', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'earningsInPeriod' => 'float', + 'qualifyingEarningsInPeriod' => 'float', + 'aeExclusionCode' => '\SynergiTech\Staffology\Model\AeExclusionCode', + 'status' => '\SynergiTech\Staffology\Model\AeStatus', + 'reason' => 'string', + 'action' => '\SynergiTech\Staffology\Model\AeAssessmentAction', + 'startReportingType' => '\SynergiTech\Staffology\Model\PensionReportingType', + 'endReportingType' => '\SynergiTech\Staffology\Model\PensionReportingType', + 'startPayRunEntryId' => 'int', + 'endPayRunEntryId' => 'int', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'assessmentDate' => 'date-time', + 'employeeState' => null, + 'age' => 'int32', + 'ukWorker' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'earningsInPeriod' => 'double', + 'qualifyingEarningsInPeriod' => 'double', + 'aeExclusionCode' => null, + 'status' => null, + 'reason' => null, + 'action' => null, + 'startReportingType' => null, + 'endReportingType' => null, + 'startPayRunEntryId' => 'int32', + 'endPayRunEntryId' => 'int32', + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'assessmentDate' => false, + 'employeeState' => false, + 'age' => false, + 'ukWorker' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'earningsInPeriod' => false, + 'qualifyingEarningsInPeriod' => false, + 'aeExclusionCode' => false, + 'status' => false, + 'reason' => true, + 'action' => false, + 'startReportingType' => false, + 'endReportingType' => false, + 'startPayRunEntryId' => true, + 'endPayRunEntryId' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'assessmentDate' => 'assessmentDate', + 'employeeState' => 'employeeState', + 'age' => 'age', + 'ukWorker' => 'ukWorker', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'earningsInPeriod' => 'earningsInPeriod', + 'qualifyingEarningsInPeriod' => 'qualifyingEarningsInPeriod', + 'aeExclusionCode' => 'aeExclusionCode', + 'status' => 'status', + 'reason' => 'reason', + 'action' => 'action', + 'startReportingType' => 'startReportingType', + 'endReportingType' => 'endReportingType', + 'startPayRunEntryId' => 'startPayRunEntryId', + 'endPayRunEntryId' => 'endPayRunEntryId', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'assessmentDate' => 'setAssessmentDate', + 'employeeState' => 'setEmployeeState', + 'age' => 'setAge', + 'ukWorker' => 'setUkWorker', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'earningsInPeriod' => 'setEarningsInPeriod', + 'qualifyingEarningsInPeriod' => 'setQualifyingEarningsInPeriod', + 'aeExclusionCode' => 'setAeExclusionCode', + 'status' => 'setStatus', + 'reason' => 'setReason', + 'action' => 'setAction', + 'startReportingType' => 'setStartReportingType', + 'endReportingType' => 'setEndReportingType', + 'startPayRunEntryId' => 'setStartPayRunEntryId', + 'endPayRunEntryId' => 'setEndPayRunEntryId', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'assessmentDate' => 'getAssessmentDate', + 'employeeState' => 'getEmployeeState', + 'age' => 'getAge', + 'ukWorker' => 'getUkWorker', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'earningsInPeriod' => 'getEarningsInPeriod', + 'qualifyingEarningsInPeriod' => 'getQualifyingEarningsInPeriod', + 'aeExclusionCode' => 'getAeExclusionCode', + 'status' => 'getStatus', + 'reason' => 'getReason', + 'action' => 'getAction', + 'startReportingType' => 'getStartReportingType', + 'endReportingType' => 'getEndReportingType', + 'startPayRunEntryId' => 'getStartPayRunEntryId', + 'endPayRunEntryId' => 'getEndPayRunEntryId', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('assessmentDate', $data ?? [], null); + $this->setIfExists('employeeState', $data ?? [], null); + $this->setIfExists('age', $data ?? [], null); + $this->setIfExists('ukWorker', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('earningsInPeriod', $data ?? [], null); + $this->setIfExists('qualifyingEarningsInPeriod', $data ?? [], null); + $this->setIfExists('aeExclusionCode', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('startReportingType', $data ?? [], null); + $this->setIfExists('endReportingType', $data ?? [], null); + $this->setIfExists('startPayRunEntryId', $data ?? [], null); + $this->setIfExists('endPayRunEntryId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets assessmentDate + * + * @return \DateTime|null + */ + public function getAssessmentDate(): ?\DateTime + { + return $this->container['assessmentDate']; + } + + /** + * Sets assessmentDate + * + * @param \DateTime|null $assessmentDate assessmentDate + * + * @return $this + */ + public function setAssessmentDate(?\DateTime $assessmentDate): static + { + if (is_null($assessmentDate)) { + throw new InvalidArgumentException('non-nullable assessmentDate cannot be null'); + } + $this->container['assessmentDate'] = $assessmentDate; + + return $this; + } + + /** + * Gets employeeState + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getEmployeeState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['employeeState']; + } + + /** + * Sets employeeState + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $employeeState employeeState + * + * @return $this + */ + public function setEmployeeState(?\SynergiTech\Staffology\Model\AeEmployeeState $employeeState): static + { + if (is_null($employeeState)) { + throw new InvalidArgumentException('non-nullable employeeState cannot be null'); + } + $this->container['employeeState'] = $employeeState; + + return $this; + } + + /** + * Gets age + * + * @return int|null + */ + public function getAge(): ?int + { + return $this->container['age']; + } + + /** + * Sets age + * + * @param int|null $age [readonly] The age of the Employee at the time of the assessment + * + * @return $this + */ + public function setAge(?int $age): static + { + if (is_null($age)) { + throw new InvalidArgumentException('non-nullable age cannot be null'); + } + $this->container['age'] = $age; + + return $this; + } + + /** + * Gets ukWorker + * + * @return \SynergiTech\Staffology\Model\AeUKWorker|null + */ + public function getUkWorker(): ?\SynergiTech\Staffology\Model\AeUKWorker + { + return $this->container['ukWorker']; + } + + /** + * Sets ukWorker + * + * @param \SynergiTech\Staffology\Model\AeUKWorker|null $ukWorker ukWorker + * + * @return $this + */ + public function setUkWorker(?\SynergiTech\Staffology\Model\AeUKWorker $ukWorker): static + { + if (is_null($ukWorker)) { + throw new InvalidArgumentException('non-nullable ukWorker cannot be null'); + } + $this->container['ukWorker'] = $ukWorker; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal [readonly] The PaySchedule ordinal for the Employee at the time of the assessment + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets earningsInPeriod + * + * @return float|null + */ + public function getEarningsInPeriod(): ?float + { + return $this->container['earningsInPeriod']; + } + + /** + * Sets earningsInPeriod + * + * @param float|null $earningsInPeriod [readonly] + * + * @return $this + */ + public function setEarningsInPeriod(?float $earningsInPeriod): static + { + if (is_null($earningsInPeriod)) { + throw new InvalidArgumentException('non-nullable earningsInPeriod cannot be null'); + } + $this->container['earningsInPeriod'] = $earningsInPeriod; + + return $this; + } + + /** + * Gets qualifyingEarningsInPeriod + * + * @return float|null + */ + public function getQualifyingEarningsInPeriod(): ?float + { + return $this->container['qualifyingEarningsInPeriod']; + } + + /** + * Sets qualifyingEarningsInPeriod + * + * @param float|null $qualifyingEarningsInPeriod [readonly] + * + * @return $this + */ + public function setQualifyingEarningsInPeriod(?float $qualifyingEarningsInPeriod): static + { + if (is_null($qualifyingEarningsInPeriod)) { + throw new InvalidArgumentException('non-nullable qualifyingEarningsInPeriod cannot be null'); + } + $this->container['qualifyingEarningsInPeriod'] = $qualifyingEarningsInPeriod; + + return $this; + } + + /** + * Gets aeExclusionCode + * + * @return \SynergiTech\Staffology\Model\AeExclusionCode|null + */ + public function getAeExclusionCode(): ?\SynergiTech\Staffology\Model\AeExclusionCode + { + return $this->container['aeExclusionCode']; + } + + /** + * Sets aeExclusionCode + * + * @param \SynergiTech\Staffology\Model\AeExclusionCode|null $aeExclusionCode aeExclusionCode + * + * @return $this + */ + public function setAeExclusionCode(?\SynergiTech\Staffology\Model\AeExclusionCode $aeExclusionCode): static + { + if (is_null($aeExclusionCode)) { + throw new InvalidArgumentException('non-nullable aeExclusionCode cannot be null'); + } + $this->container['aeExclusionCode'] = $aeExclusionCode; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\AeStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\AeStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\AeStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\AeStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason(): ?string + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason [readonly] The reason for determining the Status given. + * + * @return $this + */ + public function setReason(?string $reason): static + { + if (is_null($reason)) { + array_push($this->openAPINullablesSetToNull, 'reason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reason', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets action + * + * @return \SynergiTech\Staffology\Model\AeAssessmentAction|null + */ + public function getAction(): ?\SynergiTech\Staffology\Model\AeAssessmentAction + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \SynergiTech\Staffology\Model\AeAssessmentAction|null $action action + * + * @return $this + */ + public function setAction(?\SynergiTech\Staffology\Model\AeAssessmentAction $action): static + { + if (is_null($action)) { + throw new InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets startReportingType + * + * @return \SynergiTech\Staffology\Model\PensionReportingType|null + */ + public function getStartReportingType(): ?\SynergiTech\Staffology\Model\PensionReportingType + { + return $this->container['startReportingType']; + } + + /** + * Sets startReportingType + * + * @param \SynergiTech\Staffology\Model\PensionReportingType|null $startReportingType startReportingType + * + * @return $this + */ + public function setStartReportingType(?\SynergiTech\Staffology\Model\PensionReportingType $startReportingType): static + { + if (is_null($startReportingType)) { + throw new InvalidArgumentException('non-nullable startReportingType cannot be null'); + } + $this->container['startReportingType'] = $startReportingType; + + return $this; + } + + /** + * Gets endReportingType + * + * @return \SynergiTech\Staffology\Model\PensionReportingType|null + */ + public function getEndReportingType(): ?\SynergiTech\Staffology\Model\PensionReportingType + { + return $this->container['endReportingType']; + } + + /** + * Sets endReportingType + * + * @param \SynergiTech\Staffology\Model\PensionReportingType|null $endReportingType endReportingType + * + * @return $this + */ + public function setEndReportingType(?\SynergiTech\Staffology\Model\PensionReportingType $endReportingType): static + { + if (is_null($endReportingType)) { + throw new InvalidArgumentException('non-nullable endReportingType cannot be null'); + } + $this->container['endReportingType'] = $endReportingType; + + return $this; + } + + /** + * Gets startPayRunEntryId + * + * @return int|null + */ + public function getStartPayRunEntryId(): ?int + { + return $this->container['startPayRunEntryId']; + } + + /** + * Sets startPayRunEntryId + * + * @param int|null $startPayRunEntryId startPayRunEntryId + * + * @return $this + */ + public function setStartPayRunEntryId(?int $startPayRunEntryId): static + { + if (is_null($startPayRunEntryId)) { + array_push($this->openAPINullablesSetToNull, 'startPayRunEntryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPayRunEntryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPayRunEntryId'] = $startPayRunEntryId; + + return $this; + } + + /** + * Gets endPayRunEntryId + * + * @return int|null + */ + public function getEndPayRunEntryId(): ?int + { + return $this->container['endPayRunEntryId']; + } + + /** + * Sets endPayRunEntryId + * + * @param int|null $endPayRunEntryId endPayRunEntryId + * + * @return $this + */ + public function setEndPayRunEntryId(?int $endPayRunEntryId): static + { + if (is_null($endPayRunEntryId)) { + array_push($this->openAPINullablesSetToNull, 'endPayRunEntryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPayRunEntryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPayRunEntryId'] = $endPayRunEntryId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AeAssessmentAction.php b/src/Model/AeAssessmentAction.php new file mode 100644 index 0000000..cffe522 --- /dev/null +++ b/src/Model/AeAssessmentAction.php @@ -0,0 +1,653 @@ + + */ +class AeAssessmentAction implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AeAssessmentAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'action' => '\SynergiTech\Staffology\Model\AeAction', + 'employeeState' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'actionCompleted' => 'bool', + 'actionCompletedMessage' => 'string', + 'requiredLetter' => '\SynergiTech\Staffology\Model\AeStatutoryLetter', + 'pensionSchemeId' => 'string', + 'workerGroupId' => 'string', + 'letterNotYetSent' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'action' => null, + 'employeeState' => null, + 'actionCompleted' => null, + 'actionCompletedMessage' => null, + 'requiredLetter' => null, + 'pensionSchemeId' => 'uuid', + 'workerGroupId' => 'uuid', + 'letterNotYetSent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'action' => false, + 'employeeState' => false, + 'actionCompleted' => false, + 'actionCompletedMessage' => true, + 'requiredLetter' => false, + 'pensionSchemeId' => false, + 'workerGroupId' => false, + 'letterNotYetSent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'action' => 'action', + 'employeeState' => 'employeeState', + 'actionCompleted' => 'actionCompleted', + 'actionCompletedMessage' => 'actionCompletedMessage', + 'requiredLetter' => 'requiredLetter', + 'pensionSchemeId' => 'pensionSchemeId', + 'workerGroupId' => 'workerGroupId', + 'letterNotYetSent' => 'letterNotYetSent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'action' => 'setAction', + 'employeeState' => 'setEmployeeState', + 'actionCompleted' => 'setActionCompleted', + 'actionCompletedMessage' => 'setActionCompletedMessage', + 'requiredLetter' => 'setRequiredLetter', + 'pensionSchemeId' => 'setPensionSchemeId', + 'workerGroupId' => 'setWorkerGroupId', + 'letterNotYetSent' => 'setLetterNotYetSent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'action' => 'getAction', + 'employeeState' => 'getEmployeeState', + 'actionCompleted' => 'getActionCompleted', + 'actionCompletedMessage' => 'getActionCompletedMessage', + 'requiredLetter' => 'getRequiredLetter', + 'pensionSchemeId' => 'getPensionSchemeId', + 'workerGroupId' => 'getWorkerGroupId', + 'letterNotYetSent' => 'getLetterNotYetSent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('employeeState', $data ?? [], null); + $this->setIfExists('actionCompleted', $data ?? [], null); + $this->setIfExists('actionCompletedMessage', $data ?? [], null); + $this->setIfExists('requiredLetter', $data ?? [], null); + $this->setIfExists('pensionSchemeId', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + $this->setIfExists('letterNotYetSent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action + * + * @return \SynergiTech\Staffology\Model\AeAction|null + */ + public function getAction(): ?\SynergiTech\Staffology\Model\AeAction + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \SynergiTech\Staffology\Model\AeAction|null $action action + * + * @return $this + */ + public function setAction(?\SynergiTech\Staffology\Model\AeAction $action): static + { + if (is_null($action)) { + throw new InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets employeeState + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getEmployeeState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['employeeState']; + } + + /** + * Sets employeeState + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $employeeState employeeState + * + * @return $this + */ + public function setEmployeeState(?\SynergiTech\Staffology\Model\AeEmployeeState $employeeState): static + { + if (is_null($employeeState)) { + throw new InvalidArgumentException('non-nullable employeeState cannot be null'); + } + $this->container['employeeState'] = $employeeState; + + return $this; + } + + /** + * Gets actionCompleted + * + * @return bool|null + */ + public function getActionCompleted(): ?bool + { + return $this->container['actionCompleted']; + } + + /** + * Sets actionCompleted + * + * @param bool|null $actionCompleted [readonly] Indicates whether or not the required action was successfully completed + * + * @return $this + */ + public function setActionCompleted(?bool $actionCompleted): static + { + if (is_null($actionCompleted)) { + throw new InvalidArgumentException('non-nullable actionCompleted cannot be null'); + } + $this->container['actionCompleted'] = $actionCompleted; + + return $this; + } + + /** + * Gets actionCompletedMessage + * + * @return string|null + */ + public function getActionCompletedMessage(): ?string + { + return $this->container['actionCompletedMessage']; + } + + /** + * Sets actionCompletedMessage + * + * @param string|null $actionCompletedMessage [readonly] Gives further information about the action taken or the reason if wasn't successfully completed + * + * @return $this + */ + public function setActionCompletedMessage(?string $actionCompletedMessage): static + { + if (is_null($actionCompletedMessage)) { + array_push($this->openAPINullablesSetToNull, 'actionCompletedMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actionCompletedMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actionCompletedMessage'] = $actionCompletedMessage; + + return $this; + } + + /** + * Gets requiredLetter + * + * @return \SynergiTech\Staffology\Model\AeStatutoryLetter|null + */ + public function getRequiredLetter(): ?\SynergiTech\Staffology\Model\AeStatutoryLetter + { + return $this->container['requiredLetter']; + } + + /** + * Sets requiredLetter + * + * @param \SynergiTech\Staffology\Model\AeStatutoryLetter|null $requiredLetter requiredLetter + * + * @return $this + */ + public function setRequiredLetter(?\SynergiTech\Staffology\Model\AeStatutoryLetter $requiredLetter): static + { + if (is_null($requiredLetter)) { + throw new InvalidArgumentException('non-nullable requiredLetter cannot be null'); + } + $this->container['requiredLetter'] = $requiredLetter; + + return $this; + } + + /** + * Gets pensionSchemeId + * + * @return string|null + */ + public function getPensionSchemeId(): ?string + { + return $this->container['pensionSchemeId']; + } + + /** + * Sets pensionSchemeId + * + * @param string|null $pensionSchemeId [readonly] The PensionSchemeId that a completed action relates to + * + * @return $this + */ + public function setPensionSchemeId(?string $pensionSchemeId): static + { + if (is_null($pensionSchemeId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeId cannot be null'); + } + $this->container['pensionSchemeId'] = $pensionSchemeId; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId [readonly] The WorkerGroupId that a completed action relates to + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + + /** + * Gets letterNotYetSent + * + * @return bool|null + */ + public function getLetterNotYetSent(): ?bool + { + return $this->container['letterNotYetSent']; + } + + /** + * Sets letterNotYetSent + * + * @param bool|null $letterNotYetSent [readonly] Indicates whether or not any required letter has been sent + * + * @return $this + */ + public function setLetterNotYetSent(?bool $letterNotYetSent): static + { + if (is_null($letterNotYetSent)) { + throw new InvalidArgumentException('non-nullable letterNotYetSent cannot be null'); + } + $this->container['letterNotYetSent'] = $letterNotYetSent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AeEmployeeState.php b/src/Model/AeEmployeeState.php new file mode 100644 index 0000000..ebef0cc --- /dev/null +++ b/src/Model/AeEmployeeState.php @@ -0,0 +1,59 @@ + + */ +class AnalysisCategory implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisCategory'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The unique Analysis Category Name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 100)) { + throw new InvalidArgumentException('invalid length for $name when calling AnalysisCategory., must be smaller than or equal to 100.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling AnalysisCategory., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisCategoryCode.php b/src/Model/AnalysisCategoryCode.php new file mode 100644 index 0000000..2594c35 --- /dev/null +++ b/src/Model/AnalysisCategoryCode.php @@ -0,0 +1,576 @@ + + */ +class AnalysisCategoryCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisCategoryCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'title' => false, + 'color' => true, + 'accountingCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['accountingCode']) && (mb_strlen($this->container['accountingCode']) > 50)) { + $invalidProperties[] = "invalid value for 'accountingCode', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling AnalysisCategoryCode., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling AnalysisCategoryCode., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Analysis Code + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling AnalysisCategoryCode., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling AnalysisCategoryCode., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Analysis Code, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling AnalysisCategoryCode., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountingCode) && (mb_strlen($accountingCode) > 50)) { + throw new InvalidArgumentException('invalid length for $accountingCode when calling AnalysisCategoryCode., must be smaller than or equal to 50.'); + } + + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisCategoryCodes.php b/src/Model/AnalysisCategoryCodes.php new file mode 100644 index 0000000..3536cb9 --- /dev/null +++ b/src/Model/AnalysisCategoryCodes.php @@ -0,0 +1,538 @@ + + */ +class AnalysisCategoryCodes implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisCategoryCodes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'analysisCategory' => 'string', + 'analysisCategoryCode' => 'string', + 'analysisCategoryId' => 'string', + 'analysisCategoryCodeId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'analysisCategory' => null, + 'analysisCategoryCode' => null, + 'analysisCategoryId' => 'uuid', + 'analysisCategoryCodeId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'analysisCategory' => true, + 'analysisCategoryCode' => true, + 'analysisCategoryId' => true, + 'analysisCategoryCodeId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'analysisCategory' => 'analysisCategory', + 'analysisCategoryCode' => 'analysisCategoryCode', + 'analysisCategoryId' => 'analysisCategoryId', + 'analysisCategoryCodeId' => 'analysisCategoryCodeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'analysisCategory' => 'setAnalysisCategory', + 'analysisCategoryCode' => 'setAnalysisCategoryCode', + 'analysisCategoryId' => 'setAnalysisCategoryId', + 'analysisCategoryCodeId' => 'setAnalysisCategoryCodeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'analysisCategory' => 'getAnalysisCategory', + 'analysisCategoryCode' => 'getAnalysisCategoryCode', + 'analysisCategoryId' => 'getAnalysisCategoryId', + 'analysisCategoryCodeId' => 'getAnalysisCategoryCodeId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('analysisCategory', $data ?? [], null); + $this->setIfExists('analysisCategoryCode', $data ?? [], null); + $this->setIfExists('analysisCategoryId', $data ?? [], null); + $this->setIfExists('analysisCategoryCodeId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets analysisCategory + * + * @return string|null + */ + public function getAnalysisCategory(): ?string + { + return $this->container['analysisCategory']; + } + + /** + * Sets analysisCategory + * + * @param string|null $analysisCategory AnalysisCategory Model + * + * @return $this + */ + public function setAnalysisCategory(?string $analysisCategory): static + { + if (is_null($analysisCategory)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategory'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategory', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategory'] = $analysisCategory; + + return $this; + } + + /** + * Gets analysisCategoryCode + * + * @return string|null + */ + public function getAnalysisCategoryCode(): ?string + { + return $this->container['analysisCategoryCode']; + } + + /** + * Sets analysisCategoryCode + * + * @param string|null $analysisCategoryCode AnalysisCategoryCode Model + * + * @return $this + */ + public function setAnalysisCategoryCode(?string $analysisCategoryCode): static + { + if (is_null($analysisCategoryCode)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCode'] = $analysisCategoryCode; + + return $this; + } + + /** + * Gets analysisCategoryId + * + * @return string|null + */ + public function getAnalysisCategoryId(): ?string + { + return $this->container['analysisCategoryId']; + } + + /** + * Sets analysisCategoryId + * + * @param string|null $analysisCategoryId AnalysisCategory Identifier + * + * @return $this + */ + public function setAnalysisCategoryId(?string $analysisCategoryId): static + { + if (is_null($analysisCategoryId)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryId'] = $analysisCategoryId; + + return $this; + } + + /** + * Gets analysisCategoryCodeId + * + * @return string|null + */ + public function getAnalysisCategoryCodeId(): ?string + { + return $this->container['analysisCategoryCodeId']; + } + + /** + * Sets analysisCategoryCodeId + * + * @param string|null $analysisCategoryCodeId AnalysisCategoryCode Identifier + * + * @return $this + */ + public function setAnalysisCategoryCodeId(?string $analysisCategoryCodeId): static + { + if (is_null($analysisCategoryCodeId)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeId'] = $analysisCategoryCodeId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisCategoryIndex.php b/src/Model/AnalysisCategoryIndex.php new file mode 100644 index 0000000..071133f --- /dev/null +++ b/src/Model/AnalysisCategoryIndex.php @@ -0,0 +1,449 @@ + + */ +class AnalysisCategoryIndex implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisCategoryIndex'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'index' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'index' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'index' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'index' => 'index' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'index' => 'setIndex' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'index' => 'getIndex' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('index', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets index + * + * @return int|null + */ + public function getIndex(): ?int + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param int|null $index index + * + * @return $this + */ + public function setIndex(?int $index): static + { + if (is_null($index)) { + throw new InvalidArgumentException('non-nullable index cannot be null'); + } + $this->container['index'] = $index; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisReport.php b/src/Model/AnalysisReport.php new file mode 100644 index 0000000..26e9043 --- /dev/null +++ b/src/Model/AnalysisReport.php @@ -0,0 +1,953 @@ + + */ +class AnalysisReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\AnalysisReportLine[]', + 'payCodes' => '\SynergiTech\Staffology\Model\PayCode[]', + 'showPayPeriodBreakdown' => 'bool', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'payCodes' => null, + 'showPayPeriodBreakdown' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'payCodes' => true, + 'showPayPeriodBreakdown' => false, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'payCodes' => 'payCodes', + 'showPayPeriodBreakdown' => 'showPayPeriodBreakdown', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'payCodes' => 'setPayCodes', + 'showPayPeriodBreakdown' => 'setShowPayPeriodBreakdown', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'payCodes' => 'getPayCodes', + 'showPayPeriodBreakdown' => 'getShowPayPeriodBreakdown', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('showPayPeriodBreakdown', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\AnalysisReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\AnalysisReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets payCodes + * + * @return \SynergiTech\Staffology\Model\PayCode[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param \SynergiTech\Staffology\Model\PayCode[]|null $payCodes payCodes + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets showPayPeriodBreakdown + * + * @return bool|null + */ + public function getShowPayPeriodBreakdown(): ?bool + { + return $this->container['showPayPeriodBreakdown']; + } + + /** + * Sets showPayPeriodBreakdown + * + * @param bool|null $showPayPeriodBreakdown showPayPeriodBreakdown + * + * @return $this + */ + public function setShowPayPeriodBreakdown(?bool $showPayPeriodBreakdown): static + { + if (is_null($showPayPeriodBreakdown)) { + throw new InvalidArgumentException('non-nullable showPayPeriodBreakdown cannot be null'); + } + $this->container['showPayPeriodBreakdown'] = $showPayPeriodBreakdown; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisReportLine.php b/src/Model/AnalysisReportLine.php new file mode 100644 index 0000000..b43b6fd --- /dev/null +++ b/src/Model/AnalysisReportLine.php @@ -0,0 +1,830 @@ + + */ +class AnalysisReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'taxYear' => 'string', + 'payPeriod' => 'int', + 'gross' => 'float', + 'niableGross' => 'float', + 'pensionableGross' => 'float', + 'net' => 'float', + 'takeHome' => 'float', + 'employerNic' => 'float', + 'employerPension' => 'float', + 'showQtyColumn' => 'bool', + 'niSaving' => 'float', + 'lines' => '\SynergiTech\Staffology\Model\AnalysisReportLineValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'taxYear' => null, + 'payPeriod' => 'int32', + 'gross' => 'double', + 'niableGross' => 'double', + 'pensionableGross' => 'double', + 'net' => 'double', + 'takeHome' => 'double', + 'employerNic' => 'double', + 'employerPension' => 'double', + 'showQtyColumn' => null, + 'niSaving' => 'double', + 'lines' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'taxYear' => true, + 'payPeriod' => false, + 'gross' => false, + 'niableGross' => false, + 'pensionableGross' => false, + 'net' => false, + 'takeHome' => false, + 'employerNic' => false, + 'employerPension' => false, + 'showQtyColumn' => false, + 'niSaving' => false, + 'lines' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'gross' => 'gross', + 'niableGross' => 'niableGross', + 'pensionableGross' => 'pensionableGross', + 'net' => 'net', + 'takeHome' => 'takeHome', + 'employerNic' => 'employerNic', + 'employerPension' => 'employerPension', + 'showQtyColumn' => 'showQtyColumn', + 'niSaving' => 'niSaving', + 'lines' => 'lines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'gross' => 'setGross', + 'niableGross' => 'setNiableGross', + 'pensionableGross' => 'setPensionableGross', + 'net' => 'setNet', + 'takeHome' => 'setTakeHome', + 'employerNic' => 'setEmployerNic', + 'employerPension' => 'setEmployerPension', + 'showQtyColumn' => 'setShowQtyColumn', + 'niSaving' => 'setNiSaving', + 'lines' => 'setLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'gross' => 'getGross', + 'niableGross' => 'getNiableGross', + 'pensionableGross' => 'getPensionableGross', + 'net' => 'getNet', + 'takeHome' => 'getTakeHome', + 'employerNic' => 'getEmployerNic', + 'employerPension' => 'getEmployerPension', + 'showQtyColumn' => 'getShowQtyColumn', + 'niSaving' => 'getNiSaving', + 'lines' => 'getLines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('gross', $data ?? [], null); + $this->setIfExists('niableGross', $data ?? [], null); + $this->setIfExists('pensionableGross', $data ?? [], null); + $this->setIfExists('net', $data ?? [], null); + $this->setIfExists('takeHome', $data ?? [], null); + $this->setIfExists('employerNic', $data ?? [], null); + $this->setIfExists('employerPension', $data ?? [], null); + $this->setIfExists('showQtyColumn', $data ?? [], null); + $this->setIfExists('niSaving', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets taxYear + * + * @return string|null + */ + public function getTaxYear(): ?string + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param string|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?string $taxYear): static + { + if (is_null($taxYear)) { + array_push($this->openAPINullablesSetToNull, 'taxYear'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxYear', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return int|null + */ + public function getPayPeriod(): ?int + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param int|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?int $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets gross + * + * @return float|null + */ + public function getGross(): ?float + { + return $this->container['gross']; + } + + /** + * Sets gross + * + * @param float|null $gross gross + * + * @return $this + */ + public function setGross(?float $gross): static + { + if (is_null($gross)) { + throw new InvalidArgumentException('non-nullable gross cannot be null'); + } + $this->container['gross'] = $gross; + + return $this; + } + + /** + * Gets niableGross + * + * @return float|null + */ + public function getNiableGross(): ?float + { + return $this->container['niableGross']; + } + + /** + * Sets niableGross + * + * @param float|null $niableGross niableGross + * + * @return $this + */ + public function setNiableGross(?float $niableGross): static + { + if (is_null($niableGross)) { + throw new InvalidArgumentException('non-nullable niableGross cannot be null'); + } + $this->container['niableGross'] = $niableGross; + + return $this; + } + + /** + * Gets pensionableGross + * + * @return float|null + */ + public function getPensionableGross(): ?float + { + return $this->container['pensionableGross']; + } + + /** + * Sets pensionableGross + * + * @param float|null $pensionableGross pensionableGross + * + * @return $this + */ + public function setPensionableGross(?float $pensionableGross): static + { + if (is_null($pensionableGross)) { + throw new InvalidArgumentException('non-nullable pensionableGross cannot be null'); + } + $this->container['pensionableGross'] = $pensionableGross; + + return $this; + } + + /** + * Gets net + * + * @return float|null + */ + public function getNet(): ?float + { + return $this->container['net']; + } + + /** + * Sets net + * + * @param float|null $net net + * + * @return $this + */ + public function setNet(?float $net): static + { + if (is_null($net)) { + throw new InvalidArgumentException('non-nullable net cannot be null'); + } + $this->container['net'] = $net; + + return $this; + } + + /** + * Gets takeHome + * + * @return float|null + */ + public function getTakeHome(): ?float + { + return $this->container['takeHome']; + } + + /** + * Sets takeHome + * + * @param float|null $takeHome takeHome + * + * @return $this + */ + public function setTakeHome(?float $takeHome): static + { + if (is_null($takeHome)) { + throw new InvalidArgumentException('non-nullable takeHome cannot be null'); + } + $this->container['takeHome'] = $takeHome; + + return $this; + } + + /** + * Gets employerNic + * + * @return float|null + */ + public function getEmployerNic(): ?float + { + return $this->container['employerNic']; + } + + /** + * Sets employerNic + * + * @param float|null $employerNic employerNic + * + * @return $this + */ + public function setEmployerNic(?float $employerNic): static + { + if (is_null($employerNic)) { + throw new InvalidArgumentException('non-nullable employerNic cannot be null'); + } + $this->container['employerNic'] = $employerNic; + + return $this; + } + + /** + * Gets employerPension + * + * @return float|null + */ + public function getEmployerPension(): ?float + { + return $this->container['employerPension']; + } + + /** + * Sets employerPension + * + * @param float|null $employerPension employerPension + * + * @return $this + */ + public function setEmployerPension(?float $employerPension): static + { + if (is_null($employerPension)) { + throw new InvalidArgumentException('non-nullable employerPension cannot be null'); + } + $this->container['employerPension'] = $employerPension; + + return $this; + } + + /** + * Gets showQtyColumn + * + * @return bool|null + */ + public function getShowQtyColumn(): ?bool + { + return $this->container['showQtyColumn']; + } + + /** + * Sets showQtyColumn + * + * @param bool|null $showQtyColumn showQtyColumn + * + * @return $this + */ + public function setShowQtyColumn(?bool $showQtyColumn): static + { + if (is_null($showQtyColumn)) { + throw new InvalidArgumentException('non-nullable showQtyColumn cannot be null'); + } + $this->container['showQtyColumn'] = $showQtyColumn; + + return $this; + } + + /** + * Gets niSaving + * + * @return float|null + */ + public function getNiSaving(): ?float + { + return $this->container['niSaving']; + } + + /** + * Sets niSaving + * + * @param float|null $niSaving niSaving + * + * @return $this + */ + public function setNiSaving(?float $niSaving): static + { + if (is_null($niSaving)) { + throw new InvalidArgumentException('non-nullable niSaving cannot be null'); + } + $this->container['niSaving'] = $niSaving; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\AnalysisReportLineValue[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\AnalysisReportLineValue[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisReportLineValue.php b/src/Model/AnalysisReportLineValue.php new file mode 100644 index 0000000..b0f1023 --- /dev/null +++ b/src/Model/AnalysisReportLineValue.php @@ -0,0 +1,490 @@ + + */ +class AnalysisReportLineValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisReportLineValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'qty' => 'float', + 'code' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'qty' => 'double', + 'code' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'qty' => true, + 'code' => true, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'qty' => 'qty', + 'code' => 'code', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'qty' => 'setQty', + 'code' => 'setCode', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'qty' => 'getQty', + 'code' => 'getCode', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('qty', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets qty + * + * @return float|null + */ + public function getQty(): ?float + { + return $this->container['qty']; + } + + /** + * Sets qty + * + * @param float|null $qty qty + * + * @return $this + */ + public function setQty(?float $qty): static + { + if (is_null($qty)) { + array_push($this->openAPINullablesSetToNull, 'qty'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qty', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qty'] = $qty; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnalysisReportReportResponse.php b/src/Model/AnalysisReportReportResponse.php new file mode 100644 index 0000000..e904eac --- /dev/null +++ b/src/Model/AnalysisReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class AnalysisReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AnalysisReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\AnalysisReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\AnalysisReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\AnalysisReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\AnalysisReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\AnalysisReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AnnualRoundingRule.php b/src/Model/AnnualRoundingRule.php new file mode 100644 index 0000000..08135a6 --- /dev/null +++ b/src/Model/AnnualRoundingRule.php @@ -0,0 +1,49 @@ + + */ +class AttachmentOrder implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AttachmentOrder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\AttachmentOrderType', + 'carryForwardShortfall' => 'bool', + 'allowProtectedEarnings' => 'bool', + 'autoDeduction' => 'bool', + 'reference' => 'string', + 'issueDate' => '\DateTime', + 'applyFrom' => '\DateTime', + 'applyUntil' => '\DateTime', + 'deductionIsPercentage' => 'bool', + 'deduction' => 'float', + 'protectedEarningsIsPercentage' => 'bool', + 'protectedEarnings' => 'float', + 'chargeAdminFee' => 'bool', + 'shortfall' => 'float', + 'stopWhenTotalPaid' => 'bool', + 'totalAmountToPay' => 'float', + 'amountPreviouslyPaid' => 'float', + 'stopped' => 'bool', + 'notes' => 'string', + 'includeBankDetails' => 'bool', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'payments' => '\SynergiTech\Staffology\Model\AttachmentOrderPayment[]', + 'payee' => 'string', + 'payeeName' => 'string', + 'documentCount' => 'int', + 'documents' => '\SynergiTech\Staffology\Model\Item[]', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'carryForwardShortfall' => null, + 'allowProtectedEarnings' => null, + 'autoDeduction' => null, + 'reference' => null, + 'issueDate' => 'date', + 'applyFrom' => 'date', + 'applyUntil' => 'date', + 'deductionIsPercentage' => null, + 'deduction' => 'double', + 'protectedEarningsIsPercentage' => null, + 'protectedEarnings' => 'double', + 'chargeAdminFee' => null, + 'shortfall' => 'double', + 'stopWhenTotalPaid' => null, + 'totalAmountToPay' => 'double', + 'amountPreviouslyPaid' => 'double', + 'stopped' => null, + 'notes' => null, + 'includeBankDetails' => null, + 'bankDetails' => null, + 'payments' => null, + 'payee' => 'uuid', + 'payeeName' => null, + 'documentCount' => 'int32', + 'documents' => null, + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'carryForwardShortfall' => false, + 'allowProtectedEarnings' => false, + 'autoDeduction' => false, + 'reference' => true, + 'issueDate' => false, + 'applyFrom' => false, + 'applyUntil' => true, + 'deductionIsPercentage' => false, + 'deduction' => false, + 'protectedEarningsIsPercentage' => false, + 'protectedEarnings' => false, + 'chargeAdminFee' => false, + 'shortfall' => false, + 'stopWhenTotalPaid' => false, + 'totalAmountToPay' => false, + 'amountPreviouslyPaid' => false, + 'stopped' => false, + 'notes' => true, + 'includeBankDetails' => false, + 'bankDetails' => false, + 'payments' => true, + 'payee' => true, + 'payeeName' => true, + 'documentCount' => false, + 'documents' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'carryForwardShortfall' => 'carryForwardShortfall', + 'allowProtectedEarnings' => 'allowProtectedEarnings', + 'autoDeduction' => 'autoDeduction', + 'reference' => 'reference', + 'issueDate' => 'issueDate', + 'applyFrom' => 'applyFrom', + 'applyUntil' => 'applyUntil', + 'deductionIsPercentage' => 'deductionIsPercentage', + 'deduction' => 'deduction', + 'protectedEarningsIsPercentage' => 'protectedEarningsIsPercentage', + 'protectedEarnings' => 'protectedEarnings', + 'chargeAdminFee' => 'chargeAdminFee', + 'shortfall' => 'shortfall', + 'stopWhenTotalPaid' => 'stopWhenTotalPaid', + 'totalAmountToPay' => 'totalAmountToPay', + 'amountPreviouslyPaid' => 'amountPreviouslyPaid', + 'stopped' => 'stopped', + 'notes' => 'notes', + 'includeBankDetails' => 'includeBankDetails', + 'bankDetails' => 'bankDetails', + 'payments' => 'payments', + 'payee' => 'payee', + 'payeeName' => 'payeeName', + 'documentCount' => 'documentCount', + 'documents' => 'documents', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'carryForwardShortfall' => 'setCarryForwardShortfall', + 'allowProtectedEarnings' => 'setAllowProtectedEarnings', + 'autoDeduction' => 'setAutoDeduction', + 'reference' => 'setReference', + 'issueDate' => 'setIssueDate', + 'applyFrom' => 'setApplyFrom', + 'applyUntil' => 'setApplyUntil', + 'deductionIsPercentage' => 'setDeductionIsPercentage', + 'deduction' => 'setDeduction', + 'protectedEarningsIsPercentage' => 'setProtectedEarningsIsPercentage', + 'protectedEarnings' => 'setProtectedEarnings', + 'chargeAdminFee' => 'setChargeAdminFee', + 'shortfall' => 'setShortfall', + 'stopWhenTotalPaid' => 'setStopWhenTotalPaid', + 'totalAmountToPay' => 'setTotalAmountToPay', + 'amountPreviouslyPaid' => 'setAmountPreviouslyPaid', + 'stopped' => 'setStopped', + 'notes' => 'setNotes', + 'includeBankDetails' => 'setIncludeBankDetails', + 'bankDetails' => 'setBankDetails', + 'payments' => 'setPayments', + 'payee' => 'setPayee', + 'payeeName' => 'setPayeeName', + 'documentCount' => 'setDocumentCount', + 'documents' => 'setDocuments', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'carryForwardShortfall' => 'getCarryForwardShortfall', + 'allowProtectedEarnings' => 'getAllowProtectedEarnings', + 'autoDeduction' => 'getAutoDeduction', + 'reference' => 'getReference', + 'issueDate' => 'getIssueDate', + 'applyFrom' => 'getApplyFrom', + 'applyUntil' => 'getApplyUntil', + 'deductionIsPercentage' => 'getDeductionIsPercentage', + 'deduction' => 'getDeduction', + 'protectedEarningsIsPercentage' => 'getProtectedEarningsIsPercentage', + 'protectedEarnings' => 'getProtectedEarnings', + 'chargeAdminFee' => 'getChargeAdminFee', + 'shortfall' => 'getShortfall', + 'stopWhenTotalPaid' => 'getStopWhenTotalPaid', + 'totalAmountToPay' => 'getTotalAmountToPay', + 'amountPreviouslyPaid' => 'getAmountPreviouslyPaid', + 'stopped' => 'getStopped', + 'notes' => 'getNotes', + 'includeBankDetails' => 'getIncludeBankDetails', + 'bankDetails' => 'getBankDetails', + 'payments' => 'getPayments', + 'payee' => 'getPayee', + 'payeeName' => 'getPayeeName', + 'documentCount' => 'getDocumentCount', + 'documents' => 'getDocuments', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('carryForwardShortfall', $data ?? [], null); + $this->setIfExists('allowProtectedEarnings', $data ?? [], null); + $this->setIfExists('autoDeduction', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('issueDate', $data ?? [], null); + $this->setIfExists('applyFrom', $data ?? [], null); + $this->setIfExists('applyUntil', $data ?? [], null); + $this->setIfExists('deductionIsPercentage', $data ?? [], null); + $this->setIfExists('deduction', $data ?? [], null); + $this->setIfExists('protectedEarningsIsPercentage', $data ?? [], null); + $this->setIfExists('protectedEarnings', $data ?? [], null); + $this->setIfExists('chargeAdminFee', $data ?? [], null); + $this->setIfExists('shortfall', $data ?? [], null); + $this->setIfExists('stopWhenTotalPaid', $data ?? [], null); + $this->setIfExists('totalAmountToPay', $data ?? [], null); + $this->setIfExists('amountPreviouslyPaid', $data ?? [], null); + $this->setIfExists('stopped', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('includeBankDetails', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('payments', $data ?? [], null); + $this->setIfExists('payee', $data ?? [], null); + $this->setIfExists('payeeName', $data ?? [], null); + $this->setIfExists('documentCount', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reference']) && (mb_strlen($this->container['reference']) > 100)) { + $invalidProperties[] = "invalid value for 'reference', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['notes']) && (mb_strlen($this->container['notes']) > 300)) { + $invalidProperties[] = "invalid value for 'notes', the character length must be smaller than or equal to 300."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\AttachmentOrderType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\AttachmentOrderType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\AttachmentOrderType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\AttachmentOrderType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets carryForwardShortfall + * + * @return bool|null + */ + public function getCarryForwardShortfall(): ?bool + { + return $this->container['carryForwardShortfall']; + } + + /** + * Sets carryForwardShortfall + * + * @param bool|null $carryForwardShortfall [ReadOnly] Whether or not shortfalls should be carried forward + * + * @return $this + */ + public function setCarryForwardShortfall(?bool $carryForwardShortfall): static + { + if (is_null($carryForwardShortfall)) { + throw new InvalidArgumentException('non-nullable carryForwardShortfall cannot be null'); + } + $this->container['carryForwardShortfall'] = $carryForwardShortfall; + + return $this; + } + + /** + * Gets allowProtectedEarnings + * + * @return bool|null + */ + public function getAllowProtectedEarnings(): ?bool + { + return $this->container['allowProtectedEarnings']; + } + + /** + * Sets allowProtectedEarnings + * + * @param bool|null $allowProtectedEarnings [ReadOnly] Whether or not shortfalls should be carried forward + * + * @return $this + */ + public function setAllowProtectedEarnings(?bool $allowProtectedEarnings): static + { + if (is_null($allowProtectedEarnings)) { + throw new InvalidArgumentException('non-nullable allowProtectedEarnings cannot be null'); + } + $this->container['allowProtectedEarnings'] = $allowProtectedEarnings; + + return $this; + } + + /** + * Gets autoDeduction + * + * @return bool|null + */ + public function getAutoDeduction(): ?bool + { + return $this->container['autoDeduction']; + } + + /** + * Sets autoDeduction + * + * @param bool|null $autoDeduction [readonly] Whether or not the amount to be deducted is automatically calculated + * + * @return $this + */ + public function setAutoDeduction(?bool $autoDeduction): static + { + if (is_null($autoDeduction)) { + throw new InvalidArgumentException('non-nullable autoDeduction cannot be null'); + } + $this->container['autoDeduction'] = $autoDeduction; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference which appeared on the court paperwork + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reference) && (mb_strlen($reference) > 100)) { + throw new InvalidArgumentException('invalid length for $reference when calling AttachmentOrder., must be smaller than or equal to 100.'); + } + + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets issueDate + * + * @return \DateTime|null + */ + public function getIssueDate(): ?\DateTime + { + return $this->container['issueDate']; + } + + /** + * Sets issueDate + * + * @param \DateTime|null $issueDate The date of issue for this Order + * + * @return $this + */ + public function setIssueDate(?\DateTime $issueDate): static + { + if (is_null($issueDate)) { + throw new InvalidArgumentException('non-nullable issueDate cannot be null'); + } + $this->container['issueDate'] = $issueDate; + + return $this; + } + + /** + * Gets applyFrom + * + * @return \DateTime|null + */ + public function getApplyFrom(): ?\DateTime + { + return $this->container['applyFrom']; + } + + /** + * Sets applyFrom + * + * @param \DateTime|null $applyFrom The date from which to apply this Order + * + * @return $this + */ + public function setApplyFrom(?\DateTime $applyFrom): static + { + if (is_null($applyFrom)) { + throw new InvalidArgumentException('non-nullable applyFrom cannot be null'); + } + $this->container['applyFrom'] = $applyFrom; + + return $this; + } + + /** + * Gets applyUntil + * + * @return \DateTime|null + */ + public function getApplyUntil(): ?\DateTime + { + return $this->container['applyUntil']; + } + + /** + * Sets applyUntil + * + * @param \DateTime|null $applyUntil An optional date on which to stop applying this order + * + * @return $this + */ + public function setApplyUntil(?\DateTime $applyUntil): static + { + if (is_null($applyUntil)) { + array_push($this->openAPINullablesSetToNull, 'applyUntil'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('applyUntil', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['applyUntil'] = $applyUntil; + + return $this; + } + + /** + * Gets deductionIsPercentage + * + * @return bool|null + */ + public function getDeductionIsPercentage(): ?bool + { + return $this->container['deductionIsPercentage']; + } + + /** + * Sets deductionIsPercentage + * + * @param bool|null $deductionIsPercentage Whether or not the amount given for Deduction is a percentage rather than a fixed amount + * + * @return $this + */ + public function setDeductionIsPercentage(?bool $deductionIsPercentage): static + { + if (is_null($deductionIsPercentage)) { + throw new InvalidArgumentException('non-nullable deductionIsPercentage cannot be null'); + } + $this->container['deductionIsPercentage'] = $deductionIsPercentage; + + return $this; + } + + /** + * Gets deduction + * + * @return float|null + */ + public function getDeduction(): ?float + { + return $this->container['deduction']; + } + + /** + * Sets deduction + * + * @param float|null $deduction The percentage or amount (depending on DeductionIsPercentage) to deduct + * + * @return $this + */ + public function setDeduction(?float $deduction): static + { + if (is_null($deduction)) { + throw new InvalidArgumentException('non-nullable deduction cannot be null'); + } + $this->container['deduction'] = $deduction; + + return $this; + } + + /** + * Gets protectedEarningsIsPercentage + * + * @return bool|null + */ + public function getProtectedEarningsIsPercentage(): ?bool + { + return $this->container['protectedEarningsIsPercentage']; + } + + /** + * Sets protectedEarningsIsPercentage + * + * @param bool|null $protectedEarningsIsPercentage Whether or not the amount for ProtectedEarnings is a percentage rather than a fixed amount. + * + * @return $this + */ + public function setProtectedEarningsIsPercentage(?bool $protectedEarningsIsPercentage): static + { + if (is_null($protectedEarningsIsPercentage)) { + throw new InvalidArgumentException('non-nullable protectedEarningsIsPercentage cannot be null'); + } + $this->container['protectedEarningsIsPercentage'] = $protectedEarningsIsPercentage; + + return $this; + } + + /** + * Gets protectedEarnings + * + * @return float|null + */ + public function getProtectedEarnings(): ?float + { + return $this->container['protectedEarnings']; + } + + /** + * Sets protectedEarnings + * + * @param float|null $protectedEarnings The percentage or amount or percentage (depending on ProtectedEarningsIsPercentage) to protect + * + * @return $this + */ + public function setProtectedEarnings(?float $protectedEarnings): static + { + if (is_null($protectedEarnings)) { + throw new InvalidArgumentException('non-nullable protectedEarnings cannot be null'); + } + $this->container['protectedEarnings'] = $protectedEarnings; + + return $this; + } + + /** + * Gets chargeAdminFee + * + * @return bool|null + */ + public function getChargeAdminFee(): ?bool + { + return $this->container['chargeAdminFee']; + } + + /** + * Sets chargeAdminFee + * + * @param bool|null $chargeAdminFee Whether or not a £1 admin fee should be deducted for this order + * + * @return $this + */ + public function setChargeAdminFee(?bool $chargeAdminFee): static + { + if (is_null($chargeAdminFee)) { + throw new InvalidArgumentException('non-nullable chargeAdminFee cannot be null'); + } + $this->container['chargeAdminFee'] = $chargeAdminFee; + + return $this; + } + + /** + * Gets shortfall + * + * @return float|null + */ + public function getShortfall(): ?float + { + return $this->container['shortfall']; + } + + /** + * Sets shortfall + * + * @param float|null $shortfall Any shortfall that is being carried forward + * + * @return $this + */ + public function setShortfall(?float $shortfall): static + { + if (is_null($shortfall)) { + throw new InvalidArgumentException('non-nullable shortfall cannot be null'); + } + $this->container['shortfall'] = $shortfall; + + return $this; + } + + /** + * Gets stopWhenTotalPaid + * + * @return bool|null + */ + public function getStopWhenTotalPaid(): ?bool + { + return $this->container['stopWhenTotalPaid']; + } + + /** + * Sets stopWhenTotalPaid + * + * @param bool|null $stopWhenTotalPaid Whether or not this order should be stopped once a total amount has been paid + * + * @return $this + */ + public function setStopWhenTotalPaid(?bool $stopWhenTotalPaid): static + { + if (is_null($stopWhenTotalPaid)) { + throw new InvalidArgumentException('non-nullable stopWhenTotalPaid cannot be null'); + } + $this->container['stopWhenTotalPaid'] = $stopWhenTotalPaid; + + return $this; + } + + /** + * Gets totalAmountToPay + * + * @return float|null + */ + public function getTotalAmountToPay(): ?float + { + return $this->container['totalAmountToPay']; + } + + /** + * Sets totalAmountToPay + * + * @param float|null $totalAmountToPay The Total amount that needs to be paid for this Order + * + * @return $this + */ + public function setTotalAmountToPay(?float $totalAmountToPay): static + { + if (is_null($totalAmountToPay)) { + throw new InvalidArgumentException('non-nullable totalAmountToPay cannot be null'); + } + $this->container['totalAmountToPay'] = $totalAmountToPay; + + return $this; + } + + /** + * Gets amountPreviouslyPaid + * + * @return float|null + */ + public function getAmountPreviouslyPaid(): ?float + { + return $this->container['amountPreviouslyPaid']; + } + + /** + * Sets amountPreviouslyPaid + * + * @param float|null $amountPreviouslyPaid Any amount that has previously been paid towards this Order + * + * @return $this + */ + public function setAmountPreviouslyPaid(?float $amountPreviouslyPaid): static + { + if (is_null($amountPreviouslyPaid)) { + throw new InvalidArgumentException('non-nullable amountPreviouslyPaid cannot be null'); + } + $this->container['amountPreviouslyPaid'] = $amountPreviouslyPaid; + + return $this; + } + + /** + * Gets stopped + * + * @return bool|null + */ + public function getStopped(): ?bool + { + return $this->container['stopped']; + } + + /** + * Sets stopped + * + * @param bool|null $stopped [readonly] Whether or not this Order has been stopped. This is set automatically when either it's paid in full or the ApplyUntil date has been reached. + * + * @return $this + */ + public function setStopped(?bool $stopped): static + { + if (is_null($stopped)) { + throw new InvalidArgumentException('non-nullable stopped cannot be null'); + } + $this->container['stopped'] = $stopped; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes(): ?string + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes A free-form text field to record any comments + * + * @return $this + */ + public function setNotes(?string $notes): static + { + if (is_null($notes)) { + array_push($this->openAPINullablesSetToNull, 'notes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('notes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($notes) && (mb_strlen($notes) > 300)) { + throw new InvalidArgumentException('invalid length for $notes when calling AttachmentOrder., must be smaller than or equal to 300.'); + } + + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets includeBankDetails + * + * @return bool|null + */ + public function getIncludeBankDetails(): ?bool + { + return $this->container['includeBankDetails']; + } + + /** + * Sets includeBankDetails + * + * @param bool|null $includeBankDetails includeBankDetails + * + * @return $this + */ + public function setIncludeBankDetails(?bool $includeBankDetails): static + { + if (is_null($includeBankDetails)) { + throw new InvalidArgumentException('non-nullable includeBankDetails cannot be null'); + } + $this->container['includeBankDetails'] = $includeBankDetails; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets payments + * + * @return \SynergiTech\Staffology\Model\AttachmentOrderPayment[]|null + */ + public function getPayments(): ?array + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param \SynergiTech\Staffology\Model\AttachmentOrderPayment[]|null $payments [readonly] Payments made towards this order. Only populated when viewed as a report. + * + * @return $this + */ + public function setPayments(?array $payments): static + { + if (is_null($payments)) { + array_push($this->openAPINullablesSetToNull, 'payments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets payee + * + * @return string|null + */ + public function getPayee(): ?string + { + return $this->container['payee']; + } + + /** + * Sets payee + * + * @param string|null $payee The Id of the Payee, if any, that deductions are to be paid to. + * + * @return $this + */ + public function setPayee(?string $payee): static + { + if (is_null($payee)) { + array_push($this->openAPINullablesSetToNull, 'payee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payee'] = $payee; + + return $this; + } + + /** + * Gets payeeName + * + * @return string|null + */ + public function getPayeeName(): ?string + { + return $this->container['payeeName']; + } + + /** + * Sets payeeName + * + * @param string|null $payeeName The name of the Payee, if any, that deductions are to be paid to. + * + * @return $this + */ + public function setPayeeName(?string $payeeName): static + { + if (is_null($payeeName)) { + array_push($this->openAPINullablesSetToNull, 'payeeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payeeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payeeName'] = $payeeName; + + return $this; + } + + /** + * Gets documentCount + * + * @return int|null + */ + public function getDocumentCount(): ?int + { + return $this->container['documentCount']; + } + + /** + * Sets documentCount + * + * @param int|null $documentCount [readonly] The number of attachments associated with this model + * + * @return $this + */ + public function setDocumentCount(?int $documentCount): static + { + if (is_null($documentCount)) { + throw new InvalidArgumentException('non-nullable documentCount cannot be null'); + } + $this->container['documentCount'] = $documentCount; + + return $this; + } + + /** + * Gets documents + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getDocuments(): ?array + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \SynergiTech\Staffology\Model\Item[]|null $documents [readonly] The attachments associated with this model + * + * @return $this + */ + public function setDocuments(?array $documents): static + { + if (is_null($documents)) { + array_push($this->openAPINullablesSetToNull, 'documents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AttachmentOrderPayment.php b/src/Model/AttachmentOrderPayment.php new file mode 100644 index 0000000..21b09de --- /dev/null +++ b/src/Model/AttachmentOrderPayment.php @@ -0,0 +1,926 @@ + + */ +class AttachmentOrderPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AttachmentOrderPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'attachmentOrder' => '\SynergiTech\Staffology\Model\Item', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'date' => '\DateTime', + 'description' => 'string', + 'attachablePay' => 'float', + 'protectedPay' => 'float', + 'otherAttachmentOrderDeductions' => 'float', + 'desiredDeduction' => 'float', + 'shortfall' => 'float', + 'totalPaid' => 'float', + 'resultingDeduction' => 'float', + 'resultingShortfall' => 'float', + 'adminFee' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'attachmentOrder' => null, + 'taxYear' => null, + 'payPeriod' => null, + 'date' => 'date', + 'description' => null, + 'attachablePay' => 'double', + 'protectedPay' => 'double', + 'otherAttachmentOrderDeductions' => 'double', + 'desiredDeduction' => 'double', + 'shortfall' => 'double', + 'totalPaid' => 'double', + 'resultingDeduction' => 'double', + 'resultingShortfall' => 'double', + 'adminFee' => 'double', + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'attachmentOrder' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'date' => false, + 'description' => true, + 'attachablePay' => false, + 'protectedPay' => false, + 'otherAttachmentOrderDeductions' => false, + 'desiredDeduction' => false, + 'shortfall' => false, + 'totalPaid' => false, + 'resultingDeduction' => false, + 'resultingShortfall' => false, + 'adminFee' => false, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'attachmentOrder' => 'attachmentOrder', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'date' => 'date', + 'description' => 'description', + 'attachablePay' => 'attachablePay', + 'protectedPay' => 'protectedPay', + 'otherAttachmentOrderDeductions' => 'otherAttachmentOrderDeductions', + 'desiredDeduction' => 'desiredDeduction', + 'shortfall' => 'shortfall', + 'totalPaid' => 'totalPaid', + 'resultingDeduction' => 'resultingDeduction', + 'resultingShortfall' => 'resultingShortfall', + 'adminFee' => 'adminFee', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'attachmentOrder' => 'setAttachmentOrder', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'date' => 'setDate', + 'description' => 'setDescription', + 'attachablePay' => 'setAttachablePay', + 'protectedPay' => 'setProtectedPay', + 'otherAttachmentOrderDeductions' => 'setOtherAttachmentOrderDeductions', + 'desiredDeduction' => 'setDesiredDeduction', + 'shortfall' => 'setShortfall', + 'totalPaid' => 'setTotalPaid', + 'resultingDeduction' => 'setResultingDeduction', + 'resultingShortfall' => 'setResultingShortfall', + 'adminFee' => 'setAdminFee', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'attachmentOrder' => 'getAttachmentOrder', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'date' => 'getDate', + 'description' => 'getDescription', + 'attachablePay' => 'getAttachablePay', + 'protectedPay' => 'getProtectedPay', + 'otherAttachmentOrderDeductions' => 'getOtherAttachmentOrderDeductions', + 'desiredDeduction' => 'getDesiredDeduction', + 'shortfall' => 'getShortfall', + 'totalPaid' => 'getTotalPaid', + 'resultingDeduction' => 'getResultingDeduction', + 'resultingShortfall' => 'getResultingShortfall', + 'adminFee' => 'getAdminFee', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('attachmentOrder', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('attachablePay', $data ?? [], null); + $this->setIfExists('protectedPay', $data ?? [], null); + $this->setIfExists('otherAttachmentOrderDeductions', $data ?? [], null); + $this->setIfExists('desiredDeduction', $data ?? [], null); + $this->setIfExists('shortfall', $data ?? [], null); + $this->setIfExists('totalPaid', $data ?? [], null); + $this->setIfExists('resultingDeduction', $data ?? [], null); + $this->setIfExists('resultingShortfall', $data ?? [], null); + $this->setIfExists('adminFee', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets attachmentOrder + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getAttachmentOrder(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['attachmentOrder']; + } + + /** + * Sets attachmentOrder + * + * @param \SynergiTech\Staffology\Model\Item|null $attachmentOrder attachmentOrder + * + * @return $this + */ + public function setAttachmentOrder(?\SynergiTech\Staffology\Model\Item $attachmentOrder): static + { + if (is_null($attachmentOrder)) { + throw new InvalidArgumentException('non-nullable attachmentOrder cannot be null'); + } + $this->container['attachmentOrder'] = $attachmentOrder; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] The date this deduction was made + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description [readonly] Description of deduction, usually the reference from the AttachmentOrder + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets attachablePay + * + * @return float|null + */ + public function getAttachablePay(): ?float + { + return $this->container['attachablePay']; + } + + /** + * Sets attachablePay + * + * @param float|null $attachablePay [readonly] The total Attachable pay for the Employee on this PayRun + * + * @return $this + */ + public function setAttachablePay(?float $attachablePay): static + { + if (is_null($attachablePay)) { + throw new InvalidArgumentException('non-nullable attachablePay cannot be null'); + } + $this->container['attachablePay'] = $attachablePay; + + return $this; + } + + /** + * Gets protectedPay + * + * @return float|null + */ + public function getProtectedPay(): ?float + { + return $this->container['protectedPay']; + } + + /** + * Sets protectedPay + * + * @param float|null $protectedPay [readonly] The amount of the Attachable Pay that must be protected + * + * @return $this + */ + public function setProtectedPay(?float $protectedPay): static + { + if (is_null($protectedPay)) { + throw new InvalidArgumentException('non-nullable protectedPay cannot be null'); + } + $this->container['protectedPay'] = $protectedPay; + + return $this; + } + + /** + * Gets otherAttachmentOrderDeductions + * + * @return float|null + */ + public function getOtherAttachmentOrderDeductions(): ?float + { + return $this->container['otherAttachmentOrderDeductions']; + } + + /** + * Sets otherAttachmentOrderDeductions + * + * @param float|null $otherAttachmentOrderDeductions [readonly] Deductions made on this PayRun for this employee due to other higher priority AttachmentOrders + * + * @return $this + */ + public function setOtherAttachmentOrderDeductions(?float $otherAttachmentOrderDeductions): static + { + if (is_null($otherAttachmentOrderDeductions)) { + throw new InvalidArgumentException('non-nullable otherAttachmentOrderDeductions cannot be null'); + } + $this->container['otherAttachmentOrderDeductions'] = $otherAttachmentOrderDeductions; + + return $this; + } + + /** + * Gets desiredDeduction + * + * @return float|null + */ + public function getDesiredDeduction(): ?float + { + return $this->container['desiredDeduction']; + } + + /** + * Sets desiredDeduction + * + * @param float|null $desiredDeduction [readonly] The amount that should be deducted, if arrestable pay is available. Not including any shortfall + * + * @return $this + */ + public function setDesiredDeduction(?float $desiredDeduction): static + { + if (is_null($desiredDeduction)) { + throw new InvalidArgumentException('non-nullable desiredDeduction cannot be null'); + } + $this->container['desiredDeduction'] = $desiredDeduction; + + return $this; + } + + /** + * Gets shortfall + * + * @return float|null + */ + public function getShortfall(): ?float + { + return $this->container['shortfall']; + } + + /** + * Sets shortfall + * + * @param float|null $shortfall [readonly] Any shortfall (ie arrears) that existed before this PayRun. + * + * @return $this + */ + public function setShortfall(?float $shortfall): static + { + if (is_null($shortfall)) { + throw new InvalidArgumentException('non-nullable shortfall cannot be null'); + } + $this->container['shortfall'] = $shortfall; + + return $this; + } + + /** + * Gets totalPaid + * + * @return float|null + */ + public function getTotalPaid(): ?float + { + return $this->container['totalPaid']; + } + + /** + * Sets totalPaid + * + * @param float|null $totalPaid [readonly] Total amount paid to date, including this deduction. + * + * @return $this + */ + public function setTotalPaid(?float $totalPaid): static + { + if (is_null($totalPaid)) { + throw new InvalidArgumentException('non-nullable totalPaid cannot be null'); + } + $this->container['totalPaid'] = $totalPaid; + + return $this; + } + + /** + * Gets resultingDeduction + * + * @return float|null + */ + public function getResultingDeduction(): ?float + { + return $this->container['resultingDeduction']; + } + + /** + * Sets resultingDeduction + * + * @param float|null $resultingDeduction [readonly] The actual amount deducted + * + * @return $this + */ + public function setResultingDeduction(?float $resultingDeduction): static + { + if (is_null($resultingDeduction)) { + throw new InvalidArgumentException('non-nullable resultingDeduction cannot be null'); + } + $this->container['resultingDeduction'] = $resultingDeduction; + + return $this; + } + + /** + * Gets resultingShortfall + * + * @return float|null + */ + public function getResultingShortfall(): ?float + { + return $this->container['resultingShortfall']; + } + + /** + * Sets resultingShortfall + * + * @param float|null $resultingShortfall [readonly] The resulting shortfall (including any shortfall from previous periods + * + * @return $this + */ + public function setResultingShortfall(?float $resultingShortfall): static + { + if (is_null($resultingShortfall)) { + throw new InvalidArgumentException('non-nullable resultingShortfall cannot be null'); + } + $this->container['resultingShortfall'] = $resultingShortfall; + + return $this; + } + + /** + * Gets adminFee + * + * @return float|null + */ + public function getAdminFee(): ?float + { + return $this->container['adminFee']; + } + + /** + * Sets adminFee + * + * @param float|null $adminFee [readonly] Any admin fee charged + * + * @return $this + */ + public function setAdminFee(?float $adminFee): static + { + if (is_null($adminFee)) { + throw new InvalidArgumentException('non-nullable adminFee cannot be null'); + } + $this->container['adminFee'] = $adminFee; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AttachmentOrderReportResponse.php b/src/Model/AttachmentOrderReportResponse.php new file mode 100644 index 0000000..0d3449b --- /dev/null +++ b/src/Model/AttachmentOrderReportResponse.php @@ -0,0 +1,532 @@ + + */ +class AttachmentOrderReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AttachmentOrderReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\AttachmentOrder', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\AttachmentOrder|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\AttachmentOrder + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\AttachmentOrder|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\AttachmentOrder $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AttachmentOrderType.php b/src/Model/AttachmentOrderType.php new file mode 100644 index 0000000..8cc33e1 --- /dev/null +++ b/src/Model/AttachmentOrderType.php @@ -0,0 +1,81 @@ + + */ +class AttachmentOrdersReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AttachmentOrdersReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AttachmentOrdersReportReportResponse.php b/src/Model/AttachmentOrdersReportReportResponse.php new file mode 100644 index 0000000..468dbf3 --- /dev/null +++ b/src/Model/AttachmentOrdersReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class AttachmentOrdersReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AttachmentOrdersReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\AttachmentOrdersReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\AttachmentOrdersReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\AttachmentOrdersReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\AttachmentOrdersReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\AttachmentOrdersReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AuditEventAction.php b/src/Model/AuditEventAction.php new file mode 100644 index 0000000..f78da59 --- /dev/null +++ b/src/Model/AuditEventAction.php @@ -0,0 +1,47 @@ + + */ +class AutoEnrolment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AutoEnrolment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'state' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'stateDate' => '\DateTime', + 'ukWorker' => '\SynergiTech\Staffology\Model\AeUKWorker', + 'daysToDeferAssessment' => 'int', + 'postponementDate' => '\DateTime', + 'deferByMonthsNotDays' => 'bool', + 'exempt' => 'bool', + 'aeExclusionCode' => '\SynergiTech\Staffology\Model\AeExclusionCode', + 'aePostponementLetterSent' => 'bool', + 'lastAssessment' => '\SynergiTech\Staffology\Model\AeAssessment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'state' => null, + 'stateDate' => 'date', + 'ukWorker' => null, + 'daysToDeferAssessment' => 'int32', + 'postponementDate' => 'date', + 'deferByMonthsNotDays' => null, + 'exempt' => null, + 'aeExclusionCode' => null, + 'aePostponementLetterSent' => null, + 'lastAssessment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'state' => false, + 'stateDate' => true, + 'ukWorker' => false, + 'daysToDeferAssessment' => false, + 'postponementDate' => true, + 'deferByMonthsNotDays' => false, + 'exempt' => false, + 'aeExclusionCode' => false, + 'aePostponementLetterSent' => false, + 'lastAssessment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'state' => 'state', + 'stateDate' => 'stateDate', + 'ukWorker' => 'ukWorker', + 'daysToDeferAssessment' => 'daysToDeferAssessment', + 'postponementDate' => 'postponementDate', + 'deferByMonthsNotDays' => 'deferByMonthsNotDays', + 'exempt' => 'exempt', + 'aeExclusionCode' => 'aeExclusionCode', + 'aePostponementLetterSent' => 'aePostponementLetterSent', + 'lastAssessment' => 'lastAssessment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'state' => 'setState', + 'stateDate' => 'setStateDate', + 'ukWorker' => 'setUkWorker', + 'daysToDeferAssessment' => 'setDaysToDeferAssessment', + 'postponementDate' => 'setPostponementDate', + 'deferByMonthsNotDays' => 'setDeferByMonthsNotDays', + 'exempt' => 'setExempt', + 'aeExclusionCode' => 'setAeExclusionCode', + 'aePostponementLetterSent' => 'setAePostponementLetterSent', + 'lastAssessment' => 'setLastAssessment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'state' => 'getState', + 'stateDate' => 'getStateDate', + 'ukWorker' => 'getUkWorker', + 'daysToDeferAssessment' => 'getDaysToDeferAssessment', + 'postponementDate' => 'getPostponementDate', + 'deferByMonthsNotDays' => 'getDeferByMonthsNotDays', + 'exempt' => 'getExempt', + 'aeExclusionCode' => 'getAeExclusionCode', + 'aePostponementLetterSent' => 'getAePostponementLetterSent', + 'lastAssessment' => 'getLastAssessment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('stateDate', $data ?? [], null); + $this->setIfExists('ukWorker', $data ?? [], null); + $this->setIfExists('daysToDeferAssessment', $data ?? [], null); + $this->setIfExists('postponementDate', $data ?? [], null); + $this->setIfExists('deferByMonthsNotDays', $data ?? [], null); + $this->setIfExists('exempt', $data ?? [], null); + $this->setIfExists('aeExclusionCode', $data ?? [], null); + $this->setIfExists('aePostponementLetterSent', $data ?? [], null); + $this->setIfExists('lastAssessment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\AeEmployeeState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets stateDate + * + * @return \DateTime|null + */ + public function getStateDate(): ?\DateTime + { + return $this->container['stateDate']; + } + + /** + * Sets stateDate + * + * @param \DateTime|null $stateDate [readonly] + * + * @return $this + */ + public function setStateDate(?\DateTime $stateDate): static + { + if (is_null($stateDate)) { + array_push($this->openAPINullablesSetToNull, 'stateDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stateDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stateDate'] = $stateDate; + + return $this; + } + + /** + * Gets ukWorker + * + * @return \SynergiTech\Staffology\Model\AeUKWorker|null + */ + public function getUkWorker(): ?\SynergiTech\Staffology\Model\AeUKWorker + { + return $this->container['ukWorker']; + } + + /** + * Sets ukWorker + * + * @param \SynergiTech\Staffology\Model\AeUKWorker|null $ukWorker ukWorker + * + * @return $this + */ + public function setUkWorker(?\SynergiTech\Staffology\Model\AeUKWorker $ukWorker): static + { + if (is_null($ukWorker)) { + throw new InvalidArgumentException('non-nullable ukWorker cannot be null'); + } + $this->container['ukWorker'] = $ukWorker; + + return $this; + } + + /** + * Gets daysToDeferAssessment + * + * @return int|null + */ + public function getDaysToDeferAssessment(): ?int + { + return $this->container['daysToDeferAssessment']; + } + + /** + * Sets daysToDeferAssessment + * + * @param int|null $daysToDeferAssessment The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. + * + * @return $this + */ + public function setDaysToDeferAssessment(?int $daysToDeferAssessment): static + { + if (is_null($daysToDeferAssessment)) { + throw new InvalidArgumentException('non-nullable daysToDeferAssessment cannot be null'); + } + $this->container['daysToDeferAssessment'] = $daysToDeferAssessment; + + return $this; + } + + /** + * Gets postponementDate + * + * @return \DateTime|null + */ + public function getPostponementDate(): ?\DateTime + { + return $this->container['postponementDate']; + } + + /** + * Sets postponementDate + * + * @param \DateTime|null $postponementDate [readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date. This is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null This is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not. + * + * @return $this + */ + public function setPostponementDate(?\DateTime $postponementDate): static + { + if (is_null($postponementDate)) { + array_push($this->openAPINullablesSetToNull, 'postponementDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postponementDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postponementDate'] = $postponementDate; + + return $this; + } + + /** + * Gets deferByMonthsNotDays + * + * @return bool|null + */ + public function getDeferByMonthsNotDays(): ?bool + { + return $this->container['deferByMonthsNotDays']; + } + + /** + * Sets deferByMonthsNotDays + * + * @param bool|null $deferByMonthsNotDays If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days + * + * @return $this + */ + public function setDeferByMonthsNotDays(?bool $deferByMonthsNotDays): static + { + if (is_null($deferByMonthsNotDays)) { + throw new InvalidArgumentException('non-nullable deferByMonthsNotDays cannot be null'); + } + $this->container['deferByMonthsNotDays'] = $deferByMonthsNotDays; + + return $this; + } + + /** + * Gets exempt + * + * @return bool|null + */ + public function getExempt(): ?bool + { + return $this->container['exempt']; + } + + /** + * Sets exempt + * + * @param bool|null $exempt exempt + * + * @return $this + */ + public function setExempt(?bool $exempt): static + { + if (is_null($exempt)) { + throw new InvalidArgumentException('non-nullable exempt cannot be null'); + } + $this->container['exempt'] = $exempt; + + return $this; + } + + /** + * Gets aeExclusionCode + * + * @return \SynergiTech\Staffology\Model\AeExclusionCode|null + */ + public function getAeExclusionCode(): ?\SynergiTech\Staffology\Model\AeExclusionCode + { + return $this->container['aeExclusionCode']; + } + + /** + * Sets aeExclusionCode + * + * @param \SynergiTech\Staffology\Model\AeExclusionCode|null $aeExclusionCode aeExclusionCode + * + * @return $this + */ + public function setAeExclusionCode(?\SynergiTech\Staffology\Model\AeExclusionCode $aeExclusionCode): static + { + if (is_null($aeExclusionCode)) { + throw new InvalidArgumentException('non-nullable aeExclusionCode cannot be null'); + } + $this->container['aeExclusionCode'] = $aeExclusionCode; + + return $this; + } + + /** + * Gets aePostponementLetterSent + * + * @return bool|null + */ + public function getAePostponementLetterSent(): ?bool + { + return $this->container['aePostponementLetterSent']; + } + + /** + * Sets aePostponementLetterSent + * + * @param bool|null $aePostponementLetterSent aePostponementLetterSent + * + * @return $this + */ + public function setAePostponementLetterSent(?bool $aePostponementLetterSent): static + { + if (is_null($aePostponementLetterSent)) { + throw new InvalidArgumentException('non-nullable aePostponementLetterSent cannot be null'); + } + $this->container['aePostponementLetterSent'] = $aePostponementLetterSent; + + return $this; + } + + /** + * Gets lastAssessment + * + * @return \SynergiTech\Staffology\Model\AeAssessment|null + */ + public function getLastAssessment(): ?\SynergiTech\Staffology\Model\AeAssessment + { + return $this->container['lastAssessment']; + } + + /** + * Sets lastAssessment + * + * @param \SynergiTech\Staffology\Model\AeAssessment|null $lastAssessment lastAssessment + * + * @return $this + */ + public function setLastAssessment(?\SynergiTech\Staffology\Model\AeAssessment $lastAssessment): static + { + if (is_null($lastAssessment)) { + throw new InvalidArgumentException('non-nullable lastAssessment cannot be null'); + } + $this->container['lastAssessment'] = $lastAssessment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AutoEnrolmentSettings.php b/src/Model/AutoEnrolmentSettings.php new file mode 100644 index 0000000..e3592af --- /dev/null +++ b/src/Model/AutoEnrolmentSettings.php @@ -0,0 +1,762 @@ + + */ +class AutoEnrolmentSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AutoEnrolmentSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'stagingDate' => '\DateTime', + 'cyclicalReenrolmentDate' => '\DateTime', + 'previousCyclicalReenrolmentDate' => '\DateTime', + 'defaultPension' => '\SynergiTech\Staffology\Model\PensionSelection', + 'pensionSameAsDefault' => 'bool', + 'daysToDeferAssessment' => 'int', + 'deferByMonthsNotDays' => 'bool', + 'deferEnrolmentBy' => 'int', + 'deferEnrolmentByPeriodType' => '\SynergiTech\Staffology\Model\DeferalPeriodType', + 'includeNonPensionedEmployeesInSubmission' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'stagingDate' => 'date', + 'cyclicalReenrolmentDate' => 'date', + 'previousCyclicalReenrolmentDate' => 'date', + 'defaultPension' => null, + 'pensionSameAsDefault' => null, + 'daysToDeferAssessment' => 'int32', + 'deferByMonthsNotDays' => null, + 'deferEnrolmentBy' => 'int32', + 'deferEnrolmentByPeriodType' => null, + 'includeNonPensionedEmployeesInSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'stagingDate' => false, + 'cyclicalReenrolmentDate' => true, + 'previousCyclicalReenrolmentDate' => true, + 'defaultPension' => false, + 'pensionSameAsDefault' => false, + 'daysToDeferAssessment' => false, + 'deferByMonthsNotDays' => false, + 'deferEnrolmentBy' => false, + 'deferEnrolmentByPeriodType' => false, + 'includeNonPensionedEmployeesInSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'stagingDate' => 'stagingDate', + 'cyclicalReenrolmentDate' => 'cyclicalReenrolmentDate', + 'previousCyclicalReenrolmentDate' => 'previousCyclicalReenrolmentDate', + 'defaultPension' => 'defaultPension', + 'pensionSameAsDefault' => 'pensionSameAsDefault', + 'daysToDeferAssessment' => 'daysToDeferAssessment', + 'deferByMonthsNotDays' => 'deferByMonthsNotDays', + 'deferEnrolmentBy' => 'deferEnrolmentBy', + 'deferEnrolmentByPeriodType' => 'deferEnrolmentByPeriodType', + 'includeNonPensionedEmployeesInSubmission' => 'includeNonPensionedEmployeesInSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'stagingDate' => 'setStagingDate', + 'cyclicalReenrolmentDate' => 'setCyclicalReenrolmentDate', + 'previousCyclicalReenrolmentDate' => 'setPreviousCyclicalReenrolmentDate', + 'defaultPension' => 'setDefaultPension', + 'pensionSameAsDefault' => 'setPensionSameAsDefault', + 'daysToDeferAssessment' => 'setDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'setDeferByMonthsNotDays', + 'deferEnrolmentBy' => 'setDeferEnrolmentBy', + 'deferEnrolmentByPeriodType' => 'setDeferEnrolmentByPeriodType', + 'includeNonPensionedEmployeesInSubmission' => 'setIncludeNonPensionedEmployeesInSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'stagingDate' => 'getStagingDate', + 'cyclicalReenrolmentDate' => 'getCyclicalReenrolmentDate', + 'previousCyclicalReenrolmentDate' => 'getPreviousCyclicalReenrolmentDate', + 'defaultPension' => 'getDefaultPension', + 'pensionSameAsDefault' => 'getPensionSameAsDefault', + 'daysToDeferAssessment' => 'getDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'getDeferByMonthsNotDays', + 'deferEnrolmentBy' => 'getDeferEnrolmentBy', + 'deferEnrolmentByPeriodType' => 'getDeferEnrolmentByPeriodType', + 'includeNonPensionedEmployeesInSubmission' => 'getIncludeNonPensionedEmployeesInSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('stagingDate', $data ?? [], null); + $this->setIfExists('cyclicalReenrolmentDate', $data ?? [], null); + $this->setIfExists('previousCyclicalReenrolmentDate', $data ?? [], null); + $this->setIfExists('defaultPension', $data ?? [], null); + $this->setIfExists('pensionSameAsDefault', $data ?? [], null); + $this->setIfExists('daysToDeferAssessment', $data ?? [], null); + $this->setIfExists('deferByMonthsNotDays', $data ?? [], null); + $this->setIfExists('deferEnrolmentBy', $data ?? [], null); + $this->setIfExists('deferEnrolmentByPeriodType', $data ?? [], null); + $this->setIfExists('includeNonPensionedEmployeesInSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stagingDate + * + * @return \DateTime|null + */ + public function getStagingDate(): ?\DateTime + { + return $this->container['stagingDate']; + } + + /** + * Sets stagingDate + * + * @param \DateTime|null $stagingDate stagingDate + * + * @return $this + */ + public function setStagingDate(?\DateTime $stagingDate): static + { + if (is_null($stagingDate)) { + throw new InvalidArgumentException('non-nullable stagingDate cannot be null'); + } + $this->container['stagingDate'] = $stagingDate; + + return $this; + } + + /** + * Gets cyclicalReenrolmentDate + * + * @return \DateTime|null + */ + public function getCyclicalReenrolmentDate(): ?\DateTime + { + return $this->container['cyclicalReenrolmentDate']; + } + + /** + * Sets cyclicalReenrolmentDate + * + * @param \DateTime|null $cyclicalReenrolmentDate cyclicalReenrolmentDate + * + * @return $this + */ + public function setCyclicalReenrolmentDate(?\DateTime $cyclicalReenrolmentDate): static + { + if (is_null($cyclicalReenrolmentDate)) { + array_push($this->openAPINullablesSetToNull, 'cyclicalReenrolmentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cyclicalReenrolmentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cyclicalReenrolmentDate'] = $cyclicalReenrolmentDate; + + return $this; + } + + /** + * Gets previousCyclicalReenrolmentDate + * + * @return \DateTime|null + */ + public function getPreviousCyclicalReenrolmentDate(): ?\DateTime + { + return $this->container['previousCyclicalReenrolmentDate']; + } + + /** + * Sets previousCyclicalReenrolmentDate + * + * @param \DateTime|null $previousCyclicalReenrolmentDate previousCyclicalReenrolmentDate + * + * @return $this + */ + public function setPreviousCyclicalReenrolmentDate(?\DateTime $previousCyclicalReenrolmentDate): static + { + if (is_null($previousCyclicalReenrolmentDate)) { + array_push($this->openAPINullablesSetToNull, 'previousCyclicalReenrolmentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousCyclicalReenrolmentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['previousCyclicalReenrolmentDate'] = $previousCyclicalReenrolmentDate; + + return $this; + } + + /** + * Gets defaultPension + * + * @return \SynergiTech\Staffology\Model\PensionSelection|null + */ + public function getDefaultPension(): ?\SynergiTech\Staffology\Model\PensionSelection + { + return $this->container['defaultPension']; + } + + /** + * Sets defaultPension + * + * @param \SynergiTech\Staffology\Model\PensionSelection|null $defaultPension defaultPension + * + * @return $this + */ + public function setDefaultPension(?\SynergiTech\Staffology\Model\PensionSelection $defaultPension): static + { + if (is_null($defaultPension)) { + throw new InvalidArgumentException('non-nullable defaultPension cannot be null'); + } + $this->container['defaultPension'] = $defaultPension; + + return $this; + } + + /** + * Gets pensionSameAsDefault + * + * @return bool|null + */ + public function getPensionSameAsDefault(): ?bool + { + return $this->container['pensionSameAsDefault']; + } + + /** + * Sets pensionSameAsDefault + * + * @param bool|null $pensionSameAsDefault pensionSameAsDefault + * + * @return $this + */ + public function setPensionSameAsDefault(?bool $pensionSameAsDefault): static + { + if (is_null($pensionSameAsDefault)) { + throw new InvalidArgumentException('non-nullable pensionSameAsDefault cannot be null'); + } + $this->container['pensionSameAsDefault'] = $pensionSameAsDefault; + + return $this; + } + + /** + * Gets daysToDeferAssessment + * + * @return int|null + */ + public function getDaysToDeferAssessment(): ?int + { + return $this->container['daysToDeferAssessment']; + } + + /** + * Sets daysToDeferAssessment + * + * @param int|null $daysToDeferAssessment The number of days, if any, to defer assessment of new employees. You're allowed to defer assessment of new employees by up to 3 months. This is the default value used when you create a new employee. It can be changed on a per-employee basis. + * + * @return $this + */ + public function setDaysToDeferAssessment(?int $daysToDeferAssessment): static + { + if (is_null($daysToDeferAssessment)) { + throw new InvalidArgumentException('non-nullable daysToDeferAssessment cannot be null'); + } + $this->container['daysToDeferAssessment'] = $daysToDeferAssessment; + + return $this; + } + + /** + * Gets deferByMonthsNotDays + * + * @return bool|null + */ + public function getDeferByMonthsNotDays(): ?bool + { + return $this->container['deferByMonthsNotDays']; + } + + /** + * Sets deferByMonthsNotDays + * + * @param bool|null $deferByMonthsNotDays If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days + * + * @return $this + */ + public function setDeferByMonthsNotDays(?bool $deferByMonthsNotDays): static + { + if (is_null($deferByMonthsNotDays)) { + throw new InvalidArgumentException('non-nullable deferByMonthsNotDays cannot be null'); + } + $this->container['deferByMonthsNotDays'] = $deferByMonthsNotDays; + + return $this; + } + + /** + * Gets deferEnrolmentBy + * + * @return int|null + */ + public function getDeferEnrolmentBy(): ?int + { + return $this->container['deferEnrolmentBy']; + } + + /** + * Sets deferEnrolmentBy + * + * @param int|null $deferEnrolmentBy The number of days )or weeks, or months), if any, to defer enrolment of employees that are Eligible Jobholders. For example, if this is set to 30 days then if an employee meets the criteria for enrolment then they'll only be enrolled if they still meet the criteria 30 days later + * + * @return $this + */ + public function setDeferEnrolmentBy(?int $deferEnrolmentBy): static + { + if (is_null($deferEnrolmentBy)) { + throw new InvalidArgumentException('non-nullable deferEnrolmentBy cannot be null'); + } + $this->container['deferEnrolmentBy'] = $deferEnrolmentBy; + + return $this; + } + + /** + * Gets deferEnrolmentByPeriodType + * + * @return \SynergiTech\Staffology\Model\DeferalPeriodType|null + */ + public function getDeferEnrolmentByPeriodType(): ?\SynergiTech\Staffology\Model\DeferalPeriodType + { + return $this->container['deferEnrolmentByPeriodType']; + } + + /** + * Sets deferEnrolmentByPeriodType + * + * @param \SynergiTech\Staffology\Model\DeferalPeriodType|null $deferEnrolmentByPeriodType deferEnrolmentByPeriodType + * + * @return $this + */ + public function setDeferEnrolmentByPeriodType(?\SynergiTech\Staffology\Model\DeferalPeriodType $deferEnrolmentByPeriodType): static + { + if (is_null($deferEnrolmentByPeriodType)) { + throw new InvalidArgumentException('non-nullable deferEnrolmentByPeriodType cannot be null'); + } + $this->container['deferEnrolmentByPeriodType'] = $deferEnrolmentByPeriodType; + + return $this; + } + + /** + * Gets includeNonPensionedEmployeesInSubmission + * + * @return bool|null + */ + public function getIncludeNonPensionedEmployeesInSubmission(): ?bool + { + return $this->container['includeNonPensionedEmployeesInSubmission']; + } + + /** + * Sets includeNonPensionedEmployeesInSubmission + * + * @param bool|null $includeNonPensionedEmployeesInSubmission Whether or not to include details of non-pensioned employees in your submissions to this provider + * + * @return $this + */ + public function setIncludeNonPensionedEmployeesInSubmission(?bool $includeNonPensionedEmployeesInSubmission): static + { + if (is_null($includeNonPensionedEmployeesInSubmission)) { + throw new InvalidArgumentException('non-nullable includeNonPensionedEmployeesInSubmission cannot be null'); + } + $this->container['includeNonPensionedEmployeesInSubmission'] = $includeNonPensionedEmployeesInSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AutoPilotFinaliseTime.php b/src/Model/AutoPilotFinaliseTime.php new file mode 100644 index 0000000..4b81beb --- /dev/null +++ b/src/Model/AutoPilotFinaliseTime.php @@ -0,0 +1,53 @@ + + */ +class AutomationSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AutomationSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'enableAutoPilot' => 'bool', + 'autoPilotTime' => '\SynergiTech\Staffology\Model\AutoPilotFinaliseTime', + 'autoPilotOffset' => 'int', + 'enableAutoOpen' => 'bool', + 'autoSubmitFps' => 'bool', + 'autoSubmitPayments' => 'bool', + 'autoSubmitJournal' => 'bool', + 'autoSubmitPaymentsEmployee' => 'bool', + 'autoSubmitPayslips' => 'bool', + 'autoSubmitP45s' => 'bool', + 'autoSubmitPaymentsHmrc' => 'bool', + 'autoSubmitPaymentsDeductions' => 'bool', + 'autoSubmitPaymentsAeos' => 'bool', + 'autoSubmitPaymentsPensions' => 'bool', + 'employeesWithoutEmailAddress' => 'int', + 'employeesWithEmailAddressButNotAutoSending' => 'int', + 'subcontractorsNotAutoSendingStatement' => 'int', + 'codingNoticesAutomaticallyApplied' => 'bool', + 'payrunEmails' => '\SynergiTech\Staffology\Model\PayrunEmail[]', + 'autoSubmitPensionLetters' => 'bool', + 'autoSubmitEps' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'enableAutoPilot' => null, + 'autoPilotTime' => null, + 'autoPilotOffset' => 'int32', + 'enableAutoOpen' => null, + 'autoSubmitFps' => null, + 'autoSubmitPayments' => null, + 'autoSubmitJournal' => null, + 'autoSubmitPaymentsEmployee' => null, + 'autoSubmitPayslips' => null, + 'autoSubmitP45s' => null, + 'autoSubmitPaymentsHmrc' => null, + 'autoSubmitPaymentsDeductions' => null, + 'autoSubmitPaymentsAeos' => null, + 'autoSubmitPaymentsPensions' => null, + 'employeesWithoutEmailAddress' => 'int32', + 'employeesWithEmailAddressButNotAutoSending' => 'int32', + 'subcontractorsNotAutoSendingStatement' => 'int32', + 'codingNoticesAutomaticallyApplied' => null, + 'payrunEmails' => null, + 'autoSubmitPensionLetters' => null, + 'autoSubmitEps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'enableAutoPilot' => false, + 'autoPilotTime' => false, + 'autoPilotOffset' => false, + 'enableAutoOpen' => false, + 'autoSubmitFps' => false, + 'autoSubmitPayments' => false, + 'autoSubmitJournal' => false, + 'autoSubmitPaymentsEmployee' => false, + 'autoSubmitPayslips' => false, + 'autoSubmitP45s' => false, + 'autoSubmitPaymentsHmrc' => false, + 'autoSubmitPaymentsDeductions' => false, + 'autoSubmitPaymentsAeos' => false, + 'autoSubmitPaymentsPensions' => false, + 'employeesWithoutEmailAddress' => false, + 'employeesWithEmailAddressButNotAutoSending' => false, + 'subcontractorsNotAutoSendingStatement' => false, + 'codingNoticesAutomaticallyApplied' => false, + 'payrunEmails' => true, + 'autoSubmitPensionLetters' => false, + 'autoSubmitEps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'enableAutoPilot' => 'enableAutoPilot', + 'autoPilotTime' => 'autoPilotTime', + 'autoPilotOffset' => 'autoPilotOffset', + 'enableAutoOpen' => 'enableAutoOpen', + 'autoSubmitFps' => 'autoSubmitFps', + 'autoSubmitPayments' => 'autoSubmitPayments', + 'autoSubmitJournal' => 'autoSubmitJournal', + 'autoSubmitPaymentsEmployee' => 'autoSubmitPayments_Employee', + 'autoSubmitPayslips' => 'autoSubmitPayslips', + 'autoSubmitP45s' => 'autoSubmitP45s', + 'autoSubmitPaymentsHmrc' => 'autoSubmitPayments_Hmrc', + 'autoSubmitPaymentsDeductions' => 'autoSubmitPayments_Deductions', + 'autoSubmitPaymentsAeos' => 'autoSubmitPayments_Aeos', + 'autoSubmitPaymentsPensions' => 'autoSubmitPayments_Pensions', + 'employeesWithoutEmailAddress' => 'employeesWithoutEmailAddress', + 'employeesWithEmailAddressButNotAutoSending' => 'employeesWithEmailAddressButNotAutoSending', + 'subcontractorsNotAutoSendingStatement' => 'subcontractorsNotAutoSendingStatement', + 'codingNoticesAutomaticallyApplied' => 'codingNoticesAutomaticallyApplied', + 'payrunEmails' => 'payrunEmails', + 'autoSubmitPensionLetters' => 'autoSubmitPensionLetters', + 'autoSubmitEps' => 'autoSubmitEps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'enableAutoPilot' => 'setEnableAutoPilot', + 'autoPilotTime' => 'setAutoPilotTime', + 'autoPilotOffset' => 'setAutoPilotOffset', + 'enableAutoOpen' => 'setEnableAutoOpen', + 'autoSubmitFps' => 'setAutoSubmitFps', + 'autoSubmitPayments' => 'setAutoSubmitPayments', + 'autoSubmitJournal' => 'setAutoSubmitJournal', + 'autoSubmitPaymentsEmployee' => 'setAutoSubmitPaymentsEmployee', + 'autoSubmitPayslips' => 'setAutoSubmitPayslips', + 'autoSubmitP45s' => 'setAutoSubmitP45s', + 'autoSubmitPaymentsHmrc' => 'setAutoSubmitPaymentsHmrc', + 'autoSubmitPaymentsDeductions' => 'setAutoSubmitPaymentsDeductions', + 'autoSubmitPaymentsAeos' => 'setAutoSubmitPaymentsAeos', + 'autoSubmitPaymentsPensions' => 'setAutoSubmitPaymentsPensions', + 'employeesWithoutEmailAddress' => 'setEmployeesWithoutEmailAddress', + 'employeesWithEmailAddressButNotAutoSending' => 'setEmployeesWithEmailAddressButNotAutoSending', + 'subcontractorsNotAutoSendingStatement' => 'setSubcontractorsNotAutoSendingStatement', + 'codingNoticesAutomaticallyApplied' => 'setCodingNoticesAutomaticallyApplied', + 'payrunEmails' => 'setPayrunEmails', + 'autoSubmitPensionLetters' => 'setAutoSubmitPensionLetters', + 'autoSubmitEps' => 'setAutoSubmitEps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'enableAutoPilot' => 'getEnableAutoPilot', + 'autoPilotTime' => 'getAutoPilotTime', + 'autoPilotOffset' => 'getAutoPilotOffset', + 'enableAutoOpen' => 'getEnableAutoOpen', + 'autoSubmitFps' => 'getAutoSubmitFps', + 'autoSubmitPayments' => 'getAutoSubmitPayments', + 'autoSubmitJournal' => 'getAutoSubmitJournal', + 'autoSubmitPaymentsEmployee' => 'getAutoSubmitPaymentsEmployee', + 'autoSubmitPayslips' => 'getAutoSubmitPayslips', + 'autoSubmitP45s' => 'getAutoSubmitP45s', + 'autoSubmitPaymentsHmrc' => 'getAutoSubmitPaymentsHmrc', + 'autoSubmitPaymentsDeductions' => 'getAutoSubmitPaymentsDeductions', + 'autoSubmitPaymentsAeos' => 'getAutoSubmitPaymentsAeos', + 'autoSubmitPaymentsPensions' => 'getAutoSubmitPaymentsPensions', + 'employeesWithoutEmailAddress' => 'getEmployeesWithoutEmailAddress', + 'employeesWithEmailAddressButNotAutoSending' => 'getEmployeesWithEmailAddressButNotAutoSending', + 'subcontractorsNotAutoSendingStatement' => 'getSubcontractorsNotAutoSendingStatement', + 'codingNoticesAutomaticallyApplied' => 'getCodingNoticesAutomaticallyApplied', + 'payrunEmails' => 'getPayrunEmails', + 'autoSubmitPensionLetters' => 'getAutoSubmitPensionLetters', + 'autoSubmitEps' => 'getAutoSubmitEps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enableAutoPilot', $data ?? [], null); + $this->setIfExists('autoPilotTime', $data ?? [], null); + $this->setIfExists('autoPilotOffset', $data ?? [], null); + $this->setIfExists('enableAutoOpen', $data ?? [], null); + $this->setIfExists('autoSubmitFps', $data ?? [], null); + $this->setIfExists('autoSubmitPayments', $data ?? [], null); + $this->setIfExists('autoSubmitJournal', $data ?? [], null); + $this->setIfExists('autoSubmitPaymentsEmployee', $data ?? [], null); + $this->setIfExists('autoSubmitPayslips', $data ?? [], null); + $this->setIfExists('autoSubmitP45s', $data ?? [], null); + $this->setIfExists('autoSubmitPaymentsHmrc', $data ?? [], null); + $this->setIfExists('autoSubmitPaymentsDeductions', $data ?? [], null); + $this->setIfExists('autoSubmitPaymentsAeos', $data ?? [], null); + $this->setIfExists('autoSubmitPaymentsPensions', $data ?? [], null); + $this->setIfExists('employeesWithoutEmailAddress', $data ?? [], null); + $this->setIfExists('employeesWithEmailAddressButNotAutoSending', $data ?? [], null); + $this->setIfExists('subcontractorsNotAutoSendingStatement', $data ?? [], null); + $this->setIfExists('codingNoticesAutomaticallyApplied', $data ?? [], null); + $this->setIfExists('payrunEmails', $data ?? [], null); + $this->setIfExists('autoSubmitPensionLetters', $data ?? [], null); + $this->setIfExists('autoSubmitEps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['autoPilotOffset']) && ($this->container['autoPilotOffset'] > 6)) { + $invalidProperties[] = "invalid value for 'autoPilotOffset', must be smaller than or equal to 6."; + } + + if (!is_null($this->container['autoPilotOffset']) && ($this->container['autoPilotOffset'] < 0)) { + $invalidProperties[] = "invalid value for 'autoPilotOffset', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enableAutoPilot + * + * @return bool|null + */ + public function getEnableAutoPilot(): ?bool + { + return $this->container['enableAutoPilot']; + } + + /** + * Sets enableAutoPilot + * + * @param bool|null $enableAutoPilot IF enabled then payruns will be automatically finalised on the payment date and the next payrun will be started + * + * @return $this + */ + public function setEnableAutoPilot(?bool $enableAutoPilot): static + { + if (is_null($enableAutoPilot)) { + throw new InvalidArgumentException('non-nullable enableAutoPilot cannot be null'); + } + $this->container['enableAutoPilot'] = $enableAutoPilot; + + return $this; + } + + /** + * Gets autoPilotTime + * + * @return \SynergiTech\Staffology\Model\AutoPilotFinaliseTime|null + */ + public function getAutoPilotTime(): ?\SynergiTech\Staffology\Model\AutoPilotFinaliseTime + { + return $this->container['autoPilotTime']; + } + + /** + * Sets autoPilotTime + * + * @param \SynergiTech\Staffology\Model\AutoPilotFinaliseTime|null $autoPilotTime autoPilotTime + * + * @return $this + */ + public function setAutoPilotTime(?\SynergiTech\Staffology\Model\AutoPilotFinaliseTime $autoPilotTime): static + { + if (is_null($autoPilotTime)) { + throw new InvalidArgumentException('non-nullable autoPilotTime cannot be null'); + } + $this->container['autoPilotTime'] = $autoPilotTime; + + return $this; + } + + /** + * Gets autoPilotOffset + * + * @return int|null + */ + public function getAutoPilotOffset(): ?int + { + return $this->container['autoPilotOffset']; + } + + /** + * Sets autoPilotOffset + * + * @param int|null $autoPilotOffset How many days before the payment date a payrun should be finalised. Set it to 0 if you want the payrun to be automatically finalised on the payment date itself + * + * @return $this + */ + public function setAutoPilotOffset(?int $autoPilotOffset): static + { + if (is_null($autoPilotOffset)) { + throw new InvalidArgumentException('non-nullable autoPilotOffset cannot be null'); + } + + if (($autoPilotOffset > 6)) { + throw new InvalidArgumentException('invalid value for $autoPilotOffset when calling AutomationSettings., must be smaller than or equal to 6.'); + } + if (($autoPilotOffset < 0)) { + throw new InvalidArgumentException('invalid value for $autoPilotOffset when calling AutomationSettings., must be bigger than or equal to 0.'); + } + + $this->container['autoPilotOffset'] = $autoPilotOffset; + + return $this; + } + + /** + * Gets enableAutoOpen + * + * @return bool|null + */ + public function getEnableAutoOpen(): ?bool + { + return $this->container['enableAutoOpen']; + } + + /** + * Sets enableAutoOpen + * + * @param bool|null $enableAutoOpen IF enabled then whenever you close a payrun, the next one will be started. Automatically set to true if EnableAutoPilot is true + * + * @return $this + */ + public function setEnableAutoOpen(?bool $enableAutoOpen): static + { + if (is_null($enableAutoOpen)) { + throw new InvalidArgumentException('non-nullable enableAutoOpen cannot be null'); + } + $this->container['enableAutoOpen'] = $enableAutoOpen; + + return $this; + } + + /** + * Gets autoSubmitFps + * + * @return bool|null + */ + public function getAutoSubmitFps(): ?bool + { + return $this->container['autoSubmitFps']; + } + + /** + * Sets autoSubmitFps + * + * @param bool|null $autoSubmitFps If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun. This property will always have the same value as the property with the same name on the RtiSubmissionSettings model. + * + * @return $this + */ + public function setAutoSubmitFps(?bool $autoSubmitFps): static + { + if (is_null($autoSubmitFps)) { + throw new InvalidArgumentException('non-nullable autoSubmitFps cannot be null'); + } + $this->container['autoSubmitFps'] = $autoSubmitFps; + + return $this; + } + + /** + * Gets autoSubmitPayments + * + * @return bool|null + */ + public function getAutoSubmitPayments(): ?bool + { + return $this->container['autoSubmitPayments']; + } + + /** + * Sets autoSubmitPayments + * + * @param bool|null $autoSubmitPayments If set to true, we'll automatically submit payments whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'Payments'. + * + * @return $this + */ + public function setAutoSubmitPayments(?bool $autoSubmitPayments): static + { + if (is_null($autoSubmitPayments)) { + throw new InvalidArgumentException('non-nullable autoSubmitPayments cannot be null'); + } + $this->container['autoSubmitPayments'] = $autoSubmitPayments; + + return $this; + } + + /** + * Gets autoSubmitJournal + * + * @return bool|null + */ + public function getAutoSubmitJournal(): ?bool + { + return $this->container['autoSubmitJournal']; + } + + /** + * Sets autoSubmitJournal + * + * @param bool|null $autoSubmitJournal If set to true, we'll automatically submit the payroll journal whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'Accounting'. + * + * @return $this + */ + public function setAutoSubmitJournal(?bool $autoSubmitJournal): static + { + if (is_null($autoSubmitJournal)) { + throw new InvalidArgumentException('non-nullable autoSubmitJournal cannot be null'); + } + $this->container['autoSubmitJournal'] = $autoSubmitJournal; + + return $this; + } + + /** + * Gets autoSubmitPaymentsEmployee + * + * @return bool|null + */ + public function getAutoSubmitPaymentsEmployee(): ?bool + { + return $this->container['autoSubmitPaymentsEmployee']; + } + + /** + * Sets autoSubmitPaymentsEmployee + * + * @param bool|null $autoSubmitPaymentsEmployee Used in conjunction with AutoSubmitPayments. + * + * @return $this + */ + public function setAutoSubmitPaymentsEmployee(?bool $autoSubmitPaymentsEmployee): static + { + if (is_null($autoSubmitPaymentsEmployee)) { + throw new InvalidArgumentException('non-nullable autoSubmitPaymentsEmployee cannot be null'); + } + $this->container['autoSubmitPaymentsEmployee'] = $autoSubmitPaymentsEmployee; + + return $this; + } + + /** + * Gets autoSubmitPayslips + * + * @return bool|null + */ + public function getAutoSubmitPayslips(): ?bool + { + return $this->container['autoSubmitPayslips']; + } + + /** + * Sets autoSubmitPayslips + * + * @param bool|null $autoSubmitPayslips If set to true, we'll automatically submit payslips whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. + * + * @return $this + */ + public function setAutoSubmitPayslips(?bool $autoSubmitPayslips): static + { + if (is_null($autoSubmitPayslips)) { + throw new InvalidArgumentException('non-nullable autoSubmitPayslips cannot be null'); + } + $this->container['autoSubmitPayslips'] = $autoSubmitPayslips; + + return $this; + } + + /** + * Gets autoSubmitP45s + * + * @return bool|null + */ + public function getAutoSubmitP45s(): ?bool + { + return $this->container['autoSubmitP45s']; + } + + /** + * Sets autoSubmitP45s + * + * @param bool|null $autoSubmitP45s If set to true, we'll automatically submit P45s whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. + * + * @return $this + */ + public function setAutoSubmitP45s(?bool $autoSubmitP45s): static + { + if (is_null($autoSubmitP45s)) { + throw new InvalidArgumentException('non-nullable autoSubmitP45s cannot be null'); + } + $this->container['autoSubmitP45s'] = $autoSubmitP45s; + + return $this; + } + + /** + * Gets autoSubmitPaymentsHmrc + * + * @return bool|null + */ + public function getAutoSubmitPaymentsHmrc(): ?bool + { + return $this->container['autoSubmitPaymentsHmrc']; + } + + /** + * Sets autoSubmitPaymentsHmrc + * + * @param bool|null $autoSubmitPaymentsHmrc Used in conjunction with AutoSubmitPayments. + * + * @return $this + */ + public function setAutoSubmitPaymentsHmrc(?bool $autoSubmitPaymentsHmrc): static + { + if (is_null($autoSubmitPaymentsHmrc)) { + throw new InvalidArgumentException('non-nullable autoSubmitPaymentsHmrc cannot be null'); + } + $this->container['autoSubmitPaymentsHmrc'] = $autoSubmitPaymentsHmrc; + + return $this; + } + + /** + * Gets autoSubmitPaymentsDeductions + * + * @return bool|null + */ + public function getAutoSubmitPaymentsDeductions(): ?bool + { + return $this->container['autoSubmitPaymentsDeductions']; + } + + /** + * Sets autoSubmitPaymentsDeductions + * + * @param bool|null $autoSubmitPaymentsDeductions Used in conjunction with AutoSubmitPayments. + * + * @return $this + */ + public function setAutoSubmitPaymentsDeductions(?bool $autoSubmitPaymentsDeductions): static + { + if (is_null($autoSubmitPaymentsDeductions)) { + throw new InvalidArgumentException('non-nullable autoSubmitPaymentsDeductions cannot be null'); + } + $this->container['autoSubmitPaymentsDeductions'] = $autoSubmitPaymentsDeductions; + + return $this; + } + + /** + * Gets autoSubmitPaymentsAeos + * + * @return bool|null + */ + public function getAutoSubmitPaymentsAeos(): ?bool + { + return $this->container['autoSubmitPaymentsAeos']; + } + + /** + * Sets autoSubmitPaymentsAeos + * + * @param bool|null $autoSubmitPaymentsAeos Used in conjunction with AutoSubmitPayments. + * + * @return $this + */ + public function setAutoSubmitPaymentsAeos(?bool $autoSubmitPaymentsAeos): static + { + if (is_null($autoSubmitPaymentsAeos)) { + throw new InvalidArgumentException('non-nullable autoSubmitPaymentsAeos cannot be null'); + } + $this->container['autoSubmitPaymentsAeos'] = $autoSubmitPaymentsAeos; + + return $this; + } + + /** + * Gets autoSubmitPaymentsPensions + * + * @return bool|null + */ + public function getAutoSubmitPaymentsPensions(): ?bool + { + return $this->container['autoSubmitPaymentsPensions']; + } + + /** + * Sets autoSubmitPaymentsPensions + * + * @param bool|null $autoSubmitPaymentsPensions Used in conjunction with AutoSubmitPayments. + * + * @return $this + */ + public function setAutoSubmitPaymentsPensions(?bool $autoSubmitPaymentsPensions): static + { + if (is_null($autoSubmitPaymentsPensions)) { + throw new InvalidArgumentException('non-nullable autoSubmitPaymentsPensions cannot be null'); + } + $this->container['autoSubmitPaymentsPensions'] = $autoSubmitPaymentsPensions; + + return $this; + } + + /** + * Gets employeesWithoutEmailAddress + * + * @return int|null + */ + public function getEmployeesWithoutEmailAddress(): ?int + { + return $this->container['employeesWithoutEmailAddress']; + } + + /** + * Sets employeesWithoutEmailAddress + * + * @param int|null $employeesWithoutEmailAddress [readonly] A count of how many employees or subcontractors for this employer do not have email addresses + * + * @return $this + */ + public function setEmployeesWithoutEmailAddress(?int $employeesWithoutEmailAddress): static + { + if (is_null($employeesWithoutEmailAddress)) { + throw new InvalidArgumentException('non-nullable employeesWithoutEmailAddress cannot be null'); + } + $this->container['employeesWithoutEmailAddress'] = $employeesWithoutEmailAddress; + + return $this; + } + + /** + * Gets employeesWithEmailAddressButNotAutoSending + * + * @return int|null + */ + public function getEmployeesWithEmailAddressButNotAutoSending(): ?int + { + return $this->container['employeesWithEmailAddressButNotAutoSending']; + } + + /** + * Sets employeesWithEmailAddressButNotAutoSending + * + * @param int|null $employeesWithEmailAddressButNotAutoSending [readonly] A count of how many employees or subcontractors for this employer do have email addresses but don't have the option enabled to auto-email payslips + * + * @return $this + */ + public function setEmployeesWithEmailAddressButNotAutoSending(?int $employeesWithEmailAddressButNotAutoSending): static + { + if (is_null($employeesWithEmailAddressButNotAutoSending)) { + throw new InvalidArgumentException('non-nullable employeesWithEmailAddressButNotAutoSending cannot be null'); + } + $this->container['employeesWithEmailAddressButNotAutoSending'] = $employeesWithEmailAddressButNotAutoSending; + + return $this; + } + + /** + * Gets subcontractorsNotAutoSendingStatement + * + * @return int|null + */ + public function getSubcontractorsNotAutoSendingStatement(): ?int + { + return $this->container['subcontractorsNotAutoSendingStatement']; + } + + /** + * Sets subcontractorsNotAutoSendingStatement + * + * @param int|null $subcontractorsNotAutoSendingStatement [readonly] A count of how many subscontractors for this employer do don't have the option enabled to auto-email statement + * + * @return $this + */ + public function setSubcontractorsNotAutoSendingStatement(?int $subcontractorsNotAutoSendingStatement): static + { + if (is_null($subcontractorsNotAutoSendingStatement)) { + throw new InvalidArgumentException('non-nullable subcontractorsNotAutoSendingStatement cannot be null'); + } + $this->container['subcontractorsNotAutoSendingStatement'] = $subcontractorsNotAutoSendingStatement; + + return $this; + } + + /** + * Gets codingNoticesAutomaticallyApplied + * + * @return bool|null + */ + public function getCodingNoticesAutomaticallyApplied(): ?bool + { + return $this->container['codingNoticesAutomaticallyApplied']; + } + + /** + * Sets codingNoticesAutomaticallyApplied + * + * @param bool|null $codingNoticesAutomaticallyApplied [readonly] An indicator of whether or not this employer is automatically applying DpsNotices + * + * @return $this + */ + public function setCodingNoticesAutomaticallyApplied(?bool $codingNoticesAutomaticallyApplied): static + { + if (is_null($codingNoticesAutomaticallyApplied)) { + throw new InvalidArgumentException('non-nullable codingNoticesAutomaticallyApplied cannot be null'); + } + $this->container['codingNoticesAutomaticallyApplied'] = $codingNoticesAutomaticallyApplied; + + return $this; + } + + /** + * Gets payrunEmails + * + * @return \SynergiTech\Staffology\Model\PayrunEmail[]|null + */ + public function getPayrunEmails(): ?array + { + return $this->container['payrunEmails']; + } + + /** + * Sets payrunEmails + * + * @param \SynergiTech\Staffology\Model\PayrunEmail[]|null $payrunEmails Automated emails that will be sent when a PayRun is finalised + * + * @return $this + */ + public function setPayrunEmails(?array $payrunEmails): static + { + if (is_null($payrunEmails)) { + array_push($this->openAPINullablesSetToNull, 'payrunEmails'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrunEmails', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrunEmails'] = $payrunEmails; + + return $this; + } + + /** + * Gets autoSubmitPensionLetters + * + * @return bool|null + */ + public function getAutoSubmitPensionLetters(): ?bool + { + return $this->container['autoSubmitPensionLetters']; + } + + /** + * Sets autoSubmitPensionLetters + * + * @param bool|null $autoSubmitPensionLetters If set to true, we'll automatically submit Pension Letters whenever you finalise a PayRun. The employer must be connected to an ExternalDataProvider supporting Type of 'EmployeePortal'. + * + * @return $this + */ + public function setAutoSubmitPensionLetters(?bool $autoSubmitPensionLetters): static + { + if (is_null($autoSubmitPensionLetters)) { + throw new InvalidArgumentException('non-nullable autoSubmitPensionLetters cannot be null'); + } + $this->container['autoSubmitPensionLetters'] = $autoSubmitPensionLetters; + + return $this; + } + + /** + * Gets autoSubmitEps + * + * @return bool|null + */ + public function getAutoSubmitEps(): ?bool + { + return $this->container['autoSubmitEps']; + } + + /** + * Sets autoSubmitEps + * + * @param bool|null $autoSubmitEps If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun. + * + * @return $this + */ + public function setAutoSubmitEps(?bool $autoSubmitEps): static + { + if (is_null($autoSubmitEps)) { + throw new InvalidArgumentException('non-nullable autoSubmitEps cannot be null'); + } + $this->container['autoSubmitEps'] = $autoSubmitEps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AverageHolidayPayRateReport.php b/src/Model/AverageHolidayPayRateReport.php new file mode 100644 index 0000000..9b088f3 --- /dev/null +++ b/src/Model/AverageHolidayPayRateReport.php @@ -0,0 +1,878 @@ + + */ +class AverageHolidayPayRateReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AverageHolidayPayRateReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\AverageHolidayPayRateReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\AverageHolidayPayRateReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\AverageHolidayPayRateReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AverageHolidayPayRateReportLine.php b/src/Model/AverageHolidayPayRateReportLine.php new file mode 100644 index 0000000..480a295 --- /dev/null +++ b/src/Model/AverageHolidayPayRateReportLine.php @@ -0,0 +1,681 @@ + + */ +class AverageHolidayPayRateReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AverageHolidayPayRateReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'niNumber' => 'string', + 'period' => 'int', + 'rate' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'firstName' => null, + 'lastName' => null, + 'niNumber' => null, + 'period' => 'int32', + 'rate' => 'double', + 'employee' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'firstName' => true, + 'lastName' => true, + 'niNumber' => true, + 'period' => false, + 'rate' => false, + 'employee' => false, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'niNumber' => 'niNumber', + 'period' => 'period', + 'rate' => 'rate', + 'employee' => 'employee', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'niNumber' => 'setNiNumber', + 'period' => 'setPeriod', + 'rate' => 'setRate', + 'employee' => 'setEmployee', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'niNumber' => 'getNiNumber', + 'period' => 'getPeriod', + 'rate' => 'getRate', + 'employee' => 'getEmployee', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode Payroll code of the employee + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName The First Name of the employee + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName The Last Name of the employee + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber The NiNumber of the employee + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period The Period of the average holiday pay rate + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate The Average holiday pay rate + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AverageHolidayPayRateReportReportResponse.php b/src/Model/AverageHolidayPayRateReportReportResponse.php new file mode 100644 index 0000000..03639b7 --- /dev/null +++ b/src/Model/AverageHolidayPayRateReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class AverageHolidayPayRateReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AverageHolidayPayRateReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\AverageHolidayPayRateReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\AverageHolidayPayRateReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\AverageHolidayPayRateReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\AverageHolidayPayRateReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\AverageHolidayPayRateReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AveragePayGradesReportLine.php b/src/Model/AveragePayGradesReportLine.php new file mode 100644 index 0000000..b76bfa9 --- /dev/null +++ b/src/Model/AveragePayGradesReportLine.php @@ -0,0 +1,722 @@ + + */ +class AveragePayGradesReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AveragePayGradesReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'effectiveDate' => '\DateTime', + 'paySpineName' => 'string', + 'payGradeName' => 'string', + 'lowerGradePoint' => 'string', + 'upperGradePoint' => 'string', + 'upperPointAltMax' => 'bool', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'effectiveDate' => 'date', + 'paySpineName' => null, + 'payGradeName' => null, + 'lowerGradePoint' => null, + 'upperGradePoint' => null, + 'upperPointAltMax' => null, + 'employee' => null, + 'payrollCode' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'effectiveDate' => false, + 'paySpineName' => true, + 'payGradeName' => true, + 'lowerGradePoint' => true, + 'upperGradePoint' => true, + 'upperPointAltMax' => false, + 'employee' => false, + 'payrollCode' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'effectiveDate' => 'effectiveDate', + 'paySpineName' => 'paySpineName', + 'payGradeName' => 'payGradeName', + 'lowerGradePoint' => 'lowerGradePoint', + 'upperGradePoint' => 'upperGradePoint', + 'upperPointAltMax' => 'upperPointAltMax', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'effectiveDate' => 'setEffectiveDate', + 'paySpineName' => 'setPaySpineName', + 'payGradeName' => 'setPayGradeName', + 'lowerGradePoint' => 'setLowerGradePoint', + 'upperGradePoint' => 'setUpperGradePoint', + 'upperPointAltMax' => 'setUpperPointAltMax', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'effectiveDate' => 'getEffectiveDate', + 'paySpineName' => 'getPaySpineName', + 'payGradeName' => 'getPayGradeName', + 'lowerGradePoint' => 'getLowerGradePoint', + 'upperGradePoint' => 'getUpperGradePoint', + 'upperPointAltMax' => 'getUpperPointAltMax', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('paySpineName', $data ?? [], null); + $this->setIfExists('payGradeName', $data ?? [], null); + $this->setIfExists('lowerGradePoint', $data ?? [], null); + $this->setIfExists('upperGradePoint', $data ?? [], null); + $this->setIfExists('upperPointAltMax', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Effective date for Pay spine grade + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets paySpineName + * + * @return string|null + */ + public function getPaySpineName(): ?string + { + return $this->container['paySpineName']; + } + + /** + * Sets paySpineName + * + * @param string|null $paySpineName Name of Pay Spine + * + * @return $this + */ + public function setPaySpineName(?string $paySpineName): static + { + if (is_null($paySpineName)) { + array_push($this->openAPINullablesSetToNull, 'paySpineName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineName'] = $paySpineName; + + return $this; + } + + /** + * Gets payGradeName + * + * @return string|null + */ + public function getPayGradeName(): ?string + { + return $this->container['payGradeName']; + } + + /** + * Sets payGradeName + * + * @param string|null $payGradeName Name of Pay grade name + * + * @return $this + */ + public function setPayGradeName(?string $payGradeName): static + { + if (is_null($payGradeName)) { + array_push($this->openAPINullablesSetToNull, 'payGradeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payGradeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payGradeName'] = $payGradeName; + + return $this; + } + + /** + * Gets lowerGradePoint + * + * @return string|null + */ + public function getLowerGradePoint(): ?string + { + return $this->container['lowerGradePoint']; + } + + /** + * Sets lowerGradePoint + * + * @param string|null $lowerGradePoint Lower grade point of pay spine grade + * + * @return $this + */ + public function setLowerGradePoint(?string $lowerGradePoint): static + { + if (is_null($lowerGradePoint)) { + array_push($this->openAPINullablesSetToNull, 'lowerGradePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lowerGradePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lowerGradePoint'] = $lowerGradePoint; + + return $this; + } + + /** + * Gets upperGradePoint + * + * @return string|null + */ + public function getUpperGradePoint(): ?string + { + return $this->container['upperGradePoint']; + } + + /** + * Sets upperGradePoint + * + * @param string|null $upperGradePoint Upper grade point of pay spine grade + * + * @return $this + */ + public function setUpperGradePoint(?string $upperGradePoint): static + { + if (is_null($upperGradePoint)) { + array_push($this->openAPINullablesSetToNull, 'upperGradePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('upperGradePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['upperGradePoint'] = $upperGradePoint; + + return $this; + } + + /** + * Gets upperPointAltMax + * + * @return bool|null + */ + public function getUpperPointAltMax(): ?bool + { + return $this->container['upperPointAltMax']; + } + + /** + * Sets upperPointAltMax + * + * @param bool|null $upperPointAltMax To Check Alt Max of Upper point + * + * @return $this + */ + public function setUpperPointAltMax(?bool $upperPointAltMax): static + { + if (is_null($upperPointAltMax)) { + throw new InvalidArgumentException('non-nullable upperPointAltMax cannot be null'); + } + $this->container['upperPointAltMax'] = $upperPointAltMax; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AverageWeeklyEarnings.php b/src/Model/AverageWeeklyEarnings.php new file mode 100644 index 0000000..cade003 --- /dev/null +++ b/src/Model/AverageWeeklyEarnings.php @@ -0,0 +1,721 @@ + + */ +class AverageWeeklyEarnings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AverageWeeklyEarnings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'result' => '\SynergiTech\Staffology\Model\AverageWeeklyEarningsResult', + 'resultDescription' => 'string', + 'averageEarnings' => 'float', + 'threshold' => 'float', + 'eligibilityThreshold' => 'float', + 'requestedDate' => '\DateTime', + 'relevantPeriodStart' => '\DateTime', + 'relevantPeriodEnd' => '\DateTime', + 'relevantPeriodWeekCount' => 'float', + 'relevantPeriodEarnings' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'result' => null, + 'resultDescription' => null, + 'averageEarnings' => 'double', + 'threshold' => 'double', + 'eligibilityThreshold' => 'double', + 'requestedDate' => 'date', + 'relevantPeriodStart' => 'date', + 'relevantPeriodEnd' => 'date', + 'relevantPeriodWeekCount' => 'double', + 'relevantPeriodEarnings' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'result' => false, + 'resultDescription' => true, + 'averageEarnings' => false, + 'threshold' => false, + 'eligibilityThreshold' => false, + 'requestedDate' => false, + 'relevantPeriodStart' => false, + 'relevantPeriodEnd' => false, + 'relevantPeriodWeekCount' => false, + 'relevantPeriodEarnings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'result' => 'result', + 'resultDescription' => 'resultDescription', + 'averageEarnings' => 'averageEarnings', + 'threshold' => 'threshold', + 'eligibilityThreshold' => 'eligibilityThreshold', + 'requestedDate' => 'requestedDate', + 'relevantPeriodStart' => 'relevantPeriodStart', + 'relevantPeriodEnd' => 'relevantPeriodEnd', + 'relevantPeriodWeekCount' => 'relevantPeriodWeekCount', + 'relevantPeriodEarnings' => 'relevantPeriodEarnings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'result' => 'setResult', + 'resultDescription' => 'setResultDescription', + 'averageEarnings' => 'setAverageEarnings', + 'threshold' => 'setThreshold', + 'eligibilityThreshold' => 'setEligibilityThreshold', + 'requestedDate' => 'setRequestedDate', + 'relevantPeriodStart' => 'setRelevantPeriodStart', + 'relevantPeriodEnd' => 'setRelevantPeriodEnd', + 'relevantPeriodWeekCount' => 'setRelevantPeriodWeekCount', + 'relevantPeriodEarnings' => 'setRelevantPeriodEarnings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'result' => 'getResult', + 'resultDescription' => 'getResultDescription', + 'averageEarnings' => 'getAverageEarnings', + 'threshold' => 'getThreshold', + 'eligibilityThreshold' => 'getEligibilityThreshold', + 'requestedDate' => 'getRequestedDate', + 'relevantPeriodStart' => 'getRelevantPeriodStart', + 'relevantPeriodEnd' => 'getRelevantPeriodEnd', + 'relevantPeriodWeekCount' => 'getRelevantPeriodWeekCount', + 'relevantPeriodEarnings' => 'getRelevantPeriodEarnings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('resultDescription', $data ?? [], null); + $this->setIfExists('averageEarnings', $data ?? [], null); + $this->setIfExists('threshold', $data ?? [], null); + $this->setIfExists('eligibilityThreshold', $data ?? [], null); + $this->setIfExists('requestedDate', $data ?? [], null); + $this->setIfExists('relevantPeriodStart', $data ?? [], null); + $this->setIfExists('relevantPeriodEnd', $data ?? [], null); + $this->setIfExists('relevantPeriodWeekCount', $data ?? [], null); + $this->setIfExists('relevantPeriodEarnings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return \SynergiTech\Staffology\Model\AverageWeeklyEarningsResult|null + */ + public function getResult(): ?\SynergiTech\Staffology\Model\AverageWeeklyEarningsResult + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \SynergiTech\Staffology\Model\AverageWeeklyEarningsResult|null $result result + * + * @return $this + */ + public function setResult(?\SynergiTech\Staffology\Model\AverageWeeklyEarningsResult $result): static + { + if (is_null($result)) { + throw new InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets resultDescription + * + * @return string|null + */ + public function getResultDescription(): ?string + { + return $this->container['resultDescription']; + } + + /** + * Sets resultDescription + * + * @param string|null $resultDescription resultDescription + * + * @return $this + */ + public function setResultDescription(?string $resultDescription): static + { + if (is_null($resultDescription)) { + array_push($this->openAPINullablesSetToNull, 'resultDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('resultDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['resultDescription'] = $resultDescription; + + return $this; + } + + /** + * Gets averageEarnings + * + * @return float|null + */ + public function getAverageEarnings(): ?float + { + return $this->container['averageEarnings']; + } + + /** + * Sets averageEarnings + * + * @param float|null $averageEarnings averageEarnings + * + * @return $this + */ + public function setAverageEarnings(?float $averageEarnings): static + { + if (is_null($averageEarnings)) { + throw new InvalidArgumentException('non-nullable averageEarnings cannot be null'); + } + $this->container['averageEarnings'] = $averageEarnings; + + return $this; + } + + /** + * Gets threshold + * + * @return float|null + */ + public function getThreshold(): ?float + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param float|null $threshold threshold + * + * @return $this + */ + public function setThreshold(?float $threshold): static + { + if (is_null($threshold)) { + throw new InvalidArgumentException('non-nullable threshold cannot be null'); + } + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets eligibilityThreshold + * + * @return float|null + */ + public function getEligibilityThreshold(): ?float + { + return $this->container['eligibilityThreshold']; + } + + /** + * Sets eligibilityThreshold + * + * @param float|null $eligibilityThreshold eligibilityThreshold + * + * @return $this + */ + public function setEligibilityThreshold(?float $eligibilityThreshold): static + { + if (is_null($eligibilityThreshold)) { + throw new InvalidArgumentException('non-nullable eligibilityThreshold cannot be null'); + } + $this->container['eligibilityThreshold'] = $eligibilityThreshold; + + return $this; + } + + /** + * Gets requestedDate + * + * @return \DateTime|null + */ + public function getRequestedDate(): ?\DateTime + { + return $this->container['requestedDate']; + } + + /** + * Sets requestedDate + * + * @param \DateTime|null $requestedDate requestedDate + * + * @return $this + */ + public function setRequestedDate(?\DateTime $requestedDate): static + { + if (is_null($requestedDate)) { + throw new InvalidArgumentException('non-nullable requestedDate cannot be null'); + } + $this->container['requestedDate'] = $requestedDate; + + return $this; + } + + /** + * Gets relevantPeriodStart + * + * @return \DateTime|null + */ + public function getRelevantPeriodStart(): ?\DateTime + { + return $this->container['relevantPeriodStart']; + } + + /** + * Sets relevantPeriodStart + * + * @param \DateTime|null $relevantPeriodStart relevantPeriodStart + * + * @return $this + */ + public function setRelevantPeriodStart(?\DateTime $relevantPeriodStart): static + { + if (is_null($relevantPeriodStart)) { + throw new InvalidArgumentException('non-nullable relevantPeriodStart cannot be null'); + } + $this->container['relevantPeriodStart'] = $relevantPeriodStart; + + return $this; + } + + /** + * Gets relevantPeriodEnd + * + * @return \DateTime|null + */ + public function getRelevantPeriodEnd(): ?\DateTime + { + return $this->container['relevantPeriodEnd']; + } + + /** + * Sets relevantPeriodEnd + * + * @param \DateTime|null $relevantPeriodEnd relevantPeriodEnd + * + * @return $this + */ + public function setRelevantPeriodEnd(?\DateTime $relevantPeriodEnd): static + { + if (is_null($relevantPeriodEnd)) { + throw new InvalidArgumentException('non-nullable relevantPeriodEnd cannot be null'); + } + $this->container['relevantPeriodEnd'] = $relevantPeriodEnd; + + return $this; + } + + /** + * Gets relevantPeriodWeekCount + * + * @return float|null + */ + public function getRelevantPeriodWeekCount(): ?float + { + return $this->container['relevantPeriodWeekCount']; + } + + /** + * Sets relevantPeriodWeekCount + * + * @param float|null $relevantPeriodWeekCount relevantPeriodWeekCount + * + * @return $this + */ + public function setRelevantPeriodWeekCount(?float $relevantPeriodWeekCount): static + { + if (is_null($relevantPeriodWeekCount)) { + throw new InvalidArgumentException('non-nullable relevantPeriodWeekCount cannot be null'); + } + $this->container['relevantPeriodWeekCount'] = $relevantPeriodWeekCount; + + return $this; + } + + /** + * Gets relevantPeriodEarnings + * + * @return float|null + */ + public function getRelevantPeriodEarnings(): ?float + { + return $this->container['relevantPeriodEarnings']; + } + + /** + * Sets relevantPeriodEarnings + * + * @param float|null $relevantPeriodEarnings relevantPeriodEarnings + * + * @return $this + */ + public function setRelevantPeriodEarnings(?float $relevantPeriodEarnings): static + { + if (is_null($relevantPeriodEarnings)) { + throw new InvalidArgumentException('non-nullable relevantPeriodEarnings cannot be null'); + } + $this->container['relevantPeriodEarnings'] = $relevantPeriodEarnings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AverageWeeklyEarningsResult.php b/src/Model/AverageWeeklyEarningsResult.php new file mode 100644 index 0000000..3a8b70c --- /dev/null +++ b/src/Model/AverageWeeklyEarningsResult.php @@ -0,0 +1,49 @@ + + */ +class BankDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BankDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'bankName' => 'string', + 'bankBranch' => 'string', + 'bankReference' => 'string', + 'accountName' => 'string', + 'accountNumber' => 'string', + 'sortCode' => 'string', + 'note' => 'string', + 'buildingSocietyRollNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'bankName' => null, + 'bankBranch' => null, + 'bankReference' => null, + 'accountName' => null, + 'accountNumber' => null, + 'sortCode' => null, + 'note' => null, + 'buildingSocietyRollNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'bankName' => true, + 'bankBranch' => true, + 'bankReference' => true, + 'accountName' => true, + 'accountNumber' => true, + 'sortCode' => true, + 'note' => true, + 'buildingSocietyRollNumber' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'bankName' => 'bankName', + 'bankBranch' => 'bankBranch', + 'bankReference' => 'bankReference', + 'accountName' => 'accountName', + 'accountNumber' => 'accountNumber', + 'sortCode' => 'sortCode', + 'note' => 'note', + 'buildingSocietyRollNumber' => 'buildingSocietyRollNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'bankName' => 'setBankName', + 'bankBranch' => 'setBankBranch', + 'bankReference' => 'setBankReference', + 'accountName' => 'setAccountName', + 'accountNumber' => 'setAccountNumber', + 'sortCode' => 'setSortCode', + 'note' => 'setNote', + 'buildingSocietyRollNumber' => 'setBuildingSocietyRollNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'bankName' => 'getBankName', + 'bankBranch' => 'getBankBranch', + 'bankReference' => 'getBankReference', + 'accountName' => 'getAccountName', + 'accountNumber' => 'getAccountNumber', + 'sortCode' => 'getSortCode', + 'note' => 'getNote', + 'buildingSocietyRollNumber' => 'getBuildingSocietyRollNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bankName', $data ?? [], null); + $this->setIfExists('bankBranch', $data ?? [], null); + $this->setIfExists('bankReference', $data ?? [], null); + $this->setIfExists('accountName', $data ?? [], null); + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('buildingSocietyRollNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['bankName']) && (mb_strlen($this->container['bankName']) > 100)) { + $invalidProperties[] = "invalid value for 'bankName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['bankBranch']) && (mb_strlen($this->container['bankBranch']) > 100)) { + $invalidProperties[] = "invalid value for 'bankBranch', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['bankReference']) && (mb_strlen($this->container['bankReference']) > 100)) { + $invalidProperties[] = "invalid value for 'bankReference', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['accountName']) && (mb_strlen($this->container['accountName']) > 100)) { + $invalidProperties[] = "invalid value for 'accountName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['accountNumber']) && !preg_match("/^\\d{8}$/", $this->container['accountNumber'])) { + $invalidProperties[] = "invalid value for 'accountNumber', must be conform to the pattern /^\\d{8}$/."; + } + + if (!is_null($this->container['sortCode']) && !preg_match("/^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/", $this->container['sortCode'])) { + $invalidProperties[] = "invalid value for 'sortCode', must be conform to the pattern /^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/."; + } + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 200)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && (mb_strlen($this->container['buildingSocietyRollNumber']) > 18)) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', the character length must be smaller than or equal to 18."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && (mb_strlen($this->container['buildingSocietyRollNumber']) < 1)) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && !preg_match("/^[a-zA-Z0-9\\s\/\\.-]+$/", $this->container['buildingSocietyRollNumber'])) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', must be conform to the pattern /^[a-zA-Z0-9\\s\/\\.-]+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bankName + * + * @return string|null + */ + public function getBankName(): ?string + { + return $this->container['bankName']; + } + + /** + * Sets bankName + * + * @param string|null $bankName bankName + * + * @return $this + */ + public function setBankName(?string $bankName): static + { + if (is_null($bankName)) { + array_push($this->openAPINullablesSetToNull, 'bankName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankName) && (mb_strlen($bankName) > 100)) { + throw new InvalidArgumentException('invalid length for $bankName when calling BankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankName'] = $bankName; + + return $this; + } + + /** + * Gets bankBranch + * + * @return string|null + */ + public function getBankBranch(): ?string + { + return $this->container['bankBranch']; + } + + /** + * Sets bankBranch + * + * @param string|null $bankBranch bankBranch + * + * @return $this + */ + public function setBankBranch(?string $bankBranch): static + { + if (is_null($bankBranch)) { + array_push($this->openAPINullablesSetToNull, 'bankBranch'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankBranch', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankBranch) && (mb_strlen($bankBranch) > 100)) { + throw new InvalidArgumentException('invalid length for $bankBranch when calling BankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankBranch'] = $bankBranch; + + return $this; + } + + /** + * Gets bankReference + * + * @return string|null + */ + public function getBankReference(): ?string + { + return $this->container['bankReference']; + } + + /** + * Sets bankReference + * + * @param string|null $bankReference bankReference + * + * @return $this + */ + public function setBankReference(?string $bankReference): static + { + if (is_null($bankReference)) { + array_push($this->openAPINullablesSetToNull, 'bankReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankReference) && (mb_strlen($bankReference) > 100)) { + throw new InvalidArgumentException('invalid length for $bankReference when calling BankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankReference'] = $bankReference; + + return $this; + } + + /** + * Gets accountName + * + * @return string|null + */ + public function getAccountName(): ?string + { + return $this->container['accountName']; + } + + /** + * Sets accountName + * + * @param string|null $accountName accountName + * + * @return $this + */ + public function setAccountName(?string $accountName): static + { + if (is_null($accountName)) { + array_push($this->openAPINullablesSetToNull, 'accountName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountName) && (mb_strlen($accountName) > 100)) { + throw new InvalidArgumentException('invalid length for $accountName when calling BankDetails., must be smaller than or equal to 100.'); + } + + $this->container['accountName'] = $accountName; + + return $this; + } + + /** + * Gets accountNumber + * + * @return string|null + */ + public function getAccountNumber(): ?string + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string|null $accountNumber accountNumber + * + * @return $this + */ + public function setAccountNumber(?string $accountNumber): static + { + if (is_null($accountNumber)) { + array_push($this->openAPINullablesSetToNull, 'accountNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($accountNumber) && (!preg_match("/^\\d{8}$/", ObjectSerializer::toString($accountNumber)))) { + throw new InvalidArgumentException("invalid value for \$accountNumber when calling BankDetails., must conform to the pattern /^\\d{8}$/."); + } + + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode(): ?string + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode sortCode + * + * @return $this + */ + public function setSortCode(?string $sortCode): static + { + if (is_null($sortCode)) { + array_push($this->openAPINullablesSetToNull, 'sortCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sortCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($sortCode) && (!preg_match("/^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/", ObjectSerializer::toString($sortCode)))) { + throw new InvalidArgumentException("invalid value for \$sortCode when calling BankDetails., must conform to the pattern /^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/."); + } + + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note note + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 200)) { + throw new InvalidArgumentException('invalid length for $note when calling BankDetails., must be smaller than or equal to 200.'); + } + + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets buildingSocietyRollNumber + * + * @return string|null + */ + public function getBuildingSocietyRollNumber(): ?string + { + return $this->container['buildingSocietyRollNumber']; + } + + /** + * Sets buildingSocietyRollNumber + * + * @param string|null $buildingSocietyRollNumber buildingSocietyRollNumber + * + * @return $this + */ + public function setBuildingSocietyRollNumber(?string $buildingSocietyRollNumber): static + { + if (is_null($buildingSocietyRollNumber)) { + array_push($this->openAPINullablesSetToNull, 'buildingSocietyRollNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buildingSocietyRollNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buildingSocietyRollNumber) && (mb_strlen($buildingSocietyRollNumber) > 18)) { + throw new InvalidArgumentException('invalid length for $buildingSocietyRollNumber when calling BankDetails., must be smaller than or equal to 18.'); + } + if (!is_null($buildingSocietyRollNumber) && (mb_strlen($buildingSocietyRollNumber) < 1)) { + throw new InvalidArgumentException('invalid length for $buildingSocietyRollNumber when calling BankDetails., must be bigger than or equal to 1.'); + } + if (!is_null($buildingSocietyRollNumber) && (!preg_match("/^[a-zA-Z0-9\\s\/\\.-]+$/", ObjectSerializer::toString($buildingSocietyRollNumber)))) { + throw new InvalidArgumentException("invalid value for \$buildingSocietyRollNumber when calling BankDetails., must conform to the pattern /^[a-zA-Z0-9\\s\/\\.-]+$/."); + } + + $this->container['buildingSocietyRollNumber'] = $buildingSocietyRollNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BankHolidayCollection.php b/src/Model/BankHolidayCollection.php new file mode 100644 index 0000000..ca09ec8 --- /dev/null +++ b/src/Model/BankHolidayCollection.php @@ -0,0 +1,49 @@ + + */ +class BankPaymentInstruction implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BankPaymentInstruction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'originator' => '\SynergiTech\Staffology\Model\BankDetails', + 'bankPayments' => '\SynergiTech\Staffology\Model\PayRunPayment[]', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusMessage' => 'string', + 'link' => 'string', + 'serviceUserNumber' => 'string', + 'bureauNumber' => 'string', + 'allowsMultiDate' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'originator' => null, + 'bankPayments' => null, + 'status' => null, + 'statusMessage' => null, + 'link' => null, + 'serviceUserNumber' => null, + 'bureauNumber' => null, + 'allowsMultiDate' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'originator' => false, + 'bankPayments' => true, + 'status' => false, + 'statusMessage' => true, + 'link' => true, + 'serviceUserNumber' => true, + 'bureauNumber' => true, + 'allowsMultiDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'originator' => 'originator', + 'bankPayments' => 'bankPayments', + 'status' => 'status', + 'statusMessage' => 'statusMessage', + 'link' => 'link', + 'serviceUserNumber' => 'serviceUserNumber', + 'bureauNumber' => 'bureauNumber', + 'allowsMultiDate' => 'allowsMultiDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'originator' => 'setOriginator', + 'bankPayments' => 'setBankPayments', + 'status' => 'setStatus', + 'statusMessage' => 'setStatusMessage', + 'link' => 'setLink', + 'serviceUserNumber' => 'setServiceUserNumber', + 'bureauNumber' => 'setBureauNumber', + 'allowsMultiDate' => 'setAllowsMultiDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'originator' => 'getOriginator', + 'bankPayments' => 'getBankPayments', + 'status' => 'getStatus', + 'statusMessage' => 'getStatusMessage', + 'link' => 'getLink', + 'serviceUserNumber' => 'getServiceUserNumber', + 'bureauNumber' => 'getBureauNumber', + 'allowsMultiDate' => 'getAllowsMultiDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('originator', $data ?? [], null); + $this->setIfExists('bankPayments', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('serviceUserNumber', $data ?? [], null); + $this->setIfExists('bureauNumber', $data ?? [], null); + $this->setIfExists('allowsMultiDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets originator + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getOriginator(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['originator']; + } + + /** + * Sets originator + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $originator originator + * + * @return $this + */ + public function setOriginator(?\SynergiTech\Staffology\Model\BankDetails $originator): static + { + if (is_null($originator)) { + throw new InvalidArgumentException('non-nullable originator cannot be null'); + } + $this->container['originator'] = $originator; + + return $this; + } + + /** + * Gets bankPayments + * + * @return \SynergiTech\Staffology\Model\PayRunPayment[]|null + */ + public function getBankPayments(): ?array + { + return $this->container['bankPayments']; + } + + /** + * Sets bankPayments + * + * @param \SynergiTech\Staffology\Model\PayRunPayment[]|null $bankPayments bankPayments + * + * @return $this + */ + public function setBankPayments(?array $bankPayments): static + { + if (is_null($bankPayments)) { + array_push($this->openAPINullablesSetToNull, 'bankPayments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankPayments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankPayments'] = $bankPayments; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage [readonly] A message to elaborate on the Status + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink(): ?string + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link [readonly] If available, a link to the payments in an ExternalDataProvider + * + * @return $this + */ + public function setLink(?string $link): static + { + if (is_null($link)) { + array_push($this->openAPINullablesSetToNull, 'link'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('link', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets serviceUserNumber + * + * @return string|null + */ + public function getServiceUserNumber(): ?string + { + return $this->container['serviceUserNumber']; + } + + /** + * Sets serviceUserNumber + * + * @param string|null $serviceUserNumber Service user number to be used while sending payment instruction + * + * @return $this + */ + public function setServiceUserNumber(?string $serviceUserNumber): static + { + if (is_null($serviceUserNumber)) { + array_push($this->openAPINullablesSetToNull, 'serviceUserNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('serviceUserNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['serviceUserNumber'] = $serviceUserNumber; + + return $this; + } + + /** + * Gets bureauNumber + * + * @return string|null + */ + public function getBureauNumber(): ?string + { + return $this->container['bureauNumber']; + } + + /** + * Sets bureauNumber + * + * @param string|null $bureauNumber Bureau number to be used if available while sending payment instruction + * + * @return $this + */ + public function setBureauNumber(?string $bureauNumber): static + { + if (is_null($bureauNumber)) { + array_push($this->openAPINullablesSetToNull, 'bureauNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bureauNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bureauNumber'] = $bureauNumber; + + return $this; + } + + /** + * Gets allowsMultiDate + * + * @return bool|null + */ + public function getAllowsMultiDate(): ?bool + { + return $this->container['allowsMultiDate']; + } + + /** + * Sets allowsMultiDate + * + * @param bool|null $allowsMultiDate Allows multiple payment dates in the file + * + * @return $this + */ + public function setAllowsMultiDate(?bool $allowsMultiDate): static + { + if (is_null($allowsMultiDate)) { + throw new InvalidArgumentException('non-nullable allowsMultiDate cannot be null'); + } + $this->container['allowsMultiDate'] = $allowsMultiDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BankPaymentInstructionReportResponse.php b/src/Model/BankPaymentInstructionReportResponse.php new file mode 100644 index 0000000..e8dd9fb --- /dev/null +++ b/src/Model/BankPaymentInstructionReportResponse.php @@ -0,0 +1,532 @@ + + */ +class BankPaymentInstructionReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BankPaymentInstructionReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\BankPaymentInstruction', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\BankPaymentInstruction|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\BankPaymentInstruction + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\BankPaymentInstruction|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\BankPaymentInstruction $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BankPaymentInstructionsCsvFormat.php b/src/Model/BankPaymentInstructionsCsvFormat.php new file mode 100644 index 0000000..74496d5 --- /dev/null +++ b/src/Model/BankPaymentInstructionsCsvFormat.php @@ -0,0 +1,79 @@ + + */ +class Benefit implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Benefit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'type' => '\SynergiTech\Staffology\Model\BenefitType', + 'declarationType' => '\SynergiTech\Staffology\Model\BenefitDeclarationType', + 'benefitPayrolled' => '\SynergiTech\Staffology\Model\BenefitPayrolled[]', + 'description' => 'string', + 'value' => 'float', + 'employeeContribution' => 'float', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'useProRata' => 'bool', + 'cashEquivalent' => 'float', + 'assetType' => '\SynergiTech\Staffology\Model\BenefitDetailsAssetType', + 'useOfAssetType' => '\SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType', + 'class1AType' => '\SynergiTech\Staffology\Model\BenefitDetailsClass1AType', + 'nonClass1AType' => '\SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType', + 'paymentType' => '\SynergiTech\Staffology\Model\BenefitDetailsPaymentType', + 'tradingOrganisation' => 'bool', + 'cashEquivalentFuel' => 'float', + 'loan' => '\SynergiTech\Staffology\Model\BenefitDetailsLoan', + 'car' => '\SynergiTech\Staffology\Model\BenefitDetailsCar', + 'openingBalance' => 'float', + 'paid' => 'float', + 'bikOutstanding' => 'float', + 'isPeriodValue' => 'bool', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'type' => null, + 'declarationType' => null, + 'benefitPayrolled' => null, + 'description' => null, + 'value' => 'double', + 'employeeContribution' => 'double', + 'startDate' => 'date', + 'endDate' => 'date', + 'useProRata' => null, + 'cashEquivalent' => 'double', + 'assetType' => null, + 'useOfAssetType' => null, + 'class1AType' => null, + 'nonClass1AType' => null, + 'paymentType' => null, + 'tradingOrganisation' => null, + 'cashEquivalentFuel' => 'double', + 'loan' => null, + 'car' => null, + 'openingBalance' => 'double', + 'paid' => 'double', + 'bikOutstanding' => 'double', + 'isPeriodValue' => null, + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'type' => false, + 'declarationType' => false, + 'benefitPayrolled' => true, + 'description' => true, + 'value' => false, + 'employeeContribution' => false, + 'startDate' => true, + 'endDate' => true, + 'useProRata' => false, + 'cashEquivalent' => false, + 'assetType' => false, + 'useOfAssetType' => false, + 'class1AType' => false, + 'nonClass1AType' => false, + 'paymentType' => false, + 'tradingOrganisation' => false, + 'cashEquivalentFuel' => false, + 'loan' => false, + 'car' => false, + 'openingBalance' => false, + 'paid' => false, + 'bikOutstanding' => false, + 'isPeriodValue' => false, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'type' => 'type', + 'declarationType' => 'declarationType', + 'benefitPayrolled' => 'benefitPayrolled', + 'description' => 'description', + 'value' => 'value', + 'employeeContribution' => 'employeeContribution', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'useProRata' => 'useProRata', + 'cashEquivalent' => 'cashEquivalent', + 'assetType' => 'assetType', + 'useOfAssetType' => 'useOfAssetType', + 'class1AType' => 'class1AType', + 'nonClass1AType' => 'nonClass1AType', + 'paymentType' => 'paymentType', + 'tradingOrganisation' => 'tradingOrganisation', + 'cashEquivalentFuel' => 'cashEquivalentFuel', + 'loan' => 'loan', + 'car' => 'car', + 'openingBalance' => 'openingBalance', + 'paid' => 'paid', + 'bikOutstanding' => 'bikOutstanding', + 'isPeriodValue' => 'isPeriodValue', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'type' => 'setType', + 'declarationType' => 'setDeclarationType', + 'benefitPayrolled' => 'setBenefitPayrolled', + 'description' => 'setDescription', + 'value' => 'setValue', + 'employeeContribution' => 'setEmployeeContribution', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'useProRata' => 'setUseProRata', + 'cashEquivalent' => 'setCashEquivalent', + 'assetType' => 'setAssetType', + 'useOfAssetType' => 'setUseOfAssetType', + 'class1AType' => 'setClass1AType', + 'nonClass1AType' => 'setNonClass1AType', + 'paymentType' => 'setPaymentType', + 'tradingOrganisation' => 'setTradingOrganisation', + 'cashEquivalentFuel' => 'setCashEquivalentFuel', + 'loan' => 'setLoan', + 'car' => 'setCar', + 'openingBalance' => 'setOpeningBalance', + 'paid' => 'setPaid', + 'bikOutstanding' => 'setBikOutstanding', + 'isPeriodValue' => 'setIsPeriodValue', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'type' => 'getType', + 'declarationType' => 'getDeclarationType', + 'benefitPayrolled' => 'getBenefitPayrolled', + 'description' => 'getDescription', + 'value' => 'getValue', + 'employeeContribution' => 'getEmployeeContribution', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'useProRata' => 'getUseProRata', + 'cashEquivalent' => 'getCashEquivalent', + 'assetType' => 'getAssetType', + 'useOfAssetType' => 'getUseOfAssetType', + 'class1AType' => 'getClass1AType', + 'nonClass1AType' => 'getNonClass1AType', + 'paymentType' => 'getPaymentType', + 'tradingOrganisation' => 'getTradingOrganisation', + 'cashEquivalentFuel' => 'getCashEquivalentFuel', + 'loan' => 'getLoan', + 'car' => 'getCar', + 'openingBalance' => 'getOpeningBalance', + 'paid' => 'getPaid', + 'bikOutstanding' => 'getBikOutstanding', + 'isPeriodValue' => 'getIsPeriodValue', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('declarationType', $data ?? [], null); + $this->setIfExists('benefitPayrolled', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('employeeContribution', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('useProRata', $data ?? [], null); + $this->setIfExists('cashEquivalent', $data ?? [], null); + $this->setIfExists('assetType', $data ?? [], null); + $this->setIfExists('useOfAssetType', $data ?? [], null); + $this->setIfExists('class1AType', $data ?? [], null); + $this->setIfExists('nonClass1AType', $data ?? [], null); + $this->setIfExists('paymentType', $data ?? [], null); + $this->setIfExists('tradingOrganisation', $data ?? [], null); + $this->setIfExists('cashEquivalentFuel', $data ?? [], null); + $this->setIfExists('loan', $data ?? [], null); + $this->setIfExists('car', $data ?? [], null); + $this->setIfExists('openingBalance', $data ?? [], null); + $this->setIfExists('paid', $data ?? [], null); + $this->setIfExists('bikOutstanding', $data ?? [], null); + $this->setIfExists('isPeriodValue', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 120)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 120."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\BenefitType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\BenefitType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\BenefitType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\BenefitType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets declarationType + * + * @return \SynergiTech\Staffology\Model\BenefitDeclarationType|null + */ + public function getDeclarationType(): ?\SynergiTech\Staffology\Model\BenefitDeclarationType + { + return $this->container['declarationType']; + } + + /** + * Sets declarationType + * + * @param \SynergiTech\Staffology\Model\BenefitDeclarationType|null $declarationType declarationType + * + * @return $this + */ + public function setDeclarationType(?\SynergiTech\Staffology\Model\BenefitDeclarationType $declarationType): static + { + if (is_null($declarationType)) { + throw new InvalidArgumentException('non-nullable declarationType cannot be null'); + } + $this->container['declarationType'] = $declarationType; + + return $this; + } + + /** + * Gets benefitPayrolled + * + * @return \SynergiTech\Staffology\Model\BenefitPayrolled[]|null + */ + public function getBenefitPayrolled(): ?array + { + return $this->container['benefitPayrolled']; + } + + /** + * Sets benefitPayrolled + * + * @param \SynergiTech\Staffology\Model\BenefitPayrolled[]|null $benefitPayrolled benefitPayrolled + * + * @return $this + */ + public function setBenefitPayrolled(?array $benefitPayrolled): static + { + if (is_null($benefitPayrolled)) { + array_push($this->openAPINullablesSetToNull, 'benefitPayrolled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('benefitPayrolled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['benefitPayrolled'] = $benefitPayrolled; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of this benefit + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 120)) { + throw new InvalidArgumentException('invalid length for $description when calling Benefit., must be smaller than or equal to 120.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets employeeContribution + * + * @return float|null + */ + public function getEmployeeContribution(): ?float + { + return $this->container['employeeContribution']; + } + + /** + * Sets employeeContribution + * + * @param float|null $employeeContribution employeeContribution + * + * @return $this + */ + public function setEmployeeContribution(?float $employeeContribution): static + { + if (is_null($employeeContribution)) { + throw new InvalidArgumentException('non-nullable employeeContribution cannot be null'); + } + $this->container['employeeContribution'] = $employeeContribution; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate The date the benefits starts if different to the start date of the TaxYear + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate The date the benefits ends if different to the end date of the TaxYear + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets useProRata + * + * @return bool|null + */ + public function getUseProRata(): ?bool + { + return $this->container['useProRata']; + } + + /** + * Sets useProRata + * + * @param bool|null $useProRata Benefit calculation should be done on pro rata rules + * + * @return $this + */ + public function setUseProRata(?bool $useProRata): static + { + if (is_null($useProRata)) { + throw new InvalidArgumentException('non-nullable useProRata cannot be null'); + } + $this->container['useProRata'] = $useProRata; + + return $this; + } + + /** + * Gets cashEquivalent + * + * @return float|null + */ + public function getCashEquivalent(): ?float + { + return $this->container['cashEquivalent']; + } + + /** + * Sets cashEquivalent + * + * @param float|null $cashEquivalent [readonly] + * + * @return $this + */ + public function setCashEquivalent(?float $cashEquivalent): static + { + if (is_null($cashEquivalent)) { + throw new InvalidArgumentException('non-nullable cashEquivalent cannot be null'); + } + $this->container['cashEquivalent'] = $cashEquivalent; + + return $this; + } + + /** + * Gets assetType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsAssetType|null + */ + public function getAssetType(): ?\SynergiTech\Staffology\Model\BenefitDetailsAssetType + { + return $this->container['assetType']; + } + + /** + * Sets assetType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsAssetType|null $assetType assetType + * + * @return $this + */ + public function setAssetType(?\SynergiTech\Staffology\Model\BenefitDetailsAssetType $assetType): static + { + if (is_null($assetType)) { + throw new InvalidArgumentException('non-nullable assetType cannot be null'); + } + $this->container['assetType'] = $assetType; + + return $this; + } + + /** + * Gets useOfAssetType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType|null + */ + public function getUseOfAssetType(): ?\SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType + { + return $this->container['useOfAssetType']; + } + + /** + * Sets useOfAssetType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType|null $useOfAssetType useOfAssetType + * + * @return $this + */ + public function setUseOfAssetType(?\SynergiTech\Staffology\Model\BenefitDetailsUseOfAssetType $useOfAssetType): static + { + if (is_null($useOfAssetType)) { + throw new InvalidArgumentException('non-nullable useOfAssetType cannot be null'); + } + $this->container['useOfAssetType'] = $useOfAssetType; + + return $this; + } + + /** + * Gets class1AType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsClass1AType|null + */ + public function getClass1AType(): ?\SynergiTech\Staffology\Model\BenefitDetailsClass1AType + { + return $this->container['class1AType']; + } + + /** + * Sets class1AType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsClass1AType|null $class1AType class1AType + * + * @return $this + */ + public function setClass1AType(?\SynergiTech\Staffology\Model\BenefitDetailsClass1AType $class1AType): static + { + if (is_null($class1AType)) { + throw new InvalidArgumentException('non-nullable class1AType cannot be null'); + } + $this->container['class1AType'] = $class1AType; + + return $this; + } + + /** + * Gets nonClass1AType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType|null + */ + public function getNonClass1AType(): ?\SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType + { + return $this->container['nonClass1AType']; + } + + /** + * Sets nonClass1AType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType|null $nonClass1AType nonClass1AType + * + * @return $this + */ + public function setNonClass1AType(?\SynergiTech\Staffology\Model\BenefitDetailsNonClass1AType $nonClass1AType): static + { + if (is_null($nonClass1AType)) { + throw new InvalidArgumentException('non-nullable nonClass1AType cannot be null'); + } + $this->container['nonClass1AType'] = $nonClass1AType; + + return $this; + } + + /** + * Gets paymentType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsPaymentType|null + */ + public function getPaymentType(): ?\SynergiTech\Staffology\Model\BenefitDetailsPaymentType + { + return $this->container['paymentType']; + } + + /** + * Sets paymentType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsPaymentType|null $paymentType paymentType + * + * @return $this + */ + public function setPaymentType(?\SynergiTech\Staffology\Model\BenefitDetailsPaymentType $paymentType): static + { + if (is_null($paymentType)) { + throw new InvalidArgumentException('non-nullable paymentType cannot be null'); + } + $this->container['paymentType'] = $paymentType; + + return $this; + } + + /** + * Gets tradingOrganisation + * + * @return bool|null + */ + public function getTradingOrganisation(): ?bool + { + return $this->container['tradingOrganisation']; + } + + /** + * Sets tradingOrganisation + * + * @param bool|null $tradingOrganisation Only relevant to Benefits with Type Entertainment + * + * @return $this + */ + public function setTradingOrganisation(?bool $tradingOrganisation): static + { + if (is_null($tradingOrganisation)) { + throw new InvalidArgumentException('non-nullable tradingOrganisation cannot be null'); + } + $this->container['tradingOrganisation'] = $tradingOrganisation; + + return $this; + } + + /** + * Gets cashEquivalentFuel + * + * @return float|null + */ + public function getCashEquivalentFuel(): ?float + { + return $this->container['cashEquivalentFuel']; + } + + /** + * Sets cashEquivalentFuel + * + * @param float|null $cashEquivalentFuel Only relevant to Benefits with Type Vans + * + * @return $this + */ + public function setCashEquivalentFuel(?float $cashEquivalentFuel): static + { + if (is_null($cashEquivalentFuel)) { + throw new InvalidArgumentException('non-nullable cashEquivalentFuel cannot be null'); + } + $this->container['cashEquivalentFuel'] = $cashEquivalentFuel; + + return $this; + } + + /** + * Gets loan + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsLoan|null + */ + public function getLoan(): ?\SynergiTech\Staffology\Model\BenefitDetailsLoan + { + return $this->container['loan']; + } + + /** + * Sets loan + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsLoan|null $loan loan + * + * @return $this + */ + public function setLoan(?\SynergiTech\Staffology\Model\BenefitDetailsLoan $loan): static + { + if (is_null($loan)) { + throw new InvalidArgumentException('non-nullable loan cannot be null'); + } + $this->container['loan'] = $loan; + + return $this; + } + + /** + * Gets car + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsCar|null + */ + public function getCar(): ?\SynergiTech\Staffology\Model\BenefitDetailsCar + { + return $this->container['car']; + } + + /** + * Sets car + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsCar|null $car car + * + * @return $this + */ + public function setCar(?\SynergiTech\Staffology\Model\BenefitDetailsCar $car): static + { + if (is_null($car)) { + throw new InvalidArgumentException('non-nullable car cannot be null'); + } + $this->container['car'] = $car; + + return $this; + } + + /** + * Gets openingBalance + * + * @return float|null + */ + public function getOpeningBalance(): ?float + { + return $this->container['openingBalance']; + } + + /** + * Sets openingBalance + * + * @param float|null $openingBalance The amount of benefit paid YTD when setting up a benefit + * + * @return $this + */ + public function setOpeningBalance(?float $openingBalance): static + { + if (is_null($openingBalance)) { + throw new InvalidArgumentException('non-nullable openingBalance cannot be null'); + } + $this->container['openingBalance'] = $openingBalance; + + return $this; + } + + /** + * Gets paid + * + * @return float|null + */ + public function getPaid(): ?float + { + return $this->container['paid']; + } + + /** + * Sets paid + * + * @param float|null $paid [readonly] + * + * @return $this + */ + public function setPaid(?float $paid): static + { + if (is_null($paid)) { + throw new InvalidArgumentException('non-nullable paid cannot be null'); + } + $this->container['paid'] = $paid; + + return $this; + } + + /** + * Gets bikOutstanding + * + * @return float|null + */ + public function getBikOutstanding(): ?float + { + return $this->container['bikOutstanding']; + } + + /** + * Sets bikOutstanding + * + * @param float|null $bikOutstanding [readonly] + * + * @return $this + */ + public function setBikOutstanding(?float $bikOutstanding): static + { + if (is_null($bikOutstanding)) { + throw new InvalidArgumentException('non-nullable bikOutstanding cannot be null'); + } + $this->container['bikOutstanding'] = $bikOutstanding; + + return $this; + } + + /** + * Gets isPeriodValue + * + * @return bool|null + */ + public function getIsPeriodValue(): ?bool + { + return $this->container['isPeriodValue']; + } + + /** + * Sets isPeriodValue + * + * @param bool|null $isPeriodValue To be used for the benefit period + * + * @return $this + */ + public function setIsPeriodValue(?bool $isPeriodValue): static + { + if (is_null($isPeriodValue)) { + throw new InvalidArgumentException('non-nullable isPeriodValue cannot be null'); + } + $this->container['isPeriodValue'] = $isPeriodValue; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BenefitDeclarationType.php b/src/Model/BenefitDeclarationType.php new file mode 100644 index 0000000..e2c17ed --- /dev/null +++ b/src/Model/BenefitDeclarationType.php @@ -0,0 +1,45 @@ + + */ +class BenefitDetailsCar implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BenefitDetailsCar'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'makeAndModel' => 'string', + 'registration' => 'string', + 'firstRegistered' => '\DateTime', + 'hasApprovedEmissionsValue' => 'bool', + 'co2Emissions' => 'int', + 'engineSize' => 'int', + 'zeroEmissionsMileage' => 'int', + 'fuelType' => '\SynergiTech\Staffology\Model\BenefitDetailsCarPowerType', + 'availableFrom' => '\DateTime', + 'availableTo' => '\DateTime', + 'daysUnavailable' => 'int', + 'listPrice' => 'float', + 'nonStandardAccessories' => 'float', + 'employeeCapitalContributions' => 'float', + 'employeePrivateContributions' => 'float', + 'freeFuel' => 'bool', + 'fuelAvailableFrom' => '\DateTime', + 'fuelAvailableTo' => '\DateTime', + 'freeFuelReinstated' => 'bool', + 'registeredPriorTo1998' => 'bool', + 'rate' => 'float', + 'chargeableValue' => 'float', + 'fullYearCharge' => 'float', + 'cashEquivalent' => 'float', + 'cashEquivalentFuel' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'makeAndModel' => null, + 'registration' => null, + 'firstRegistered' => 'date', + 'hasApprovedEmissionsValue' => null, + 'co2Emissions' => 'int32', + 'engineSize' => 'int32', + 'zeroEmissionsMileage' => 'int32', + 'fuelType' => null, + 'availableFrom' => 'date', + 'availableTo' => 'date', + 'daysUnavailable' => 'int32', + 'listPrice' => 'double', + 'nonStandardAccessories' => 'double', + 'employeeCapitalContributions' => 'double', + 'employeePrivateContributions' => 'double', + 'freeFuel' => null, + 'fuelAvailableFrom' => 'date', + 'fuelAvailableTo' => 'date', + 'freeFuelReinstated' => null, + 'registeredPriorTo1998' => null, + 'rate' => 'double', + 'chargeableValue' => 'double', + 'fullYearCharge' => 'double', + 'cashEquivalent' => 'double', + 'cashEquivalentFuel' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'makeAndModel' => true, + 'registration' => true, + 'firstRegistered' => true, + 'hasApprovedEmissionsValue' => false, + 'co2Emissions' => false, + 'engineSize' => false, + 'zeroEmissionsMileage' => false, + 'fuelType' => false, + 'availableFrom' => true, + 'availableTo' => true, + 'daysUnavailable' => false, + 'listPrice' => false, + 'nonStandardAccessories' => false, + 'employeeCapitalContributions' => false, + 'employeePrivateContributions' => false, + 'freeFuel' => false, + 'fuelAvailableFrom' => true, + 'fuelAvailableTo' => true, + 'freeFuelReinstated' => false, + 'registeredPriorTo1998' => false, + 'rate' => false, + 'chargeableValue' => false, + 'fullYearCharge' => false, + 'cashEquivalent' => false, + 'cashEquivalentFuel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'makeAndModel' => 'makeAndModel', + 'registration' => 'registration', + 'firstRegistered' => 'firstRegistered', + 'hasApprovedEmissionsValue' => 'hasApprovedEmissionsValue', + 'co2Emissions' => 'co2Emissions', + 'engineSize' => 'engineSize', + 'zeroEmissionsMileage' => 'zeroEmissionsMileage', + 'fuelType' => 'fuelType', + 'availableFrom' => 'availableFrom', + 'availableTo' => 'availableTo', + 'daysUnavailable' => 'daysUnavailable', + 'listPrice' => 'listPrice', + 'nonStandardAccessories' => 'nonStandardAccessories', + 'employeeCapitalContributions' => 'employeeCapitalContributions', + 'employeePrivateContributions' => 'employeePrivateContributions', + 'freeFuel' => 'freeFuel', + 'fuelAvailableFrom' => 'fuelAvailableFrom', + 'fuelAvailableTo' => 'fuelAvailableTo', + 'freeFuelReinstated' => 'freeFuelReinstated', + 'registeredPriorTo1998' => 'registeredPriorTo1998', + 'rate' => 'rate', + 'chargeableValue' => 'chargeableValue', + 'fullYearCharge' => 'fullYearCharge', + 'cashEquivalent' => 'cashEquivalent', + 'cashEquivalentFuel' => 'cashEquivalentFuel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'makeAndModel' => 'setMakeAndModel', + 'registration' => 'setRegistration', + 'firstRegistered' => 'setFirstRegistered', + 'hasApprovedEmissionsValue' => 'setHasApprovedEmissionsValue', + 'co2Emissions' => 'setCo2Emissions', + 'engineSize' => 'setEngineSize', + 'zeroEmissionsMileage' => 'setZeroEmissionsMileage', + 'fuelType' => 'setFuelType', + 'availableFrom' => 'setAvailableFrom', + 'availableTo' => 'setAvailableTo', + 'daysUnavailable' => 'setDaysUnavailable', + 'listPrice' => 'setListPrice', + 'nonStandardAccessories' => 'setNonStandardAccessories', + 'employeeCapitalContributions' => 'setEmployeeCapitalContributions', + 'employeePrivateContributions' => 'setEmployeePrivateContributions', + 'freeFuel' => 'setFreeFuel', + 'fuelAvailableFrom' => 'setFuelAvailableFrom', + 'fuelAvailableTo' => 'setFuelAvailableTo', + 'freeFuelReinstated' => 'setFreeFuelReinstated', + 'registeredPriorTo1998' => 'setRegisteredPriorTo1998', + 'rate' => 'setRate', + 'chargeableValue' => 'setChargeableValue', + 'fullYearCharge' => 'setFullYearCharge', + 'cashEquivalent' => 'setCashEquivalent', + 'cashEquivalentFuel' => 'setCashEquivalentFuel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'makeAndModel' => 'getMakeAndModel', + 'registration' => 'getRegistration', + 'firstRegistered' => 'getFirstRegistered', + 'hasApprovedEmissionsValue' => 'getHasApprovedEmissionsValue', + 'co2Emissions' => 'getCo2Emissions', + 'engineSize' => 'getEngineSize', + 'zeroEmissionsMileage' => 'getZeroEmissionsMileage', + 'fuelType' => 'getFuelType', + 'availableFrom' => 'getAvailableFrom', + 'availableTo' => 'getAvailableTo', + 'daysUnavailable' => 'getDaysUnavailable', + 'listPrice' => 'getListPrice', + 'nonStandardAccessories' => 'getNonStandardAccessories', + 'employeeCapitalContributions' => 'getEmployeeCapitalContributions', + 'employeePrivateContributions' => 'getEmployeePrivateContributions', + 'freeFuel' => 'getFreeFuel', + 'fuelAvailableFrom' => 'getFuelAvailableFrom', + 'fuelAvailableTo' => 'getFuelAvailableTo', + 'freeFuelReinstated' => 'getFreeFuelReinstated', + 'registeredPriorTo1998' => 'getRegisteredPriorTo1998', + 'rate' => 'getRate', + 'chargeableValue' => 'getChargeableValue', + 'fullYearCharge' => 'getFullYearCharge', + 'cashEquivalent' => 'getCashEquivalent', + 'cashEquivalentFuel' => 'getCashEquivalentFuel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('makeAndModel', $data ?? [], null); + $this->setIfExists('registration', $data ?? [], null); + $this->setIfExists('firstRegistered', $data ?? [], null); + $this->setIfExists('hasApprovedEmissionsValue', $data ?? [], null); + $this->setIfExists('co2Emissions', $data ?? [], null); + $this->setIfExists('engineSize', $data ?? [], null); + $this->setIfExists('zeroEmissionsMileage', $data ?? [], null); + $this->setIfExists('fuelType', $data ?? [], null); + $this->setIfExists('availableFrom', $data ?? [], null); + $this->setIfExists('availableTo', $data ?? [], null); + $this->setIfExists('daysUnavailable', $data ?? [], null); + $this->setIfExists('listPrice', $data ?? [], null); + $this->setIfExists('nonStandardAccessories', $data ?? [], null); + $this->setIfExists('employeeCapitalContributions', $data ?? [], null); + $this->setIfExists('employeePrivateContributions', $data ?? [], null); + $this->setIfExists('freeFuel', $data ?? [], null); + $this->setIfExists('fuelAvailableFrom', $data ?? [], null); + $this->setIfExists('fuelAvailableTo', $data ?? [], null); + $this->setIfExists('freeFuelReinstated', $data ?? [], null); + $this->setIfExists('registeredPriorTo1998', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('chargeableValue', $data ?? [], null); + $this->setIfExists('fullYearCharge', $data ?? [], null); + $this->setIfExists('cashEquivalent', $data ?? [], null); + $this->setIfExists('cashEquivalentFuel', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets makeAndModel + * + * @return string|null + */ + public function getMakeAndModel(): ?string + { + return $this->container['makeAndModel']; + } + + /** + * Sets makeAndModel + * + * @param string|null $makeAndModel makeAndModel + * + * @return $this + */ + public function setMakeAndModel(?string $makeAndModel): static + { + if (is_null($makeAndModel)) { + array_push($this->openAPINullablesSetToNull, 'makeAndModel'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('makeAndModel', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['makeAndModel'] = $makeAndModel; + + return $this; + } + + /** + * Gets registration + * + * @return string|null + */ + public function getRegistration(): ?string + { + return $this->container['registration']; + } + + /** + * Sets registration + * + * @param string|null $registration registration + * + * @return $this + */ + public function setRegistration(?string $registration): static + { + if (is_null($registration)) { + array_push($this->openAPINullablesSetToNull, 'registration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('registration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['registration'] = $registration; + + return $this; + } + + /** + * Gets firstRegistered + * + * @return \DateTime|null + */ + public function getFirstRegistered(): ?\DateTime + { + return $this->container['firstRegistered']; + } + + /** + * Sets firstRegistered + * + * @param \DateTime|null $firstRegistered firstRegistered + * + * @return $this + */ + public function setFirstRegistered(?\DateTime $firstRegistered): static + { + if (is_null($firstRegistered)) { + array_push($this->openAPINullablesSetToNull, 'firstRegistered'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstRegistered', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstRegistered'] = $firstRegistered; + + return $this; + } + + /** + * Gets hasApprovedEmissionsValue + * + * @return bool|null + */ + public function getHasApprovedEmissionsValue(): ?bool + { + return $this->container['hasApprovedEmissionsValue']; + } + + /** + * Sets hasApprovedEmissionsValue + * + * @param bool|null $hasApprovedEmissionsValue hasApprovedEmissionsValue + * + * @return $this + */ + public function setHasApprovedEmissionsValue(?bool $hasApprovedEmissionsValue): static + { + if (is_null($hasApprovedEmissionsValue)) { + throw new InvalidArgumentException('non-nullable hasApprovedEmissionsValue cannot be null'); + } + $this->container['hasApprovedEmissionsValue'] = $hasApprovedEmissionsValue; + + return $this; + } + + /** + * Gets co2Emissions + * + * @return int|null + */ + public function getCo2Emissions(): ?int + { + return $this->container['co2Emissions']; + } + + /** + * Sets co2Emissions + * + * @param int|null $co2Emissions co2Emissions + * + * @return $this + */ + public function setCo2Emissions(?int $co2Emissions): static + { + if (is_null($co2Emissions)) { + throw new InvalidArgumentException('non-nullable co2Emissions cannot be null'); + } + $this->container['co2Emissions'] = $co2Emissions; + + return $this; + } + + /** + * Gets engineSize + * + * @return int|null + */ + public function getEngineSize(): ?int + { + return $this->container['engineSize']; + } + + /** + * Sets engineSize + * + * @param int|null $engineSize engineSize + * + * @return $this + */ + public function setEngineSize(?int $engineSize): static + { + if (is_null($engineSize)) { + throw new InvalidArgumentException('non-nullable engineSize cannot be null'); + } + $this->container['engineSize'] = $engineSize; + + return $this; + } + + /** + * Gets zeroEmissionsMileage + * + * @return int|null + */ + public function getZeroEmissionsMileage(): ?int + { + return $this->container['zeroEmissionsMileage']; + } + + /** + * Sets zeroEmissionsMileage + * + * @param int|null $zeroEmissionsMileage zeroEmissionsMileage + * + * @return $this + */ + public function setZeroEmissionsMileage(?int $zeroEmissionsMileage): static + { + if (is_null($zeroEmissionsMileage)) { + throw new InvalidArgumentException('non-nullable zeroEmissionsMileage cannot be null'); + } + $this->container['zeroEmissionsMileage'] = $zeroEmissionsMileage; + + return $this; + } + + /** + * Gets fuelType + * + * @return \SynergiTech\Staffology\Model\BenefitDetailsCarPowerType|null + */ + public function getFuelType(): ?\SynergiTech\Staffology\Model\BenefitDetailsCarPowerType + { + return $this->container['fuelType']; + } + + /** + * Sets fuelType + * + * @param \SynergiTech\Staffology\Model\BenefitDetailsCarPowerType|null $fuelType fuelType + * + * @return $this + */ + public function setFuelType(?\SynergiTech\Staffology\Model\BenefitDetailsCarPowerType $fuelType): static + { + if (is_null($fuelType)) { + throw new InvalidArgumentException('non-nullable fuelType cannot be null'); + } + $this->container['fuelType'] = $fuelType; + + return $this; + } + + /** + * Gets availableFrom + * + * @return \DateTime|null + */ + public function getAvailableFrom(): ?\DateTime + { + return $this->container['availableFrom']; + } + + /** + * Sets availableFrom + * + * @param \DateTime|null $availableFrom availableFrom + * + * @return $this + */ + public function setAvailableFrom(?\DateTime $availableFrom): static + { + if (is_null($availableFrom)) { + array_push($this->openAPINullablesSetToNull, 'availableFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availableFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availableFrom'] = $availableFrom; + + return $this; + } + + /** + * Gets availableTo + * + * @return \DateTime|null + */ + public function getAvailableTo(): ?\DateTime + { + return $this->container['availableTo']; + } + + /** + * Sets availableTo + * + * @param \DateTime|null $availableTo availableTo + * + * @return $this + */ + public function setAvailableTo(?\DateTime $availableTo): static + { + if (is_null($availableTo)) { + array_push($this->openAPINullablesSetToNull, 'availableTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availableTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availableTo'] = $availableTo; + + return $this; + } + + /** + * Gets daysUnavailable + * + * @return int|null + */ + public function getDaysUnavailable(): ?int + { + return $this->container['daysUnavailable']; + } + + /** + * Sets daysUnavailable + * + * @param int|null $daysUnavailable daysUnavailable + * + * @return $this + */ + public function setDaysUnavailable(?int $daysUnavailable): static + { + if (is_null($daysUnavailable)) { + throw new InvalidArgumentException('non-nullable daysUnavailable cannot be null'); + } + $this->container['daysUnavailable'] = $daysUnavailable; + + return $this; + } + + /** + * Gets listPrice + * + * @return float|null + */ + public function getListPrice(): ?float + { + return $this->container['listPrice']; + } + + /** + * Sets listPrice + * + * @param float|null $listPrice listPrice + * + * @return $this + */ + public function setListPrice(?float $listPrice): static + { + if (is_null($listPrice)) { + throw new InvalidArgumentException('non-nullable listPrice cannot be null'); + } + $this->container['listPrice'] = $listPrice; + + return $this; + } + + /** + * Gets nonStandardAccessories + * + * @return float|null + */ + public function getNonStandardAccessories(): ?float + { + return $this->container['nonStandardAccessories']; + } + + /** + * Sets nonStandardAccessories + * + * @param float|null $nonStandardAccessories nonStandardAccessories + * + * @return $this + */ + public function setNonStandardAccessories(?float $nonStandardAccessories): static + { + if (is_null($nonStandardAccessories)) { + throw new InvalidArgumentException('non-nullable nonStandardAccessories cannot be null'); + } + $this->container['nonStandardAccessories'] = $nonStandardAccessories; + + return $this; + } + + /** + * Gets employeeCapitalContributions + * + * @return float|null + */ + public function getEmployeeCapitalContributions(): ?float + { + return $this->container['employeeCapitalContributions']; + } + + /** + * Sets employeeCapitalContributions + * + * @param float|null $employeeCapitalContributions employeeCapitalContributions + * + * @return $this + */ + public function setEmployeeCapitalContributions(?float $employeeCapitalContributions): static + { + if (is_null($employeeCapitalContributions)) { + throw new InvalidArgumentException('non-nullable employeeCapitalContributions cannot be null'); + } + $this->container['employeeCapitalContributions'] = $employeeCapitalContributions; + + return $this; + } + + /** + * Gets employeePrivateContributions + * + * @return float|null + */ + public function getEmployeePrivateContributions(): ?float + { + return $this->container['employeePrivateContributions']; + } + + /** + * Sets employeePrivateContributions + * + * @param float|null $employeePrivateContributions employeePrivateContributions + * + * @return $this + */ + public function setEmployeePrivateContributions(?float $employeePrivateContributions): static + { + if (is_null($employeePrivateContributions)) { + throw new InvalidArgumentException('non-nullable employeePrivateContributions cannot be null'); + } + $this->container['employeePrivateContributions'] = $employeePrivateContributions; + + return $this; + } + + /** + * Gets freeFuel + * + * @return bool|null + */ + public function getFreeFuel(): ?bool + { + return $this->container['freeFuel']; + } + + /** + * Sets freeFuel + * + * @param bool|null $freeFuel freeFuel + * + * @return $this + */ + public function setFreeFuel(?bool $freeFuel): static + { + if (is_null($freeFuel)) { + throw new InvalidArgumentException('non-nullable freeFuel cannot be null'); + } + $this->container['freeFuel'] = $freeFuel; + + return $this; + } + + /** + * Gets fuelAvailableFrom + * + * @return \DateTime|null + */ + public function getFuelAvailableFrom(): ?\DateTime + { + return $this->container['fuelAvailableFrom']; + } + + /** + * Sets fuelAvailableFrom + * + * @param \DateTime|null $fuelAvailableFrom fuelAvailableFrom + * + * @return $this + */ + public function setFuelAvailableFrom(?\DateTime $fuelAvailableFrom): static + { + if (is_null($fuelAvailableFrom)) { + array_push($this->openAPINullablesSetToNull, 'fuelAvailableFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuelAvailableFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuelAvailableFrom'] = $fuelAvailableFrom; + + return $this; + } + + /** + * Gets fuelAvailableTo + * + * @return \DateTime|null + */ + public function getFuelAvailableTo(): ?\DateTime + { + return $this->container['fuelAvailableTo']; + } + + /** + * Sets fuelAvailableTo + * + * @param \DateTime|null $fuelAvailableTo fuelAvailableTo + * + * @return $this + */ + public function setFuelAvailableTo(?\DateTime $fuelAvailableTo): static + { + if (is_null($fuelAvailableTo)) { + array_push($this->openAPINullablesSetToNull, 'fuelAvailableTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuelAvailableTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuelAvailableTo'] = $fuelAvailableTo; + + return $this; + } + + /** + * Gets freeFuelReinstated + * + * @return bool|null + */ + public function getFreeFuelReinstated(): ?bool + { + return $this->container['freeFuelReinstated']; + } + + /** + * Sets freeFuelReinstated + * + * @param bool|null $freeFuelReinstated freeFuelReinstated + * + * @return $this + */ + public function setFreeFuelReinstated(?bool $freeFuelReinstated): static + { + if (is_null($freeFuelReinstated)) { + throw new InvalidArgumentException('non-nullable freeFuelReinstated cannot be null'); + } + $this->container['freeFuelReinstated'] = $freeFuelReinstated; + + return $this; + } + + /** + * Gets registeredPriorTo1998 + * + * @return bool|null + */ + public function getRegisteredPriorTo1998(): ?bool + { + return $this->container['registeredPriorTo1998']; + } + + /** + * Sets registeredPriorTo1998 + * + * @param bool|null $registeredPriorTo1998 [readonly] + * + * @return $this + */ + public function setRegisteredPriorTo1998(?bool $registeredPriorTo1998): static + { + if (is_null($registeredPriorTo1998)) { + throw new InvalidArgumentException('non-nullable registeredPriorTo1998 cannot be null'); + } + $this->container['registeredPriorTo1998'] = $registeredPriorTo1998; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate [readonly] The applicable rate based on CO2Emissions and Engine Size + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets chargeableValue + * + * @return float|null + */ + public function getChargeableValue(): ?float + { + return $this->container['chargeableValue']; + } + + /** + * Sets chargeableValue + * + * @param float|null $chargeableValue [readonly] The chargeable value of the car + * + * @return $this + */ + public function setChargeableValue(?float $chargeableValue): static + { + if (is_null($chargeableValue)) { + throw new InvalidArgumentException('non-nullable chargeableValue cannot be null'); + } + $this->container['chargeableValue'] = $chargeableValue; + + return $this; + } + + /** + * Gets fullYearCharge + * + * @return float|null + */ + public function getFullYearCharge(): ?float + { + return $this->container['fullYearCharge']; + } + + /** + * Sets fullYearCharge + * + * @param float|null $fullYearCharge [readonly] The charge for the car for a full year, not taking in to account available dates or EmployeePrivateContributions + * + * @return $this + */ + public function setFullYearCharge(?float $fullYearCharge): static + { + if (is_null($fullYearCharge)) { + throw new InvalidArgumentException('non-nullable fullYearCharge cannot be null'); + } + $this->container['fullYearCharge'] = $fullYearCharge; + + return $this; + } + + /** + * Gets cashEquivalent + * + * @return float|null + */ + public function getCashEquivalent(): ?float + { + return $this->container['cashEquivalent']; + } + + /** + * Sets cashEquivalent + * + * @param float|null $cashEquivalent [readonly] + * + * @return $this + */ + public function setCashEquivalent(?float $cashEquivalent): static + { + if (is_null($cashEquivalent)) { + throw new InvalidArgumentException('non-nullable cashEquivalent cannot be null'); + } + $this->container['cashEquivalent'] = $cashEquivalent; + + return $this; + } + + /** + * Gets cashEquivalentFuel + * + * @return float|null + */ + public function getCashEquivalentFuel(): ?float + { + return $this->container['cashEquivalentFuel']; + } + + /** + * Sets cashEquivalentFuel + * + * @param float|null $cashEquivalentFuel [readonly] + * + * @return $this + */ + public function setCashEquivalentFuel(?float $cashEquivalentFuel): static + { + if (is_null($cashEquivalentFuel)) { + throw new InvalidArgumentException('non-nullable cashEquivalentFuel cannot be null'); + } + $this->container['cashEquivalentFuel'] = $cashEquivalentFuel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BenefitDetailsCarPowerType.php b/src/Model/BenefitDetailsCarPowerType.php new file mode 100644 index 0000000..e77e4f8 --- /dev/null +++ b/src/Model/BenefitDetailsCarPowerType.php @@ -0,0 +1,51 @@ + + */ +class BenefitDetailsLoan implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BenefitDetailsLoan'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'numberOfJointBorrowers' => 'int', + 'loanMade' => '\DateTime', + 'loanDischarged' => '\DateTime', + 'startingBalance' => 'float', + 'closingBalance' => 'float', + 'maxBalanceInYear' => 'float', + 'interestPaid' => 'float', + 'cashEquivalent' => 'float', + 'fullTaxMonths' => 'int', + 'monthlyValue' => 'float', + 'officialInterest' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'numberOfJointBorrowers' => 'int32', + 'loanMade' => 'date', + 'loanDischarged' => 'date', + 'startingBalance' => 'double', + 'closingBalance' => 'double', + 'maxBalanceInYear' => 'double', + 'interestPaid' => 'double', + 'cashEquivalent' => 'double', + 'fullTaxMonths' => 'int32', + 'monthlyValue' => 'double', + 'officialInterest' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'numberOfJointBorrowers' => true, + 'loanMade' => true, + 'loanDischarged' => true, + 'startingBalance' => false, + 'closingBalance' => false, + 'maxBalanceInYear' => false, + 'interestPaid' => false, + 'cashEquivalent' => false, + 'fullTaxMonths' => false, + 'monthlyValue' => false, + 'officialInterest' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'numberOfJointBorrowers' => 'numberOfJointBorrowers', + 'loanMade' => 'loanMade', + 'loanDischarged' => 'loanDischarged', + 'startingBalance' => 'startingBalance', + 'closingBalance' => 'closingBalance', + 'maxBalanceInYear' => 'maxBalanceInYear', + 'interestPaid' => 'interestPaid', + 'cashEquivalent' => 'cashEquivalent', + 'fullTaxMonths' => 'fullTaxMonths', + 'monthlyValue' => 'monthlyValue', + 'officialInterest' => 'officialInterest' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'numberOfJointBorrowers' => 'setNumberOfJointBorrowers', + 'loanMade' => 'setLoanMade', + 'loanDischarged' => 'setLoanDischarged', + 'startingBalance' => 'setStartingBalance', + 'closingBalance' => 'setClosingBalance', + 'maxBalanceInYear' => 'setMaxBalanceInYear', + 'interestPaid' => 'setInterestPaid', + 'cashEquivalent' => 'setCashEquivalent', + 'fullTaxMonths' => 'setFullTaxMonths', + 'monthlyValue' => 'setMonthlyValue', + 'officialInterest' => 'setOfficialInterest' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'numberOfJointBorrowers' => 'getNumberOfJointBorrowers', + 'loanMade' => 'getLoanMade', + 'loanDischarged' => 'getLoanDischarged', + 'startingBalance' => 'getStartingBalance', + 'closingBalance' => 'getClosingBalance', + 'maxBalanceInYear' => 'getMaxBalanceInYear', + 'interestPaid' => 'getInterestPaid', + 'cashEquivalent' => 'getCashEquivalent', + 'fullTaxMonths' => 'getFullTaxMonths', + 'monthlyValue' => 'getMonthlyValue', + 'officialInterest' => 'getOfficialInterest' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('numberOfJointBorrowers', $data ?? [], null); + $this->setIfExists('loanMade', $data ?? [], null); + $this->setIfExists('loanDischarged', $data ?? [], null); + $this->setIfExists('startingBalance', $data ?? [], null); + $this->setIfExists('closingBalance', $data ?? [], null); + $this->setIfExists('maxBalanceInYear', $data ?? [], null); + $this->setIfExists('interestPaid', $data ?? [], null); + $this->setIfExists('cashEquivalent', $data ?? [], null); + $this->setIfExists('fullTaxMonths', $data ?? [], null); + $this->setIfExists('monthlyValue', $data ?? [], null); + $this->setIfExists('officialInterest', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets numberOfJointBorrowers + * + * @return int|null + */ + public function getNumberOfJointBorrowers(): ?int + { + return $this->container['numberOfJointBorrowers']; + } + + /** + * Sets numberOfJointBorrowers + * + * @param int|null $numberOfJointBorrowers numberOfJointBorrowers + * + * @return $this + */ + public function setNumberOfJointBorrowers(?int $numberOfJointBorrowers): static + { + if (is_null($numberOfJointBorrowers)) { + array_push($this->openAPINullablesSetToNull, 'numberOfJointBorrowers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('numberOfJointBorrowers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['numberOfJointBorrowers'] = $numberOfJointBorrowers; + + return $this; + } + + /** + * Gets loanMade + * + * @return \DateTime|null + */ + public function getLoanMade(): ?\DateTime + { + return $this->container['loanMade']; + } + + /** + * Sets loanMade + * + * @param \DateTime|null $loanMade loanMade + * + * @return $this + */ + public function setLoanMade(?\DateTime $loanMade): static + { + if (is_null($loanMade)) { + array_push($this->openAPINullablesSetToNull, 'loanMade'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loanMade', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loanMade'] = $loanMade; + + return $this; + } + + /** + * Gets loanDischarged + * + * @return \DateTime|null + */ + public function getLoanDischarged(): ?\DateTime + { + return $this->container['loanDischarged']; + } + + /** + * Sets loanDischarged + * + * @param \DateTime|null $loanDischarged loanDischarged + * + * @return $this + */ + public function setLoanDischarged(?\DateTime $loanDischarged): static + { + if (is_null($loanDischarged)) { + array_push($this->openAPINullablesSetToNull, 'loanDischarged'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loanDischarged', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loanDischarged'] = $loanDischarged; + + return $this; + } + + /** + * Gets startingBalance + * + * @return float|null + */ + public function getStartingBalance(): ?float + { + return $this->container['startingBalance']; + } + + /** + * Sets startingBalance + * + * @param float|null $startingBalance startingBalance + * + * @return $this + */ + public function setStartingBalance(?float $startingBalance): static + { + if (is_null($startingBalance)) { + throw new InvalidArgumentException('non-nullable startingBalance cannot be null'); + } + $this->container['startingBalance'] = $startingBalance; + + return $this; + } + + /** + * Gets closingBalance + * + * @return float|null + */ + public function getClosingBalance(): ?float + { + return $this->container['closingBalance']; + } + + /** + * Sets closingBalance + * + * @param float|null $closingBalance closingBalance + * + * @return $this + */ + public function setClosingBalance(?float $closingBalance): static + { + if (is_null($closingBalance)) { + throw new InvalidArgumentException('non-nullable closingBalance cannot be null'); + } + $this->container['closingBalance'] = $closingBalance; + + return $this; + } + + /** + * Gets maxBalanceInYear + * + * @return float|null + */ + public function getMaxBalanceInYear(): ?float + { + return $this->container['maxBalanceInYear']; + } + + /** + * Sets maxBalanceInYear + * + * @param float|null $maxBalanceInYear maxBalanceInYear + * + * @return $this + */ + public function setMaxBalanceInYear(?float $maxBalanceInYear): static + { + if (is_null($maxBalanceInYear)) { + throw new InvalidArgumentException('non-nullable maxBalanceInYear cannot be null'); + } + $this->container['maxBalanceInYear'] = $maxBalanceInYear; + + return $this; + } + + /** + * Gets interestPaid + * + * @return float|null + */ + public function getInterestPaid(): ?float + { + return $this->container['interestPaid']; + } + + /** + * Sets interestPaid + * + * @param float|null $interestPaid interestPaid + * + * @return $this + */ + public function setInterestPaid(?float $interestPaid): static + { + if (is_null($interestPaid)) { + throw new InvalidArgumentException('non-nullable interestPaid cannot be null'); + } + $this->container['interestPaid'] = $interestPaid; + + return $this; + } + + /** + * Gets cashEquivalent + * + * @return float|null + */ + public function getCashEquivalent(): ?float + { + return $this->container['cashEquivalent']; + } + + /** + * Sets cashEquivalent + * + * @param float|null $cashEquivalent [readonly] + * + * @return $this + */ + public function setCashEquivalent(?float $cashEquivalent): static + { + if (is_null($cashEquivalent)) { + throw new InvalidArgumentException('non-nullable cashEquivalent cannot be null'); + } + $this->container['cashEquivalent'] = $cashEquivalent; + + return $this; + } + + /** + * Gets fullTaxMonths + * + * @return int|null + */ + public function getFullTaxMonths(): ?int + { + return $this->container['fullTaxMonths']; + } + + /** + * Sets fullTaxMonths + * + * @param int|null $fullTaxMonths [readonly] + * + * @return $this + */ + public function setFullTaxMonths(?int $fullTaxMonths): static + { + if (is_null($fullTaxMonths)) { + throw new InvalidArgumentException('non-nullable fullTaxMonths cannot be null'); + } + $this->container['fullTaxMonths'] = $fullTaxMonths; + + return $this; + } + + /** + * Gets monthlyValue + * + * @return float|null + */ + public function getMonthlyValue(): ?float + { + return $this->container['monthlyValue']; + } + + /** + * Sets monthlyValue + * + * @param float|null $monthlyValue [readonly] + * + * @return $this + */ + public function setMonthlyValue(?float $monthlyValue): static + { + if (is_null($monthlyValue)) { + throw new InvalidArgumentException('non-nullable monthlyValue cannot be null'); + } + $this->container['monthlyValue'] = $monthlyValue; + + return $this; + } + + /** + * Gets officialInterest + * + * @return float|null + */ + public function getOfficialInterest(): ?float + { + return $this->container['officialInterest']; + } + + /** + * Sets officialInterest + * + * @param float|null $officialInterest [readonly] + * + * @return $this + */ + public function setOfficialInterest(?float $officialInterest): static + { + if (is_null($officialInterest)) { + throw new InvalidArgumentException('non-nullable officialInterest cannot be null'); + } + $this->container['officialInterest'] = $officialInterest; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BenefitDetailsNonClass1AType.php b/src/Model/BenefitDetailsNonClass1AType.php new file mode 100644 index 0000000..1970eeb --- /dev/null +++ b/src/Model/BenefitDetailsNonClass1AType.php @@ -0,0 +1,53 @@ + + */ +class BenefitPayrolled implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BenefitPayrolled'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'amount' => 'float', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'amount' => 'double', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'amount' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'amount' => 'amount', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'amount' => 'setAmount', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'amount' => 'getAmount', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount amount + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/BenefitType.php b/src/Model/BenefitType.php new file mode 100644 index 0000000..17807fc --- /dev/null +++ b/src/Model/BenefitType.php @@ -0,0 +1,83 @@ + + */ +class BureauSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BureauSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'enableApprovals' => 'bool', + 'processorUserId' => 'string', + 'reportPackId' => 'string', + 'isBacsClient' => 'bool', + 'isBacsClientForHmrc' => 'bool', + 'showContactCard' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'enableApprovals' => null, + 'processorUserId' => 'uuid', + 'reportPackId' => 'uuid', + 'isBacsClient' => null, + 'isBacsClientForHmrc' => null, + 'showContactCard' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'enableApprovals' => false, + 'processorUserId' => true, + 'reportPackId' => true, + 'isBacsClient' => false, + 'isBacsClientForHmrc' => false, + 'showContactCard' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'enableApprovals' => 'enableApprovals', + 'processorUserId' => 'processorUserId', + 'reportPackId' => 'reportPackId', + 'isBacsClient' => 'isBacsClient', + 'isBacsClientForHmrc' => 'isBacsClientForHmrc', + 'showContactCard' => 'showContactCard', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'enableApprovals' => 'setEnableApprovals', + 'processorUserId' => 'setProcessorUserId', + 'reportPackId' => 'setReportPackId', + 'isBacsClient' => 'setIsBacsClient', + 'isBacsClientForHmrc' => 'setIsBacsClientForHmrc', + 'showContactCard' => 'setShowContactCard', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'enableApprovals' => 'getEnableApprovals', + 'processorUserId' => 'getProcessorUserId', + 'reportPackId' => 'getReportPackId', + 'isBacsClient' => 'getIsBacsClient', + 'isBacsClientForHmrc' => 'getIsBacsClientForHmrc', + 'showContactCard' => 'getShowContactCard', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enableApprovals', $data ?? [], null); + $this->setIfExists('processorUserId', $data ?? [], null); + $this->setIfExists('reportPackId', $data ?? [], null); + $this->setIfExists('isBacsClient', $data ?? [], null); + $this->setIfExists('isBacsClientForHmrc', $data ?? [], null); + $this->setIfExists('showContactCard', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enableApprovals + * + * @return bool|null + */ + public function getEnableApprovals(): ?bool + { + return $this->container['enableApprovals']; + } + + /** + * Sets enableApprovals + * + * @param bool|null $enableApprovals Whether or not Payruns for this employer need to go through an Approval process + * + * @return $this + */ + public function setEnableApprovals(?bool $enableApprovals): static + { + if (is_null($enableApprovals)) { + throw new InvalidArgumentException('non-nullable enableApprovals cannot be null'); + } + $this->container['enableApprovals'] = $enableApprovals; + + return $this; + } + + /** + * Gets processorUserId + * + * @return string|null + */ + public function getProcessorUserId(): ?string + { + return $this->container['processorUserId']; + } + + /** + * Sets processorUserId + * + * @param string|null $processorUserId The Id of the user, if any, that is the allocated Processor + * + * @return $this + */ + public function setProcessorUserId(?string $processorUserId): static + { + if (is_null($processorUserId)) { + array_push($this->openAPINullablesSetToNull, 'processorUserId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('processorUserId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['processorUserId'] = $processorUserId; + + return $this; + } + + /** + * Gets reportPackId + * + * @return string|null + */ + public function getReportPackId(): ?string + { + return $this->container['reportPackId']; + } + + /** + * Sets reportPackId + * + * @param string|null $reportPackId The Id of the ReportPack, if any, to present to the Payroll Client + * + * @return $this + */ + public function setReportPackId(?string $reportPackId): static + { + if (is_null($reportPackId)) { + array_push($this->openAPINullablesSetToNull, 'reportPackId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reportPackId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reportPackId'] = $reportPackId; + + return $this; + } + + /** + * Gets isBacsClient + * + * @return bool|null + */ + public function getIsBacsClient(): ?bool + { + return $this->container['isBacsClient']; + } + + /** + * Sets isBacsClient + * + * @param bool|null $isBacsClient Indicates that the bureau is responsible for BACS payments of net wages to employees + * + * @return $this + */ + public function setIsBacsClient(?bool $isBacsClient): static + { + if (is_null($isBacsClient)) { + throw new InvalidArgumentException('non-nullable isBacsClient cannot be null'); + } + $this->container['isBacsClient'] = $isBacsClient; + + return $this; + } + + /** + * Gets isBacsClientForHmrc + * + * @return bool|null + */ + public function getIsBacsClientForHmrc(): ?bool + { + return $this->container['isBacsClientForHmrc']; + } + + /** + * Sets isBacsClientForHmrc + * + * @param bool|null $isBacsClientForHmrc Indicates that the bureau is responsible for BACS payments of HMRC liabilites + * + * @return $this + */ + public function setIsBacsClientForHmrc(?bool $isBacsClientForHmrc): static + { + if (is_null($isBacsClientForHmrc)) { + throw new InvalidArgumentException('non-nullable isBacsClientForHmrc cannot be null'); + } + $this->container['isBacsClientForHmrc'] = $isBacsClientForHmrc; + + return $this; + } + + /** + * Gets showContactCard + * + * @return bool|null + */ + public function getShowContactCard(): ?bool + { + return $this->container['showContactCard']; + } + + /** + * Sets showContactCard + * + * @param bool|null $showContactCard Show a Contact card with the Processors details on the PayrollClient dashboard + * + * @return $this + */ + public function setShowContactCard(?bool $showContactCard): static + { + if (is_null($showContactCard)) { + throw new InvalidArgumentException('non-nullable showContactCard cannot be null'); + } + $this->container['showContactCard'] = $showContactCard; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CISSubContractorType.php b/src/Model/CISSubContractorType.php new file mode 100644 index 0000000..9bbb6cc --- /dev/null +++ b/src/Model/CISSubContractorType.php @@ -0,0 +1,49 @@ + + */ +class CalendarEntry implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CalendarEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'start' => '\DateTime', + 'end' => '\DateTime', + 'type' => '\SynergiTech\Staffology\Model\CalendarEntryType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'start' => 'date', + 'end' => 'date', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => true, + 'start' => false, + 'end' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'start' => 'start', + 'end' => 'end', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'start' => 'setStart', + 'end' => 'setEnd', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'start' => 'getStart', + 'end' => 'getEnd', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('start', $data ?? [], null); + $this->setIfExists('end', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets start + * + * @return \DateTime|null + */ + public function getStart(): ?\DateTime + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param \DateTime|null $start start + * + * @return $this + */ + public function setStart(?\DateTime $start): static + { + if (is_null($start)) { + throw new InvalidArgumentException('non-nullable start cannot be null'); + } + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets end + * + * @return \DateTime|null + */ + public function getEnd(): ?\DateTime + { + return $this->container['end']; + } + + /** + * Sets end + * + * @param \DateTime|null $end end + * + * @return $this + */ + public function setEnd(?\DateTime $end): static + { + if (is_null($end)) { + throw new InvalidArgumentException('non-nullable end cannot be null'); + } + $this->container['end'] = $end; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\CalendarEntryType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\CalendarEntryType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\CalendarEntryType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\CalendarEntryType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CalendarEntryType.php b/src/Model/CalendarEntryType.php new file mode 100644 index 0000000..ee8c174 --- /dev/null +++ b/src/Model/CalendarEntryType.php @@ -0,0 +1,53 @@ + + */ +class CarCharge implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CarCharge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'dieselSurcharge' => 'float', + 'maxCharge' => 'float', + 'minCharge' => 'float', + 'fuelCharge' => 'float', + 'newCarRateReductionDate' => '\DateTime', + 'newCarRateReductionAmount' => 'float', + 'co2Table' => '\SynergiTech\Staffology\Model\CarChargeRate[]', + 'engineSizeTable' => '\SynergiTech\Staffology\Model\CarChargeRate[]', + 'zeroEmissionsTable' => '\SynergiTech\Staffology\Model\CarChargeRate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'dieselSurcharge' => 'double', + 'maxCharge' => 'double', + 'minCharge' => 'double', + 'fuelCharge' => 'double', + 'newCarRateReductionDate' => 'date', + 'newCarRateReductionAmount' => 'double', + 'co2Table' => null, + 'engineSizeTable' => null, + 'zeroEmissionsTable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'dieselSurcharge' => false, + 'maxCharge' => false, + 'minCharge' => false, + 'fuelCharge' => false, + 'newCarRateReductionDate' => true, + 'newCarRateReductionAmount' => false, + 'co2Table' => true, + 'engineSizeTable' => true, + 'zeroEmissionsTable' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'dieselSurcharge' => 'dieselSurcharge', + 'maxCharge' => 'maxCharge', + 'minCharge' => 'minCharge', + 'fuelCharge' => 'fuelCharge', + 'newCarRateReductionDate' => 'newCarRateReductionDate', + 'newCarRateReductionAmount' => 'newCarRateReductionAmount', + 'co2Table' => 'co2Table', + 'engineSizeTable' => 'engineSizeTable', + 'zeroEmissionsTable' => 'zeroEmissionsTable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'dieselSurcharge' => 'setDieselSurcharge', + 'maxCharge' => 'setMaxCharge', + 'minCharge' => 'setMinCharge', + 'fuelCharge' => 'setFuelCharge', + 'newCarRateReductionDate' => 'setNewCarRateReductionDate', + 'newCarRateReductionAmount' => 'setNewCarRateReductionAmount', + 'co2Table' => 'setCo2Table', + 'engineSizeTable' => 'setEngineSizeTable', + 'zeroEmissionsTable' => 'setZeroEmissionsTable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'dieselSurcharge' => 'getDieselSurcharge', + 'maxCharge' => 'getMaxCharge', + 'minCharge' => 'getMinCharge', + 'fuelCharge' => 'getFuelCharge', + 'newCarRateReductionDate' => 'getNewCarRateReductionDate', + 'newCarRateReductionAmount' => 'getNewCarRateReductionAmount', + 'co2Table' => 'getCo2Table', + 'engineSizeTable' => 'getEngineSizeTable', + 'zeroEmissionsTable' => 'getZeroEmissionsTable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('dieselSurcharge', $data ?? [], null); + $this->setIfExists('maxCharge', $data ?? [], null); + $this->setIfExists('minCharge', $data ?? [], null); + $this->setIfExists('fuelCharge', $data ?? [], null); + $this->setIfExists('newCarRateReductionDate', $data ?? [], null); + $this->setIfExists('newCarRateReductionAmount', $data ?? [], null); + $this->setIfExists('co2Table', $data ?? [], null); + $this->setIfExists('engineSizeTable', $data ?? [], null); + $this->setIfExists('zeroEmissionsTable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dieselSurcharge + * + * @return float|null + */ + public function getDieselSurcharge(): ?float + { + return $this->container['dieselSurcharge']; + } + + /** + * Sets dieselSurcharge + * + * @param float|null $dieselSurcharge dieselSurcharge + * + * @return $this + */ + public function setDieselSurcharge(?float $dieselSurcharge): static + { + if (is_null($dieselSurcharge)) { + throw new InvalidArgumentException('non-nullable dieselSurcharge cannot be null'); + } + $this->container['dieselSurcharge'] = $dieselSurcharge; + + return $this; + } + + /** + * Gets maxCharge + * + * @return float|null + */ + public function getMaxCharge(): ?float + { + return $this->container['maxCharge']; + } + + /** + * Sets maxCharge + * + * @param float|null $maxCharge maxCharge + * + * @return $this + */ + public function setMaxCharge(?float $maxCharge): static + { + if (is_null($maxCharge)) { + throw new InvalidArgumentException('non-nullable maxCharge cannot be null'); + } + $this->container['maxCharge'] = $maxCharge; + + return $this; + } + + /** + * Gets minCharge + * + * @return float|null + */ + public function getMinCharge(): ?float + { + return $this->container['minCharge']; + } + + /** + * Sets minCharge + * + * @param float|null $minCharge minCharge + * + * @return $this + */ + public function setMinCharge(?float $minCharge): static + { + if (is_null($minCharge)) { + throw new InvalidArgumentException('non-nullable minCharge cannot be null'); + } + $this->container['minCharge'] = $minCharge; + + return $this; + } + + /** + * Gets fuelCharge + * + * @return float|null + */ + public function getFuelCharge(): ?float + { + return $this->container['fuelCharge']; + } + + /** + * Sets fuelCharge + * + * @param float|null $fuelCharge fuelCharge + * + * @return $this + */ + public function setFuelCharge(?float $fuelCharge): static + { + if (is_null($fuelCharge)) { + throw new InvalidArgumentException('non-nullable fuelCharge cannot be null'); + } + $this->container['fuelCharge'] = $fuelCharge; + + return $this; + } + + /** + * Gets newCarRateReductionDate + * + * @return \DateTime|null + */ + public function getNewCarRateReductionDate(): ?\DateTime + { + return $this->container['newCarRateReductionDate']; + } + + /** + * Sets newCarRateReductionDate + * + * @param \DateTime|null $newCarRateReductionDate newCarRateReductionDate + * + * @return $this + */ + public function setNewCarRateReductionDate(?\DateTime $newCarRateReductionDate): static + { + if (is_null($newCarRateReductionDate)) { + array_push($this->openAPINullablesSetToNull, 'newCarRateReductionDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('newCarRateReductionDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['newCarRateReductionDate'] = $newCarRateReductionDate; + + return $this; + } + + /** + * Gets newCarRateReductionAmount + * + * @return float|null + */ + public function getNewCarRateReductionAmount(): ?float + { + return $this->container['newCarRateReductionAmount']; + } + + /** + * Sets newCarRateReductionAmount + * + * @param float|null $newCarRateReductionAmount newCarRateReductionAmount + * + * @return $this + */ + public function setNewCarRateReductionAmount(?float $newCarRateReductionAmount): static + { + if (is_null($newCarRateReductionAmount)) { + throw new InvalidArgumentException('non-nullable newCarRateReductionAmount cannot be null'); + } + $this->container['newCarRateReductionAmount'] = $newCarRateReductionAmount; + + return $this; + } + + /** + * Gets co2Table + * + * @return \SynergiTech\Staffology\Model\CarChargeRate[]|null + */ + public function getCo2Table(): ?array + { + return $this->container['co2Table']; + } + + /** + * Sets co2Table + * + * @param \SynergiTech\Staffology\Model\CarChargeRate[]|null $co2Table co2Table + * + * @return $this + */ + public function setCo2Table(?array $co2Table): static + { + if (is_null($co2Table)) { + array_push($this->openAPINullablesSetToNull, 'co2Table'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('co2Table', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['co2Table'] = $co2Table; + + return $this; + } + + /** + * Gets engineSizeTable + * + * @return \SynergiTech\Staffology\Model\CarChargeRate[]|null + */ + public function getEngineSizeTable(): ?array + { + return $this->container['engineSizeTable']; + } + + /** + * Sets engineSizeTable + * + * @param \SynergiTech\Staffology\Model\CarChargeRate[]|null $engineSizeTable engineSizeTable + * + * @return $this + */ + public function setEngineSizeTable(?array $engineSizeTable): static + { + if (is_null($engineSizeTable)) { + array_push($this->openAPINullablesSetToNull, 'engineSizeTable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('engineSizeTable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['engineSizeTable'] = $engineSizeTable; + + return $this; + } + + /** + * Gets zeroEmissionsTable + * + * @return \SynergiTech\Staffology\Model\CarChargeRate[]|null + */ + public function getZeroEmissionsTable(): ?array + { + return $this->container['zeroEmissionsTable']; + } + + /** + * Sets zeroEmissionsTable + * + * @param \SynergiTech\Staffology\Model\CarChargeRate[]|null $zeroEmissionsTable zeroEmissionsTable + * + * @return $this + */ + public function setZeroEmissionsTable(?array $zeroEmissionsTable): static + { + if (is_null($zeroEmissionsTable)) { + array_push($this->openAPINullablesSetToNull, 'zeroEmissionsTable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('zeroEmissionsTable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['zeroEmissionsTable'] = $zeroEmissionsTable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CarChargeRate.php b/src/Model/CarChargeRate.php new file mode 100644 index 0000000..0651ce5 --- /dev/null +++ b/src/Model/CarChargeRate.php @@ -0,0 +1,477 @@ + + */ +class CarChargeRate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CarChargeRate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'rangeStart' => 'int', + 'rangeStop' => 'int', + 'rate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'rangeStart' => 'int32', + 'rangeStop' => 'int32', + 'rate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'rangeStart' => false, + 'rangeStop' => false, + 'rate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'rangeStart' => 'rangeStart', + 'rangeStop' => 'rangeStop', + 'rate' => 'rate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'rangeStart' => 'setRangeStart', + 'rangeStop' => 'setRangeStop', + 'rate' => 'setRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'rangeStart' => 'getRangeStart', + 'rangeStop' => 'getRangeStop', + 'rate' => 'getRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('rangeStart', $data ?? [], null); + $this->setIfExists('rangeStop', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rangeStart + * + * @return int|null + */ + public function getRangeStart(): ?int + { + return $this->container['rangeStart']; + } + + /** + * Sets rangeStart + * + * @param int|null $rangeStart rangeStart + * + * @return $this + */ + public function setRangeStart(?int $rangeStart): static + { + if (is_null($rangeStart)) { + throw new InvalidArgumentException('non-nullable rangeStart cannot be null'); + } + $this->container['rangeStart'] = $rangeStart; + + return $this; + } + + /** + * Gets rangeStop + * + * @return int|null + */ + public function getRangeStop(): ?int + { + return $this->container['rangeStop']; + } + + /** + * Sets rangeStop + * + * @param int|null $rangeStop rangeStop + * + * @return $this + */ + public function setRangeStop(?int $rangeStop): static + { + if (is_null($rangeStop)) { + throw new InvalidArgumentException('non-nullable rangeStop cannot be null'); + } + $this->container['rangeStop'] = $rangeStop; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate rate + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ChangeSummary.php b/src/Model/ChangeSummary.php new file mode 100644 index 0000000..ecf3a26 --- /dev/null +++ b/src/Model/ChangeSummary.php @@ -0,0 +1,1117 @@ + + */ +class ChangeSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChangeSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'auditId' => 'string', + 'previousAuditId' => 'string', + 'date' => '\DateTime', + 'name' => 'string', + 'actionPerformed' => '\SynergiTech\Staffology\Model\AuditEventAction', + 'entityType' => '\SynergiTech\Staffology\Model\EntityType', + 'entityId' => 'string', + 'employeeUniqueId' => 'string', + 'employerUniqueId' => 'string', + 'actionPerformedBy' => 'string', + 'actionPerformedOn' => 'string', + 'employeeFirstName' => 'string', + 'employeeLastName' => 'string', + 'uniqueId' => 'string', + 'parentEventType' => 'string', + 'displayName' => 'string', + 'payRunPeriod' => 'int', + 'changeType' => 'string', + 'modifications' => '\SynergiTech\Staffology\Model\FieldModification[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'auditId' => 'uuid', + 'previousAuditId' => 'uuid', + 'date' => 'date', + 'name' => null, + 'actionPerformed' => null, + 'entityType' => null, + 'entityId' => 'uuid', + 'employeeUniqueId' => 'uuid', + 'employerUniqueId' => 'uuid', + 'actionPerformedBy' => null, + 'actionPerformedOn' => null, + 'employeeFirstName' => null, + 'employeeLastName' => null, + 'uniqueId' => 'uuid', + 'parentEventType' => null, + 'displayName' => null, + 'payRunPeriod' => 'int32', + 'changeType' => null, + 'modifications' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'auditId' => false, + 'previousAuditId' => false, + 'date' => false, + 'name' => true, + 'actionPerformed' => false, + 'entityType' => false, + 'entityId' => false, + 'employeeUniqueId' => false, + 'employerUniqueId' => false, + 'actionPerformedBy' => true, + 'actionPerformedOn' => true, + 'employeeFirstName' => true, + 'employeeLastName' => true, + 'uniqueId' => false, + 'parentEventType' => true, + 'displayName' => true, + 'payRunPeriod' => false, + 'changeType' => true, + 'modifications' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'auditId' => 'auditId', + 'previousAuditId' => 'previousAuditId', + 'date' => 'date', + 'name' => 'name', + 'actionPerformed' => 'actionPerformed', + 'entityType' => 'entityType', + 'entityId' => 'entityId', + 'employeeUniqueId' => 'employeeUniqueId', + 'employerUniqueId' => 'employerUniqueId', + 'actionPerformedBy' => 'actionPerformedBy', + 'actionPerformedOn' => 'actionPerformedOn', + 'employeeFirstName' => 'employeeFirstName', + 'employeeLastName' => 'employeeLastName', + 'uniqueId' => 'uniqueId', + 'parentEventType' => 'parentEventType', + 'displayName' => 'displayName', + 'payRunPeriod' => 'payRunPeriod', + 'changeType' => 'changeType', + 'modifications' => 'modifications' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'auditId' => 'setAuditId', + 'previousAuditId' => 'setPreviousAuditId', + 'date' => 'setDate', + 'name' => 'setName', + 'actionPerformed' => 'setActionPerformed', + 'entityType' => 'setEntityType', + 'entityId' => 'setEntityId', + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'employerUniqueId' => 'setEmployerUniqueId', + 'actionPerformedBy' => 'setActionPerformedBy', + 'actionPerformedOn' => 'setActionPerformedOn', + 'employeeFirstName' => 'setEmployeeFirstName', + 'employeeLastName' => 'setEmployeeLastName', + 'uniqueId' => 'setUniqueId', + 'parentEventType' => 'setParentEventType', + 'displayName' => 'setDisplayName', + 'payRunPeriod' => 'setPayRunPeriod', + 'changeType' => 'setChangeType', + 'modifications' => 'setModifications' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'auditId' => 'getAuditId', + 'previousAuditId' => 'getPreviousAuditId', + 'date' => 'getDate', + 'name' => 'getName', + 'actionPerformed' => 'getActionPerformed', + 'entityType' => 'getEntityType', + 'entityId' => 'getEntityId', + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'employerUniqueId' => 'getEmployerUniqueId', + 'actionPerformedBy' => 'getActionPerformedBy', + 'actionPerformedOn' => 'getActionPerformedOn', + 'employeeFirstName' => 'getEmployeeFirstName', + 'employeeLastName' => 'getEmployeeLastName', + 'uniqueId' => 'getUniqueId', + 'parentEventType' => 'getParentEventType', + 'displayName' => 'getDisplayName', + 'payRunPeriod' => 'getPayRunPeriod', + 'changeType' => 'getChangeType', + 'modifications' => 'getModifications' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('auditId', $data ?? [], null); + $this->setIfExists('previousAuditId', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('actionPerformed', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('employerUniqueId', $data ?? [], null); + $this->setIfExists('actionPerformedBy', $data ?? [], null); + $this->setIfExists('actionPerformedOn', $data ?? [], null); + $this->setIfExists('employeeFirstName', $data ?? [], null); + $this->setIfExists('employeeLastName', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('parentEventType', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('payRunPeriod', $data ?? [], null); + $this->setIfExists('changeType', $data ?? [], null); + $this->setIfExists('modifications', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets auditId + * + * @return string|null + */ + public function getAuditId(): ?string + { + return $this->container['auditId']; + } + + /** + * Sets auditId + * + * @param string|null $auditId auditId + * + * @return $this + */ + public function setAuditId(?string $auditId): static + { + if (is_null($auditId)) { + throw new InvalidArgumentException('non-nullable auditId cannot be null'); + } + $this->container['auditId'] = $auditId; + + return $this; + } + + /** + * Gets previousAuditId + * + * @return string|null + */ + public function getPreviousAuditId(): ?string + { + return $this->container['previousAuditId']; + } + + /** + * Sets previousAuditId + * + * @param string|null $previousAuditId This Id is used to delete the previous audit entry once the change summary entry is created for the modifications between the current and the previous audit entry. + * + * @return $this + */ + public function setPreviousAuditId(?string $previousAuditId): static + { + if (is_null($previousAuditId)) { + throw new InvalidArgumentException('non-nullable previousAuditId cannot be null'); + } + $this->container['previousAuditId'] = $previousAuditId; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets actionPerformed + * + * @return \SynergiTech\Staffology\Model\AuditEventAction|null + */ + public function getActionPerformed(): ?\SynergiTech\Staffology\Model\AuditEventAction + { + return $this->container['actionPerformed']; + } + + /** + * Sets actionPerformed + * + * @param \SynergiTech\Staffology\Model\AuditEventAction|null $actionPerformed actionPerformed + * + * @return $this + */ + public function setActionPerformed(?\SynergiTech\Staffology\Model\AuditEventAction $actionPerformed): static + { + if (is_null($actionPerformed)) { + throw new InvalidArgumentException('non-nullable actionPerformed cannot be null'); + } + $this->container['actionPerformed'] = $actionPerformed; + + return $this; + } + + /** + * Gets entityType + * + * @return \SynergiTech\Staffology\Model\EntityType|null + */ + public function getEntityType(): ?\SynergiTech\Staffology\Model\EntityType + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \SynergiTech\Staffology\Model\EntityType|null $entityType entityType + * + * @return $this + */ + public function setEntityType(?\SynergiTech\Staffology\Model\EntityType $entityType): static + { + if (is_null($entityType)) { + throw new InvalidArgumentException('non-nullable entityType cannot be null'); + } + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets entityId + * + * @return string|null + */ + public function getEntityId(): ?string + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string|null $entityId Id of the underlying entity + * + * @return $this + */ + public function setEntityId(?string $entityId): static + { + if (is_null($entityId)) { + throw new InvalidArgumentException('non-nullable entityId cannot be null'); + } + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId Unique id of the employee this operation belongs to + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets employerUniqueId + * + * @return string|null + */ + public function getEmployerUniqueId(): ?string + { + return $this->container['employerUniqueId']; + } + + /** + * Sets employerUniqueId + * + * @param string|null $employerUniqueId Unique id of the employer this operation belongs to + * + * @return $this + */ + public function setEmployerUniqueId(?string $employerUniqueId): static + { + if (is_null($employerUniqueId)) { + throw new InvalidArgumentException('non-nullable employerUniqueId cannot be null'); + } + $this->container['employerUniqueId'] = $employerUniqueId; + + return $this; + } + + /** + * Gets actionPerformedBy + * + * @return string|null + */ + public function getActionPerformedBy(): ?string + { + return $this->container['actionPerformedBy']; + } + + /** + * Sets actionPerformedBy + * + * @param string|null $actionPerformedBy actionPerformedBy + * + * @return $this + */ + public function setActionPerformedBy(?string $actionPerformedBy): static + { + if (is_null($actionPerformedBy)) { + array_push($this->openAPINullablesSetToNull, 'actionPerformedBy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actionPerformedBy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actionPerformedBy'] = $actionPerformedBy; + + return $this; + } + + /** + * Gets actionPerformedOn + * + * @return string|null + */ + public function getActionPerformedOn(): ?string + { + return $this->container['actionPerformedOn']; + } + + /** + * Sets actionPerformedOn + * + * @param string|null $actionPerformedOn actionPerformedOn + * + * @return $this + */ + public function setActionPerformedOn(?string $actionPerformedOn): static + { + if (is_null($actionPerformedOn)) { + array_push($this->openAPINullablesSetToNull, 'actionPerformedOn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actionPerformedOn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actionPerformedOn'] = $actionPerformedOn; + + return $this; + } + + /** + * Gets employeeFirstName + * + * @return string|null + */ + public function getEmployeeFirstName(): ?string + { + return $this->container['employeeFirstName']; + } + + /** + * Sets employeeFirstName + * + * @param string|null $employeeFirstName employeeFirstName + * + * @return $this + */ + public function setEmployeeFirstName(?string $employeeFirstName): static + { + if (is_null($employeeFirstName)) { + array_push($this->openAPINullablesSetToNull, 'employeeFirstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeFirstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeFirstName'] = $employeeFirstName; + + return $this; + } + + /** + * Gets employeeLastName + * + * @return string|null + */ + public function getEmployeeLastName(): ?string + { + return $this->container['employeeLastName']; + } + + /** + * Sets employeeLastName + * + * @param string|null $employeeLastName employeeLastName + * + * @return $this + */ + public function setEmployeeLastName(?string $employeeLastName): static + { + if (is_null($employeeLastName)) { + array_push($this->openAPINullablesSetToNull, 'employeeLastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeLastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeLastName'] = $employeeLastName; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique id of the owner this request belongs to + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets parentEventType + * + * @return string|null + */ + public function getParentEventType(): ?string + { + return $this->container['parentEventType']; + } + + /** + * Sets parentEventType + * + * @param string|null $parentEventType parentEventType + * + * @return $this + */ + public function setParentEventType(?string $parentEventType): static + { + if (is_null($parentEventType)) { + array_push($this->openAPINullablesSetToNull, 'parentEventType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parentEventType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parentEventType'] = $parentEventType; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets payRunPeriod + * + * @return int|null + */ + public function getPayRunPeriod(): ?int + { + return $this->container['payRunPeriod']; + } + + /** + * Sets payRunPeriod + * + * @param int|null $payRunPeriod payRunPeriod + * + * @return $this + */ + public function setPayRunPeriod(?int $payRunPeriod): static + { + if (is_null($payRunPeriod)) { + throw new InvalidArgumentException('non-nullable payRunPeriod cannot be null'); + } + $this->container['payRunPeriod'] = $payRunPeriod; + + return $this; + } + + /** + * Gets changeType + * + * @return string|null + */ + public function getChangeType(): ?string + { + return $this->container['changeType']; + } + + /** + * Sets changeType + * + * @param string|null $changeType changeType + * + * @return $this + */ + public function setChangeType(?string $changeType): static + { + if (is_null($changeType)) { + array_push($this->openAPINullablesSetToNull, 'changeType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('changeType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['changeType'] = $changeType; + + return $this; + } + + /** + * Gets modifications + * + * @return \SynergiTech\Staffology\Model\FieldModification[]|null + */ + public function getModifications(): ?array + { + return $this->container['modifications']; + } + + /** + * Sets modifications + * + * @param \SynergiTech\Staffology\Model\FieldModification[]|null $modifications modifications + * + * @return $this + */ + public function setModifications(?array $modifications): static + { + if (is_null($modifications)) { + array_push($this->openAPINullablesSetToNull, 'modifications'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('modifications', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['modifications'] = $modifications; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ChangeSummaryListReportResponse.php b/src/Model/ChangeSummaryListReportResponse.php new file mode 100644 index 0000000..9e19cfc --- /dev/null +++ b/src/Model/ChangeSummaryListReportResponse.php @@ -0,0 +1,539 @@ + + */ +class ChangeSummaryListReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChangeSummaryListReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\ChangeSummary[]', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\ChangeSummary[]|null + */ + public function getModel(): ?array + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\ChangeSummary[]|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(?array $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Cis300.php b/src/Model/Cis300.php new file mode 100644 index 0000000..0b19109 --- /dev/null +++ b/src/Model/Cis300.php @@ -0,0 +1,830 @@ + + */ +class Cis300 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Cis300'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxMonth' => 'int', + 'employeeCount' => 'int', + 'employmentStatusDeclaration' => 'bool', + 'verificationDeclaration' => 'bool', + 'informationCorrectDeclaration' => 'bool', + 'inactivityDeclaration' => 'bool', + 'cisReturn' => '\SynergiTech\Staffology\Model\CisReturn', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxMonth' => 'int32', + 'employeeCount' => 'int32', + 'employmentStatusDeclaration' => null, + 'verificationDeclaration' => null, + 'informationCorrectDeclaration' => null, + 'inactivityDeclaration' => null, + 'cisReturn' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxMonth' => false, + 'employeeCount' => false, + 'employmentStatusDeclaration' => false, + 'verificationDeclaration' => false, + 'informationCorrectDeclaration' => false, + 'inactivityDeclaration' => false, + 'cisReturn' => false, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxMonth' => 'taxMonth', + 'employeeCount' => 'employeeCount', + 'employmentStatusDeclaration' => 'employmentStatusDeclaration', + 'verificationDeclaration' => 'verificationDeclaration', + 'informationCorrectDeclaration' => 'informationCorrectDeclaration', + 'inactivityDeclaration' => 'inactivityDeclaration', + 'cisReturn' => 'cisReturn', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxMonth' => 'setTaxMonth', + 'employeeCount' => 'setEmployeeCount', + 'employmentStatusDeclaration' => 'setEmploymentStatusDeclaration', + 'verificationDeclaration' => 'setVerificationDeclaration', + 'informationCorrectDeclaration' => 'setInformationCorrectDeclaration', + 'inactivityDeclaration' => 'setInactivityDeclaration', + 'cisReturn' => 'setCisReturn', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxMonth' => 'getTaxMonth', + 'employeeCount' => 'getEmployeeCount', + 'employmentStatusDeclaration' => 'getEmploymentStatusDeclaration', + 'verificationDeclaration' => 'getVerificationDeclaration', + 'informationCorrectDeclaration' => 'getInformationCorrectDeclaration', + 'inactivityDeclaration' => 'getInactivityDeclaration', + 'cisReturn' => 'getCisReturn', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('employmentStatusDeclaration', $data ?? [], null); + $this->setIfExists('verificationDeclaration', $data ?? [], null); + $this->setIfExists('informationCorrectDeclaration', $data ?? [], null); + $this->setIfExists('inactivityDeclaration', $data ?? [], null); + $this->setIfExists('cisReturn', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth taxMonth + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount employeeCount + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets employmentStatusDeclaration + * + * @return bool|null + */ + public function getEmploymentStatusDeclaration(): ?bool + { + return $this->container['employmentStatusDeclaration']; + } + + /** + * Sets employmentStatusDeclaration + * + * @param bool|null $employmentStatusDeclaration employmentStatusDeclaration + * + * @return $this + */ + public function setEmploymentStatusDeclaration(?bool $employmentStatusDeclaration): static + { + if (is_null($employmentStatusDeclaration)) { + throw new InvalidArgumentException('non-nullable employmentStatusDeclaration cannot be null'); + } + $this->container['employmentStatusDeclaration'] = $employmentStatusDeclaration; + + return $this; + } + + /** + * Gets verificationDeclaration + * + * @return bool|null + */ + public function getVerificationDeclaration(): ?bool + { + return $this->container['verificationDeclaration']; + } + + /** + * Sets verificationDeclaration + * + * @param bool|null $verificationDeclaration verificationDeclaration + * + * @return $this + */ + public function setVerificationDeclaration(?bool $verificationDeclaration): static + { + if (is_null($verificationDeclaration)) { + throw new InvalidArgumentException('non-nullable verificationDeclaration cannot be null'); + } + $this->container['verificationDeclaration'] = $verificationDeclaration; + + return $this; + } + + /** + * Gets informationCorrectDeclaration + * + * @return bool|null + */ + public function getInformationCorrectDeclaration(): ?bool + { + return $this->container['informationCorrectDeclaration']; + } + + /** + * Sets informationCorrectDeclaration + * + * @param bool|null $informationCorrectDeclaration informationCorrectDeclaration + * + * @return $this + */ + public function setInformationCorrectDeclaration(?bool $informationCorrectDeclaration): static + { + if (is_null($informationCorrectDeclaration)) { + throw new InvalidArgumentException('non-nullable informationCorrectDeclaration cannot be null'); + } + $this->container['informationCorrectDeclaration'] = $informationCorrectDeclaration; + + return $this; + } + + /** + * Gets inactivityDeclaration + * + * @return bool|null + */ + public function getInactivityDeclaration(): ?bool + { + return $this->container['inactivityDeclaration']; + } + + /** + * Sets inactivityDeclaration + * + * @param bool|null $inactivityDeclaration inactivityDeclaration + * + * @return $this + */ + public function setInactivityDeclaration(?bool $inactivityDeclaration): static + { + if (is_null($inactivityDeclaration)) { + throw new InvalidArgumentException('non-nullable inactivityDeclaration cannot be null'); + } + $this->container['inactivityDeclaration'] = $inactivityDeclaration; + + return $this; + } + + /** + * Gets cisReturn + * + * @return \SynergiTech\Staffology\Model\CisReturn|null + */ + public function getCisReturn(): ?\SynergiTech\Staffology\Model\CisReturn + { + return $this->container['cisReturn']; + } + + /** + * Sets cisReturn + * + * @param \SynergiTech\Staffology\Model\CisReturn|null $cisReturn cisReturn + * + * @return $this + */ + public function setCisReturn(?\SynergiTech\Staffology\Model\CisReturn $cisReturn): static + { + if (is_null($cisReturn)) { + throw new InvalidArgumentException('non-nullable cisReturn cannot be null'); + } + $this->container['cisReturn'] = $cisReturn; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Cis300Declarations.php b/src/Model/Cis300Declarations.php new file mode 100644 index 0000000..6c64677 --- /dev/null +++ b/src/Model/Cis300Declarations.php @@ -0,0 +1,538 @@ + + */ +class Cis300Declarations implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Cis300Declarations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employmentStatus' => 'string', + 'verification' => 'string', + 'informationCorrect' => 'string', + 'inactivity' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employmentStatus' => null, + 'verification' => null, + 'informationCorrect' => null, + 'inactivity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employmentStatus' => true, + 'verification' => true, + 'informationCorrect' => true, + 'inactivity' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employmentStatus' => 'employmentStatus', + 'verification' => 'verification', + 'informationCorrect' => 'informationCorrect', + 'inactivity' => 'inactivity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employmentStatus' => 'setEmploymentStatus', + 'verification' => 'setVerification', + 'informationCorrect' => 'setInformationCorrect', + 'inactivity' => 'setInactivity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employmentStatus' => 'getEmploymentStatus', + 'verification' => 'getVerification', + 'informationCorrect' => 'getInformationCorrect', + 'inactivity' => 'getInactivity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employmentStatus', $data ?? [], null); + $this->setIfExists('verification', $data ?? [], null); + $this->setIfExists('informationCorrect', $data ?? [], null); + $this->setIfExists('inactivity', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employmentStatus + * + * @return string|null + */ + public function getEmploymentStatus(): ?string + { + return $this->container['employmentStatus']; + } + + /** + * Sets employmentStatus + * + * @param string|null $employmentStatus employmentStatus + * + * @return $this + */ + public function setEmploymentStatus(?string $employmentStatus): static + { + if (is_null($employmentStatus)) { + array_push($this->openAPINullablesSetToNull, 'employmentStatus'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employmentStatus', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employmentStatus'] = $employmentStatus; + + return $this; + } + + /** + * Gets verification + * + * @return string|null + */ + public function getVerification(): ?string + { + return $this->container['verification']; + } + + /** + * Sets verification + * + * @param string|null $verification verification + * + * @return $this + */ + public function setVerification(?string $verification): static + { + if (is_null($verification)) { + array_push($this->openAPINullablesSetToNull, 'verification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verification'] = $verification; + + return $this; + } + + /** + * Gets informationCorrect + * + * @return string|null + */ + public function getInformationCorrect(): ?string + { + return $this->container['informationCorrect']; + } + + /** + * Sets informationCorrect + * + * @param string|null $informationCorrect informationCorrect + * + * @return $this + */ + public function setInformationCorrect(?string $informationCorrect): static + { + if (is_null($informationCorrect)) { + array_push($this->openAPINullablesSetToNull, 'informationCorrect'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('informationCorrect', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['informationCorrect'] = $informationCorrect; + + return $this; + } + + /** + * Gets inactivity + * + * @return string|null + */ + public function getInactivity(): ?string + { + return $this->container['inactivity']; + } + + /** + * Sets inactivity + * + * @param string|null $inactivity inactivity + * + * @return $this + */ + public function setInactivity(?string $inactivity): static + { + if (is_null($inactivity)) { + array_push($this->openAPINullablesSetToNull, 'inactivity'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inactivity', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['inactivity'] = $inactivity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Cis300ReportResponse.php b/src/Model/Cis300ReportResponse.php new file mode 100644 index 0000000..67947fd --- /dev/null +++ b/src/Model/Cis300ReportResponse.php @@ -0,0 +1,532 @@ + + */ +class Cis300ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Cis300ReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\Cis300', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\Cis300|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\Cis300 + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\Cis300|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\Cis300 $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisContractor.php b/src/Model/CisContractor.php new file mode 100644 index 0000000..cf28550 --- /dev/null +++ b/src/Model/CisContractor.php @@ -0,0 +1,457 @@ + + */ +class CisContractor implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisContractor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'utr' => 'string', + 'aOref' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'utr' => null, + 'aOref' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'utr' => true, + 'aOref' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'utr' => 'utr', + 'aOref' => 'aOref' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'utr' => 'setUtr', + 'aOref' => 'setAOref' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'utr' => 'getUtr', + 'aOref' => 'getAOref' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('aOref', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets aOref + * + * @return string|null + */ + public function getAOref(): ?string + { + return $this->container['aOref']; + } + + /** + * Sets aOref + * + * @param string|null $aOref aOref + * + * @return $this + */ + public function setAOref(?string $aOref): static + { + if (is_null($aOref)) { + array_push($this->openAPINullablesSetToNull, 'aOref'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aOref', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aOref'] = $aOref; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisDetails.php b/src/Model/CisDetails.php new file mode 100644 index 0000000..65be107 --- /dev/null +++ b/src/Model/CisDetails.php @@ -0,0 +1,790 @@ + + */ +class CisDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\CISSubContractorType', + 'utr' => 'string', + 'tradingName' => 'string', + 'companyUtr' => 'string', + 'companyNumber' => 'string', + 'vatRegistered' => 'bool', + 'vatNumber' => 'string', + 'vatRate' => 'float', + 'reverseChargeVAT' => 'bool', + 'verification' => '\SynergiTech\Staffology\Model\CisVerificationDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'utr' => null, + 'tradingName' => null, + 'companyUtr' => null, + 'companyNumber' => null, + 'vatRegistered' => null, + 'vatNumber' => null, + 'vatRate' => 'double', + 'reverseChargeVAT' => null, + 'verification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'utr' => true, + 'tradingName' => true, + 'companyUtr' => true, + 'companyNumber' => true, + 'vatRegistered' => false, + 'vatNumber' => true, + 'vatRate' => false, + 'reverseChargeVAT' => false, + 'verification' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'utr' => 'utr', + 'tradingName' => 'tradingName', + 'companyUtr' => 'companyUtr', + 'companyNumber' => 'companyNumber', + 'vatRegistered' => 'vatRegistered', + 'vatNumber' => 'vatNumber', + 'vatRate' => 'vatRate', + 'reverseChargeVAT' => 'reverseChargeVAT', + 'verification' => 'verification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'utr' => 'setUtr', + 'tradingName' => 'setTradingName', + 'companyUtr' => 'setCompanyUtr', + 'companyNumber' => 'setCompanyNumber', + 'vatRegistered' => 'setVatRegistered', + 'vatNumber' => 'setVatNumber', + 'vatRate' => 'setVatRate', + 'reverseChargeVAT' => 'setReverseChargeVAT', + 'verification' => 'setVerification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'utr' => 'getUtr', + 'tradingName' => 'getTradingName', + 'companyUtr' => 'getCompanyUtr', + 'companyNumber' => 'getCompanyNumber', + 'vatRegistered' => 'getVatRegistered', + 'vatNumber' => 'getVatNumber', + 'vatRate' => 'getVatRate', + 'reverseChargeVAT' => 'getReverseChargeVAT', + 'verification' => 'getVerification' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('companyUtr', $data ?? [], null); + $this->setIfExists('companyNumber', $data ?? [], null); + $this->setIfExists('vatRegistered', $data ?? [], null); + $this->setIfExists('vatNumber', $data ?? [], null); + $this->setIfExists('vatRate', $data ?? [], null); + $this->setIfExists('reverseChargeVAT', $data ?? [], null); + $this->setIfExists('verification', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['utr']) && (mb_strlen($this->container['utr']) > 20)) { + $invalidProperties[] = "invalid value for 'utr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['tradingName']) && (mb_strlen($this->container['tradingName']) > 200)) { + $invalidProperties[] = "invalid value for 'tradingName', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['companyUtr']) && (mb_strlen($this->container['companyUtr']) > 20)) { + $invalidProperties[] = "invalid value for 'companyUtr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['companyNumber']) && (mb_strlen($this->container['companyNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'companyNumber', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['vatNumber']) && (mb_strlen($this->container['vatNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'vatNumber', the character length must be smaller than or equal to 20."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\CISSubContractorType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\CISSubContractorType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\CISSubContractorType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\CISSubContractorType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($utr) && (mb_strlen($utr) > 20)) { + throw new InvalidArgumentException('invalid length for $utr when calling CisDetails., must be smaller than or equal to 20.'); + } + + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($tradingName) && (mb_strlen($tradingName) > 200)) { + throw new InvalidArgumentException('invalid length for $tradingName when calling CisDetails., must be smaller than or equal to 200.'); + } + + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets companyUtr + * + * @return string|null + */ + public function getCompanyUtr(): ?string + { + return $this->container['companyUtr']; + } + + /** + * Sets companyUtr + * + * @param string|null $companyUtr companyUtr + * + * @return $this + */ + public function setCompanyUtr(?string $companyUtr): static + { + if (is_null($companyUtr)) { + array_push($this->openAPINullablesSetToNull, 'companyUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyUtr) && (mb_strlen($companyUtr) > 20)) { + throw new InvalidArgumentException('invalid length for $companyUtr when calling CisDetails., must be smaller than or equal to 20.'); + } + + $this->container['companyUtr'] = $companyUtr; + + return $this; + } + + /** + * Gets companyNumber + * + * @return string|null + */ + public function getCompanyNumber(): ?string + { + return $this->container['companyNumber']; + } + + /** + * Sets companyNumber + * + * @param string|null $companyNumber companyNumber + * + * @return $this + */ + public function setCompanyNumber(?string $companyNumber): static + { + if (is_null($companyNumber)) { + array_push($this->openAPINullablesSetToNull, 'companyNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyNumber) && (mb_strlen($companyNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $companyNumber when calling CisDetails., must be smaller than or equal to 20.'); + } + + $this->container['companyNumber'] = $companyNumber; + + return $this; + } + + /** + * Gets vatRegistered + * + * @return bool|null + */ + public function getVatRegistered(): ?bool + { + return $this->container['vatRegistered']; + } + + /** + * Sets vatRegistered + * + * @param bool|null $vatRegistered vatRegistered + * + * @return $this + */ + public function setVatRegistered(?bool $vatRegistered): static + { + if (is_null($vatRegistered)) { + throw new InvalidArgumentException('non-nullable vatRegistered cannot be null'); + } + $this->container['vatRegistered'] = $vatRegistered; + + return $this; + } + + /** + * Gets vatNumber + * + * @return string|null + */ + public function getVatNumber(): ?string + { + return $this->container['vatNumber']; + } + + /** + * Sets vatNumber + * + * @param string|null $vatNumber vatNumber + * + * @return $this + */ + public function setVatNumber(?string $vatNumber): static + { + if (is_null($vatNumber)) { + array_push($this->openAPINullablesSetToNull, 'vatNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vatNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($vatNumber) && (mb_strlen($vatNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $vatNumber when calling CisDetails., must be smaller than or equal to 20.'); + } + + $this->container['vatNumber'] = $vatNumber; + + return $this; + } + + /** + * Gets vatRate + * + * @return float|null + */ + public function getVatRate(): ?float + { + return $this->container['vatRate']; + } + + /** + * Sets vatRate + * + * @param float|null $vatRate vatRate + * + * @return $this + */ + public function setVatRate(?float $vatRate): static + { + if (is_null($vatRate)) { + throw new InvalidArgumentException('non-nullable vatRate cannot be null'); + } + $this->container['vatRate'] = $vatRate; + + return $this; + } + + /** + * Gets reverseChargeVAT + * + * @return bool|null + */ + public function getReverseChargeVAT(): ?bool + { + return $this->container['reverseChargeVAT']; + } + + /** + * Sets reverseChargeVAT + * + * @param bool|null $reverseChargeVAT reverseChargeVAT + * + * @return $this + */ + public function setReverseChargeVAT(?bool $reverseChargeVAT): static + { + if (is_null($reverseChargeVAT)) { + throw new InvalidArgumentException('non-nullable reverseChargeVAT cannot be null'); + } + $this->container['reverseChargeVAT'] = $reverseChargeVAT; + + return $this; + } + + /** + * Gets verification + * + * @return \SynergiTech\Staffology\Model\CisVerificationDetails|null + */ + public function getVerification(): ?\SynergiTech\Staffology\Model\CisVerificationDetails + { + return $this->container['verification']; + } + + /** + * Sets verification + * + * @param \SynergiTech\Staffology\Model\CisVerificationDetails|null $verification verification + * + * @return $this + */ + public function setVerification(?\SynergiTech\Staffology\Model\CisVerificationDetails $verification): static + { + if (is_null($verification)) { + throw new InvalidArgumentException('non-nullable verification cannot be null'); + } + $this->container['verification'] = $verification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisPartnership.php b/src/Model/CisPartnership.php new file mode 100644 index 0000000..e56b065 --- /dev/null +++ b/src/Model/CisPartnership.php @@ -0,0 +1,457 @@ + + */ +class CisPartnership implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisPartnership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'utr' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'utr' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'utr' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'utr' => 'utr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'utr' => 'setUtr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'utr' => 'getUtr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisRequest.php b/src/Model/CisRequest.php new file mode 100644 index 0000000..4c3ce20 --- /dev/null +++ b/src/Model/CisRequest.php @@ -0,0 +1,490 @@ + + */ +class CisRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'contractor' => '\SynergiTech\Staffology\Model\CisContractor', + 'subcontractor' => '\SynergiTech\Staffology\Model\CisSubContractor[]', + 'declaration' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'contractor' => null, + 'subcontractor' => null, + 'declaration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'contractor' => false, + 'subcontractor' => true, + 'declaration' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'contractor' => 'contractor', + 'subcontractor' => 'subcontractor', + 'declaration' => 'declaration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'contractor' => 'setContractor', + 'subcontractor' => 'setSubcontractor', + 'declaration' => 'setDeclaration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'contractor' => 'getContractor', + 'subcontractor' => 'getSubcontractor', + 'declaration' => 'getDeclaration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('contractor', $data ?? [], null); + $this->setIfExists('subcontractor', $data ?? [], null); + $this->setIfExists('declaration', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets contractor + * + * @return \SynergiTech\Staffology\Model\CisContractor|null + */ + public function getContractor(): ?\SynergiTech\Staffology\Model\CisContractor + { + return $this->container['contractor']; + } + + /** + * Sets contractor + * + * @param \SynergiTech\Staffology\Model\CisContractor|null $contractor contractor + * + * @return $this + */ + public function setContractor(?\SynergiTech\Staffology\Model\CisContractor $contractor): static + { + if (is_null($contractor)) { + throw new InvalidArgumentException('non-nullable contractor cannot be null'); + } + $this->container['contractor'] = $contractor; + + return $this; + } + + /** + * Gets subcontractor + * + * @return \SynergiTech\Staffology\Model\CisSubContractor[]|null + */ + public function getSubcontractor(): ?array + { + return $this->container['subcontractor']; + } + + /** + * Sets subcontractor + * + * @param \SynergiTech\Staffology\Model\CisSubContractor[]|null $subcontractor subcontractor + * + * @return $this + */ + public function setSubcontractor(?array $subcontractor): static + { + if (is_null($subcontractor)) { + array_push($this->openAPINullablesSetToNull, 'subcontractor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subcontractor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subcontractor'] = $subcontractor; + + return $this; + } + + /** + * Gets declaration + * + * @return string|null + */ + public function getDeclaration(): ?string + { + return $this->container['declaration']; + } + + /** + * Sets declaration + * + * @param string|null $declaration declaration + * + * @return $this + */ + public function setDeclaration(?string $declaration): static + { + if (is_null($declaration)) { + array_push($this->openAPINullablesSetToNull, 'declaration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('declaration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['declaration'] = $declaration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisReturn.php b/src/Model/CisReturn.php new file mode 100644 index 0000000..646cff4 --- /dev/null +++ b/src/Model/CisReturn.php @@ -0,0 +1,524 @@ + + */ +class CisReturn implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisReturn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'contractor' => '\SynergiTech\Staffology\Model\CisContractor', + 'subcontractor' => '\SynergiTech\Staffology\Model\CisSubContractor[]', + 'nilReturn' => 'string', + 'declarations' => '\SynergiTech\Staffology\Model\Cis300Declarations' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'contractor' => null, + 'subcontractor' => null, + 'nilReturn' => null, + 'declarations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'contractor' => false, + 'subcontractor' => true, + 'nilReturn' => true, + 'declarations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'contractor' => 'contractor', + 'subcontractor' => 'subcontractor', + 'nilReturn' => 'nilReturn', + 'declarations' => 'declarations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'contractor' => 'setContractor', + 'subcontractor' => 'setSubcontractor', + 'nilReturn' => 'setNilReturn', + 'declarations' => 'setDeclarations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'contractor' => 'getContractor', + 'subcontractor' => 'getSubcontractor', + 'nilReturn' => 'getNilReturn', + 'declarations' => 'getDeclarations' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('contractor', $data ?? [], null); + $this->setIfExists('subcontractor', $data ?? [], null); + $this->setIfExists('nilReturn', $data ?? [], null); + $this->setIfExists('declarations', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets contractor + * + * @return \SynergiTech\Staffology\Model\CisContractor|null + */ + public function getContractor(): ?\SynergiTech\Staffology\Model\CisContractor + { + return $this->container['contractor']; + } + + /** + * Sets contractor + * + * @param \SynergiTech\Staffology\Model\CisContractor|null $contractor contractor + * + * @return $this + */ + public function setContractor(?\SynergiTech\Staffology\Model\CisContractor $contractor): static + { + if (is_null($contractor)) { + throw new InvalidArgumentException('non-nullable contractor cannot be null'); + } + $this->container['contractor'] = $contractor; + + return $this; + } + + /** + * Gets subcontractor + * + * @return \SynergiTech\Staffology\Model\CisSubContractor[]|null + */ + public function getSubcontractor(): ?array + { + return $this->container['subcontractor']; + } + + /** + * Sets subcontractor + * + * @param \SynergiTech\Staffology\Model\CisSubContractor[]|null $subcontractor subcontractor + * + * @return $this + */ + public function setSubcontractor(?array $subcontractor): static + { + if (is_null($subcontractor)) { + array_push($this->openAPINullablesSetToNull, 'subcontractor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subcontractor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subcontractor'] = $subcontractor; + + return $this; + } + + /** + * Gets nilReturn + * + * @return string|null + */ + public function getNilReturn(): ?string + { + return $this->container['nilReturn']; + } + + /** + * Sets nilReturn + * + * @param string|null $nilReturn nilReturn + * + * @return $this + */ + public function setNilReturn(?string $nilReturn): static + { + if (is_null($nilReturn)) { + array_push($this->openAPINullablesSetToNull, 'nilReturn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nilReturn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nilReturn'] = $nilReturn; + + return $this; + } + + /** + * Gets declarations + * + * @return \SynergiTech\Staffology\Model\Cis300Declarations|null + */ + public function getDeclarations(): ?\SynergiTech\Staffology\Model\Cis300Declarations + { + return $this->container['declarations']; + } + + /** + * Sets declarations + * + * @param \SynergiTech\Staffology\Model\Cis300Declarations|null $declarations declarations + * + * @return $this + */ + public function setDeclarations(?\SynergiTech\Staffology\Model\Cis300Declarations $declarations): static + { + if (is_null($declarations)) { + throw new InvalidArgumentException('non-nullable declarations cannot be null'); + } + $this->container['declarations'] = $declarations; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisStatement.php b/src/Model/CisStatement.php new file mode 100644 index 0000000..1bb7da1 --- /dev/null +++ b/src/Model/CisStatement.php @@ -0,0 +1,886 @@ + + */ +class CisStatement implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisStatement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'taxMonth' => 'int', + 'contractorName' => 'string', + 'contractorAddress' => '\SynergiTech\Staffology\Model\Address', + 'contractorOfficeNumber' => 'string', + 'contractorPayeReference' => 'string', + 'subcontractorName' => '\SynergiTech\Staffology\Model\RtiEmployeeName', + 'subContractorUtr' => 'string', + 'verificationNumber' => 'string', + 'grossAmountPaid' => 'float', + 'costOfMaterials' => 'float', + 'amountLiableToDeduction' => 'float', + 'amountDeducted' => 'float', + 'amountPayable' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'taxMonth' => 'int32', + 'contractorName' => null, + 'contractorAddress' => null, + 'contractorOfficeNumber' => null, + 'contractorPayeReference' => null, + 'subcontractorName' => null, + 'subContractorUtr' => null, + 'verificationNumber' => null, + 'grossAmountPaid' => 'double', + 'costOfMaterials' => 'double', + 'amountLiableToDeduction' => 'double', + 'amountDeducted' => 'double', + 'amountPayable' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'taxMonth' => false, + 'contractorName' => true, + 'contractorAddress' => false, + 'contractorOfficeNumber' => true, + 'contractorPayeReference' => true, + 'subcontractorName' => false, + 'subContractorUtr' => true, + 'verificationNumber' => true, + 'grossAmountPaid' => false, + 'costOfMaterials' => false, + 'amountLiableToDeduction' => false, + 'amountDeducted' => false, + 'amountPayable' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'taxMonth' => 'taxMonth', + 'contractorName' => 'contractorName', + 'contractorAddress' => 'contractorAddress', + 'contractorOfficeNumber' => 'contractorOfficeNumber', + 'contractorPayeReference' => 'contractorPayeReference', + 'subcontractorName' => 'subcontractorName', + 'subContractorUtr' => 'subContractorUtr', + 'verificationNumber' => 'verificationNumber', + 'grossAmountPaid' => 'grossAmountPaid', + 'costOfMaterials' => 'costOfMaterials', + 'amountLiableToDeduction' => 'amountLiableToDeduction', + 'amountDeducted' => 'amountDeducted', + 'amountPayable' => 'amountPayable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'taxMonth' => 'setTaxMonth', + 'contractorName' => 'setContractorName', + 'contractorAddress' => 'setContractorAddress', + 'contractorOfficeNumber' => 'setContractorOfficeNumber', + 'contractorPayeReference' => 'setContractorPayeReference', + 'subcontractorName' => 'setSubcontractorName', + 'subContractorUtr' => 'setSubContractorUtr', + 'verificationNumber' => 'setVerificationNumber', + 'grossAmountPaid' => 'setGrossAmountPaid', + 'costOfMaterials' => 'setCostOfMaterials', + 'amountLiableToDeduction' => 'setAmountLiableToDeduction', + 'amountDeducted' => 'setAmountDeducted', + 'amountPayable' => 'setAmountPayable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'taxMonth' => 'getTaxMonth', + 'contractorName' => 'getContractorName', + 'contractorAddress' => 'getContractorAddress', + 'contractorOfficeNumber' => 'getContractorOfficeNumber', + 'contractorPayeReference' => 'getContractorPayeReference', + 'subcontractorName' => 'getSubcontractorName', + 'subContractorUtr' => 'getSubContractorUtr', + 'verificationNumber' => 'getVerificationNumber', + 'grossAmountPaid' => 'getGrossAmountPaid', + 'costOfMaterials' => 'getCostOfMaterials', + 'amountLiableToDeduction' => 'getAmountLiableToDeduction', + 'amountDeducted' => 'getAmountDeducted', + 'amountPayable' => 'getAmountPayable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('contractorName', $data ?? [], null); + $this->setIfExists('contractorAddress', $data ?? [], null); + $this->setIfExists('contractorOfficeNumber', $data ?? [], null); + $this->setIfExists('contractorPayeReference', $data ?? [], null); + $this->setIfExists('subcontractorName', $data ?? [], null); + $this->setIfExists('subContractorUtr', $data ?? [], null); + $this->setIfExists('verificationNumber', $data ?? [], null); + $this->setIfExists('grossAmountPaid', $data ?? [], null); + $this->setIfExists('costOfMaterials', $data ?? [], null); + $this->setIfExists('amountLiableToDeduction', $data ?? [], null); + $this->setIfExists('amountDeducted', $data ?? [], null); + $this->setIfExists('amountPayable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth [readonly] + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets contractorName + * + * @return string|null + */ + public function getContractorName(): ?string + { + return $this->container['contractorName']; + } + + /** + * Sets contractorName + * + * @param string|null $contractorName [readonly] + * + * @return $this + */ + public function setContractorName(?string $contractorName): static + { + if (is_null($contractorName)) { + array_push($this->openAPINullablesSetToNull, 'contractorName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractorName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractorName'] = $contractorName; + + return $this; + } + + /** + * Gets contractorAddress + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getContractorAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['contractorAddress']; + } + + /** + * Sets contractorAddress + * + * @param \SynergiTech\Staffology\Model\Address|null $contractorAddress contractorAddress + * + * @return $this + */ + public function setContractorAddress(?\SynergiTech\Staffology\Model\Address $contractorAddress): static + { + if (is_null($contractorAddress)) { + throw new InvalidArgumentException('non-nullable contractorAddress cannot be null'); + } + $this->container['contractorAddress'] = $contractorAddress; + + return $this; + } + + /** + * Gets contractorOfficeNumber + * + * @return string|null + */ + public function getContractorOfficeNumber(): ?string + { + return $this->container['contractorOfficeNumber']; + } + + /** + * Sets contractorOfficeNumber + * + * @param string|null $contractorOfficeNumber [readonly] + * + * @return $this + */ + public function setContractorOfficeNumber(?string $contractorOfficeNumber): static + { + if (is_null($contractorOfficeNumber)) { + array_push($this->openAPINullablesSetToNull, 'contractorOfficeNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractorOfficeNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractorOfficeNumber'] = $contractorOfficeNumber; + + return $this; + } + + /** + * Gets contractorPayeReference + * + * @return string|null + */ + public function getContractorPayeReference(): ?string + { + return $this->container['contractorPayeReference']; + } + + /** + * Sets contractorPayeReference + * + * @param string|null $contractorPayeReference [readonly] + * + * @return $this + */ + public function setContractorPayeReference(?string $contractorPayeReference): static + { + if (is_null($contractorPayeReference)) { + array_push($this->openAPINullablesSetToNull, 'contractorPayeReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractorPayeReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractorPayeReference'] = $contractorPayeReference; + + return $this; + } + + /** + * Gets subcontractorName + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getSubcontractorName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['subcontractorName']; + } + + /** + * Sets subcontractorName + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $subcontractorName subcontractorName + * + * @return $this + */ + public function setSubcontractorName(?\SynergiTech\Staffology\Model\RtiEmployeeName $subcontractorName): static + { + if (is_null($subcontractorName)) { + throw new InvalidArgumentException('non-nullable subcontractorName cannot be null'); + } + $this->container['subcontractorName'] = $subcontractorName; + + return $this; + } + + /** + * Gets subContractorUtr + * + * @return string|null + */ + public function getSubContractorUtr(): ?string + { + return $this->container['subContractorUtr']; + } + + /** + * Sets subContractorUtr + * + * @param string|null $subContractorUtr [readonly] + * + * @return $this + */ + public function setSubContractorUtr(?string $subContractorUtr): static + { + if (is_null($subContractorUtr)) { + array_push($this->openAPINullablesSetToNull, 'subContractorUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subContractorUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subContractorUtr'] = $subContractorUtr; + + return $this; + } + + /** + * Gets verificationNumber + * + * @return string|null + */ + public function getVerificationNumber(): ?string + { + return $this->container['verificationNumber']; + } + + /** + * Sets verificationNumber + * + * @param string|null $verificationNumber [readonly] + * + * @return $this + */ + public function setVerificationNumber(?string $verificationNumber): static + { + if (is_null($verificationNumber)) { + array_push($this->openAPINullablesSetToNull, 'verificationNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationNumber'] = $verificationNumber; + + return $this; + } + + /** + * Gets grossAmountPaid + * + * @return float|null + */ + public function getGrossAmountPaid(): ?float + { + return $this->container['grossAmountPaid']; + } + + /** + * Sets grossAmountPaid + * + * @param float|null $grossAmountPaid [readonly] Gross Amount Paid (Excl VAT) + * + * @return $this + */ + public function setGrossAmountPaid(?float $grossAmountPaid): static + { + if (is_null($grossAmountPaid)) { + throw new InvalidArgumentException('non-nullable grossAmountPaid cannot be null'); + } + $this->container['grossAmountPaid'] = $grossAmountPaid; + + return $this; + } + + /** + * Gets costOfMaterials + * + * @return float|null + */ + public function getCostOfMaterials(): ?float + { + return $this->container['costOfMaterials']; + } + + /** + * Sets costOfMaterials + * + * @param float|null $costOfMaterials [readonly] + * + * @return $this + */ + public function setCostOfMaterials(?float $costOfMaterials): static + { + if (is_null($costOfMaterials)) { + throw new InvalidArgumentException('non-nullable costOfMaterials cannot be null'); + } + $this->container['costOfMaterials'] = $costOfMaterials; + + return $this; + } + + /** + * Gets amountLiableToDeduction + * + * @return float|null + */ + public function getAmountLiableToDeduction(): ?float + { + return $this->container['amountLiableToDeduction']; + } + + /** + * Sets amountLiableToDeduction + * + * @param float|null $amountLiableToDeduction [readonly] + * + * @return $this + */ + public function setAmountLiableToDeduction(?float $amountLiableToDeduction): static + { + if (is_null($amountLiableToDeduction)) { + throw new InvalidArgumentException('non-nullable amountLiableToDeduction cannot be null'); + } + $this->container['amountLiableToDeduction'] = $amountLiableToDeduction; + + return $this; + } + + /** + * Gets amountDeducted + * + * @return float|null + */ + public function getAmountDeducted(): ?float + { + return $this->container['amountDeducted']; + } + + /** + * Sets amountDeducted + * + * @param float|null $amountDeducted [readonly] + * + * @return $this + */ + public function setAmountDeducted(?float $amountDeducted): static + { + if (is_null($amountDeducted)) { + throw new InvalidArgumentException('non-nullable amountDeducted cannot be null'); + } + $this->container['amountDeducted'] = $amountDeducted; + + return $this; + } + + /** + * Gets amountPayable + * + * @return float|null + */ + public function getAmountPayable(): ?float + { + return $this->container['amountPayable']; + } + + /** + * Sets amountPayable + * + * @param float|null $amountPayable [readonly] + * + * @return $this + */ + public function setAmountPayable(?float $amountPayable): static + { + if (is_null($amountPayable)) { + throw new InvalidArgumentException('non-nullable amountPayable cannot be null'); + } + $this->container['amountPayable'] = $amountPayable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisStatementListReportResponse.php b/src/Model/CisStatementListReportResponse.php new file mode 100644 index 0000000..35af85c --- /dev/null +++ b/src/Model/CisStatementListReportResponse.php @@ -0,0 +1,539 @@ + + */ +class CisStatementListReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisStatementListReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\CisStatement[]', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\CisStatement[]|null + */ + public function getModel(): ?array + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\CisStatement[]|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(?array $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisSubContractor.php b/src/Model/CisSubContractor.php new file mode 100644 index 0000000..127961e --- /dev/null +++ b/src/Model/CisSubContractor.php @@ -0,0 +1,1521 @@ + + */ +class CisSubContractor implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisSubContractor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeUniqueId' => 'string', + 'emailStatementTo' => 'string', + 'numberOfPayments' => 'int', + 'item' => '\SynergiTech\Staffology\Model\Item', + 'displayName' => 'string', + 'action' => 'string', + 'type' => 'string', + 'name' => '\SynergiTech\Staffology\Model\RtiEmployeeName', + 'tradingName' => 'string', + 'worksRef' => 'string', + 'unmatchedRate' => 'string', + 'utr' => 'string', + 'crn' => 'string', + 'nino' => 'string', + 'partnership' => '\SynergiTech\Staffology\Model\CisPartnership', + 'address' => '\SynergiTech\Staffology\Model\RtiEmployeeAddress', + 'telephone' => 'string', + 'totalPaymentsUnrounded' => 'string', + 'costOfMaterialsUnrounded' => 'string', + 'umbrellaFee' => 'string', + 'validationMsg' => 'string', + 'verificationNumber' => 'string', + 'totalPayments' => 'string', + 'costOfMaterials' => 'string', + 'totalDeducted' => 'string', + 'matched' => 'string', + 'taxTreatment' => 'string', + 'netPayment' => 'string', + 'vatAmount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeUniqueId' => 'uuid', + 'emailStatementTo' => null, + 'numberOfPayments' => 'int32', + 'item' => null, + 'displayName' => null, + 'action' => null, + 'type' => null, + 'name' => null, + 'tradingName' => null, + 'worksRef' => null, + 'unmatchedRate' => null, + 'utr' => null, + 'crn' => null, + 'nino' => null, + 'partnership' => null, + 'address' => null, + 'telephone' => null, + 'totalPaymentsUnrounded' => null, + 'costOfMaterialsUnrounded' => null, + 'umbrellaFee' => null, + 'validationMsg' => null, + 'verificationNumber' => null, + 'totalPayments' => null, + 'costOfMaterials' => null, + 'totalDeducted' => null, + 'matched' => null, + 'taxTreatment' => null, + 'netPayment' => null, + 'vatAmount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeUniqueId' => false, + 'emailStatementTo' => true, + 'numberOfPayments' => false, + 'item' => false, + 'displayName' => true, + 'action' => true, + 'type' => true, + 'name' => false, + 'tradingName' => true, + 'worksRef' => true, + 'unmatchedRate' => true, + 'utr' => true, + 'crn' => true, + 'nino' => true, + 'partnership' => false, + 'address' => false, + 'telephone' => true, + 'totalPaymentsUnrounded' => true, + 'costOfMaterialsUnrounded' => true, + 'umbrellaFee' => true, + 'validationMsg' => true, + 'verificationNumber' => true, + 'totalPayments' => true, + 'costOfMaterials' => true, + 'totalDeducted' => true, + 'matched' => true, + 'taxTreatment' => true, + 'netPayment' => true, + 'vatAmount' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeUniqueId' => 'employeeUniqueId', + 'emailStatementTo' => 'emailStatementTo', + 'numberOfPayments' => 'numberOfPayments', + 'item' => 'item', + 'displayName' => 'displayName', + 'action' => 'action', + 'type' => 'type', + 'name' => 'name', + 'tradingName' => 'tradingName', + 'worksRef' => 'worksRef', + 'unmatchedRate' => 'unmatchedRate', + 'utr' => 'utr', + 'crn' => 'crn', + 'nino' => 'nino', + 'partnership' => 'partnership', + 'address' => 'address', + 'telephone' => 'telephone', + 'totalPaymentsUnrounded' => 'totalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'costOfMaterialsUnrounded', + 'umbrellaFee' => 'umbrellaFee', + 'validationMsg' => 'validationMsg', + 'verificationNumber' => 'verificationNumber', + 'totalPayments' => 'totalPayments', + 'costOfMaterials' => 'costOfMaterials', + 'totalDeducted' => 'totalDeducted', + 'matched' => 'matched', + 'taxTreatment' => 'taxTreatment', + 'netPayment' => 'netPayment', + 'vatAmount' => 'vatAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'emailStatementTo' => 'setEmailStatementTo', + 'numberOfPayments' => 'setNumberOfPayments', + 'item' => 'setItem', + 'displayName' => 'setDisplayName', + 'action' => 'setAction', + 'type' => 'setType', + 'name' => 'setName', + 'tradingName' => 'setTradingName', + 'worksRef' => 'setWorksRef', + 'unmatchedRate' => 'setUnmatchedRate', + 'utr' => 'setUtr', + 'crn' => 'setCrn', + 'nino' => 'setNino', + 'partnership' => 'setPartnership', + 'address' => 'setAddress', + 'telephone' => 'setTelephone', + 'totalPaymentsUnrounded' => 'setTotalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'setCostOfMaterialsUnrounded', + 'umbrellaFee' => 'setUmbrellaFee', + 'validationMsg' => 'setValidationMsg', + 'verificationNumber' => 'setVerificationNumber', + 'totalPayments' => 'setTotalPayments', + 'costOfMaterials' => 'setCostOfMaterials', + 'totalDeducted' => 'setTotalDeducted', + 'matched' => 'setMatched', + 'taxTreatment' => 'setTaxTreatment', + 'netPayment' => 'setNetPayment', + 'vatAmount' => 'setVatAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'emailStatementTo' => 'getEmailStatementTo', + 'numberOfPayments' => 'getNumberOfPayments', + 'item' => 'getItem', + 'displayName' => 'getDisplayName', + 'action' => 'getAction', + 'type' => 'getType', + 'name' => 'getName', + 'tradingName' => 'getTradingName', + 'worksRef' => 'getWorksRef', + 'unmatchedRate' => 'getUnmatchedRate', + 'utr' => 'getUtr', + 'crn' => 'getCrn', + 'nino' => 'getNino', + 'partnership' => 'getPartnership', + 'address' => 'getAddress', + 'telephone' => 'getTelephone', + 'totalPaymentsUnrounded' => 'getTotalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'getCostOfMaterialsUnrounded', + 'umbrellaFee' => 'getUmbrellaFee', + 'validationMsg' => 'getValidationMsg', + 'verificationNumber' => 'getVerificationNumber', + 'totalPayments' => 'getTotalPayments', + 'costOfMaterials' => 'getCostOfMaterials', + 'totalDeducted' => 'getTotalDeducted', + 'matched' => 'getMatched', + 'taxTreatment' => 'getTaxTreatment', + 'netPayment' => 'getNetPayment', + 'vatAmount' => 'getVatAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('emailStatementTo', $data ?? [], null); + $this->setIfExists('numberOfPayments', $data ?? [], null); + $this->setIfExists('item', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('worksRef', $data ?? [], null); + $this->setIfExists('unmatchedRate', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('crn', $data ?? [], null); + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('partnership', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('totalPaymentsUnrounded', $data ?? [], null); + $this->setIfExists('costOfMaterialsUnrounded', $data ?? [], null); + $this->setIfExists('umbrellaFee', $data ?? [], null); + $this->setIfExists('validationMsg', $data ?? [], null); + $this->setIfExists('verificationNumber', $data ?? [], null); + $this->setIfExists('totalPayments', $data ?? [], null); + $this->setIfExists('costOfMaterials', $data ?? [], null); + $this->setIfExists('totalDeducted', $data ?? [], null); + $this->setIfExists('matched', $data ?? [], null); + $this->setIfExists('taxTreatment', $data ?? [], null); + $this->setIfExists('netPayment', $data ?? [], null); + $this->setIfExists('vatAmount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId employeeUniqueId + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets emailStatementTo + * + * @return string|null + */ + public function getEmailStatementTo(): ?string + { + return $this->container['emailStatementTo']; + } + + /** + * Sets emailStatementTo + * + * @param string|null $emailStatementTo emailStatementTo + * + * @return $this + */ + public function setEmailStatementTo(?string $emailStatementTo): static + { + if (is_null($emailStatementTo)) { + array_push($this->openAPINullablesSetToNull, 'emailStatementTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailStatementTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailStatementTo'] = $emailStatementTo; + + return $this; + } + + /** + * Gets numberOfPayments + * + * @return int|null + */ + public function getNumberOfPayments(): ?int + { + return $this->container['numberOfPayments']; + } + + /** + * Sets numberOfPayments + * + * @param int|null $numberOfPayments numberOfPayments + * + * @return $this + */ + public function setNumberOfPayments(?int $numberOfPayments): static + { + if (is_null($numberOfPayments)) { + throw new InvalidArgumentException('non-nullable numberOfPayments cannot be null'); + } + $this->container['numberOfPayments'] = $numberOfPayments; + + return $this; + } + + /** + * Gets item + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getItem(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \SynergiTech\Staffology\Model\Item|null $item item + * + * @return $this + */ + public function setItem(?\SynergiTech\Staffology\Model\Item $item): static + { + if (is_null($item)) { + throw new InvalidArgumentException('non-nullable item cannot be null'); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction(): ?string + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return $this + */ + public function setAction(?string $action): static + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\RtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets worksRef + * + * @return string|null + */ + public function getWorksRef(): ?string + { + return $this->container['worksRef']; + } + + /** + * Sets worksRef + * + * @param string|null $worksRef worksRef + * + * @return $this + */ + public function setWorksRef(?string $worksRef): static + { + if (is_null($worksRef)) { + array_push($this->openAPINullablesSetToNull, 'worksRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('worksRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['worksRef'] = $worksRef; + + return $this; + } + + /** + * Gets unmatchedRate + * + * @return string|null + */ + public function getUnmatchedRate(): ?string + { + return $this->container['unmatchedRate']; + } + + /** + * Sets unmatchedRate + * + * @param string|null $unmatchedRate unmatchedRate + * + * @return $this + */ + public function setUnmatchedRate(?string $unmatchedRate): static + { + if (is_null($unmatchedRate)) { + array_push($this->openAPINullablesSetToNull, 'unmatchedRate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unmatchedRate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['unmatchedRate'] = $unmatchedRate; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets crn + * + * @return string|null + */ + public function getCrn(): ?string + { + return $this->container['crn']; + } + + /** + * Sets crn + * + * @param string|null $crn crn + * + * @return $this + */ + public function setCrn(?string $crn): static + { + if (is_null($crn)) { + array_push($this->openAPINullablesSetToNull, 'crn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('crn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['crn'] = $crn; + + return $this; + } + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets partnership + * + * @return \SynergiTech\Staffology\Model\CisPartnership|null + */ + public function getPartnership(): ?\SynergiTech\Staffology\Model\CisPartnership + { + return $this->container['partnership']; + } + + /** + * Sets partnership + * + * @param \SynergiTech\Staffology\Model\CisPartnership|null $partnership partnership + * + * @return $this + */ + public function setPartnership(?\SynergiTech\Staffology\Model\CisPartnership $partnership): static + { + if (is_null($partnership)) { + throw new InvalidArgumentException('non-nullable partnership cannot be null'); + } + $this->container['partnership'] = $partnership; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\RtiEmployeeAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\RtiEmployeeAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets totalPaymentsUnrounded + * + * @return string|null + */ + public function getTotalPaymentsUnrounded(): ?string + { + return $this->container['totalPaymentsUnrounded']; + } + + /** + * Sets totalPaymentsUnrounded + * + * @param string|null $totalPaymentsUnrounded totalPaymentsUnrounded + * + * @return $this + */ + public function setTotalPaymentsUnrounded(?string $totalPaymentsUnrounded): static + { + if (is_null($totalPaymentsUnrounded)) { + array_push($this->openAPINullablesSetToNull, 'totalPaymentsUnrounded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaymentsUnrounded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaymentsUnrounded'] = $totalPaymentsUnrounded; + + return $this; + } + + /** + * Gets costOfMaterialsUnrounded + * + * @return string|null + */ + public function getCostOfMaterialsUnrounded(): ?string + { + return $this->container['costOfMaterialsUnrounded']; + } + + /** + * Sets costOfMaterialsUnrounded + * + * @param string|null $costOfMaterialsUnrounded costOfMaterialsUnrounded + * + * @return $this + */ + public function setCostOfMaterialsUnrounded(?string $costOfMaterialsUnrounded): static + { + if (is_null($costOfMaterialsUnrounded)) { + array_push($this->openAPINullablesSetToNull, 'costOfMaterialsUnrounded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOfMaterialsUnrounded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOfMaterialsUnrounded'] = $costOfMaterialsUnrounded; + + return $this; + } + + /** + * Gets umbrellaFee + * + * @return string|null + */ + public function getUmbrellaFee(): ?string + { + return $this->container['umbrellaFee']; + } + + /** + * Sets umbrellaFee + * + * @param string|null $umbrellaFee umbrellaFee + * + * @return $this + */ + public function setUmbrellaFee(?string $umbrellaFee): static + { + if (is_null($umbrellaFee)) { + array_push($this->openAPINullablesSetToNull, 'umbrellaFee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('umbrellaFee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['umbrellaFee'] = $umbrellaFee; + + return $this; + } + + /** + * Gets validationMsg + * + * @return string|null + */ + public function getValidationMsg(): ?string + { + return $this->container['validationMsg']; + } + + /** + * Sets validationMsg + * + * @param string|null $validationMsg validationMsg + * + * @return $this + */ + public function setValidationMsg(?string $validationMsg): static + { + if (is_null($validationMsg)) { + array_push($this->openAPINullablesSetToNull, 'validationMsg'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validationMsg', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['validationMsg'] = $validationMsg; + + return $this; + } + + /** + * Gets verificationNumber + * + * @return string|null + */ + public function getVerificationNumber(): ?string + { + return $this->container['verificationNumber']; + } + + /** + * Sets verificationNumber + * + * @param string|null $verificationNumber verificationNumber + * + * @return $this + */ + public function setVerificationNumber(?string $verificationNumber): static + { + if (is_null($verificationNumber)) { + array_push($this->openAPINullablesSetToNull, 'verificationNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationNumber'] = $verificationNumber; + + return $this; + } + + /** + * Gets totalPayments + * + * @return string|null + */ + public function getTotalPayments(): ?string + { + return $this->container['totalPayments']; + } + + /** + * Sets totalPayments + * + * @param string|null $totalPayments totalPayments + * + * @return $this + */ + public function setTotalPayments(?string $totalPayments): static + { + if (is_null($totalPayments)) { + array_push($this->openAPINullablesSetToNull, 'totalPayments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPayments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPayments'] = $totalPayments; + + return $this; + } + + /** + * Gets costOfMaterials + * + * @return string|null + */ + public function getCostOfMaterials(): ?string + { + return $this->container['costOfMaterials']; + } + + /** + * Sets costOfMaterials + * + * @param string|null $costOfMaterials costOfMaterials + * + * @return $this + */ + public function setCostOfMaterials(?string $costOfMaterials): static + { + if (is_null($costOfMaterials)) { + array_push($this->openAPINullablesSetToNull, 'costOfMaterials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOfMaterials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOfMaterials'] = $costOfMaterials; + + return $this; + } + + /** + * Gets totalDeducted + * + * @return string|null + */ + public function getTotalDeducted(): ?string + { + return $this->container['totalDeducted']; + } + + /** + * Sets totalDeducted + * + * @param string|null $totalDeducted totalDeducted + * + * @return $this + */ + public function setTotalDeducted(?string $totalDeducted): static + { + if (is_null($totalDeducted)) { + array_push($this->openAPINullablesSetToNull, 'totalDeducted'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalDeducted', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalDeducted'] = $totalDeducted; + + return $this; + } + + /** + * Gets matched + * + * @return string|null + */ + public function getMatched(): ?string + { + return $this->container['matched']; + } + + /** + * Sets matched + * + * @param string|null $matched matched + * + * @return $this + */ + public function setMatched(?string $matched): static + { + if (is_null($matched)) { + array_push($this->openAPINullablesSetToNull, 'matched'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matched', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['matched'] = $matched; + + return $this; + } + + /** + * Gets taxTreatment + * + * @return string|null + */ + public function getTaxTreatment(): ?string + { + return $this->container['taxTreatment']; + } + + /** + * Sets taxTreatment + * + * @param string|null $taxTreatment taxTreatment + * + * @return $this + */ + public function setTaxTreatment(?string $taxTreatment): static + { + if (is_null($taxTreatment)) { + array_push($this->openAPINullablesSetToNull, 'taxTreatment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxTreatment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxTreatment'] = $taxTreatment; + + return $this; + } + + /** + * Gets netPayment + * + * @return string|null + */ + public function getNetPayment(): ?string + { + return $this->container['netPayment']; + } + + /** + * Sets netPayment + * + * @param string|null $netPayment netPayment + * + * @return $this + */ + public function setNetPayment(?string $netPayment): static + { + if (is_null($netPayment)) { + array_push($this->openAPINullablesSetToNull, 'netPayment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netPayment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netPayment'] = $netPayment; + + return $this; + } + + /** + * Gets vatAmount + * + * @return string|null + */ + public function getVatAmount(): ?string + { + return $this->container['vatAmount']; + } + + /** + * Sets vatAmount + * + * @param string|null $vatAmount vatAmount + * + * @return $this + */ + public function setVatAmount(?string $vatAmount): static + { + if (is_null($vatAmount)) { + array_push($this->openAPINullablesSetToNull, 'vatAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vatAmount', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['vatAmount'] = $vatAmount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisSubContractorSummary.php b/src/Model/CisSubContractorSummary.php new file mode 100644 index 0000000..d8fbbc2 --- /dev/null +++ b/src/Model/CisSubContractorSummary.php @@ -0,0 +1,812 @@ + + */ +class CisSubContractorSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisSubContractorSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'tradingName' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'niNumber' => 'string', + 'type' => '\SynergiTech\Staffology\Model\CISSubContractorType', + 'utr' => 'string', + 'taxStatus' => '\SynergiTech\Staffology\Model\CISTaxStatus', + 'verificationNumber' => 'string', + 'displayName' => 'string', + 'validationMessage' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'tradingName' => null, + 'firstName' => null, + 'lastName' => null, + 'niNumber' => null, + 'type' => null, + 'utr' => null, + 'taxStatus' => null, + 'verificationNumber' => null, + 'displayName' => null, + 'validationMessage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'tradingName' => true, + 'firstName' => true, + 'lastName' => true, + 'niNumber' => true, + 'type' => false, + 'utr' => true, + 'taxStatus' => false, + 'verificationNumber' => true, + 'displayName' => true, + 'validationMessage' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'tradingName' => 'tradingName', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'niNumber' => 'niNumber', + 'type' => 'type', + 'utr' => 'utr', + 'taxStatus' => 'taxStatus', + 'verificationNumber' => 'verificationNumber', + 'displayName' => 'displayName', + 'validationMessage' => 'validationMessage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'tradingName' => 'setTradingName', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'niNumber' => 'setNiNumber', + 'type' => 'setType', + 'utr' => 'setUtr', + 'taxStatus' => 'setTaxStatus', + 'verificationNumber' => 'setVerificationNumber', + 'displayName' => 'setDisplayName', + 'validationMessage' => 'setValidationMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'tradingName' => 'getTradingName', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'niNumber' => 'getNiNumber', + 'type' => 'getType', + 'utr' => 'getUtr', + 'taxStatus' => 'getTaxStatus', + 'verificationNumber' => 'getVerificationNumber', + 'displayName' => 'getDisplayName', + 'validationMessage' => 'getValidationMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('taxStatus', $data ?? [], null); + $this->setIfExists('verificationNumber', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('validationMessage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\CISSubContractorType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\CISSubContractorType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\CISSubContractorType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\CISSubContractorType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets taxStatus + * + * @return \SynergiTech\Staffology\Model\CISTaxStatus|null + */ + public function getTaxStatus(): ?\SynergiTech\Staffology\Model\CISTaxStatus + { + return $this->container['taxStatus']; + } + + /** + * Sets taxStatus + * + * @param \SynergiTech\Staffology\Model\CISTaxStatus|null $taxStatus taxStatus + * + * @return $this + */ + public function setTaxStatus(?\SynergiTech\Staffology\Model\CISTaxStatus $taxStatus): static + { + if (is_null($taxStatus)) { + throw new InvalidArgumentException('non-nullable taxStatus cannot be null'); + } + $this->container['taxStatus'] = $taxStatus; + + return $this; + } + + /** + * Gets verificationNumber + * + * @return string|null + */ + public function getVerificationNumber(): ?string + { + return $this->container['verificationNumber']; + } + + /** + * Sets verificationNumber + * + * @param string|null $verificationNumber verificationNumber + * + * @return $this + */ + public function setVerificationNumber(?string $verificationNumber): static + { + if (is_null($verificationNumber)) { + array_push($this->openAPINullablesSetToNull, 'verificationNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationNumber'] = $verificationNumber; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets validationMessage + * + * @return string[]|null + */ + public function getValidationMessage(): ?array + { + return $this->container['validationMessage']; + } + + /** + * Sets validationMessage + * + * @param string[]|null $validationMessage validationMessage + * + * @return $this + */ + public function setValidationMessage(?array $validationMessage): static + { + if (is_null($validationMessage)) { + array_push($this->openAPINullablesSetToNull, 'validationMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validationMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['validationMessage'] = $validationMessage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisSubContractorSummaryListReportResponse.php b/src/Model/CisSubContractorSummaryListReportResponse.php new file mode 100644 index 0000000..4ab0f1b --- /dev/null +++ b/src/Model/CisSubContractorSummaryListReportResponse.php @@ -0,0 +1,539 @@ + + */ +class CisSubContractorSummaryListReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisSubContractorSummaryListReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\CisSubContractorSummary[]', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\CisSubContractorSummary[]|null + */ + public function getModel(): ?array + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\CisSubContractorSummary[]|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(?array $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisVerification.php b/src/Model/CisVerification.php new file mode 100644 index 0000000..d9dca34 --- /dev/null +++ b/src/Model/CisVerification.php @@ -0,0 +1,743 @@ + + */ +class CisVerification implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisVerification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employees' => '\SynergiTech\Staffology\Model\Item[]', + 'employeeCount' => 'int', + 'cisRequest' => '\SynergiTech\Staffology\Model\CisRequest', + 'responses' => '\SynergiTech\Staffology\Model\CisSubContractor[]', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employees' => null, + 'employeeCount' => 'int32', + 'cisRequest' => null, + 'responses' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employees' => true, + 'employeeCount' => false, + 'cisRequest' => false, + 'responses' => true, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employees' => 'employees', + 'employeeCount' => 'employeeCount', + 'cisRequest' => 'cisRequest', + 'responses' => 'responses', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employees' => 'setEmployees', + 'employeeCount' => 'setEmployeeCount', + 'cisRequest' => 'setCisRequest', + 'responses' => 'setResponses', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employees' => 'getEmployees', + 'employeeCount' => 'getEmployeeCount', + 'cisRequest' => 'getCisRequest', + 'responses' => 'getResponses', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employees', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('cisRequest', $data ?? [], null); + $this->setIfExists('responses', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employees + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getEmployees(): ?array + { + return $this->container['employees']; + } + + /** + * Sets employees + * + * @param \SynergiTech\Staffology\Model\Item[]|null $employees employees + * + * @return $this + */ + public function setEmployees(?array $employees): static + { + if (is_null($employees)) { + array_push($this->openAPINullablesSetToNull, 'employees'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employees', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employees'] = $employees; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount employeeCount + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets cisRequest + * + * @return \SynergiTech\Staffology\Model\CisRequest|null + */ + public function getCisRequest(): ?\SynergiTech\Staffology\Model\CisRequest + { + return $this->container['cisRequest']; + } + + /** + * Sets cisRequest + * + * @param \SynergiTech\Staffology\Model\CisRequest|null $cisRequest cisRequest + * + * @return $this + */ + public function setCisRequest(?\SynergiTech\Staffology\Model\CisRequest $cisRequest): static + { + if (is_null($cisRequest)) { + throw new InvalidArgumentException('non-nullable cisRequest cannot be null'); + } + $this->container['cisRequest'] = $cisRequest; + + return $this; + } + + /** + * Gets responses + * + * @return \SynergiTech\Staffology\Model\CisSubContractor[]|null + */ + public function getResponses(): ?array + { + return $this->container['responses']; + } + + /** + * Sets responses + * + * @param \SynergiTech\Staffology\Model\CisSubContractor[]|null $responses responses + * + * @return $this + */ + public function setResponses(?array $responses): static + { + if (is_null($responses)) { + array_push($this->openAPINullablesSetToNull, 'responses'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('responses', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['responses'] = $responses; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CisVerificationDetails.php b/src/Model/CisVerificationDetails.php new file mode 100644 index 0000000..d8b31f8 --- /dev/null +++ b/src/Model/CisVerificationDetails.php @@ -0,0 +1,633 @@ + + */ +class CisVerificationDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CisVerificationDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'manuallyEntered' => 'bool', + 'matchInsteadOfVerify' => 'bool', + 'number' => 'string', + 'date' => '\DateTime', + 'taxStatus' => '\SynergiTech\Staffology\Model\CISTaxStatus', + 'verificationRequest' => 'string', + 'verificationResponse' => '\SynergiTech\Staffology\Model\CisSubContractor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'manuallyEntered' => null, + 'matchInsteadOfVerify' => null, + 'number' => null, + 'date' => 'date', + 'taxStatus' => null, + 'verificationRequest' => 'uuid', + 'verificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'manuallyEntered' => false, + 'matchInsteadOfVerify' => false, + 'number' => true, + 'date' => true, + 'taxStatus' => false, + 'verificationRequest' => true, + 'verificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'manuallyEntered' => 'manuallyEntered', + 'matchInsteadOfVerify' => 'matchInsteadOfVerify', + 'number' => 'number', + 'date' => 'date', + 'taxStatus' => 'taxStatus', + 'verificationRequest' => 'verificationRequest', + 'verificationResponse' => 'verificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'manuallyEntered' => 'setManuallyEntered', + 'matchInsteadOfVerify' => 'setMatchInsteadOfVerify', + 'number' => 'setNumber', + 'date' => 'setDate', + 'taxStatus' => 'setTaxStatus', + 'verificationRequest' => 'setVerificationRequest', + 'verificationResponse' => 'setVerificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'manuallyEntered' => 'getManuallyEntered', + 'matchInsteadOfVerify' => 'getMatchInsteadOfVerify', + 'number' => 'getNumber', + 'date' => 'getDate', + 'taxStatus' => 'getTaxStatus', + 'verificationRequest' => 'getVerificationRequest', + 'verificationResponse' => 'getVerificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('manuallyEntered', $data ?? [], null); + $this->setIfExists('matchInsteadOfVerify', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('taxStatus', $data ?? [], null); + $this->setIfExists('verificationRequest', $data ?? [], null); + $this->setIfExists('verificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets manuallyEntered + * + * @return bool|null + */ + public function getManuallyEntered(): ?bool + { + return $this->container['manuallyEntered']; + } + + /** + * Sets manuallyEntered + * + * @param bool|null $manuallyEntered manuallyEntered + * + * @return $this + */ + public function setManuallyEntered(?bool $manuallyEntered): static + { + if (is_null($manuallyEntered)) { + throw new InvalidArgumentException('non-nullable manuallyEntered cannot be null'); + } + $this->container['manuallyEntered'] = $manuallyEntered; + + return $this; + } + + /** + * Gets matchInsteadOfVerify + * + * @return bool|null + */ + public function getMatchInsteadOfVerify(): ?bool + { + return $this->container['matchInsteadOfVerify']; + } + + /** + * Sets matchInsteadOfVerify + * + * @param bool|null $matchInsteadOfVerify matchInsteadOfVerify + * + * @return $this + */ + public function setMatchInsteadOfVerify(?bool $matchInsteadOfVerify): static + { + if (is_null($matchInsteadOfVerify)) { + throw new InvalidArgumentException('non-nullable matchInsteadOfVerify cannot be null'); + } + $this->container['matchInsteadOfVerify'] = $matchInsteadOfVerify; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber(): ?string + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number number + * + * @return $this + */ + public function setNumber(?string $number): static + { + if (is_null($number)) { + array_push($this->openAPINullablesSetToNull, 'number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + array_push($this->openAPINullablesSetToNull, 'date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets taxStatus + * + * @return \SynergiTech\Staffology\Model\CISTaxStatus|null + */ + public function getTaxStatus(): ?\SynergiTech\Staffology\Model\CISTaxStatus + { + return $this->container['taxStatus']; + } + + /** + * Sets taxStatus + * + * @param \SynergiTech\Staffology\Model\CISTaxStatus|null $taxStatus taxStatus + * + * @return $this + */ + public function setTaxStatus(?\SynergiTech\Staffology\Model\CISTaxStatus $taxStatus): static + { + if (is_null($taxStatus)) { + throw new InvalidArgumentException('non-nullable taxStatus cannot be null'); + } + $this->container['taxStatus'] = $taxStatus; + + return $this; + } + + /** + * Gets verificationRequest + * + * @return string|null + */ + public function getVerificationRequest(): ?string + { + return $this->container['verificationRequest']; + } + + /** + * Sets verificationRequest + * + * @param string|null $verificationRequest [readonly] If a Verification request has been made for this employee then this will show its ID + * + * @return $this + */ + public function setVerificationRequest(?string $verificationRequest): static + { + if (is_null($verificationRequest)) { + array_push($this->openAPINullablesSetToNull, 'verificationRequest'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationRequest', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationRequest'] = $verificationRequest; + + return $this; + } + + /** + * Gets verificationResponse + * + * @return \SynergiTech\Staffology\Model\CisSubContractor|null + */ + public function getVerificationResponse(): ?\SynergiTech\Staffology\Model\CisSubContractor + { + return $this->container['verificationResponse']; + } + + /** + * Sets verificationResponse + * + * @param \SynergiTech\Staffology\Model\CisSubContractor|null $verificationResponse verificationResponse + * + * @return $this + */ + public function setVerificationResponse(?\SynergiTech\Staffology\Model\CisSubContractor $verificationResponse): static + { + if (is_null($verificationResponse)) { + throw new InvalidArgumentException('non-nullable verificationResponse cannot be null'); + } + $this->container['verificationResponse'] = $verificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAddress.php b/src/Model/ContractAddress.php new file mode 100644 index 0000000..e944c20 --- /dev/null +++ b/src/Model/ContractAddress.php @@ -0,0 +1,751 @@ + + */ +class ContractAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'line4' => 'string', + 'line5' => 'string', + 'postCode' => 'string', + 'country' => '\SynergiTech\Staffology\Model\Country', + 'foreignCountry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'line4' => null, + 'line5' => null, + 'postCode' => null, + 'country' => null, + 'foreignCountry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'line1' => true, + 'line2' => true, + 'line3' => true, + 'line4' => true, + 'line5' => true, + 'postCode' => true, + 'country' => false, + 'foreignCountry' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'line4' => 'line4', + 'line5' => 'line5', + 'postCode' => 'postCode', + 'country' => 'country', + 'foreignCountry' => 'foreignCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'line4' => 'setLine4', + 'line5' => 'setLine5', + 'postCode' => 'setPostCode', + 'country' => 'setCountry', + 'foreignCountry' => 'setForeignCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'line4' => 'getLine4', + 'line5' => 'getLine5', + 'postCode' => 'getPostCode', + 'country' => 'getCountry', + 'foreignCountry' => 'getForeignCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('line4', $data ?? [], null); + $this->setIfExists('line5', $data ?? [], null); + $this->setIfExists('postCode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('foreignCountry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['line1']) && (mb_strlen($this->container['line1']) > 100)) { + $invalidProperties[] = "invalid value for 'line1', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line2']) && (mb_strlen($this->container['line2']) > 100)) { + $invalidProperties[] = "invalid value for 'line2', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line3']) && (mb_strlen($this->container['line3']) > 100)) { + $invalidProperties[] = "invalid value for 'line3', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line4']) && (mb_strlen($this->container['line4']) > 100)) { + $invalidProperties[] = "invalid value for 'line4', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['line5']) && (mb_strlen($this->container['line5']) > 100)) { + $invalidProperties[] = "invalid value for 'line5', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['postCode']) && (mb_strlen($this->container['postCode']) > 10)) { + $invalidProperties[] = "invalid value for 'postCode', the character length must be smaller than or equal to 10."; + } + + if (!is_null($this->container['foreignCountry']) && (mb_strlen($this->container['foreignCountry']) > 35)) { + $invalidProperties[] = "invalid value for 'foreignCountry', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1(): ?string + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 line1 + * + * @return $this + */ + public function setLine1(?string $line1): static + { + if (is_null($line1)) { + array_push($this->openAPINullablesSetToNull, 'line1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line1) && (mb_strlen($line1) > 100)) { + throw new InvalidArgumentException('invalid length for $line1 when calling ContractAddress., must be smaller than or equal to 100.'); + } + + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2(): ?string + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 line2 + * + * @return $this + */ + public function setLine2(?string $line2): static + { + if (is_null($line2)) { + array_push($this->openAPINullablesSetToNull, 'line2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line2) && (mb_strlen($line2) > 100)) { + throw new InvalidArgumentException('invalid length for $line2 when calling ContractAddress., must be smaller than or equal to 100.'); + } + + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3(): ?string + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 line3 + * + * @return $this + */ + public function setLine3(?string $line3): static + { + if (is_null($line3)) { + array_push($this->openAPINullablesSetToNull, 'line3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line3) && (mb_strlen($line3) > 100)) { + throw new InvalidArgumentException('invalid length for $line3 when calling ContractAddress., must be smaller than or equal to 100.'); + } + + $this->container['line3'] = $line3; + + return $this; + } + + /** + * Gets line4 + * + * @return string|null + */ + public function getLine4(): ?string + { + return $this->container['line4']; + } + + /** + * Sets line4 + * + * @param string|null $line4 line4 + * + * @return $this + */ + public function setLine4(?string $line4): static + { + if (is_null($line4)) { + array_push($this->openAPINullablesSetToNull, 'line4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line4) && (mb_strlen($line4) > 100)) { + throw new InvalidArgumentException('invalid length for $line4 when calling ContractAddress., must be smaller than or equal to 100.'); + } + + $this->container['line4'] = $line4; + + return $this; + } + + /** + * Gets line5 + * + * @return string|null + */ + public function getLine5(): ?string + { + return $this->container['line5']; + } + + /** + * Sets line5 + * + * @param string|null $line5 line5 + * + * @return $this + */ + public function setLine5(?string $line5): static + { + if (is_null($line5)) { + array_push($this->openAPINullablesSetToNull, 'line5'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line5', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($line5) && (mb_strlen($line5) > 100)) { + throw new InvalidArgumentException('invalid length for $line5 when calling ContractAddress., must be smaller than or equal to 100.'); + } + + $this->container['line5'] = $line5; + + return $this; + } + + /** + * Gets postCode + * + * @return string|null + */ + public function getPostCode(): ?string + { + return $this->container['postCode']; + } + + /** + * Sets postCode + * + * @param string|null $postCode postCode + * + * @return $this + */ + public function setPostCode(?string $postCode): static + { + if (is_null($postCode)) { + array_push($this->openAPINullablesSetToNull, 'postCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($postCode) && (mb_strlen($postCode) > 10)) { + throw new InvalidArgumentException('invalid length for $postCode when calling ContractAddress., must be smaller than or equal to 10.'); + } + + $this->container['postCode'] = $postCode; + + return $this; + } + + /** + * Gets country + * + * @return \SynergiTech\Staffology\Model\Country|null + */ + public function getCountry(): ?\SynergiTech\Staffology\Model\Country + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param \SynergiTech\Staffology\Model\Country|null $country country + * + * @return $this + */ + public function setCountry(?\SynergiTech\Staffology\Model\Country $country): static + { + if (is_null($country)) { + throw new InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets foreignCountry + * + * @return string|null + */ + public function getForeignCountry(): ?string + { + return $this->container['foreignCountry']; + } + + /** + * Sets foreignCountry + * + * @param string|null $foreignCountry foreignCountry + * + * @return $this + */ + public function setForeignCountry(?string $foreignCountry): static + { + if (is_null($foreignCountry)) { + array_push($this->openAPINullablesSetToNull, 'foreignCountry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignCountry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($foreignCountry) && (mb_strlen($foreignCountry) > 35)) { + throw new InvalidArgumentException('invalid length for $foreignCountry when calling ContractAddress., must be smaller than or equal to 35.'); + } + + $this->container['foreignCountry'] = $foreignCountry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAeAssessmentAction.php b/src/Model/ContractAeAssessmentAction.php new file mode 100644 index 0000000..f2fc06d --- /dev/null +++ b/src/Model/ContractAeAssessmentAction.php @@ -0,0 +1,653 @@ + + */ +class ContractAeAssessmentAction implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AeAssessmentAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'action' => '\SynergiTech\Staffology\Model\AeAction', + 'employeeState' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'actionCompleted' => 'bool', + 'actionCompletedMessage' => 'string', + 'requiredLetter' => '\SynergiTech\Staffology\Model\AeStatutoryLetter', + 'pensionSchemeId' => 'string', + 'workerGroupId' => 'string', + 'letterNotYetSent' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'action' => null, + 'employeeState' => null, + 'actionCompleted' => null, + 'actionCompletedMessage' => null, + 'requiredLetter' => null, + 'pensionSchemeId' => 'uuid', + 'workerGroupId' => 'uuid', + 'letterNotYetSent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'action' => false, + 'employeeState' => false, + 'actionCompleted' => false, + 'actionCompletedMessage' => true, + 'requiredLetter' => false, + 'pensionSchemeId' => false, + 'workerGroupId' => false, + 'letterNotYetSent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'action' => 'action', + 'employeeState' => 'employeeState', + 'actionCompleted' => 'actionCompleted', + 'actionCompletedMessage' => 'actionCompletedMessage', + 'requiredLetter' => 'requiredLetter', + 'pensionSchemeId' => 'pensionSchemeId', + 'workerGroupId' => 'workerGroupId', + 'letterNotYetSent' => 'letterNotYetSent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'action' => 'setAction', + 'employeeState' => 'setEmployeeState', + 'actionCompleted' => 'setActionCompleted', + 'actionCompletedMessage' => 'setActionCompletedMessage', + 'requiredLetter' => 'setRequiredLetter', + 'pensionSchemeId' => 'setPensionSchemeId', + 'workerGroupId' => 'setWorkerGroupId', + 'letterNotYetSent' => 'setLetterNotYetSent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'action' => 'getAction', + 'employeeState' => 'getEmployeeState', + 'actionCompleted' => 'getActionCompleted', + 'actionCompletedMessage' => 'getActionCompletedMessage', + 'requiredLetter' => 'getRequiredLetter', + 'pensionSchemeId' => 'getPensionSchemeId', + 'workerGroupId' => 'getWorkerGroupId', + 'letterNotYetSent' => 'getLetterNotYetSent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('employeeState', $data ?? [], null); + $this->setIfExists('actionCompleted', $data ?? [], null); + $this->setIfExists('actionCompletedMessage', $data ?? [], null); + $this->setIfExists('requiredLetter', $data ?? [], null); + $this->setIfExists('pensionSchemeId', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + $this->setIfExists('letterNotYetSent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action + * + * @return \SynergiTech\Staffology\Model\AeAction|null + */ + public function getAction(): ?\SynergiTech\Staffology\Model\AeAction + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \SynergiTech\Staffology\Model\AeAction|null $action action + * + * @return $this + */ + public function setAction(?\SynergiTech\Staffology\Model\AeAction $action): static + { + if (is_null($action)) { + throw new InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets employeeState + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getEmployeeState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['employeeState']; + } + + /** + * Sets employeeState + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $employeeState employeeState + * + * @return $this + */ + public function setEmployeeState(?\SynergiTech\Staffology\Model\AeEmployeeState $employeeState): static + { + if (is_null($employeeState)) { + throw new InvalidArgumentException('non-nullable employeeState cannot be null'); + } + $this->container['employeeState'] = $employeeState; + + return $this; + } + + /** + * Gets actionCompleted + * + * @return bool|null + */ + public function getActionCompleted(): ?bool + { + return $this->container['actionCompleted']; + } + + /** + * Sets actionCompleted + * + * @param bool|null $actionCompleted Indicates whether or not the required action was successfully completed + * + * @return $this + */ + public function setActionCompleted(?bool $actionCompleted): static + { + if (is_null($actionCompleted)) { + throw new InvalidArgumentException('non-nullable actionCompleted cannot be null'); + } + $this->container['actionCompleted'] = $actionCompleted; + + return $this; + } + + /** + * Gets actionCompletedMessage + * + * @return string|null + */ + public function getActionCompletedMessage(): ?string + { + return $this->container['actionCompletedMessage']; + } + + /** + * Sets actionCompletedMessage + * + * @param string|null $actionCompletedMessage Gives further information about the action taken or the reason if wasn't successfully completed + * + * @return $this + */ + public function setActionCompletedMessage(?string $actionCompletedMessage): static + { + if (is_null($actionCompletedMessage)) { + array_push($this->openAPINullablesSetToNull, 'actionCompletedMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actionCompletedMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actionCompletedMessage'] = $actionCompletedMessage; + + return $this; + } + + /** + * Gets requiredLetter + * + * @return \SynergiTech\Staffology\Model\AeStatutoryLetter|null + */ + public function getRequiredLetter(): ?\SynergiTech\Staffology\Model\AeStatutoryLetter + { + return $this->container['requiredLetter']; + } + + /** + * Sets requiredLetter + * + * @param \SynergiTech\Staffology\Model\AeStatutoryLetter|null $requiredLetter requiredLetter + * + * @return $this + */ + public function setRequiredLetter(?\SynergiTech\Staffology\Model\AeStatutoryLetter $requiredLetter): static + { + if (is_null($requiredLetter)) { + throw new InvalidArgumentException('non-nullable requiredLetter cannot be null'); + } + $this->container['requiredLetter'] = $requiredLetter; + + return $this; + } + + /** + * Gets pensionSchemeId + * + * @return string|null + */ + public function getPensionSchemeId(): ?string + { + return $this->container['pensionSchemeId']; + } + + /** + * Sets pensionSchemeId + * + * @param string|null $pensionSchemeId The PensionSchemeId that a completed action relates to + * + * @return $this + */ + public function setPensionSchemeId(?string $pensionSchemeId): static + { + if (is_null($pensionSchemeId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeId cannot be null'); + } + $this->container['pensionSchemeId'] = $pensionSchemeId; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId The WorkerGroupId that a completed action relates to + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + + /** + * Gets letterNotYetSent + * + * @return bool|null + */ + public function getLetterNotYetSent(): ?bool + { + return $this->container['letterNotYetSent']; + } + + /** + * Sets letterNotYetSent + * + * @param bool|null $letterNotYetSent Indicates whether or not any required letter has been sent + * + * @return $this + */ + public function setLetterNotYetSent(?bool $letterNotYetSent): static + { + if (is_null($letterNotYetSent)) { + throw new InvalidArgumentException('non-nullable letterNotYetSent cannot be null'); + } + $this->container['letterNotYetSent'] = $letterNotYetSent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAeAssessmentRequest.php b/src/Model/ContractAeAssessmentRequest.php new file mode 100644 index 0000000..7dbf60b --- /dev/null +++ b/src/Model/ContractAeAssessmentRequest.php @@ -0,0 +1,409 @@ + + */ +class ContractAeAssessmentRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AeAssessmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'assessmentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'assessmentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'assessmentDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'assessmentDate' => 'assessmentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'assessmentDate' => 'setAssessmentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'assessmentDate' => 'getAssessmentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('assessmentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets assessmentDate + * + * @return \DateTime|null + */ + public function getAssessmentDate(): ?\DateTime + { + return $this->container['assessmentDate']; + } + + /** + * Sets assessmentDate + * + * @param \DateTime|null $assessmentDate assessmentDate + * + * @return $this + */ + public function setAssessmentDate(?\DateTime $assessmentDate): static + { + if (is_null($assessmentDate)) { + throw new InvalidArgumentException('non-nullable assessmentDate cannot be null'); + } + $this->container['assessmentDate'] = $assessmentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAeAssessmentResponse.php b/src/Model/ContractAeAssessmentResponse.php new file mode 100644 index 0000000..0747912 --- /dev/null +++ b/src/Model/ContractAeAssessmentResponse.php @@ -0,0 +1,857 @@ + + */ +class ContractAeAssessmentResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AeAssessmentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'employeeState' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'age' => 'int', + 'ukWorker' => '\SynergiTech\Staffology\Model\AeUKWorker', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'earningsInPeriod' => 'float', + 'qualifyingEarningsInPeriod' => 'float', + 'aeExclusionCode' => '\SynergiTech\Staffology\Model\AeExclusionCode', + 'status' => '\SynergiTech\Staffology\Model\AeStatus', + 'reason' => 'string', + 'action' => '\SynergiTech\Staffology\Model\ContractAeAssessmentAction', + 'employee' => '\SynergiTech\Staffology\Model\ContractEmployeeItem', + 'assessmentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'employeeState' => null, + 'age' => 'int32', + 'ukWorker' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'earningsInPeriod' => 'double', + 'qualifyingEarningsInPeriod' => 'double', + 'aeExclusionCode' => null, + 'status' => null, + 'reason' => null, + 'action' => null, + 'employee' => null, + 'assessmentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employeeState' => false, + 'age' => false, + 'ukWorker' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'earningsInPeriod' => false, + 'qualifyingEarningsInPeriod' => false, + 'aeExclusionCode' => false, + 'status' => false, + 'reason' => true, + 'action' => false, + 'employee' => false, + 'assessmentDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employeeState' => 'employeeState', + 'age' => 'age', + 'ukWorker' => 'ukWorker', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'earningsInPeriod' => 'earningsInPeriod', + 'qualifyingEarningsInPeriod' => 'qualifyingEarningsInPeriod', + 'aeExclusionCode' => 'aeExclusionCode', + 'status' => 'status', + 'reason' => 'reason', + 'action' => 'action', + 'employee' => 'employee', + 'assessmentDate' => 'assessmentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employeeState' => 'setEmployeeState', + 'age' => 'setAge', + 'ukWorker' => 'setUkWorker', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'earningsInPeriod' => 'setEarningsInPeriod', + 'qualifyingEarningsInPeriod' => 'setQualifyingEarningsInPeriod', + 'aeExclusionCode' => 'setAeExclusionCode', + 'status' => 'setStatus', + 'reason' => 'setReason', + 'action' => 'setAction', + 'employee' => 'setEmployee', + 'assessmentDate' => 'setAssessmentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employeeState' => 'getEmployeeState', + 'age' => 'getAge', + 'ukWorker' => 'getUkWorker', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'earningsInPeriod' => 'getEarningsInPeriod', + 'qualifyingEarningsInPeriod' => 'getQualifyingEarningsInPeriod', + 'aeExclusionCode' => 'getAeExclusionCode', + 'status' => 'getStatus', + 'reason' => 'getReason', + 'action' => 'getAction', + 'employee' => 'getEmployee', + 'assessmentDate' => 'getAssessmentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employeeState', $data ?? [], null); + $this->setIfExists('age', $data ?? [], null); + $this->setIfExists('ukWorker', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('earningsInPeriod', $data ?? [], null); + $this->setIfExists('qualifyingEarningsInPeriod', $data ?? [], null); + $this->setIfExists('aeExclusionCode', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('assessmentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employeeState + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getEmployeeState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['employeeState']; + } + + /** + * Sets employeeState + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $employeeState employeeState + * + * @return $this + */ + public function setEmployeeState(?\SynergiTech\Staffology\Model\AeEmployeeState $employeeState): static + { + if (is_null($employeeState)) { + throw new InvalidArgumentException('non-nullable employeeState cannot be null'); + } + $this->container['employeeState'] = $employeeState; + + return $this; + } + + /** + * Gets age + * + * @return int|null + */ + public function getAge(): ?int + { + return $this->container['age']; + } + + /** + * Sets age + * + * @param int|null $age The age of the Employee at the time of the assessment + * + * @return $this + */ + public function setAge(?int $age): static + { + if (is_null($age)) { + throw new InvalidArgumentException('non-nullable age cannot be null'); + } + $this->container['age'] = $age; + + return $this; + } + + /** + * Gets ukWorker + * + * @return \SynergiTech\Staffology\Model\AeUKWorker|null + */ + public function getUkWorker(): ?\SynergiTech\Staffology\Model\AeUKWorker + { + return $this->container['ukWorker']; + } + + /** + * Sets ukWorker + * + * @param \SynergiTech\Staffology\Model\AeUKWorker|null $ukWorker ukWorker + * + * @return $this + */ + public function setUkWorker(?\SynergiTech\Staffology\Model\AeUKWorker $ukWorker): static + { + if (is_null($ukWorker)) { + throw new InvalidArgumentException('non-nullable ukWorker cannot be null'); + } + $this->container['ukWorker'] = $ukWorker; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal The PaySchedule ordinal for the Employee at the time of the assessment + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets earningsInPeriod + * + * @return float|null + */ + public function getEarningsInPeriod(): ?float + { + return $this->container['earningsInPeriod']; + } + + /** + * Sets earningsInPeriod + * + * @param float|null $earningsInPeriod earningsInPeriod + * + * @return $this + */ + public function setEarningsInPeriod(?float $earningsInPeriod): static + { + if (is_null($earningsInPeriod)) { + throw new InvalidArgumentException('non-nullable earningsInPeriod cannot be null'); + } + $this->container['earningsInPeriod'] = $earningsInPeriod; + + return $this; + } + + /** + * Gets qualifyingEarningsInPeriod + * + * @return float|null + */ + public function getQualifyingEarningsInPeriod(): ?float + { + return $this->container['qualifyingEarningsInPeriod']; + } + + /** + * Sets qualifyingEarningsInPeriod + * + * @param float|null $qualifyingEarningsInPeriod qualifyingEarningsInPeriod + * + * @return $this + */ + public function setQualifyingEarningsInPeriod(?float $qualifyingEarningsInPeriod): static + { + if (is_null($qualifyingEarningsInPeriod)) { + throw new InvalidArgumentException('non-nullable qualifyingEarningsInPeriod cannot be null'); + } + $this->container['qualifyingEarningsInPeriod'] = $qualifyingEarningsInPeriod; + + return $this; + } + + /** + * Gets aeExclusionCode + * + * @return \SynergiTech\Staffology\Model\AeExclusionCode|null + */ + public function getAeExclusionCode(): ?\SynergiTech\Staffology\Model\AeExclusionCode + { + return $this->container['aeExclusionCode']; + } + + /** + * Sets aeExclusionCode + * + * @param \SynergiTech\Staffology\Model\AeExclusionCode|null $aeExclusionCode aeExclusionCode + * + * @return $this + */ + public function setAeExclusionCode(?\SynergiTech\Staffology\Model\AeExclusionCode $aeExclusionCode): static + { + if (is_null($aeExclusionCode)) { + throw new InvalidArgumentException('non-nullable aeExclusionCode cannot be null'); + } + $this->container['aeExclusionCode'] = $aeExclusionCode; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\AeStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\AeStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\AeStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\AeStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason(): ?string + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for determining the Status given. + * + * @return $this + */ + public function setReason(?string $reason): static + { + if (is_null($reason)) { + array_push($this->openAPINullablesSetToNull, 'reason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reason', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets action + * + * @return \SynergiTech\Staffology\Model\ContractAeAssessmentAction|null + */ + public function getAction(): ?\SynergiTech\Staffology\Model\ContractAeAssessmentAction + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \SynergiTech\Staffology\Model\ContractAeAssessmentAction|null $action action + * + * @return $this + */ + public function setAction(?\SynergiTech\Staffology\Model\ContractAeAssessmentAction $action): static + { + if (is_null($action)) { + throw new InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\ContractEmployeeItem|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\ContractEmployeeItem + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\ContractEmployeeItem|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\ContractEmployeeItem $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets assessmentDate + * + * @return \DateTime|null + */ + public function getAssessmentDate(): ?\DateTime + { + return $this->container['assessmentDate']; + } + + /** + * Sets assessmentDate + * + * @param \DateTime|null $assessmentDate assessmentDate + * + * @return $this + */ + public function setAssessmentDate(?\DateTime $assessmentDate): static + { + if (is_null($assessmentDate)) { + throw new InvalidArgumentException('non-nullable assessmentDate cannot be null'); + } + $this->container['assessmentDate'] = $assessmentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAllowanceGradesRequest.php b/src/Model/ContractAllowanceGradesRequest.php new file mode 100644 index 0000000..a8a7494 --- /dev/null +++ b/src/Model/ContractAllowanceGradesRequest.php @@ -0,0 +1,524 @@ + + */ +class ContractAllowanceGradesRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AllowanceGradesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowanceGradePayslipText' => 'string', + 'allowanceGradeAnnualValue' => 'float', + 'allowanceGradeEffectiveDate' => '\DateTime', + 'allowanceName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowanceGradePayslipText' => null, + 'allowanceGradeAnnualValue' => 'double', + 'allowanceGradeEffectiveDate' => 'date', + 'allowanceName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowanceGradePayslipText' => true, + 'allowanceGradeAnnualValue' => false, + 'allowanceGradeEffectiveDate' => false, + 'allowanceName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowanceGradePayslipText' => 'allowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'allowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'allowanceGradeEffectiveDate', + 'allowanceName' => 'allowanceName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowanceGradePayslipText' => 'setAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'setAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'setAllowanceGradeEffectiveDate', + 'allowanceName' => 'setAllowanceName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowanceGradePayslipText' => 'getAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'getAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'getAllowanceGradeEffectiveDate', + 'allowanceName' => 'getAllowanceName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowanceGradePayslipText', $data ?? [], null); + $this->setIfExists('allowanceGradeAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceGradeEffectiveDate', $data ?? [], null); + $this->setIfExists('allowanceName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowanceGradePayslipText + * + * @return string|null + */ + public function getAllowanceGradePayslipText(): ?string + { + return $this->container['allowanceGradePayslipText']; + } + + /** + * Sets allowanceGradePayslipText + * + * @param string|null $allowanceGradePayslipText Alternative text for display on the payslip (i.e. TLR1A) + * + * @return $this + */ + public function setAllowanceGradePayslipText(?string $allowanceGradePayslipText): static + { + if (is_null($allowanceGradePayslipText)) { + array_push($this->openAPINullablesSetToNull, 'allowanceGradePayslipText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceGradePayslipText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceGradePayslipText'] = $allowanceGradePayslipText; + + return $this; + } + + /** + * Gets allowanceGradeAnnualValue + * + * @return float|null + */ + public function getAllowanceGradeAnnualValue(): ?float + { + return $this->container['allowanceGradeAnnualValue']; + } + + /** + * Sets allowanceGradeAnnualValue + * + * @param float|null $allowanceGradeAnnualValue FTE value of allowance grade + * + * @return $this + */ + public function setAllowanceGradeAnnualValue(?float $allowanceGradeAnnualValue): static + { + if (is_null($allowanceGradeAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceGradeAnnualValue cannot be null'); + } + $this->container['allowanceGradeAnnualValue'] = $allowanceGradeAnnualValue; + + return $this; + } + + /** + * Gets allowanceGradeEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceGradeEffectiveDate(): ?\DateTime + { + return $this->container['allowanceGradeEffectiveDate']; + } + + /** + * Sets allowanceGradeEffectiveDate + * + * @param \DateTime|null $allowanceGradeEffectiveDate Effective date of the value + * + * @return $this + */ + public function setAllowanceGradeEffectiveDate(?\DateTime $allowanceGradeEffectiveDate): static + { + if (is_null($allowanceGradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceGradeEffectiveDate cannot be null'); + } + $this->container['allowanceGradeEffectiveDate'] = $allowanceGradeEffectiveDate; + + return $this; + } + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Spine Allowance Name + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAllowanceGradesResponse.php b/src/Model/ContractAllowanceGradesResponse.php new file mode 100644 index 0000000..ecc68ed --- /dev/null +++ b/src/Model/ContractAllowanceGradesResponse.php @@ -0,0 +1,558 @@ + + */ +class ContractAllowanceGradesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AllowanceGradesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowanceGradePayslipText' => 'string', + 'allowanceGradeAnnualValue' => 'float', + 'allowanceGradeEffectiveDate' => '\DateTime', + 'uniqueId' => 'string', + 'allowanceName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowanceGradePayslipText' => null, + 'allowanceGradeAnnualValue' => 'double', + 'allowanceGradeEffectiveDate' => 'date', + 'uniqueId' => 'uuid', + 'allowanceName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowanceGradePayslipText' => true, + 'allowanceGradeAnnualValue' => false, + 'allowanceGradeEffectiveDate' => false, + 'uniqueId' => false, + 'allowanceName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowanceGradePayslipText' => 'allowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'allowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'allowanceGradeEffectiveDate', + 'uniqueId' => 'uniqueId', + 'allowanceName' => 'allowanceName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowanceGradePayslipText' => 'setAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'setAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'setAllowanceGradeEffectiveDate', + 'uniqueId' => 'setUniqueId', + 'allowanceName' => 'setAllowanceName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowanceGradePayslipText' => 'getAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'getAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'getAllowanceGradeEffectiveDate', + 'uniqueId' => 'getUniqueId', + 'allowanceName' => 'getAllowanceName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowanceGradePayslipText', $data ?? [], null); + $this->setIfExists('allowanceGradeAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceGradeEffectiveDate', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('allowanceName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowanceGradePayslipText + * + * @return string|null + */ + public function getAllowanceGradePayslipText(): ?string + { + return $this->container['allowanceGradePayslipText']; + } + + /** + * Sets allowanceGradePayslipText + * + * @param string|null $allowanceGradePayslipText Alternative text for display on the payslip (i.e. TLR1A) + * + * @return $this + */ + public function setAllowanceGradePayslipText(?string $allowanceGradePayslipText): static + { + if (is_null($allowanceGradePayslipText)) { + array_push($this->openAPINullablesSetToNull, 'allowanceGradePayslipText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceGradePayslipText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceGradePayslipText'] = $allowanceGradePayslipText; + + return $this; + } + + /** + * Gets allowanceGradeAnnualValue + * + * @return float|null + */ + public function getAllowanceGradeAnnualValue(): ?float + { + return $this->container['allowanceGradeAnnualValue']; + } + + /** + * Sets allowanceGradeAnnualValue + * + * @param float|null $allowanceGradeAnnualValue FTE value of allowance grade + * + * @return $this + */ + public function setAllowanceGradeAnnualValue(?float $allowanceGradeAnnualValue): static + { + if (is_null($allowanceGradeAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceGradeAnnualValue cannot be null'); + } + $this->container['allowanceGradeAnnualValue'] = $allowanceGradeAnnualValue; + + return $this; + } + + /** + * Gets allowanceGradeEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceGradeEffectiveDate(): ?\DateTime + { + return $this->container['allowanceGradeEffectiveDate']; + } + + /** + * Sets allowanceGradeEffectiveDate + * + * @param \DateTime|null $allowanceGradeEffectiveDate Effective date of the value + * + * @return $this + */ + public function setAllowanceGradeEffectiveDate(?\DateTime $allowanceGradeEffectiveDate): static + { + if (is_null($allowanceGradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceGradeEffectiveDate cannot be null'); + } + $this->container['allowanceGradeEffectiveDate'] = $allowanceGradeEffectiveDate; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Spine Allowance identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Spine Allowance Name + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAllowanceGradesUpdateRequest.php b/src/Model/ContractAllowanceGradesUpdateRequest.php new file mode 100644 index 0000000..2a8d29f --- /dev/null +++ b/src/Model/ContractAllowanceGradesUpdateRequest.php @@ -0,0 +1,558 @@ + + */ +class ContractAllowanceGradesUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AllowanceGradesUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'allowanceGradePayslipText' => 'string', + 'allowanceGradeAnnualValue' => 'float', + 'allowanceGradeEffectiveDate' => '\DateTime', + 'allowanceName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'allowanceGradePayslipText' => null, + 'allowanceGradeAnnualValue' => 'double', + 'allowanceGradeEffectiveDate' => 'date', + 'allowanceName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'allowanceGradePayslipText' => true, + 'allowanceGradeAnnualValue' => false, + 'allowanceGradeEffectiveDate' => false, + 'allowanceName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'allowanceGradePayslipText' => 'allowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'allowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'allowanceGradeEffectiveDate', + 'allowanceName' => 'allowanceName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'allowanceGradePayslipText' => 'setAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'setAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'setAllowanceGradeEffectiveDate', + 'allowanceName' => 'setAllowanceName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'allowanceGradePayslipText' => 'getAllowanceGradePayslipText', + 'allowanceGradeAnnualValue' => 'getAllowanceGradeAnnualValue', + 'allowanceGradeEffectiveDate' => 'getAllowanceGradeEffectiveDate', + 'allowanceName' => 'getAllowanceName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('allowanceGradePayslipText', $data ?? [], null); + $this->setIfExists('allowanceGradeAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceGradeEffectiveDate', $data ?? [], null); + $this->setIfExists('allowanceName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Allowance Grades identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets allowanceGradePayslipText + * + * @return string|null + */ + public function getAllowanceGradePayslipText(): ?string + { + return $this->container['allowanceGradePayslipText']; + } + + /** + * Sets allowanceGradePayslipText + * + * @param string|null $allowanceGradePayslipText Alternative text for display on the payslip (i.e. TLR1A) + * + * @return $this + */ + public function setAllowanceGradePayslipText(?string $allowanceGradePayslipText): static + { + if (is_null($allowanceGradePayslipText)) { + array_push($this->openAPINullablesSetToNull, 'allowanceGradePayslipText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceGradePayslipText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceGradePayslipText'] = $allowanceGradePayslipText; + + return $this; + } + + /** + * Gets allowanceGradeAnnualValue + * + * @return float|null + */ + public function getAllowanceGradeAnnualValue(): ?float + { + return $this->container['allowanceGradeAnnualValue']; + } + + /** + * Sets allowanceGradeAnnualValue + * + * @param float|null $allowanceGradeAnnualValue FTE value of allowance grade + * + * @return $this + */ + public function setAllowanceGradeAnnualValue(?float $allowanceGradeAnnualValue): static + { + if (is_null($allowanceGradeAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceGradeAnnualValue cannot be null'); + } + $this->container['allowanceGradeAnnualValue'] = $allowanceGradeAnnualValue; + + return $this; + } + + /** + * Gets allowanceGradeEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceGradeEffectiveDate(): ?\DateTime + { + return $this->container['allowanceGradeEffectiveDate']; + } + + /** + * Sets allowanceGradeEffectiveDate + * + * @param \DateTime|null $allowanceGradeEffectiveDate Effective date of the value + * + * @return $this + */ + public function setAllowanceGradeEffectiveDate(?\DateTime $allowanceGradeEffectiveDate): static + { + if (is_null($allowanceGradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceGradeEffectiveDate cannot be null'); + } + $this->container['allowanceGradeEffectiveDate'] = $allowanceGradeEffectiveDate; + + return $this; + } + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Spine Allowance Name + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAnalysisCategoryCodeRequest.php b/src/Model/ContractAnalysisCategoryCodeRequest.php new file mode 100644 index 0000000..8836e4b --- /dev/null +++ b/src/Model/ContractAnalysisCategoryCodeRequest.php @@ -0,0 +1,538 @@ + + */ +class ContractAnalysisCategoryCodeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AnalysisCategoryCodeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => true, + 'title' => true, + 'color' => true, + 'accountingCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color color + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAnalysisCategoryCodeResponse.php b/src/Model/ContractAnalysisCategoryCodeResponse.php new file mode 100644 index 0000000..81d4175 --- /dev/null +++ b/src/Model/ContractAnalysisCategoryCodeResponse.php @@ -0,0 +1,572 @@ + + */ +class ContractAnalysisCategoryCodeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AnalysisCategoryCodeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'code' => true, + 'title' => true, + 'color' => true, + 'accountingCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Analysis Category Code identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color color + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAnalysisCategoryRequest.php b/src/Model/ContractAnalysisCategoryRequest.php new file mode 100644 index 0000000..9cb8fe4 --- /dev/null +++ b/src/Model/ContractAnalysisCategoryRequest.php @@ -0,0 +1,415 @@ + + */ +class ContractAnalysisCategoryRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AnalysisCategoryRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Analysis Category Name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAnalysisCategoryResponse.php b/src/Model/ContractAnalysisCategoryResponse.php new file mode 100644 index 0000000..e2833fb --- /dev/null +++ b/src/Model/ContractAnalysisCategoryResponse.php @@ -0,0 +1,449 @@ + + */ +class ContractAnalysisCategoryResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AnalysisCategoryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Analysis Category identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Analysis Category Name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAutoEnrolmentRequest.php b/src/Model/ContractAutoEnrolmentRequest.php new file mode 100644 index 0000000..1c9ca30 --- /dev/null +++ b/src/Model/ContractAutoEnrolmentRequest.php @@ -0,0 +1,612 @@ + + */ +class ContractAutoEnrolmentRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AutoEnrolmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lastAssessment' => '\SynergiTech\Staffology\Model\ContractAeAssessmentRequest', + 'ukWorker' => '\SynergiTech\Staffology\Model\AeUKWorker', + 'daysToDeferAssessment' => 'int', + 'deferByMonthsNotDays' => 'bool', + 'exempt' => 'bool', + 'aeExclusionCode' => '\SynergiTech\Staffology\Model\AeExclusionCode', + 'aePostponementLetterSent' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lastAssessment' => null, + 'ukWorker' => null, + 'daysToDeferAssessment' => 'int32', + 'deferByMonthsNotDays' => null, + 'exempt' => null, + 'aeExclusionCode' => null, + 'aePostponementLetterSent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lastAssessment' => false, + 'ukWorker' => false, + 'daysToDeferAssessment' => false, + 'deferByMonthsNotDays' => false, + 'exempt' => false, + 'aeExclusionCode' => false, + 'aePostponementLetterSent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lastAssessment' => 'lastAssessment', + 'ukWorker' => 'ukWorker', + 'daysToDeferAssessment' => 'daysToDeferAssessment', + 'deferByMonthsNotDays' => 'deferByMonthsNotDays', + 'exempt' => 'exempt', + 'aeExclusionCode' => 'aeExclusionCode', + 'aePostponementLetterSent' => 'aePostponementLetterSent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lastAssessment' => 'setLastAssessment', + 'ukWorker' => 'setUkWorker', + 'daysToDeferAssessment' => 'setDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'setDeferByMonthsNotDays', + 'exempt' => 'setExempt', + 'aeExclusionCode' => 'setAeExclusionCode', + 'aePostponementLetterSent' => 'setAePostponementLetterSent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lastAssessment' => 'getLastAssessment', + 'ukWorker' => 'getUkWorker', + 'daysToDeferAssessment' => 'getDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'getDeferByMonthsNotDays', + 'exempt' => 'getExempt', + 'aeExclusionCode' => 'getAeExclusionCode', + 'aePostponementLetterSent' => 'getAePostponementLetterSent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lastAssessment', $data ?? [], null); + $this->setIfExists('ukWorker', $data ?? [], null); + $this->setIfExists('daysToDeferAssessment', $data ?? [], null); + $this->setIfExists('deferByMonthsNotDays', $data ?? [], null); + $this->setIfExists('exempt', $data ?? [], null); + $this->setIfExists('aeExclusionCode', $data ?? [], null); + $this->setIfExists('aePostponementLetterSent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lastAssessment + * + * @return \SynergiTech\Staffology\Model\ContractAeAssessmentRequest|null + */ + public function getLastAssessment(): ?\SynergiTech\Staffology\Model\ContractAeAssessmentRequest + { + return $this->container['lastAssessment']; + } + + /** + * Sets lastAssessment + * + * @param \SynergiTech\Staffology\Model\ContractAeAssessmentRequest|null $lastAssessment lastAssessment + * + * @return $this + */ + public function setLastAssessment(?\SynergiTech\Staffology\Model\ContractAeAssessmentRequest $lastAssessment): static + { + if (is_null($lastAssessment)) { + throw new InvalidArgumentException('non-nullable lastAssessment cannot be null'); + } + $this->container['lastAssessment'] = $lastAssessment; + + return $this; + } + + /** + * Gets ukWorker + * + * @return \SynergiTech\Staffology\Model\AeUKWorker|null + */ + public function getUkWorker(): ?\SynergiTech\Staffology\Model\AeUKWorker + { + return $this->container['ukWorker']; + } + + /** + * Sets ukWorker + * + * @param \SynergiTech\Staffology\Model\AeUKWorker|null $ukWorker ukWorker + * + * @return $this + */ + public function setUkWorker(?\SynergiTech\Staffology\Model\AeUKWorker $ukWorker): static + { + if (is_null($ukWorker)) { + throw new InvalidArgumentException('non-nullable ukWorker cannot be null'); + } + $this->container['ukWorker'] = $ukWorker; + + return $this; + } + + /** + * Gets daysToDeferAssessment + * + * @return int|null + */ + public function getDaysToDeferAssessment(): ?int + { + return $this->container['daysToDeferAssessment']; + } + + /** + * Sets daysToDeferAssessment + * + * @param int|null $daysToDeferAssessment The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. + * + * @return $this + */ + public function setDaysToDeferAssessment(?int $daysToDeferAssessment): static + { + if (is_null($daysToDeferAssessment)) { + throw new InvalidArgumentException('non-nullable daysToDeferAssessment cannot be null'); + } + $this->container['daysToDeferAssessment'] = $daysToDeferAssessment; + + return $this; + } + + /** + * Gets deferByMonthsNotDays + * + * @return bool|null + */ + public function getDeferByMonthsNotDays(): ?bool + { + return $this->container['deferByMonthsNotDays']; + } + + /** + * Sets deferByMonthsNotDays + * + * @param bool|null $deferByMonthsNotDays If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days + * + * @return $this + */ + public function setDeferByMonthsNotDays(?bool $deferByMonthsNotDays): static + { + if (is_null($deferByMonthsNotDays)) { + throw new InvalidArgumentException('non-nullable deferByMonthsNotDays cannot be null'); + } + $this->container['deferByMonthsNotDays'] = $deferByMonthsNotDays; + + return $this; + } + + /** + * Gets exempt + * + * @return bool|null + */ + public function getExempt(): ?bool + { + return $this->container['exempt']; + } + + /** + * Sets exempt + * + * @param bool|null $exempt exempt + * + * @return $this + */ + public function setExempt(?bool $exempt): static + { + if (is_null($exempt)) { + throw new InvalidArgumentException('non-nullable exempt cannot be null'); + } + $this->container['exempt'] = $exempt; + + return $this; + } + + /** + * Gets aeExclusionCode + * + * @return \SynergiTech\Staffology\Model\AeExclusionCode|null + */ + public function getAeExclusionCode(): ?\SynergiTech\Staffology\Model\AeExclusionCode + { + return $this->container['aeExclusionCode']; + } + + /** + * Sets aeExclusionCode + * + * @param \SynergiTech\Staffology\Model\AeExclusionCode|null $aeExclusionCode aeExclusionCode + * + * @return $this + */ + public function setAeExclusionCode(?\SynergiTech\Staffology\Model\AeExclusionCode $aeExclusionCode): static + { + if (is_null($aeExclusionCode)) { + throw new InvalidArgumentException('non-nullable aeExclusionCode cannot be null'); + } + $this->container['aeExclusionCode'] = $aeExclusionCode; + + return $this; + } + + /** + * Gets aePostponementLetterSent + * + * @return bool|null + */ + public function getAePostponementLetterSent(): ?bool + { + return $this->container['aePostponementLetterSent']; + } + + /** + * Sets aePostponementLetterSent + * + * @param bool|null $aePostponementLetterSent aePostponementLetterSent + * + * @return $this + */ + public function setAePostponementLetterSent(?bool $aePostponementLetterSent): static + { + if (is_null($aePostponementLetterSent)) { + throw new InvalidArgumentException('non-nullable aePostponementLetterSent cannot be null'); + } + $this->container['aePostponementLetterSent'] = $aePostponementLetterSent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractAutoEnrolmentResponse.php b/src/Model/ContractAutoEnrolmentResponse.php new file mode 100644 index 0000000..991ffa6 --- /dev/null +++ b/src/Model/ContractAutoEnrolmentResponse.php @@ -0,0 +1,728 @@ + + */ +class ContractAutoEnrolmentResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.AutoEnrolmentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'state' => '\SynergiTech\Staffology\Model\AeEmployeeState', + 'stateDate' => '\DateTime', + 'postponementDate' => '\DateTime', + 'lastAssessment' => '\SynergiTech\Staffology\Model\ContractAeAssessmentResponse', + 'ukWorker' => '\SynergiTech\Staffology\Model\AeUKWorker', + 'daysToDeferAssessment' => 'int', + 'deferByMonthsNotDays' => 'bool', + 'exempt' => 'bool', + 'aeExclusionCode' => '\SynergiTech\Staffology\Model\AeExclusionCode', + 'aePostponementLetterSent' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'state' => null, + 'stateDate' => 'date', + 'postponementDate' => 'date', + 'lastAssessment' => null, + 'ukWorker' => null, + 'daysToDeferAssessment' => 'int32', + 'deferByMonthsNotDays' => null, + 'exempt' => null, + 'aeExclusionCode' => null, + 'aePostponementLetterSent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'state' => false, + 'stateDate' => true, + 'postponementDate' => true, + 'lastAssessment' => false, + 'ukWorker' => false, + 'daysToDeferAssessment' => false, + 'deferByMonthsNotDays' => false, + 'exempt' => false, + 'aeExclusionCode' => false, + 'aePostponementLetterSent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'state' => 'state', + 'stateDate' => 'stateDate', + 'postponementDate' => 'postponementDate', + 'lastAssessment' => 'lastAssessment', + 'ukWorker' => 'ukWorker', + 'daysToDeferAssessment' => 'daysToDeferAssessment', + 'deferByMonthsNotDays' => 'deferByMonthsNotDays', + 'exempt' => 'exempt', + 'aeExclusionCode' => 'aeExclusionCode', + 'aePostponementLetterSent' => 'aePostponementLetterSent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'state' => 'setState', + 'stateDate' => 'setStateDate', + 'postponementDate' => 'setPostponementDate', + 'lastAssessment' => 'setLastAssessment', + 'ukWorker' => 'setUkWorker', + 'daysToDeferAssessment' => 'setDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'setDeferByMonthsNotDays', + 'exempt' => 'setExempt', + 'aeExclusionCode' => 'setAeExclusionCode', + 'aePostponementLetterSent' => 'setAePostponementLetterSent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'state' => 'getState', + 'stateDate' => 'getStateDate', + 'postponementDate' => 'getPostponementDate', + 'lastAssessment' => 'getLastAssessment', + 'ukWorker' => 'getUkWorker', + 'daysToDeferAssessment' => 'getDaysToDeferAssessment', + 'deferByMonthsNotDays' => 'getDeferByMonthsNotDays', + 'exempt' => 'getExempt', + 'aeExclusionCode' => 'getAeExclusionCode', + 'aePostponementLetterSent' => 'getAePostponementLetterSent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('stateDate', $data ?? [], null); + $this->setIfExists('postponementDate', $data ?? [], null); + $this->setIfExists('lastAssessment', $data ?? [], null); + $this->setIfExists('ukWorker', $data ?? [], null); + $this->setIfExists('daysToDeferAssessment', $data ?? [], null); + $this->setIfExists('deferByMonthsNotDays', $data ?? [], null); + $this->setIfExists('exempt', $data ?? [], null); + $this->setIfExists('aeExclusionCode', $data ?? [], null); + $this->setIfExists('aePostponementLetterSent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\AeEmployeeState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\AeEmployeeState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\AeEmployeeState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\AeEmployeeState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets stateDate + * + * @return \DateTime|null + */ + public function getStateDate(): ?\DateTime + { + return $this->container['stateDate']; + } + + /** + * Sets stateDate + * + * @param \DateTime|null $stateDate stateDate + * + * @return $this + */ + public function setStateDate(?\DateTime $stateDate): static + { + if (is_null($stateDate)) { + array_push($this->openAPINullablesSetToNull, 'stateDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stateDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stateDate'] = $stateDate; + + return $this; + } + + /** + * Gets postponementDate + * + * @return \DateTime|null + */ + public function getPostponementDate(): ?\DateTime + { + return $this->container['postponementDate']; + } + + /** + * Sets postponementDate + * + * @param \DateTime|null $postponementDate [readonly] If a value is present, then employee wont be enrolled on an AE Pension until after this date. This is automatically set to a date if the employee is deemed to be an EligibleJobHolder, but the employer has set a Postponement period and this value is currently null This is automatically set to null if it already has a value and the employee is deemed NOT to be an EligibleJobHolder - ie, they previously qualified but now do not. + * + * @return $this + */ + public function setPostponementDate(?\DateTime $postponementDate): static + { + if (is_null($postponementDate)) { + array_push($this->openAPINullablesSetToNull, 'postponementDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postponementDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postponementDate'] = $postponementDate; + + return $this; + } + + /** + * Gets lastAssessment + * + * @return \SynergiTech\Staffology\Model\ContractAeAssessmentResponse|null + */ + public function getLastAssessment(): ?\SynergiTech\Staffology\Model\ContractAeAssessmentResponse + { + return $this->container['lastAssessment']; + } + + /** + * Sets lastAssessment + * + * @param \SynergiTech\Staffology\Model\ContractAeAssessmentResponse|null $lastAssessment lastAssessment + * + * @return $this + */ + public function setLastAssessment(?\SynergiTech\Staffology\Model\ContractAeAssessmentResponse $lastAssessment): static + { + if (is_null($lastAssessment)) { + throw new InvalidArgumentException('non-nullable lastAssessment cannot be null'); + } + $this->container['lastAssessment'] = $lastAssessment; + + return $this; + } + + /** + * Gets ukWorker + * + * @return \SynergiTech\Staffology\Model\AeUKWorker|null + */ + public function getUkWorker(): ?\SynergiTech\Staffology\Model\AeUKWorker + { + return $this->container['ukWorker']; + } + + /** + * Sets ukWorker + * + * @param \SynergiTech\Staffology\Model\AeUKWorker|null $ukWorker ukWorker + * + * @return $this + */ + public function setUkWorker(?\SynergiTech\Staffology\Model\AeUKWorker $ukWorker): static + { + if (is_null($ukWorker)) { + throw new InvalidArgumentException('non-nullable ukWorker cannot be null'); + } + $this->container['ukWorker'] = $ukWorker; + + return $this; + } + + /** + * Gets daysToDeferAssessment + * + * @return int|null + */ + public function getDaysToDeferAssessment(): ?int + { + return $this->container['daysToDeferAssessment']; + } + + /** + * Sets daysToDeferAssessment + * + * @param int|null $daysToDeferAssessment The number of days, if any, to defer assessment of this employee. You're allowed to defer assessment of new employees by up to 3 months. + * + * @return $this + */ + public function setDaysToDeferAssessment(?int $daysToDeferAssessment): static + { + if (is_null($daysToDeferAssessment)) { + throw new InvalidArgumentException('non-nullable daysToDeferAssessment cannot be null'); + } + $this->container['daysToDeferAssessment'] = $daysToDeferAssessment; + + return $this; + } + + /** + * Gets deferByMonthsNotDays + * + * @return bool|null + */ + public function getDeferByMonthsNotDays(): ?bool + { + return $this->container['deferByMonthsNotDays']; + } + + /** + * Sets deferByMonthsNotDays + * + * @param bool|null $deferByMonthsNotDays If set to true then the value in DaysToDeferAssessment will be treated as a number of months, not a number of days + * + * @return $this + */ + public function setDeferByMonthsNotDays(?bool $deferByMonthsNotDays): static + { + if (is_null($deferByMonthsNotDays)) { + throw new InvalidArgumentException('non-nullable deferByMonthsNotDays cannot be null'); + } + $this->container['deferByMonthsNotDays'] = $deferByMonthsNotDays; + + return $this; + } + + /** + * Gets exempt + * + * @return bool|null + */ + public function getExempt(): ?bool + { + return $this->container['exempt']; + } + + /** + * Sets exempt + * + * @param bool|null $exempt exempt + * + * @return $this + */ + public function setExempt(?bool $exempt): static + { + if (is_null($exempt)) { + throw new InvalidArgumentException('non-nullable exempt cannot be null'); + } + $this->container['exempt'] = $exempt; + + return $this; + } + + /** + * Gets aeExclusionCode + * + * @return \SynergiTech\Staffology\Model\AeExclusionCode|null + */ + public function getAeExclusionCode(): ?\SynergiTech\Staffology\Model\AeExclusionCode + { + return $this->container['aeExclusionCode']; + } + + /** + * Sets aeExclusionCode + * + * @param \SynergiTech\Staffology\Model\AeExclusionCode|null $aeExclusionCode aeExclusionCode + * + * @return $this + */ + public function setAeExclusionCode(?\SynergiTech\Staffology\Model\AeExclusionCode $aeExclusionCode): static + { + if (is_null($aeExclusionCode)) { + throw new InvalidArgumentException('non-nullable aeExclusionCode cannot be null'); + } + $this->container['aeExclusionCode'] = $aeExclusionCode; + + return $this; + } + + /** + * Gets aePostponementLetterSent + * + * @return bool|null + */ + public function getAePostponementLetterSent(): ?bool + { + return $this->container['aePostponementLetterSent']; + } + + /** + * Sets aePostponementLetterSent + * + * @param bool|null $aePostponementLetterSent aePostponementLetterSent + * + * @return $this + */ + public function setAePostponementLetterSent(?bool $aePostponementLetterSent): static + { + if (is_null($aePostponementLetterSent)) { + throw new InvalidArgumentException('non-nullable aePostponementLetterSent cannot be null'); + } + $this->container['aePostponementLetterSent'] = $aePostponementLetterSent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractBankDetails.php b/src/Model/ContractBankDetails.php new file mode 100644 index 0000000..c4d5c76 --- /dev/null +++ b/src/Model/ContractBankDetails.php @@ -0,0 +1,782 @@ + + */ +class ContractBankDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.BankDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'bankName' => 'string', + 'bankBranch' => 'string', + 'bankReference' => 'string', + 'accountName' => 'string', + 'accountNumber' => 'string', + 'sortCode' => 'string', + 'note' => 'string', + 'buildingSocietyRollNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'bankName' => null, + 'bankBranch' => null, + 'bankReference' => null, + 'accountName' => null, + 'accountNumber' => null, + 'sortCode' => null, + 'note' => null, + 'buildingSocietyRollNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'bankName' => true, + 'bankBranch' => true, + 'bankReference' => true, + 'accountName' => true, + 'accountNumber' => true, + 'sortCode' => true, + 'note' => true, + 'buildingSocietyRollNumber' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'bankName' => 'bankName', + 'bankBranch' => 'bankBranch', + 'bankReference' => 'bankReference', + 'accountName' => 'accountName', + 'accountNumber' => 'accountNumber', + 'sortCode' => 'sortCode', + 'note' => 'note', + 'buildingSocietyRollNumber' => 'buildingSocietyRollNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'bankName' => 'setBankName', + 'bankBranch' => 'setBankBranch', + 'bankReference' => 'setBankReference', + 'accountName' => 'setAccountName', + 'accountNumber' => 'setAccountNumber', + 'sortCode' => 'setSortCode', + 'note' => 'setNote', + 'buildingSocietyRollNumber' => 'setBuildingSocietyRollNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'bankName' => 'getBankName', + 'bankBranch' => 'getBankBranch', + 'bankReference' => 'getBankReference', + 'accountName' => 'getAccountName', + 'accountNumber' => 'getAccountNumber', + 'sortCode' => 'getSortCode', + 'note' => 'getNote', + 'buildingSocietyRollNumber' => 'getBuildingSocietyRollNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bankName', $data ?? [], null); + $this->setIfExists('bankBranch', $data ?? [], null); + $this->setIfExists('bankReference', $data ?? [], null); + $this->setIfExists('accountName', $data ?? [], null); + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('buildingSocietyRollNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['bankName']) && (mb_strlen($this->container['bankName']) > 100)) { + $invalidProperties[] = "invalid value for 'bankName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['bankBranch']) && (mb_strlen($this->container['bankBranch']) > 100)) { + $invalidProperties[] = "invalid value for 'bankBranch', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['bankReference']) && (mb_strlen($this->container['bankReference']) > 100)) { + $invalidProperties[] = "invalid value for 'bankReference', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['accountName']) && (mb_strlen($this->container['accountName']) > 100)) { + $invalidProperties[] = "invalid value for 'accountName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['accountNumber']) && !preg_match("/^\\d{8}$/", $this->container['accountNumber'])) { + $invalidProperties[] = "invalid value for 'accountNumber', must be conform to the pattern /^\\d{8}$/."; + } + + if (!is_null($this->container['sortCode']) && !preg_match("/^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/", $this->container['sortCode'])) { + $invalidProperties[] = "invalid value for 'sortCode', must be conform to the pattern /^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/."; + } + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 200)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && (mb_strlen($this->container['buildingSocietyRollNumber']) > 18)) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', the character length must be smaller than or equal to 18."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && (mb_strlen($this->container['buildingSocietyRollNumber']) < 1)) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['buildingSocietyRollNumber']) && !preg_match("/^[a-zA-Z0-9\\s\/\\.-]+$/", $this->container['buildingSocietyRollNumber'])) { + $invalidProperties[] = "invalid value for 'buildingSocietyRollNumber', must be conform to the pattern /^[a-zA-Z0-9\\s\/\\.-]+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bankName + * + * @return string|null + */ + public function getBankName(): ?string + { + return $this->container['bankName']; + } + + /** + * Sets bankName + * + * @param string|null $bankName bankName + * + * @return $this + */ + public function setBankName(?string $bankName): static + { + if (is_null($bankName)) { + array_push($this->openAPINullablesSetToNull, 'bankName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankName) && (mb_strlen($bankName) > 100)) { + throw new InvalidArgumentException('invalid length for $bankName when calling ContractBankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankName'] = $bankName; + + return $this; + } + + /** + * Gets bankBranch + * + * @return string|null + */ + public function getBankBranch(): ?string + { + return $this->container['bankBranch']; + } + + /** + * Sets bankBranch + * + * @param string|null $bankBranch bankBranch + * + * @return $this + */ + public function setBankBranch(?string $bankBranch): static + { + if (is_null($bankBranch)) { + array_push($this->openAPINullablesSetToNull, 'bankBranch'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankBranch', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankBranch) && (mb_strlen($bankBranch) > 100)) { + throw new InvalidArgumentException('invalid length for $bankBranch when calling ContractBankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankBranch'] = $bankBranch; + + return $this; + } + + /** + * Gets bankReference + * + * @return string|null + */ + public function getBankReference(): ?string + { + return $this->container['bankReference']; + } + + /** + * Sets bankReference + * + * @param string|null $bankReference bankReference + * + * @return $this + */ + public function setBankReference(?string $bankReference): static + { + if (is_null($bankReference)) { + array_push($this->openAPINullablesSetToNull, 'bankReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankReference) && (mb_strlen($bankReference) > 100)) { + throw new InvalidArgumentException('invalid length for $bankReference when calling ContractBankDetails., must be smaller than or equal to 100.'); + } + + $this->container['bankReference'] = $bankReference; + + return $this; + } + + /** + * Gets accountName + * + * @return string|null + */ + public function getAccountName(): ?string + { + return $this->container['accountName']; + } + + /** + * Sets accountName + * + * @param string|null $accountName accountName + * + * @return $this + */ + public function setAccountName(?string $accountName): static + { + if (is_null($accountName)) { + array_push($this->openAPINullablesSetToNull, 'accountName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountName) && (mb_strlen($accountName) > 100)) { + throw new InvalidArgumentException('invalid length for $accountName when calling ContractBankDetails., must be smaller than or equal to 100.'); + } + + $this->container['accountName'] = $accountName; + + return $this; + } + + /** + * Gets accountNumber + * + * @return string|null + */ + public function getAccountNumber(): ?string + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string|null $accountNumber accountNumber + * + * @return $this + */ + public function setAccountNumber(?string $accountNumber): static + { + if (is_null($accountNumber)) { + array_push($this->openAPINullablesSetToNull, 'accountNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($accountNumber) && (!preg_match("/^\\d{8}$/", ObjectSerializer::toString($accountNumber)))) { + throw new InvalidArgumentException("invalid value for \$accountNumber when calling ContractBankDetails., must conform to the pattern /^\\d{8}$/."); + } + + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode(): ?string + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode sortCode + * + * @return $this + */ + public function setSortCode(?string $sortCode): static + { + if (is_null($sortCode)) { + array_push($this->openAPINullablesSetToNull, 'sortCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sortCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($sortCode) && (!preg_match("/^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/", ObjectSerializer::toString($sortCode)))) { + throw new InvalidArgumentException("invalid value for \$sortCode when calling ContractBankDetails., must conform to the pattern /^(\\d{6}|\\d{2}-\\d{2}-\\d{2}|\\d{2} \\d{2} \\d{2})$/."); + } + + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note note + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 200)) { + throw new InvalidArgumentException('invalid length for $note when calling ContractBankDetails., must be smaller than or equal to 200.'); + } + + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets buildingSocietyRollNumber + * + * @return string|null + */ + public function getBuildingSocietyRollNumber(): ?string + { + return $this->container['buildingSocietyRollNumber']; + } + + /** + * Sets buildingSocietyRollNumber + * + * @param string|null $buildingSocietyRollNumber buildingSocietyRollNumber + * + * @return $this + */ + public function setBuildingSocietyRollNumber(?string $buildingSocietyRollNumber): static + { + if (is_null($buildingSocietyRollNumber)) { + array_push($this->openAPINullablesSetToNull, 'buildingSocietyRollNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buildingSocietyRollNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buildingSocietyRollNumber) && (mb_strlen($buildingSocietyRollNumber) > 18)) { + throw new InvalidArgumentException('invalid length for $buildingSocietyRollNumber when calling ContractBankDetails., must be smaller than or equal to 18.'); + } + if (!is_null($buildingSocietyRollNumber) && (mb_strlen($buildingSocietyRollNumber) < 1)) { + throw new InvalidArgumentException('invalid length for $buildingSocietyRollNumber when calling ContractBankDetails., must be bigger than or equal to 1.'); + } + if (!is_null($buildingSocietyRollNumber) && (!preg_match("/^[a-zA-Z0-9\\s\/\\.-]+$/", ObjectSerializer::toString($buildingSocietyRollNumber)))) { + throw new InvalidArgumentException("invalid value for \$buildingSocietyRollNumber when calling ContractBankDetails., must conform to the pattern /^[a-zA-Z0-9\\s\/\\.-]+$/."); + } + + $this->container['buildingSocietyRollNumber'] = $buildingSocietyRollNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisDetailsRequest.php b/src/Model/ContractCisDetailsRequest.php new file mode 100644 index 0000000..b673a31 --- /dev/null +++ b/src/Model/ContractCisDetailsRequest.php @@ -0,0 +1,789 @@ + + */ +class ContractCisDetailsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'verification' => '\SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest', + 'type' => '\SynergiTech\Staffology\Model\CISSubContractorType', + 'utr' => 'string', + 'tradingName' => 'string', + 'companyUtr' => 'string', + 'companyNumber' => 'string', + 'vatRegistered' => 'bool', + 'vatNumber' => 'string', + 'vatRate' => 'float', + 'reverseChargeVAT' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'verification' => null, + 'type' => null, + 'utr' => null, + 'tradingName' => null, + 'companyUtr' => null, + 'companyNumber' => null, + 'vatRegistered' => null, + 'vatNumber' => null, + 'vatRate' => 'double', + 'reverseChargeVAT' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'verification' => false, + 'type' => false, + 'utr' => true, + 'tradingName' => true, + 'companyUtr' => true, + 'companyNumber' => true, + 'vatRegistered' => false, + 'vatNumber' => true, + 'vatRate' => false, + 'reverseChargeVAT' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'verification' => 'verification', + 'type' => 'type', + 'utr' => 'utr', + 'tradingName' => 'tradingName', + 'companyUtr' => 'companyUtr', + 'companyNumber' => 'companyNumber', + 'vatRegistered' => 'vatRegistered', + 'vatNumber' => 'vatNumber', + 'vatRate' => 'vatRate', + 'reverseChargeVAT' => 'reverseChargeVAT' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'verification' => 'setVerification', + 'type' => 'setType', + 'utr' => 'setUtr', + 'tradingName' => 'setTradingName', + 'companyUtr' => 'setCompanyUtr', + 'companyNumber' => 'setCompanyNumber', + 'vatRegistered' => 'setVatRegistered', + 'vatNumber' => 'setVatNumber', + 'vatRate' => 'setVatRate', + 'reverseChargeVAT' => 'setReverseChargeVAT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'verification' => 'getVerification', + 'type' => 'getType', + 'utr' => 'getUtr', + 'tradingName' => 'getTradingName', + 'companyUtr' => 'getCompanyUtr', + 'companyNumber' => 'getCompanyNumber', + 'vatRegistered' => 'getVatRegistered', + 'vatNumber' => 'getVatNumber', + 'vatRate' => 'getVatRate', + 'reverseChargeVAT' => 'getReverseChargeVAT' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('verification', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('companyUtr', $data ?? [], null); + $this->setIfExists('companyNumber', $data ?? [], null); + $this->setIfExists('vatRegistered', $data ?? [], null); + $this->setIfExists('vatNumber', $data ?? [], null); + $this->setIfExists('vatRate', $data ?? [], null); + $this->setIfExists('reverseChargeVAT', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['utr']) && (mb_strlen($this->container['utr']) > 20)) { + $invalidProperties[] = "invalid value for 'utr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['tradingName']) && (mb_strlen($this->container['tradingName']) > 200)) { + $invalidProperties[] = "invalid value for 'tradingName', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['companyUtr']) && (mb_strlen($this->container['companyUtr']) > 20)) { + $invalidProperties[] = "invalid value for 'companyUtr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['companyNumber']) && (mb_strlen($this->container['companyNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'companyNumber', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['vatNumber']) && (mb_strlen($this->container['vatNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'vatNumber', the character length must be smaller than or equal to 20."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets verification + * + * @return \SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest|null + */ + public function getVerification(): ?\SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest + { + return $this->container['verification']; + } + + /** + * Sets verification + * + * @param \SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest|null $verification verification + * + * @return $this + */ + public function setVerification(?\SynergiTech\Staffology\Model\ContractCisVerificationDetailsRequest $verification): static + { + if (is_null($verification)) { + throw new InvalidArgumentException('non-nullable verification cannot be null'); + } + $this->container['verification'] = $verification; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\CISSubContractorType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\CISSubContractorType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\CISSubContractorType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\CISSubContractorType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($utr) && (mb_strlen($utr) > 20)) { + throw new InvalidArgumentException('invalid length for $utr when calling ContractCisDetailsRequest., must be smaller than or equal to 20.'); + } + + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($tradingName) && (mb_strlen($tradingName) > 200)) { + throw new InvalidArgumentException('invalid length for $tradingName when calling ContractCisDetailsRequest., must be smaller than or equal to 200.'); + } + + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets companyUtr + * + * @return string|null + */ + public function getCompanyUtr(): ?string + { + return $this->container['companyUtr']; + } + + /** + * Sets companyUtr + * + * @param string|null $companyUtr companyUtr + * + * @return $this + */ + public function setCompanyUtr(?string $companyUtr): static + { + if (is_null($companyUtr)) { + array_push($this->openAPINullablesSetToNull, 'companyUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyUtr) && (mb_strlen($companyUtr) > 20)) { + throw new InvalidArgumentException('invalid length for $companyUtr when calling ContractCisDetailsRequest., must be smaller than or equal to 20.'); + } + + $this->container['companyUtr'] = $companyUtr; + + return $this; + } + + /** + * Gets companyNumber + * + * @return string|null + */ + public function getCompanyNumber(): ?string + { + return $this->container['companyNumber']; + } + + /** + * Sets companyNumber + * + * @param string|null $companyNumber companyNumber + * + * @return $this + */ + public function setCompanyNumber(?string $companyNumber): static + { + if (is_null($companyNumber)) { + array_push($this->openAPINullablesSetToNull, 'companyNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyNumber) && (mb_strlen($companyNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $companyNumber when calling ContractCisDetailsRequest., must be smaller than or equal to 20.'); + } + + $this->container['companyNumber'] = $companyNumber; + + return $this; + } + + /** + * Gets vatRegistered + * + * @return bool|null + */ + public function getVatRegistered(): ?bool + { + return $this->container['vatRegistered']; + } + + /** + * Sets vatRegistered + * + * @param bool|null $vatRegistered vatRegistered + * + * @return $this + */ + public function setVatRegistered(?bool $vatRegistered): static + { + if (is_null($vatRegistered)) { + throw new InvalidArgumentException('non-nullable vatRegistered cannot be null'); + } + $this->container['vatRegistered'] = $vatRegistered; + + return $this; + } + + /** + * Gets vatNumber + * + * @return string|null + */ + public function getVatNumber(): ?string + { + return $this->container['vatNumber']; + } + + /** + * Sets vatNumber + * + * @param string|null $vatNumber vatNumber + * + * @return $this + */ + public function setVatNumber(?string $vatNumber): static + { + if (is_null($vatNumber)) { + array_push($this->openAPINullablesSetToNull, 'vatNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vatNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($vatNumber) && (mb_strlen($vatNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $vatNumber when calling ContractCisDetailsRequest., must be smaller than or equal to 20.'); + } + + $this->container['vatNumber'] = $vatNumber; + + return $this; + } + + /** + * Gets vatRate + * + * @return float|null + */ + public function getVatRate(): ?float + { + return $this->container['vatRate']; + } + + /** + * Sets vatRate + * + * @param float|null $vatRate vatRate + * + * @return $this + */ + public function setVatRate(?float $vatRate): static + { + if (is_null($vatRate)) { + throw new InvalidArgumentException('non-nullable vatRate cannot be null'); + } + $this->container['vatRate'] = $vatRate; + + return $this; + } + + /** + * Gets reverseChargeVAT + * + * @return bool|null + */ + public function getReverseChargeVAT(): ?bool + { + return $this->container['reverseChargeVAT']; + } + + /** + * Sets reverseChargeVAT + * + * @param bool|null $reverseChargeVAT reverseChargeVAT + * + * @return $this + */ + public function setReverseChargeVAT(?bool $reverseChargeVAT): static + { + if (is_null($reverseChargeVAT)) { + throw new InvalidArgumentException('non-nullable reverseChargeVAT cannot be null'); + } + $this->container['reverseChargeVAT'] = $reverseChargeVAT; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisDetailsResponse.php b/src/Model/ContractCisDetailsResponse.php new file mode 100644 index 0000000..356849e --- /dev/null +++ b/src/Model/ContractCisDetailsResponse.php @@ -0,0 +1,789 @@ + + */ +class ContractCisDetailsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'verification' => '\SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse', + 'type' => '\SynergiTech\Staffology\Model\CISSubContractorType', + 'utr' => 'string', + 'tradingName' => 'string', + 'companyUtr' => 'string', + 'companyNumber' => 'string', + 'vatRegistered' => 'bool', + 'vatNumber' => 'string', + 'vatRate' => 'float', + 'reverseChargeVAT' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'verification' => null, + 'type' => null, + 'utr' => null, + 'tradingName' => null, + 'companyUtr' => null, + 'companyNumber' => null, + 'vatRegistered' => null, + 'vatNumber' => null, + 'vatRate' => 'double', + 'reverseChargeVAT' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'verification' => false, + 'type' => false, + 'utr' => true, + 'tradingName' => true, + 'companyUtr' => true, + 'companyNumber' => true, + 'vatRegistered' => false, + 'vatNumber' => true, + 'vatRate' => false, + 'reverseChargeVAT' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'verification' => 'verification', + 'type' => 'type', + 'utr' => 'utr', + 'tradingName' => 'tradingName', + 'companyUtr' => 'companyUtr', + 'companyNumber' => 'companyNumber', + 'vatRegistered' => 'vatRegistered', + 'vatNumber' => 'vatNumber', + 'vatRate' => 'vatRate', + 'reverseChargeVAT' => 'reverseChargeVAT' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'verification' => 'setVerification', + 'type' => 'setType', + 'utr' => 'setUtr', + 'tradingName' => 'setTradingName', + 'companyUtr' => 'setCompanyUtr', + 'companyNumber' => 'setCompanyNumber', + 'vatRegistered' => 'setVatRegistered', + 'vatNumber' => 'setVatNumber', + 'vatRate' => 'setVatRate', + 'reverseChargeVAT' => 'setReverseChargeVAT' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'verification' => 'getVerification', + 'type' => 'getType', + 'utr' => 'getUtr', + 'tradingName' => 'getTradingName', + 'companyUtr' => 'getCompanyUtr', + 'companyNumber' => 'getCompanyNumber', + 'vatRegistered' => 'getVatRegistered', + 'vatNumber' => 'getVatNumber', + 'vatRate' => 'getVatRate', + 'reverseChargeVAT' => 'getReverseChargeVAT' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('verification', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('companyUtr', $data ?? [], null); + $this->setIfExists('companyNumber', $data ?? [], null); + $this->setIfExists('vatRegistered', $data ?? [], null); + $this->setIfExists('vatNumber', $data ?? [], null); + $this->setIfExists('vatRate', $data ?? [], null); + $this->setIfExists('reverseChargeVAT', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['utr']) && (mb_strlen($this->container['utr']) > 20)) { + $invalidProperties[] = "invalid value for 'utr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['tradingName']) && (mb_strlen($this->container['tradingName']) > 200)) { + $invalidProperties[] = "invalid value for 'tradingName', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['companyUtr']) && (mb_strlen($this->container['companyUtr']) > 20)) { + $invalidProperties[] = "invalid value for 'companyUtr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['companyNumber']) && (mb_strlen($this->container['companyNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'companyNumber', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['vatNumber']) && (mb_strlen($this->container['vatNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'vatNumber', the character length must be smaller than or equal to 20."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets verification + * + * @return \SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse|null + */ + public function getVerification(): ?\SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse + { + return $this->container['verification']; + } + + /** + * Sets verification + * + * @param \SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse|null $verification verification + * + * @return $this + */ + public function setVerification(?\SynergiTech\Staffology\Model\ContractCisVerificationDetailsResponse $verification): static + { + if (is_null($verification)) { + throw new InvalidArgumentException('non-nullable verification cannot be null'); + } + $this->container['verification'] = $verification; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\CISSubContractorType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\CISSubContractorType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\CISSubContractorType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\CISSubContractorType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($utr) && (mb_strlen($utr) > 20)) { + throw new InvalidArgumentException('invalid length for $utr when calling ContractCisDetailsResponse., must be smaller than or equal to 20.'); + } + + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($tradingName) && (mb_strlen($tradingName) > 200)) { + throw new InvalidArgumentException('invalid length for $tradingName when calling ContractCisDetailsResponse., must be smaller than or equal to 200.'); + } + + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets companyUtr + * + * @return string|null + */ + public function getCompanyUtr(): ?string + { + return $this->container['companyUtr']; + } + + /** + * Sets companyUtr + * + * @param string|null $companyUtr companyUtr + * + * @return $this + */ + public function setCompanyUtr(?string $companyUtr): static + { + if (is_null($companyUtr)) { + array_push($this->openAPINullablesSetToNull, 'companyUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyUtr) && (mb_strlen($companyUtr) > 20)) { + throw new InvalidArgumentException('invalid length for $companyUtr when calling ContractCisDetailsResponse., must be smaller than or equal to 20.'); + } + + $this->container['companyUtr'] = $companyUtr; + + return $this; + } + + /** + * Gets companyNumber + * + * @return string|null + */ + public function getCompanyNumber(): ?string + { + return $this->container['companyNumber']; + } + + /** + * Sets companyNumber + * + * @param string|null $companyNumber companyNumber + * + * @return $this + */ + public function setCompanyNumber(?string $companyNumber): static + { + if (is_null($companyNumber)) { + array_push($this->openAPINullablesSetToNull, 'companyNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($companyNumber) && (mb_strlen($companyNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $companyNumber when calling ContractCisDetailsResponse., must be smaller than or equal to 20.'); + } + + $this->container['companyNumber'] = $companyNumber; + + return $this; + } + + /** + * Gets vatRegistered + * + * @return bool|null + */ + public function getVatRegistered(): ?bool + { + return $this->container['vatRegistered']; + } + + /** + * Sets vatRegistered + * + * @param bool|null $vatRegistered vatRegistered + * + * @return $this + */ + public function setVatRegistered(?bool $vatRegistered): static + { + if (is_null($vatRegistered)) { + throw new InvalidArgumentException('non-nullable vatRegistered cannot be null'); + } + $this->container['vatRegistered'] = $vatRegistered; + + return $this; + } + + /** + * Gets vatNumber + * + * @return string|null + */ + public function getVatNumber(): ?string + { + return $this->container['vatNumber']; + } + + /** + * Sets vatNumber + * + * @param string|null $vatNumber vatNumber + * + * @return $this + */ + public function setVatNumber(?string $vatNumber): static + { + if (is_null($vatNumber)) { + array_push($this->openAPINullablesSetToNull, 'vatNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vatNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($vatNumber) && (mb_strlen($vatNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $vatNumber when calling ContractCisDetailsResponse., must be smaller than or equal to 20.'); + } + + $this->container['vatNumber'] = $vatNumber; + + return $this; + } + + /** + * Gets vatRate + * + * @return float|null + */ + public function getVatRate(): ?float + { + return $this->container['vatRate']; + } + + /** + * Sets vatRate + * + * @param float|null $vatRate vatRate + * + * @return $this + */ + public function setVatRate(?float $vatRate): static + { + if (is_null($vatRate)) { + throw new InvalidArgumentException('non-nullable vatRate cannot be null'); + } + $this->container['vatRate'] = $vatRate; + + return $this; + } + + /** + * Gets reverseChargeVAT + * + * @return bool|null + */ + public function getReverseChargeVAT(): ?bool + { + return $this->container['reverseChargeVAT']; + } + + /** + * Sets reverseChargeVAT + * + * @param bool|null $reverseChargeVAT reverseChargeVAT + * + * @return $this + */ + public function setReverseChargeVAT(?bool $reverseChargeVAT): static + { + if (is_null($reverseChargeVAT)) { + throw new InvalidArgumentException('non-nullable reverseChargeVAT cannot be null'); + } + $this->container['reverseChargeVAT'] = $reverseChargeVAT; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisPartnership.php b/src/Model/ContractCisPartnership.php new file mode 100644 index 0000000..f9213c3 --- /dev/null +++ b/src/Model/ContractCisPartnership.php @@ -0,0 +1,457 @@ + + */ +class ContractCisPartnership implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisPartnership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'utr' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'utr' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'utr' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'utr' => 'utr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'utr' => 'setUtr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'utr' => 'getUtr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisSubContractor.php b/src/Model/ContractCisSubContractor.php new file mode 100644 index 0000000..2ba5f65 --- /dev/null +++ b/src/Model/ContractCisSubContractor.php @@ -0,0 +1,1480 @@ + + */ +class ContractCisSubContractor implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisSubContractor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeUniqueId' => 'string', + 'emailStatementTo' => 'string', + 'numberOfPayments' => 'int', + 'item' => '\SynergiTech\Staffology\Model\ContractCisSubContractorItem', + 'displayName' => 'string', + 'action' => 'string', + 'type' => 'string', + 'name' => '\SynergiTech\Staffology\Model\ContractRtiEmployeeName', + 'tradingName' => 'string', + 'worksRef' => 'string', + 'unmatchedRate' => 'string', + 'utr' => 'string', + 'crn' => 'string', + 'nino' => 'string', + 'partnership' => '\SynergiTech\Staffology\Model\ContractCisPartnership', + 'address' => '\SynergiTech\Staffology\Model\ContractRtiEmployeeAddress', + 'telephone' => 'string', + 'totalPaymentsUnrounded' => 'string', + 'costOfMaterialsUnrounded' => 'string', + 'umbrellaFee' => 'string', + 'validationMsg' => 'string', + 'verificationNumber' => 'string', + 'totalPayments' => 'string', + 'costOfMaterials' => 'string', + 'totalDeducted' => 'string', + 'matched' => 'string', + 'taxTreatment' => 'string', + 'netPayment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeUniqueId' => 'uuid', + 'emailStatementTo' => null, + 'numberOfPayments' => 'int32', + 'item' => null, + 'displayName' => null, + 'action' => null, + 'type' => null, + 'name' => null, + 'tradingName' => null, + 'worksRef' => null, + 'unmatchedRate' => null, + 'utr' => null, + 'crn' => null, + 'nino' => null, + 'partnership' => null, + 'address' => null, + 'telephone' => null, + 'totalPaymentsUnrounded' => null, + 'costOfMaterialsUnrounded' => null, + 'umbrellaFee' => null, + 'validationMsg' => null, + 'verificationNumber' => null, + 'totalPayments' => null, + 'costOfMaterials' => null, + 'totalDeducted' => null, + 'matched' => null, + 'taxTreatment' => null, + 'netPayment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeUniqueId' => false, + 'emailStatementTo' => true, + 'numberOfPayments' => false, + 'item' => false, + 'displayName' => true, + 'action' => true, + 'type' => true, + 'name' => false, + 'tradingName' => true, + 'worksRef' => true, + 'unmatchedRate' => true, + 'utr' => true, + 'crn' => true, + 'nino' => true, + 'partnership' => false, + 'address' => false, + 'telephone' => true, + 'totalPaymentsUnrounded' => true, + 'costOfMaterialsUnrounded' => true, + 'umbrellaFee' => true, + 'validationMsg' => true, + 'verificationNumber' => true, + 'totalPayments' => true, + 'costOfMaterials' => true, + 'totalDeducted' => true, + 'matched' => true, + 'taxTreatment' => true, + 'netPayment' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeUniqueId' => 'employeeUniqueId', + 'emailStatementTo' => 'emailStatementTo', + 'numberOfPayments' => 'numberOfPayments', + 'item' => 'item', + 'displayName' => 'displayName', + 'action' => 'action', + 'type' => 'type', + 'name' => 'name', + 'tradingName' => 'tradingName', + 'worksRef' => 'worksRef', + 'unmatchedRate' => 'unmatchedRate', + 'utr' => 'utr', + 'crn' => 'crn', + 'nino' => 'nino', + 'partnership' => 'partnership', + 'address' => 'address', + 'telephone' => 'telephone', + 'totalPaymentsUnrounded' => 'totalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'costOfMaterialsUnrounded', + 'umbrellaFee' => 'umbrellaFee', + 'validationMsg' => 'validationMsg', + 'verificationNumber' => 'verificationNumber', + 'totalPayments' => 'totalPayments', + 'costOfMaterials' => 'costOfMaterials', + 'totalDeducted' => 'totalDeducted', + 'matched' => 'matched', + 'taxTreatment' => 'taxTreatment', + 'netPayment' => 'netPayment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'emailStatementTo' => 'setEmailStatementTo', + 'numberOfPayments' => 'setNumberOfPayments', + 'item' => 'setItem', + 'displayName' => 'setDisplayName', + 'action' => 'setAction', + 'type' => 'setType', + 'name' => 'setName', + 'tradingName' => 'setTradingName', + 'worksRef' => 'setWorksRef', + 'unmatchedRate' => 'setUnmatchedRate', + 'utr' => 'setUtr', + 'crn' => 'setCrn', + 'nino' => 'setNino', + 'partnership' => 'setPartnership', + 'address' => 'setAddress', + 'telephone' => 'setTelephone', + 'totalPaymentsUnrounded' => 'setTotalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'setCostOfMaterialsUnrounded', + 'umbrellaFee' => 'setUmbrellaFee', + 'validationMsg' => 'setValidationMsg', + 'verificationNumber' => 'setVerificationNumber', + 'totalPayments' => 'setTotalPayments', + 'costOfMaterials' => 'setCostOfMaterials', + 'totalDeducted' => 'setTotalDeducted', + 'matched' => 'setMatched', + 'taxTreatment' => 'setTaxTreatment', + 'netPayment' => 'setNetPayment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'emailStatementTo' => 'getEmailStatementTo', + 'numberOfPayments' => 'getNumberOfPayments', + 'item' => 'getItem', + 'displayName' => 'getDisplayName', + 'action' => 'getAction', + 'type' => 'getType', + 'name' => 'getName', + 'tradingName' => 'getTradingName', + 'worksRef' => 'getWorksRef', + 'unmatchedRate' => 'getUnmatchedRate', + 'utr' => 'getUtr', + 'crn' => 'getCrn', + 'nino' => 'getNino', + 'partnership' => 'getPartnership', + 'address' => 'getAddress', + 'telephone' => 'getTelephone', + 'totalPaymentsUnrounded' => 'getTotalPaymentsUnrounded', + 'costOfMaterialsUnrounded' => 'getCostOfMaterialsUnrounded', + 'umbrellaFee' => 'getUmbrellaFee', + 'validationMsg' => 'getValidationMsg', + 'verificationNumber' => 'getVerificationNumber', + 'totalPayments' => 'getTotalPayments', + 'costOfMaterials' => 'getCostOfMaterials', + 'totalDeducted' => 'getTotalDeducted', + 'matched' => 'getMatched', + 'taxTreatment' => 'getTaxTreatment', + 'netPayment' => 'getNetPayment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('emailStatementTo', $data ?? [], null); + $this->setIfExists('numberOfPayments', $data ?? [], null); + $this->setIfExists('item', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tradingName', $data ?? [], null); + $this->setIfExists('worksRef', $data ?? [], null); + $this->setIfExists('unmatchedRate', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('crn', $data ?? [], null); + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('partnership', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('totalPaymentsUnrounded', $data ?? [], null); + $this->setIfExists('costOfMaterialsUnrounded', $data ?? [], null); + $this->setIfExists('umbrellaFee', $data ?? [], null); + $this->setIfExists('validationMsg', $data ?? [], null); + $this->setIfExists('verificationNumber', $data ?? [], null); + $this->setIfExists('totalPayments', $data ?? [], null); + $this->setIfExists('costOfMaterials', $data ?? [], null); + $this->setIfExists('totalDeducted', $data ?? [], null); + $this->setIfExists('matched', $data ?? [], null); + $this->setIfExists('taxTreatment', $data ?? [], null); + $this->setIfExists('netPayment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId employeeUniqueId + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets emailStatementTo + * + * @return string|null + */ + public function getEmailStatementTo(): ?string + { + return $this->container['emailStatementTo']; + } + + /** + * Sets emailStatementTo + * + * @param string|null $emailStatementTo emailStatementTo + * + * @return $this + */ + public function setEmailStatementTo(?string $emailStatementTo): static + { + if (is_null($emailStatementTo)) { + array_push($this->openAPINullablesSetToNull, 'emailStatementTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailStatementTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailStatementTo'] = $emailStatementTo; + + return $this; + } + + /** + * Gets numberOfPayments + * + * @return int|null + */ + public function getNumberOfPayments(): ?int + { + return $this->container['numberOfPayments']; + } + + /** + * Sets numberOfPayments + * + * @param int|null $numberOfPayments numberOfPayments + * + * @return $this + */ + public function setNumberOfPayments(?int $numberOfPayments): static + { + if (is_null($numberOfPayments)) { + throw new InvalidArgumentException('non-nullable numberOfPayments cannot be null'); + } + $this->container['numberOfPayments'] = $numberOfPayments; + + return $this; + } + + /** + * Gets item + * + * @return \SynergiTech\Staffology\Model\ContractCisSubContractorItem|null + */ + public function getItem(): ?\SynergiTech\Staffology\Model\ContractCisSubContractorItem + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \SynergiTech\Staffology\Model\ContractCisSubContractorItem|null $item item + * + * @return $this + */ + public function setItem(?\SynergiTech\Staffology\Model\ContractCisSubContractorItem $item): static + { + if (is_null($item)) { + throw new InvalidArgumentException('non-nullable item cannot be null'); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction(): ?string + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return $this + */ + public function setAction(?string $action): static + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\ContractRtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\ContractRtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\ContractRtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\ContractRtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tradingName + * + * @return string|null + */ + public function getTradingName(): ?string + { + return $this->container['tradingName']; + } + + /** + * Sets tradingName + * + * @param string|null $tradingName tradingName + * + * @return $this + */ + public function setTradingName(?string $tradingName): static + { + if (is_null($tradingName)) { + array_push($this->openAPINullablesSetToNull, 'tradingName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tradingName'] = $tradingName; + + return $this; + } + + /** + * Gets worksRef + * + * @return string|null + */ + public function getWorksRef(): ?string + { + return $this->container['worksRef']; + } + + /** + * Sets worksRef + * + * @param string|null $worksRef worksRef + * + * @return $this + */ + public function setWorksRef(?string $worksRef): static + { + if (is_null($worksRef)) { + array_push($this->openAPINullablesSetToNull, 'worksRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('worksRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['worksRef'] = $worksRef; + + return $this; + } + + /** + * Gets unmatchedRate + * + * @return string|null + */ + public function getUnmatchedRate(): ?string + { + return $this->container['unmatchedRate']; + } + + /** + * Sets unmatchedRate + * + * @param string|null $unmatchedRate unmatchedRate + * + * @return $this + */ + public function setUnmatchedRate(?string $unmatchedRate): static + { + if (is_null($unmatchedRate)) { + array_push($this->openAPINullablesSetToNull, 'unmatchedRate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unmatchedRate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['unmatchedRate'] = $unmatchedRate; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets crn + * + * @return string|null + */ + public function getCrn(): ?string + { + return $this->container['crn']; + } + + /** + * Sets crn + * + * @param string|null $crn crn + * + * @return $this + */ + public function setCrn(?string $crn): static + { + if (is_null($crn)) { + array_push($this->openAPINullablesSetToNull, 'crn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('crn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['crn'] = $crn; + + return $this; + } + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets partnership + * + * @return \SynergiTech\Staffology\Model\ContractCisPartnership|null + */ + public function getPartnership(): ?\SynergiTech\Staffology\Model\ContractCisPartnership + { + return $this->container['partnership']; + } + + /** + * Sets partnership + * + * @param \SynergiTech\Staffology\Model\ContractCisPartnership|null $partnership partnership + * + * @return $this + */ + public function setPartnership(?\SynergiTech\Staffology\Model\ContractCisPartnership $partnership): static + { + if (is_null($partnership)) { + throw new InvalidArgumentException('non-nullable partnership cannot be null'); + } + $this->container['partnership'] = $partnership; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\ContractRtiEmployeeAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\ContractRtiEmployeeAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\ContractRtiEmployeeAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\ContractRtiEmployeeAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets totalPaymentsUnrounded + * + * @return string|null + */ + public function getTotalPaymentsUnrounded(): ?string + { + return $this->container['totalPaymentsUnrounded']; + } + + /** + * Sets totalPaymentsUnrounded + * + * @param string|null $totalPaymentsUnrounded totalPaymentsUnrounded + * + * @return $this + */ + public function setTotalPaymentsUnrounded(?string $totalPaymentsUnrounded): static + { + if (is_null($totalPaymentsUnrounded)) { + array_push($this->openAPINullablesSetToNull, 'totalPaymentsUnrounded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaymentsUnrounded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaymentsUnrounded'] = $totalPaymentsUnrounded; + + return $this; + } + + /** + * Gets costOfMaterialsUnrounded + * + * @return string|null + */ + public function getCostOfMaterialsUnrounded(): ?string + { + return $this->container['costOfMaterialsUnrounded']; + } + + /** + * Sets costOfMaterialsUnrounded + * + * @param string|null $costOfMaterialsUnrounded costOfMaterialsUnrounded + * + * @return $this + */ + public function setCostOfMaterialsUnrounded(?string $costOfMaterialsUnrounded): static + { + if (is_null($costOfMaterialsUnrounded)) { + array_push($this->openAPINullablesSetToNull, 'costOfMaterialsUnrounded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOfMaterialsUnrounded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOfMaterialsUnrounded'] = $costOfMaterialsUnrounded; + + return $this; + } + + /** + * Gets umbrellaFee + * + * @return string|null + */ + public function getUmbrellaFee(): ?string + { + return $this->container['umbrellaFee']; + } + + /** + * Sets umbrellaFee + * + * @param string|null $umbrellaFee umbrellaFee + * + * @return $this + */ + public function setUmbrellaFee(?string $umbrellaFee): static + { + if (is_null($umbrellaFee)) { + array_push($this->openAPINullablesSetToNull, 'umbrellaFee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('umbrellaFee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['umbrellaFee'] = $umbrellaFee; + + return $this; + } + + /** + * Gets validationMsg + * + * @return string|null + */ + public function getValidationMsg(): ?string + { + return $this->container['validationMsg']; + } + + /** + * Sets validationMsg + * + * @param string|null $validationMsg validationMsg + * + * @return $this + */ + public function setValidationMsg(?string $validationMsg): static + { + if (is_null($validationMsg)) { + array_push($this->openAPINullablesSetToNull, 'validationMsg'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validationMsg', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['validationMsg'] = $validationMsg; + + return $this; + } + + /** + * Gets verificationNumber + * + * @return string|null + */ + public function getVerificationNumber(): ?string + { + return $this->container['verificationNumber']; + } + + /** + * Sets verificationNumber + * + * @param string|null $verificationNumber verificationNumber + * + * @return $this + */ + public function setVerificationNumber(?string $verificationNumber): static + { + if (is_null($verificationNumber)) { + array_push($this->openAPINullablesSetToNull, 'verificationNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationNumber'] = $verificationNumber; + + return $this; + } + + /** + * Gets totalPayments + * + * @return string|null + */ + public function getTotalPayments(): ?string + { + return $this->container['totalPayments']; + } + + /** + * Sets totalPayments + * + * @param string|null $totalPayments totalPayments + * + * @return $this + */ + public function setTotalPayments(?string $totalPayments): static + { + if (is_null($totalPayments)) { + array_push($this->openAPINullablesSetToNull, 'totalPayments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPayments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPayments'] = $totalPayments; + + return $this; + } + + /** + * Gets costOfMaterials + * + * @return string|null + */ + public function getCostOfMaterials(): ?string + { + return $this->container['costOfMaterials']; + } + + /** + * Sets costOfMaterials + * + * @param string|null $costOfMaterials costOfMaterials + * + * @return $this + */ + public function setCostOfMaterials(?string $costOfMaterials): static + { + if (is_null($costOfMaterials)) { + array_push($this->openAPINullablesSetToNull, 'costOfMaterials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOfMaterials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOfMaterials'] = $costOfMaterials; + + return $this; + } + + /** + * Gets totalDeducted + * + * @return string|null + */ + public function getTotalDeducted(): ?string + { + return $this->container['totalDeducted']; + } + + /** + * Sets totalDeducted + * + * @param string|null $totalDeducted totalDeducted + * + * @return $this + */ + public function setTotalDeducted(?string $totalDeducted): static + { + if (is_null($totalDeducted)) { + array_push($this->openAPINullablesSetToNull, 'totalDeducted'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalDeducted', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalDeducted'] = $totalDeducted; + + return $this; + } + + /** + * Gets matched + * + * @return string|null + */ + public function getMatched(): ?string + { + return $this->container['matched']; + } + + /** + * Sets matched + * + * @param string|null $matched matched + * + * @return $this + */ + public function setMatched(?string $matched): static + { + if (is_null($matched)) { + array_push($this->openAPINullablesSetToNull, 'matched'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matched', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['matched'] = $matched; + + return $this; + } + + /** + * Gets taxTreatment + * + * @return string|null + */ + public function getTaxTreatment(): ?string + { + return $this->container['taxTreatment']; + } + + /** + * Sets taxTreatment + * + * @param string|null $taxTreatment taxTreatment + * + * @return $this + */ + public function setTaxTreatment(?string $taxTreatment): static + { + if (is_null($taxTreatment)) { + array_push($this->openAPINullablesSetToNull, 'taxTreatment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxTreatment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxTreatment'] = $taxTreatment; + + return $this; + } + + /** + * Gets netPayment + * + * @return string|null + */ + public function getNetPayment(): ?string + { + return $this->container['netPayment']; + } + + /** + * Sets netPayment + * + * @param string|null $netPayment netPayment + * + * @return $this + */ + public function setNetPayment(?string $netPayment): static + { + if (is_null($netPayment)) { + array_push($this->openAPINullablesSetToNull, 'netPayment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netPayment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netPayment'] = $netPayment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisSubContractorItem.php b/src/Model/ContractCisSubContractorItem.php new file mode 100644 index 0000000..800d91f --- /dev/null +++ b/src/Model/ContractCisSubContractorItem.php @@ -0,0 +1,531 @@ + + */ +class ContractCisSubContractorItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisSubContractorItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisVerificationDetailsRequest.php b/src/Model/ContractCisVerificationDetailsRequest.php new file mode 100644 index 0000000..969238a --- /dev/null +++ b/src/Model/ContractCisVerificationDetailsRequest.php @@ -0,0 +1,592 @@ + + */ +class ContractCisVerificationDetailsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisVerificationDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'manuallyEntered' => 'bool', + 'matchInsteadOfVerify' => 'bool', + 'number' => 'string', + 'date' => '\DateTime', + 'taxStatus' => '\SynergiTech\Staffology\Model\CISTaxStatus', + 'verificationResponse' => '\SynergiTech\Staffology\Model\ContractCisSubContractor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'manuallyEntered' => null, + 'matchInsteadOfVerify' => null, + 'number' => null, + 'date' => 'date', + 'taxStatus' => null, + 'verificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'manuallyEntered' => false, + 'matchInsteadOfVerify' => false, + 'number' => true, + 'date' => true, + 'taxStatus' => false, + 'verificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'manuallyEntered' => 'manuallyEntered', + 'matchInsteadOfVerify' => 'matchInsteadOfVerify', + 'number' => 'number', + 'date' => 'date', + 'taxStatus' => 'taxStatus', + 'verificationResponse' => 'verificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'manuallyEntered' => 'setManuallyEntered', + 'matchInsteadOfVerify' => 'setMatchInsteadOfVerify', + 'number' => 'setNumber', + 'date' => 'setDate', + 'taxStatus' => 'setTaxStatus', + 'verificationResponse' => 'setVerificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'manuallyEntered' => 'getManuallyEntered', + 'matchInsteadOfVerify' => 'getMatchInsteadOfVerify', + 'number' => 'getNumber', + 'date' => 'getDate', + 'taxStatus' => 'getTaxStatus', + 'verificationResponse' => 'getVerificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('manuallyEntered', $data ?? [], null); + $this->setIfExists('matchInsteadOfVerify', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('taxStatus', $data ?? [], null); + $this->setIfExists('verificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets manuallyEntered + * + * @return bool|null + */ + public function getManuallyEntered(): ?bool + { + return $this->container['manuallyEntered']; + } + + /** + * Sets manuallyEntered + * + * @param bool|null $manuallyEntered manuallyEntered + * + * @return $this + */ + public function setManuallyEntered(?bool $manuallyEntered): static + { + if (is_null($manuallyEntered)) { + throw new InvalidArgumentException('non-nullable manuallyEntered cannot be null'); + } + $this->container['manuallyEntered'] = $manuallyEntered; + + return $this; + } + + /** + * Gets matchInsteadOfVerify + * + * @return bool|null + */ + public function getMatchInsteadOfVerify(): ?bool + { + return $this->container['matchInsteadOfVerify']; + } + + /** + * Sets matchInsteadOfVerify + * + * @param bool|null $matchInsteadOfVerify matchInsteadOfVerify + * + * @return $this + */ + public function setMatchInsteadOfVerify(?bool $matchInsteadOfVerify): static + { + if (is_null($matchInsteadOfVerify)) { + throw new InvalidArgumentException('non-nullable matchInsteadOfVerify cannot be null'); + } + $this->container['matchInsteadOfVerify'] = $matchInsteadOfVerify; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber(): ?string + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number number + * + * @return $this + */ + public function setNumber(?string $number): static + { + if (is_null($number)) { + array_push($this->openAPINullablesSetToNull, 'number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + array_push($this->openAPINullablesSetToNull, 'date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets taxStatus + * + * @return \SynergiTech\Staffology\Model\CISTaxStatus|null + */ + public function getTaxStatus(): ?\SynergiTech\Staffology\Model\CISTaxStatus + { + return $this->container['taxStatus']; + } + + /** + * Sets taxStatus + * + * @param \SynergiTech\Staffology\Model\CISTaxStatus|null $taxStatus taxStatus + * + * @return $this + */ + public function setTaxStatus(?\SynergiTech\Staffology\Model\CISTaxStatus $taxStatus): static + { + if (is_null($taxStatus)) { + throw new InvalidArgumentException('non-nullable taxStatus cannot be null'); + } + $this->container['taxStatus'] = $taxStatus; + + return $this; + } + + /** + * Gets verificationResponse + * + * @return \SynergiTech\Staffology\Model\ContractCisSubContractor|null + */ + public function getVerificationResponse(): ?\SynergiTech\Staffology\Model\ContractCisSubContractor + { + return $this->container['verificationResponse']; + } + + /** + * Sets verificationResponse + * + * @param \SynergiTech\Staffology\Model\ContractCisSubContractor|null $verificationResponse verificationResponse + * + * @return $this + */ + public function setVerificationResponse(?\SynergiTech\Staffology\Model\ContractCisSubContractor $verificationResponse): static + { + if (is_null($verificationResponse)) { + throw new InvalidArgumentException('non-nullable verificationResponse cannot be null'); + } + $this->container['verificationResponse'] = $verificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCisVerificationDetailsResponse.php b/src/Model/ContractCisVerificationDetailsResponse.php new file mode 100644 index 0000000..19d0950 --- /dev/null +++ b/src/Model/ContractCisVerificationDetailsResponse.php @@ -0,0 +1,633 @@ + + */ +class ContractCisVerificationDetailsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CisVerificationDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'verificationRequest' => 'string', + 'manuallyEntered' => 'bool', + 'matchInsteadOfVerify' => 'bool', + 'number' => 'string', + 'date' => '\DateTime', + 'taxStatus' => '\SynergiTech\Staffology\Model\CISTaxStatus', + 'verificationResponse' => '\SynergiTech\Staffology\Model\ContractCisSubContractor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'verificationRequest' => 'uuid', + 'manuallyEntered' => null, + 'matchInsteadOfVerify' => null, + 'number' => null, + 'date' => 'date', + 'taxStatus' => null, + 'verificationResponse' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'verificationRequest' => true, + 'manuallyEntered' => false, + 'matchInsteadOfVerify' => false, + 'number' => true, + 'date' => true, + 'taxStatus' => false, + 'verificationResponse' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'verificationRequest' => 'verificationRequest', + 'manuallyEntered' => 'manuallyEntered', + 'matchInsteadOfVerify' => 'matchInsteadOfVerify', + 'number' => 'number', + 'date' => 'date', + 'taxStatus' => 'taxStatus', + 'verificationResponse' => 'verificationResponse' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'verificationRequest' => 'setVerificationRequest', + 'manuallyEntered' => 'setManuallyEntered', + 'matchInsteadOfVerify' => 'setMatchInsteadOfVerify', + 'number' => 'setNumber', + 'date' => 'setDate', + 'taxStatus' => 'setTaxStatus', + 'verificationResponse' => 'setVerificationResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'verificationRequest' => 'getVerificationRequest', + 'manuallyEntered' => 'getManuallyEntered', + 'matchInsteadOfVerify' => 'getMatchInsteadOfVerify', + 'number' => 'getNumber', + 'date' => 'getDate', + 'taxStatus' => 'getTaxStatus', + 'verificationResponse' => 'getVerificationResponse' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('verificationRequest', $data ?? [], null); + $this->setIfExists('manuallyEntered', $data ?? [], null); + $this->setIfExists('matchInsteadOfVerify', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('taxStatus', $data ?? [], null); + $this->setIfExists('verificationResponse', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets verificationRequest + * + * @return string|null + */ + public function getVerificationRequest(): ?string + { + return $this->container['verificationRequest']; + } + + /** + * Sets verificationRequest + * + * @param string|null $verificationRequest If a Verification request has been made for this employee then this will show its ID + * + * @return $this + */ + public function setVerificationRequest(?string $verificationRequest): static + { + if (is_null($verificationRequest)) { + array_push($this->openAPINullablesSetToNull, 'verificationRequest'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('verificationRequest', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['verificationRequest'] = $verificationRequest; + + return $this; + } + + /** + * Gets manuallyEntered + * + * @return bool|null + */ + public function getManuallyEntered(): ?bool + { + return $this->container['manuallyEntered']; + } + + /** + * Sets manuallyEntered + * + * @param bool|null $manuallyEntered manuallyEntered + * + * @return $this + */ + public function setManuallyEntered(?bool $manuallyEntered): static + { + if (is_null($manuallyEntered)) { + throw new InvalidArgumentException('non-nullable manuallyEntered cannot be null'); + } + $this->container['manuallyEntered'] = $manuallyEntered; + + return $this; + } + + /** + * Gets matchInsteadOfVerify + * + * @return bool|null + */ + public function getMatchInsteadOfVerify(): ?bool + { + return $this->container['matchInsteadOfVerify']; + } + + /** + * Sets matchInsteadOfVerify + * + * @param bool|null $matchInsteadOfVerify matchInsteadOfVerify + * + * @return $this + */ + public function setMatchInsteadOfVerify(?bool $matchInsteadOfVerify): static + { + if (is_null($matchInsteadOfVerify)) { + throw new InvalidArgumentException('non-nullable matchInsteadOfVerify cannot be null'); + } + $this->container['matchInsteadOfVerify'] = $matchInsteadOfVerify; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber(): ?string + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number number + * + * @return $this + */ + public function setNumber(?string $number): static + { + if (is_null($number)) { + array_push($this->openAPINullablesSetToNull, 'number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + array_push($this->openAPINullablesSetToNull, 'date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets taxStatus + * + * @return \SynergiTech\Staffology\Model\CISTaxStatus|null + */ + public function getTaxStatus(): ?\SynergiTech\Staffology\Model\CISTaxStatus + { + return $this->container['taxStatus']; + } + + /** + * Sets taxStatus + * + * @param \SynergiTech\Staffology\Model\CISTaxStatus|null $taxStatus taxStatus + * + * @return $this + */ + public function setTaxStatus(?\SynergiTech\Staffology\Model\CISTaxStatus $taxStatus): static + { + if (is_null($taxStatus)) { + throw new InvalidArgumentException('non-nullable taxStatus cannot be null'); + } + $this->container['taxStatus'] = $taxStatus; + + return $this; + } + + /** + * Gets verificationResponse + * + * @return \SynergiTech\Staffology\Model\ContractCisSubContractor|null + */ + public function getVerificationResponse(): ?\SynergiTech\Staffology\Model\ContractCisSubContractor + { + return $this->container['verificationResponse']; + } + + /** + * Sets verificationResponse + * + * @param \SynergiTech\Staffology\Model\ContractCisSubContractor|null $verificationResponse verificationResponse + * + * @return $this + */ + public function setVerificationResponse(?\SynergiTech\Staffology\Model\ContractCisSubContractor $verificationResponse): static + { + if (is_null($verificationResponse)) { + throw new InvalidArgumentException('non-nullable verificationResponse cannot be null'); + } + $this->container['verificationResponse'] = $verificationResponse; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCostCentreJournalOverridesRequest.php b/src/Model/ContractCostCentreJournalOverridesRequest.php new file mode 100644 index 0000000..07c8547 --- /dev/null +++ b/src/Model/ContractCostCentreJournalOverridesRequest.php @@ -0,0 +1,490 @@ + + */ +class ContractCostCentreJournalOverridesRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CostCentreJournalOverridesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping CostCentre Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCostCentreJournalOverridesResponse.php b/src/Model/ContractCostCentreJournalOverridesResponse.php new file mode 100644 index 0000000..19bcb73 --- /dev/null +++ b/src/Model/ContractCostCentreJournalOverridesResponse.php @@ -0,0 +1,524 @@ + + */ +class ContractCostCentreJournalOverridesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CostCentreJournalOverridesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Cost Centre Journal Overrides identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping CostCentre Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCostCentreJournalOverridesResponseItem.php b/src/Model/ContractCostCentreJournalOverridesResponseItem.php new file mode 100644 index 0000000..61376af --- /dev/null +++ b/src/Model/ContractCostCentreJournalOverridesResponseItem.php @@ -0,0 +1,531 @@ + + */ +class ContractCostCentreJournalOverridesResponseItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CostCentreJournalOverridesResponseItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCostCentreJournalOverridesUpdateRequest.php b/src/Model/ContractCostCentreJournalOverridesUpdateRequest.php new file mode 100644 index 0000000..ceafdc2 --- /dev/null +++ b/src/Model/ContractCostCentreJournalOverridesUpdateRequest.php @@ -0,0 +1,524 @@ + + */ +class ContractCostCentreJournalOverridesUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CostCentreJournalOverridesUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique Id + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping CostCentre Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractCreateEmployeeRequest.php b/src/Model/ContractCreateEmployeeRequest.php new file mode 100644 index 0000000..efca8a4 --- /dev/null +++ b/src/Model/ContractCreateEmployeeRequest.php @@ -0,0 +1,825 @@ + + */ +class ContractCreateEmployeeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.CreateEmployeeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'personalDetails' => '\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest', + 'employmentDetails' => '\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest', + 'autoEnrolment' => '\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest', + 'leaveSettings' => '\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest', + 'rightToWork' => '\SynergiTech\Staffology\Model\ContractRightToWork', + 'bankDetails' => '\SynergiTech\Staffology\Model\ContractBankDetails', + 'payOptions' => '\SynergiTech\Staffology\Model\ContractPayOptionsRequest', + 'tags' => 'string[]', + 'holidaySchemeUniqueId' => 'string', + 'aggregatedServiceDate' => '\DateTime', + 'evcId' => 'string', + 'sourceSystemId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'personalDetails' => null, + 'employmentDetails' => null, + 'autoEnrolment' => null, + 'leaveSettings' => null, + 'rightToWork' => null, + 'bankDetails' => null, + 'payOptions' => null, + 'tags' => null, + 'holidaySchemeUniqueId' => 'uuid', + 'aggregatedServiceDate' => 'date', + 'evcId' => 'uuid', + 'sourceSystemId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'personalDetails' => false, + 'employmentDetails' => false, + 'autoEnrolment' => false, + 'leaveSettings' => false, + 'rightToWork' => false, + 'bankDetails' => false, + 'payOptions' => false, + 'tags' => true, + 'holidaySchemeUniqueId' => true, + 'aggregatedServiceDate' => true, + 'evcId' => true, + 'sourceSystemId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'personalDetails' => 'personalDetails', + 'employmentDetails' => 'employmentDetails', + 'autoEnrolment' => 'autoEnrolment', + 'leaveSettings' => 'leaveSettings', + 'rightToWork' => 'rightToWork', + 'bankDetails' => 'bankDetails', + 'payOptions' => 'payOptions', + 'tags' => 'tags', + 'holidaySchemeUniqueId' => 'holidaySchemeUniqueId', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'evcId' => 'evcId', + 'sourceSystemId' => 'sourceSystemId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'personalDetails' => 'setPersonalDetails', + 'employmentDetails' => 'setEmploymentDetails', + 'autoEnrolment' => 'setAutoEnrolment', + 'leaveSettings' => 'setLeaveSettings', + 'rightToWork' => 'setRightToWork', + 'bankDetails' => 'setBankDetails', + 'payOptions' => 'setPayOptions', + 'tags' => 'setTags', + 'holidaySchemeUniqueId' => 'setHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'evcId' => 'setEvcId', + 'sourceSystemId' => 'setSourceSystemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'personalDetails' => 'getPersonalDetails', + 'employmentDetails' => 'getEmploymentDetails', + 'autoEnrolment' => 'getAutoEnrolment', + 'leaveSettings' => 'getLeaveSettings', + 'rightToWork' => 'getRightToWork', + 'bankDetails' => 'getBankDetails', + 'payOptions' => 'getPayOptions', + 'tags' => 'getTags', + 'holidaySchemeUniqueId' => 'getHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'evcId' => 'getEvcId', + 'sourceSystemId' => 'getSourceSystemId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('autoEnrolment', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + $this->setIfExists('rightToWork', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('holidaySchemeUniqueId', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('evcId', $data ?? [], null); + $this->setIfExists('sourceSystemId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['sourceSystemId']) && (mb_strlen($this->container['sourceSystemId']) > 50)) { + $invalidProperties[] = "invalid value for 'sourceSystemId', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\ContractPersonalDetailsRequest|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\ContractPersonalDetailsRequest|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets autoEnrolment + * + * @return \SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest|null + */ + public function getAutoEnrolment(): ?\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest + { + return $this->container['autoEnrolment']; + } + + /** + * Sets autoEnrolment + * + * @param \SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest|null $autoEnrolment autoEnrolment + * + * @return $this + */ + public function setAutoEnrolment(?\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest $autoEnrolment): static + { + if (is_null($autoEnrolment)) { + throw new InvalidArgumentException('non-nullable autoEnrolment cannot be null'); + } + $this->container['autoEnrolment'] = $autoEnrolment; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\ContractLeaveSettingsRequest|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\ContractLeaveSettingsRequest|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + + /** + * Gets rightToWork + * + * @return \SynergiTech\Staffology\Model\ContractRightToWork|null + */ + public function getRightToWork(): ?\SynergiTech\Staffology\Model\ContractRightToWork + { + return $this->container['rightToWork']; + } + + /** + * Sets rightToWork + * + * @param \SynergiTech\Staffology\Model\ContractRightToWork|null $rightToWork rightToWork + * + * @return $this + */ + public function setRightToWork(?\SynergiTech\Staffology\Model\ContractRightToWork $rightToWork): static + { + if (is_null($rightToWork)) { + throw new InvalidArgumentException('non-nullable rightToWork cannot be null'); + } + $this->container['rightToWork'] = $rightToWork; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\ContractBankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\ContractBankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\ContractBankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\ContractBankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\ContractPayOptionsRequest|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\ContractPayOptionsRequest + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\ContractPayOptionsRequest|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\ContractPayOptionsRequest $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets holidaySchemeUniqueId + * + * @return string|null + */ + public function getHolidaySchemeUniqueId(): ?string + { + return $this->container['holidaySchemeUniqueId']; + } + + /** + * Sets holidaySchemeUniqueId + * + * @param string|null $holidaySchemeUniqueId holidaySchemeUniqueId + * + * @return $this + */ + public function setHolidaySchemeUniqueId(?string $holidaySchemeUniqueId): static + { + if (is_null($holidaySchemeUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'holidaySchemeUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidaySchemeUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidaySchemeUniqueId'] = $holidaySchemeUniqueId; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets evcId + * + * @return string|null + */ + public function getEvcId(): ?string + { + return $this->container['evcId']; + } + + /** + * Sets evcId + * + * @param string|null $evcId If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. + * + * @return $this + */ + public function setEvcId(?string $evcId): static + { + if (is_null($evcId)) { + array_push($this->openAPINullablesSetToNull, 'evcId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('evcId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['evcId'] = $evcId; + + return $this; + } + + /** + * Gets sourceSystemId + * + * @return string|null + */ + public function getSourceSystemId(): ?string + { + return $this->container['sourceSystemId']; + } + + /** + * Sets sourceSystemId + * + * @param string|null $sourceSystemId Used by external systems so they can store an immutable reference. Once this property is set it cannot be changed. + * + * @return $this + */ + public function setSourceSystemId(?string $sourceSystemId): static + { + if (is_null($sourceSystemId)) { + array_push($this->openAPINullablesSetToNull, 'sourceSystemId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sourceSystemId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($sourceSystemId) && (mb_strlen($sourceSystemId) > 50)) { + throw new InvalidArgumentException('invalid length for $sourceSystemId when calling ContractCreateEmployeeRequest., must be smaller than or equal to 50.'); + } + + $this->container['sourceSystemId'] = $sourceSystemId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentJournalOverridesRequest.php b/src/Model/ContractDepartmentJournalOverridesRequest.php new file mode 100644 index 0000000..5ee2123 --- /dev/null +++ b/src/Model/ContractDepartmentJournalOverridesRequest.php @@ -0,0 +1,490 @@ + + */ +class ContractDepartmentJournalOverridesRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentJournalOverridesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping Department Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentJournalOverridesResponse.php b/src/Model/ContractDepartmentJournalOverridesResponse.php new file mode 100644 index 0000000..1b0cc76 --- /dev/null +++ b/src/Model/ContractDepartmentJournalOverridesResponse.php @@ -0,0 +1,524 @@ + + */ +class ContractDepartmentJournalOverridesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentJournalOverridesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Department Journal Overrides identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping Department Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentJournalOverridesResponseItem.php b/src/Model/ContractDepartmentJournalOverridesResponseItem.php new file mode 100644 index 0000000..36f303e --- /dev/null +++ b/src/Model/ContractDepartmentJournalOverridesResponseItem.php @@ -0,0 +1,531 @@ + + */ +class ContractDepartmentJournalOverridesResponseItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentJournalOverridesResponseItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentJournalOverridesUpdateRequest.php b/src/Model/ContractDepartmentJournalOverridesUpdateRequest.php new file mode 100644 index 0000000..123c919 --- /dev/null +++ b/src/Model/ContractDepartmentJournalOverridesUpdateRequest.php @@ -0,0 +1,524 @@ + + */ +class ContractDepartmentJournalOverridesUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentJournalOverridesUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'tokenDescription' => 'string', + 'mapping' => 'string', + 'journalTokenPublicId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'tokenDescription' => null, + 'mapping' => null, + 'journalTokenPublicId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'tokenDescription' => true, + 'mapping' => true, + 'journalTokenPublicId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'tokenDescription' => 'tokenDescription', + 'mapping' => 'mapping', + 'journalTokenPublicId' => 'journalTokenPublicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'tokenDescription' => 'setTokenDescription', + 'mapping' => 'setMapping', + 'journalTokenPublicId' => 'setJournalTokenPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'tokenDescription' => 'getTokenDescription', + 'mapping' => 'getMapping', + 'journalTokenPublicId' => 'getJournalTokenPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('tokenDescription', $data ?? [], null); + $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('journalTokenPublicId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique Id + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets tokenDescription + * + * @return string|null + */ + public function getTokenDescription(): ?string + { + return $this->container['tokenDescription']; + } + + /** + * Sets tokenDescription + * + * @param string|null $tokenDescription Token Description + * + * @return $this + */ + public function setTokenDescription(?string $tokenDescription): static + { + if (is_null($tokenDescription)) { + array_push($this->openAPINullablesSetToNull, 'tokenDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokenDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokenDescription'] = $tokenDescription; + + return $this; + } + + /** + * Gets mapping + * + * @return string|null + */ + public function getMapping(): ?string + { + return $this->container['mapping']; + } + + /** + * Sets mapping + * + * @param string|null $mapping Department Journal Overrides Mapping + * + * @return $this + */ + public function setMapping(?string $mapping): static + { + if (is_null($mapping)) { + array_push($this->openAPINullablesSetToNull, 'mapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapping'] = $mapping; + + return $this; + } + + /** + * Gets journalTokenPublicId + * + * @return string|null + */ + public function getJournalTokenPublicId(): ?string + { + return $this->container['journalTokenPublicId']; + } + + /** + * Sets journalTokenPublicId + * + * @param string|null $journalTokenPublicId Journal Token Public Id + * + * @return $this + */ + public function setJournalTokenPublicId(?string $journalTokenPublicId): static + { + if (is_null($journalTokenPublicId)) { + throw new InvalidArgumentException('non-nullable journalTokenPublicId cannot be null'); + } + $this->container['journalTokenPublicId'] = $journalTokenPublicId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentRequest.php b/src/Model/ContractDepartmentRequest.php new file mode 100644 index 0000000..25ecb43 --- /dev/null +++ b/src/Model/ContractDepartmentRequest.php @@ -0,0 +1,576 @@ + + */ +class ContractDepartmentRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'title' => false, + 'color' => true, + 'accountingCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['accountingCode']) && (mb_strlen($this->container['accountingCode']) > 50)) { + $invalidProperties[] = "invalid value for 'accountingCode', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this Department + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling ContractDepartmentRequest., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling ContractDepartmentRequest., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Department + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractDepartmentRequest., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractDepartmentRequest., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Department, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling ContractDepartmentRequest., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountingCode) && (mb_strlen($accountingCode) > 50)) { + throw new InvalidArgumentException('invalid length for $accountingCode when calling ContractDepartmentRequest., must be smaller than or equal to 50.'); + } + + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDepartmentResponse.php b/src/Model/ContractDepartmentResponse.php new file mode 100644 index 0000000..55f9b35 --- /dev/null +++ b/src/Model/ContractDepartmentResponse.php @@ -0,0 +1,610 @@ + + */ +class ContractDepartmentResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DepartmentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeCount' => 'int', + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeCount' => 'int32', + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeCount' => false, + 'code' => false, + 'title' => false, + 'color' => true, + 'accountingCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeCount' => 'employeeCount', + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeCount' => 'setEmployeeCount', + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeCount' => 'getEmployeeCount', + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['accountingCode']) && (mb_strlen($this->container['accountingCode']) > 50)) { + $invalidProperties[] = "invalid value for 'accountingCode', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount The number of employees with this set as their primary department + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this Department + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling ContractDepartmentResponse., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling ContractDepartmentResponse., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Department + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractDepartmentResponse., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractDepartmentResponse., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Department, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling ContractDepartmentResponse., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountingCode) && (mb_strlen($accountingCode) > 50)) { + throw new InvalidArgumentException('invalid length for $accountingCode when calling ContractDepartmentResponse., must be smaller than or equal to 50.'); + } + + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractDirectorshipDetails.php b/src/Model/ContractDirectorshipDetails.php new file mode 100644 index 0000000..a2ea689 --- /dev/null +++ b/src/Model/ContractDirectorshipDetails.php @@ -0,0 +1,524 @@ + + */ +class ContractDirectorshipDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.DirectorshipDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isDirector' => 'bool', + 'startDate' => '\DateTime', + 'leaveDate' => '\DateTime', + 'niAlternativeMethod' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isDirector' => null, + 'startDate' => 'date', + 'leaveDate' => 'date', + 'niAlternativeMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isDirector' => false, + 'startDate' => true, + 'leaveDate' => true, + 'niAlternativeMethod' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isDirector' => 'isDirector', + 'startDate' => 'startDate', + 'leaveDate' => 'leaveDate', + 'niAlternativeMethod' => 'niAlternativeMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isDirector' => 'setIsDirector', + 'startDate' => 'setStartDate', + 'leaveDate' => 'setLeaveDate', + 'niAlternativeMethod' => 'setNiAlternativeMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isDirector' => 'getIsDirector', + 'startDate' => 'getStartDate', + 'leaveDate' => 'getLeaveDate', + 'niAlternativeMethod' => 'getNiAlternativeMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isDirector', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('niAlternativeMethod', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isDirector + * + * @return bool|null + */ + public function getIsDirector(): ?bool + { + return $this->container['isDirector']; + } + + /** + * Sets isDirector + * + * @param bool|null $isDirector isDirector + * + * @return $this + */ + public function setIsDirector(?bool $isDirector): static + { + if (is_null($isDirector)) { + throw new InvalidArgumentException('non-nullable isDirector cannot be null'); + } + $this->container['isDirector'] = $isDirector; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets niAlternativeMethod + * + * @return bool|null + */ + public function getNiAlternativeMethod(): ?bool + { + return $this->container['niAlternativeMethod']; + } + + /** + * Sets niAlternativeMethod + * + * @param bool|null $niAlternativeMethod niAlternativeMethod + * + * @return $this + */ + public function setNiAlternativeMethod(?bool $niAlternativeMethod): static + { + if (is_null($niAlternativeMethod)) { + throw new InvalidArgumentException('non-nullable niAlternativeMethod cannot be null'); + } + $this->container['niAlternativeMethod'] = $niAlternativeMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeItem.php b/src/Model/ContractEmployeeItem.php new file mode 100644 index 0000000..aedeb76 --- /dev/null +++ b/src/Model/ContractEmployeeItem.php @@ -0,0 +1,531 @@ + + */ +class ContractEmployeeItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeResponse.php b/src/Model/ContractEmployeeResponse.php new file mode 100644 index 0000000..58e86bb --- /dev/null +++ b/src/Model/ContractEmployeeResponse.php @@ -0,0 +1,919 @@ + + */ +class ContractEmployeeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'personalDetails' => '\SynergiTech\Staffology\Model\ContractPersonalDetailsResponse', + 'employmentDetails' => '\SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse', + 'autoEnrolment' => '\SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse', + 'leaveSettings' => '\SynergiTech\Staffology\Model\ContractLeaveSettingsResponse', + 'rightToWork' => '\SynergiTech\Staffology\Model\ContractRightToWork', + 'bankDetails' => '\SynergiTech\Staffology\Model\ContractBankDetails', + 'payOptions' => '\SynergiTech\Staffology\Model\ContractPayOptionsResponse', + 'tags' => 'string[]', + 'status' => '\SynergiTech\Staffology\Model\EmployeeStatus', + 'aeNotEnroledWarning' => 'bool', + 'sourceSystemId' => 'string', + 'aggregatedServiceDate' => '\DateTime', + 'holidaySchemeUniqueId' => 'string', + 'evcId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'personalDetails' => null, + 'employmentDetails' => null, + 'autoEnrolment' => null, + 'leaveSettings' => null, + 'rightToWork' => null, + 'bankDetails' => null, + 'payOptions' => null, + 'tags' => null, + 'status' => null, + 'aeNotEnroledWarning' => null, + 'sourceSystemId' => null, + 'aggregatedServiceDate' => 'date', + 'holidaySchemeUniqueId' => 'uuid', + 'evcId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'personalDetails' => false, + 'employmentDetails' => false, + 'autoEnrolment' => false, + 'leaveSettings' => false, + 'rightToWork' => false, + 'bankDetails' => false, + 'payOptions' => false, + 'tags' => true, + 'status' => false, + 'aeNotEnroledWarning' => false, + 'sourceSystemId' => true, + 'aggregatedServiceDate' => true, + 'holidaySchemeUniqueId' => true, + 'evcId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'personalDetails' => 'personalDetails', + 'employmentDetails' => 'employmentDetails', + 'autoEnrolment' => 'autoEnrolment', + 'leaveSettings' => 'leaveSettings', + 'rightToWork' => 'rightToWork', + 'bankDetails' => 'bankDetails', + 'payOptions' => 'payOptions', + 'tags' => 'tags', + 'status' => 'status', + 'aeNotEnroledWarning' => 'aeNotEnroledWarning', + 'sourceSystemId' => 'sourceSystemId', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'holidaySchemeUniqueId' => 'holidaySchemeUniqueId', + 'evcId' => 'evcId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'personalDetails' => 'setPersonalDetails', + 'employmentDetails' => 'setEmploymentDetails', + 'autoEnrolment' => 'setAutoEnrolment', + 'leaveSettings' => 'setLeaveSettings', + 'rightToWork' => 'setRightToWork', + 'bankDetails' => 'setBankDetails', + 'payOptions' => 'setPayOptions', + 'tags' => 'setTags', + 'status' => 'setStatus', + 'aeNotEnroledWarning' => 'setAeNotEnroledWarning', + 'sourceSystemId' => 'setSourceSystemId', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'holidaySchemeUniqueId' => 'setHolidaySchemeUniqueId', + 'evcId' => 'setEvcId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'personalDetails' => 'getPersonalDetails', + 'employmentDetails' => 'getEmploymentDetails', + 'autoEnrolment' => 'getAutoEnrolment', + 'leaveSettings' => 'getLeaveSettings', + 'rightToWork' => 'getRightToWork', + 'bankDetails' => 'getBankDetails', + 'payOptions' => 'getPayOptions', + 'tags' => 'getTags', + 'status' => 'getStatus', + 'aeNotEnroledWarning' => 'getAeNotEnroledWarning', + 'sourceSystemId' => 'getSourceSystemId', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'holidaySchemeUniqueId' => 'getHolidaySchemeUniqueId', + 'evcId' => 'getEvcId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('autoEnrolment', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + $this->setIfExists('rightToWork', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('aeNotEnroledWarning', $data ?? [], null); + $this->setIfExists('sourceSystemId', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('holidaySchemeUniqueId', $data ?? [], null); + $this->setIfExists('evcId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\ContractPersonalDetailsResponse|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\ContractPersonalDetailsResponse + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\ContractPersonalDetailsResponse|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\ContractPersonalDetailsResponse $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\ContractEmploymentDetailsResponse $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets autoEnrolment + * + * @return \SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse|null + */ + public function getAutoEnrolment(): ?\SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse + { + return $this->container['autoEnrolment']; + } + + /** + * Sets autoEnrolment + * + * @param \SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse|null $autoEnrolment autoEnrolment + * + * @return $this + */ + public function setAutoEnrolment(?\SynergiTech\Staffology\Model\ContractAutoEnrolmentResponse $autoEnrolment): static + { + if (is_null($autoEnrolment)) { + throw new InvalidArgumentException('non-nullable autoEnrolment cannot be null'); + } + $this->container['autoEnrolment'] = $autoEnrolment; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\ContractLeaveSettingsResponse|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\ContractLeaveSettingsResponse + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\ContractLeaveSettingsResponse|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\ContractLeaveSettingsResponse $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + + /** + * Gets rightToWork + * + * @return \SynergiTech\Staffology\Model\ContractRightToWork|null + */ + public function getRightToWork(): ?\SynergiTech\Staffology\Model\ContractRightToWork + { + return $this->container['rightToWork']; + } + + /** + * Sets rightToWork + * + * @param \SynergiTech\Staffology\Model\ContractRightToWork|null $rightToWork rightToWork + * + * @return $this + */ + public function setRightToWork(?\SynergiTech\Staffology\Model\ContractRightToWork $rightToWork): static + { + if (is_null($rightToWork)) { + throw new InvalidArgumentException('non-nullable rightToWork cannot be null'); + } + $this->container['rightToWork'] = $rightToWork; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\ContractBankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\ContractBankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\ContractBankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\ContractBankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\ContractPayOptionsResponse|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\ContractPayOptionsResponse + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\ContractPayOptionsResponse|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\ContractPayOptionsResponse $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\EmployeeStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\EmployeeStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\EmployeeStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets aeNotEnroledWarning + * + * @return bool|null + */ + public function getAeNotEnroledWarning(): ?bool + { + return $this->container['aeNotEnroledWarning']; + } + + /** + * Sets aeNotEnroledWarning + * + * @param bool|null $aeNotEnroledWarning aeNotEnroledWarning + * + * @return $this + */ + public function setAeNotEnroledWarning(?bool $aeNotEnroledWarning): static + { + if (is_null($aeNotEnroledWarning)) { + throw new InvalidArgumentException('non-nullable aeNotEnroledWarning cannot be null'); + } + $this->container['aeNotEnroledWarning'] = $aeNotEnroledWarning; + + return $this; + } + + /** + * Gets sourceSystemId + * + * @return string|null + */ + public function getSourceSystemId(): ?string + { + return $this->container['sourceSystemId']; + } + + /** + * Sets sourceSystemId + * + * @param string|null $sourceSystemId sourceSystemId + * + * @return $this + */ + public function setSourceSystemId(?string $sourceSystemId): static + { + if (is_null($sourceSystemId)) { + array_push($this->openAPINullablesSetToNull, 'sourceSystemId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sourceSystemId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sourceSystemId'] = $sourceSystemId; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets holidaySchemeUniqueId + * + * @return string|null + */ + public function getHolidaySchemeUniqueId(): ?string + { + return $this->container['holidaySchemeUniqueId']; + } + + /** + * Sets holidaySchemeUniqueId + * + * @param string|null $holidaySchemeUniqueId holidaySchemeUniqueId + * + * @return $this + */ + public function setHolidaySchemeUniqueId(?string $holidaySchemeUniqueId): static + { + if (is_null($holidaySchemeUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'holidaySchemeUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidaySchemeUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidaySchemeUniqueId'] = $holidaySchemeUniqueId; + + return $this; + } + + /** + * Gets evcId + * + * @return string|null + */ + public function getEvcId(): ?string + { + return $this->container['evcId']; + } + + /** + * Sets evcId + * + * @param string|null $evcId If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. + * + * @return $this + */ + public function setEvcId(?string $evcId): static + { + if (is_null($evcId)) { + array_push($this->openAPINullablesSetToNull, 'evcId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('evcId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['evcId'] = $evcId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.php b/src/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.php new file mode 100644 index 0000000..01acd53 --- /dev/null +++ b/src/Model/ContractEmployeeRoleAnalysisCategoryCodeRequest.php @@ -0,0 +1,640 @@ + + */ +class ContractEmployeeRoleAnalysisCategoryCodeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleAnalysisCategoryCodeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'weighting' => 'float', + 'analysisCategoryName' => 'string', + 'analysisCategoryPublicId' => 'string', + 'isPrimary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'color' => null, + 'title' => null, + 'weighting' => 'double', + 'analysisCategoryName' => null, + 'analysisCategoryPublicId' => 'uuid', + 'isPrimary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => true, + 'color' => true, + 'title' => true, + 'weighting' => false, + 'analysisCategoryName' => true, + 'analysisCategoryPublicId' => false, + 'isPrimary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'weighting' => 'weighting', + 'analysisCategoryName' => 'analysisCategoryName', + 'analysisCategoryPublicId' => 'analysisCategoryPublicId', + 'isPrimary' => 'isPrimary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'weighting' => 'setWeighting', + 'analysisCategoryName' => 'setAnalysisCategoryName', + 'analysisCategoryPublicId' => 'setAnalysisCategoryPublicId', + 'isPrimary' => 'setIsPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'weighting' => 'getWeighting', + 'analysisCategoryName' => 'getAnalysisCategoryName', + 'analysisCategoryPublicId' => 'getAnalysisCategoryPublicId', + 'isPrimary' => 'getIsPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('weighting', $data ?? [], null); + $this->setIfExists('analysisCategoryName', $data ?? [], null); + $this->setIfExists('analysisCategoryPublicId', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code Analysis Category code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color Analysis Category code color + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Analysis Category code Title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets weighting + * + * @return float|null + */ + public function getWeighting(): ?float + { + return $this->container['weighting']; + } + + /** + * Sets weighting + * + * @param float|null $weighting Weightage for analysis category code + * + * @return $this + */ + public function setWeighting(?float $weighting): static + { + if (is_null($weighting)) { + throw new InvalidArgumentException('non-nullable weighting cannot be null'); + } + $this->container['weighting'] = $weighting; + + return $this; + } + + /** + * Gets analysisCategoryName + * + * @return string|null + */ + public function getAnalysisCategoryName(): ?string + { + return $this->container['analysisCategoryName']; + } + + /** + * Sets analysisCategoryName + * + * @param string|null $analysisCategoryName Analysis category name for AnalysisCategory code + * + * @return $this + */ + public function setAnalysisCategoryName(?string $analysisCategoryName): static + { + if (is_null($analysisCategoryName)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryName'] = $analysisCategoryName; + + return $this; + } + + /** + * Gets analysisCategoryPublicId + * + * @return string|null + */ + public function getAnalysisCategoryPublicId(): ?string + { + return $this->container['analysisCategoryPublicId']; + } + + /** + * Sets analysisCategoryPublicId + * + * @param string|null $analysisCategoryPublicId Analysis category identifier + * + * @return $this + */ + public function setAnalysisCategoryPublicId(?string $analysisCategoryPublicId): static + { + if (is_null($analysisCategoryPublicId)) { + throw new InvalidArgumentException('non-nullable analysisCategoryPublicId cannot be null'); + } + $this->container['analysisCategoryPublicId'] = $analysisCategoryPublicId; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Return whether Employee Role is primary for not + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.php b/src/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.php new file mode 100644 index 0000000..d5f74ea --- /dev/null +++ b/src/Model/ContractEmployeeRoleAnalysisCategoryCodeResponse.php @@ -0,0 +1,674 @@ + + */ +class ContractEmployeeRoleAnalysisCategoryCodeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleAnalysisCategoryCodeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'weighting' => 'float', + 'analysisCategoryName' => 'string', + 'analysisCategoryPublicId' => 'string', + 'isPrimary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'code' => null, + 'color' => null, + 'title' => null, + 'weighting' => 'double', + 'analysisCategoryName' => null, + 'analysisCategoryPublicId' => 'uuid', + 'isPrimary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'code' => true, + 'color' => true, + 'title' => true, + 'weighting' => false, + 'analysisCategoryName' => true, + 'analysisCategoryPublicId' => false, + 'isPrimary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'weighting' => 'weighting', + 'analysisCategoryName' => 'analysisCategoryName', + 'analysisCategoryPublicId' => 'analysisCategoryPublicId', + 'isPrimary' => 'isPrimary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'weighting' => 'setWeighting', + 'analysisCategoryName' => 'setAnalysisCategoryName', + 'analysisCategoryPublicId' => 'setAnalysisCategoryPublicId', + 'isPrimary' => 'setIsPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'weighting' => 'getWeighting', + 'analysisCategoryName' => 'getAnalysisCategoryName', + 'analysisCategoryPublicId' => 'getAnalysisCategoryPublicId', + 'isPrimary' => 'getIsPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('weighting', $data ?? [], null); + $this->setIfExists('analysisCategoryName', $data ?? [], null); + $this->setIfExists('analysisCategoryPublicId', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Employee Role Analysis Category Code identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code Analysis Category code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color Analysis Category code color + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Analysis Category code Title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets weighting + * + * @return float|null + */ + public function getWeighting(): ?float + { + return $this->container['weighting']; + } + + /** + * Sets weighting + * + * @param float|null $weighting Weightage for analysis category code + * + * @return $this + */ + public function setWeighting(?float $weighting): static + { + if (is_null($weighting)) { + throw new InvalidArgumentException('non-nullable weighting cannot be null'); + } + $this->container['weighting'] = $weighting; + + return $this; + } + + /** + * Gets analysisCategoryName + * + * @return string|null + */ + public function getAnalysisCategoryName(): ?string + { + return $this->container['analysisCategoryName']; + } + + /** + * Sets analysisCategoryName + * + * @param string|null $analysisCategoryName Analysis category name for AnalysisCategory code + * + * @return $this + */ + public function setAnalysisCategoryName(?string $analysisCategoryName): static + { + if (is_null($analysisCategoryName)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryName'] = $analysisCategoryName; + + return $this; + } + + /** + * Gets analysisCategoryPublicId + * + * @return string|null + */ + public function getAnalysisCategoryPublicId(): ?string + { + return $this->container['analysisCategoryPublicId']; + } + + /** + * Sets analysisCategoryPublicId + * + * @param string|null $analysisCategoryPublicId Analysis category identifier + * + * @return $this + */ + public function setAnalysisCategoryPublicId(?string $analysisCategoryPublicId): static + { + if (is_null($analysisCategoryPublicId)) { + throw new InvalidArgumentException('non-nullable analysisCategoryPublicId cannot be null'); + } + $this->container['analysisCategoryPublicId'] = $analysisCategoryPublicId; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Return whether Employee Role is primary for not + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleItem.php b/src/Model/ContractEmployeeRoleItem.php new file mode 100644 index 0000000..9464f50 --- /dev/null +++ b/src/Model/ContractEmployeeRoleItem.php @@ -0,0 +1,531 @@ + + */ +class ContractEmployeeRoleItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleResponse.php b/src/Model/ContractEmployeeRoleResponse.php new file mode 100644 index 0000000..0921679 --- /dev/null +++ b/src/Model/ContractEmployeeRoleResponse.php @@ -0,0 +1,866 @@ + + */ +class ContractEmployeeRoleResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'jobTitle' => 'string', + 'isPrimary' => 'bool', + 'reference' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'basis' => '\SynergiTech\Staffology\Model\RoleBasis', + 'type' => '\SynergiTech\Staffology\Model\RoleType', + 'displayName' => 'string', + 'payOptions' => '\SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse', + 'workingPattern' => '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', + 'occupationalMaternityPolicyUniqueId' => 'string', + 'occupationalSicknessPolicyUniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'jobTitle' => null, + 'isPrimary' => null, + 'reference' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'basis' => null, + 'type' => null, + 'displayName' => null, + 'payOptions' => null, + 'workingPattern' => null, + 'occupationalMaternityPolicyUniqueId' => 'uuid', + 'occupationalSicknessPolicyUniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'jobTitle' => true, + 'isPrimary' => false, + 'reference' => true, + 'startDate' => false, + 'endDate' => true, + 'basis' => false, + 'type' => false, + 'displayName' => true, + 'payOptions' => false, + 'workingPattern' => false, + 'occupationalMaternityPolicyUniqueId' => true, + 'occupationalSicknessPolicyUniqueId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'jobTitle' => 'jobTitle', + 'isPrimary' => 'isPrimary', + 'reference' => 'reference', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'basis' => 'basis', + 'type' => 'type', + 'displayName' => 'displayName', + 'payOptions' => 'payOptions', + 'workingPattern' => 'workingPattern', + 'occupationalMaternityPolicyUniqueId' => 'occupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'occupationalSicknessPolicyUniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'jobTitle' => 'setJobTitle', + 'isPrimary' => 'setIsPrimary', + 'reference' => 'setReference', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'basis' => 'setBasis', + 'type' => 'setType', + 'displayName' => 'setDisplayName', + 'payOptions' => 'setPayOptions', + 'workingPattern' => 'setWorkingPattern', + 'occupationalMaternityPolicyUniqueId' => 'setOccupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'setOccupationalSicknessPolicyUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'jobTitle' => 'getJobTitle', + 'isPrimary' => 'getIsPrimary', + 'reference' => 'getReference', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'basis' => 'getBasis', + 'type' => 'getType', + 'displayName' => 'getDisplayName', + 'payOptions' => 'getPayOptions', + 'workingPattern' => 'getWorkingPattern', + 'occupationalMaternityPolicyUniqueId' => 'getOccupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'getOccupationalSicknessPolicyUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('workingPattern', $data ?? [], null); + $this->setIfExists('occupationalMaternityPolicyUniqueId', $data ?? [], null); + $this->setIfExists('occupationalSicknessPolicyUniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reference']) && (mb_strlen($this->container['reference']) > 35)) { + $invalidProperties[] = "invalid value for 'reference', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle Job Title of the Role + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Set to True if this is Primary role of the Employee + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference reference + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reference) && (mb_strlen($reference) > 35)) { + throw new InvalidArgumentException('invalid length for $reference when calling ContractEmployeeRoleResponse., must be smaller than or equal to 35.'); + } + + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\RoleBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\RoleBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\RoleBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\RoleBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\RoleType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\RoleType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\RoleType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\RoleType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\ContractPayOptionsBaseResponse $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets workingPattern + * + * @return \SynergiTech\Staffology\Model\ContractWorkingPatternResponse|null + */ + public function getWorkingPattern(): ?\SynergiTech\Staffology\Model\ContractWorkingPatternResponse + { + return $this->container['workingPattern']; + } + + /** + * Sets workingPattern + * + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternResponse|null $workingPattern workingPattern + * + * @return $this + */ + public function setWorkingPattern(?\SynergiTech\Staffology\Model\ContractWorkingPatternResponse $workingPattern): static + { + if (is_null($workingPattern)) { + throw new InvalidArgumentException('non-nullable workingPattern cannot be null'); + } + $this->container['workingPattern'] = $workingPattern; + + return $this; + } + + /** + * Gets occupationalMaternityPolicyUniqueId + * + * @return string|null + */ + public function getOccupationalMaternityPolicyUniqueId(): ?string + { + return $this->container['occupationalMaternityPolicyUniqueId']; + } + + /** + * Sets occupationalMaternityPolicyUniqueId + * + * @param string|null $occupationalMaternityPolicyUniqueId occupationalMaternityPolicyUniqueId + * + * @return $this + */ + public function setOccupationalMaternityPolicyUniqueId(?string $occupationalMaternityPolicyUniqueId): static + { + if (is_null($occupationalMaternityPolicyUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalMaternityPolicyUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalMaternityPolicyUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalMaternityPolicyUniqueId'] = $occupationalMaternityPolicyUniqueId; + + return $this; + } + + /** + * Gets occupationalSicknessPolicyUniqueId + * + * @return string|null + */ + public function getOccupationalSicknessPolicyUniqueId(): ?string + { + return $this->container['occupationalSicknessPolicyUniqueId']; + } + + /** + * Sets occupationalSicknessPolicyUniqueId + * + * @param string|null $occupationalSicknessPolicyUniqueId occupationalSicknessPolicyUniqueId + * + * @return $this + */ + public function setOccupationalSicknessPolicyUniqueId(?string $occupationalSicknessPolicyUniqueId): static + { + if (is_null($occupationalSicknessPolicyUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalSicknessPolicyUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalSicknessPolicyUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalSicknessPolicyUniqueId'] = $occupationalSicknessPolicyUniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleWorkingPatternRequest.php b/src/Model/ContractEmployeeRoleWorkingPatternRequest.php new file mode 100644 index 0000000..06b7211 --- /dev/null +++ b/src/Model/ContractEmployeeRoleWorkingPatternRequest.php @@ -0,0 +1,442 @@ + + */ +class ContractEmployeeRoleWorkingPatternRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleWorkingPatternRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'effectiveFrom' => '\DateTime', + 'workingPatternUniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'effectiveFrom' => 'date', + 'workingPatternUniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'effectiveFrom' => false, + 'workingPatternUniqueId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'effectiveFrom' => 'effectiveFrom', + 'workingPatternUniqueId' => 'workingPatternUniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'effectiveFrom' => 'setEffectiveFrom', + 'workingPatternUniqueId' => 'setWorkingPatternUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'effectiveFrom' => 'getEffectiveFrom', + 'workingPatternUniqueId' => 'getWorkingPatternUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('workingPatternUniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when the assignment of the Working Pattern becomes effective. + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + throw new InvalidArgumentException('non-nullable effectiveFrom cannot be null'); + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets workingPatternUniqueId + * + * @return string|null + */ + public function getWorkingPatternUniqueId(): ?string + { + return $this->container['workingPatternUniqueId']; + } + + /** + * Sets workingPatternUniqueId + * + * @param string|null $workingPatternUniqueId The UniqueId of the Working Pattern. + * + * @return $this + */ + public function setWorkingPatternUniqueId(?string $workingPatternUniqueId): static + { + if (is_null($workingPatternUniqueId)) { + throw new InvalidArgumentException('non-nullable workingPatternUniqueId cannot be null'); + } + $this->container['workingPatternUniqueId'] = $workingPatternUniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleWorkingPatternResponse.php b/src/Model/ContractEmployeeRoleWorkingPatternResponse.php new file mode 100644 index 0000000..097d5b3 --- /dev/null +++ b/src/Model/ContractEmployeeRoleWorkingPatternResponse.php @@ -0,0 +1,544 @@ + + */ +class ContractEmployeeRoleWorkingPatternResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleWorkingPatternResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'effectiveTo' => '\DateTime', + 'workingPattern' => '\SynergiTech\Staffology\Model\ContractWorkingPatternResponse', + 'effectiveFrom' => '\DateTime', + 'workingPatternUniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'effectiveTo' => 'date', + 'workingPattern' => null, + 'effectiveFrom' => 'date', + 'workingPatternUniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'effectiveTo' => false, + 'workingPattern' => false, + 'effectiveFrom' => false, + 'workingPatternUniqueId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'effectiveTo' => 'effectiveTo', + 'workingPattern' => 'workingPattern', + 'effectiveFrom' => 'effectiveFrom', + 'workingPatternUniqueId' => 'workingPatternUniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'effectiveTo' => 'setEffectiveTo', + 'workingPattern' => 'setWorkingPattern', + 'effectiveFrom' => 'setEffectiveFrom', + 'workingPatternUniqueId' => 'setWorkingPatternUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'effectiveTo' => 'getEffectiveTo', + 'workingPattern' => 'getWorkingPattern', + 'effectiveFrom' => 'getEffectiveFrom', + 'workingPatternUniqueId' => 'getWorkingPatternUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('workingPattern', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('workingPatternUniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId The UniqueId of the model. + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo [readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates. + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + throw new InvalidArgumentException('non-nullable effectiveTo cannot be null'); + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets workingPattern + * + * @return \SynergiTech\Staffology\Model\ContractWorkingPatternResponse|null + */ + public function getWorkingPattern(): ?\SynergiTech\Staffology\Model\ContractWorkingPatternResponse + { + return $this->container['workingPattern']; + } + + /** + * Sets workingPattern + * + * @param \SynergiTech\Staffology\Model\ContractWorkingPatternResponse|null $workingPattern workingPattern + * + * @return $this + */ + public function setWorkingPattern(?\SynergiTech\Staffology\Model\ContractWorkingPatternResponse $workingPattern): static + { + if (is_null($workingPattern)) { + throw new InvalidArgumentException('non-nullable workingPattern cannot be null'); + } + $this->container['workingPattern'] = $workingPattern; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when the assignment of the Working Pattern becomes effective. + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + throw new InvalidArgumentException('non-nullable effectiveFrom cannot be null'); + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets workingPatternUniqueId + * + * @return string|null + */ + public function getWorkingPatternUniqueId(): ?string + { + return $this->container['workingPatternUniqueId']; + } + + /** + * Sets workingPatternUniqueId + * + * @param string|null $workingPatternUniqueId The UniqueId of the Working Pattern. + * + * @return $this + */ + public function setWorkingPatternUniqueId(?string $workingPatternUniqueId): static + { + if (is_null($workingPatternUniqueId)) { + throw new InvalidArgumentException('non-nullable workingPatternUniqueId cannot be null'); + } + $this->container['workingPatternUniqueId'] = $workingPatternUniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployeeRoleWorkingPatternResponseItem.php b/src/Model/ContractEmployeeRoleWorkingPatternResponseItem.php new file mode 100644 index 0000000..409a63e --- /dev/null +++ b/src/Model/ContractEmployeeRoleWorkingPatternResponseItem.php @@ -0,0 +1,756 @@ + + */ +class ContractEmployeeRoleWorkingPatternResponseItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployeeRoleWorkingPatternResponseItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'workingPatternId' => 'string', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'totalHours' => 'float', + 'contractedWeeks' => 'float', + 'title' => 'string', + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'workingPatternId' => 'uuid', + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'totalHours' => 'double', + 'contractedWeeks' => 'double', + 'title' => null, + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'workingPatternId' => false, + 'effectiveFrom' => false, + 'effectiveTo' => true, + 'totalHours' => false, + 'contractedWeeks' => true, + 'title' => true, + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'workingPatternId' => 'workingPatternId', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'totalHours' => 'totalHours', + 'contractedWeeks' => 'contractedWeeks', + 'title' => 'title', + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'workingPatternId' => 'setWorkingPatternId', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'totalHours' => 'setTotalHours', + 'contractedWeeks' => 'setContractedWeeks', + 'title' => 'setTitle', + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'workingPatternId' => 'getWorkingPatternId', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'totalHours' => 'getTotalHours', + 'contractedWeeks' => 'getContractedWeeks', + 'title' => 'getTitle', + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('workingPatternId', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('totalHours', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets workingPatternId + * + * @return string|null + */ + public function getWorkingPatternId(): ?string + { + return $this->container['workingPatternId']; + } + + /** + * Sets workingPatternId + * + * @param string|null $workingPatternId The unique id of the working pattern. + * + * @return $this + */ + public function setWorkingPatternId(?string $workingPatternId): static + { + if (is_null($workingPatternId)) { + throw new InvalidArgumentException('non-nullable workingPatternId cannot be null'); + } + $this->container['workingPatternId'] = $workingPatternId; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when the assignment of the Working Pattern becomes effective. + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + throw new InvalidArgumentException('non-nullable effectiveFrom cannot be null'); + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo [readonly] The date when the assignment of the Working Pattern effectiveness ends. Populated automatically based on working pattern effectiveFrom dates. + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets totalHours + * + * @return float|null + */ + public function getTotalHours(): ?float + { + return $this->container['totalHours']; + } + + /** + * Sets totalHours + * + * @param float|null $totalHours [readonly] The amount of hours per working pattern. + * + * @return $this + */ + public function setTotalHours(?float $totalHours): static + { + if (is_null($totalHours)) { + throw new InvalidArgumentException('non-nullable totalHours cannot be null'); + } + $this->container['totalHours'] = $totalHours; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks [readonly] The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'contractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the working pattern. + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmployerBase.php b/src/Model/ContractEmployerBase.php new file mode 100644 index 0000000..3d7152b --- /dev/null +++ b/src/Model/ContractEmployerBase.php @@ -0,0 +1,449 @@ + + */ +class ContractEmployerBase implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmployerBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'uniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'uniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'uniqueId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'uniqueId' => 'uniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'uniqueId' => 'setUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'uniqueId' => 'getUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId uniqueId + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmploymentDetailsRequest.php b/src/Model/ContractEmploymentDetailsRequest.php new file mode 100644 index 0000000..5cc45a0 --- /dev/null +++ b/src/Model/ContractEmploymentDetailsRequest.php @@ -0,0 +1,1389 @@ + + */ +class ContractEmploymentDetailsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmploymentDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'cis' => '\SynergiTech\Staffology\Model\ContractCisDetailsRequest', + 'department' => '\SynergiTech\Staffology\Model\ContractDepartmentRequest', + 'cisSubContractor' => 'bool', + 'payrollCode' => 'string', + 'jobTitle' => 'string', + 'onHold' => 'bool', + 'onFurlough' => 'bool', + 'furloughStart' => '\DateTime', + 'furloughEnd' => '\DateTime', + 'furloughCalculationBasis' => '\SynergiTech\Staffology\Model\FurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'float', + 'partialFurlough' => 'bool', + 'furloughHoursNormallyWorked' => 'float', + 'furloughHoursOnFurlough' => 'float', + 'isApprentice' => 'bool', + 'apprenticeshipStartDate' => '\DateTime', + 'apprenticeshipEndDate' => '\DateTime', + 'workingPattern' => 'string', + 'forcePreviousPayrollCode' => 'string', + 'starterDetails' => '\SynergiTech\Staffology\Model\ContractStarterDetails', + 'directorshipDetails' => '\SynergiTech\Staffology\Model\ContractDirectorshipDetails', + 'leaverDetails' => '\SynergiTech\Staffology\Model\ContractLeaverDetails', + 'roles' => '\SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]', + 'isWorkingInFreePort' => 'bool', + 'isWorkingInInvestmentZone' => 'bool', + 'veteranDetails' => '\SynergiTech\Staffology\Model\ContractVeteranDetails', + 'continuousEmploymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'cis' => null, + 'department' => null, + 'cisSubContractor' => null, + 'payrollCode' => null, + 'jobTitle' => null, + 'onHold' => null, + 'onFurlough' => null, + 'furloughStart' => 'date', + 'furloughEnd' => 'date', + 'furloughCalculationBasis' => null, + 'furloughCalculationBasisAmount' => 'double', + 'partialFurlough' => null, + 'furloughHoursNormallyWorked' => 'double', + 'furloughHoursOnFurlough' => 'double', + 'isApprentice' => null, + 'apprenticeshipStartDate' => 'date', + 'apprenticeshipEndDate' => 'date', + 'workingPattern' => 'uuid', + 'forcePreviousPayrollCode' => null, + 'starterDetails' => null, + 'directorshipDetails' => null, + 'leaverDetails' => null, + 'roles' => null, + 'isWorkingInFreePort' => null, + 'isWorkingInInvestmentZone' => null, + 'veteranDetails' => null, + 'continuousEmploymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'cis' => false, + 'department' => false, + 'cisSubContractor' => false, + 'payrollCode' => false, + 'jobTitle' => true, + 'onHold' => false, + 'onFurlough' => false, + 'furloughStart' => true, + 'furloughEnd' => true, + 'furloughCalculationBasis' => false, + 'furloughCalculationBasisAmount' => false, + 'partialFurlough' => false, + 'furloughHoursNormallyWorked' => false, + 'furloughHoursOnFurlough' => false, + 'isApprentice' => false, + 'apprenticeshipStartDate' => true, + 'apprenticeshipEndDate' => true, + 'workingPattern' => true, + 'forcePreviousPayrollCode' => true, + 'starterDetails' => false, + 'directorshipDetails' => false, + 'leaverDetails' => false, + 'roles' => true, + 'isWorkingInFreePort' => false, + 'isWorkingInInvestmentZone' => false, + 'veteranDetails' => false, + 'continuousEmploymentDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'cis' => 'cis', + 'department' => 'department', + 'cisSubContractor' => 'cisSubContractor', + 'payrollCode' => 'payrollCode', + 'jobTitle' => 'jobTitle', + 'onHold' => 'onHold', + 'onFurlough' => 'onFurlough', + 'furloughStart' => 'furloughStart', + 'furloughEnd' => 'furloughEnd', + 'furloughCalculationBasis' => 'furloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'furloughCalculationBasisAmount', + 'partialFurlough' => 'partialFurlough', + 'furloughHoursNormallyWorked' => 'furloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'furloughHoursOnFurlough', + 'isApprentice' => 'isApprentice', + 'apprenticeshipStartDate' => 'apprenticeshipStartDate', + 'apprenticeshipEndDate' => 'apprenticeshipEndDate', + 'workingPattern' => 'workingPattern', + 'forcePreviousPayrollCode' => 'forcePreviousPayrollCode', + 'starterDetails' => 'starterDetails', + 'directorshipDetails' => 'directorshipDetails', + 'leaverDetails' => 'leaverDetails', + 'roles' => 'roles', + 'isWorkingInFreePort' => 'isWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'isWorkingInInvestmentZone', + 'veteranDetails' => 'veteranDetails', + 'continuousEmploymentDate' => 'continuousEmploymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'cis' => 'setCis', + 'department' => 'setDepartment', + 'cisSubContractor' => 'setCisSubContractor', + 'payrollCode' => 'setPayrollCode', + 'jobTitle' => 'setJobTitle', + 'onHold' => 'setOnHold', + 'onFurlough' => 'setOnFurlough', + 'furloughStart' => 'setFurloughStart', + 'furloughEnd' => 'setFurloughEnd', + 'furloughCalculationBasis' => 'setFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'setFurloughCalculationBasisAmount', + 'partialFurlough' => 'setPartialFurlough', + 'furloughHoursNormallyWorked' => 'setFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'setFurloughHoursOnFurlough', + 'isApprentice' => 'setIsApprentice', + 'apprenticeshipStartDate' => 'setApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'setApprenticeshipEndDate', + 'workingPattern' => 'setWorkingPattern', + 'forcePreviousPayrollCode' => 'setForcePreviousPayrollCode', + 'starterDetails' => 'setStarterDetails', + 'directorshipDetails' => 'setDirectorshipDetails', + 'leaverDetails' => 'setLeaverDetails', + 'roles' => 'setRoles', + 'isWorkingInFreePort' => 'setIsWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'setIsWorkingInInvestmentZone', + 'veteranDetails' => 'setVeteranDetails', + 'continuousEmploymentDate' => 'setContinuousEmploymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'cis' => 'getCis', + 'department' => 'getDepartment', + 'cisSubContractor' => 'getCisSubContractor', + 'payrollCode' => 'getPayrollCode', + 'jobTitle' => 'getJobTitle', + 'onHold' => 'getOnHold', + 'onFurlough' => 'getOnFurlough', + 'furloughStart' => 'getFurloughStart', + 'furloughEnd' => 'getFurloughEnd', + 'furloughCalculationBasis' => 'getFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'getFurloughCalculationBasisAmount', + 'partialFurlough' => 'getPartialFurlough', + 'furloughHoursNormallyWorked' => 'getFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'getFurloughHoursOnFurlough', + 'isApprentice' => 'getIsApprentice', + 'apprenticeshipStartDate' => 'getApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'getApprenticeshipEndDate', + 'workingPattern' => 'getWorkingPattern', + 'forcePreviousPayrollCode' => 'getForcePreviousPayrollCode', + 'starterDetails' => 'getStarterDetails', + 'directorshipDetails' => 'getDirectorshipDetails', + 'leaverDetails' => 'getLeaverDetails', + 'roles' => 'getRoles', + 'isWorkingInFreePort' => 'getIsWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'getIsWorkingInInvestmentZone', + 'veteranDetails' => 'getVeteranDetails', + 'continuousEmploymentDate' => 'getContinuousEmploymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cis', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('cisSubContractor', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('onHold', $data ?? [], null); + $this->setIfExists('onFurlough', $data ?? [], null); + $this->setIfExists('furloughStart', $data ?? [], null); + $this->setIfExists('furloughEnd', $data ?? [], null); + $this->setIfExists('furloughCalculationBasis', $data ?? [], null); + $this->setIfExists('furloughCalculationBasisAmount', $data ?? [], null); + $this->setIfExists('partialFurlough', $data ?? [], null); + $this->setIfExists('furloughHoursNormallyWorked', $data ?? [], null); + $this->setIfExists('furloughHoursOnFurlough', $data ?? [], null); + $this->setIfExists('isApprentice', $data ?? [], null); + $this->setIfExists('apprenticeshipStartDate', $data ?? [], null); + $this->setIfExists('apprenticeshipEndDate', $data ?? [], null); + $this->setIfExists('workingPattern', $data ?? [], null); + $this->setIfExists('forcePreviousPayrollCode', $data ?? [], null); + $this->setIfExists('starterDetails', $data ?? [], null); + $this->setIfExists('directorshipDetails', $data ?? [], null); + $this->setIfExists('leaverDetails', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('isWorkingInFreePort', $data ?? [], null); + $this->setIfExists('isWorkingInInvestmentZone', $data ?? [], null); + $this->setIfExists('veteranDetails', $data ?? [], null); + $this->setIfExists('continuousEmploymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['payrollCode'] === null) { + $invalidProperties[] = "'payrollCode' can't be null"; + } + if ((mb_strlen($this->container['payrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be smaller than or equal to 35."; + } + + if ((mb_strlen($this->container['payrollCode']) < 1)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['jobTitle']) && (mb_strlen($this->container['jobTitle']) > 120)) { + $invalidProperties[] = "invalid value for 'jobTitle', the character length must be smaller than or equal to 120."; + } + + if (!is_null($this->container['forcePreviousPayrollCode']) && (mb_strlen($this->container['forcePreviousPayrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'forcePreviousPayrollCode', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cis + * + * @return \SynergiTech\Staffology\Model\ContractCisDetailsRequest|null + */ + public function getCis(): ?\SynergiTech\Staffology\Model\ContractCisDetailsRequest + { + return $this->container['cis']; + } + + /** + * Sets cis + * + * @param \SynergiTech\Staffology\Model\ContractCisDetailsRequest|null $cis cis + * + * @return $this + */ + public function setCis(?\SynergiTech\Staffology\Model\ContractCisDetailsRequest $cis): static + { + if (is_null($cis)) { + throw new InvalidArgumentException('non-nullable cis cannot be null'); + } + $this->container['cis'] = $cis; + + return $this; + } + + /** + * Gets department + * + * @return \SynergiTech\Staffology\Model\ContractDepartmentRequest|null + */ + public function getDepartment(): ?\SynergiTech\Staffology\Model\ContractDepartmentRequest + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param \SynergiTech\Staffology\Model\ContractDepartmentRequest|null $department department + * + * @return $this + */ + public function setDepartment(?\SynergiTech\Staffology\Model\ContractDepartmentRequest $department): static + { + if (is_null($department)) { + throw new InvalidArgumentException('non-nullable department cannot be null'); + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets cisSubContractor + * + * @return bool|null + */ + public function getCisSubContractor(): ?bool + { + return $this->container['cisSubContractor']; + } + + /** + * Sets cisSubContractor + * + * @param bool|null $cisSubContractor Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information + * + * @return $this + */ + public function setCisSubContractor(?bool $cisSubContractor): static + { + if (is_null($cisSubContractor)) { + throw new InvalidArgumentException('non-nullable cisSubContractor cannot be null'); + } + $this->container['cisSubContractor'] = $cisSubContractor; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string + */ + public function getPayrollCode(): string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string $payrollCode The Employees Payroll Code. Must be unique within the Employer. + * + * @return $this + */ + public function setPayrollCode(string $payrollCode): static + { + if (is_null($payrollCode)) { + throw new InvalidArgumentException('non-nullable payrollCode cannot be null'); + } + if ((mb_strlen($payrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling ContractEmploymentDetailsRequest., must be smaller than or equal to 35.'); + } + if ((mb_strlen($payrollCode) < 1)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling ContractEmploymentDetailsRequest., must be bigger than or equal to 1.'); + } + + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle Job Title of Primary role of the Employee + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($jobTitle) && (mb_strlen($jobTitle) > 120)) { + throw new InvalidArgumentException('invalid length for $jobTitle when calling ContractEmploymentDetailsRequest., must be smaller than or equal to 120.'); + } + + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets onHold + * + * @return bool|null + */ + public function getOnHold(): ?bool + { + return $this->container['onHold']; + } + + /** + * Sets onHold + * + * @param bool|null $onHold Set to true to temporarily exclude the employee from payruns + * + * @return $this + */ + public function setOnHold(?bool $onHold): static + { + if (is_null($onHold)) { + throw new InvalidArgumentException('non-nullable onHold cannot be null'); + } + $this->container['onHold'] = $onHold; + + return $this; + } + + /** + * Gets onFurlough + * + * @return bool|null + */ + public function getOnFurlough(): ?bool + { + return $this->container['onFurlough']; + } + + /** + * Sets onFurlough + * + * @param bool|null $onFurlough Set to true if the employee is on furlough. + * + * @return $this + */ + public function setOnFurlough(?bool $onFurlough): static + { + if (is_null($onFurlough)) { + throw new InvalidArgumentException('non-nullable onFurlough cannot be null'); + } + $this->container['onFurlough'] = $onFurlough; + + return $this; + } + + /** + * Gets furloughStart + * + * @return \DateTime|null + */ + public function getFurloughStart(): ?\DateTime + { + return $this->container['furloughStart']; + } + + /** + * Sets furloughStart + * + * @param \DateTime|null $furloughStart Furlough Start Date. + * + * @return $this + */ + public function setFurloughStart(?\DateTime $furloughStart): static + { + if (is_null($furloughStart)) { + array_push($this->openAPINullablesSetToNull, 'furloughStart'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughStart', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughStart'] = $furloughStart; + + return $this; + } + + /** + * Gets furloughEnd + * + * @return \DateTime|null + */ + public function getFurloughEnd(): ?\DateTime + { + return $this->container['furloughEnd']; + } + + /** + * Sets furloughEnd + * + * @param \DateTime|null $furloughEnd Furlough End Date. + * + * @return $this + */ + public function setFurloughEnd(?\DateTime $furloughEnd): static + { + if (is_null($furloughEnd)) { + array_push($this->openAPINullablesSetToNull, 'furloughEnd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughEnd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughEnd'] = $furloughEnd; + + return $this; + } + + /** + * Gets furloughCalculationBasis + * + * @return \SynergiTech\Staffology\Model\FurloughCalculationBasis|null + */ + public function getFurloughCalculationBasis(): ?\SynergiTech\Staffology\Model\FurloughCalculationBasis + { + return $this->container['furloughCalculationBasis']; + } + + /** + * Sets furloughCalculationBasis + * + * @param \SynergiTech\Staffology\Model\FurloughCalculationBasis|null $furloughCalculationBasis furloughCalculationBasis + * + * @return $this + */ + public function setFurloughCalculationBasis(?\SynergiTech\Staffology\Model\FurloughCalculationBasis $furloughCalculationBasis): static + { + if (is_null($furloughCalculationBasis)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasis cannot be null'); + } + $this->container['furloughCalculationBasis'] = $furloughCalculationBasis; + + return $this; + } + + /** + * Gets furloughCalculationBasisAmount + * + * @return float|null + */ + public function getFurloughCalculationBasisAmount(): ?float + { + return $this->container['furloughCalculationBasisAmount']; + } + + /** + * Sets furloughCalculationBasisAmount + * + * @param float|null $furloughCalculationBasisAmount furloughCalculationBasisAmount + * + * @return $this + */ + public function setFurloughCalculationBasisAmount(?float $furloughCalculationBasisAmount): static + { + if (is_null($furloughCalculationBasisAmount)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasisAmount cannot be null'); + } + $this->container['furloughCalculationBasisAmount'] = $furloughCalculationBasisAmount; + + return $this; + } + + /** + * Gets partialFurlough + * + * @return bool|null + */ + public function getPartialFurlough(): ?bool + { + return $this->container['partialFurlough']; + } + + /** + * Sets partialFurlough + * + * @param bool|null $partialFurlough Set to true if the employee is partially furloughed. + * + * @return $this + */ + public function setPartialFurlough(?bool $partialFurlough): static + { + if (is_null($partialFurlough)) { + throw new InvalidArgumentException('non-nullable partialFurlough cannot be null'); + } + $this->container['partialFurlough'] = $partialFurlough; + + return $this; + } + + /** + * Gets furloughHoursNormallyWorked + * + * @return float|null + */ + public function getFurloughHoursNormallyWorked(): ?float + { + return $this->container['furloughHoursNormallyWorked']; + } + + /** + * Sets furloughHoursNormallyWorked + * + * @param float|null $furloughHoursNormallyWorked furloughHoursNormallyWorked + * + * @return $this + */ + public function setFurloughHoursNormallyWorked(?float $furloughHoursNormallyWorked): static + { + if (is_null($furloughHoursNormallyWorked)) { + throw new InvalidArgumentException('non-nullable furloughHoursNormallyWorked cannot be null'); + } + $this->container['furloughHoursNormallyWorked'] = $furloughHoursNormallyWorked; + + return $this; + } + + /** + * Gets furloughHoursOnFurlough + * + * @return float|null + */ + public function getFurloughHoursOnFurlough(): ?float + { + return $this->container['furloughHoursOnFurlough']; + } + + /** + * Sets furloughHoursOnFurlough + * + * @param float|null $furloughHoursOnFurlough furloughHoursOnFurlough + * + * @return $this + */ + public function setFurloughHoursOnFurlough(?float $furloughHoursOnFurlough): static + { + if (is_null($furloughHoursOnFurlough)) { + throw new InvalidArgumentException('non-nullable furloughHoursOnFurlough cannot be null'); + } + $this->container['furloughHoursOnFurlough'] = $furloughHoursOnFurlough; + + return $this; + } + + /** + * Gets isApprentice + * + * @return bool|null + */ + public function getIsApprentice(): ?bool + { + return $this->container['isApprentice']; + } + + /** + * Sets isApprentice + * + * @param bool|null $isApprentice Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage + * + * @return $this + */ + public function setIsApprentice(?bool $isApprentice): static + { + if (is_null($isApprentice)) { + throw new InvalidArgumentException('non-nullable isApprentice cannot be null'); + } + $this->container['isApprentice'] = $isApprentice; + + return $this; + } + + /** + * Gets apprenticeshipStartDate + * + * @return \DateTime|null + */ + public function getApprenticeshipStartDate(): ?\DateTime + { + return $this->container['apprenticeshipStartDate']; + } + + /** + * Sets apprenticeshipStartDate + * + * @param \DateTime|null $apprenticeshipStartDate apprenticeshipStartDate + * + * @return $this + */ + public function setApprenticeshipStartDate(?\DateTime $apprenticeshipStartDate): static + { + if (is_null($apprenticeshipStartDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipStartDate'] = $apprenticeshipStartDate; + + return $this; + } + + /** + * Gets apprenticeshipEndDate + * + * @return \DateTime|null + */ + public function getApprenticeshipEndDate(): ?\DateTime + { + return $this->container['apprenticeshipEndDate']; + } + + /** + * Sets apprenticeshipEndDate + * + * @param \DateTime|null $apprenticeshipEndDate apprenticeshipEndDate + * + * @return $this + */ + public function setApprenticeshipEndDate(?\DateTime $apprenticeshipEndDate): static + { + if (is_null($apprenticeshipEndDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipEndDate'] = $apprenticeshipEndDate; + + return $this; + } + + /** + * Gets workingPattern + * + * @return string|null + */ + public function getWorkingPattern(): ?string + { + return $this->container['workingPattern']; + } + + /** + * Sets workingPattern + * + * @param string|null $workingPattern Used when calculating payments for Leave. If null then the default Working Pattern is used + * + * @return $this + */ + public function setWorkingPattern(?string $workingPattern): static + { + if (is_null($workingPattern)) { + array_push($this->openAPINullablesSetToNull, 'workingPattern'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workingPattern', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workingPattern'] = $workingPattern; + + return $this; + } + + /** + * Gets forcePreviousPayrollCode + * + * @return string|null + */ + public function getForcePreviousPayrollCode(): ?string + { + return $this->container['forcePreviousPayrollCode']; + } + + /** + * Sets forcePreviousPayrollCode + * + * @param string|null $forcePreviousPayrollCode If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. + * + * @return $this + */ + public function setForcePreviousPayrollCode(?string $forcePreviousPayrollCode): static + { + if (is_null($forcePreviousPayrollCode)) { + array_push($this->openAPINullablesSetToNull, 'forcePreviousPayrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcePreviousPayrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($forcePreviousPayrollCode) && (mb_strlen($forcePreviousPayrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $forcePreviousPayrollCode when calling ContractEmploymentDetailsRequest., must be smaller than or equal to 35.'); + } + + $this->container['forcePreviousPayrollCode'] = $forcePreviousPayrollCode; + + return $this; + } + + /** + * Gets starterDetails + * + * @return \SynergiTech\Staffology\Model\ContractStarterDetails|null + */ + public function getStarterDetails(): ?\SynergiTech\Staffology\Model\ContractStarterDetails + { + return $this->container['starterDetails']; + } + + /** + * Sets starterDetails + * + * @param \SynergiTech\Staffology\Model\ContractStarterDetails|null $starterDetails starterDetails + * + * @return $this + */ + public function setStarterDetails(?\SynergiTech\Staffology\Model\ContractStarterDetails $starterDetails): static + { + if (is_null($starterDetails)) { + throw new InvalidArgumentException('non-nullable starterDetails cannot be null'); + } + $this->container['starterDetails'] = $starterDetails; + + return $this; + } + + /** + * Gets directorshipDetails + * + * @return \SynergiTech\Staffology\Model\ContractDirectorshipDetails|null + */ + public function getDirectorshipDetails(): ?\SynergiTech\Staffology\Model\ContractDirectorshipDetails + { + return $this->container['directorshipDetails']; + } + + /** + * Sets directorshipDetails + * + * @param \SynergiTech\Staffology\Model\ContractDirectorshipDetails|null $directorshipDetails directorshipDetails + * + * @return $this + */ + public function setDirectorshipDetails(?\SynergiTech\Staffology\Model\ContractDirectorshipDetails $directorshipDetails): static + { + if (is_null($directorshipDetails)) { + throw new InvalidArgumentException('non-nullable directorshipDetails cannot be null'); + } + $this->container['directorshipDetails'] = $directorshipDetails; + + return $this; + } + + /** + * Gets leaverDetails + * + * @return \SynergiTech\Staffology\Model\ContractLeaverDetails|null + */ + public function getLeaverDetails(): ?\SynergiTech\Staffology\Model\ContractLeaverDetails + { + return $this->container['leaverDetails']; + } + + /** + * Sets leaverDetails + * + * @param \SynergiTech\Staffology\Model\ContractLeaverDetails|null $leaverDetails leaverDetails + * + * @return $this + */ + public function setLeaverDetails(?\SynergiTech\Staffology\Model\ContractLeaverDetails $leaverDetails): static + { + if (is_null($leaverDetails)) { + throw new InvalidArgumentException('non-nullable leaverDetails cannot be null'); + } + $this->container['leaverDetails'] = $leaverDetails; + + return $this; + } + + /** + * Gets roles + * + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]|null + */ + public function getRoles(): ?array + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]|null $roles List of Roles held by Employee + * + * @return $this + */ + public function setRoles(?array $roles): static + { + if (is_null($roles)) { + array_push($this->openAPINullablesSetToNull, 'roles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets isWorkingInFreePort + * + * @return bool|null + */ + public function getIsWorkingInFreePort(): ?bool + { + return $this->container['isWorkingInFreePort']; + } + + /** + * Sets isWorkingInFreePort + * + * @param bool|null $isWorkingInFreePort Flag indicating the employee is employed in a Freeport + * + * @return $this + */ + public function setIsWorkingInFreePort(?bool $isWorkingInFreePort): static + { + if (is_null($isWorkingInFreePort)) { + throw new InvalidArgumentException('non-nullable isWorkingInFreePort cannot be null'); + } + $this->container['isWorkingInFreePort'] = $isWorkingInFreePort; + + return $this; + } + + /** + * Gets isWorkingInInvestmentZone + * + * @return bool|null + */ + public function getIsWorkingInInvestmentZone(): ?bool + { + return $this->container['isWorkingInInvestmentZone']; + } + + /** + * Sets isWorkingInInvestmentZone + * + * @param bool|null $isWorkingInInvestmentZone Flag indicating the employee is employed in an Investment Zone + * + * @return $this + */ + public function setIsWorkingInInvestmentZone(?bool $isWorkingInInvestmentZone): static + { + if (is_null($isWorkingInInvestmentZone)) { + throw new InvalidArgumentException('non-nullable isWorkingInInvestmentZone cannot be null'); + } + $this->container['isWorkingInInvestmentZone'] = $isWorkingInInvestmentZone; + + return $this; + } + + /** + * Gets veteranDetails + * + * @return \SynergiTech\Staffology\Model\ContractVeteranDetails|null + */ + public function getVeteranDetails(): ?\SynergiTech\Staffology\Model\ContractVeteranDetails + { + return $this->container['veteranDetails']; + } + + /** + * Sets veteranDetails + * + * @param \SynergiTech\Staffology\Model\ContractVeteranDetails|null $veteranDetails veteranDetails + * + * @return $this + */ + public function setVeteranDetails(?\SynergiTech\Staffology\Model\ContractVeteranDetails $veteranDetails): static + { + if (is_null($veteranDetails)) { + throw new InvalidArgumentException('non-nullable veteranDetails cannot be null'); + } + $this->container['veteranDetails'] = $veteranDetails; + + return $this; + } + + /** + * Gets continuousEmploymentDate + * + * @return \DateTime|null + */ + public function getContinuousEmploymentDate(): ?\DateTime + { + return $this->container['continuousEmploymentDate']; + } + + /** + * Sets continuousEmploymentDate + * + * @param \DateTime|null $continuousEmploymentDate Date of continuous employment + * + * @return $this + */ + public function setContinuousEmploymentDate(?\DateTime $continuousEmploymentDate): static + { + if (is_null($continuousEmploymentDate)) { + array_push($this->openAPINullablesSetToNull, 'continuousEmploymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('continuousEmploymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['continuousEmploymentDate'] = $continuousEmploymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractEmploymentDetailsResponse.php b/src/Model/ContractEmploymentDetailsResponse.php new file mode 100644 index 0000000..4472a9f --- /dev/null +++ b/src/Model/ContractEmploymentDetailsResponse.php @@ -0,0 +1,1423 @@ + + */ +class ContractEmploymentDetailsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.EmploymentDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'cis' => '\SynergiTech\Staffology\Model\ContractCisDetailsResponse', + 'department' => '\SynergiTech\Staffology\Model\ContractDepartmentResponse', + 'includeSecondedInfoOnStarter' => 'bool', + 'cisSubContractor' => 'bool', + 'payrollCode' => 'string', + 'jobTitle' => 'string', + 'onHold' => 'bool', + 'onFurlough' => 'bool', + 'furloughStart' => '\DateTime', + 'furloughEnd' => '\DateTime', + 'furloughCalculationBasis' => '\SynergiTech\Staffology\Model\FurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'float', + 'partialFurlough' => 'bool', + 'furloughHoursNormallyWorked' => 'float', + 'furloughHoursOnFurlough' => 'float', + 'isApprentice' => 'bool', + 'apprenticeshipStartDate' => '\DateTime', + 'apprenticeshipEndDate' => '\DateTime', + 'workingPattern' => 'string', + 'forcePreviousPayrollCode' => 'string', + 'starterDetails' => '\SynergiTech\Staffology\Model\ContractStarterDetails', + 'directorshipDetails' => '\SynergiTech\Staffology\Model\ContractDirectorshipDetails', + 'leaverDetails' => '\SynergiTech\Staffology\Model\ContractLeaverDetails', + 'roles' => '\SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]', + 'isWorkingInFreePort' => 'bool', + 'isWorkingInInvestmentZone' => 'bool', + 'veteranDetails' => '\SynergiTech\Staffology\Model\ContractVeteranDetails', + 'continuousEmploymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'cis' => null, + 'department' => null, + 'includeSecondedInfoOnStarter' => null, + 'cisSubContractor' => null, + 'payrollCode' => null, + 'jobTitle' => null, + 'onHold' => null, + 'onFurlough' => null, + 'furloughStart' => 'date', + 'furloughEnd' => 'date', + 'furloughCalculationBasis' => null, + 'furloughCalculationBasisAmount' => 'double', + 'partialFurlough' => null, + 'furloughHoursNormallyWorked' => 'double', + 'furloughHoursOnFurlough' => 'double', + 'isApprentice' => null, + 'apprenticeshipStartDate' => 'date', + 'apprenticeshipEndDate' => 'date', + 'workingPattern' => 'uuid', + 'forcePreviousPayrollCode' => null, + 'starterDetails' => null, + 'directorshipDetails' => null, + 'leaverDetails' => null, + 'roles' => null, + 'isWorkingInFreePort' => null, + 'isWorkingInInvestmentZone' => null, + 'veteranDetails' => null, + 'continuousEmploymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'cis' => false, + 'department' => false, + 'includeSecondedInfoOnStarter' => false, + 'cisSubContractor' => false, + 'payrollCode' => false, + 'jobTitle' => true, + 'onHold' => false, + 'onFurlough' => false, + 'furloughStart' => true, + 'furloughEnd' => true, + 'furloughCalculationBasis' => false, + 'furloughCalculationBasisAmount' => false, + 'partialFurlough' => false, + 'furloughHoursNormallyWorked' => false, + 'furloughHoursOnFurlough' => false, + 'isApprentice' => false, + 'apprenticeshipStartDate' => true, + 'apprenticeshipEndDate' => true, + 'workingPattern' => true, + 'forcePreviousPayrollCode' => true, + 'starterDetails' => false, + 'directorshipDetails' => false, + 'leaverDetails' => false, + 'roles' => true, + 'isWorkingInFreePort' => false, + 'isWorkingInInvestmentZone' => false, + 'veteranDetails' => false, + 'continuousEmploymentDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'cis' => 'cis', + 'department' => 'department', + 'includeSecondedInfoOnStarter' => 'includeSecondedInfoOnStarter', + 'cisSubContractor' => 'cisSubContractor', + 'payrollCode' => 'payrollCode', + 'jobTitle' => 'jobTitle', + 'onHold' => 'onHold', + 'onFurlough' => 'onFurlough', + 'furloughStart' => 'furloughStart', + 'furloughEnd' => 'furloughEnd', + 'furloughCalculationBasis' => 'furloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'furloughCalculationBasisAmount', + 'partialFurlough' => 'partialFurlough', + 'furloughHoursNormallyWorked' => 'furloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'furloughHoursOnFurlough', + 'isApprentice' => 'isApprentice', + 'apprenticeshipStartDate' => 'apprenticeshipStartDate', + 'apprenticeshipEndDate' => 'apprenticeshipEndDate', + 'workingPattern' => 'workingPattern', + 'forcePreviousPayrollCode' => 'forcePreviousPayrollCode', + 'starterDetails' => 'starterDetails', + 'directorshipDetails' => 'directorshipDetails', + 'leaverDetails' => 'leaverDetails', + 'roles' => 'roles', + 'isWorkingInFreePort' => 'isWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'isWorkingInInvestmentZone', + 'veteranDetails' => 'veteranDetails', + 'continuousEmploymentDate' => 'continuousEmploymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'cis' => 'setCis', + 'department' => 'setDepartment', + 'includeSecondedInfoOnStarter' => 'setIncludeSecondedInfoOnStarter', + 'cisSubContractor' => 'setCisSubContractor', + 'payrollCode' => 'setPayrollCode', + 'jobTitle' => 'setJobTitle', + 'onHold' => 'setOnHold', + 'onFurlough' => 'setOnFurlough', + 'furloughStart' => 'setFurloughStart', + 'furloughEnd' => 'setFurloughEnd', + 'furloughCalculationBasis' => 'setFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'setFurloughCalculationBasisAmount', + 'partialFurlough' => 'setPartialFurlough', + 'furloughHoursNormallyWorked' => 'setFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'setFurloughHoursOnFurlough', + 'isApprentice' => 'setIsApprentice', + 'apprenticeshipStartDate' => 'setApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'setApprenticeshipEndDate', + 'workingPattern' => 'setWorkingPattern', + 'forcePreviousPayrollCode' => 'setForcePreviousPayrollCode', + 'starterDetails' => 'setStarterDetails', + 'directorshipDetails' => 'setDirectorshipDetails', + 'leaverDetails' => 'setLeaverDetails', + 'roles' => 'setRoles', + 'isWorkingInFreePort' => 'setIsWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'setIsWorkingInInvestmentZone', + 'veteranDetails' => 'setVeteranDetails', + 'continuousEmploymentDate' => 'setContinuousEmploymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'cis' => 'getCis', + 'department' => 'getDepartment', + 'includeSecondedInfoOnStarter' => 'getIncludeSecondedInfoOnStarter', + 'cisSubContractor' => 'getCisSubContractor', + 'payrollCode' => 'getPayrollCode', + 'jobTitle' => 'getJobTitle', + 'onHold' => 'getOnHold', + 'onFurlough' => 'getOnFurlough', + 'furloughStart' => 'getFurloughStart', + 'furloughEnd' => 'getFurloughEnd', + 'furloughCalculationBasis' => 'getFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'getFurloughCalculationBasisAmount', + 'partialFurlough' => 'getPartialFurlough', + 'furloughHoursNormallyWorked' => 'getFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'getFurloughHoursOnFurlough', + 'isApprentice' => 'getIsApprentice', + 'apprenticeshipStartDate' => 'getApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'getApprenticeshipEndDate', + 'workingPattern' => 'getWorkingPattern', + 'forcePreviousPayrollCode' => 'getForcePreviousPayrollCode', + 'starterDetails' => 'getStarterDetails', + 'directorshipDetails' => 'getDirectorshipDetails', + 'leaverDetails' => 'getLeaverDetails', + 'roles' => 'getRoles', + 'isWorkingInFreePort' => 'getIsWorkingInFreePort', + 'isWorkingInInvestmentZone' => 'getIsWorkingInInvestmentZone', + 'veteranDetails' => 'getVeteranDetails', + 'continuousEmploymentDate' => 'getContinuousEmploymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cis', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('includeSecondedInfoOnStarter', $data ?? [], null); + $this->setIfExists('cisSubContractor', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('onHold', $data ?? [], null); + $this->setIfExists('onFurlough', $data ?? [], null); + $this->setIfExists('furloughStart', $data ?? [], null); + $this->setIfExists('furloughEnd', $data ?? [], null); + $this->setIfExists('furloughCalculationBasis', $data ?? [], null); + $this->setIfExists('furloughCalculationBasisAmount', $data ?? [], null); + $this->setIfExists('partialFurlough', $data ?? [], null); + $this->setIfExists('furloughHoursNormallyWorked', $data ?? [], null); + $this->setIfExists('furloughHoursOnFurlough', $data ?? [], null); + $this->setIfExists('isApprentice', $data ?? [], null); + $this->setIfExists('apprenticeshipStartDate', $data ?? [], null); + $this->setIfExists('apprenticeshipEndDate', $data ?? [], null); + $this->setIfExists('workingPattern', $data ?? [], null); + $this->setIfExists('forcePreviousPayrollCode', $data ?? [], null); + $this->setIfExists('starterDetails', $data ?? [], null); + $this->setIfExists('directorshipDetails', $data ?? [], null); + $this->setIfExists('leaverDetails', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('isWorkingInFreePort', $data ?? [], null); + $this->setIfExists('isWorkingInInvestmentZone', $data ?? [], null); + $this->setIfExists('veteranDetails', $data ?? [], null); + $this->setIfExists('continuousEmploymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['payrollCode'] === null) { + $invalidProperties[] = "'payrollCode' can't be null"; + } + if ((mb_strlen($this->container['payrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be smaller than or equal to 35."; + } + + if ((mb_strlen($this->container['payrollCode']) < 1)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['jobTitle']) && (mb_strlen($this->container['jobTitle']) > 120)) { + $invalidProperties[] = "invalid value for 'jobTitle', the character length must be smaller than or equal to 120."; + } + + if (!is_null($this->container['forcePreviousPayrollCode']) && (mb_strlen($this->container['forcePreviousPayrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'forcePreviousPayrollCode', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cis + * + * @return \SynergiTech\Staffology\Model\ContractCisDetailsResponse|null + */ + public function getCis(): ?\SynergiTech\Staffology\Model\ContractCisDetailsResponse + { + return $this->container['cis']; + } + + /** + * Sets cis + * + * @param \SynergiTech\Staffology\Model\ContractCisDetailsResponse|null $cis cis + * + * @return $this + */ + public function setCis(?\SynergiTech\Staffology\Model\ContractCisDetailsResponse $cis): static + { + if (is_null($cis)) { + throw new InvalidArgumentException('non-nullable cis cannot be null'); + } + $this->container['cis'] = $cis; + + return $this; + } + + /** + * Gets department + * + * @return \SynergiTech\Staffology\Model\ContractDepartmentResponse|null + */ + public function getDepartment(): ?\SynergiTech\Staffology\Model\ContractDepartmentResponse + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param \SynergiTech\Staffology\Model\ContractDepartmentResponse|null $department department + * + * @return $this + */ + public function setDepartment(?\SynergiTech\Staffology\Model\ContractDepartmentResponse $department): static + { + if (is_null($department)) { + throw new InvalidArgumentException('non-nullable department cannot be null'); + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets includeSecondedInfoOnStarter + * + * @return bool|null + */ + public function getIncludeSecondedInfoOnStarter(): ?bool + { + return $this->container['includeSecondedInfoOnStarter']; + } + + /** + * Sets includeSecondedInfoOnStarter + * + * @param bool|null $includeSecondedInfoOnStarter includeSecondedInfoOnStarter + * + * @return $this + */ + public function setIncludeSecondedInfoOnStarter(?bool $includeSecondedInfoOnStarter): static + { + if (is_null($includeSecondedInfoOnStarter)) { + throw new InvalidArgumentException('non-nullable includeSecondedInfoOnStarter cannot be null'); + } + $this->container['includeSecondedInfoOnStarter'] = $includeSecondedInfoOnStarter; + + return $this; + } + + /** + * Gets cisSubContractor + * + * @return bool|null + */ + public function getCisSubContractor(): ?bool + { + return $this->container['cisSubContractor']; + } + + /** + * Sets cisSubContractor + * + * @param bool|null $cisSubContractor Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information + * + * @return $this + */ + public function setCisSubContractor(?bool $cisSubContractor): static + { + if (is_null($cisSubContractor)) { + throw new InvalidArgumentException('non-nullable cisSubContractor cannot be null'); + } + $this->container['cisSubContractor'] = $cisSubContractor; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string + */ + public function getPayrollCode(): string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string $payrollCode The Employees Payroll Code. Must be unique within the Employer. + * + * @return $this + */ + public function setPayrollCode(string $payrollCode): static + { + if (is_null($payrollCode)) { + throw new InvalidArgumentException('non-nullable payrollCode cannot be null'); + } + if ((mb_strlen($payrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling ContractEmploymentDetailsResponse., must be smaller than or equal to 35.'); + } + if ((mb_strlen($payrollCode) < 1)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling ContractEmploymentDetailsResponse., must be bigger than or equal to 1.'); + } + + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle Job Title of Primary role of the Employee + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($jobTitle) && (mb_strlen($jobTitle) > 120)) { + throw new InvalidArgumentException('invalid length for $jobTitle when calling ContractEmploymentDetailsResponse., must be smaller than or equal to 120.'); + } + + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets onHold + * + * @return bool|null + */ + public function getOnHold(): ?bool + { + return $this->container['onHold']; + } + + /** + * Sets onHold + * + * @param bool|null $onHold Set to true to temporarily exclude the employee from payruns + * + * @return $this + */ + public function setOnHold(?bool $onHold): static + { + if (is_null($onHold)) { + throw new InvalidArgumentException('non-nullable onHold cannot be null'); + } + $this->container['onHold'] = $onHold; + + return $this; + } + + /** + * Gets onFurlough + * + * @return bool|null + */ + public function getOnFurlough(): ?bool + { + return $this->container['onFurlough']; + } + + /** + * Sets onFurlough + * + * @param bool|null $onFurlough Set to true if the employee is on furlough. + * + * @return $this + */ + public function setOnFurlough(?bool $onFurlough): static + { + if (is_null($onFurlough)) { + throw new InvalidArgumentException('non-nullable onFurlough cannot be null'); + } + $this->container['onFurlough'] = $onFurlough; + + return $this; + } + + /** + * Gets furloughStart + * + * @return \DateTime|null + */ + public function getFurloughStart(): ?\DateTime + { + return $this->container['furloughStart']; + } + + /** + * Sets furloughStart + * + * @param \DateTime|null $furloughStart Furlough Start Date. + * + * @return $this + */ + public function setFurloughStart(?\DateTime $furloughStart): static + { + if (is_null($furloughStart)) { + array_push($this->openAPINullablesSetToNull, 'furloughStart'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughStart', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughStart'] = $furloughStart; + + return $this; + } + + /** + * Gets furloughEnd + * + * @return \DateTime|null + */ + public function getFurloughEnd(): ?\DateTime + { + return $this->container['furloughEnd']; + } + + /** + * Sets furloughEnd + * + * @param \DateTime|null $furloughEnd Furlough End Date. + * + * @return $this + */ + public function setFurloughEnd(?\DateTime $furloughEnd): static + { + if (is_null($furloughEnd)) { + array_push($this->openAPINullablesSetToNull, 'furloughEnd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughEnd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughEnd'] = $furloughEnd; + + return $this; + } + + /** + * Gets furloughCalculationBasis + * + * @return \SynergiTech\Staffology\Model\FurloughCalculationBasis|null + */ + public function getFurloughCalculationBasis(): ?\SynergiTech\Staffology\Model\FurloughCalculationBasis + { + return $this->container['furloughCalculationBasis']; + } + + /** + * Sets furloughCalculationBasis + * + * @param \SynergiTech\Staffology\Model\FurloughCalculationBasis|null $furloughCalculationBasis furloughCalculationBasis + * + * @return $this + */ + public function setFurloughCalculationBasis(?\SynergiTech\Staffology\Model\FurloughCalculationBasis $furloughCalculationBasis): static + { + if (is_null($furloughCalculationBasis)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasis cannot be null'); + } + $this->container['furloughCalculationBasis'] = $furloughCalculationBasis; + + return $this; + } + + /** + * Gets furloughCalculationBasisAmount + * + * @return float|null + */ + public function getFurloughCalculationBasisAmount(): ?float + { + return $this->container['furloughCalculationBasisAmount']; + } + + /** + * Sets furloughCalculationBasisAmount + * + * @param float|null $furloughCalculationBasisAmount furloughCalculationBasisAmount + * + * @return $this + */ + public function setFurloughCalculationBasisAmount(?float $furloughCalculationBasisAmount): static + { + if (is_null($furloughCalculationBasisAmount)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasisAmount cannot be null'); + } + $this->container['furloughCalculationBasisAmount'] = $furloughCalculationBasisAmount; + + return $this; + } + + /** + * Gets partialFurlough + * + * @return bool|null + */ + public function getPartialFurlough(): ?bool + { + return $this->container['partialFurlough']; + } + + /** + * Sets partialFurlough + * + * @param bool|null $partialFurlough Set to true if the employee is partially furloughed. + * + * @return $this + */ + public function setPartialFurlough(?bool $partialFurlough): static + { + if (is_null($partialFurlough)) { + throw new InvalidArgumentException('non-nullable partialFurlough cannot be null'); + } + $this->container['partialFurlough'] = $partialFurlough; + + return $this; + } + + /** + * Gets furloughHoursNormallyWorked + * + * @return float|null + */ + public function getFurloughHoursNormallyWorked(): ?float + { + return $this->container['furloughHoursNormallyWorked']; + } + + /** + * Sets furloughHoursNormallyWorked + * + * @param float|null $furloughHoursNormallyWorked furloughHoursNormallyWorked + * + * @return $this + */ + public function setFurloughHoursNormallyWorked(?float $furloughHoursNormallyWorked): static + { + if (is_null($furloughHoursNormallyWorked)) { + throw new InvalidArgumentException('non-nullable furloughHoursNormallyWorked cannot be null'); + } + $this->container['furloughHoursNormallyWorked'] = $furloughHoursNormallyWorked; + + return $this; + } + + /** + * Gets furloughHoursOnFurlough + * + * @return float|null + */ + public function getFurloughHoursOnFurlough(): ?float + { + return $this->container['furloughHoursOnFurlough']; + } + + /** + * Sets furloughHoursOnFurlough + * + * @param float|null $furloughHoursOnFurlough furloughHoursOnFurlough + * + * @return $this + */ + public function setFurloughHoursOnFurlough(?float $furloughHoursOnFurlough): static + { + if (is_null($furloughHoursOnFurlough)) { + throw new InvalidArgumentException('non-nullable furloughHoursOnFurlough cannot be null'); + } + $this->container['furloughHoursOnFurlough'] = $furloughHoursOnFurlough; + + return $this; + } + + /** + * Gets isApprentice + * + * @return bool|null + */ + public function getIsApprentice(): ?bool + { + return $this->container['isApprentice']; + } + + /** + * Sets isApprentice + * + * @param bool|null $isApprentice Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage + * + * @return $this + */ + public function setIsApprentice(?bool $isApprentice): static + { + if (is_null($isApprentice)) { + throw new InvalidArgumentException('non-nullable isApprentice cannot be null'); + } + $this->container['isApprentice'] = $isApprentice; + + return $this; + } + + /** + * Gets apprenticeshipStartDate + * + * @return \DateTime|null + */ + public function getApprenticeshipStartDate(): ?\DateTime + { + return $this->container['apprenticeshipStartDate']; + } + + /** + * Sets apprenticeshipStartDate + * + * @param \DateTime|null $apprenticeshipStartDate apprenticeshipStartDate + * + * @return $this + */ + public function setApprenticeshipStartDate(?\DateTime $apprenticeshipStartDate): static + { + if (is_null($apprenticeshipStartDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipStartDate'] = $apprenticeshipStartDate; + + return $this; + } + + /** + * Gets apprenticeshipEndDate + * + * @return \DateTime|null + */ + public function getApprenticeshipEndDate(): ?\DateTime + { + return $this->container['apprenticeshipEndDate']; + } + + /** + * Sets apprenticeshipEndDate + * + * @param \DateTime|null $apprenticeshipEndDate apprenticeshipEndDate + * + * @return $this + */ + public function setApprenticeshipEndDate(?\DateTime $apprenticeshipEndDate): static + { + if (is_null($apprenticeshipEndDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipEndDate'] = $apprenticeshipEndDate; + + return $this; + } + + /** + * Gets workingPattern + * + * @return string|null + */ + public function getWorkingPattern(): ?string + { + return $this->container['workingPattern']; + } + + /** + * Sets workingPattern + * + * @param string|null $workingPattern Used when calculating payments for Leave. If null then the default Working Pattern is used + * + * @return $this + */ + public function setWorkingPattern(?string $workingPattern): static + { + if (is_null($workingPattern)) { + array_push($this->openAPINullablesSetToNull, 'workingPattern'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workingPattern', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workingPattern'] = $workingPattern; + + return $this; + } + + /** + * Gets forcePreviousPayrollCode + * + * @return string|null + */ + public function getForcePreviousPayrollCode(): ?string + { + return $this->container['forcePreviousPayrollCode']; + } + + /** + * Sets forcePreviousPayrollCode + * + * @param string|null $forcePreviousPayrollCode If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. + * + * @return $this + */ + public function setForcePreviousPayrollCode(?string $forcePreviousPayrollCode): static + { + if (is_null($forcePreviousPayrollCode)) { + array_push($this->openAPINullablesSetToNull, 'forcePreviousPayrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcePreviousPayrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($forcePreviousPayrollCode) && (mb_strlen($forcePreviousPayrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $forcePreviousPayrollCode when calling ContractEmploymentDetailsResponse., must be smaller than or equal to 35.'); + } + + $this->container['forcePreviousPayrollCode'] = $forcePreviousPayrollCode; + + return $this; + } + + /** + * Gets starterDetails + * + * @return \SynergiTech\Staffology\Model\ContractStarterDetails|null + */ + public function getStarterDetails(): ?\SynergiTech\Staffology\Model\ContractStarterDetails + { + return $this->container['starterDetails']; + } + + /** + * Sets starterDetails + * + * @param \SynergiTech\Staffology\Model\ContractStarterDetails|null $starterDetails starterDetails + * + * @return $this + */ + public function setStarterDetails(?\SynergiTech\Staffology\Model\ContractStarterDetails $starterDetails): static + { + if (is_null($starterDetails)) { + throw new InvalidArgumentException('non-nullable starterDetails cannot be null'); + } + $this->container['starterDetails'] = $starterDetails; + + return $this; + } + + /** + * Gets directorshipDetails + * + * @return \SynergiTech\Staffology\Model\ContractDirectorshipDetails|null + */ + public function getDirectorshipDetails(): ?\SynergiTech\Staffology\Model\ContractDirectorshipDetails + { + return $this->container['directorshipDetails']; + } + + /** + * Sets directorshipDetails + * + * @param \SynergiTech\Staffology\Model\ContractDirectorshipDetails|null $directorshipDetails directorshipDetails + * + * @return $this + */ + public function setDirectorshipDetails(?\SynergiTech\Staffology\Model\ContractDirectorshipDetails $directorshipDetails): static + { + if (is_null($directorshipDetails)) { + throw new InvalidArgumentException('non-nullable directorshipDetails cannot be null'); + } + $this->container['directorshipDetails'] = $directorshipDetails; + + return $this; + } + + /** + * Gets leaverDetails + * + * @return \SynergiTech\Staffology\Model\ContractLeaverDetails|null + */ + public function getLeaverDetails(): ?\SynergiTech\Staffology\Model\ContractLeaverDetails + { + return $this->container['leaverDetails']; + } + + /** + * Sets leaverDetails + * + * @param \SynergiTech\Staffology\Model\ContractLeaverDetails|null $leaverDetails leaverDetails + * + * @return $this + */ + public function setLeaverDetails(?\SynergiTech\Staffology\Model\ContractLeaverDetails $leaverDetails): static + { + if (is_null($leaverDetails)) { + throw new InvalidArgumentException('non-nullable leaverDetails cannot be null'); + } + $this->container['leaverDetails'] = $leaverDetails; + + return $this; + } + + /** + * Gets roles + * + * @return \SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]|null + */ + public function getRoles(): ?array + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param \SynergiTech\Staffology\Model\ContractEmployeeRoleItem[]|null $roles List of Roles held by Employee + * + * @return $this + */ + public function setRoles(?array $roles): static + { + if (is_null($roles)) { + array_push($this->openAPINullablesSetToNull, 'roles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets isWorkingInFreePort + * + * @return bool|null + */ + public function getIsWorkingInFreePort(): ?bool + { + return $this->container['isWorkingInFreePort']; + } + + /** + * Sets isWorkingInFreePort + * + * @param bool|null $isWorkingInFreePort Flag indicating the employee is employed in a Freeport + * + * @return $this + */ + public function setIsWorkingInFreePort(?bool $isWorkingInFreePort): static + { + if (is_null($isWorkingInFreePort)) { + throw new InvalidArgumentException('non-nullable isWorkingInFreePort cannot be null'); + } + $this->container['isWorkingInFreePort'] = $isWorkingInFreePort; + + return $this; + } + + /** + * Gets isWorkingInInvestmentZone + * + * @return bool|null + */ + public function getIsWorkingInInvestmentZone(): ?bool + { + return $this->container['isWorkingInInvestmentZone']; + } + + /** + * Sets isWorkingInInvestmentZone + * + * @param bool|null $isWorkingInInvestmentZone Flag indicating the employee is employed in an Investment Zone + * + * @return $this + */ + public function setIsWorkingInInvestmentZone(?bool $isWorkingInInvestmentZone): static + { + if (is_null($isWorkingInInvestmentZone)) { + throw new InvalidArgumentException('non-nullable isWorkingInInvestmentZone cannot be null'); + } + $this->container['isWorkingInInvestmentZone'] = $isWorkingInInvestmentZone; + + return $this; + } + + /** + * Gets veteranDetails + * + * @return \SynergiTech\Staffology\Model\ContractVeteranDetails|null + */ + public function getVeteranDetails(): ?\SynergiTech\Staffology\Model\ContractVeteranDetails + { + return $this->container['veteranDetails']; + } + + /** + * Sets veteranDetails + * + * @param \SynergiTech\Staffology\Model\ContractVeteranDetails|null $veteranDetails veteranDetails + * + * @return $this + */ + public function setVeteranDetails(?\SynergiTech\Staffology\Model\ContractVeteranDetails $veteranDetails): static + { + if (is_null($veteranDetails)) { + throw new InvalidArgumentException('non-nullable veteranDetails cannot be null'); + } + $this->container['veteranDetails'] = $veteranDetails; + + return $this; + } + + /** + * Gets continuousEmploymentDate + * + * @return \DateTime|null + */ + public function getContinuousEmploymentDate(): ?\DateTime + { + return $this->container['continuousEmploymentDate']; + } + + /** + * Sets continuousEmploymentDate + * + * @param \DateTime|null $continuousEmploymentDate Date of continuous employment + * + * @return $this + */ + public function setContinuousEmploymentDate(?\DateTime $continuousEmploymentDate): static + { + if (is_null($continuousEmploymentDate)) { + array_push($this->openAPINullablesSetToNull, 'continuousEmploymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('continuousEmploymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['continuousEmploymentDate'] = $continuousEmploymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractFpsFields.php b/src/Model/ContractFpsFields.php new file mode 100644 index 0000000..5f66bf5 --- /dev/null +++ b/src/Model/ContractFpsFields.php @@ -0,0 +1,544 @@ + + */ +class ContractFpsFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.FpsFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'offPayrollWorker' => 'bool', + 'irregularPaymentPattern' => 'bool', + 'nonIndividual' => 'bool', + 'excludeFromRtiSubmissions' => 'bool', + 'hoursNormallyWorked' => '\SynergiTech\Staffology\Model\HoursNormallyWorked' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'offPayrollWorker' => null, + 'irregularPaymentPattern' => null, + 'nonIndividual' => null, + 'excludeFromRtiSubmissions' => null, + 'hoursNormallyWorked' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'offPayrollWorker' => false, + 'irregularPaymentPattern' => false, + 'nonIndividual' => false, + 'excludeFromRtiSubmissions' => false, + 'hoursNormallyWorked' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'offPayrollWorker' => 'offPayrollWorker', + 'irregularPaymentPattern' => 'irregularPaymentPattern', + 'nonIndividual' => 'nonIndividual', + 'excludeFromRtiSubmissions' => 'excludeFromRtiSubmissions', + 'hoursNormallyWorked' => 'hoursNormallyWorked' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'offPayrollWorker' => 'setOffPayrollWorker', + 'irregularPaymentPattern' => 'setIrregularPaymentPattern', + 'nonIndividual' => 'setNonIndividual', + 'excludeFromRtiSubmissions' => 'setExcludeFromRtiSubmissions', + 'hoursNormallyWorked' => 'setHoursNormallyWorked' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'offPayrollWorker' => 'getOffPayrollWorker', + 'irregularPaymentPattern' => 'getIrregularPaymentPattern', + 'nonIndividual' => 'getNonIndividual', + 'excludeFromRtiSubmissions' => 'getExcludeFromRtiSubmissions', + 'hoursNormallyWorked' => 'getHoursNormallyWorked' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('offPayrollWorker', $data ?? [], null); + $this->setIfExists('irregularPaymentPattern', $data ?? [], null); + $this->setIfExists('nonIndividual', $data ?? [], null); + $this->setIfExists('excludeFromRtiSubmissions', $data ?? [], null); + $this->setIfExists('hoursNormallyWorked', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offPayrollWorker + * + * @return bool|null + */ + public function getOffPayrollWorker(): ?bool + { + return $this->container['offPayrollWorker']; + } + + /** + * Sets offPayrollWorker + * + * @param bool|null $offPayrollWorker offPayrollWorker + * + * @return $this + */ + public function setOffPayrollWorker(?bool $offPayrollWorker): static + { + if (is_null($offPayrollWorker)) { + throw new InvalidArgumentException('non-nullable offPayrollWorker cannot be null'); + } + $this->container['offPayrollWorker'] = $offPayrollWorker; + + return $this; + } + + /** + * Gets irregularPaymentPattern + * + * @return bool|null + */ + public function getIrregularPaymentPattern(): ?bool + { + return $this->container['irregularPaymentPattern']; + } + + /** + * Sets irregularPaymentPattern + * + * @param bool|null $irregularPaymentPattern True if employee is currently on an irregular payment patter + * + * @return $this + */ + public function setIrregularPaymentPattern(?bool $irregularPaymentPattern): static + { + if (is_null($irregularPaymentPattern)) { + throw new InvalidArgumentException('non-nullable irregularPaymentPattern cannot be null'); + } + $this->container['irregularPaymentPattern'] = $irregularPaymentPattern; + + return $this; + } + + /** + * Gets nonIndividual + * + * @return bool|null + */ + public function getNonIndividual(): ?bool + { + return $this->container['nonIndividual']; + } + + /** + * Sets nonIndividual + * + * @param bool|null $nonIndividual True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative) + * + * @return $this + */ + public function setNonIndividual(?bool $nonIndividual): static + { + if (is_null($nonIndividual)) { + throw new InvalidArgumentException('non-nullable nonIndividual cannot be null'); + } + $this->container['nonIndividual'] = $nonIndividual; + + return $this; + } + + /** + * Gets excludeFromRtiSubmissions + * + * @return bool|null + */ + public function getExcludeFromRtiSubmissions(): ?bool + { + return $this->container['excludeFromRtiSubmissions']; + } + + /** + * Sets excludeFromRtiSubmissions + * + * @param bool|null $excludeFromRtiSubmissions True if Employee is excluded from RTI submissions + * + * @return $this + */ + public function setExcludeFromRtiSubmissions(?bool $excludeFromRtiSubmissions): static + { + if (is_null($excludeFromRtiSubmissions)) { + throw new InvalidArgumentException('non-nullable excludeFromRtiSubmissions cannot be null'); + } + $this->container['excludeFromRtiSubmissions'] = $excludeFromRtiSubmissions; + + return $this; + } + + /** + * Gets hoursNormallyWorked + * + * @return \SynergiTech\Staffology\Model\HoursNormallyWorked|null + */ + public function getHoursNormallyWorked(): ?\SynergiTech\Staffology\Model\HoursNormallyWorked + { + return $this->container['hoursNormallyWorked']; + } + + /** + * Sets hoursNormallyWorked + * + * @param \SynergiTech\Staffology\Model\HoursNormallyWorked|null $hoursNormallyWorked hoursNormallyWorked + * + * @return $this + */ + public function setHoursNormallyWorked(?\SynergiTech\Staffology\Model\HoursNormallyWorked $hoursNormallyWorked): static + { + if (is_null($hoursNormallyWorked)) { + throw new InvalidArgumentException('non-nullable hoursNormallyWorked cannot be null'); + } + $this->container['hoursNormallyWorked'] = $hoursNormallyWorked; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractGrossToNetReportRequest.php b/src/Model/ContractGrossToNetReportRequest.php new file mode 100644 index 0000000..5d8be90 --- /dev/null +++ b/src/Model/ContractGrossToNetReportRequest.php @@ -0,0 +1,680 @@ + + */ +class ContractGrossToNetReportRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.GrossToNetReportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'fromPeriod' => 'int', + 'toPeriod' => 'int', + 'reportFormat' => '\SynergiTech\Staffology\Model\ReportFormat', + 'sortBy' => '\SynergiTech\Staffology\Model\ReportSortBy', + 'sortDescending' => 'bool', + 'ordinal' => 'int', + 'forCis' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payPeriod' => null, + 'taxYear' => null, + 'fromPeriod' => 'int32', + 'toPeriod' => 'int32', + 'reportFormat' => null, + 'sortBy' => null, + 'sortDescending' => null, + 'ordinal' => 'int32', + 'forCis' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payPeriod' => false, + 'taxYear' => false, + 'fromPeriod' => false, + 'toPeriod' => false, + 'reportFormat' => false, + 'sortBy' => false, + 'sortDescending' => false, + 'ordinal' => false, + 'forCis' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payPeriod' => 'payPeriod', + 'taxYear' => 'taxYear', + 'fromPeriod' => 'fromPeriod', + 'toPeriod' => 'toPeriod', + 'reportFormat' => 'reportFormat', + 'sortBy' => 'sortBy', + 'sortDescending' => 'sortDescending', + 'ordinal' => 'ordinal', + 'forCis' => 'forCis' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payPeriod' => 'setPayPeriod', + 'taxYear' => 'setTaxYear', + 'fromPeriod' => 'setFromPeriod', + 'toPeriod' => 'setToPeriod', + 'reportFormat' => 'setReportFormat', + 'sortBy' => 'setSortBy', + 'sortDescending' => 'setSortDescending', + 'ordinal' => 'setOrdinal', + 'forCis' => 'setForCis' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payPeriod' => 'getPayPeriod', + 'taxYear' => 'getTaxYear', + 'fromPeriod' => 'getFromPeriod', + 'toPeriod' => 'getToPeriod', + 'reportFormat' => 'getReportFormat', + 'sortBy' => 'getSortBy', + 'sortDescending' => 'getSortDescending', + 'ordinal' => 'getOrdinal', + 'forCis' => 'getForCis' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('fromPeriod', $data ?? [], null); + $this->setIfExists('toPeriod', $data ?? [], null); + $this->setIfExists('reportFormat', $data ?? [], null); + $this->setIfExists('sortBy', $data ?? [], null); + $this->setIfExists('sortDescending', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('forCis', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets fromPeriod + * + * @return int|null + */ + public function getFromPeriod(): ?int + { + return $this->container['fromPeriod']; + } + + /** + * Sets fromPeriod + * + * @param int|null $fromPeriod The start Tax Month of report data. + * + * @return $this + */ + public function setFromPeriod(?int $fromPeriod): static + { + if (is_null($fromPeriod)) { + throw new InvalidArgumentException('non-nullable fromPeriod cannot be null'); + } + $this->container['fromPeriod'] = $fromPeriod; + + return $this; + } + + /** + * Gets toPeriod + * + * @return int|null + */ + public function getToPeriod(): ?int + { + return $this->container['toPeriod']; + } + + /** + * Sets toPeriod + * + * @param int|null $toPeriod The end Tax Month of report data. + * + * @return $this + */ + public function setToPeriod(?int $toPeriod): static + { + if (is_null($toPeriod)) { + throw new InvalidArgumentException('non-nullable toPeriod cannot be null'); + } + $this->container['toPeriod'] = $toPeriod; + + return $this; + } + + /** + * Gets reportFormat + * + * @return \SynergiTech\Staffology\Model\ReportFormat|null + */ + public function getReportFormat(): ?\SynergiTech\Staffology\Model\ReportFormat + { + return $this->container['reportFormat']; + } + + /** + * Sets reportFormat + * + * @param \SynergiTech\Staffology\Model\ReportFormat|null $reportFormat reportFormat + * + * @return $this + */ + public function setReportFormat(?\SynergiTech\Staffology\Model\ReportFormat $reportFormat): static + { + if (is_null($reportFormat)) { + throw new InvalidArgumentException('non-nullable reportFormat cannot be null'); + } + $this->container['reportFormat'] = $reportFormat; + + return $this; + } + + /** + * Gets sortBy + * + * @return \SynergiTech\Staffology\Model\ReportSortBy|null + */ + public function getSortBy(): ?\SynergiTech\Staffology\Model\ReportSortBy + { + return $this->container['sortBy']; + } + + /** + * Sets sortBy + * + * @param \SynergiTech\Staffology\Model\ReportSortBy|null $sortBy sortBy + * + * @return $this + */ + public function setSortBy(?\SynergiTech\Staffology\Model\ReportSortBy $sortBy): static + { + if (is_null($sortBy)) { + throw new InvalidArgumentException('non-nullable sortBy cannot be null'); + } + $this->container['sortBy'] = $sortBy; + + return $this; + } + + /** + * Gets sortDescending + * + * @return bool|null + */ + public function getSortDescending(): ?bool + { + return $this->container['sortDescending']; + } + + /** + * Sets sortDescending + * + * @param bool|null $sortDescending Defines whether to sort the data in descending order. Defaults to false. + * + * @return $this + */ + public function setSortDescending(?bool $sortDescending): static + { + if (is_null($sortDescending)) { + throw new InvalidArgumentException('non-nullable sortDescending cannot be null'); + } + $this->container['sortDescending'] = $sortDescending; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets forCis + * + * @return bool|null + */ + public function getForCis(): ?bool + { + return $this->container['forCis']; + } + + /** + * Sets forCis + * + * @param bool|null $forCis If true then CIS Subcontractors are reported on. + * + * @return $this + */ + public function setForCis(?bool $forCis): static + { + if (is_null($forCis)) { + throw new InvalidArgumentException('non-nullable forCis cannot be null'); + } + $this->container['forCis'] = $forCis; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractHolidayEntitlementRequest.php b/src/Model/ContractHolidayEntitlementRequest.php new file mode 100644 index 0000000..8a562fa --- /dev/null +++ b/src/Model/ContractHolidayEntitlementRequest.php @@ -0,0 +1,524 @@ + + */ +class ContractHolidayEntitlementRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.HolidayEntitlementRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'effectiveDate' => '\DateTime', + 'baseHolidayEntitlement' => 'float', + 'yearsServiceEntitlementBasis' => '\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => '\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'effectiveDate' => 'date', + 'baseHolidayEntitlement' => 'double', + 'yearsServiceEntitlementBasis' => null, + 'yearsServiceEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'effectiveDate' => true, + 'baseHolidayEntitlement' => false, + 'yearsServiceEntitlementBasis' => false, + 'yearsServiceEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'effectiveDate' => 'effectiveDate', + 'baseHolidayEntitlement' => 'baseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'yearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'yearsServiceEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'effectiveDate' => 'setEffectiveDate', + 'baseHolidayEntitlement' => 'setBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'setYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'setYearsServiceEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'effectiveDate' => 'getEffectiveDate', + 'baseHolidayEntitlement' => 'getBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'getYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'getYearsServiceEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('baseHolidayEntitlement', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlementBasis', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + array_push($this->openAPINullablesSetToNull, 'effectiveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets baseHolidayEntitlement + * + * @return float|null + */ + public function getBaseHolidayEntitlement(): ?float + { + return $this->container['baseHolidayEntitlement']; + } + + /** + * Sets baseHolidayEntitlement + * + * @param float|null $baseHolidayEntitlement PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setBaseHolidayEntitlement(?float $baseHolidayEntitlement): static + { + if (is_null($baseHolidayEntitlement)) { + throw new InvalidArgumentException('non-nullable baseHolidayEntitlement cannot be null'); + } + $this->container['baseHolidayEntitlement'] = $baseHolidayEntitlement; + + return $this; + } + + /** + * Gets yearsServiceEntitlementBasis + * + * @return \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null + */ + public function getYearsServiceEntitlementBasis(): ?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis + { + return $this->container['yearsServiceEntitlementBasis']; + } + + /** + * Sets yearsServiceEntitlementBasis + * + * @param \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null $yearsServiceEntitlementBasis yearsServiceEntitlementBasis + * + * @return $this + */ + public function setYearsServiceEntitlementBasis(?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis $yearsServiceEntitlementBasis): static + { + if (is_null($yearsServiceEntitlementBasis)) { + throw new InvalidArgumentException('non-nullable yearsServiceEntitlementBasis cannot be null'); + } + $this->container['yearsServiceEntitlementBasis'] = $yearsServiceEntitlementBasis; + + return $this; + } + + /** + * Gets yearsServiceEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementRequest[]|null + */ + public function getYearsServiceEntitlements(): ?array + { + return $this->container['yearsServiceEntitlements']; + } + + /** + * Sets yearsServiceEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementRequest[]|null $yearsServiceEntitlements Holiday Entitlement Years Service Entitlements + * + * @return $this + */ + public function setYearsServiceEntitlements(?array $yearsServiceEntitlements): static + { + if (is_null($yearsServiceEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'yearsServiceEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsServiceEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsServiceEntitlements'] = $yearsServiceEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractHolidayEntitlementResponse.php b/src/Model/ContractHolidayEntitlementResponse.php new file mode 100644 index 0000000..b9b8d81 --- /dev/null +++ b/src/Model/ContractHolidayEntitlementResponse.php @@ -0,0 +1,558 @@ + + */ +class ContractHolidayEntitlementResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.HolidayEntitlementResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'effectiveDate' => '\DateTime', + 'baseHolidayEntitlement' => 'float', + 'yearsServiceEntitlementBasis' => '\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => '\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'effectiveDate' => 'date', + 'baseHolidayEntitlement' => 'double', + 'yearsServiceEntitlementBasis' => null, + 'yearsServiceEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'effectiveDate' => true, + 'baseHolidayEntitlement' => false, + 'yearsServiceEntitlementBasis' => false, + 'yearsServiceEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'effectiveDate' => 'effectiveDate', + 'baseHolidayEntitlement' => 'baseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'yearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'yearsServiceEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'effectiveDate' => 'setEffectiveDate', + 'baseHolidayEntitlement' => 'setBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'setYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'setYearsServiceEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'effectiveDate' => 'getEffectiveDate', + 'baseHolidayEntitlement' => 'getBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'getYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'getYearsServiceEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('baseHolidayEntitlement', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlementBasis', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique identifier for the Holiday Entitlement + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + array_push($this->openAPINullablesSetToNull, 'effectiveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets baseHolidayEntitlement + * + * @return float|null + */ + public function getBaseHolidayEntitlement(): ?float + { + return $this->container['baseHolidayEntitlement']; + } + + /** + * Sets baseHolidayEntitlement + * + * @param float|null $baseHolidayEntitlement PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setBaseHolidayEntitlement(?float $baseHolidayEntitlement): static + { + if (is_null($baseHolidayEntitlement)) { + throw new InvalidArgumentException('non-nullable baseHolidayEntitlement cannot be null'); + } + $this->container['baseHolidayEntitlement'] = $baseHolidayEntitlement; + + return $this; + } + + /** + * Gets yearsServiceEntitlementBasis + * + * @return \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null + */ + public function getYearsServiceEntitlementBasis(): ?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis + { + return $this->container['yearsServiceEntitlementBasis']; + } + + /** + * Sets yearsServiceEntitlementBasis + * + * @param \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null $yearsServiceEntitlementBasis yearsServiceEntitlementBasis + * + * @return $this + */ + public function setYearsServiceEntitlementBasis(?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis $yearsServiceEntitlementBasis): static + { + if (is_null($yearsServiceEntitlementBasis)) { + throw new InvalidArgumentException('non-nullable yearsServiceEntitlementBasis cannot be null'); + } + $this->container['yearsServiceEntitlementBasis'] = $yearsServiceEntitlementBasis; + + return $this; + } + + /** + * Gets yearsServiceEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementResponse[]|null + */ + public function getYearsServiceEntitlements(): ?array + { + return $this->container['yearsServiceEntitlements']; + } + + /** + * Sets yearsServiceEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementResponse[]|null $yearsServiceEntitlements Holiday Entitlement Years Service Entitlements + * + * @return $this + */ + public function setYearsServiceEntitlements(?array $yearsServiceEntitlements): static + { + if (is_null($yearsServiceEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'yearsServiceEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsServiceEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsServiceEntitlements'] = $yearsServiceEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractHolidayEntitlementUpdateRequest.php b/src/Model/ContractHolidayEntitlementUpdateRequest.php new file mode 100644 index 0000000..66fa262 --- /dev/null +++ b/src/Model/ContractHolidayEntitlementUpdateRequest.php @@ -0,0 +1,558 @@ + + */ +class ContractHolidayEntitlementUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.HolidayEntitlementUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'effectiveDate' => '\DateTime', + 'baseHolidayEntitlement' => 'float', + 'yearsServiceEntitlementBasis' => '\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => '\SynergiTech\Staffology\Model\ContractYearsServiceEntitlementUpdateRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'effectiveDate' => 'date', + 'baseHolidayEntitlement' => 'double', + 'yearsServiceEntitlementBasis' => null, + 'yearsServiceEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'effectiveDate' => true, + 'baseHolidayEntitlement' => false, + 'yearsServiceEntitlementBasis' => false, + 'yearsServiceEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'effectiveDate' => 'effectiveDate', + 'baseHolidayEntitlement' => 'baseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'yearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'yearsServiceEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'effectiveDate' => 'setEffectiveDate', + 'baseHolidayEntitlement' => 'setBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'setYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'setYearsServiceEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'effectiveDate' => 'getEffectiveDate', + 'baseHolidayEntitlement' => 'getBaseHolidayEntitlement', + 'yearsServiceEntitlementBasis' => 'getYearsServiceEntitlementBasis', + 'yearsServiceEntitlements' => 'getYearsServiceEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('baseHolidayEntitlement', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlementBasis', $data ?? [], null); + $this->setIfExists('yearsServiceEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique identifier for the PaySpine Holiday Entitlement. + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate PaySpine Holiday Entitlement Effective Date If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + array_push($this->openAPINullablesSetToNull, 'effectiveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets baseHolidayEntitlement + * + * @return float|null + */ + public function getBaseHolidayEntitlement(): ?float + { + return $this->container['baseHolidayEntitlement']; + } + + /** + * Sets baseHolidayEntitlement + * + * @param float|null $baseHolidayEntitlement PaySpine Base Holiday Entitlement If UseSpineHolidayRules is true then this field is required + * + * @return $this + */ + public function setBaseHolidayEntitlement(?float $baseHolidayEntitlement): static + { + if (is_null($baseHolidayEntitlement)) { + throw new InvalidArgumentException('non-nullable baseHolidayEntitlement cannot be null'); + } + $this->container['baseHolidayEntitlement'] = $baseHolidayEntitlement; + + return $this; + } + + /** + * Gets yearsServiceEntitlementBasis + * + * @return \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null + */ + public function getYearsServiceEntitlementBasis(): ?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis + { + return $this->container['yearsServiceEntitlementBasis']; + } + + /** + * Sets yearsServiceEntitlementBasis + * + * @param \SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis|null $yearsServiceEntitlementBasis yearsServiceEntitlementBasis + * + * @return $this + */ + public function setYearsServiceEntitlementBasis(?\SynergiTech\Staffology\Model\PaySpineYearsServiceEntitlementBasis $yearsServiceEntitlementBasis): static + { + if (is_null($yearsServiceEntitlementBasis)) { + throw new InvalidArgumentException('non-nullable yearsServiceEntitlementBasis cannot be null'); + } + $this->container['yearsServiceEntitlementBasis'] = $yearsServiceEntitlementBasis; + + return $this; + } + + /** + * Gets yearsServiceEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementUpdateRequest[]|null + */ + public function getYearsServiceEntitlements(): ?array + { + return $this->container['yearsServiceEntitlements']; + } + + /** + * Sets yearsServiceEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractYearsServiceEntitlementUpdateRequest[]|null $yearsServiceEntitlements Holiday Entitlement Years Service Entitlements + * + * @return $this + */ + public function setYearsServiceEntitlements(?array $yearsServiceEntitlements): static + { + if (is_null($yearsServiceEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'yearsServiceEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsServiceEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsServiceEntitlements'] = $yearsServiceEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractHolidaySchemeRequest.php b/src/Model/ContractHolidaySchemeRequest.php new file mode 100644 index 0000000..1946d4e --- /dev/null +++ b/src/Model/ContractHolidaySchemeRequest.php @@ -0,0 +1,740 @@ + + */ +class ContractHolidaySchemeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.HolidaySchemeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'averageCalculationWeeks' => 'int', + 'useOnlyPaidWeeks' => 'bool', + 'ignoreSxp' => 'bool', + 'calculationDurationUnit' => '\SynergiTech\Staffology\Model\HolidaySchemeDurationType', + 'useNiPay' => 'bool', + 'useWorkingPattern' => 'bool', + 'payCodeSetForPayId' => 'string', + 'payCodeSetForHoursId' => 'string', + 'useFallbackRate' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'averageCalculationWeeks' => 'int32', + 'useOnlyPaidWeeks' => null, + 'ignoreSxp' => null, + 'calculationDurationUnit' => null, + 'useNiPay' => null, + 'useWorkingPattern' => null, + 'payCodeSetForPayId' => 'uuid', + 'payCodeSetForHoursId' => 'uuid', + 'useFallbackRate' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'averageCalculationWeeks' => false, + 'useOnlyPaidWeeks' => false, + 'ignoreSxp' => false, + 'calculationDurationUnit' => false, + 'useNiPay' => false, + 'useWorkingPattern' => false, + 'payCodeSetForPayId' => true, + 'payCodeSetForHoursId' => true, + 'useFallbackRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'averageCalculationWeeks' => 'averageCalculationWeeks', + 'useOnlyPaidWeeks' => 'useOnlyPaidWeeks', + 'ignoreSxp' => 'ignoreSxp', + 'calculationDurationUnit' => 'calculationDurationUnit', + 'useNiPay' => 'useNiPay', + 'useWorkingPattern' => 'useWorkingPattern', + 'payCodeSetForPayId' => 'payCodeSetForPayId', + 'payCodeSetForHoursId' => 'payCodeSetForHoursId', + 'useFallbackRate' => 'useFallbackRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'averageCalculationWeeks' => 'setAverageCalculationWeeks', + 'useOnlyPaidWeeks' => 'setUseOnlyPaidWeeks', + 'ignoreSxp' => 'setIgnoreSxp', + 'calculationDurationUnit' => 'setCalculationDurationUnit', + 'useNiPay' => 'setUseNiPay', + 'useWorkingPattern' => 'setUseWorkingPattern', + 'payCodeSetForPayId' => 'setPayCodeSetForPayId', + 'payCodeSetForHoursId' => 'setPayCodeSetForHoursId', + 'useFallbackRate' => 'setUseFallbackRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'averageCalculationWeeks' => 'getAverageCalculationWeeks', + 'useOnlyPaidWeeks' => 'getUseOnlyPaidWeeks', + 'ignoreSxp' => 'getIgnoreSxp', + 'calculationDurationUnit' => 'getCalculationDurationUnit', + 'useNiPay' => 'getUseNiPay', + 'useWorkingPattern' => 'getUseWorkingPattern', + 'payCodeSetForPayId' => 'getPayCodeSetForPayId', + 'payCodeSetForHoursId' => 'getPayCodeSetForHoursId', + 'useFallbackRate' => 'getUseFallbackRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('averageCalculationWeeks', $data ?? [], null); + $this->setIfExists('useOnlyPaidWeeks', $data ?? [], null); + $this->setIfExists('ignoreSxp', $data ?? [], null); + $this->setIfExists('calculationDurationUnit', $data ?? [], null); + $this->setIfExists('useNiPay', $data ?? [], null); + $this->setIfExists('useWorkingPattern', $data ?? [], null); + $this->setIfExists('payCodeSetForPayId', $data ?? [], null); + $this->setIfExists('payCodeSetForHoursId', $data ?? [], null); + $this->setIfExists('useFallbackRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Holiday scheme name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling ContractHolidaySchemeRequest., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets averageCalculationWeeks + * + * @return int|null + */ + public function getAverageCalculationWeeks(): ?int + { + return $this->container['averageCalculationWeeks']; + } + + /** + * Sets averageCalculationWeeks + * + * @param int|null $averageCalculationWeeks The number of weeks that the average holiday pay calculation is to be calculated over (Default 52) + * + * @return $this + */ + public function setAverageCalculationWeeks(?int $averageCalculationWeeks): static + { + if (is_null($averageCalculationWeeks)) { + throw new InvalidArgumentException('non-nullable averageCalculationWeeks cannot be null'); + } + $this->container['averageCalculationWeeks'] = $averageCalculationWeeks; + + return $this; + } + + /** + * Gets useOnlyPaidWeeks + * + * @return bool|null + */ + public function getUseOnlyPaidWeeks(): ?bool + { + return $this->container['useOnlyPaidWeeks']; + } + + /** + * Sets useOnlyPaidWeeks + * + * @param bool|null $useOnlyPaidWeeks If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True) + * + * @return $this + */ + public function setUseOnlyPaidWeeks(?bool $useOnlyPaidWeeks): static + { + if (is_null($useOnlyPaidWeeks)) { + throw new InvalidArgumentException('non-nullable useOnlyPaidWeeks cannot be null'); + } + $this->container['useOnlyPaidWeeks'] = $useOnlyPaidWeeks; + + return $this; + } + + /** + * Gets ignoreSxp + * + * @return bool|null + */ + public function getIgnoreSxp(): ?bool + { + return $this->container['ignoreSxp']; + } + + /** + * Sets ignoreSxp + * + * @param bool|null $ignoreSxp Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True). + * + * @return $this + */ + public function setIgnoreSxp(?bool $ignoreSxp): static + { + if (is_null($ignoreSxp)) { + throw new InvalidArgumentException('non-nullable ignoreSxp cannot be null'); + } + $this->container['ignoreSxp'] = $ignoreSxp; + + return $this; + } + + /** + * Gets calculationDurationUnit + * + * @return \SynergiTech\Staffology\Model\HolidaySchemeDurationType|null + */ + public function getCalculationDurationUnit(): ?\SynergiTech\Staffology\Model\HolidaySchemeDurationType + { + return $this->container['calculationDurationUnit']; + } + + /** + * Sets calculationDurationUnit + * + * @param \SynergiTech\Staffology\Model\HolidaySchemeDurationType|null $calculationDurationUnit calculationDurationUnit + * + * @return $this + */ + public function setCalculationDurationUnit(?\SynergiTech\Staffology\Model\HolidaySchemeDurationType $calculationDurationUnit): static + { + if (is_null($calculationDurationUnit)) { + throw new InvalidArgumentException('non-nullable calculationDurationUnit cannot be null'); + } + $this->container['calculationDurationUnit'] = $calculationDurationUnit; + + return $this; + } + + /** + * Gets useNiPay + * + * @return bool|null + */ + public function getUseNiPay(): ?bool + { + return $this->container['useNiPay']; + } + + /** + * Sets useNiPay + * + * @param bool|null $useNiPay If use National insurance gross taxable pay. (Default - True). + * + * @return $this + */ + public function setUseNiPay(?bool $useNiPay): static + { + if (is_null($useNiPay)) { + throw new InvalidArgumentException('non-nullable useNiPay cannot be null'); + } + $this->container['useNiPay'] = $useNiPay; + + return $this; + } + + /** + * Gets useWorkingPattern + * + * @return bool|null + */ + public function getUseWorkingPattern(): ?bool + { + return $this->container['useWorkingPattern']; + } + + /** + * Sets useWorkingPattern + * + * @param bool|null $useWorkingPattern If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate. + * + * @return $this + */ + public function setUseWorkingPattern(?bool $useWorkingPattern): static + { + if (is_null($useWorkingPattern)) { + throw new InvalidArgumentException('non-nullable useWorkingPattern cannot be null'); + } + $this->container['useWorkingPattern'] = $useWorkingPattern; + + return $this; + } + + /** + * Gets payCodeSetForPayId + * + * @return string|null + */ + public function getPayCodeSetForPayId(): ?string + { + return $this->container['payCodeSetForPayId']; + } + + /** + * Sets payCodeSetForPayId + * + * @param string|null $payCodeSetForPayId the Paycode set that they want to use for the Values to enable the calculation. + * + * @return $this + */ + public function setPayCodeSetForPayId(?string $payCodeSetForPayId): static + { + if (is_null($payCodeSetForPayId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetForPayId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetForPayId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetForPayId'] = $payCodeSetForPayId; + + return $this; + } + + /** + * Gets payCodeSetForHoursId + * + * @return string|null + */ + public function getPayCodeSetForHoursId(): ?string + { + return $this->container['payCodeSetForHoursId']; + } + + /** + * Sets payCodeSetForHoursId + * + * @param string|null $payCodeSetForHoursId the Paycode set that they want to use for the Hours to enable the calculation. + * + * @return $this + */ + public function setPayCodeSetForHoursId(?string $payCodeSetForHoursId): static + { + if (is_null($payCodeSetForHoursId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetForHoursId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetForHoursId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetForHoursId'] = $payCodeSetForHoursId; + + return $this; + } + + /** + * Gets useFallbackRate + * + * @return bool|null + */ + public function getUseFallbackRate(): ?bool + { + return $this->container['useFallbackRate']; + } + + /** + * Sets useFallbackRate + * + * @param bool|null $useFallbackRate Indicates to use employee base hourly rate where the calculated average hourly rate is less + * + * @return $this + */ + public function setUseFallbackRate(?bool $useFallbackRate): static + { + if (is_null($useFallbackRate)) { + throw new InvalidArgumentException('non-nullable useFallbackRate cannot be null'); + } + $this->container['useFallbackRate'] = $useFallbackRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractHolidaySchemeResponse.php b/src/Model/ContractHolidaySchemeResponse.php new file mode 100644 index 0000000..7480d41 --- /dev/null +++ b/src/Model/ContractHolidaySchemeResponse.php @@ -0,0 +1,774 @@ + + */ +class ContractHolidaySchemeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.HolidaySchemeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'averageCalculationWeeks' => 'int', + 'useOnlyPaidWeeks' => 'bool', + 'ignoreSxp' => 'bool', + 'calculationDurationUnit' => '\SynergiTech\Staffology\Model\HolidaySchemeDurationType', + 'useNiPay' => 'bool', + 'useWorkingPattern' => 'bool', + 'payCodeSetForPayId' => 'string', + 'payCodeSetForHoursId' => 'string', + 'useFallbackRate' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'averageCalculationWeeks' => 'int32', + 'useOnlyPaidWeeks' => null, + 'ignoreSxp' => null, + 'calculationDurationUnit' => null, + 'useNiPay' => null, + 'useWorkingPattern' => null, + 'payCodeSetForPayId' => 'uuid', + 'payCodeSetForHoursId' => 'uuid', + 'useFallbackRate' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'averageCalculationWeeks' => false, + 'useOnlyPaidWeeks' => false, + 'ignoreSxp' => false, + 'calculationDurationUnit' => false, + 'useNiPay' => false, + 'useWorkingPattern' => false, + 'payCodeSetForPayId' => true, + 'payCodeSetForHoursId' => true, + 'useFallbackRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'averageCalculationWeeks' => 'averageCalculationWeeks', + 'useOnlyPaidWeeks' => 'useOnlyPaidWeeks', + 'ignoreSxp' => 'ignoreSxp', + 'calculationDurationUnit' => 'calculationDurationUnit', + 'useNiPay' => 'useNiPay', + 'useWorkingPattern' => 'useWorkingPattern', + 'payCodeSetForPayId' => 'payCodeSetForPayId', + 'payCodeSetForHoursId' => 'payCodeSetForHoursId', + 'useFallbackRate' => 'useFallbackRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'averageCalculationWeeks' => 'setAverageCalculationWeeks', + 'useOnlyPaidWeeks' => 'setUseOnlyPaidWeeks', + 'ignoreSxp' => 'setIgnoreSxp', + 'calculationDurationUnit' => 'setCalculationDurationUnit', + 'useNiPay' => 'setUseNiPay', + 'useWorkingPattern' => 'setUseWorkingPattern', + 'payCodeSetForPayId' => 'setPayCodeSetForPayId', + 'payCodeSetForHoursId' => 'setPayCodeSetForHoursId', + 'useFallbackRate' => 'setUseFallbackRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'averageCalculationWeeks' => 'getAverageCalculationWeeks', + 'useOnlyPaidWeeks' => 'getUseOnlyPaidWeeks', + 'ignoreSxp' => 'getIgnoreSxp', + 'calculationDurationUnit' => 'getCalculationDurationUnit', + 'useNiPay' => 'getUseNiPay', + 'useWorkingPattern' => 'getUseWorkingPattern', + 'payCodeSetForPayId' => 'getPayCodeSetForPayId', + 'payCodeSetForHoursId' => 'getPayCodeSetForHoursId', + 'useFallbackRate' => 'getUseFallbackRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('averageCalculationWeeks', $data ?? [], null); + $this->setIfExists('useOnlyPaidWeeks', $data ?? [], null); + $this->setIfExists('ignoreSxp', $data ?? [], null); + $this->setIfExists('calculationDurationUnit', $data ?? [], null); + $this->setIfExists('useNiPay', $data ?? [], null); + $this->setIfExists('useWorkingPattern', $data ?? [], null); + $this->setIfExists('payCodeSetForPayId', $data ?? [], null); + $this->setIfExists('payCodeSetForHoursId', $data ?? [], null); + $this->setIfExists('useFallbackRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Holiday scheme identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Holiday scheme name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling ContractHolidaySchemeResponse., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets averageCalculationWeeks + * + * @return int|null + */ + public function getAverageCalculationWeeks(): ?int + { + return $this->container['averageCalculationWeeks']; + } + + /** + * Sets averageCalculationWeeks + * + * @param int|null $averageCalculationWeeks The number of weeks that the average holiday pay calculation is to be calculated over (Default 52) + * + * @return $this + */ + public function setAverageCalculationWeeks(?int $averageCalculationWeeks): static + { + if (is_null($averageCalculationWeeks)) { + throw new InvalidArgumentException('non-nullable averageCalculationWeeks cannot be null'); + } + $this->container['averageCalculationWeeks'] = $averageCalculationWeeks; + + return $this; + } + + /** + * Gets useOnlyPaidWeeks + * + * @return bool|null + */ + public function getUseOnlyPaidWeeks(): ?bool + { + return $this->container['useOnlyPaidWeeks']; + } + + /** + * Sets useOnlyPaidWeeks + * + * @param bool|null $useOnlyPaidWeeks If to go back further than the stated no of weeks for calculation if there are weeks where the employee has not been paid. (Default- True) + * + * @return $this + */ + public function setUseOnlyPaidWeeks(?bool $useOnlyPaidWeeks): static + { + if (is_null($useOnlyPaidWeeks)) { + throw new InvalidArgumentException('non-nullable useOnlyPaidWeeks cannot be null'); + } + $this->container['useOnlyPaidWeeks'] = $useOnlyPaidWeeks; + + return $this; + } + + /** + * Gets ignoreSxp + * + * @return bool|null + */ + public function getIgnoreSxp(): ?bool + { + return $this->container['ignoreSxp']; + } + + /** + * Sets ignoreSxp + * + * @param bool|null $ignoreSxp Option to ignore weeks where SXP payments have been paid. The calculation will then go back like above until the stated number of weeks are included in the calculation. (Default -True). + * + * @return $this + */ + public function setIgnoreSxp(?bool $ignoreSxp): static + { + if (is_null($ignoreSxp)) { + throw new InvalidArgumentException('non-nullable ignoreSxp cannot be null'); + } + $this->container['ignoreSxp'] = $ignoreSxp; + + return $this; + } + + /** + * Gets calculationDurationUnit + * + * @return \SynergiTech\Staffology\Model\HolidaySchemeDurationType|null + */ + public function getCalculationDurationUnit(): ?\SynergiTech\Staffology\Model\HolidaySchemeDurationType + { + return $this->container['calculationDurationUnit']; + } + + /** + * Sets calculationDurationUnit + * + * @param \SynergiTech\Staffology\Model\HolidaySchemeDurationType|null $calculationDurationUnit calculationDurationUnit + * + * @return $this + */ + public function setCalculationDurationUnit(?\SynergiTech\Staffology\Model\HolidaySchemeDurationType $calculationDurationUnit): static + { + if (is_null($calculationDurationUnit)) { + throw new InvalidArgumentException('non-nullable calculationDurationUnit cannot be null'); + } + $this->container['calculationDurationUnit'] = $calculationDurationUnit; + + return $this; + } + + /** + * Gets useNiPay + * + * @return bool|null + */ + public function getUseNiPay(): ?bool + { + return $this->container['useNiPay']; + } + + /** + * Sets useNiPay + * + * @param bool|null $useNiPay If use National insurance gross taxable pay. (Default - True). + * + * @return $this + */ + public function setUseNiPay(?bool $useNiPay): static + { + if (is_null($useNiPay)) { + throw new InvalidArgumentException('non-nullable useNiPay cannot be null'); + } + $this->container['useNiPay'] = $useNiPay; + + return $this; + } + + /** + * Gets useWorkingPattern + * + * @return bool|null + */ + public function getUseWorkingPattern(): ?bool + { + return $this->container['useWorkingPattern']; + } + + /** + * Sets useWorkingPattern + * + * @param bool|null $useWorkingPattern If use the weekly hours or days as per their working pattern as the divisor for the average holiday rate. + * + * @return $this + */ + public function setUseWorkingPattern(?bool $useWorkingPattern): static + { + if (is_null($useWorkingPattern)) { + throw new InvalidArgumentException('non-nullable useWorkingPattern cannot be null'); + } + $this->container['useWorkingPattern'] = $useWorkingPattern; + + return $this; + } + + /** + * Gets payCodeSetForPayId + * + * @return string|null + */ + public function getPayCodeSetForPayId(): ?string + { + return $this->container['payCodeSetForPayId']; + } + + /** + * Sets payCodeSetForPayId + * + * @param string|null $payCodeSetForPayId the Paycode set that they want to use for the Values to enable the calculation. + * + * @return $this + */ + public function setPayCodeSetForPayId(?string $payCodeSetForPayId): static + { + if (is_null($payCodeSetForPayId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetForPayId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetForPayId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetForPayId'] = $payCodeSetForPayId; + + return $this; + } + + /** + * Gets payCodeSetForHoursId + * + * @return string|null + */ + public function getPayCodeSetForHoursId(): ?string + { + return $this->container['payCodeSetForHoursId']; + } + + /** + * Sets payCodeSetForHoursId + * + * @param string|null $payCodeSetForHoursId the Paycode set that they want to use for the Hours to enable the calculation. + * + * @return $this + */ + public function setPayCodeSetForHoursId(?string $payCodeSetForHoursId): static + { + if (is_null($payCodeSetForHoursId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetForHoursId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetForHoursId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetForHoursId'] = $payCodeSetForHoursId; + + return $this; + } + + /** + * Gets useFallbackRate + * + * @return bool|null + */ + public function getUseFallbackRate(): ?bool + { + return $this->container['useFallbackRate']; + } + + /** + * Sets useFallbackRate + * + * @param bool|null $useFallbackRate Indicates to use employee base hourly rate where the calculated average hourly rate is less + * + * @return $this + */ + public function setUseFallbackRate(?bool $useFallbackRate): static + { + if (is_null($useFallbackRate)) { + throw new InvalidArgumentException('non-nullable useFallbackRate cannot be null'); + } + $this->container['useFallbackRate'] = $useFallbackRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJobErrorResponse.php b/src/Model/ContractJobErrorResponse.php new file mode 100644 index 0000000..726c46b --- /dev/null +++ b/src/Model/ContractJobErrorResponse.php @@ -0,0 +1,558 @@ + + */ +class ContractJobErrorResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JobErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'jobId' => 'string', + 'errorMessage' => 'string', + 'errorType' => 'string', + 'createdDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'jobId' => 'uuid', + 'errorMessage' => null, + 'errorType' => null, + 'createdDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'jobId' => false, + 'errorMessage' => true, + 'errorType' => true, + 'createdDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'jobId' => 'jobId', + 'errorMessage' => 'errorMessage', + 'errorType' => 'errorType', + 'createdDate' => 'createdDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'jobId' => 'setJobId', + 'errorMessage' => 'setErrorMessage', + 'errorType' => 'setErrorType', + 'createdDate' => 'setCreatedDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'jobId' => 'getJobId', + 'errorMessage' => 'getErrorMessage', + 'errorType' => 'getErrorType', + 'createdDate' => 'getCreatedDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('jobId', $data ?? [], null); + $this->setIfExists('errorMessage', $data ?? [], null); + $this->setIfExists('errorType', $data ?? [], null); + $this->setIfExists('createdDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the job error. + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets jobId + * + * @return string|null + */ + public function getJobId(): ?string + { + return $this->container['jobId']; + } + + /** + * Sets jobId + * + * @param string|null $jobId Job public Id + * + * @return $this + */ + public function setJobId(?string $jobId): static + { + if (is_null($jobId)) { + throw new InvalidArgumentException('non-nullable jobId cannot be null'); + } + $this->container['jobId'] = $jobId; + + return $this; + } + + /** + * Gets errorMessage + * + * @return string|null + */ + public function getErrorMessage(): ?string + { + return $this->container['errorMessage']; + } + + /** + * Sets errorMessage + * + * @param string|null $errorMessage Error Message + * + * @return $this + */ + public function setErrorMessage(?string $errorMessage): static + { + if (is_null($errorMessage)) { + array_push($this->openAPINullablesSetToNull, 'errorMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errorMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errorMessage'] = $errorMessage; + + return $this; + } + + /** + * Gets errorType + * + * @return string|null + */ + public function getErrorType(): ?string + { + return $this->container['errorType']; + } + + /** + * Sets errorType + * + * @param string|null $errorType Type of job error + * + * @return $this + */ + public function setErrorType(?string $errorType): static + { + if (is_null($errorType)) { + array_push($this->openAPINullablesSetToNull, 'errorType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errorType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errorType'] = $errorType; + + return $this; + } + + /** + * Gets createdDate + * + * @return \DateTime|null + */ + public function getCreatedDate(): ?\DateTime + { + return $this->container['createdDate']; + } + + /** + * Sets createdDate + * + * @param \DateTime|null $createdDate Date the job error was created + * + * @return $this + */ + public function setCreatedDate(?\DateTime $createdDate): static + { + if (is_null($createdDate)) { + throw new InvalidArgumentException('non-nullable createdDate cannot be null'); + } + $this->container['createdDate'] = $createdDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJobResponse.php b/src/Model/ContractJobResponse.php new file mode 100644 index 0000000..58c830b --- /dev/null +++ b/src/Model/ContractJobResponse.php @@ -0,0 +1,906 @@ + + */ +class ContractJobResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JobResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'employerId' => 'string', + 'employerName' => 'string', + 'type' => '\SynergiTech\Staffology\Model\JobType', + 'name' => 'string', + 'outputFormat' => 'string', + 'status' => '\SynergiTech\Staffology\Model\JobStatus', + 'executionStartTime' => '\DateTime', + 'timeInQueue' => 'int', + 'executionTime' => 'int', + 'result' => '\SynergiTech\Staffology\Model\ContractJobResultResponse', + 'createdDate' => '\DateTime', + 'updatedDate' => '\DateTime', + 'requestedByName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'employerId' => 'uuid', + 'employerName' => null, + 'type' => null, + 'name' => null, + 'outputFormat' => null, + 'status' => null, + 'executionStartTime' => 'date', + 'timeInQueue' => 'int32', + 'executionTime' => 'int32', + 'result' => null, + 'createdDate' => 'date', + 'updatedDate' => 'date', + 'requestedByName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employerId' => false, + 'employerName' => true, + 'type' => false, + 'name' => true, + 'outputFormat' => true, + 'status' => false, + 'executionStartTime' => true, + 'timeInQueue' => true, + 'executionTime' => true, + 'result' => false, + 'createdDate' => false, + 'updatedDate' => true, + 'requestedByName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employerId' => 'employerId', + 'employerName' => 'employerName', + 'type' => 'type', + 'name' => 'name', + 'outputFormat' => 'outputFormat', + 'status' => 'status', + 'executionStartTime' => 'executionStartTime', + 'timeInQueue' => 'timeInQueue', + 'executionTime' => 'executionTime', + 'result' => 'result', + 'createdDate' => 'createdDate', + 'updatedDate' => 'updatedDate', + 'requestedByName' => 'requestedByName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employerId' => 'setEmployerId', + 'employerName' => 'setEmployerName', + 'type' => 'setType', + 'name' => 'setName', + 'outputFormat' => 'setOutputFormat', + 'status' => 'setStatus', + 'executionStartTime' => 'setExecutionStartTime', + 'timeInQueue' => 'setTimeInQueue', + 'executionTime' => 'setExecutionTime', + 'result' => 'setResult', + 'createdDate' => 'setCreatedDate', + 'updatedDate' => 'setUpdatedDate', + 'requestedByName' => 'setRequestedByName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employerId' => 'getEmployerId', + 'employerName' => 'getEmployerName', + 'type' => 'getType', + 'name' => 'getName', + 'outputFormat' => 'getOutputFormat', + 'status' => 'getStatus', + 'executionStartTime' => 'getExecutionStartTime', + 'timeInQueue' => 'getTimeInQueue', + 'executionTime' => 'getExecutionTime', + 'result' => 'getResult', + 'createdDate' => 'getCreatedDate', + 'updatedDate' => 'getUpdatedDate', + 'requestedByName' => 'getRequestedByName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employerId', $data ?? [], null); + $this->setIfExists('employerName', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('outputFormat', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('executionStartTime', $data ?? [], null); + $this->setIfExists('timeInQueue', $data ?? [], null); + $this->setIfExists('executionTime', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('createdDate', $data ?? [], null); + $this->setIfExists('updatedDate', $data ?? [], null); + $this->setIfExists('requestedByName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Job public Id. + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employerId + * + * @return string|null + */ + public function getEmployerId(): ?string + { + return $this->container['employerId']; + } + + /** + * Sets employerId + * + * @param string|null $employerId Employer public Id. + * + * @return $this + */ + public function setEmployerId(?string $employerId): static + { + if (is_null($employerId)) { + throw new InvalidArgumentException('non-nullable employerId cannot be null'); + } + $this->container['employerId'] = $employerId; + + return $this; + } + + /** + * Gets employerName + * + * @return string|null + */ + public function getEmployerName(): ?string + { + return $this->container['employerName']; + } + + /** + * Sets employerName + * + * @param string|null $employerName Employer name. + * + * @return $this + */ + public function setEmployerName(?string $employerName): static + { + if (is_null($employerName)) { + array_push($this->openAPINullablesSetToNull, 'employerName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerName'] = $employerName; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\JobType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\JobType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\JobType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\JobType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The Job name, e.g. uploaded file for Import, or report display name for Report + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets outputFormat + * + * @return string|null + */ + public function getOutputFormat(): ?string + { + return $this->container['outputFormat']; + } + + /** + * Sets outputFormat + * + * @param string|null $outputFormat The Job output format, e.g. json/csv/pdf for Report, or something else for other Job types. + * + * @return $this + */ + public function setOutputFormat(?string $outputFormat): static + { + if (is_null($outputFormat)) { + array_push($this->openAPINullablesSetToNull, 'outputFormat'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('outputFormat', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['outputFormat'] = $outputFormat; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\JobStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\JobStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\JobStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\JobStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets executionStartTime + * + * @return \DateTime|null + */ + public function getExecutionStartTime(): ?\DateTime + { + return $this->container['executionStartTime']; + } + + /** + * Sets executionStartTime + * + * @param \DateTime|null $executionStartTime The Job excution start time. + * + * @return $this + */ + public function setExecutionStartTime(?\DateTime $executionStartTime): static + { + if (is_null($executionStartTime)) { + array_push($this->openAPINullablesSetToNull, 'executionStartTime'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('executionStartTime', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['executionStartTime'] = $executionStartTime; + + return $this; + } + + /** + * Gets timeInQueue + * + * @return int|null + */ + public function getTimeInQueue(): ?int + { + return $this->container['timeInQueue']; + } + + /** + * Sets timeInQueue + * + * @param int|null $timeInQueue The time the Job spent in the queue before execution in seconds. + * + * @return $this + */ + public function setTimeInQueue(?int $timeInQueue): static + { + if (is_null($timeInQueue)) { + array_push($this->openAPINullablesSetToNull, 'timeInQueue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('timeInQueue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['timeInQueue'] = $timeInQueue; + + return $this; + } + + /** + * Gets executionTime + * + * @return int|null + */ + public function getExecutionTime(): ?int + { + return $this->container['executionTime']; + } + + /** + * Sets executionTime + * + * @param int|null $executionTime The time it took the Job to execute in seconds. + * + * @return $this + */ + public function setExecutionTime(?int $executionTime): static + { + if (is_null($executionTime)) { + array_push($this->openAPINullablesSetToNull, 'executionTime'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('executionTime', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['executionTime'] = $executionTime; + + return $this; + } + + /** + * Gets result + * + * @return \SynergiTech\Staffology\Model\ContractJobResultResponse|null + */ + public function getResult(): ?\SynergiTech\Staffology\Model\ContractJobResultResponse + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \SynergiTech\Staffology\Model\ContractJobResultResponse|null $result result + * + * @return $this + */ + public function setResult(?\SynergiTech\Staffology\Model\ContractJobResultResponse $result): static + { + if (is_null($result)) { + throw new InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets createdDate + * + * @return \DateTime|null + */ + public function getCreatedDate(): ?\DateTime + { + return $this->container['createdDate']; + } + + /** + * Sets createdDate + * + * @param \DateTime|null $createdDate Job Created date. + * + * @return $this + */ + public function setCreatedDate(?\DateTime $createdDate): static + { + if (is_null($createdDate)) { + throw new InvalidArgumentException('non-nullable createdDate cannot be null'); + } + $this->container['createdDate'] = $createdDate; + + return $this; + } + + /** + * Gets updatedDate + * + * @return \DateTime|null + */ + public function getUpdatedDate(): ?\DateTime + { + return $this->container['updatedDate']; + } + + /** + * Sets updatedDate + * + * @param \DateTime|null $updatedDate Job Updated date where applicable. + * + * @return $this + */ + public function setUpdatedDate(?\DateTime $updatedDate): static + { + if (is_null($updatedDate)) { + array_push($this->openAPINullablesSetToNull, 'updatedDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('updatedDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['updatedDate'] = $updatedDate; + + return $this; + } + + /** + * Gets requestedByName + * + * @return string|null + */ + public function getRequestedByName(): ?string + { + return $this->container['requestedByName']; + } + + /** + * Sets requestedByName + * + * @param string|null $requestedByName The name of the user that requested this job + * + * @return $this + */ + public function setRequestedByName(?string $requestedByName): static + { + if (is_null($requestedByName)) { + array_push($this->openAPINullablesSetToNull, 'requestedByName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('requestedByName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['requestedByName'] = $requestedByName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJobResultFileResponse.php b/src/Model/ContractJobResultFileResponse.php new file mode 100644 index 0000000..d2489c6 --- /dev/null +++ b/src/Model/ContractJobResultFileResponse.php @@ -0,0 +1,456 @@ + + */ +class ContractJobResultFileResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JobResultFileResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fileName' => 'string', + 'uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fileName' => null, + 'uri' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fileName' => true, + 'uri' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fileName' => 'fileName', + 'uri' => 'uri' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fileName' => 'setFileName', + 'uri' => 'setUri' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fileName' => 'getFileName', + 'uri' => 'getUri' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fileName', $data ?? [], null); + $this->setIfExists('uri', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fileName + * + * @return string|null + */ + public function getFileName(): ?string + { + return $this->container['fileName']; + } + + /** + * Sets fileName + * + * @param string|null $fileName Result File name + * + * @return $this + */ + public function setFileName(?string $fileName): static + { + if (is_null($fileName)) { + array_push($this->openAPINullablesSetToNull, 'fileName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fileName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fileName'] = $fileName; + + return $this; + } + + /** + * Gets uri + * + * @return string|null + */ + public function getUri(): ?string + { + return $this->container['uri']; + } + + /** + * Sets uri + * + * @param string|null $uri Api method URI that can be used to download the result file + * + * @return $this + */ + public function setUri(?string $uri): static + { + if (is_null($uri)) { + array_push($this->openAPINullablesSetToNull, 'uri'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('uri', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['uri'] = $uri; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJobResultResponse.php b/src/Model/ContractJobResultResponse.php new file mode 100644 index 0000000..523e83a --- /dev/null +++ b/src/Model/ContractJobResultResponse.php @@ -0,0 +1,490 @@ + + */ +class ContractJobResultResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JobResultResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'file' => '\SynergiTech\Staffology\Model\ContractJobResultFileResponse', + 'metadata' => 'array', + 'errors' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'file' => null, + 'metadata' => null, + 'errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'file' => false, + 'metadata' => true, + 'errors' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'file' => 'file', + 'metadata' => 'metadata', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'file' => 'setFile', + 'metadata' => 'setMetadata', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'file' => 'getFile', + 'metadata' => 'getMetadata', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('file', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets file + * + * @return \SynergiTech\Staffology\Model\ContractJobResultFileResponse|null + */ + public function getFile(): ?\SynergiTech\Staffology\Model\ContractJobResultFileResponse + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param \SynergiTech\Staffology\Model\ContractJobResultFileResponse|null $file file + * + * @return $this + */ + public function setFile(?\SynergiTech\Staffology\Model\ContractJobResultFileResponse $file): static + { + if (is_null($file)) { + throw new InvalidArgumentException('non-nullable file cannot be null'); + } + $this->container['file'] = $file; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata(): ?array + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Job result metadata, e.g. Employee Import stats + * + * @return $this + */ + public function setMetadata(?array $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets errors + * + * @return string[]|null + */ + public function getErrors(): ?array + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param string[]|null $errors Job execution's errors. + * + * @return $this + */ + public function setErrors(?array $errors): static + { + if (is_null($errors)) { + array_push($this->openAPINullablesSetToNull, 'errors'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errors', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJournalTemplateRequest.php b/src/Model/ContractJournalTemplateRequest.php new file mode 100644 index 0000000..8ed79df --- /dev/null +++ b/src/Model/ContractJournalTemplateRequest.php @@ -0,0 +1,490 @@ + + */ +class ContractJournalTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JournalTemplateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'header' => 'string', + 'content' => 'string', + 'useColumnHeaders' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'header' => null, + 'content' => null, + 'useColumnHeaders' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'header' => true, + 'content' => true, + 'useColumnHeaders' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'header' => 'header', + 'content' => 'content', + 'useColumnHeaders' => 'useColumnHeaders' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'header' => 'setHeader', + 'content' => 'setContent', + 'useColumnHeaders' => 'setUseColumnHeaders' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'header' => 'getHeader', + 'content' => 'getContent', + 'useColumnHeaders' => 'getUseColumnHeaders' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('header', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('useColumnHeaders', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets header + * + * @return string|null + */ + public function getHeader(): ?string + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string|null $header Header of Journal Template + * + * @return $this + */ + public function setHeader(?string $header): static + { + if (is_null($header)) { + array_push($this->openAPINullablesSetToNull, 'header'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content Content of Journal Template + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets useColumnHeaders + * + * @return bool|null + */ + public function getUseColumnHeaders(): ?bool + { + return $this->container['useColumnHeaders']; + } + + /** + * Sets useColumnHeaders + * + * @param bool|null $useColumnHeaders Indicates whether content is empty or not + * + * @return $this + */ + public function setUseColumnHeaders(?bool $useColumnHeaders): static + { + if (is_null($useColumnHeaders)) { + throw new InvalidArgumentException('non-nullable useColumnHeaders cannot be null'); + } + $this->container['useColumnHeaders'] = $useColumnHeaders; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJournalTemplateResponse.php b/src/Model/ContractJournalTemplateResponse.php new file mode 100644 index 0000000..ba7f4ef --- /dev/null +++ b/src/Model/ContractJournalTemplateResponse.php @@ -0,0 +1,524 @@ + + */ +class ContractJournalTemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JournalTemplateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'header' => 'string', + 'content' => 'string', + 'useColumnHeaders' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'header' => null, + 'content' => null, + 'useColumnHeaders' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'header' => true, + 'content' => true, + 'useColumnHeaders' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'header' => 'header', + 'content' => 'content', + 'useColumnHeaders' => 'useColumnHeaders' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'header' => 'setHeader', + 'content' => 'setContent', + 'useColumnHeaders' => 'setUseColumnHeaders' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'header' => 'getHeader', + 'content' => 'getContent', + 'useColumnHeaders' => 'getUseColumnHeaders' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('header', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('useColumnHeaders', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Journal Template identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets header + * + * @return string|null + */ + public function getHeader(): ?string + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string|null $header Header of Journal Template + * + * @return $this + */ + public function setHeader(?string $header): static + { + if (is_null($header)) { + array_push($this->openAPINullablesSetToNull, 'header'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content Content of Journal Template + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets useColumnHeaders + * + * @return bool|null + */ + public function getUseColumnHeaders(): ?bool + { + return $this->container['useColumnHeaders']; + } + + /** + * Sets useColumnHeaders + * + * @param bool|null $useColumnHeaders Indicates whether content is empty or not + * + * @return $this + */ + public function setUseColumnHeaders(?bool $useColumnHeaders): static + { + if (is_null($useColumnHeaders)) { + throw new InvalidArgumentException('non-nullable useColumnHeaders cannot be null'); + } + $this->container['useColumnHeaders'] = $useColumnHeaders; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJournalTokenRequest.php b/src/Model/ContractJournalTokenRequest.php new file mode 100644 index 0000000..adc3a52 --- /dev/null +++ b/src/Model/ContractJournalTokenRequest.php @@ -0,0 +1,490 @@ + + */ +class ContractJournalTokenRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JournalTokenRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\JournalTokenType', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'name' => null, + 'description' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'name' => true, + 'description' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\JournalTokenType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\JournalTokenType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\JournalTokenType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\JournalTokenType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of Journal Tokens + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of Journal Tokens + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJournalTokenResponse.php b/src/Model/ContractJournalTokenResponse.php new file mode 100644 index 0000000..37714a5 --- /dev/null +++ b/src/Model/ContractJournalTokenResponse.php @@ -0,0 +1,524 @@ + + */ +class ContractJournalTokenResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JournalTokenResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'type' => '\SynergiTech\Staffology\Model\JournalTokenType', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'type' => null, + 'name' => null, + 'description' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'type' => false, + 'name' => true, + 'description' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'type' => 'type', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'type' => 'setType', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'type' => 'getType', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Journal Token identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\JournalTokenType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\JournalTokenType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\JournalTokenType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\JournalTokenType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of Journal Tokens + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of Journal Tokens + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractJournalTokenResponseItem.php b/src/Model/ContractJournalTokenResponseItem.php new file mode 100644 index 0000000..42c649d --- /dev/null +++ b/src/Model/ContractJournalTokenResponseItem.php @@ -0,0 +1,531 @@ + + */ +class ContractJournalTokenResponseItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.JournalTokenResponseItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLeaveImportRequest.php b/src/Model/ContractLeaveImportRequest.php new file mode 100644 index 0000000..1e27517 --- /dev/null +++ b/src/Model/ContractLeaveImportRequest.php @@ -0,0 +1,858 @@ + + */ +class ContractLeaveImportRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LeaveImportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'type' => '\SynergiTech\Staffology\Model\LeaveType', + 'pay' => '\SynergiTech\Staffology\Model\LeavePayType', + 'openEndedAbsence' => 'bool', + 'from' => '\DateTime', + 'to' => '\DateTime', + 'historicLeaveRequiresProcessing' => 'bool', + 'averageWeeklyEarnings' => 'float', + 'automaticAWECalculation' => 'bool', + 'offsetPay' => 'bool', + 'calculationType' => '\SynergiTech\Staffology\Model\LeaveCalculationType', + 'percentOfPay' => 'float', + 'strikeHoursToDeduct' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'type' => null, + 'pay' => null, + 'openEndedAbsence' => null, + 'from' => 'date', + 'to' => 'date', + 'historicLeaveRequiresProcessing' => null, + 'averageWeeklyEarnings' => 'double', + 'automaticAWECalculation' => null, + 'offsetPay' => null, + 'calculationType' => null, + 'percentOfPay' => 'double', + 'strikeHoursToDeduct' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'type' => false, + 'pay' => false, + 'openEndedAbsence' => false, + 'from' => true, + 'to' => true, + 'historicLeaveRequiresProcessing' => false, + 'averageWeeklyEarnings' => true, + 'automaticAWECalculation' => false, + 'offsetPay' => false, + 'calculationType' => false, + 'percentOfPay' => true, + 'strikeHoursToDeduct' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'type' => 'type', + 'pay' => 'pay', + 'openEndedAbsence' => 'openEndedAbsence', + 'from' => 'from', + 'to' => 'to', + 'historicLeaveRequiresProcessing' => 'historicLeaveRequiresProcessing', + 'averageWeeklyEarnings' => 'averageWeeklyEarnings', + 'automaticAWECalculation' => 'automaticAWECalculation', + 'offsetPay' => 'offsetPay', + 'calculationType' => 'calculationType', + 'percentOfPay' => 'percentOfPay', + 'strikeHoursToDeduct' => 'strikeHoursToDeduct' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'type' => 'setType', + 'pay' => 'setPay', + 'openEndedAbsence' => 'setOpenEndedAbsence', + 'from' => 'setFrom', + 'to' => 'setTo', + 'historicLeaveRequiresProcessing' => 'setHistoricLeaveRequiresProcessing', + 'averageWeeklyEarnings' => 'setAverageWeeklyEarnings', + 'automaticAWECalculation' => 'setAutomaticAWECalculation', + 'offsetPay' => 'setOffsetPay', + 'calculationType' => 'setCalculationType', + 'percentOfPay' => 'setPercentOfPay', + 'strikeHoursToDeduct' => 'setStrikeHoursToDeduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'type' => 'getType', + 'pay' => 'getPay', + 'openEndedAbsence' => 'getOpenEndedAbsence', + 'from' => 'getFrom', + 'to' => 'getTo', + 'historicLeaveRequiresProcessing' => 'getHistoricLeaveRequiresProcessing', + 'averageWeeklyEarnings' => 'getAverageWeeklyEarnings', + 'automaticAWECalculation' => 'getAutomaticAWECalculation', + 'offsetPay' => 'getOffsetPay', + 'calculationType' => 'getCalculationType', + 'percentOfPay' => 'getPercentOfPay', + 'strikeHoursToDeduct' => 'getStrikeHoursToDeduct' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('pay', $data ?? [], null); + $this->setIfExists('openEndedAbsence', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('historicLeaveRequiresProcessing', $data ?? [], null); + $this->setIfExists('averageWeeklyEarnings', $data ?? [], null); + $this->setIfExists('automaticAWECalculation', $data ?? [], null); + $this->setIfExists('offsetPay', $data ?? [], null); + $this->setIfExists('calculationType', $data ?? [], null); + $this->setIfExists('percentOfPay', $data ?? [], null); + $this->setIfExists('strikeHoursToDeduct', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode Payroll Code + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LeaveType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LeaveType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LeaveType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LeaveType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets pay + * + * @return \SynergiTech\Staffology\Model\LeavePayType|null + */ + public function getPay(): ?\SynergiTech\Staffology\Model\LeavePayType + { + return $this->container['pay']; + } + + /** + * Sets pay + * + * @param \SynergiTech\Staffology\Model\LeavePayType|null $pay pay + * + * @return $this + */ + public function setPay(?\SynergiTech\Staffology\Model\LeavePayType $pay): static + { + if (is_null($pay)) { + throw new InvalidArgumentException('non-nullable pay cannot be null'); + } + $this->container['pay'] = $pay; + + return $this; + } + + /** + * Gets openEndedAbsence + * + * @return bool|null + */ + public function getOpenEndedAbsence(): ?bool + { + return $this->container['openEndedAbsence']; + } + + /** + * Sets openEndedAbsence + * + * @param bool|null $openEndedAbsence Open Ended Absence + * + * @return $this + */ + public function setOpenEndedAbsence(?bool $openEndedAbsence): static + { + if (is_null($openEndedAbsence)) { + throw new InvalidArgumentException('non-nullable openEndedAbsence cannot be null'); + } + $this->container['openEndedAbsence'] = $openEndedAbsence; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime|null + */ + public function getFrom(): ?\DateTime + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime|null $from The first day of Leave. + * + * @return $this + */ + public function setFrom(?\DateTime $from): static + { + if (is_null($from)) { + array_push($this->openAPINullablesSetToNull, 'from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \DateTime|null + */ + public function getTo(): ?\DateTime + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \DateTime|null $to The last day of Leave. + * + * @return $this + */ + public function setTo(?\DateTime $to): static + { + if (is_null($to)) { + array_push($this->openAPINullablesSetToNull, 'to'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('to', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets historicLeaveRequiresProcessing + * + * @return bool|null + */ + public function getHistoricLeaveRequiresProcessing(): ?bool + { + return $this->container['historicLeaveRequiresProcessing']; + } + + /** + * Sets historicLeaveRequiresProcessing + * + * @param bool|null $historicLeaveRequiresProcessing Only used during the creation of historical SSP. When creating historical SSP, this will determine whether to pay that leave in the next PayRun. + * + * @return $this + */ + public function setHistoricLeaveRequiresProcessing(?bool $historicLeaveRequiresProcessing): static + { + if (is_null($historicLeaveRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicLeaveRequiresProcessing cannot be null'); + } + $this->container['historicLeaveRequiresProcessing'] = $historicLeaveRequiresProcessing; + + return $this; + } + + /** + * Gets averageWeeklyEarnings + * + * @return float|null + */ + public function getAverageWeeklyEarnings(): ?float + { + return $this->container['averageWeeklyEarnings']; + } + + /** + * Sets averageWeeklyEarnings + * + * @param float|null $averageWeeklyEarnings The employees average weekly earnings. + * + * @return $this + */ + public function setAverageWeeklyEarnings(?float $averageWeeklyEarnings): static + { + if (is_null($averageWeeklyEarnings)) { + array_push($this->openAPINullablesSetToNull, 'averageWeeklyEarnings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('averageWeeklyEarnings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['averageWeeklyEarnings'] = $averageWeeklyEarnings; + + return $this; + } + + /** + * Gets automaticAWECalculation + * + * @return bool|null + */ + public function getAutomaticAWECalculation(): ?bool + { + return $this->container['automaticAWECalculation']; + } + + /** + * Sets automaticAWECalculation + * + * @param bool|null $automaticAWECalculation Automatic Average Weekly Earnings. + * + * @return $this + */ + public function setAutomaticAWECalculation(?bool $automaticAWECalculation): static + { + if (is_null($automaticAWECalculation)) { + throw new InvalidArgumentException('non-nullable automaticAWECalculation cannot be null'); + } + $this->container['automaticAWECalculation'] = $automaticAWECalculation; + + return $this; + } + + /** + * Gets offsetPay + * + * @return bool|null + */ + public function getOffsetPay(): ?bool + { + return $this->container['offsetPay']; + } + + /** + * Sets offsetPay + * + * @param bool|null $offsetPay Top-up pay to usual amongst (offsetting) + * + * @return $this + */ + public function setOffsetPay(?bool $offsetPay): static + { + if (is_null($offsetPay)) { + throw new InvalidArgumentException('non-nullable offsetPay cannot be null'); + } + $this->container['offsetPay'] = $offsetPay; + + return $this; + } + + /** + * Gets calculationType + * + * @return \SynergiTech\Staffology\Model\LeaveCalculationType|null + */ + public function getCalculationType(): ?\SynergiTech\Staffology\Model\LeaveCalculationType + { + return $this->container['calculationType']; + } + + /** + * Sets calculationType + * + * @param \SynergiTech\Staffology\Model\LeaveCalculationType|null $calculationType calculationType + * + * @return $this + */ + public function setCalculationType(?\SynergiTech\Staffology\Model\LeaveCalculationType $calculationType): static + { + if (is_null($calculationType)) { + throw new InvalidArgumentException('non-nullable calculationType cannot be null'); + } + $this->container['calculationType'] = $calculationType; + + return $this; + } + + /** + * Gets percentOfPay + * + * @return float|null + */ + public function getPercentOfPay(): ?float + { + return $this->container['percentOfPay']; + } + + /** + * Sets percentOfPay + * + * @param float|null $percentOfPay Only provided when the leave type is 'Sick' and the payment type is 'Custom'. + * + * @return $this + */ + public function setPercentOfPay(?float $percentOfPay): static + { + if (is_null($percentOfPay)) { + array_push($this->openAPINullablesSetToNull, 'percentOfPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('percentOfPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['percentOfPay'] = $percentOfPay; + + return $this; + } + + /** + * Gets strikeHoursToDeduct + * + * @return float|null + */ + public function getStrikeHoursToDeduct(): ?float + { + return $this->container['strikeHoursToDeduct']; + } + + /** + * Sets strikeHoursToDeduct + * + * @param float|null $strikeHoursToDeduct Only provided when the leave type is 'StrikeAction' and the calculation type is 'SpecifyHours'. + * + * @return $this + */ + public function setStrikeHoursToDeduct(?float $strikeHoursToDeduct): static + { + if (is_null($strikeHoursToDeduct)) { + array_push($this->openAPINullablesSetToNull, 'strikeHoursToDeduct'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('strikeHoursToDeduct', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['strikeHoursToDeduct'] = $strikeHoursToDeduct; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLeaveSettingsRequest.php b/src/Model/ContractLeaveSettingsRequest.php new file mode 100644 index 0000000..ca86b11 --- /dev/null +++ b/src/Model/ContractLeaveSettingsRequest.php @@ -0,0 +1,1515 @@ + + */ +class ContractLeaveSettingsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LeaveSettingsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'useDefaultHolidayType' => 'bool', + 'useDefaultAllowanceResetDate' => 'bool', + 'useDefaultAllowance' => 'bool', + 'useDefaultAccruePaymentInLieu' => 'bool', + 'useDefaultAccruePaymentInLieuRate' => 'bool', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'bool', + 'useDefaultHolidayAccrualBasis' => 'bool', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'bool', + 'useDefaultAccrueHoursPerDay' => 'bool', + 'useDefaultMaximumAccruePeriod' => 'bool', + 'allowanceResetDate' => '\DateTime', + 'allowance' => 'float', + 'adjustment' => 'float', + 'holidayType' => '\SynergiTech\Staffology\Model\HolidayType', + 'accrueSetAmount' => 'bool', + 'accrueHoursPerDay' => 'float', + 'showAllowanceOnPayslip' => 'bool', + 'showAhpOnPayslip' => 'bool', + 'accruePaymentInLieuRate' => 'float', + 'accruePaymentInLieuAllGrossPay' => 'bool', + 'accruePaymentInLieuPayAutomatically' => 'bool', + 'occupationalSicknessUniqueId' => 'string', + 'accruedPaymentAdjustment' => 'float', + 'accruedHoursAdjustment' => 'float', + 'holidayAccrualBasis' => '\SynergiTech\Staffology\Model\HolidayAccrual', + 'holidayAccrualDefaultRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => '\DateTime', + 'useAggregatedServiceDate' => 'bool', + 'accruePayCodeSetUniqueId' => 'string', + 'maximumAccruePeriod' => 'float', + 'holidayLeaveAccrualCustomRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'useDefaultHolidayType' => null, + 'useDefaultAllowanceResetDate' => null, + 'useDefaultAllowance' => null, + 'useDefaultAccruePaymentInLieu' => null, + 'useDefaultAccruePaymentInLieuRate' => null, + 'useDefaultAccruePaymentInLieuAllGrossPay' => null, + 'useDefaultHolidayAccrualBasis' => null, + 'useDefaultAccruePaymentInLieuPayAutomatically' => null, + 'useDefaultAccrueHoursPerDay' => null, + 'useDefaultMaximumAccruePeriod' => null, + 'allowanceResetDate' => 'date', + 'allowance' => 'double', + 'adjustment' => 'double', + 'holidayType' => null, + 'accrueSetAmount' => null, + 'accrueHoursPerDay' => 'double', + 'showAllowanceOnPayslip' => null, + 'showAhpOnPayslip' => null, + 'accruePaymentInLieuRate' => 'double', + 'accruePaymentInLieuAllGrossPay' => null, + 'accruePaymentInLieuPayAutomatically' => null, + 'occupationalSicknessUniqueId' => 'uuid', + 'accruedPaymentAdjustment' => 'double', + 'accruedHoursAdjustment' => 'double', + 'holidayAccrualBasis' => null, + 'holidayAccrualDefaultRateType' => null, + 'aggregatedServiceDate' => 'date', + 'useAggregatedServiceDate' => null, + 'accruePayCodeSetUniqueId' => 'uuid', + 'maximumAccruePeriod' => 'double', + 'holidayLeaveAccrualCustomRateType' => null, + 'useDefaultHolidayAccrualDefaultRateType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'useDefaultHolidayType' => false, + 'useDefaultAllowanceResetDate' => false, + 'useDefaultAllowance' => false, + 'useDefaultAccruePaymentInLieu' => false, + 'useDefaultAccruePaymentInLieuRate' => false, + 'useDefaultAccruePaymentInLieuAllGrossPay' => false, + 'useDefaultHolidayAccrualBasis' => true, + 'useDefaultAccruePaymentInLieuPayAutomatically' => false, + 'useDefaultAccrueHoursPerDay' => false, + 'useDefaultMaximumAccruePeriod' => false, + 'allowanceResetDate' => false, + 'allowance' => false, + 'adjustment' => true, + 'holidayType' => false, + 'accrueSetAmount' => false, + 'accrueHoursPerDay' => false, + 'showAllowanceOnPayslip' => false, + 'showAhpOnPayslip' => false, + 'accruePaymentInLieuRate' => false, + 'accruePaymentInLieuAllGrossPay' => false, + 'accruePaymentInLieuPayAutomatically' => false, + 'occupationalSicknessUniqueId' => true, + 'accruedPaymentAdjustment' => false, + 'accruedHoursAdjustment' => false, + 'holidayAccrualBasis' => false, + 'holidayAccrualDefaultRateType' => false, + 'aggregatedServiceDate' => true, + 'useAggregatedServiceDate' => false, + 'accruePayCodeSetUniqueId' => true, + 'maximumAccruePeriod' => true, + 'holidayLeaveAccrualCustomRateType' => false, + 'useDefaultHolidayAccrualDefaultRateType' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'useDefaultHolidayType' => 'useDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'useDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'useDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'useDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'useDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'useDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'useDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'useDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'useDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'useDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'allowanceResetDate', + 'allowance' => 'allowance', + 'adjustment' => 'adjustment', + 'holidayType' => 'holidayType', + 'accrueSetAmount' => 'accrueSetAmount', + 'accrueHoursPerDay' => 'accrueHoursPerDay', + 'showAllowanceOnPayslip' => 'showAllowanceOnPayslip', + 'showAhpOnPayslip' => 'showAhpOnPayslip', + 'accruePaymentInLieuRate' => 'accruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'accruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'accruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'occupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'accruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'accruedHoursAdjustment', + 'holidayAccrualBasis' => 'holidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'holidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'useAggregatedServiceDate' => 'useAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'accruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'maximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'holidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'useDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'useDefaultHolidayType' => 'setUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'setUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'setUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'setUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'setUseDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'setUseDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'setUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'setUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'setUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'setUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'setAllowanceResetDate', + 'allowance' => 'setAllowance', + 'adjustment' => 'setAdjustment', + 'holidayType' => 'setHolidayType', + 'accrueSetAmount' => 'setAccrueSetAmount', + 'accrueHoursPerDay' => 'setAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'setShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'setShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'setAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'setAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'setAccruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'setOccupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'setAccruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'setAccruedHoursAdjustment', + 'holidayAccrualBasis' => 'setHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'setHolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'useAggregatedServiceDate' => 'setUseAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'setAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'setMaximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'setHolidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'setUseDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'useDefaultHolidayType' => 'getUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'getUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'getUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'getUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'getUseDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'getUseDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'getUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'getUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'getUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'getUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'getAllowanceResetDate', + 'allowance' => 'getAllowance', + 'adjustment' => 'getAdjustment', + 'holidayType' => 'getHolidayType', + 'accrueSetAmount' => 'getAccrueSetAmount', + 'accrueHoursPerDay' => 'getAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'getShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'getShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'getAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'getAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'getAccruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'getOccupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'getAccruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'getAccruedHoursAdjustment', + 'holidayAccrualBasis' => 'getHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'getHolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'useAggregatedServiceDate' => 'getUseAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'getAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'getMaximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'getHolidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'getUseDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('useDefaultHolidayType', $data ?? [], null); + $this->setIfExists('useDefaultAllowanceResetDate', $data ?? [], null); + $this->setIfExists('useDefaultAllowance', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieu', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuAllGrossPay', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualBasis', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('useDefaultAccrueHoursPerDay', $data ?? [], null); + $this->setIfExists('useDefaultMaximumAccruePeriod', $data ?? [], null); + $this->setIfExists('allowanceResetDate', $data ?? [], null); + $this->setIfExists('allowance', $data ?? [], null); + $this->setIfExists('adjustment', $data ?? [], null); + $this->setIfExists('holidayType', $data ?? [], null); + $this->setIfExists('accrueSetAmount', $data ?? [], null); + $this->setIfExists('accrueHoursPerDay', $data ?? [], null); + $this->setIfExists('showAllowanceOnPayslip', $data ?? [], null); + $this->setIfExists('showAhpOnPayslip', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuAllGrossPay', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('occupationalSicknessUniqueId', $data ?? [], null); + $this->setIfExists('accruedPaymentAdjustment', $data ?? [], null); + $this->setIfExists('accruedHoursAdjustment', $data ?? [], null); + $this->setIfExists('holidayAccrualBasis', $data ?? [], null); + $this->setIfExists('holidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('useAggregatedServiceDate', $data ?? [], null); + $this->setIfExists('accruePayCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('maximumAccruePeriod', $data ?? [], null); + $this->setIfExists('holidayLeaveAccrualCustomRateType', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualDefaultRateType', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets useDefaultHolidayType + * + * @return bool|null + */ + public function getUseDefaultHolidayType(): ?bool + { + return $this->container['useDefaultHolidayType']; + } + + /** + * Sets useDefaultHolidayType + * + * @param bool|null $useDefaultHolidayType If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayType(?bool $useDefaultHolidayType): static + { + if (is_null($useDefaultHolidayType)) { + throw new InvalidArgumentException('non-nullable useDefaultHolidayType cannot be null'); + } + $this->container['useDefaultHolidayType'] = $useDefaultHolidayType; + + return $this; + } + + /** + * Gets useDefaultAllowanceResetDate + * + * @return bool|null + */ + public function getUseDefaultAllowanceResetDate(): ?bool + { + return $this->container['useDefaultAllowanceResetDate']; + } + + /** + * Sets useDefaultAllowanceResetDate + * + * @param bool|null $useDefaultAllowanceResetDate If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowanceResetDate(?bool $useDefaultAllowanceResetDate): static + { + if (is_null($useDefaultAllowanceResetDate)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowanceResetDate cannot be null'); + } + $this->container['useDefaultAllowanceResetDate'] = $useDefaultAllowanceResetDate; + + return $this; + } + + /** + * Gets useDefaultAllowance + * + * @return bool|null + */ + public function getUseDefaultAllowance(): ?bool + { + return $this->container['useDefaultAllowance']; + } + + /** + * Sets useDefaultAllowance + * + * @param bool|null $useDefaultAllowance If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowance(?bool $useDefaultAllowance): static + { + if (is_null($useDefaultAllowance)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowance cannot be null'); + } + $this->container['useDefaultAllowance'] = $useDefaultAllowance; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieu + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieu(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieu']; + } + + /** + * Sets useDefaultAccruePaymentInLieu + * + * @param bool|null $useDefaultAccruePaymentInLieu If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieu(?bool $useDefaultAccruePaymentInLieu): static + { + if (is_null($useDefaultAccruePaymentInLieu)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieu cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieu'] = $useDefaultAccruePaymentInLieu; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuRate + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuRate(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuRate']; + } + + /** + * Sets useDefaultAccruePaymentInLieuRate + * + * @param bool|null $useDefaultAccruePaymentInLieuRate If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuRate(?bool $useDefaultAccruePaymentInLieuRate): static + { + if (is_null($useDefaultAccruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuRate cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuRate'] = $useDefaultAccruePaymentInLieuRate; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuAllGrossPay + * + * @return bool|null + * @deprecated + */ + public function getUseDefaultAccruePaymentInLieuAllGrossPay(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuAllGrossPay']; + } + + /** + * Sets useDefaultAccruePaymentInLieuAllGrossPay + * + * @param bool|null $useDefaultAccruePaymentInLieuAllGrossPay [Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead. This filed will be removed in a later release. + * + * @return $this + * @deprecated + */ + public function setUseDefaultAccruePaymentInLieuAllGrossPay(?bool $useDefaultAccruePaymentInLieuAllGrossPay): static + { + if (is_null($useDefaultAccruePaymentInLieuAllGrossPay)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuAllGrossPay cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuAllGrossPay'] = $useDefaultAccruePaymentInLieuAllGrossPay; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualBasis + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualBasis(): ?bool + { + return $this->container['useDefaultHolidayAccrualBasis']; + } + + /** + * Sets useDefaultHolidayAccrualBasis + * + * @param bool|null $useDefaultHolidayAccrualBasis If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayAccrualBasis(?bool $useDefaultHolidayAccrualBasis): static + { + if (is_null($useDefaultHolidayAccrualBasis)) { + array_push($this->openAPINullablesSetToNull, 'useDefaultHolidayAccrualBasis'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('useDefaultHolidayAccrualBasis', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['useDefaultHolidayAccrualBasis'] = $useDefaultHolidayAccrualBasis; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuPayAutomatically']; + } + + /** + * Sets useDefaultAccruePaymentInLieuPayAutomatically + * + * @param bool|null $useDefaultAccruePaymentInLieuPayAutomatically If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuPayAutomatically(?bool $useDefaultAccruePaymentInLieuPayAutomatically): static + { + if (is_null($useDefaultAccruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuPayAutomatically'] = $useDefaultAccruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets useDefaultAccrueHoursPerDay + * + * @return bool|null + */ + public function getUseDefaultAccrueHoursPerDay(): ?bool + { + return $this->container['useDefaultAccrueHoursPerDay']; + } + + /** + * Sets useDefaultAccrueHoursPerDay + * + * @param bool|null $useDefaultAccrueHoursPerDay If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccrueHoursPerDay(?bool $useDefaultAccrueHoursPerDay): static + { + if (is_null($useDefaultAccrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable useDefaultAccrueHoursPerDay cannot be null'); + } + $this->container['useDefaultAccrueHoursPerDay'] = $useDefaultAccrueHoursPerDay; + + return $this; + } + + /** + * Gets useDefaultMaximumAccruePeriod + * + * @return bool|null + */ + public function getUseDefaultMaximumAccruePeriod(): ?bool + { + return $this->container['useDefaultMaximumAccruePeriod']; + } + + /** + * Sets useDefaultMaximumAccruePeriod + * + * @param bool|null $useDefaultMaximumAccruePeriod If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultMaximumAccruePeriod(?bool $useDefaultMaximumAccruePeriod): static + { + if (is_null($useDefaultMaximumAccruePeriod)) { + throw new InvalidArgumentException('non-nullable useDefaultMaximumAccruePeriod cannot be null'); + } + $this->container['useDefaultMaximumAccruePeriod'] = $useDefaultMaximumAccruePeriod; + + return $this; + } + + /** + * Gets allowanceResetDate + * + * @return \DateTime|null + */ + public function getAllowanceResetDate(): ?\DateTime + { + return $this->container['allowanceResetDate']; + } + + /** + * Sets allowanceResetDate + * + * @param \DateTime|null $allowanceResetDate The date that the holiday allowance resets. Only the day/month part of the value is relevant. + * + * @return $this + */ + public function setAllowanceResetDate(?\DateTime $allowanceResetDate): static + { + if (is_null($allowanceResetDate)) { + throw new InvalidArgumentException('non-nullable allowanceResetDate cannot be null'); + } + $this->container['allowanceResetDate'] = $allowanceResetDate; + + return $this; + } + + /** + * Gets allowance + * + * @return float|null + */ + public function getAllowance(): ?float + { + return $this->container['allowance']; + } + + /** + * Sets allowance + * + * @param float|null $allowance The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset + * + * @return $this + */ + public function setAllowance(?float $allowance): static + { + if (is_null($allowance)) { + throw new InvalidArgumentException('non-nullable allowance cannot be null'); + } + $this->container['allowance'] = $allowance; + + return $this; + } + + /** + * Gets adjustment + * + * @return float|null + */ + public function getAdjustment(): ?float + { + return $this->container['adjustment']; + } + + /** + * Sets adjustment + * + * @param float|null $adjustment Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setAdjustment(?float $adjustment): static + { + if (is_null($adjustment)) { + array_push($this->openAPINullablesSetToNull, 'adjustment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustment'] = $adjustment; + + return $this; + } + + /** + * Gets holidayType + * + * @return \SynergiTech\Staffology\Model\HolidayType|null + */ + public function getHolidayType(): ?\SynergiTech\Staffology\Model\HolidayType + { + return $this->container['holidayType']; + } + + /** + * Sets holidayType + * + * @param \SynergiTech\Staffology\Model\HolidayType|null $holidayType holidayType + * + * @return $this + */ + public function setHolidayType(?\SynergiTech\Staffology\Model\HolidayType $holidayType): static + { + if (is_null($holidayType)) { + throw new InvalidArgumentException('non-nullable holidayType cannot be null'); + } + $this->container['holidayType'] = $holidayType; + + return $this; + } + + /** + * Gets accrueSetAmount + * + * @return bool|null + */ + public function getAccrueSetAmount(): ?bool + { + return $this->container['accrueSetAmount']; + } + + /** + * Sets accrueSetAmount + * + * @param bool|null $accrueSetAmount If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. + * + * @return $this + */ + public function setAccrueSetAmount(?bool $accrueSetAmount): static + { + if (is_null($accrueSetAmount)) { + throw new InvalidArgumentException('non-nullable accrueSetAmount cannot be null'); + } + $this->container['accrueSetAmount'] = $accrueSetAmount; + + return $this; + } + + /** + * Gets accrueHoursPerDay + * + * @return float|null + */ + public function getAccrueHoursPerDay(): ?float + { + return $this->container['accrueHoursPerDay']; + } + + /** + * Sets accrueHoursPerDay + * + * @param float|null $accrueHoursPerDay If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued + * + * @return $this + */ + public function setAccrueHoursPerDay(?float $accrueHoursPerDay): static + { + if (is_null($accrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable accrueHoursPerDay cannot be null'); + } + $this->container['accrueHoursPerDay'] = $accrueHoursPerDay; + + return $this; + } + + /** + * Gets showAllowanceOnPayslip + * + * @return bool|null + */ + public function getShowAllowanceOnPayslip(): ?bool + { + return $this->container['showAllowanceOnPayslip']; + } + + /** + * Sets showAllowanceOnPayslip + * + * @param bool|null $showAllowanceOnPayslip If true then the remaining Allowance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAllowanceOnPayslip(?bool $showAllowanceOnPayslip): static + { + if (is_null($showAllowanceOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAllowanceOnPayslip cannot be null'); + } + $this->container['showAllowanceOnPayslip'] = $showAllowanceOnPayslip; + + return $this; + } + + /** + * Gets showAhpOnPayslip + * + * @return bool|null + */ + public function getShowAhpOnPayslip(): ?bool + { + return $this->container['showAhpOnPayslip']; + } + + /** + * Sets showAhpOnPayslip + * + * @param bool|null $showAhpOnPayslip If true then the AHP balance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAhpOnPayslip(?bool $showAhpOnPayslip): static + { + if (is_null($showAhpOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAhpOnPayslip cannot be null'); + } + $this->container['showAhpOnPayslip'] = $showAhpOnPayslip; + + return $this; + } + + /** + * Gets accruePaymentInLieuRate + * + * @return float|null + */ + public function getAccruePaymentInLieuRate(): ?float + { + return $this->container['accruePaymentInLieuRate']; + } + + /** + * Sets accruePaymentInLieuRate + * + * @param float|null $accruePaymentInLieuRate The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. + * + * @return $this + */ + public function setAccruePaymentInLieuRate(?float $accruePaymentInLieuRate): static + { + if (is_null($accruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuRate cannot be null'); + } + $this->container['accruePaymentInLieuRate'] = $accruePaymentInLieuRate; + + return $this; + } + + /** + * Gets accruePaymentInLieuAllGrossPay + * + * @return bool|null + * @deprecated + */ + public function getAccruePaymentInLieuAllGrossPay(): ?bool + { + return $this->container['accruePaymentInLieuAllGrossPay']; + } + + /** + * Sets accruePaymentInLieuAllGrossPay + * + * @param bool|null $accruePaymentInLieuAllGrossPay [Deprecated] Please use HolidayAccrualBasis instead. This filed will be removed in a later release. + * + * @return $this + * @deprecated + */ + public function setAccruePaymentInLieuAllGrossPay(?bool $accruePaymentInLieuAllGrossPay): static + { + if (is_null($accruePaymentInLieuAllGrossPay)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuAllGrossPay cannot be null'); + } + $this->container['accruePaymentInLieuAllGrossPay'] = $accruePaymentInLieuAllGrossPay; + + return $this; + } + + /** + * Gets accruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['accruePaymentInLieuPayAutomatically']; + } + + /** + * Sets accruePaymentInLieuPayAutomatically + * + * @param bool|null $accruePaymentInLieuPayAutomatically Set to true if you want employees to be automatically paid any outstanding holiday pay + * + * @return $this + */ + public function setAccruePaymentInLieuPayAutomatically(?bool $accruePaymentInLieuPayAutomatically): static + { + if (is_null($accruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['accruePaymentInLieuPayAutomatically'] = $accruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets occupationalSicknessUniqueId + * + * @return string|null + */ + public function getOccupationalSicknessUniqueId(): ?string + { + return $this->container['occupationalSicknessUniqueId']; + } + + /** + * Sets occupationalSicknessUniqueId + * + * @param string|null $occupationalSicknessUniqueId occupationalSicknessUniqueId + * + * @return $this + */ + public function setOccupationalSicknessUniqueId(?string $occupationalSicknessUniqueId): static + { + if (is_null($occupationalSicknessUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalSicknessUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalSicknessUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalSicknessUniqueId'] = $occupationalSicknessUniqueId; + + return $this; + } + + /** + * Gets accruedPaymentAdjustment + * + * @return float|null + */ + public function getAccruedPaymentAdjustment(): ?float + { + return $this->container['accruedPaymentAdjustment']; + } + + /** + * Sets accruedPaymentAdjustment + * + * @param float|null $accruedPaymentAdjustment Any manual adjustment to the total accrued + * + * @return $this + */ + public function setAccruedPaymentAdjustment(?float $accruedPaymentAdjustment): static + { + if (is_null($accruedPaymentAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedPaymentAdjustment cannot be null'); + } + $this->container['accruedPaymentAdjustment'] = $accruedPaymentAdjustment; + + return $this; + } + + /** + * Gets accruedHoursAdjustment + * + * @return float|null + */ + public function getAccruedHoursAdjustment(): ?float + { + return $this->container['accruedHoursAdjustment']; + } + + /** + * Sets accruedHoursAdjustment + * + * @param float|null $accruedHoursAdjustment Any manual adjustment to the total hours accrued + * + * @return $this + */ + public function setAccruedHoursAdjustment(?float $accruedHoursAdjustment): static + { + if (is_null($accruedHoursAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedHoursAdjustment cannot be null'); + } + $this->container['accruedHoursAdjustment'] = $accruedHoursAdjustment; + + return $this; + } + + /** + * Gets holidayAccrualBasis + * + * @return \SynergiTech\Staffology\Model\HolidayAccrual|null + */ + public function getHolidayAccrualBasis(): ?\SynergiTech\Staffology\Model\HolidayAccrual + { + return $this->container['holidayAccrualBasis']; + } + + /** + * Sets holidayAccrualBasis + * + * @param \SynergiTech\Staffology\Model\HolidayAccrual|null $holidayAccrualBasis holidayAccrualBasis + * + * @return $this + */ + public function setHolidayAccrualBasis(?\SynergiTech\Staffology\Model\HolidayAccrual $holidayAccrualBasis): static + { + if (is_null($holidayAccrualBasis)) { + throw new InvalidArgumentException('non-nullable holidayAccrualBasis cannot be null'); + } + $this->container['holidayAccrualBasis'] = $holidayAccrualBasis; + + return $this; + } + + /** + * Gets holidayAccrualDefaultRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayAccrualDefaultRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayAccrualDefaultRateType']; + } + + /** + * Sets holidayAccrualDefaultRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayAccrualDefaultRateType holidayAccrualDefaultRateType + * + * @return $this + */ + public function setHolidayAccrualDefaultRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayAccrualDefaultRateType): static + { + if (is_null($holidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable holidayAccrualDefaultRateType cannot be null'); + } + $this->container['holidayAccrualDefaultRateType'] = $holidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets useAggregatedServiceDate + * + * @return bool|null + */ + public function getUseAggregatedServiceDate(): ?bool + { + return $this->container['useAggregatedServiceDate']; + } + + /** + * Sets useAggregatedServiceDate + * + * @param bool|null $useAggregatedServiceDate useAggregatedServiceDate + * + * @return $this + */ + public function setUseAggregatedServiceDate(?bool $useAggregatedServiceDate): static + { + if (is_null($useAggregatedServiceDate)) { + throw new InvalidArgumentException('non-nullable useAggregatedServiceDate cannot be null'); + } + $this->container['useAggregatedServiceDate'] = $useAggregatedServiceDate; + + return $this; + } + + /** + * Gets accruePayCodeSetUniqueId + * + * @return string|null + */ + public function getAccruePayCodeSetUniqueId(): ?string + { + return $this->container['accruePayCodeSetUniqueId']; + } + + /** + * Sets accruePayCodeSetUniqueId + * + * @param string|null $accruePayCodeSetUniqueId Pay code set to use for accruing holiday pay + * + * @return $this + */ + public function setAccruePayCodeSetUniqueId(?string $accruePayCodeSetUniqueId): static + { + if (is_null($accruePayCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'accruePayCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accruePayCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accruePayCodeSetUniqueId'] = $accruePayCodeSetUniqueId; + + return $this; + } + + /** + * Gets maximumAccruePeriod + * + * @return float|null + */ + public function getMaximumAccruePeriod(): ?float + { + return $this->container['maximumAccruePeriod']; + } + + /** + * Sets maximumAccruePeriod + * + * @param float|null $maximumAccruePeriod The maximum number of hours capable of being accrued in a single period + * + * @return $this + */ + public function setMaximumAccruePeriod(?float $maximumAccruePeriod): static + { + if (is_null($maximumAccruePeriod)) { + array_push($this->openAPINullablesSetToNull, 'maximumAccruePeriod'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('maximumAccruePeriod', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['maximumAccruePeriod'] = $maximumAccruePeriod; + + return $this; + } + + /** + * Gets holidayLeaveAccrualCustomRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayLeaveAccrualCustomRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayLeaveAccrualCustomRateType']; + } + + /** + * Sets holidayLeaveAccrualCustomRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayLeaveAccrualCustomRateType holidayLeaveAccrualCustomRateType + * + * @return $this + */ + public function setHolidayLeaveAccrualCustomRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayLeaveAccrualCustomRateType): static + { + if (is_null($holidayLeaveAccrualCustomRateType)) { + throw new InvalidArgumentException('non-nullable holidayLeaveAccrualCustomRateType cannot be null'); + } + $this->container['holidayLeaveAccrualCustomRateType'] = $holidayLeaveAccrualCustomRateType; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualDefaultRateType + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualDefaultRateType(): ?bool + { + return $this->container['useDefaultHolidayAccrualDefaultRateType']; + } + + /** + * Sets useDefaultHolidayAccrualDefaultRateType + * + * @param bool|null $useDefaultHolidayAccrualDefaultRateType If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. + * + * @return $this + */ + public function setUseDefaultHolidayAccrualDefaultRateType(?bool $useDefaultHolidayAccrualDefaultRateType): static + { + if (is_null($useDefaultHolidayAccrualDefaultRateType)) { + array_push($this->openAPINullablesSetToNull, 'useDefaultHolidayAccrualDefaultRateType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('useDefaultHolidayAccrualDefaultRateType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['useDefaultHolidayAccrualDefaultRateType'] = $useDefaultHolidayAccrualDefaultRateType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLeaveSettingsResponse.php b/src/Model/ContractLeaveSettingsResponse.php new file mode 100644 index 0000000..07c42ad --- /dev/null +++ b/src/Model/ContractLeaveSettingsResponse.php @@ -0,0 +1,1821 @@ + + */ +class ContractLeaveSettingsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LeaveSettingsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowanceUsed' => 'float', + 'allowanceUsedPreviousPeriod' => 'float', + 'allowanceRemaining' => 'float', + 'accruedPaymentLiability' => 'float', + 'accruedPaymentPaid' => 'float', + 'accruedPaymentBalance' => 'float', + 'accruedHoursAmount' => 'float', + 'accruedHoursPaid' => 'float', + 'accruedHoursBalance' => 'float', + 'useDefaultHolidayType' => 'bool', + 'useDefaultAllowanceResetDate' => 'bool', + 'useDefaultAllowance' => 'bool', + 'useDefaultAccruePaymentInLieu' => 'bool', + 'useDefaultAccruePaymentInLieuRate' => 'bool', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'bool', + 'useDefaultHolidayAccrualBasis' => 'bool', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'bool', + 'useDefaultAccrueHoursPerDay' => 'bool', + 'useDefaultMaximumAccruePeriod' => 'bool', + 'allowanceResetDate' => '\DateTime', + 'allowance' => 'float', + 'adjustment' => 'float', + 'holidayType' => '\SynergiTech\Staffology\Model\HolidayType', + 'accrueSetAmount' => 'bool', + 'accrueHoursPerDay' => 'float', + 'showAllowanceOnPayslip' => 'bool', + 'showAhpOnPayslip' => 'bool', + 'accruePaymentInLieuRate' => 'float', + 'accruePaymentInLieuAllGrossPay' => 'bool', + 'accruePaymentInLieuPayAutomatically' => 'bool', + 'occupationalSicknessUniqueId' => 'string', + 'accruedPaymentAdjustment' => 'float', + 'accruedHoursAdjustment' => 'float', + 'holidayAccrualBasis' => '\SynergiTech\Staffology\Model\HolidayAccrual', + 'holidayAccrualDefaultRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => '\DateTime', + 'useAggregatedServiceDate' => 'bool', + 'accruePayCodeSetUniqueId' => 'string', + 'maximumAccruePeriod' => 'float', + 'holidayLeaveAccrualCustomRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowanceUsed' => 'double', + 'allowanceUsedPreviousPeriod' => 'double', + 'allowanceRemaining' => 'double', + 'accruedPaymentLiability' => 'double', + 'accruedPaymentPaid' => 'double', + 'accruedPaymentBalance' => 'double', + 'accruedHoursAmount' => 'double', + 'accruedHoursPaid' => 'double', + 'accruedHoursBalance' => 'double', + 'useDefaultHolidayType' => null, + 'useDefaultAllowanceResetDate' => null, + 'useDefaultAllowance' => null, + 'useDefaultAccruePaymentInLieu' => null, + 'useDefaultAccruePaymentInLieuRate' => null, + 'useDefaultAccruePaymentInLieuAllGrossPay' => null, + 'useDefaultHolidayAccrualBasis' => null, + 'useDefaultAccruePaymentInLieuPayAutomatically' => null, + 'useDefaultAccrueHoursPerDay' => null, + 'useDefaultMaximumAccruePeriod' => null, + 'allowanceResetDate' => 'date', + 'allowance' => 'double', + 'adjustment' => 'double', + 'holidayType' => null, + 'accrueSetAmount' => null, + 'accrueHoursPerDay' => 'double', + 'showAllowanceOnPayslip' => null, + 'showAhpOnPayslip' => null, + 'accruePaymentInLieuRate' => 'double', + 'accruePaymentInLieuAllGrossPay' => null, + 'accruePaymentInLieuPayAutomatically' => null, + 'occupationalSicknessUniqueId' => 'uuid', + 'accruedPaymentAdjustment' => 'double', + 'accruedHoursAdjustment' => 'double', + 'holidayAccrualBasis' => null, + 'holidayAccrualDefaultRateType' => null, + 'aggregatedServiceDate' => 'date', + 'useAggregatedServiceDate' => null, + 'accruePayCodeSetUniqueId' => 'uuid', + 'maximumAccruePeriod' => 'double', + 'holidayLeaveAccrualCustomRateType' => null, + 'useDefaultHolidayAccrualDefaultRateType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowanceUsed' => false, + 'allowanceUsedPreviousPeriod' => false, + 'allowanceRemaining' => false, + 'accruedPaymentLiability' => false, + 'accruedPaymentPaid' => false, + 'accruedPaymentBalance' => false, + 'accruedHoursAmount' => false, + 'accruedHoursPaid' => false, + 'accruedHoursBalance' => false, + 'useDefaultHolidayType' => false, + 'useDefaultAllowanceResetDate' => false, + 'useDefaultAllowance' => false, + 'useDefaultAccruePaymentInLieu' => false, + 'useDefaultAccruePaymentInLieuRate' => false, + 'useDefaultAccruePaymentInLieuAllGrossPay' => false, + 'useDefaultHolidayAccrualBasis' => true, + 'useDefaultAccruePaymentInLieuPayAutomatically' => false, + 'useDefaultAccrueHoursPerDay' => false, + 'useDefaultMaximumAccruePeriod' => false, + 'allowanceResetDate' => false, + 'allowance' => false, + 'adjustment' => true, + 'holidayType' => false, + 'accrueSetAmount' => false, + 'accrueHoursPerDay' => false, + 'showAllowanceOnPayslip' => false, + 'showAhpOnPayslip' => false, + 'accruePaymentInLieuRate' => false, + 'accruePaymentInLieuAllGrossPay' => false, + 'accruePaymentInLieuPayAutomatically' => false, + 'occupationalSicknessUniqueId' => true, + 'accruedPaymentAdjustment' => false, + 'accruedHoursAdjustment' => false, + 'holidayAccrualBasis' => false, + 'holidayAccrualDefaultRateType' => false, + 'aggregatedServiceDate' => true, + 'useAggregatedServiceDate' => false, + 'accruePayCodeSetUniqueId' => true, + 'maximumAccruePeriod' => true, + 'holidayLeaveAccrualCustomRateType' => false, + 'useDefaultHolidayAccrualDefaultRateType' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowanceUsed' => 'allowanceUsed', + 'allowanceUsedPreviousPeriod' => 'allowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'allowanceRemaining', + 'accruedPaymentLiability' => 'accruedPaymentLiability', + 'accruedPaymentPaid' => 'accruedPaymentPaid', + 'accruedPaymentBalance' => 'accruedPaymentBalance', + 'accruedHoursAmount' => 'accruedHoursAmount', + 'accruedHoursPaid' => 'accruedHoursPaid', + 'accruedHoursBalance' => 'accruedHoursBalance', + 'useDefaultHolidayType' => 'useDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'useDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'useDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'useDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'useDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'useDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'useDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'useDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'useDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'useDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'allowanceResetDate', + 'allowance' => 'allowance', + 'adjustment' => 'adjustment', + 'holidayType' => 'holidayType', + 'accrueSetAmount' => 'accrueSetAmount', + 'accrueHoursPerDay' => 'accrueHoursPerDay', + 'showAllowanceOnPayslip' => 'showAllowanceOnPayslip', + 'showAhpOnPayslip' => 'showAhpOnPayslip', + 'accruePaymentInLieuRate' => 'accruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'accruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'accruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'occupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'accruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'accruedHoursAdjustment', + 'holidayAccrualBasis' => 'holidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'holidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'useAggregatedServiceDate' => 'useAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'accruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'maximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'holidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'useDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowanceUsed' => 'setAllowanceUsed', + 'allowanceUsedPreviousPeriod' => 'setAllowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'setAllowanceRemaining', + 'accruedPaymentLiability' => 'setAccruedPaymentLiability', + 'accruedPaymentPaid' => 'setAccruedPaymentPaid', + 'accruedPaymentBalance' => 'setAccruedPaymentBalance', + 'accruedHoursAmount' => 'setAccruedHoursAmount', + 'accruedHoursPaid' => 'setAccruedHoursPaid', + 'accruedHoursBalance' => 'setAccruedHoursBalance', + 'useDefaultHolidayType' => 'setUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'setUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'setUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'setUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'setUseDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'setUseDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'setUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'setUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'setUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'setUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'setAllowanceResetDate', + 'allowance' => 'setAllowance', + 'adjustment' => 'setAdjustment', + 'holidayType' => 'setHolidayType', + 'accrueSetAmount' => 'setAccrueSetAmount', + 'accrueHoursPerDay' => 'setAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'setShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'setShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'setAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'setAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'setAccruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'setOccupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'setAccruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'setAccruedHoursAdjustment', + 'holidayAccrualBasis' => 'setHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'setHolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'useAggregatedServiceDate' => 'setUseAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'setAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'setMaximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'setHolidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'setUseDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowanceUsed' => 'getAllowanceUsed', + 'allowanceUsedPreviousPeriod' => 'getAllowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'getAllowanceRemaining', + 'accruedPaymentLiability' => 'getAccruedPaymentLiability', + 'accruedPaymentPaid' => 'getAccruedPaymentPaid', + 'accruedPaymentBalance' => 'getAccruedPaymentBalance', + 'accruedHoursAmount' => 'getAccruedHoursAmount', + 'accruedHoursPaid' => 'getAccruedHoursPaid', + 'accruedHoursBalance' => 'getAccruedHoursBalance', + 'useDefaultHolidayType' => 'getUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'getUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'getUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'getUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'getUseDefaultAccruePaymentInLieuRate', + 'useDefaultAccruePaymentInLieuAllGrossPay' => 'getUseDefaultAccruePaymentInLieuAllGrossPay', + 'useDefaultHolidayAccrualBasis' => 'getUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'getUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'getUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'getUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'getAllowanceResetDate', + 'allowance' => 'getAllowance', + 'adjustment' => 'getAdjustment', + 'holidayType' => 'getHolidayType', + 'accrueSetAmount' => 'getAccrueSetAmount', + 'accrueHoursPerDay' => 'getAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'getShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'getShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'getAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'getAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'getAccruePaymentInLieuPayAutomatically', + 'occupationalSicknessUniqueId' => 'getOccupationalSicknessUniqueId', + 'accruedPaymentAdjustment' => 'getAccruedPaymentAdjustment', + 'accruedHoursAdjustment' => 'getAccruedHoursAdjustment', + 'holidayAccrualBasis' => 'getHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'getHolidayAccrualDefaultRateType', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'useAggregatedServiceDate' => 'getUseAggregatedServiceDate', + 'accruePayCodeSetUniqueId' => 'getAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'getMaximumAccruePeriod', + 'holidayLeaveAccrualCustomRateType' => 'getHolidayLeaveAccrualCustomRateType', + 'useDefaultHolidayAccrualDefaultRateType' => 'getUseDefaultHolidayAccrualDefaultRateType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowanceUsed', $data ?? [], null); + $this->setIfExists('allowanceUsedPreviousPeriod', $data ?? [], null); + $this->setIfExists('allowanceRemaining', $data ?? [], null); + $this->setIfExists('accruedPaymentLiability', $data ?? [], null); + $this->setIfExists('accruedPaymentPaid', $data ?? [], null); + $this->setIfExists('accruedPaymentBalance', $data ?? [], null); + $this->setIfExists('accruedHoursAmount', $data ?? [], null); + $this->setIfExists('accruedHoursPaid', $data ?? [], null); + $this->setIfExists('accruedHoursBalance', $data ?? [], null); + $this->setIfExists('useDefaultHolidayType', $data ?? [], null); + $this->setIfExists('useDefaultAllowanceResetDate', $data ?? [], null); + $this->setIfExists('useDefaultAllowance', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieu', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuAllGrossPay', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualBasis', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('useDefaultAccrueHoursPerDay', $data ?? [], null); + $this->setIfExists('useDefaultMaximumAccruePeriod', $data ?? [], null); + $this->setIfExists('allowanceResetDate', $data ?? [], null); + $this->setIfExists('allowance', $data ?? [], null); + $this->setIfExists('adjustment', $data ?? [], null); + $this->setIfExists('holidayType', $data ?? [], null); + $this->setIfExists('accrueSetAmount', $data ?? [], null); + $this->setIfExists('accrueHoursPerDay', $data ?? [], null); + $this->setIfExists('showAllowanceOnPayslip', $data ?? [], null); + $this->setIfExists('showAhpOnPayslip', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuAllGrossPay', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('occupationalSicknessUniqueId', $data ?? [], null); + $this->setIfExists('accruedPaymentAdjustment', $data ?? [], null); + $this->setIfExists('accruedHoursAdjustment', $data ?? [], null); + $this->setIfExists('holidayAccrualBasis', $data ?? [], null); + $this->setIfExists('holidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('useAggregatedServiceDate', $data ?? [], null); + $this->setIfExists('accruePayCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('maximumAccruePeriod', $data ?? [], null); + $this->setIfExists('holidayLeaveAccrualCustomRateType', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualDefaultRateType', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowanceUsed + * + * @return float|null + */ + public function getAllowanceUsed(): ?float + { + return $this->container['allowanceUsed']; + } + + /** + * Sets allowanceUsed + * + * @param float|null $allowanceUsed [readonly] The number of days used from the allowance since last reset + * + * @return $this + */ + public function setAllowanceUsed(?float $allowanceUsed): static + { + if (is_null($allowanceUsed)) { + throw new InvalidArgumentException('non-nullable allowanceUsed cannot be null'); + } + $this->container['allowanceUsed'] = $allowanceUsed; + + return $this; + } + + /** + * Gets allowanceUsedPreviousPeriod + * + * @return float|null + */ + public function getAllowanceUsedPreviousPeriod(): ?float + { + return $this->container['allowanceUsedPreviousPeriod']; + } + + /** + * Sets allowanceUsedPreviousPeriod + * + * @param float|null $allowanceUsedPreviousPeriod [readonly] The number of days used in the 12 months prior to the last reset + * + * @return $this + */ + public function setAllowanceUsedPreviousPeriod(?float $allowanceUsedPreviousPeriod): static + { + if (is_null($allowanceUsedPreviousPeriod)) { + throw new InvalidArgumentException('non-nullable allowanceUsedPreviousPeriod cannot be null'); + } + $this->container['allowanceUsedPreviousPeriod'] = $allowanceUsedPreviousPeriod; + + return $this; + } + + /** + * Gets allowanceRemaining + * + * @return float|null + */ + public function getAllowanceRemaining(): ?float + { + return $this->container['allowanceRemaining']; + } + + /** + * Sets allowanceRemaining + * + * @param float|null $allowanceRemaining [readonly] The number of days remaining of the allowance until next reset + * + * @return $this + */ + public function setAllowanceRemaining(?float $allowanceRemaining): static + { + if (is_null($allowanceRemaining)) { + throw new InvalidArgumentException('non-nullable allowanceRemaining cannot be null'); + } + $this->container['allowanceRemaining'] = $allowanceRemaining; + + return $this; + } + + /** + * Gets accruedPaymentLiability + * + * @return float|null + */ + public function getAccruedPaymentLiability(): ?float + { + return $this->container['accruedPaymentLiability']; + } + + /** + * Sets accruedPaymentLiability + * + * @param float|null $accruedPaymentLiability [readonly] The total accrued payments for this employee over the lifetime of their employment so far + * + * @return $this + */ + public function setAccruedPaymentLiability(?float $accruedPaymentLiability): static + { + if (is_null($accruedPaymentLiability)) { + throw new InvalidArgumentException('non-nullable accruedPaymentLiability cannot be null'); + } + $this->container['accruedPaymentLiability'] = $accruedPaymentLiability; + + return $this; + } + + /** + * Gets accruedPaymentPaid + * + * @return float|null + */ + public function getAccruedPaymentPaid(): ?float + { + return $this->container['accruedPaymentPaid']; + } + + /** + * Sets accruedPaymentPaid + * + * @param float|null $accruedPaymentPaid [readonly] The Total amount paid to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedPaymentPaid(?float $accruedPaymentPaid): static + { + if (is_null($accruedPaymentPaid)) { + throw new InvalidArgumentException('non-nullable accruedPaymentPaid cannot be null'); + } + $this->container['accruedPaymentPaid'] = $accruedPaymentPaid; + + return $this; + } + + /** + * Gets accruedPaymentBalance + * + * @return float|null + */ + public function getAccruedPaymentBalance(): ?float + { + return $this->container['accruedPaymentBalance']; + } + + /** + * Sets accruedPaymentBalance + * + * @param float|null $accruedPaymentBalance [readonly] The balance of what is owed to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedPaymentBalance(?float $accruedPaymentBalance): static + { + if (is_null($accruedPaymentBalance)) { + throw new InvalidArgumentException('non-nullable accruedPaymentBalance cannot be null'); + } + $this->container['accruedPaymentBalance'] = $accruedPaymentBalance; + + return $this; + } + + /** + * Gets accruedHoursAmount + * + * @return float|null + */ + public function getAccruedHoursAmount(): ?float + { + return $this->container['accruedHoursAmount']; + } + + /** + * Sets accruedHoursAmount + * + * @param float|null $accruedHoursAmount [readonly] The total accrued hours for this employee over the lifetime of their employment so far + * + * @return $this + */ + public function setAccruedHoursAmount(?float $accruedHoursAmount): static + { + if (is_null($accruedHoursAmount)) { + throw new InvalidArgumentException('non-nullable accruedHoursAmount cannot be null'); + } + $this->container['accruedHoursAmount'] = $accruedHoursAmount; + + return $this; + } + + /** + * Gets accruedHoursPaid + * + * @return float|null + */ + public function getAccruedHoursPaid(): ?float + { + return $this->container['accruedHoursPaid']; + } + + /** + * Sets accruedHoursPaid + * + * @param float|null $accruedHoursPaid [readonly] The Total amount of hours paid to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedHoursPaid(?float $accruedHoursPaid): static + { + if (is_null($accruedHoursPaid)) { + throw new InvalidArgumentException('non-nullable accruedHoursPaid cannot be null'); + } + $this->container['accruedHoursPaid'] = $accruedHoursPaid; + + return $this; + } + + /** + * Gets accruedHoursBalance + * + * @return float|null + */ + public function getAccruedHoursBalance(): ?float + { + return $this->container['accruedHoursBalance']; + } + + /** + * Sets accruedHoursBalance + * + * @param float|null $accruedHoursBalance [readonly] The balance of hours owed to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedHoursBalance(?float $accruedHoursBalance): static + { + if (is_null($accruedHoursBalance)) { + throw new InvalidArgumentException('non-nullable accruedHoursBalance cannot be null'); + } + $this->container['accruedHoursBalance'] = $accruedHoursBalance; + + return $this; + } + + /** + * Gets useDefaultHolidayType + * + * @return bool|null + */ + public function getUseDefaultHolidayType(): ?bool + { + return $this->container['useDefaultHolidayType']; + } + + /** + * Sets useDefaultHolidayType + * + * @param bool|null $useDefaultHolidayType If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayType(?bool $useDefaultHolidayType): static + { + if (is_null($useDefaultHolidayType)) { + throw new InvalidArgumentException('non-nullable useDefaultHolidayType cannot be null'); + } + $this->container['useDefaultHolidayType'] = $useDefaultHolidayType; + + return $this; + } + + /** + * Gets useDefaultAllowanceResetDate + * + * @return bool|null + */ + public function getUseDefaultAllowanceResetDate(): ?bool + { + return $this->container['useDefaultAllowanceResetDate']; + } + + /** + * Sets useDefaultAllowanceResetDate + * + * @param bool|null $useDefaultAllowanceResetDate If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowanceResetDate(?bool $useDefaultAllowanceResetDate): static + { + if (is_null($useDefaultAllowanceResetDate)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowanceResetDate cannot be null'); + } + $this->container['useDefaultAllowanceResetDate'] = $useDefaultAllowanceResetDate; + + return $this; + } + + /** + * Gets useDefaultAllowance + * + * @return bool|null + */ + public function getUseDefaultAllowance(): ?bool + { + return $this->container['useDefaultAllowance']; + } + + /** + * Sets useDefaultAllowance + * + * @param bool|null $useDefaultAllowance If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowance(?bool $useDefaultAllowance): static + { + if (is_null($useDefaultAllowance)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowance cannot be null'); + } + $this->container['useDefaultAllowance'] = $useDefaultAllowance; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieu + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieu(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieu']; + } + + /** + * Sets useDefaultAccruePaymentInLieu + * + * @param bool|null $useDefaultAccruePaymentInLieu If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieu(?bool $useDefaultAccruePaymentInLieu): static + { + if (is_null($useDefaultAccruePaymentInLieu)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieu cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieu'] = $useDefaultAccruePaymentInLieu; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuRate + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuRate(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuRate']; + } + + /** + * Sets useDefaultAccruePaymentInLieuRate + * + * @param bool|null $useDefaultAccruePaymentInLieuRate If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuRate(?bool $useDefaultAccruePaymentInLieuRate): static + { + if (is_null($useDefaultAccruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuRate cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuRate'] = $useDefaultAccruePaymentInLieuRate; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuAllGrossPay + * + * @return bool|null + * @deprecated + */ + public function getUseDefaultAccruePaymentInLieuAllGrossPay(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuAllGrossPay']; + } + + /** + * Sets useDefaultAccruePaymentInLieuAllGrossPay + * + * @param bool|null $useDefaultAccruePaymentInLieuAllGrossPay [Deprecated] Please use UseUseDefaultHolidayAccrualBasis instead. This filed will be removed in a later release. + * + * @return $this + * @deprecated + */ + public function setUseDefaultAccruePaymentInLieuAllGrossPay(?bool $useDefaultAccruePaymentInLieuAllGrossPay): static + { + if (is_null($useDefaultAccruePaymentInLieuAllGrossPay)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuAllGrossPay cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuAllGrossPay'] = $useDefaultAccruePaymentInLieuAllGrossPay; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualBasis + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualBasis(): ?bool + { + return $this->container['useDefaultHolidayAccrualBasis']; + } + + /** + * Sets useDefaultHolidayAccrualBasis + * + * @param bool|null $useDefaultHolidayAccrualBasis If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayAccrualBasis(?bool $useDefaultHolidayAccrualBasis): static + { + if (is_null($useDefaultHolidayAccrualBasis)) { + array_push($this->openAPINullablesSetToNull, 'useDefaultHolidayAccrualBasis'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('useDefaultHolidayAccrualBasis', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['useDefaultHolidayAccrualBasis'] = $useDefaultHolidayAccrualBasis; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuPayAutomatically']; + } + + /** + * Sets useDefaultAccruePaymentInLieuPayAutomatically + * + * @param bool|null $useDefaultAccruePaymentInLieuPayAutomatically If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuPayAutomatically(?bool $useDefaultAccruePaymentInLieuPayAutomatically): static + { + if (is_null($useDefaultAccruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuPayAutomatically'] = $useDefaultAccruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets useDefaultAccrueHoursPerDay + * + * @return bool|null + */ + public function getUseDefaultAccrueHoursPerDay(): ?bool + { + return $this->container['useDefaultAccrueHoursPerDay']; + } + + /** + * Sets useDefaultAccrueHoursPerDay + * + * @param bool|null $useDefaultAccrueHoursPerDay If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccrueHoursPerDay(?bool $useDefaultAccrueHoursPerDay): static + { + if (is_null($useDefaultAccrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable useDefaultAccrueHoursPerDay cannot be null'); + } + $this->container['useDefaultAccrueHoursPerDay'] = $useDefaultAccrueHoursPerDay; + + return $this; + } + + /** + * Gets useDefaultMaximumAccruePeriod + * + * @return bool|null + */ + public function getUseDefaultMaximumAccruePeriod(): ?bool + { + return $this->container['useDefaultMaximumAccruePeriod']; + } + + /** + * Sets useDefaultMaximumAccruePeriod + * + * @param bool|null $useDefaultMaximumAccruePeriod If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultMaximumAccruePeriod(?bool $useDefaultMaximumAccruePeriod): static + { + if (is_null($useDefaultMaximumAccruePeriod)) { + throw new InvalidArgumentException('non-nullable useDefaultMaximumAccruePeriod cannot be null'); + } + $this->container['useDefaultMaximumAccruePeriod'] = $useDefaultMaximumAccruePeriod; + + return $this; + } + + /** + * Gets allowanceResetDate + * + * @return \DateTime|null + */ + public function getAllowanceResetDate(): ?\DateTime + { + return $this->container['allowanceResetDate']; + } + + /** + * Sets allowanceResetDate + * + * @param \DateTime|null $allowanceResetDate The date that the holiday allowance resets. Only the day/month part of the value is relevant. + * + * @return $this + */ + public function setAllowanceResetDate(?\DateTime $allowanceResetDate): static + { + if (is_null($allowanceResetDate)) { + throw new InvalidArgumentException('non-nullable allowanceResetDate cannot be null'); + } + $this->container['allowanceResetDate'] = $allowanceResetDate; + + return $this; + } + + /** + * Gets allowance + * + * @return float|null + */ + public function getAllowance(): ?float + { + return $this->container['allowance']; + } + + /** + * Sets allowance + * + * @param float|null $allowance The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset + * + * @return $this + */ + public function setAllowance(?float $allowance): static + { + if (is_null($allowance)) { + throw new InvalidArgumentException('non-nullable allowance cannot be null'); + } + $this->container['allowance'] = $allowance; + + return $this; + } + + /** + * Gets adjustment + * + * @return float|null + */ + public function getAdjustment(): ?float + { + return $this->container['adjustment']; + } + + /** + * Sets adjustment + * + * @param float|null $adjustment Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setAdjustment(?float $adjustment): static + { + if (is_null($adjustment)) { + array_push($this->openAPINullablesSetToNull, 'adjustment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustment'] = $adjustment; + + return $this; + } + + /** + * Gets holidayType + * + * @return \SynergiTech\Staffology\Model\HolidayType|null + */ + public function getHolidayType(): ?\SynergiTech\Staffology\Model\HolidayType + { + return $this->container['holidayType']; + } + + /** + * Sets holidayType + * + * @param \SynergiTech\Staffology\Model\HolidayType|null $holidayType holidayType + * + * @return $this + */ + public function setHolidayType(?\SynergiTech\Staffology\Model\HolidayType $holidayType): static + { + if (is_null($holidayType)) { + throw new InvalidArgumentException('non-nullable holidayType cannot be null'); + } + $this->container['holidayType'] = $holidayType; + + return $this; + } + + /** + * Gets accrueSetAmount + * + * @return bool|null + */ + public function getAccrueSetAmount(): ?bool + { + return $this->container['accrueSetAmount']; + } + + /** + * Sets accrueSetAmount + * + * @param bool|null $accrueSetAmount If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. + * + * @return $this + */ + public function setAccrueSetAmount(?bool $accrueSetAmount): static + { + if (is_null($accrueSetAmount)) { + throw new InvalidArgumentException('non-nullable accrueSetAmount cannot be null'); + } + $this->container['accrueSetAmount'] = $accrueSetAmount; + + return $this; + } + + /** + * Gets accrueHoursPerDay + * + * @return float|null + */ + public function getAccrueHoursPerDay(): ?float + { + return $this->container['accrueHoursPerDay']; + } + + /** + * Sets accrueHoursPerDay + * + * @param float|null $accrueHoursPerDay If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued + * + * @return $this + */ + public function setAccrueHoursPerDay(?float $accrueHoursPerDay): static + { + if (is_null($accrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable accrueHoursPerDay cannot be null'); + } + $this->container['accrueHoursPerDay'] = $accrueHoursPerDay; + + return $this; + } + + /** + * Gets showAllowanceOnPayslip + * + * @return bool|null + */ + public function getShowAllowanceOnPayslip(): ?bool + { + return $this->container['showAllowanceOnPayslip']; + } + + /** + * Sets showAllowanceOnPayslip + * + * @param bool|null $showAllowanceOnPayslip If true then the remaining Allowance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAllowanceOnPayslip(?bool $showAllowanceOnPayslip): static + { + if (is_null($showAllowanceOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAllowanceOnPayslip cannot be null'); + } + $this->container['showAllowanceOnPayslip'] = $showAllowanceOnPayslip; + + return $this; + } + + /** + * Gets showAhpOnPayslip + * + * @return bool|null + */ + public function getShowAhpOnPayslip(): ?bool + { + return $this->container['showAhpOnPayslip']; + } + + /** + * Sets showAhpOnPayslip + * + * @param bool|null $showAhpOnPayslip If true then the AHP balance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAhpOnPayslip(?bool $showAhpOnPayslip): static + { + if (is_null($showAhpOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAhpOnPayslip cannot be null'); + } + $this->container['showAhpOnPayslip'] = $showAhpOnPayslip; + + return $this; + } + + /** + * Gets accruePaymentInLieuRate + * + * @return float|null + */ + public function getAccruePaymentInLieuRate(): ?float + { + return $this->container['accruePaymentInLieuRate']; + } + + /** + * Sets accruePaymentInLieuRate + * + * @param float|null $accruePaymentInLieuRate The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. + * + * @return $this + */ + public function setAccruePaymentInLieuRate(?float $accruePaymentInLieuRate): static + { + if (is_null($accruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuRate cannot be null'); + } + $this->container['accruePaymentInLieuRate'] = $accruePaymentInLieuRate; + + return $this; + } + + /** + * Gets accruePaymentInLieuAllGrossPay + * + * @return bool|null + * @deprecated + */ + public function getAccruePaymentInLieuAllGrossPay(): ?bool + { + return $this->container['accruePaymentInLieuAllGrossPay']; + } + + /** + * Sets accruePaymentInLieuAllGrossPay + * + * @param bool|null $accruePaymentInLieuAllGrossPay [Deprecated] Please use HolidayAccrualBasis instead. This filed will be removed in a later release. + * + * @return $this + * @deprecated + */ + public function setAccruePaymentInLieuAllGrossPay(?bool $accruePaymentInLieuAllGrossPay): static + { + if (is_null($accruePaymentInLieuAllGrossPay)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuAllGrossPay cannot be null'); + } + $this->container['accruePaymentInLieuAllGrossPay'] = $accruePaymentInLieuAllGrossPay; + + return $this; + } + + /** + * Gets accruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['accruePaymentInLieuPayAutomatically']; + } + + /** + * Sets accruePaymentInLieuPayAutomatically + * + * @param bool|null $accruePaymentInLieuPayAutomatically Set to true if you want employees to be automatically paid any outstanding holiday pay + * + * @return $this + */ + public function setAccruePaymentInLieuPayAutomatically(?bool $accruePaymentInLieuPayAutomatically): static + { + if (is_null($accruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['accruePaymentInLieuPayAutomatically'] = $accruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets occupationalSicknessUniqueId + * + * @return string|null + */ + public function getOccupationalSicknessUniqueId(): ?string + { + return $this->container['occupationalSicknessUniqueId']; + } + + /** + * Sets occupationalSicknessUniqueId + * + * @param string|null $occupationalSicknessUniqueId occupationalSicknessUniqueId + * + * @return $this + */ + public function setOccupationalSicknessUniqueId(?string $occupationalSicknessUniqueId): static + { + if (is_null($occupationalSicknessUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalSicknessUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalSicknessUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalSicknessUniqueId'] = $occupationalSicknessUniqueId; + + return $this; + } + + /** + * Gets accruedPaymentAdjustment + * + * @return float|null + */ + public function getAccruedPaymentAdjustment(): ?float + { + return $this->container['accruedPaymentAdjustment']; + } + + /** + * Sets accruedPaymentAdjustment + * + * @param float|null $accruedPaymentAdjustment Any manual adjustment to the total accrued + * + * @return $this + */ + public function setAccruedPaymentAdjustment(?float $accruedPaymentAdjustment): static + { + if (is_null($accruedPaymentAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedPaymentAdjustment cannot be null'); + } + $this->container['accruedPaymentAdjustment'] = $accruedPaymentAdjustment; + + return $this; + } + + /** + * Gets accruedHoursAdjustment + * + * @return float|null + */ + public function getAccruedHoursAdjustment(): ?float + { + return $this->container['accruedHoursAdjustment']; + } + + /** + * Sets accruedHoursAdjustment + * + * @param float|null $accruedHoursAdjustment Any manual adjustment to the total hours accrued + * + * @return $this + */ + public function setAccruedHoursAdjustment(?float $accruedHoursAdjustment): static + { + if (is_null($accruedHoursAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedHoursAdjustment cannot be null'); + } + $this->container['accruedHoursAdjustment'] = $accruedHoursAdjustment; + + return $this; + } + + /** + * Gets holidayAccrualBasis + * + * @return \SynergiTech\Staffology\Model\HolidayAccrual|null + */ + public function getHolidayAccrualBasis(): ?\SynergiTech\Staffology\Model\HolidayAccrual + { + return $this->container['holidayAccrualBasis']; + } + + /** + * Sets holidayAccrualBasis + * + * @param \SynergiTech\Staffology\Model\HolidayAccrual|null $holidayAccrualBasis holidayAccrualBasis + * + * @return $this + */ + public function setHolidayAccrualBasis(?\SynergiTech\Staffology\Model\HolidayAccrual $holidayAccrualBasis): static + { + if (is_null($holidayAccrualBasis)) { + throw new InvalidArgumentException('non-nullable holidayAccrualBasis cannot be null'); + } + $this->container['holidayAccrualBasis'] = $holidayAccrualBasis; + + return $this; + } + + /** + * Gets holidayAccrualDefaultRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayAccrualDefaultRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayAccrualDefaultRateType']; + } + + /** + * Sets holidayAccrualDefaultRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayAccrualDefaultRateType holidayAccrualDefaultRateType + * + * @return $this + */ + public function setHolidayAccrualDefaultRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayAccrualDefaultRateType): static + { + if (is_null($holidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable holidayAccrualDefaultRateType cannot be null'); + } + $this->container['holidayAccrualDefaultRateType'] = $holidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets useAggregatedServiceDate + * + * @return bool|null + */ + public function getUseAggregatedServiceDate(): ?bool + { + return $this->container['useAggregatedServiceDate']; + } + + /** + * Sets useAggregatedServiceDate + * + * @param bool|null $useAggregatedServiceDate useAggregatedServiceDate + * + * @return $this + */ + public function setUseAggregatedServiceDate(?bool $useAggregatedServiceDate): static + { + if (is_null($useAggregatedServiceDate)) { + throw new InvalidArgumentException('non-nullable useAggregatedServiceDate cannot be null'); + } + $this->container['useAggregatedServiceDate'] = $useAggregatedServiceDate; + + return $this; + } + + /** + * Gets accruePayCodeSetUniqueId + * + * @return string|null + */ + public function getAccruePayCodeSetUniqueId(): ?string + { + return $this->container['accruePayCodeSetUniqueId']; + } + + /** + * Sets accruePayCodeSetUniqueId + * + * @param string|null $accruePayCodeSetUniqueId Pay code set to use for accruing holiday pay + * + * @return $this + */ + public function setAccruePayCodeSetUniqueId(?string $accruePayCodeSetUniqueId): static + { + if (is_null($accruePayCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'accruePayCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accruePayCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accruePayCodeSetUniqueId'] = $accruePayCodeSetUniqueId; + + return $this; + } + + /** + * Gets maximumAccruePeriod + * + * @return float|null + */ + public function getMaximumAccruePeriod(): ?float + { + return $this->container['maximumAccruePeriod']; + } + + /** + * Sets maximumAccruePeriod + * + * @param float|null $maximumAccruePeriod The maximum number of hours capable of being accrued in a single period + * + * @return $this + */ + public function setMaximumAccruePeriod(?float $maximumAccruePeriod): static + { + if (is_null($maximumAccruePeriod)) { + array_push($this->openAPINullablesSetToNull, 'maximumAccruePeriod'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('maximumAccruePeriod', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['maximumAccruePeriod'] = $maximumAccruePeriod; + + return $this; + } + + /** + * Gets holidayLeaveAccrualCustomRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayLeaveAccrualCustomRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayLeaveAccrualCustomRateType']; + } + + /** + * Sets holidayLeaveAccrualCustomRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayLeaveAccrualCustomRateType holidayLeaveAccrualCustomRateType + * + * @return $this + */ + public function setHolidayLeaveAccrualCustomRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayLeaveAccrualCustomRateType): static + { + if (is_null($holidayLeaveAccrualCustomRateType)) { + throw new InvalidArgumentException('non-nullable holidayLeaveAccrualCustomRateType cannot be null'); + } + $this->container['holidayLeaveAccrualCustomRateType'] = $holidayLeaveAccrualCustomRateType; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualDefaultRateType + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualDefaultRateType(): ?bool + { + return $this->container['useDefaultHolidayAccrualDefaultRateType']; + } + + /** + * Sets useDefaultHolidayAccrualDefaultRateType + * + * @param bool|null $useDefaultHolidayAccrualDefaultRateType If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. + * + * @return $this + */ + public function setUseDefaultHolidayAccrualDefaultRateType(?bool $useDefaultHolidayAccrualDefaultRateType): static + { + if (is_null($useDefaultHolidayAccrualDefaultRateType)) { + array_push($this->openAPINullablesSetToNull, 'useDefaultHolidayAccrualDefaultRateType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('useDefaultHolidayAccrualDefaultRateType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['useDefaultHolidayAccrualDefaultRateType'] = $useDefaultHolidayAccrualDefaultRateType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLeaverDetails.php b/src/Model/ContractLeaverDetails.php new file mode 100644 index 0000000..6c52938 --- /dev/null +++ b/src/Model/ContractLeaverDetails.php @@ -0,0 +1,619 @@ + + */ +class ContractLeaverDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LeaverDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'hasLeft' => 'bool', + 'leaveDate' => '\DateTime', + 'isDeceased' => 'bool', + 'paymentAfterLeaving' => 'bool', + 'p45Sent' => 'bool', + 'payAccruedBalance' => 'bool', + 'paymentMethodAfterLeaving' => '\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'hasLeft' => null, + 'leaveDate' => 'date', + 'isDeceased' => null, + 'paymentAfterLeaving' => null, + 'p45Sent' => null, + 'payAccruedBalance' => null, + 'paymentMethodAfterLeaving' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'hasLeft' => false, + 'leaveDate' => true, + 'isDeceased' => false, + 'paymentAfterLeaving' => false, + 'p45Sent' => false, + 'payAccruedBalance' => false, + 'paymentMethodAfterLeaving' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'hasLeft' => 'hasLeft', + 'leaveDate' => 'leaveDate', + 'isDeceased' => 'isDeceased', + 'paymentAfterLeaving' => 'paymentAfterLeaving', + 'p45Sent' => 'p45Sent', + 'payAccruedBalance' => 'payAccruedBalance', + 'paymentMethodAfterLeaving' => 'paymentMethodAfterLeaving' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'hasLeft' => 'setHasLeft', + 'leaveDate' => 'setLeaveDate', + 'isDeceased' => 'setIsDeceased', + 'paymentAfterLeaving' => 'setPaymentAfterLeaving', + 'p45Sent' => 'setP45Sent', + 'payAccruedBalance' => 'setPayAccruedBalance', + 'paymentMethodAfterLeaving' => 'setPaymentMethodAfterLeaving' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'hasLeft' => 'getHasLeft', + 'leaveDate' => 'getLeaveDate', + 'isDeceased' => 'getIsDeceased', + 'paymentAfterLeaving' => 'getPaymentAfterLeaving', + 'p45Sent' => 'getP45Sent', + 'payAccruedBalance' => 'getPayAccruedBalance', + 'paymentMethodAfterLeaving' => 'getPaymentMethodAfterLeaving' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('hasLeft', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('isDeceased', $data ?? [], null); + $this->setIfExists('paymentAfterLeaving', $data ?? [], null); + $this->setIfExists('p45Sent', $data ?? [], null); + $this->setIfExists('payAccruedBalance', $data ?? [], null); + $this->setIfExists('paymentMethodAfterLeaving', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasLeft + * + * @return bool|null + */ + public function getHasLeft(): ?bool + { + return $this->container['hasLeft']; + } + + /** + * Sets hasLeft + * + * @param bool|null $hasLeft hasLeft + * + * @return $this + */ + public function setHasLeft(?bool $hasLeft): static + { + if (is_null($hasLeft)) { + throw new InvalidArgumentException('non-nullable hasLeft cannot be null'); + } + $this->container['hasLeft'] = $hasLeft; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets isDeceased + * + * @return bool|null + */ + public function getIsDeceased(): ?bool + { + return $this->container['isDeceased']; + } + + /** + * Sets isDeceased + * + * @param bool|null $isDeceased isDeceased + * + * @return $this + */ + public function setIsDeceased(?bool $isDeceased): static + { + if (is_null($isDeceased)) { + throw new InvalidArgumentException('non-nullable isDeceased cannot be null'); + } + $this->container['isDeceased'] = $isDeceased; + + return $this; + } + + /** + * Gets paymentAfterLeaving + * + * @return bool|null + */ + public function getPaymentAfterLeaving(): ?bool + { + return $this->container['paymentAfterLeaving']; + } + + /** + * Sets paymentAfterLeaving + * + * @param bool|null $paymentAfterLeaving paymentAfterLeaving + * + * @return $this + */ + public function setPaymentAfterLeaving(?bool $paymentAfterLeaving): static + { + if (is_null($paymentAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentAfterLeaving cannot be null'); + } + $this->container['paymentAfterLeaving'] = $paymentAfterLeaving; + + return $this; + } + + /** + * Gets p45Sent + * + * @return bool|null + */ + public function getP45Sent(): ?bool + { + return $this->container['p45Sent']; + } + + /** + * Sets p45Sent + * + * @param bool|null $p45Sent p45Sent + * + * @return $this + */ + public function setP45Sent(?bool $p45Sent): static + { + if (is_null($p45Sent)) { + throw new InvalidArgumentException('non-nullable p45Sent cannot be null'); + } + $this->container['p45Sent'] = $p45Sent; + + return $this; + } + + /** + * Gets payAccruedBalance + * + * @return bool|null + */ + public function getPayAccruedBalance(): ?bool + { + return $this->container['payAccruedBalance']; + } + + /** + * Sets payAccruedBalance + * + * @param bool|null $payAccruedBalance If set to true then new PayLine will be added into the PayRunEntry to pay the accrued balance + * + * @return $this + */ + public function setPayAccruedBalance(?bool $payAccruedBalance): static + { + if (is_null($payAccruedBalance)) { + throw new InvalidArgumentException('non-nullable payAccruedBalance cannot be null'); + } + $this->container['payAccruedBalance'] = $payAccruedBalance; + + return $this; + } + + /** + * Gets paymentMethodAfterLeaving + * + * @return \SynergiTech\Staffology\Model\PaymentMethodAfterLeaving|null + */ + public function getPaymentMethodAfterLeaving(): ?\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving + { + return $this->container['paymentMethodAfterLeaving']; + } + + /** + * Sets paymentMethodAfterLeaving + * + * @param \SynergiTech\Staffology\Model\PaymentMethodAfterLeaving|null $paymentMethodAfterLeaving paymentMethodAfterLeaving + * + * @return $this + */ + public function setPaymentMethodAfterLeaving(?\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving $paymentMethodAfterLeaving): static + { + if (is_null($paymentMethodAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentMethodAfterLeaving cannot be null'); + } + $this->container['paymentMethodAfterLeaving'] = $paymentMethodAfterLeaving; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLondonAllowanceRequest.php b/src/Model/ContractLondonAllowanceRequest.php new file mode 100644 index 0000000..ea80e93 --- /dev/null +++ b/src/Model/ContractLondonAllowanceRequest.php @@ -0,0 +1,476 @@ + + */ +class ContractLondonAllowanceRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LondonAllowanceRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\LondonAllowanceType', + 'valueType' => '\SynergiTech\Staffology\Model\LondonAllowanceValueType', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'valueType' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'valueType' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'valueType' => 'valueType', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'valueType' => 'setValueType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'valueType' => 'getValueType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valueType', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LondonAllowanceType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LondonAllowanceType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets valueType + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceValueType|null + */ + public function getValueType(): ?\SynergiTech\Staffology\Model\LondonAllowanceValueType + { + return $this->container['valueType']; + } + + /** + * Sets valueType + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceValueType|null $valueType valueType + * + * @return $this + */ + public function setValueType(?\SynergiTech\Staffology\Model\LondonAllowanceValueType $valueType): static + { + if (is_null($valueType)) { + throw new InvalidArgumentException('non-nullable valueType cannot be null'); + } + $this->container['valueType'] = $valueType; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Value of London Allowance + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractLondonAllowanceResponse.php b/src/Model/ContractLondonAllowanceResponse.php new file mode 100644 index 0000000..9773083 --- /dev/null +++ b/src/Model/ContractLondonAllowanceResponse.php @@ -0,0 +1,510 @@ + + */ +class ContractLondonAllowanceResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.LondonAllowanceResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\LondonAllowanceType', + 'valueType' => '\SynergiTech\Staffology\Model\LondonAllowanceValueType', + 'value' => 'float', + 'uniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'valueType' => null, + 'value' => 'double', + 'uniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'valueType' => false, + 'value' => false, + 'uniqueId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'valueType' => 'valueType', + 'value' => 'value', + 'uniqueId' => 'uniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'valueType' => 'setValueType', + 'value' => 'setValue', + 'uniqueId' => 'setUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'valueType' => 'getValueType', + 'value' => 'getValue', + 'uniqueId' => 'getUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valueType', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LondonAllowanceType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LondonAllowanceType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets valueType + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceValueType|null + */ + public function getValueType(): ?\SynergiTech\Staffology\Model\LondonAllowanceValueType + { + return $this->container['valueType']; + } + + /** + * Sets valueType + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceValueType|null $valueType valueType + * + * @return $this + */ + public function setValueType(?\SynergiTech\Staffology\Model\LondonAllowanceValueType $valueType): static + { + if (is_null($valueType)) { + throw new InvalidArgumentException('non-nullable valueType cannot be null'); + } + $this->container['valueType'] = $valueType; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Value of London Allowance + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId London Allowance identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractNetOfOnCostsResponse.php b/src/Model/ContractNetOfOnCostsResponse.php new file mode 100644 index 0000000..2ca7c9e --- /dev/null +++ b/src/Model/ContractNetOfOnCostsResponse.php @@ -0,0 +1,748 @@ + + */ +class ContractNetOfOnCostsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.NetOfOnCostsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'salary' => 'float', + 'holidayPay' => 'float', + 'employersPensionContribution' => 'float', + 'employeesPensionContribution' => 'float', + 'employersNi' => 'float', + 'apprenticeshipLevy' => 'float', + 'grossDailyRate' => 'float', + 'totalFees' => 'float', + 'numberOfDays' => 'float', + 'simulation' => '\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse', + 'holInclusiveSimulation' => '\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'salary' => 'double', + 'holidayPay' => 'double', + 'employersPensionContribution' => 'double', + 'employeesPensionContribution' => 'double', + 'employersNi' => 'double', + 'apprenticeshipLevy' => 'double', + 'grossDailyRate' => 'double', + 'totalFees' => 'double', + 'numberOfDays' => 'double', + 'simulation' => null, + 'holInclusiveSimulation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'salary' => false, + 'holidayPay' => false, + 'employersPensionContribution' => false, + 'employeesPensionContribution' => false, + 'employersNi' => false, + 'apprenticeshipLevy' => false, + 'grossDailyRate' => false, + 'totalFees' => false, + 'numberOfDays' => false, + 'simulation' => false, + 'holInclusiveSimulation' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'salary' => 'salary', + 'holidayPay' => 'holidayPay', + 'employersPensionContribution' => 'employersPensionContribution', + 'employeesPensionContribution' => 'employeesPensionContribution', + 'employersNi' => 'employersNi', + 'apprenticeshipLevy' => 'apprenticeshipLevy', + 'grossDailyRate' => 'grossDailyRate', + 'totalFees' => 'totalFees', + 'numberOfDays' => 'numberOfDays', + 'simulation' => 'simulation', + 'holInclusiveSimulation' => 'holInclusiveSimulation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'salary' => 'setSalary', + 'holidayPay' => 'setHolidayPay', + 'employersPensionContribution' => 'setEmployersPensionContribution', + 'employeesPensionContribution' => 'setEmployeesPensionContribution', + 'employersNi' => 'setEmployersNi', + 'apprenticeshipLevy' => 'setApprenticeshipLevy', + 'grossDailyRate' => 'setGrossDailyRate', + 'totalFees' => 'setTotalFees', + 'numberOfDays' => 'setNumberOfDays', + 'simulation' => 'setSimulation', + 'holInclusiveSimulation' => 'setHolInclusiveSimulation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'salary' => 'getSalary', + 'holidayPay' => 'getHolidayPay', + 'employersPensionContribution' => 'getEmployersPensionContribution', + 'employeesPensionContribution' => 'getEmployeesPensionContribution', + 'employersNi' => 'getEmployersNi', + 'apprenticeshipLevy' => 'getApprenticeshipLevy', + 'grossDailyRate' => 'getGrossDailyRate', + 'totalFees' => 'getTotalFees', + 'numberOfDays' => 'getNumberOfDays', + 'simulation' => 'getSimulation', + 'holInclusiveSimulation' => 'getHolInclusiveSimulation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('salary', $data ?? [], null); + $this->setIfExists('holidayPay', $data ?? [], null); + $this->setIfExists('employersPensionContribution', $data ?? [], null); + $this->setIfExists('employeesPensionContribution', $data ?? [], null); + $this->setIfExists('employersNi', $data ?? [], null); + $this->setIfExists('apprenticeshipLevy', $data ?? [], null); + $this->setIfExists('grossDailyRate', $data ?? [], null); + $this->setIfExists('totalFees', $data ?? [], null); + $this->setIfExists('numberOfDays', $data ?? [], null); + $this->setIfExists('simulation', $data ?? [], null); + $this->setIfExists('holInclusiveSimulation', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets salary + * + * @return float|null + */ + public function getSalary(): ?float + { + return $this->container['salary']; + } + + /** + * Sets salary + * + * @param float|null $salary salary + * + * @return $this + */ + public function setSalary(?float $salary): static + { + if (is_null($salary)) { + throw new InvalidArgumentException('non-nullable salary cannot be null'); + } + $this->container['salary'] = $salary; + + return $this; + } + + /** + * Gets holidayPay + * + * @return float|null + */ + public function getHolidayPay(): ?float + { + return $this->container['holidayPay']; + } + + /** + * Sets holidayPay + * + * @param float|null $holidayPay holidayPay + * + * @return $this + */ + public function setHolidayPay(?float $holidayPay): static + { + if (is_null($holidayPay)) { + throw new InvalidArgumentException('non-nullable holidayPay cannot be null'); + } + $this->container['holidayPay'] = $holidayPay; + + return $this; + } + + /** + * Gets employersPensionContribution + * + * @return float|null + */ + public function getEmployersPensionContribution(): ?float + { + return $this->container['employersPensionContribution']; + } + + /** + * Sets employersPensionContribution + * + * @param float|null $employersPensionContribution employersPensionContribution + * + * @return $this + */ + public function setEmployersPensionContribution(?float $employersPensionContribution): static + { + if (is_null($employersPensionContribution)) { + throw new InvalidArgumentException('non-nullable employersPensionContribution cannot be null'); + } + $this->container['employersPensionContribution'] = $employersPensionContribution; + + return $this; + } + + /** + * Gets employeesPensionContribution + * + * @return float|null + */ + public function getEmployeesPensionContribution(): ?float + { + return $this->container['employeesPensionContribution']; + } + + /** + * Sets employeesPensionContribution + * + * @param float|null $employeesPensionContribution employeesPensionContribution + * + * @return $this + */ + public function setEmployeesPensionContribution(?float $employeesPensionContribution): static + { + if (is_null($employeesPensionContribution)) { + throw new InvalidArgumentException('non-nullable employeesPensionContribution cannot be null'); + } + $this->container['employeesPensionContribution'] = $employeesPensionContribution; + + return $this; + } + + /** + * Gets employersNi + * + * @return float|null + */ + public function getEmployersNi(): ?float + { + return $this->container['employersNi']; + } + + /** + * Sets employersNi + * + * @param float|null $employersNi employersNi + * + * @return $this + */ + public function setEmployersNi(?float $employersNi): static + { + if (is_null($employersNi)) { + throw new InvalidArgumentException('non-nullable employersNi cannot be null'); + } + $this->container['employersNi'] = $employersNi; + + return $this; + } + + /** + * Gets apprenticeshipLevy + * + * @return float|null + */ + public function getApprenticeshipLevy(): ?float + { + return $this->container['apprenticeshipLevy']; + } + + /** + * Sets apprenticeshipLevy + * + * @param float|null $apprenticeshipLevy apprenticeshipLevy + * + * @return $this + */ + public function setApprenticeshipLevy(?float $apprenticeshipLevy): static + { + if (is_null($apprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevy cannot be null'); + } + $this->container['apprenticeshipLevy'] = $apprenticeshipLevy; + + return $this; + } + + /** + * Gets grossDailyRate + * + * @return float|null + */ + public function getGrossDailyRate(): ?float + { + return $this->container['grossDailyRate']; + } + + /** + * Sets grossDailyRate + * + * @param float|null $grossDailyRate grossDailyRate + * + * @return $this + */ + public function setGrossDailyRate(?float $grossDailyRate): static + { + if (is_null($grossDailyRate)) { + throw new InvalidArgumentException('non-nullable grossDailyRate cannot be null'); + } + $this->container['grossDailyRate'] = $grossDailyRate; + + return $this; + } + + /** + * Gets totalFees + * + * @return float|null + */ + public function getTotalFees(): ?float + { + return $this->container['totalFees']; + } + + /** + * Sets totalFees + * + * @param float|null $totalFees totalFees + * + * @return $this + */ + public function setTotalFees(?float $totalFees): static + { + if (is_null($totalFees)) { + throw new InvalidArgumentException('non-nullable totalFees cannot be null'); + } + $this->container['totalFees'] = $totalFees; + + return $this; + } + + /** + * Gets numberOfDays + * + * @return float|null + */ + public function getNumberOfDays(): ?float + { + return $this->container['numberOfDays']; + } + + /** + * Sets numberOfDays + * + * @param float|null $numberOfDays numberOfDays + * + * @return $this + */ + public function setNumberOfDays(?float $numberOfDays): static + { + if (is_null($numberOfDays)) { + throw new InvalidArgumentException('non-nullable numberOfDays cannot be null'); + } + $this->container['numberOfDays'] = $numberOfDays; + + return $this; + } + + /** + * Gets simulation + * + * @return \SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse|null + */ + public function getSimulation(): ?\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse + { + return $this->container['simulation']; + } + + /** + * Sets simulation + * + * @param \SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse|null $simulation simulation + * + * @return $this + */ + public function setSimulation(?\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse $simulation): static + { + if (is_null($simulation)) { + throw new InvalidArgumentException('non-nullable simulation cannot be null'); + } + $this->container['simulation'] = $simulation; + + return $this; + } + + /** + * Gets holInclusiveSimulation + * + * @return \SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse|null + */ + public function getHolInclusiveSimulation(): ?\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse + { + return $this->container['holInclusiveSimulation']; + } + + /** + * Sets holInclusiveSimulation + * + * @param \SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse|null $holInclusiveSimulation holInclusiveSimulation + * + * @return $this + */ + public function setHolInclusiveSimulation(?\SynergiTech\Staffology\Model\ContractNetOfOnCostsSimulationResponse $holInclusiveSimulation): static + { + if (is_null($holInclusiveSimulation)) { + throw new InvalidArgumentException('non-nullable holInclusiveSimulation cannot be null'); + } + $this->container['holInclusiveSimulation'] = $holInclusiveSimulation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractNetOfOnCostsSimulationResponse.php b/src/Model/ContractNetOfOnCostsSimulationResponse.php new file mode 100644 index 0000000..0aaed50 --- /dev/null +++ b/src/Model/ContractNetOfOnCostsSimulationResponse.php @@ -0,0 +1,544 @@ + + */ +class ContractNetOfOnCostsSimulationResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.NetOfOnCostsSimulationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'grossPay' => 'float', + 'employeePension' => 'float', + 'taxDue' => 'float', + 'niDue' => 'float', + 'netPay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'grossPay' => 'double', + 'employeePension' => 'double', + 'taxDue' => 'double', + 'niDue' => 'double', + 'netPay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'grossPay' => false, + 'employeePension' => false, + 'taxDue' => false, + 'niDue' => false, + 'netPay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'grossPay' => 'grossPay', + 'employeePension' => 'employeePension', + 'taxDue' => 'taxDue', + 'niDue' => 'niDue', + 'netPay' => 'netPay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'grossPay' => 'setGrossPay', + 'employeePension' => 'setEmployeePension', + 'taxDue' => 'setTaxDue', + 'niDue' => 'setNiDue', + 'netPay' => 'setNetPay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'grossPay' => 'getGrossPay', + 'employeePension' => 'getEmployeePension', + 'taxDue' => 'getTaxDue', + 'niDue' => 'getNiDue', + 'netPay' => 'getNetPay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('grossPay', $data ?? [], null); + $this->setIfExists('employeePension', $data ?? [], null); + $this->setIfExists('taxDue', $data ?? [], null); + $this->setIfExists('niDue', $data ?? [], null); + $this->setIfExists('netPay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets grossPay + * + * @return float|null + */ + public function getGrossPay(): ?float + { + return $this->container['grossPay']; + } + + /** + * Sets grossPay + * + * @param float|null $grossPay grossPay + * + * @return $this + */ + public function setGrossPay(?float $grossPay): static + { + if (is_null($grossPay)) { + throw new InvalidArgumentException('non-nullable grossPay cannot be null'); + } + $this->container['grossPay'] = $grossPay; + + return $this; + } + + /** + * Gets employeePension + * + * @return float|null + */ + public function getEmployeePension(): ?float + { + return $this->container['employeePension']; + } + + /** + * Sets employeePension + * + * @param float|null $employeePension employeePension + * + * @return $this + */ + public function setEmployeePension(?float $employeePension): static + { + if (is_null($employeePension)) { + throw new InvalidArgumentException('non-nullable employeePension cannot be null'); + } + $this->container['employeePension'] = $employeePension; + + return $this; + } + + /** + * Gets taxDue + * + * @return float|null + */ + public function getTaxDue(): ?float + { + return $this->container['taxDue']; + } + + /** + * Sets taxDue + * + * @param float|null $taxDue taxDue + * + * @return $this + */ + public function setTaxDue(?float $taxDue): static + { + if (is_null($taxDue)) { + throw new InvalidArgumentException('non-nullable taxDue cannot be null'); + } + $this->container['taxDue'] = $taxDue; + + return $this; + } + + /** + * Gets niDue + * + * @return float|null + */ + public function getNiDue(): ?float + { + return $this->container['niDue']; + } + + /** + * Sets niDue + * + * @param float|null $niDue niDue + * + * @return $this + */ + public function setNiDue(?float $niDue): static + { + if (is_null($niDue)) { + throw new InvalidArgumentException('non-nullable niDue cannot be null'); + } + $this->container['niDue'] = $niDue; + + return $this; + } + + /** + * Gets netPay + * + * @return float|null + */ + public function getNetPay(): ?float + { + return $this->container['netPay']; + } + + /** + * Sets netPay + * + * @param float|null $netPay netPay + * + * @return $this + */ + public function setNetPay(?float $netPay): static + { + if (is_null($netPay)) { + throw new InvalidArgumentException('non-nullable netPay cannot be null'); + } + $this->container['netPay'] = $netPay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractOverseasEmployerDetails.php b/src/Model/ContractOverseasEmployerDetails.php new file mode 100644 index 0000000..871d1c5 --- /dev/null +++ b/src/Model/ContractOverseasEmployerDetails.php @@ -0,0 +1,510 @@ + + */ +class ContractOverseasEmployerDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.OverseasEmployerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'overseasEmployer' => 'bool', + 'overseasSecondmentStatus' => '\SynergiTech\Staffology\Model\OverseasSecondmentStatus', + 'eeaCitizen' => 'bool', + 'epm6Scheme' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'overseasEmployer' => null, + 'overseasSecondmentStatus' => null, + 'eeaCitizen' => null, + 'epm6Scheme' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'overseasEmployer' => false, + 'overseasSecondmentStatus' => false, + 'eeaCitizen' => false, + 'epm6Scheme' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'overseasEmployer' => 'overseasEmployer', + 'overseasSecondmentStatus' => 'overseasSecondmentStatus', + 'eeaCitizen' => 'eeaCitizen', + 'epm6Scheme' => 'epm6Scheme' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'overseasEmployer' => 'setOverseasEmployer', + 'overseasSecondmentStatus' => 'setOverseasSecondmentStatus', + 'eeaCitizen' => 'setEeaCitizen', + 'epm6Scheme' => 'setEpm6Scheme' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'overseasEmployer' => 'getOverseasEmployer', + 'overseasSecondmentStatus' => 'getOverseasSecondmentStatus', + 'eeaCitizen' => 'getEeaCitizen', + 'epm6Scheme' => 'getEpm6Scheme' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('overseasEmployer', $data ?? [], null); + $this->setIfExists('overseasSecondmentStatus', $data ?? [], null); + $this->setIfExists('eeaCitizen', $data ?? [], null); + $this->setIfExists('epm6Scheme', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets overseasEmployer + * + * @return bool|null + */ + public function getOverseasEmployer(): ?bool + { + return $this->container['overseasEmployer']; + } + + /** + * Sets overseasEmployer + * + * @param bool|null $overseasEmployer overseasEmployer + * + * @return $this + */ + public function setOverseasEmployer(?bool $overseasEmployer): static + { + if (is_null($overseasEmployer)) { + throw new InvalidArgumentException('non-nullable overseasEmployer cannot be null'); + } + $this->container['overseasEmployer'] = $overseasEmployer; + + return $this; + } + + /** + * Gets overseasSecondmentStatus + * + * @return \SynergiTech\Staffology\Model\OverseasSecondmentStatus|null + */ + public function getOverseasSecondmentStatus(): ?\SynergiTech\Staffology\Model\OverseasSecondmentStatus + { + return $this->container['overseasSecondmentStatus']; + } + + /** + * Sets overseasSecondmentStatus + * + * @param \SynergiTech\Staffology\Model\OverseasSecondmentStatus|null $overseasSecondmentStatus overseasSecondmentStatus + * + * @return $this + */ + public function setOverseasSecondmentStatus(?\SynergiTech\Staffology\Model\OverseasSecondmentStatus $overseasSecondmentStatus): static + { + if (is_null($overseasSecondmentStatus)) { + throw new InvalidArgumentException('non-nullable overseasSecondmentStatus cannot be null'); + } + $this->container['overseasSecondmentStatus'] = $overseasSecondmentStatus; + + return $this; + } + + /** + * Gets eeaCitizen + * + * @return bool|null + */ + public function getEeaCitizen(): ?bool + { + return $this->container['eeaCitizen']; + } + + /** + * Sets eeaCitizen + * + * @param bool|null $eeaCitizen eeaCitizen + * + * @return $this + */ + public function setEeaCitizen(?bool $eeaCitizen): static + { + if (is_null($eeaCitizen)) { + throw new InvalidArgumentException('non-nullable eeaCitizen cannot be null'); + } + $this->container['eeaCitizen'] = $eeaCitizen; + + return $this; + } + + /** + * Gets epm6Scheme + * + * @return bool|null + */ + public function getEpm6Scheme(): ?bool + { + return $this->container['epm6Scheme']; + } + + /** + * Sets epm6Scheme + * + * @param bool|null $epm6Scheme epm6Scheme + * + * @return $this + */ + public function setEpm6Scheme(?bool $epm6Scheme): static + { + if (is_null($epm6Scheme)) { + throw new InvalidArgumentException('non-nullable epm6Scheme cannot be null'); + } + $this->container['epm6Scheme'] = $epm6Scheme; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractP11HistoryRequest.php b/src/Model/ContractP11HistoryRequest.php new file mode 100644 index 0000000..d2146fb --- /dev/null +++ b/src/Model/ContractP11HistoryRequest.php @@ -0,0 +1,544 @@ + + */ +class ContractP11HistoryRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.P11HistoryRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'periodNumber' => 'int', + 'niablePay' => 'float', + 'payDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'niablePay' => 'double', + 'payDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'niablePay' => false, + 'payDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'niablePay' => 'niablePay', + 'payDate' => 'payDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'niablePay' => 'setNiablePay', + 'payDate' => 'setPayDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'niablePay' => 'getNiablePay', + 'payDate' => 'getPayDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('niablePay', $data ?? [], null); + $this->setIfExists('payDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber periodNumber + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets niablePay + * + * @return float|null + */ + public function getNiablePay(): ?float + { + return $this->container['niablePay']; + } + + /** + * Sets niablePay + * + * @param float|null $niablePay niablePay + * + * @return $this + */ + public function setNiablePay(?float $niablePay): static + { + if (is_null($niablePay)) { + throw new InvalidArgumentException('non-nullable niablePay cannot be null'); + } + $this->container['niablePay'] = $niablePay; + + return $this; + } + + /** + * Gets payDate + * + * @return \DateTime|null + */ + public function getPayDate(): ?\DateTime + { + return $this->container['payDate']; + } + + /** + * Sets payDate + * + * @param \DateTime|null $payDate payDate + * + * @return $this + */ + public function setPayDate(?\DateTime $payDate): static + { + if (is_null($payDate)) { + throw new InvalidArgumentException('non-nullable payDate cannot be null'); + } + $this->container['payDate'] = $payDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractP11HistoryResponse.php b/src/Model/ContractP11HistoryResponse.php new file mode 100644 index 0000000..f4021e9 --- /dev/null +++ b/src/Model/ContractP11HistoryResponse.php @@ -0,0 +1,578 @@ + + */ +class ContractP11HistoryResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.P11HistoryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'periodNumber' => 'int', + 'niablePay' => 'float', + 'payDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'niablePay' => 'double', + 'payDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'niablePay' => false, + 'payDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'niablePay' => 'niablePay', + 'payDate' => 'payDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'niablePay' => 'setNiablePay', + 'payDate' => 'setPayDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'niablePay' => 'getNiablePay', + 'payDate' => 'getPayDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('niablePay', $data ?? [], null); + $this->setIfExists('payDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber periodNumber + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets niablePay + * + * @return float|null + */ + public function getNiablePay(): ?float + { + return $this->container['niablePay']; + } + + /** + * Sets niablePay + * + * @param float|null $niablePay niablePay + * + * @return $this + */ + public function setNiablePay(?float $niablePay): static + { + if (is_null($niablePay)) { + throw new InvalidArgumentException('non-nullable niablePay cannot be null'); + } + $this->container['niablePay'] = $niablePay; + + return $this; + } + + /** + * Gets payDate + * + * @return \DateTime|null + */ + public function getPayDate(): ?\DateTime + { + return $this->container['payDate']; + } + + /** + * Sets payDate + * + * @param \DateTime|null $payDate payDate + * + * @return $this + */ + public function setPayDate(?\DateTime $payDate): static + { + if (is_null($payDate)) { + throw new InvalidArgumentException('non-nullable payDate cannot be null'); + } + $this->container['payDate'] = $payDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPartnerDetails.php b/src/Model/ContractPartnerDetails.php new file mode 100644 index 0000000..801df46 --- /dev/null +++ b/src/Model/ContractPartnerDetails.php @@ -0,0 +1,570 @@ + + */ +class ContractPartnerDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PartnerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'firstName' => 'string', + 'initials' => 'string', + 'lastName' => 'string', + 'niNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'firstName' => null, + 'initials' => null, + 'lastName' => null, + 'niNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'firstName' => true, + 'initials' => true, + 'lastName' => true, + 'niNumber' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'firstName' => 'firstName', + 'initials' => 'initials', + 'lastName' => 'lastName', + 'niNumber' => 'niNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'firstName' => 'setFirstName', + 'initials' => 'setInitials', + 'lastName' => 'setLastName', + 'niNumber' => 'setNiNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'firstName' => 'getFirstName', + 'initials' => 'getInitials', + 'lastName' => 'getLastName', + 'niNumber' => 'getNiNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('initials', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 35)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['initials']) && (mb_strlen($this->container['initials']) > 30)) { + $invalidProperties[] = "invalid value for 'initials', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 35)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['niNumber']) && (mb_strlen($this->container['niNumber']) > 15)) { + $invalidProperties[] = "invalid value for 'niNumber', the character length must be smaller than or equal to 15."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 35)) { + throw new InvalidArgumentException('invalid length for $firstName when calling ContractPartnerDetails., must be smaller than or equal to 35.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets initials + * + * @return string|null + */ + public function getInitials(): ?string + { + return $this->container['initials']; + } + + /** + * Sets initials + * + * @param string|null $initials initials + * + * @return $this + */ + public function setInitials(?string $initials): static + { + if (is_null($initials)) { + array_push($this->openAPINullablesSetToNull, 'initials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($initials) && (mb_strlen($initials) > 30)) { + throw new InvalidArgumentException('invalid length for $initials when calling ContractPartnerDetails., must be smaller than or equal to 30.'); + } + + $this->container['initials'] = $initials; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 35)) { + throw new InvalidArgumentException('invalid length for $lastName when calling ContractPartnerDetails., must be smaller than or equal to 35.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($niNumber) && (mb_strlen($niNumber) > 15)) { + throw new InvalidArgumentException('invalid length for $niNumber when calling ContractPartnerDetails., must be smaller than or equal to 15.'); + } + + $this->container['niNumber'] = $niNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayHistoryRequest.php b/src/Model/ContractPayHistoryRequest.php new file mode 100644 index 0000000..09e909e --- /dev/null +++ b/src/Model/ContractPayHistoryRequest.php @@ -0,0 +1,680 @@ + + */ +class ContractPayHistoryRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayHistoryRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeId' => 'string', + 'employeeRoleId' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYearTypes', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriodTypes', + 'periodNumber' => 'int', + 'payAmount' => 'float', + 'hours' => 'float', + 'isStatutoryPayOnly' => 'bool', + 'paymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeId' => 'uuid', + 'employeeRoleId' => 'uuid', + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'payAmount' => 'double', + 'hours' => 'double', + 'isStatutoryPayOnly' => null, + 'paymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeId' => false, + 'employeeRoleId' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'payAmount' => false, + 'hours' => false, + 'isStatutoryPayOnly' => false, + 'paymentDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeId' => 'employeeId', + 'employeeRoleId' => 'employeeRoleId', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'payAmount' => 'payAmount', + 'hours' => 'hours', + 'isStatutoryPayOnly' => 'isStatutoryPayOnly', + 'paymentDate' => 'paymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeId' => 'setEmployeeId', + 'employeeRoleId' => 'setEmployeeRoleId', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'payAmount' => 'setPayAmount', + 'hours' => 'setHours', + 'isStatutoryPayOnly' => 'setIsStatutoryPayOnly', + 'paymentDate' => 'setPaymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeId' => 'getEmployeeId', + 'employeeRoleId' => 'getEmployeeRoleId', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'payAmount' => 'getPayAmount', + 'hours' => 'getHours', + 'isStatutoryPayOnly' => 'getIsStatutoryPayOnly', + 'paymentDate' => 'getPaymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('employeeRoleId', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('isStatutoryPayOnly', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId Employee unique Id + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets employeeRoleId + * + * @return string|null + */ + public function getEmployeeRoleId(): ?string + { + return $this->container['employeeRoleId']; + } + + /** + * Sets employeeRoleId + * + * @param string|null $employeeRoleId Employee role unique Id + * + * @return $this + */ + public function setEmployeeRoleId(?string $employeeRoleId): static + { + if (is_null($employeeRoleId)) { + throw new InvalidArgumentException('non-nullable employeeRoleId cannot be null'); + } + $this->container['employeeRoleId'] = $employeeRoleId; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYearTypes|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYearTypes + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYearTypes|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYearTypes $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriodTypes|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriodTypes + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriodTypes|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriodTypes $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber Tax Week or Tax Month number this PayRunEntry relates to + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount monetary amount for given period, if not provided then 0 + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours decimal amount of hours worked, if not provided then 0 + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets isStatutoryPayOnly + * + * @return bool|null + */ + public function getIsStatutoryPayOnly(): ?bool + { + return $this->container['isStatutoryPayOnly']; + } + + /** + * Sets isStatutoryPayOnly + * + * @param bool|null $isStatutoryPayOnly optional boolean flag, if the period only had SXP present + * + * @return $this + */ + public function setIsStatutoryPayOnly(?bool $isStatutoryPayOnly): static + { + if (is_null($isStatutoryPayOnly)) { + throw new InvalidArgumentException('non-nullable isStatutoryPayOnly cannot be null'); + } + $this->container['isStatutoryPayOnly'] = $isStatutoryPayOnly; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate The date payment was made for respective period + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayHistoryResponse.php b/src/Model/ContractPayHistoryResponse.php new file mode 100644 index 0000000..1b6de79 --- /dev/null +++ b/src/Model/ContractPayHistoryResponse.php @@ -0,0 +1,714 @@ + + */ +class ContractPayHistoryResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayHistoryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'employeeId' => 'string', + 'employeeRoleId' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYearTypes', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriodTypes', + 'periodNumber' => 'int', + 'payAmount' => 'float', + 'hours' => 'float', + 'isStatutoryPayOnly' => 'bool', + 'paymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'employeeId' => 'uuid', + 'employeeRoleId' => 'uuid', + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'payAmount' => 'double', + 'hours' => 'double', + 'isStatutoryPayOnly' => null, + 'paymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employeeId' => false, + 'employeeRoleId' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'payAmount' => false, + 'hours' => false, + 'isStatutoryPayOnly' => false, + 'paymentDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employeeId' => 'employeeId', + 'employeeRoleId' => 'employeeRoleId', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'payAmount' => 'payAmount', + 'hours' => 'hours', + 'isStatutoryPayOnly' => 'isStatutoryPayOnly', + 'paymentDate' => 'paymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employeeId' => 'setEmployeeId', + 'employeeRoleId' => 'setEmployeeRoleId', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'payAmount' => 'setPayAmount', + 'hours' => 'setHours', + 'isStatutoryPayOnly' => 'setIsStatutoryPayOnly', + 'paymentDate' => 'setPaymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employeeId' => 'getEmployeeId', + 'employeeRoleId' => 'getEmployeeRoleId', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'payAmount' => 'getPayAmount', + 'hours' => 'getHours', + 'isStatutoryPayOnly' => 'getIsStatutoryPayOnly', + 'paymentDate' => 'getPaymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('employeeRoleId', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('isStatutoryPayOnly', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Average Holiday Pay History identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId Employee unique Id + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets employeeRoleId + * + * @return string|null + */ + public function getEmployeeRoleId(): ?string + { + return $this->container['employeeRoleId']; + } + + /** + * Sets employeeRoleId + * + * @param string|null $employeeRoleId Employee role unique Id + * + * @return $this + */ + public function setEmployeeRoleId(?string $employeeRoleId): static + { + if (is_null($employeeRoleId)) { + throw new InvalidArgumentException('non-nullable employeeRoleId cannot be null'); + } + $this->container['employeeRoleId'] = $employeeRoleId; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYearTypes|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYearTypes + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYearTypes|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYearTypes $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriodTypes|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriodTypes + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriodTypes|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriodTypes $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber Tax Week or Tax Month number this PayRunEntry relates to + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount monetary amount for given period, if not provided then 0 + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours decimal amount of hours worked, if not provided then 0 + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets isStatutoryPayOnly + * + * @return bool|null + */ + public function getIsStatutoryPayOnly(): ?bool + { + return $this->container['isStatutoryPayOnly']; + } + + /** + * Sets isStatutoryPayOnly + * + * @param bool|null $isStatutoryPayOnly optional boolean flag, if the period only had SXP present + * + * @return $this + */ + public function setIsStatutoryPayOnly(?bool $isStatutoryPayOnly): static + { + if (is_null($isStatutoryPayOnly)) { + throw new InvalidArgumentException('non-nullable isStatutoryPayOnly cannot be null'); + } + $this->container['isStatutoryPayOnly'] = $isStatutoryPayOnly; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate The date payment was made for respective period + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayHistoryUpdateRequest.php b/src/Model/ContractPayHistoryUpdateRequest.php new file mode 100644 index 0000000..74538e2 --- /dev/null +++ b/src/Model/ContractPayHistoryUpdateRequest.php @@ -0,0 +1,714 @@ + + */ +class ContractPayHistoryUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayHistoryUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'employeeId' => 'string', + 'employeeRoleId' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYearTypes', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriodTypes', + 'periodNumber' => 'int', + 'payAmount' => 'float', + 'hours' => 'float', + 'isStatutoryPayOnly' => 'bool', + 'paymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'employeeId' => 'uuid', + 'employeeRoleId' => 'uuid', + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'payAmount' => 'double', + 'hours' => 'double', + 'isStatutoryPayOnly' => null, + 'paymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employeeId' => false, + 'employeeRoleId' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'payAmount' => false, + 'hours' => false, + 'isStatutoryPayOnly' => false, + 'paymentDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employeeId' => 'employeeId', + 'employeeRoleId' => 'employeeRoleId', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'payAmount' => 'payAmount', + 'hours' => 'hours', + 'isStatutoryPayOnly' => 'isStatutoryPayOnly', + 'paymentDate' => 'paymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employeeId' => 'setEmployeeId', + 'employeeRoleId' => 'setEmployeeRoleId', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'payAmount' => 'setPayAmount', + 'hours' => 'setHours', + 'isStatutoryPayOnly' => 'setIsStatutoryPayOnly', + 'paymentDate' => 'setPaymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employeeId' => 'getEmployeeId', + 'employeeRoleId' => 'getEmployeeRoleId', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'payAmount' => 'getPayAmount', + 'hours' => 'getHours', + 'isStatutoryPayOnly' => 'getIsStatutoryPayOnly', + 'paymentDate' => 'getPaymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('employeeRoleId', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('isStatutoryPayOnly', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Average Holiday Pay History identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId Employee unique Id + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets employeeRoleId + * + * @return string|null + */ + public function getEmployeeRoleId(): ?string + { + return $this->container['employeeRoleId']; + } + + /** + * Sets employeeRoleId + * + * @param string|null $employeeRoleId Employee role unique Id + * + * @return $this + */ + public function setEmployeeRoleId(?string $employeeRoleId): static + { + if (is_null($employeeRoleId)) { + throw new InvalidArgumentException('non-nullable employeeRoleId cannot be null'); + } + $this->container['employeeRoleId'] = $employeeRoleId; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYearTypes|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYearTypes + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYearTypes|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYearTypes $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriodTypes|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriodTypes + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriodTypes|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriodTypes $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber Tax Week or Tax Month number this PayRunEntry relates to + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount monetary amount for given period, if not provided then 0 + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours decimal amount of hours worked, if not provided then 0 + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets isStatutoryPayOnly + * + * @return bool|null + */ + public function getIsStatutoryPayOnly(): ?bool + { + return $this->container['isStatutoryPayOnly']; + } + + /** + * Sets isStatutoryPayOnly + * + * @param bool|null $isStatutoryPayOnly optional boolean flag, if the period only had SXP present + * + * @return $this + */ + public function setIsStatutoryPayOnly(?bool $isStatutoryPayOnly): static + { + if (is_null($isStatutoryPayOnly)) { + throw new InvalidArgumentException('non-nullable isStatutoryPayOnly cannot be null'); + } + $this->container['isStatutoryPayOnly'] = $isStatutoryPayOnly; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate The date payment was made for respective period + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayLineRequest.php b/src/Model/ContractPayLineRequest.php new file mode 100644 index 0000000..3135043 --- /dev/null +++ b/src/Model/ContractPayLineRequest.php @@ -0,0 +1,1836 @@ + + */ +class ContractPayLineRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayLineRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'analysisCategoryCodesJson' => 'string', + 'value' => 'float', + 'rate' => 'float', + 'multiplier' => 'float', + 'description' => 'string', + 'code' => 'string', + 'tags' => 'string[]', + 'childId' => 'string', + 'isNetToGross' => 'bool', + 'targetNetToGrossValue' => 'float', + 'netToGrossDiscrepancy' => 'float', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'isAutoGeneratedBasicPayLine' => 'bool', + 'percentageOfEffectiveDays' => 'float', + 'totalWorkingDays' => 'float', + 'autoAdjustForLeave' => 'bool', + 'isAutomaticBackPay' => 'bool', + 'ignoreInitialBackPay' => 'bool', + 'contributesToBasicPay' => 'bool', + 'calculateAsWhenPaid' => 'bool', + 'totalPaidDays' => 'float', + 'roleId' => 'string', + 'earnedFrom' => '\DateTime', + 'earnedTo' => '\DateTime', + 'annualValue' => 'float', + 'department' => 'string', + 'costCentre' => 'string', + 'departmentId' => 'string', + 'costCentreId' => 'string', + 'analysisCategoriesCodes' => '\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]', + 'analysisCategoryCodeIds' => 'string[]', + 'paySpineId' => 'string', + 'paySpineGradeId' => 'string', + 'spinalPointId' => 'string', + 'londonAllowanceId' => 'int', + 'fullTimeAnnualValue' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'analysisCategoryCodesJson' => null, + 'value' => 'double', + 'rate' => 'double', + 'multiplier' => 'double', + 'description' => null, + 'code' => null, + 'tags' => null, + 'childId' => 'uuid', + 'isNetToGross' => null, + 'targetNetToGrossValue' => 'double', + 'netToGrossDiscrepancy' => 'double', + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'isAutoGeneratedBasicPayLine' => null, + 'percentageOfEffectiveDays' => 'double', + 'totalWorkingDays' => 'double', + 'autoAdjustForLeave' => null, + 'isAutomaticBackPay' => null, + 'ignoreInitialBackPay' => null, + 'contributesToBasicPay' => null, + 'calculateAsWhenPaid' => null, + 'totalPaidDays' => 'double', + 'roleId' => 'uuid', + 'earnedFrom' => 'date', + 'earnedTo' => 'date', + 'annualValue' => 'double', + 'department' => null, + 'costCentre' => null, + 'departmentId' => 'uuid', + 'costCentreId' => 'uuid', + 'analysisCategoriesCodes' => null, + 'analysisCategoryCodeIds' => 'uuid', + 'paySpineId' => 'uuid', + 'paySpineGradeId' => 'uuid', + 'spinalPointId' => 'uuid', + 'londonAllowanceId' => 'int32', + 'fullTimeAnnualValue' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'analysisCategoryCodesJson' => true, + 'value' => false, + 'rate' => true, + 'multiplier' => true, + 'description' => true, + 'code' => true, + 'tags' => true, + 'childId' => true, + 'isNetToGross' => false, + 'targetNetToGrossValue' => true, + 'netToGrossDiscrepancy' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'isAutoGeneratedBasicPayLine' => false, + 'percentageOfEffectiveDays' => true, + 'totalWorkingDays' => true, + 'autoAdjustForLeave' => false, + 'isAutomaticBackPay' => false, + 'ignoreInitialBackPay' => false, + 'contributesToBasicPay' => false, + 'calculateAsWhenPaid' => false, + 'totalPaidDays' => true, + 'roleId' => true, + 'earnedFrom' => true, + 'earnedTo' => true, + 'annualValue' => true, + 'department' => true, + 'costCentre' => true, + 'departmentId' => true, + 'costCentreId' => true, + 'analysisCategoriesCodes' => true, + 'analysisCategoryCodeIds' => true, + 'paySpineId' => true, + 'paySpineGradeId' => true, + 'spinalPointId' => true, + 'londonAllowanceId' => true, + 'fullTimeAnnualValue' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'analysisCategoryCodesJson' => 'analysisCategoryCodesJson', + 'value' => 'value', + 'rate' => 'rate', + 'multiplier' => 'multiplier', + 'description' => 'description', + 'code' => 'code', + 'tags' => 'tags', + 'childId' => 'childId', + 'isNetToGross' => 'isNetToGross', + 'targetNetToGrossValue' => 'targetNetToGrossValue', + 'netToGrossDiscrepancy' => 'netToGrossDiscrepancy', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'isAutoGeneratedBasicPayLine' => 'isAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'percentageOfEffectiveDays', + 'totalWorkingDays' => 'totalWorkingDays', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'calculateAsWhenPaid' => 'calculateAsWhenPaid', + 'totalPaidDays' => 'totalPaidDays', + 'roleId' => 'roleId', + 'earnedFrom' => 'earnedFrom', + 'earnedTo' => 'earnedTo', + 'annualValue' => 'annualValue', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'departmentId' => 'departmentId', + 'costCentreId' => 'costCentreId', + 'analysisCategoriesCodes' => 'analysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'analysisCategoryCodeIds', + 'paySpineId' => 'paySpineId', + 'paySpineGradeId' => 'paySpineGradeId', + 'spinalPointId' => 'spinalPointId', + 'londonAllowanceId' => 'londonAllowanceId', + 'fullTimeAnnualValue' => 'fullTimeAnnualValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'analysisCategoryCodesJson' => 'setAnalysisCategoryCodesJson', + 'value' => 'setValue', + 'rate' => 'setRate', + 'multiplier' => 'setMultiplier', + 'description' => 'setDescription', + 'code' => 'setCode', + 'tags' => 'setTags', + 'childId' => 'setChildId', + 'isNetToGross' => 'setIsNetToGross', + 'targetNetToGrossValue' => 'setTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'setNetToGrossDiscrepancy', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'isAutoGeneratedBasicPayLine' => 'setIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'setPercentageOfEffectiveDays', + 'totalWorkingDays' => 'setTotalWorkingDays', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'calculateAsWhenPaid' => 'setCalculateAsWhenPaid', + 'totalPaidDays' => 'setTotalPaidDays', + 'roleId' => 'setRoleId', + 'earnedFrom' => 'setEarnedFrom', + 'earnedTo' => 'setEarnedTo', + 'annualValue' => 'setAnnualValue', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'departmentId' => 'setDepartmentId', + 'costCentreId' => 'setCostCentreId', + 'analysisCategoriesCodes' => 'setAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'setAnalysisCategoryCodeIds', + 'paySpineId' => 'setPaySpineId', + 'paySpineGradeId' => 'setPaySpineGradeId', + 'spinalPointId' => 'setSpinalPointId', + 'londonAllowanceId' => 'setLondonAllowanceId', + 'fullTimeAnnualValue' => 'setFullTimeAnnualValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'analysisCategoryCodesJson' => 'getAnalysisCategoryCodesJson', + 'value' => 'getValue', + 'rate' => 'getRate', + 'multiplier' => 'getMultiplier', + 'description' => 'getDescription', + 'code' => 'getCode', + 'tags' => 'getTags', + 'childId' => 'getChildId', + 'isNetToGross' => 'getIsNetToGross', + 'targetNetToGrossValue' => 'getTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'getNetToGrossDiscrepancy', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'isAutoGeneratedBasicPayLine' => 'getIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'getPercentageOfEffectiveDays', + 'totalWorkingDays' => 'getTotalWorkingDays', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'calculateAsWhenPaid' => 'getCalculateAsWhenPaid', + 'totalPaidDays' => 'getTotalPaidDays', + 'roleId' => 'getRoleId', + 'earnedFrom' => 'getEarnedFrom', + 'earnedTo' => 'getEarnedTo', + 'annualValue' => 'getAnnualValue', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'departmentId' => 'getDepartmentId', + 'costCentreId' => 'getCostCentreId', + 'analysisCategoriesCodes' => 'getAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'getAnalysisCategoryCodeIds', + 'paySpineId' => 'getPaySpineId', + 'paySpineGradeId' => 'getPaySpineGradeId', + 'spinalPointId' => 'getSpinalPointId', + 'londonAllowanceId' => 'getLondonAllowanceId', + 'fullTimeAnnualValue' => 'getFullTimeAnnualValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('analysisCategoryCodesJson', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('targetNetToGrossValue', $data ?? [], null); + $this->setIfExists('netToGrossDiscrepancy', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('isAutoGeneratedBasicPayLine', $data ?? [], null); + $this->setIfExists('percentageOfEffectiveDays', $data ?? [], null); + $this->setIfExists('totalWorkingDays', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('calculateAsWhenPaid', $data ?? [], null); + $this->setIfExists('totalPaidDays', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('earnedFrom', $data ?? [], null); + $this->setIfExists('earnedTo', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('departmentId', $data ?? [], null); + $this->setIfExists('costCentreId', $data ?? [], null); + $this->setIfExists('analysisCategoriesCodes', $data ?? [], null); + $this->setIfExists('analysisCategoryCodeIds', $data ?? [], null); + $this->setIfExists('paySpineId', $data ?? [], null); + $this->setIfExists('paySpineGradeId', $data ?? [], null); + $this->setIfExists('spinalPointId', $data ?? [], null); + $this->setIfExists('londonAllowanceId', $data ?? [], null); + $this->setIfExists('fullTimeAnnualValue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 100)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets analysisCategoryCodesJson + * + * @return string|null + */ + public function getAnalysisCategoryCodesJson(): ?string + { + return $this->container['analysisCategoryCodesJson']; + } + + /** + * Sets analysisCategoryCodesJson + * + * @param string|null $analysisCategoryCodesJson Analysis category id and analysiscategoryCode json + * + * @return $this + */ + public function setAnalysisCategoryCodesJson(?string $analysisCategoryCodesJson): static + { + if (is_null($analysisCategoryCodesJson)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodesJson'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodesJson', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodesJson'] = $analysisCategoryCodesJson; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + array_push($this->openAPINullablesSetToNull, 'rate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A freeform description to accompany this line. It will be displayed on the payslip. + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 100)) { + throw new InvalidArgumentException('invalid length for $description when calling ContractPayLineRequest., must be smaller than or equal to 100.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId childId + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + array_push($this->openAPINullablesSetToNull, 'childId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('childId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['childId'] = $childId; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets targetNetToGrossValue + * + * @return float|null + */ + public function getTargetNetToGrossValue(): ?float + { + return $this->container['targetNetToGrossValue']; + } + + /** + * Sets targetNetToGrossValue + * + * @param float|null $targetNetToGrossValue The orginal net fixed addition amount that is considered to be a take home pay target. + * + * @return $this + */ + public function setTargetNetToGrossValue(?float $targetNetToGrossValue): static + { + if (is_null($targetNetToGrossValue)) { + array_push($this->openAPINullablesSetToNull, 'targetNetToGrossValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('targetNetToGrossValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['targetNetToGrossValue'] = $targetNetToGrossValue; + + return $this; + } + + /** + * Gets netToGrossDiscrepancy + * + * @return float|null + */ + public function getNetToGrossDiscrepancy(): ?float + { + return $this->container['netToGrossDiscrepancy']; + } + + /** + * Sets netToGrossDiscrepancy + * + * @param float|null $netToGrossDiscrepancy The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation. + * + * @return $this + */ + public function setNetToGrossDiscrepancy(?float $netToGrossDiscrepancy): static + { + if (is_null($netToGrossDiscrepancy)) { + array_push($this->openAPINullablesSetToNull, 'netToGrossDiscrepancy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netToGrossDiscrepancy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netToGrossDiscrepancy'] = $netToGrossDiscrepancy; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date the payline starts being calculated in payrun + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo The date the payline stops being calculated in payrun + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets isAutoGeneratedBasicPayLine + * + * @return bool|null + */ + public function getIsAutoGeneratedBasicPayLine(): ?bool + { + return $this->container['isAutoGeneratedBasicPayLine']; + } + + /** + * Sets isAutoGeneratedBasicPayLine + * + * @param bool|null $isAutoGeneratedBasicPayLine isAutoGeneratedBasicPayLine + * + * @return $this + */ + public function setIsAutoGeneratedBasicPayLine(?bool $isAutoGeneratedBasicPayLine): static + { + if (is_null($isAutoGeneratedBasicPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoGeneratedBasicPayLine cannot be null'); + } + $this->container['isAutoGeneratedBasicPayLine'] = $isAutoGeneratedBasicPayLine; + + return $this; + } + + /** + * Gets percentageOfEffectiveDays + * + * @return float|null + */ + public function getPercentageOfEffectiveDays(): ?float + { + return $this->container['percentageOfEffectiveDays']; + } + + /** + * Sets percentageOfEffectiveDays + * + * @param float|null $percentageOfEffectiveDays The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun + * + * @return $this + */ + public function setPercentageOfEffectiveDays(?float $percentageOfEffectiveDays): static + { + if (is_null($percentageOfEffectiveDays)) { + array_push($this->openAPINullablesSetToNull, 'percentageOfEffectiveDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('percentageOfEffectiveDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['percentageOfEffectiveDays'] = $percentageOfEffectiveDays; + + return $this; + } + + /** + * Gets totalWorkingDays + * + * @return float|null + */ + public function getTotalWorkingDays(): ?float + { + return $this->container['totalWorkingDays']; + } + + /** + * Sets totalWorkingDays + * + * @param float|null $totalWorkingDays totalWorkingDays + * + * @return $this + */ + public function setTotalWorkingDays(?float $totalWorkingDays): static + { + if (is_null($totalWorkingDays)) { + array_push($this->openAPINullablesSetToNull, 'totalWorkingDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalWorkingDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalWorkingDays'] = $totalWorkingDays; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay Indicates whether this PayLine contributes to the basic pay of the Employee. + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets calculateAsWhenPaid + * + * @return bool|null + */ + public function getCalculateAsWhenPaid(): ?bool + { + return $this->container['calculateAsWhenPaid']; + } + + /** + * Sets calculateAsWhenPaid + * + * @param bool|null $calculateAsWhenPaid Indicates whether this pay line should be treated as When Paid rather than When Earned + * + * @return $this + */ + public function setCalculateAsWhenPaid(?bool $calculateAsWhenPaid): static + { + if (is_null($calculateAsWhenPaid)) { + throw new InvalidArgumentException('non-nullable calculateAsWhenPaid cannot be null'); + } + $this->container['calculateAsWhenPaid'] = $calculateAsWhenPaid; + + return $this; + } + + /** + * Gets totalPaidDays + * + * @return float|null + */ + public function getTotalPaidDays(): ?float + { + return $this->container['totalPaidDays']; + } + + /** + * Sets totalPaidDays + * + * @param float|null $totalPaidDays totalPaidDays + * + * @return $this + */ + public function setTotalPaidDays(?float $totalPaidDays): static + { + if (is_null($totalPaidDays)) { + array_push($this->openAPINullablesSetToNull, 'totalPaidDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaidDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaidDays'] = $totalPaidDays; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets earnedFrom + * + * @return \DateTime|null + */ + public function getEarnedFrom(): ?\DateTime + { + return $this->container['earnedFrom']; + } + + /** + * Sets earnedFrom + * + * @param \DateTime|null $earnedFrom earnedFrom + * + * @return $this + */ + public function setEarnedFrom(?\DateTime $earnedFrom): static + { + if (is_null($earnedFrom)) { + array_push($this->openAPINullablesSetToNull, 'earnedFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedFrom'] = $earnedFrom; + + return $this; + } + + /** + * Gets earnedTo + * + * @return \DateTime|null + */ + public function getEarnedTo(): ?\DateTime + { + return $this->container['earnedTo']; + } + + /** + * Sets earnedTo + * + * @param \DateTime|null $earnedTo earnedTo + * + * @return $this + */ + public function setEarnedTo(?\DateTime $earnedTo): static + { + if (is_null($earnedTo)) { + array_push($this->openAPINullablesSetToNull, 'earnedTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedTo'] = $earnedTo; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not To recalculate set to null with annual amount recorded in Value + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + array_push($this->openAPINullablesSetToNull, 'annualValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department Department code which we want to override in payline + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre CostCentre code which we want to override in payline + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets departmentId + * + * @return string|null + */ + public function getDepartmentId(): ?string + { + return $this->container['departmentId']; + } + + /** + * Sets departmentId + * + * @param string|null $departmentId Department uniqueId which we want to override in payline + * + * @return $this + */ + public function setDepartmentId(?string $departmentId): static + { + if (is_null($departmentId)) { + array_push($this->openAPINullablesSetToNull, 'departmentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentId'] = $departmentId; + + return $this; + } + + /** + * Gets costCentreId + * + * @return string|null + */ + public function getCostCentreId(): ?string + { + return $this->container['costCentreId']; + } + + /** + * Sets costCentreId + * + * @param string|null $costCentreId CostCentre uniqueId which we want to override in payline + * + * @return $this + */ + public function setCostCentreId(?string $costCentreId): static + { + if (is_null($costCentreId)) { + array_push($this->openAPINullablesSetToNull, 'costCentreId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentreId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentreId'] = $costCentreId; + + return $this; + } + + /** + * Gets analysisCategoriesCodes + * + * @return \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null + */ + public function getAnalysisCategoriesCodes(): ?array + { + return $this->container['analysisCategoriesCodes']; + } + + /** + * Sets analysisCategoriesCodes + * + * @param \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null $analysisCategoriesCodes List of analysiscategory id and analysiscategoryCode id + * + * @return $this + */ + public function setAnalysisCategoriesCodes(?array $analysisCategoriesCodes): static + { + if (is_null($analysisCategoriesCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoriesCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoriesCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoriesCodes'] = $analysisCategoriesCodes; + + return $this; + } + + /** + * Gets analysisCategoryCodeIds + * + * @return string[]|null + */ + public function getAnalysisCategoryCodeIds(): ?array + { + return $this->container['analysisCategoryCodeIds']; + } + + /** + * Sets analysisCategoryCodeIds + * + * @param string[]|null $analysisCategoryCodeIds Array of analysiscategoryCode uniqueId + * + * @return $this + */ + public function setAnalysisCategoryCodeIds(?array $analysisCategoryCodeIds): static + { + if (is_null($analysisCategoryCodeIds)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeIds'] = $analysisCategoryCodeIds; + + return $this; + } + + /** + * Gets paySpineId + * + * @return string|null + */ + public function getPaySpineId(): ?string + { + return $this->container['paySpineId']; + } + + /** + * Sets paySpineId + * + * @param string|null $paySpineId [readonly] The Id of the associated pay spine. + * + * @return $this + */ + public function setPaySpineId(?string $paySpineId): static + { + if (is_null($paySpineId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineId'] = $paySpineId; + + return $this; + } + + /** + * Gets paySpineGradeId + * + * @return string|null + */ + public function getPaySpineGradeId(): ?string + { + return $this->container['paySpineGradeId']; + } + + /** + * Sets paySpineGradeId + * + * @param string|null $paySpineGradeId [readonly] The Id of the associated pay spine grade. + * + * @return $this + */ + public function setPaySpineGradeId(?string $paySpineGradeId): static + { + if (is_null($paySpineGradeId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineGradeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineGradeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineGradeId'] = $paySpineGradeId; + + return $this; + } + + /** + * Gets spinalPointId + * + * @return string|null + */ + public function getSpinalPointId(): ?string + { + return $this->container['spinalPointId']; + } + + /** + * Sets spinalPointId + * + * @param string|null $spinalPointId [readonly] The Id of the associated spinal point. + * + * @return $this + */ + public function setSpinalPointId(?string $spinalPointId): static + { + if (is_null($spinalPointId)) { + array_push($this->openAPINullablesSetToNull, 'spinalPointId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinalPointId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinalPointId'] = $spinalPointId; + + return $this; + } + + /** + * Gets londonAllowanceId + * + * @return int|null + */ + public function getLondonAllowanceId(): ?int + { + return $this->container['londonAllowanceId']; + } + + /** + * Sets londonAllowanceId + * + * @param int|null $londonAllowanceId Used to set London allowance id for payline + * + * @return $this + */ + public function setLondonAllowanceId(?int $londonAllowanceId): static + { + if (is_null($londonAllowanceId)) { + array_push($this->openAPINullablesSetToNull, 'londonAllowanceId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('londonAllowanceId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['londonAllowanceId'] = $londonAllowanceId; + + return $this; + } + + /** + * Gets fullTimeAnnualValue + * + * @return float|null + */ + public function getFullTimeAnnualValue(): ?float + { + return $this->container['fullTimeAnnualValue']; + } + + /** + * Sets fullTimeAnnualValue + * + * @param float|null $fullTimeAnnualValue Used to set Full Time Annual Value for payline + * + * @return $this + */ + public function setFullTimeAnnualValue(?float $fullTimeAnnualValue): static + { + if (is_null($fullTimeAnnualValue)) { + throw new InvalidArgumentException('non-nullable fullTimeAnnualValue cannot be null'); + } + $this->container['fullTimeAnnualValue'] = $fullTimeAnnualValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayLineResponse.php b/src/Model/ContractPayLineResponse.php new file mode 100644 index 0000000..ac87ea1 --- /dev/null +++ b/src/Model/ContractPayLineResponse.php @@ -0,0 +1,2116 @@ + + */ +class ContractPayLineResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayLineResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'attachmentOrderId' => 'string', + 'pensionId' => 'string', + 'leaveId' => 'string', + 'loanId' => 'string', + 'leaveStatutoryDaysPaid' => 'float', + 'leaveStatutoryWeeksPaid' => 'float', + 'initialBackPayPublicPayRunId' => 'string', + 'value' => 'float', + 'rate' => 'float', + 'multiplier' => 'float', + 'description' => 'string', + 'code' => 'string', + 'tags' => 'string[]', + 'childId' => 'string', + 'isNetToGross' => 'bool', + 'targetNetToGrossValue' => 'float', + 'netToGrossDiscrepancy' => 'float', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'isAutoGeneratedBasicPayLine' => 'bool', + 'percentageOfEffectiveDays' => 'float', + 'totalWorkingDays' => 'float', + 'autoAdjustForLeave' => 'bool', + 'isAutomaticBackPay' => 'bool', + 'ignoreInitialBackPay' => 'bool', + 'contributesToBasicPay' => 'bool', + 'calculateAsWhenPaid' => 'bool', + 'totalPaidDays' => 'float', + 'roleId' => 'string', + 'earnedFrom' => '\DateTime', + 'earnedTo' => '\DateTime', + 'annualValue' => 'float', + 'department' => 'string', + 'costCentre' => 'string', + 'departmentId' => 'string', + 'costCentreId' => 'string', + 'analysisCategoriesCodes' => '\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]', + 'analysisCategoryCodeIds' => 'string[]', + 'paySpineId' => 'string', + 'paySpineGradeId' => 'string', + 'spinalPointId' => 'string', + 'londonAllowanceId' => 'int', + 'fullTimeAnnualValue' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'attachmentOrderId' => 'uuid', + 'pensionId' => 'uuid', + 'leaveId' => 'uuid', + 'loanId' => 'uuid', + 'leaveStatutoryDaysPaid' => 'double', + 'leaveStatutoryWeeksPaid' => 'double', + 'initialBackPayPublicPayRunId' => 'uuid', + 'value' => 'double', + 'rate' => 'double', + 'multiplier' => 'double', + 'description' => null, + 'code' => null, + 'tags' => null, + 'childId' => 'uuid', + 'isNetToGross' => null, + 'targetNetToGrossValue' => 'double', + 'netToGrossDiscrepancy' => 'double', + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'isAutoGeneratedBasicPayLine' => null, + 'percentageOfEffectiveDays' => 'double', + 'totalWorkingDays' => 'double', + 'autoAdjustForLeave' => null, + 'isAutomaticBackPay' => null, + 'ignoreInitialBackPay' => null, + 'contributesToBasicPay' => null, + 'calculateAsWhenPaid' => null, + 'totalPaidDays' => 'double', + 'roleId' => 'uuid', + 'earnedFrom' => 'date', + 'earnedTo' => 'date', + 'annualValue' => 'double', + 'department' => null, + 'costCentre' => null, + 'departmentId' => 'uuid', + 'costCentreId' => 'uuid', + 'analysisCategoriesCodes' => null, + 'analysisCategoryCodeIds' => 'uuid', + 'paySpineId' => 'uuid', + 'paySpineGradeId' => 'uuid', + 'spinalPointId' => 'uuid', + 'londonAllowanceId' => 'int32', + 'fullTimeAnnualValue' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'attachmentOrderId' => true, + 'pensionId' => true, + 'leaveId' => true, + 'loanId' => true, + 'leaveStatutoryDaysPaid' => true, + 'leaveStatutoryWeeksPaid' => true, + 'initialBackPayPublicPayRunId' => true, + 'value' => false, + 'rate' => true, + 'multiplier' => true, + 'description' => true, + 'code' => true, + 'tags' => true, + 'childId' => true, + 'isNetToGross' => false, + 'targetNetToGrossValue' => true, + 'netToGrossDiscrepancy' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'isAutoGeneratedBasicPayLine' => false, + 'percentageOfEffectiveDays' => true, + 'totalWorkingDays' => true, + 'autoAdjustForLeave' => false, + 'isAutomaticBackPay' => false, + 'ignoreInitialBackPay' => false, + 'contributesToBasicPay' => false, + 'calculateAsWhenPaid' => false, + 'totalPaidDays' => true, + 'roleId' => true, + 'earnedFrom' => true, + 'earnedTo' => true, + 'annualValue' => true, + 'department' => true, + 'costCentre' => true, + 'departmentId' => true, + 'costCentreId' => true, + 'analysisCategoriesCodes' => true, + 'analysisCategoryCodeIds' => true, + 'paySpineId' => true, + 'paySpineGradeId' => true, + 'spinalPointId' => true, + 'londonAllowanceId' => true, + 'fullTimeAnnualValue' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'attachmentOrderId' => 'attachmentOrderId', + 'pensionId' => 'pensionId', + 'leaveId' => 'leaveId', + 'loanId' => 'loanId', + 'leaveStatutoryDaysPaid' => 'leaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'leaveStatutoryWeeksPaid', + 'initialBackPayPublicPayRunId' => 'initialBackPayPublicPayRunId', + 'value' => 'value', + 'rate' => 'rate', + 'multiplier' => 'multiplier', + 'description' => 'description', + 'code' => 'code', + 'tags' => 'tags', + 'childId' => 'childId', + 'isNetToGross' => 'isNetToGross', + 'targetNetToGrossValue' => 'targetNetToGrossValue', + 'netToGrossDiscrepancy' => 'netToGrossDiscrepancy', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'isAutoGeneratedBasicPayLine' => 'isAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'percentageOfEffectiveDays', + 'totalWorkingDays' => 'totalWorkingDays', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'calculateAsWhenPaid' => 'calculateAsWhenPaid', + 'totalPaidDays' => 'totalPaidDays', + 'roleId' => 'roleId', + 'earnedFrom' => 'earnedFrom', + 'earnedTo' => 'earnedTo', + 'annualValue' => 'annualValue', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'departmentId' => 'departmentId', + 'costCentreId' => 'costCentreId', + 'analysisCategoriesCodes' => 'analysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'analysisCategoryCodeIds', + 'paySpineId' => 'paySpineId', + 'paySpineGradeId' => 'paySpineGradeId', + 'spinalPointId' => 'spinalPointId', + 'londonAllowanceId' => 'londonAllowanceId', + 'fullTimeAnnualValue' => 'fullTimeAnnualValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'attachmentOrderId' => 'setAttachmentOrderId', + 'pensionId' => 'setPensionId', + 'leaveId' => 'setLeaveId', + 'loanId' => 'setLoanId', + 'leaveStatutoryDaysPaid' => 'setLeaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'setLeaveStatutoryWeeksPaid', + 'initialBackPayPublicPayRunId' => 'setInitialBackPayPublicPayRunId', + 'value' => 'setValue', + 'rate' => 'setRate', + 'multiplier' => 'setMultiplier', + 'description' => 'setDescription', + 'code' => 'setCode', + 'tags' => 'setTags', + 'childId' => 'setChildId', + 'isNetToGross' => 'setIsNetToGross', + 'targetNetToGrossValue' => 'setTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'setNetToGrossDiscrepancy', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'isAutoGeneratedBasicPayLine' => 'setIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'setPercentageOfEffectiveDays', + 'totalWorkingDays' => 'setTotalWorkingDays', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'calculateAsWhenPaid' => 'setCalculateAsWhenPaid', + 'totalPaidDays' => 'setTotalPaidDays', + 'roleId' => 'setRoleId', + 'earnedFrom' => 'setEarnedFrom', + 'earnedTo' => 'setEarnedTo', + 'annualValue' => 'setAnnualValue', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'departmentId' => 'setDepartmentId', + 'costCentreId' => 'setCostCentreId', + 'analysisCategoriesCodes' => 'setAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'setAnalysisCategoryCodeIds', + 'paySpineId' => 'setPaySpineId', + 'paySpineGradeId' => 'setPaySpineGradeId', + 'spinalPointId' => 'setSpinalPointId', + 'londonAllowanceId' => 'setLondonAllowanceId', + 'fullTimeAnnualValue' => 'setFullTimeAnnualValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'attachmentOrderId' => 'getAttachmentOrderId', + 'pensionId' => 'getPensionId', + 'leaveId' => 'getLeaveId', + 'loanId' => 'getLoanId', + 'leaveStatutoryDaysPaid' => 'getLeaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'getLeaveStatutoryWeeksPaid', + 'initialBackPayPublicPayRunId' => 'getInitialBackPayPublicPayRunId', + 'value' => 'getValue', + 'rate' => 'getRate', + 'multiplier' => 'getMultiplier', + 'description' => 'getDescription', + 'code' => 'getCode', + 'tags' => 'getTags', + 'childId' => 'getChildId', + 'isNetToGross' => 'getIsNetToGross', + 'targetNetToGrossValue' => 'getTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'getNetToGrossDiscrepancy', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'isAutoGeneratedBasicPayLine' => 'getIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'getPercentageOfEffectiveDays', + 'totalWorkingDays' => 'getTotalWorkingDays', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'calculateAsWhenPaid' => 'getCalculateAsWhenPaid', + 'totalPaidDays' => 'getTotalPaidDays', + 'roleId' => 'getRoleId', + 'earnedFrom' => 'getEarnedFrom', + 'earnedTo' => 'getEarnedTo', + 'annualValue' => 'getAnnualValue', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'departmentId' => 'getDepartmentId', + 'costCentreId' => 'getCostCentreId', + 'analysisCategoriesCodes' => 'getAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'getAnalysisCategoryCodeIds', + 'paySpineId' => 'getPaySpineId', + 'paySpineGradeId' => 'getPaySpineGradeId', + 'spinalPointId' => 'getSpinalPointId', + 'londonAllowanceId' => 'getLondonAllowanceId', + 'fullTimeAnnualValue' => 'getFullTimeAnnualValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('attachmentOrderId', $data ?? [], null); + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('leaveId', $data ?? [], null); + $this->setIfExists('loanId', $data ?? [], null); + $this->setIfExists('leaveStatutoryDaysPaid', $data ?? [], null); + $this->setIfExists('leaveStatutoryWeeksPaid', $data ?? [], null); + $this->setIfExists('initialBackPayPublicPayRunId', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('targetNetToGrossValue', $data ?? [], null); + $this->setIfExists('netToGrossDiscrepancy', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('isAutoGeneratedBasicPayLine', $data ?? [], null); + $this->setIfExists('percentageOfEffectiveDays', $data ?? [], null); + $this->setIfExists('totalWorkingDays', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('calculateAsWhenPaid', $data ?? [], null); + $this->setIfExists('totalPaidDays', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('earnedFrom', $data ?? [], null); + $this->setIfExists('earnedTo', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('departmentId', $data ?? [], null); + $this->setIfExists('costCentreId', $data ?? [], null); + $this->setIfExists('analysisCategoriesCodes', $data ?? [], null); + $this->setIfExists('analysisCategoryCodeIds', $data ?? [], null); + $this->setIfExists('paySpineId', $data ?? [], null); + $this->setIfExists('paySpineGradeId', $data ?? [], null); + $this->setIfExists('spinalPointId', $data ?? [], null); + $this->setIfExists('londonAllowanceId', $data ?? [], null); + $this->setIfExists('fullTimeAnnualValue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 100)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets attachmentOrderId + * + * @return string|null + */ + public function getAttachmentOrderId(): ?string + { + return $this->container['attachmentOrderId']; + } + + /** + * Sets attachmentOrderId + * + * @param string|null $attachmentOrderId [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO + * + * @return $this + */ + public function setAttachmentOrderId(?string $attachmentOrderId): static + { + if (is_null($attachmentOrderId)) { + array_push($this->openAPINullablesSetToNull, 'attachmentOrderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachmentOrderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachmentOrderId'] = $attachmentOrderId; + + return $this; + } + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + array_push($this->openAPINullablesSetToNull, 'pensionId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets leaveId + * + * @return string|null + */ + public function getLeaveId(): ?string + { + return $this->container['leaveId']; + } + + /** + * Sets leaveId + * + * @param string|null $leaveId [readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay + * + * @return $this + */ + public function setLeaveId(?string $leaveId): static + { + if (is_null($leaveId)) { + array_push($this->openAPINullablesSetToNull, 'leaveId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveId'] = $leaveId; + + return $this; + } + + /** + * Gets loanId + * + * @return string|null + */ + public function getLoanId(): ?string + { + return $this->container['loanId']; + } + + /** + * Sets loanId + * + * @param string|null $loanId [readonly] The Id of the associated Loan, if any. + * + * @return $this + */ + public function setLoanId(?string $loanId): static + { + if (is_null($loanId)) { + array_push($this->openAPINullablesSetToNull, 'loanId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loanId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loanId'] = $loanId; + + return $this; + } + + /** + * Gets leaveStatutoryDaysPaid + * + * @return float|null + */ + public function getLeaveStatutoryDaysPaid(): ?float + { + return $this->container['leaveStatutoryDaysPaid']; + } + + /** + * Sets leaveStatutoryDaysPaid + * + * @param float|null $leaveStatutoryDaysPaid [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern). + * + * @return $this + */ + public function setLeaveStatutoryDaysPaid(?float $leaveStatutoryDaysPaid): static + { + if (is_null($leaveStatutoryDaysPaid)) { + array_push($this->openAPINullablesSetToNull, 'leaveStatutoryDaysPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveStatutoryDaysPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveStatutoryDaysPaid'] = $leaveStatutoryDaysPaid; + + return $this; + } + + /** + * Gets leaveStatutoryWeeksPaid + * + * @return float|null + */ + public function getLeaveStatutoryWeeksPaid(): ?float + { + return $this->container['leaveStatutoryWeeksPaid']; + } + + /** + * Sets leaveStatutoryWeeksPaid + * + * @param float|null $leaveStatutoryWeeksPaid [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern). + * + * @return $this + */ + public function setLeaveStatutoryWeeksPaid(?float $leaveStatutoryWeeksPaid): static + { + if (is_null($leaveStatutoryWeeksPaid)) { + array_push($this->openAPINullablesSetToNull, 'leaveStatutoryWeeksPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveStatutoryWeeksPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveStatutoryWeeksPaid'] = $leaveStatutoryWeeksPaid; + + return $this; + } + + /** + * Gets initialBackPayPublicPayRunId + * + * @return string|null + */ + public function getInitialBackPayPublicPayRunId(): ?string + { + return $this->container['initialBackPayPublicPayRunId']; + } + + /** + * Sets initialBackPayPublicPayRunId + * + * @param string|null $initialBackPayPublicPayRunId [readonly] Used to mark the first payrun where this payline has been payrolled for backpay + * + * @return $this + */ + public function setInitialBackPayPublicPayRunId(?string $initialBackPayPublicPayRunId): static + { + if (is_null($initialBackPayPublicPayRunId)) { + array_push($this->openAPINullablesSetToNull, 'initialBackPayPublicPayRunId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initialBackPayPublicPayRunId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initialBackPayPublicPayRunId'] = $initialBackPayPublicPayRunId; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + array_push($this->openAPINullablesSetToNull, 'rate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A freeform description to accompany this line. It will be displayed on the payslip. + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 100)) { + throw new InvalidArgumentException('invalid length for $description when calling ContractPayLineResponse., must be smaller than or equal to 100.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId childId + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + array_push($this->openAPINullablesSetToNull, 'childId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('childId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['childId'] = $childId; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets targetNetToGrossValue + * + * @return float|null + */ + public function getTargetNetToGrossValue(): ?float + { + return $this->container['targetNetToGrossValue']; + } + + /** + * Sets targetNetToGrossValue + * + * @param float|null $targetNetToGrossValue The orginal net fixed addition amount that is considered to be a take home pay target. + * + * @return $this + */ + public function setTargetNetToGrossValue(?float $targetNetToGrossValue): static + { + if (is_null($targetNetToGrossValue)) { + array_push($this->openAPINullablesSetToNull, 'targetNetToGrossValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('targetNetToGrossValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['targetNetToGrossValue'] = $targetNetToGrossValue; + + return $this; + } + + /** + * Gets netToGrossDiscrepancy + * + * @return float|null + */ + public function getNetToGrossDiscrepancy(): ?float + { + return $this->container['netToGrossDiscrepancy']; + } + + /** + * Sets netToGrossDiscrepancy + * + * @param float|null $netToGrossDiscrepancy The discrepancy between the targeted and the calculated grossed up value durig a net to gross calculation. + * + * @return $this + */ + public function setNetToGrossDiscrepancy(?float $netToGrossDiscrepancy): static + { + if (is_null($netToGrossDiscrepancy)) { + array_push($this->openAPINullablesSetToNull, 'netToGrossDiscrepancy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netToGrossDiscrepancy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netToGrossDiscrepancy'] = $netToGrossDiscrepancy; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date the payline starts being calculated in payrun + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo The date the payline stops being calculated in payrun + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets isAutoGeneratedBasicPayLine + * + * @return bool|null + */ + public function getIsAutoGeneratedBasicPayLine(): ?bool + { + return $this->container['isAutoGeneratedBasicPayLine']; + } + + /** + * Sets isAutoGeneratedBasicPayLine + * + * @param bool|null $isAutoGeneratedBasicPayLine isAutoGeneratedBasicPayLine + * + * @return $this + */ + public function setIsAutoGeneratedBasicPayLine(?bool $isAutoGeneratedBasicPayLine): static + { + if (is_null($isAutoGeneratedBasicPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoGeneratedBasicPayLine cannot be null'); + } + $this->container['isAutoGeneratedBasicPayLine'] = $isAutoGeneratedBasicPayLine; + + return $this; + } + + /** + * Gets percentageOfEffectiveDays + * + * @return float|null + */ + public function getPercentageOfEffectiveDays(): ?float + { + return $this->container['percentageOfEffectiveDays']; + } + + /** + * Sets percentageOfEffectiveDays + * + * @param float|null $percentageOfEffectiveDays The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun + * + * @return $this + */ + public function setPercentageOfEffectiveDays(?float $percentageOfEffectiveDays): static + { + if (is_null($percentageOfEffectiveDays)) { + array_push($this->openAPINullablesSetToNull, 'percentageOfEffectiveDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('percentageOfEffectiveDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['percentageOfEffectiveDays'] = $percentageOfEffectiveDays; + + return $this; + } + + /** + * Gets totalWorkingDays + * + * @return float|null + */ + public function getTotalWorkingDays(): ?float + { + return $this->container['totalWorkingDays']; + } + + /** + * Sets totalWorkingDays + * + * @param float|null $totalWorkingDays totalWorkingDays + * + * @return $this + */ + public function setTotalWorkingDays(?float $totalWorkingDays): static + { + if (is_null($totalWorkingDays)) { + array_push($this->openAPINullablesSetToNull, 'totalWorkingDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalWorkingDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalWorkingDays'] = $totalWorkingDays; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay Indicates whether this PayLine contributes to the basic pay of the Employee. + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets calculateAsWhenPaid + * + * @return bool|null + */ + public function getCalculateAsWhenPaid(): ?bool + { + return $this->container['calculateAsWhenPaid']; + } + + /** + * Sets calculateAsWhenPaid + * + * @param bool|null $calculateAsWhenPaid Indicates whether this pay line should be treated as When Paid rather than When Earned + * + * @return $this + */ + public function setCalculateAsWhenPaid(?bool $calculateAsWhenPaid): static + { + if (is_null($calculateAsWhenPaid)) { + throw new InvalidArgumentException('non-nullable calculateAsWhenPaid cannot be null'); + } + $this->container['calculateAsWhenPaid'] = $calculateAsWhenPaid; + + return $this; + } + + /** + * Gets totalPaidDays + * + * @return float|null + */ + public function getTotalPaidDays(): ?float + { + return $this->container['totalPaidDays']; + } + + /** + * Sets totalPaidDays + * + * @param float|null $totalPaidDays totalPaidDays + * + * @return $this + */ + public function setTotalPaidDays(?float $totalPaidDays): static + { + if (is_null($totalPaidDays)) { + array_push($this->openAPINullablesSetToNull, 'totalPaidDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaidDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaidDays'] = $totalPaidDays; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets earnedFrom + * + * @return \DateTime|null + */ + public function getEarnedFrom(): ?\DateTime + { + return $this->container['earnedFrom']; + } + + /** + * Sets earnedFrom + * + * @param \DateTime|null $earnedFrom earnedFrom + * + * @return $this + */ + public function setEarnedFrom(?\DateTime $earnedFrom): static + { + if (is_null($earnedFrom)) { + array_push($this->openAPINullablesSetToNull, 'earnedFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedFrom'] = $earnedFrom; + + return $this; + } + + /** + * Gets earnedTo + * + * @return \DateTime|null + */ + public function getEarnedTo(): ?\DateTime + { + return $this->container['earnedTo']; + } + + /** + * Sets earnedTo + * + * @param \DateTime|null $earnedTo earnedTo + * + * @return $this + */ + public function setEarnedTo(?\DateTime $earnedTo): static + { + if (is_null($earnedTo)) { + array_push($this->openAPINullablesSetToNull, 'earnedTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedTo'] = $earnedTo; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not To recalculate set to null with annual amount recorded in Value + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + array_push($this->openAPINullablesSetToNull, 'annualValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department Department code which we want to override in payline + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre CostCentre code which we want to override in payline + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets departmentId + * + * @return string|null + */ + public function getDepartmentId(): ?string + { + return $this->container['departmentId']; + } + + /** + * Sets departmentId + * + * @param string|null $departmentId Department uniqueId which we want to override in payline + * + * @return $this + */ + public function setDepartmentId(?string $departmentId): static + { + if (is_null($departmentId)) { + array_push($this->openAPINullablesSetToNull, 'departmentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentId'] = $departmentId; + + return $this; + } + + /** + * Gets costCentreId + * + * @return string|null + */ + public function getCostCentreId(): ?string + { + return $this->container['costCentreId']; + } + + /** + * Sets costCentreId + * + * @param string|null $costCentreId CostCentre uniqueId which we want to override in payline + * + * @return $this + */ + public function setCostCentreId(?string $costCentreId): static + { + if (is_null($costCentreId)) { + array_push($this->openAPINullablesSetToNull, 'costCentreId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentreId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentreId'] = $costCentreId; + + return $this; + } + + /** + * Gets analysisCategoriesCodes + * + * @return \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null + */ + public function getAnalysisCategoriesCodes(): ?array + { + return $this->container['analysisCategoriesCodes']; + } + + /** + * Sets analysisCategoriesCodes + * + * @param \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null $analysisCategoriesCodes List of analysiscategory id and analysiscategoryCode id + * + * @return $this + */ + public function setAnalysisCategoriesCodes(?array $analysisCategoriesCodes): static + { + if (is_null($analysisCategoriesCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoriesCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoriesCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoriesCodes'] = $analysisCategoriesCodes; + + return $this; + } + + /** + * Gets analysisCategoryCodeIds + * + * @return string[]|null + */ + public function getAnalysisCategoryCodeIds(): ?array + { + return $this->container['analysisCategoryCodeIds']; + } + + /** + * Sets analysisCategoryCodeIds + * + * @param string[]|null $analysisCategoryCodeIds Array of analysiscategoryCode uniqueId + * + * @return $this + */ + public function setAnalysisCategoryCodeIds(?array $analysisCategoryCodeIds): static + { + if (is_null($analysisCategoryCodeIds)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeIds'] = $analysisCategoryCodeIds; + + return $this; + } + + /** + * Gets paySpineId + * + * @return string|null + */ + public function getPaySpineId(): ?string + { + return $this->container['paySpineId']; + } + + /** + * Sets paySpineId + * + * @param string|null $paySpineId [readonly] The Id of the associated pay spine. + * + * @return $this + */ + public function setPaySpineId(?string $paySpineId): static + { + if (is_null($paySpineId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineId'] = $paySpineId; + + return $this; + } + + /** + * Gets paySpineGradeId + * + * @return string|null + */ + public function getPaySpineGradeId(): ?string + { + return $this->container['paySpineGradeId']; + } + + /** + * Sets paySpineGradeId + * + * @param string|null $paySpineGradeId [readonly] The Id of the associated pay spine grade. + * + * @return $this + */ + public function setPaySpineGradeId(?string $paySpineGradeId): static + { + if (is_null($paySpineGradeId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineGradeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineGradeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineGradeId'] = $paySpineGradeId; + + return $this; + } + + /** + * Gets spinalPointId + * + * @return string|null + */ + public function getSpinalPointId(): ?string + { + return $this->container['spinalPointId']; + } + + /** + * Sets spinalPointId + * + * @param string|null $spinalPointId [readonly] The Id of the associated spinal point. + * + * @return $this + */ + public function setSpinalPointId(?string $spinalPointId): static + { + if (is_null($spinalPointId)) { + array_push($this->openAPINullablesSetToNull, 'spinalPointId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinalPointId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinalPointId'] = $spinalPointId; + + return $this; + } + + /** + * Gets londonAllowanceId + * + * @return int|null + */ + public function getLondonAllowanceId(): ?int + { + return $this->container['londonAllowanceId']; + } + + /** + * Sets londonAllowanceId + * + * @param int|null $londonAllowanceId Used to set London allowance id for payline + * + * @return $this + */ + public function setLondonAllowanceId(?int $londonAllowanceId): static + { + if (is_null($londonAllowanceId)) { + array_push($this->openAPINullablesSetToNull, 'londonAllowanceId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('londonAllowanceId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['londonAllowanceId'] = $londonAllowanceId; + + return $this; + } + + /** + * Gets fullTimeAnnualValue + * + * @return float|null + */ + public function getFullTimeAnnualValue(): ?float + { + return $this->container['fullTimeAnnualValue']; + } + + /** + * Sets fullTimeAnnualValue + * + * @param float|null $fullTimeAnnualValue Used to set Full Time Annual Value for payline + * + * @return $this + */ + public function setFullTimeAnnualValue(?float $fullTimeAnnualValue): static + { + if (is_null($fullTimeAnnualValue)) { + throw new InvalidArgumentException('non-nullable fullTimeAnnualValue cannot be null'); + } + $this->container['fullTimeAnnualValue'] = $fullTimeAnnualValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayOptionsBaseResponse.php b/src/Model/ContractPayOptionsBaseResponse.php new file mode 100644 index 0000000..7f93988 --- /dev/null +++ b/src/Model/ContractPayOptionsBaseResponse.php @@ -0,0 +1,803 @@ + + */ +class ContractPayOptionsBaseResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayOptionsBaseResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'regularPayLines' => '\SynergiTech\Staffology\Model\ContractPayLineResponse[]', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'nationalMinimumWage' => 'bool', + 'payCode' => 'string', + 'mileageVehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'mapsMiles' => 'int', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'baseHourlyRate' => 'float', + 'baseDailyRate' => 'float', + 'autoAdjustForLeave' => 'bool', + 'niTable' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'regularPayLines' => null, + 'basis' => null, + 'nationalMinimumWage' => null, + 'payCode' => null, + 'mileageVehicleType' => null, + 'mapsMiles' => 'int32', + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'baseHourlyRate' => 'double', + 'baseDailyRate' => 'double', + 'autoAdjustForLeave' => null, + 'niTable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'regularPayLines' => true, + 'basis' => false, + 'nationalMinimumWage' => false, + 'payCode' => true, + 'mileageVehicleType' => false, + 'mapsMiles' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'baseHourlyRate' => false, + 'baseDailyRate' => false, + 'autoAdjustForLeave' => false, + 'niTable' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'regularPayLines' => 'regularPayLines', + 'basis' => 'basis', + 'nationalMinimumWage' => 'nationalMinimumWage', + 'payCode' => 'payCode', + 'mileageVehicleType' => 'mileageVehicleType', + 'mapsMiles' => 'mapsMiles', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'baseHourlyRate' => 'baseHourlyRate', + 'baseDailyRate' => 'baseDailyRate', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'niTable' => 'niTable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'regularPayLines' => 'setRegularPayLines', + 'basis' => 'setBasis', + 'nationalMinimumWage' => 'setNationalMinimumWage', + 'payCode' => 'setPayCode', + 'mileageVehicleType' => 'setMileageVehicleType', + 'mapsMiles' => 'setMapsMiles', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'baseDailyRate' => 'setBaseDailyRate', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'niTable' => 'setNiTable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'regularPayLines' => 'getRegularPayLines', + 'basis' => 'getBasis', + 'nationalMinimumWage' => 'getNationalMinimumWage', + 'payCode' => 'getPayCode', + 'mileageVehicleType' => 'getMileageVehicleType', + 'mapsMiles' => 'getMapsMiles', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'baseDailyRate' => 'getBaseDailyRate', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'niTable' => 'getNiTable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('regularPayLines', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('nationalMinimumWage', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('mileageVehicleType', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets regularPayLines + * + * @return \SynergiTech\Staffology\Model\ContractPayLineResponse[]|null + */ + public function getRegularPayLines(): ?array + { + return $this->container['regularPayLines']; + } + + /** + * Sets regularPayLines + * + * @param \SynergiTech\Staffology\Model\ContractPayLineResponse[]|null $regularPayLines These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. + * + * @return $this + */ + public function setRegularPayLines(?array $regularPayLines): static + { + if (is_null($regularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'regularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('regularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['regularPayLines'] = $regularPayLines; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets nationalMinimumWage + * + * @return bool|null + */ + public function getNationalMinimumWage(): ?bool + { + return $this->container['nationalMinimumWage']; + } + + /** + * Sets nationalMinimumWage + * + * @param bool|null $nationalMinimumWage nationalMinimumWage + * + * @return $this + */ + public function setNationalMinimumWage(?bool $nationalMinimumWage): static + { + if (is_null($nationalMinimumWage)) { + throw new InvalidArgumentException('non-nullable nationalMinimumWage cannot be null'); + } + $this->container['nationalMinimumWage'] = $nationalMinimumWage; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want the Employees pay to be allocated to a code other than BASIC, specify it here + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets mileageVehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getMileageVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['mileageVehicleType']; + } + + /** + * Sets mileageVehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $mileageVehicleType mileageVehicleType + * + * @return $this + */ + public function setMileageVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $mileageVehicleType): static + { + if (is_null($mileageVehicleType)) { + throw new InvalidArgumentException('non-nullable mileageVehicleType cannot be null'); + } + $this->container['mileageVehicleType'] = $mileageVehicleType; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles The number of miles to pay for as Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayOptionsImportRequest.php b/src/Model/ContractPayOptionsImportRequest.php new file mode 100644 index 0000000..362c66c --- /dev/null +++ b/src/Model/ContractPayOptionsImportRequest.php @@ -0,0 +1,1261 @@ + + */ +class ContractPayOptionsImportRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayOptionsImportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'analysisCategoriesCodes' => '\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]', + 'autoAdjustForLeave' => 'bool', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'contributesToBasicPay' => 'bool', + 'costCentre' => 'string', + 'department' => 'string', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'employerIdentifier' => 'string', + 'ignoreInitialBackPay' => 'bool', + 'isAutomaticBackPay' => 'bool', + 'isNetToGross' => 'bool', + 'lines' => '\SynergiTech\Staffology\Model\ContractPaylineRequest[]', + 'note' => 'string', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'payCode' => 'string', + 'payGrade' => 'string', + 'payrollCode' => 'string', + 'paySpine' => 'string', + 'roleReference' => 'string', + 'spinePoint' => 'string', + 'tags' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'analysisCategoriesCodes' => null, + 'autoAdjustForLeave' => null, + 'basis' => null, + 'contributesToBasicPay' => null, + 'costCentre' => null, + 'department' => null, + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'employerIdentifier' => null, + 'ignoreInitialBackPay' => null, + 'isAutomaticBackPay' => null, + 'isNetToGross' => null, + 'lines' => null, + 'note' => null, + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'payCode' => null, + 'payGrade' => null, + 'payrollCode' => null, + 'paySpine' => null, + 'roleReference' => null, + 'spinePoint' => null, + 'tags' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'analysisCategoriesCodes' => true, + 'autoAdjustForLeave' => false, + 'basis' => false, + 'contributesToBasicPay' => false, + 'costCentre' => true, + 'department' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'employerIdentifier' => true, + 'ignoreInitialBackPay' => false, + 'isAutomaticBackPay' => false, + 'isNetToGross' => false, + 'lines' => true, + 'note' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'payCode' => true, + 'payGrade' => true, + 'payrollCode' => true, + 'paySpine' => true, + 'roleReference' => true, + 'spinePoint' => true, + 'tags' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'analysisCategoriesCodes' => 'analysisCategoriesCodes', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'basis' => 'basis', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'costCentre' => 'costCentre', + 'department' => 'department', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'employerIdentifier' => 'employerIdentifier', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'isNetToGross' => 'isNetToGross', + 'lines' => 'lines', + 'note' => 'note', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'payCode' => 'payCode', + 'payGrade' => 'payGrade', + 'payrollCode' => 'payrollCode', + 'paySpine' => 'paySpine', + 'roleReference' => 'roleReference', + 'spinePoint' => 'spinePoint', + 'tags' => 'tags' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'analysisCategoriesCodes' => 'setAnalysisCategoriesCodes', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'basis' => 'setBasis', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'costCentre' => 'setCostCentre', + 'department' => 'setDepartment', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'employerIdentifier' => 'setEmployerIdentifier', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'isNetToGross' => 'setIsNetToGross', + 'lines' => 'setLines', + 'note' => 'setNote', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'payCode' => 'setPayCode', + 'payGrade' => 'setPayGrade', + 'payrollCode' => 'setPayrollCode', + 'paySpine' => 'setPaySpine', + 'roleReference' => 'setRoleReference', + 'spinePoint' => 'setSpinePoint', + 'tags' => 'setTags' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'analysisCategoriesCodes' => 'getAnalysisCategoriesCodes', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'basis' => 'getBasis', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'costCentre' => 'getCostCentre', + 'department' => 'getDepartment', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'employerIdentifier' => 'getEmployerIdentifier', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'isNetToGross' => 'getIsNetToGross', + 'lines' => 'getLines', + 'note' => 'getNote', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'payCode' => 'getPayCode', + 'payGrade' => 'getPayGrade', + 'payrollCode' => 'getPayrollCode', + 'paySpine' => 'getPaySpine', + 'roleReference' => 'getRoleReference', + 'spinePoint' => 'getSpinePoint', + 'tags' => 'getTags' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('analysisCategoriesCodes', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('employerIdentifier', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('payGrade', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('paySpine', $data ?? [], null); + $this->setIfExists('roleReference', $data ?? [], null); + $this->setIfExists('spinePoint', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets analysisCategoriesCodes + * + * @return \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null + */ + public function getAnalysisCategoriesCodes(): ?array + { + return $this->container['analysisCategoriesCodes']; + } + + /** + * Sets analysisCategoriesCodes + * + * @param \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null $analysisCategoriesCodes analysisCategoriesCodes + * + * @return $this + */ + public function setAnalysisCategoriesCodes(?array $analysisCategoriesCodes): static + { + if (is_null($analysisCategoriesCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoriesCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoriesCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoriesCodes'] = $analysisCategoriesCodes; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave autoAdjustForLeave + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay contributesToBasicPay + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre costCentre + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom effectiveFrom + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo effectiveTo + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets employerIdentifier + * + * @return string|null + */ + public function getEmployerIdentifier(): ?string + { + return $this->container['employerIdentifier']; + } + + /** + * Sets employerIdentifier + * + * @param string|null $employerIdentifier employerIdentifier + * + * @return $this + */ + public function setEmployerIdentifier(?string $employerIdentifier): static + { + if (is_null($employerIdentifier)) { + array_push($this->openAPINullablesSetToNull, 'employerIdentifier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerIdentifier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerIdentifier'] = $employerIdentifier; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay ignoreInitialBackPay + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay isAutomaticBackPay + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross isNetToGross + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\ContractPaylineRequest[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\ContractPaylineRequest[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note note + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount payAmount + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier payAmountMultiplier + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets payGrade + * + * @return string|null + */ + public function getPayGrade(): ?string + { + return $this->container['payGrade']; + } + + /** + * Sets payGrade + * + * @param string|null $payGrade payGrade + * + * @return $this + */ + public function setPayGrade(?string $payGrade): static + { + if (is_null($payGrade)) { + array_push($this->openAPINullablesSetToNull, 'payGrade'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payGrade', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payGrade'] = $payGrade; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets paySpine + * + * @return string|null + */ + public function getPaySpine(): ?string + { + return $this->container['paySpine']; + } + + /** + * Sets paySpine + * + * @param string|null $paySpine paySpine + * + * @return $this + */ + public function setPaySpine(?string $paySpine): static + { + if (is_null($paySpine)) { + array_push($this->openAPINullablesSetToNull, 'paySpine'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpine', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpine'] = $paySpine; + + return $this; + } + + /** + * Gets roleReference + * + * @return string|null + */ + public function getRoleReference(): ?string + { + return $this->container['roleReference']; + } + + /** + * Sets roleReference + * + * @param string|null $roleReference roleReference + * + * @return $this + */ + public function setRoleReference(?string $roleReference): static + { + if (is_null($roleReference)) { + array_push($this->openAPINullablesSetToNull, 'roleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleReference'] = $roleReference; + + return $this; + } + + /** + * Gets spinePoint + * + * @return string|null + */ + public function getSpinePoint(): ?string + { + return $this->container['spinePoint']; + } + + /** + * Sets spinePoint + * + * @param string|null $spinePoint spinePoint + * + * @return $this + */ + public function setSpinePoint(?string $spinePoint): static + { + if (is_null($spinePoint)) { + array_push($this->openAPINullablesSetToNull, 'spinePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinePoint'] = $spinePoint; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayOptionsRequest.php b/src/Model/ContractPayOptionsRequest.php new file mode 100644 index 0000000..777f0e2 --- /dev/null +++ b/src/Model/ContractPayOptionsRequest.php @@ -0,0 +1,1048 @@ + + */ +class ContractPayOptionsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayOptionsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'regularPayLines' => '\SynergiTech\Staffology\Model\ContractPayLineRequest[]', + 'period' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'method' => '\SynergiTech\Staffology\Model\PayMethod', + 'withholdTaxRefundIfPayIsZero' => 'bool', + 'taxAndNi' => '\SynergiTech\Staffology\Model\ContractTaxAndNi', + 'fpsFields' => '\SynergiTech\Staffology\Model\ContractFpsFields', + 'tags' => 'string[]', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'nationalMinimumWage' => 'bool', + 'payCode' => 'string', + 'mileageVehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'mapsMiles' => 'int', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'baseHourlyRate' => 'float', + 'baseDailyRate' => 'float', + 'autoAdjustForLeave' => 'bool', + 'niTable' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'regularPayLines' => null, + 'period' => null, + 'ordinal' => 'int32', + 'method' => null, + 'withholdTaxRefundIfPayIsZero' => null, + 'taxAndNi' => null, + 'fpsFields' => null, + 'tags' => null, + 'basis' => null, + 'nationalMinimumWage' => null, + 'payCode' => null, + 'mileageVehicleType' => null, + 'mapsMiles' => 'int32', + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'baseHourlyRate' => 'double', + 'baseDailyRate' => 'double', + 'autoAdjustForLeave' => null, + 'niTable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'regularPayLines' => true, + 'period' => false, + 'ordinal' => false, + 'method' => false, + 'withholdTaxRefundIfPayIsZero' => false, + 'taxAndNi' => false, + 'fpsFields' => false, + 'tags' => true, + 'basis' => false, + 'nationalMinimumWage' => false, + 'payCode' => true, + 'mileageVehicleType' => false, + 'mapsMiles' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'baseHourlyRate' => false, + 'baseDailyRate' => false, + 'autoAdjustForLeave' => false, + 'niTable' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'regularPayLines' => 'regularPayLines', + 'period' => 'period', + 'ordinal' => 'ordinal', + 'method' => 'method', + 'withholdTaxRefundIfPayIsZero' => 'withholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'taxAndNi', + 'fpsFields' => 'fpsFields', + 'tags' => 'tags', + 'basis' => 'basis', + 'nationalMinimumWage' => 'nationalMinimumWage', + 'payCode' => 'payCode', + 'mileageVehicleType' => 'mileageVehicleType', + 'mapsMiles' => 'mapsMiles', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'baseHourlyRate' => 'baseHourlyRate', + 'baseDailyRate' => 'baseDailyRate', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'niTable' => 'niTable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'regularPayLines' => 'setRegularPayLines', + 'period' => 'setPeriod', + 'ordinal' => 'setOrdinal', + 'method' => 'setMethod', + 'withholdTaxRefundIfPayIsZero' => 'setWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'setTaxAndNi', + 'fpsFields' => 'setFpsFields', + 'tags' => 'setTags', + 'basis' => 'setBasis', + 'nationalMinimumWage' => 'setNationalMinimumWage', + 'payCode' => 'setPayCode', + 'mileageVehicleType' => 'setMileageVehicleType', + 'mapsMiles' => 'setMapsMiles', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'baseDailyRate' => 'setBaseDailyRate', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'niTable' => 'setNiTable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'regularPayLines' => 'getRegularPayLines', + 'period' => 'getPeriod', + 'ordinal' => 'getOrdinal', + 'method' => 'getMethod', + 'withholdTaxRefundIfPayIsZero' => 'getWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'getTaxAndNi', + 'fpsFields' => 'getFpsFields', + 'tags' => 'getTags', + 'basis' => 'getBasis', + 'nationalMinimumWage' => 'getNationalMinimumWage', + 'payCode' => 'getPayCode', + 'mileageVehicleType' => 'getMileageVehicleType', + 'mapsMiles' => 'getMapsMiles', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'baseDailyRate' => 'getBaseDailyRate', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'niTable' => 'getNiTable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('regularPayLines', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('withholdTaxRefundIfPayIsZero', $data ?? [], null); + $this->setIfExists('taxAndNi', $data ?? [], null); + $this->setIfExists('fpsFields', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('nationalMinimumWage', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('mileageVehicleType', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets regularPayLines + * + * @return \SynergiTech\Staffology\Model\ContractPayLineRequest[]|null + */ + public function getRegularPayLines(): ?array + { + return $this->container['regularPayLines']; + } + + /** + * Sets regularPayLines + * + * @param \SynergiTech\Staffology\Model\ContractPayLineRequest[]|null $regularPayLines These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. + * + * @return $this + */ + public function setRegularPayLines(?array $regularPayLines): static + { + if (is_null($regularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'regularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('regularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['regularPayLines'] = $regularPayLines; + + return $this; + } + + /** + * Gets period + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $period period + * + * @return $this + */ + public function setPeriod(?\SynergiTech\Staffology\Model\PayPeriods $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets method + * + * @return \SynergiTech\Staffology\Model\PayMethod|null + */ + public function getMethod(): ?\SynergiTech\Staffology\Model\PayMethod + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param \SynergiTech\Staffology\Model\PayMethod|null $method method + * + * @return $this + */ + public function setMethod(?\SynergiTech\Staffology\Model\PayMethod $method): static + { + if (is_null($method)) { + throw new InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets withholdTaxRefundIfPayIsZero + * + * @return bool|null + */ + public function getWithholdTaxRefundIfPayIsZero(): ?bool + { + return $this->container['withholdTaxRefundIfPayIsZero']; + } + + /** + * Sets withholdTaxRefundIfPayIsZero + * + * @param bool|null $withholdTaxRefundIfPayIsZero If you don't want negative PAYE values when the Gross pay is zero, set this to true + * + * @return $this + */ + public function setWithholdTaxRefundIfPayIsZero(?bool $withholdTaxRefundIfPayIsZero): static + { + if (is_null($withholdTaxRefundIfPayIsZero)) { + throw new InvalidArgumentException('non-nullable withholdTaxRefundIfPayIsZero cannot be null'); + } + $this->container['withholdTaxRefundIfPayIsZero'] = $withholdTaxRefundIfPayIsZero; + + return $this; + } + + /** + * Gets taxAndNi + * + * @return \SynergiTech\Staffology\Model\ContractTaxAndNi|null + */ + public function getTaxAndNi(): ?\SynergiTech\Staffology\Model\ContractTaxAndNi + { + return $this->container['taxAndNi']; + } + + /** + * Sets taxAndNi + * + * @param \SynergiTech\Staffology\Model\ContractTaxAndNi|null $taxAndNi taxAndNi + * + * @return $this + */ + public function setTaxAndNi(?\SynergiTech\Staffology\Model\ContractTaxAndNi $taxAndNi): static + { + if (is_null($taxAndNi)) { + throw new InvalidArgumentException('non-nullable taxAndNi cannot be null'); + } + $this->container['taxAndNi'] = $taxAndNi; + + return $this; + } + + /** + * Gets fpsFields + * + * @return \SynergiTech\Staffology\Model\ContractFpsFields|null + */ + public function getFpsFields(): ?\SynergiTech\Staffology\Model\ContractFpsFields + { + return $this->container['fpsFields']; + } + + /** + * Sets fpsFields + * + * @param \SynergiTech\Staffology\Model\ContractFpsFields|null $fpsFields fpsFields + * + * @return $this + */ + public function setFpsFields(?\SynergiTech\Staffology\Model\ContractFpsFields $fpsFields): static + { + if (is_null($fpsFields)) { + throw new InvalidArgumentException('non-nullable fpsFields cannot be null'); + } + $this->container['fpsFields'] = $fpsFields; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets nationalMinimumWage + * + * @return bool|null + */ + public function getNationalMinimumWage(): ?bool + { + return $this->container['nationalMinimumWage']; + } + + /** + * Sets nationalMinimumWage + * + * @param bool|null $nationalMinimumWage nationalMinimumWage + * + * @return $this + */ + public function setNationalMinimumWage(?bool $nationalMinimumWage): static + { + if (is_null($nationalMinimumWage)) { + throw new InvalidArgumentException('non-nullable nationalMinimumWage cannot be null'); + } + $this->container['nationalMinimumWage'] = $nationalMinimumWage; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want the Employees pay to be allocated to a code other than BASIC, specify it here + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets mileageVehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getMileageVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['mileageVehicleType']; + } + + /** + * Sets mileageVehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $mileageVehicleType mileageVehicleType + * + * @return $this + */ + public function setMileageVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $mileageVehicleType): static + { + if (is_null($mileageVehicleType)) { + throw new InvalidArgumentException('non-nullable mileageVehicleType cannot be null'); + } + $this->container['mileageVehicleType'] = $mileageVehicleType; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles The number of miles to pay for as Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayOptionsResponse.php b/src/Model/ContractPayOptionsResponse.php new file mode 100644 index 0000000..8667978 --- /dev/null +++ b/src/Model/ContractPayOptionsResponse.php @@ -0,0 +1,1082 @@ + + */ +class ContractPayOptionsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayOptionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'regularPayLines' => '\SynergiTech\Staffology\Model\ContractPayLineResponse[]', + 'basicPay' => 'float', + 'period' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'method' => '\SynergiTech\Staffology\Model\PayMethod', + 'withholdTaxRefundIfPayIsZero' => 'bool', + 'taxAndNi' => '\SynergiTech\Staffology\Model\ContractTaxAndNi', + 'fpsFields' => '\SynergiTech\Staffology\Model\ContractFpsFields', + 'tags' => 'string[]', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'nationalMinimumWage' => 'bool', + 'payCode' => 'string', + 'mileageVehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'mapsMiles' => 'int', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'baseHourlyRate' => 'float', + 'baseDailyRate' => 'float', + 'autoAdjustForLeave' => 'bool', + 'niTable' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'regularPayLines' => null, + 'basicPay' => 'double', + 'period' => null, + 'ordinal' => 'int32', + 'method' => null, + 'withholdTaxRefundIfPayIsZero' => null, + 'taxAndNi' => null, + 'fpsFields' => null, + 'tags' => null, + 'basis' => null, + 'nationalMinimumWage' => null, + 'payCode' => null, + 'mileageVehicleType' => null, + 'mapsMiles' => 'int32', + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'baseHourlyRate' => 'double', + 'baseDailyRate' => 'double', + 'autoAdjustForLeave' => null, + 'niTable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'regularPayLines' => true, + 'basicPay' => false, + 'period' => false, + 'ordinal' => false, + 'method' => false, + 'withholdTaxRefundIfPayIsZero' => false, + 'taxAndNi' => false, + 'fpsFields' => false, + 'tags' => true, + 'basis' => false, + 'nationalMinimumWage' => false, + 'payCode' => true, + 'mileageVehicleType' => false, + 'mapsMiles' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'baseHourlyRate' => false, + 'baseDailyRate' => false, + 'autoAdjustForLeave' => false, + 'niTable' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'regularPayLines' => 'regularPayLines', + 'basicPay' => 'basicPay', + 'period' => 'period', + 'ordinal' => 'ordinal', + 'method' => 'method', + 'withholdTaxRefundIfPayIsZero' => 'withholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'taxAndNi', + 'fpsFields' => 'fpsFields', + 'tags' => 'tags', + 'basis' => 'basis', + 'nationalMinimumWage' => 'nationalMinimumWage', + 'payCode' => 'payCode', + 'mileageVehicleType' => 'mileageVehicleType', + 'mapsMiles' => 'mapsMiles', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'baseHourlyRate' => 'baseHourlyRate', + 'baseDailyRate' => 'baseDailyRate', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'niTable' => 'niTable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'regularPayLines' => 'setRegularPayLines', + 'basicPay' => 'setBasicPay', + 'period' => 'setPeriod', + 'ordinal' => 'setOrdinal', + 'method' => 'setMethod', + 'withholdTaxRefundIfPayIsZero' => 'setWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'setTaxAndNi', + 'fpsFields' => 'setFpsFields', + 'tags' => 'setTags', + 'basis' => 'setBasis', + 'nationalMinimumWage' => 'setNationalMinimumWage', + 'payCode' => 'setPayCode', + 'mileageVehicleType' => 'setMileageVehicleType', + 'mapsMiles' => 'setMapsMiles', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'baseDailyRate' => 'setBaseDailyRate', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'niTable' => 'setNiTable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'regularPayLines' => 'getRegularPayLines', + 'basicPay' => 'getBasicPay', + 'period' => 'getPeriod', + 'ordinal' => 'getOrdinal', + 'method' => 'getMethod', + 'withholdTaxRefundIfPayIsZero' => 'getWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'getTaxAndNi', + 'fpsFields' => 'getFpsFields', + 'tags' => 'getTags', + 'basis' => 'getBasis', + 'nationalMinimumWage' => 'getNationalMinimumWage', + 'payCode' => 'getPayCode', + 'mileageVehicleType' => 'getMileageVehicleType', + 'mapsMiles' => 'getMapsMiles', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'baseDailyRate' => 'getBaseDailyRate', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'niTable' => 'getNiTable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('regularPayLines', $data ?? [], null); + $this->setIfExists('basicPay', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('withholdTaxRefundIfPayIsZero', $data ?? [], null); + $this->setIfExists('taxAndNi', $data ?? [], null); + $this->setIfExists('fpsFields', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('nationalMinimumWage', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('mileageVehicleType', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets regularPayLines + * + * @return \SynergiTech\Staffology\Model\ContractPayLineResponse[]|null + */ + public function getRegularPayLines(): ?array + { + return $this->container['regularPayLines']; + } + + /** + * Sets regularPayLines + * + * @param \SynergiTech\Staffology\Model\ContractPayLineResponse[]|null $regularPayLines These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. + * + * @return $this + */ + public function setRegularPayLines(?array $regularPayLines): static + { + if (is_null($regularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'regularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('regularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['regularPayLines'] = $regularPayLines; + + return $this; + } + + /** + * Gets basicPay + * + * @return float|null + */ + public function getBasicPay(): ?float + { + return $this->container['basicPay']; + } + + /** + * Sets basicPay + * + * @param float|null $basicPay The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay + * + * @return $this + */ + public function setBasicPay(?float $basicPay): static + { + if (is_null($basicPay)) { + throw new InvalidArgumentException('non-nullable basicPay cannot be null'); + } + $this->container['basicPay'] = $basicPay; + + return $this; + } + + /** + * Gets period + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $period period + * + * @return $this + */ + public function setPeriod(?\SynergiTech\Staffology\Model\PayPeriods $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets method + * + * @return \SynergiTech\Staffology\Model\PayMethod|null + */ + public function getMethod(): ?\SynergiTech\Staffology\Model\PayMethod + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param \SynergiTech\Staffology\Model\PayMethod|null $method method + * + * @return $this + */ + public function setMethod(?\SynergiTech\Staffology\Model\PayMethod $method): static + { + if (is_null($method)) { + throw new InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets withholdTaxRefundIfPayIsZero + * + * @return bool|null + */ + public function getWithholdTaxRefundIfPayIsZero(): ?bool + { + return $this->container['withholdTaxRefundIfPayIsZero']; + } + + /** + * Sets withholdTaxRefundIfPayIsZero + * + * @param bool|null $withholdTaxRefundIfPayIsZero If you don't want negative PAYE values when the Gross pay is zero, set this to true + * + * @return $this + */ + public function setWithholdTaxRefundIfPayIsZero(?bool $withholdTaxRefundIfPayIsZero): static + { + if (is_null($withholdTaxRefundIfPayIsZero)) { + throw new InvalidArgumentException('non-nullable withholdTaxRefundIfPayIsZero cannot be null'); + } + $this->container['withholdTaxRefundIfPayIsZero'] = $withholdTaxRefundIfPayIsZero; + + return $this; + } + + /** + * Gets taxAndNi + * + * @return \SynergiTech\Staffology\Model\ContractTaxAndNi|null + */ + public function getTaxAndNi(): ?\SynergiTech\Staffology\Model\ContractTaxAndNi + { + return $this->container['taxAndNi']; + } + + /** + * Sets taxAndNi + * + * @param \SynergiTech\Staffology\Model\ContractTaxAndNi|null $taxAndNi taxAndNi + * + * @return $this + */ + public function setTaxAndNi(?\SynergiTech\Staffology\Model\ContractTaxAndNi $taxAndNi): static + { + if (is_null($taxAndNi)) { + throw new InvalidArgumentException('non-nullable taxAndNi cannot be null'); + } + $this->container['taxAndNi'] = $taxAndNi; + + return $this; + } + + /** + * Gets fpsFields + * + * @return \SynergiTech\Staffology\Model\ContractFpsFields|null + */ + public function getFpsFields(): ?\SynergiTech\Staffology\Model\ContractFpsFields + { + return $this->container['fpsFields']; + } + + /** + * Sets fpsFields + * + * @param \SynergiTech\Staffology\Model\ContractFpsFields|null $fpsFields fpsFields + * + * @return $this + */ + public function setFpsFields(?\SynergiTech\Staffology\Model\ContractFpsFields $fpsFields): static + { + if (is_null($fpsFields)) { + throw new InvalidArgumentException('non-nullable fpsFields cannot be null'); + } + $this->container['fpsFields'] = $fpsFields; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets nationalMinimumWage + * + * @return bool|null + */ + public function getNationalMinimumWage(): ?bool + { + return $this->container['nationalMinimumWage']; + } + + /** + * Sets nationalMinimumWage + * + * @param bool|null $nationalMinimumWage nationalMinimumWage + * + * @return $this + */ + public function setNationalMinimumWage(?bool $nationalMinimumWage): static + { + if (is_null($nationalMinimumWage)) { + throw new InvalidArgumentException('non-nullable nationalMinimumWage cannot be null'); + } + $this->container['nationalMinimumWage'] = $nationalMinimumWage; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want the Employees pay to be allocated to a code other than BASIC, specify it here + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets mileageVehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getMileageVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['mileageVehicleType']; + } + + /** + * Sets mileageVehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $mileageVehicleType mileageVehicleType + * + * @return $this + */ + public function setMileageVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $mileageVehicleType): static + { + if (is_null($mileageVehicleType)) { + throw new InvalidArgumentException('non-nullable mileageVehicleType cannot be null'); + } + $this->container['mileageVehicleType'] = $mileageVehicleType; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles The number of miles to pay for as Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayRunStateHistoryResponse.php b/src/Model/ContractPayRunStateHistoryResponse.php new file mode 100644 index 0000000..33592f1 --- /dev/null +++ b/src/Model/ContractPayRunStateHistoryResponse.php @@ -0,0 +1,442 @@ + + */ +class ContractPayRunStateHistoryResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayRunStateHistoryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'state' => '\SynergiTech\Staffology\Model\PayRunState', + 'createdDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'state' => null, + 'createdDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'state' => false, + 'createdDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'state' => 'state', + 'createdDate' => 'createdDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'state' => 'setState', + 'createdDate' => 'setCreatedDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'state' => 'getState', + 'createdDate' => 'getCreatedDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('createdDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\PayRunState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\PayRunState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\PayRunState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\PayRunState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets createdDate + * + * @return \DateTime|null + */ + public function getCreatedDate(): ?\DateTime + { + return $this->container['createdDate']; + } + + /** + * Sets createdDate + * + * @param \DateTime|null $createdDate Date in which the State was changed + * + * @return $this + */ + public function setCreatedDate(?\DateTime $createdDate): static + { + if (is_null($createdDate)) { + throw new InvalidArgumentException('non-nullable createdDate cannot be null'); + } + $this->container['createdDate'] = $createdDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaySpineGradeRequest.php b/src/Model/ContractPaySpineGradeRequest.php new file mode 100644 index 0000000..8f1431f --- /dev/null +++ b/src/Model/ContractPaySpineGradeRequest.php @@ -0,0 +1,585 @@ + + */ +class ContractPaySpineGradeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaySpineGradeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'lowerPointUniqueId' => 'string', + 'upperPointUniqueId' => 'string', + 'upperPointUseMax' => 'bool', + 'effectiveDate' => '\DateTime', + 'holidayEntitlement' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'lowerPointUniqueId' => 'uuid', + 'upperPointUniqueId' => 'uuid', + 'upperPointUseMax' => null, + 'effectiveDate' => 'date', + 'holidayEntitlement' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'lowerPointUniqueId' => false, + 'upperPointUniqueId' => false, + 'upperPointUseMax' => false, + 'effectiveDate' => false, + 'holidayEntitlement' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'lowerPointUniqueId' => 'lowerPointUniqueId', + 'upperPointUniqueId' => 'upperPointUniqueId', + 'upperPointUseMax' => 'upperPointUseMax', + 'effectiveDate' => 'effectiveDate', + 'holidayEntitlement' => 'holidayEntitlement' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'lowerPointUniqueId' => 'setLowerPointUniqueId', + 'upperPointUniqueId' => 'setUpperPointUniqueId', + 'upperPointUseMax' => 'setUpperPointUseMax', + 'effectiveDate' => 'setEffectiveDate', + 'holidayEntitlement' => 'setHolidayEntitlement' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'lowerPointUniqueId' => 'getLowerPointUniqueId', + 'upperPointUniqueId' => 'getUpperPointUniqueId', + 'upperPointUseMax' => 'getUpperPointUseMax', + 'effectiveDate' => 'getEffectiveDate', + 'holidayEntitlement' => 'getHolidayEntitlement' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('lowerPointUniqueId', $data ?? [], null); + $this->setIfExists('upperPointUniqueId', $data ?? [], null); + $this->setIfExists('upperPointUseMax', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('holidayEntitlement', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Pay spine grade name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets lowerPointUniqueId + * + * @return string|null + */ + public function getLowerPointUniqueId(): ?string + { + return $this->container['lowerPointUniqueId']; + } + + /** + * Sets lowerPointUniqueId + * + * @param string|null $lowerPointUniqueId Id of lower spinal point to be used. + * + * @return $this + */ + public function setLowerPointUniqueId(?string $lowerPointUniqueId): static + { + if (is_null($lowerPointUniqueId)) { + throw new InvalidArgumentException('non-nullable lowerPointUniqueId cannot be null'); + } + $this->container['lowerPointUniqueId'] = $lowerPointUniqueId; + + return $this; + } + + /** + * Gets upperPointUniqueId + * + * @return string|null + */ + public function getUpperPointUniqueId(): ?string + { + return $this->container['upperPointUniqueId']; + } + + /** + * Sets upperPointUniqueId + * + * @param string|null $upperPointUniqueId Id of upper spinal point to be used. + * + * @return $this + */ + public function setUpperPointUniqueId(?string $upperPointUniqueId): static + { + if (is_null($upperPointUniqueId)) { + throw new InvalidArgumentException('non-nullable upperPointUniqueId cannot be null'); + } + $this->container['upperPointUniqueId'] = $upperPointUniqueId; + + return $this; + } + + /** + * Gets upperPointUseMax + * + * @return bool|null + */ + public function getUpperPointUseMax(): ?bool + { + return $this->container['upperPointUseMax']; + } + + /** + * Sets upperPointUseMax + * + * @param bool|null $upperPointUseMax Use the Alt Max Value of the Upper Point. (Default false) + * + * @return $this + */ + public function setUpperPointUseMax(?bool $upperPointUseMax): static + { + if (is_null($upperPointUseMax)) { + throw new InvalidArgumentException('non-nullable upperPointUseMax cannot be null'); + } + $this->container['upperPointUseMax'] = $upperPointUseMax; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Date that this configuration is effective from. + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets holidayEntitlement + * + * @return float|null + */ + public function getHolidayEntitlement(): ?float + { + return $this->container['holidayEntitlement']; + } + + /** + * Sets holidayEntitlement + * + * @param float|null $holidayEntitlement The number of holiday days entitled for this pay spine grade. + * + * @return $this + */ + public function setHolidayEntitlement(?float $holidayEntitlement): static + { + if (is_null($holidayEntitlement)) { + throw new InvalidArgumentException('non-nullable holidayEntitlement cannot be null'); + } + $this->container['holidayEntitlement'] = $holidayEntitlement; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaySpineGradeResponse.php b/src/Model/ContractPaySpineGradeResponse.php new file mode 100644 index 0000000..f51610d --- /dev/null +++ b/src/Model/ContractPaySpineGradeResponse.php @@ -0,0 +1,619 @@ + + */ +class ContractPaySpineGradeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaySpineGradeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'lowerPointUniqueId' => 'string', + 'upperPointUniqueId' => 'string', + 'upperPointUseMax' => 'bool', + 'effectiveDate' => '\DateTime', + 'uniqueId' => 'string', + 'holidayEntitlement' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'lowerPointUniqueId' => 'uuid', + 'upperPointUniqueId' => 'uuid', + 'upperPointUseMax' => null, + 'effectiveDate' => 'date', + 'uniqueId' => 'uuid', + 'holidayEntitlement' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'lowerPointUniqueId' => false, + 'upperPointUniqueId' => false, + 'upperPointUseMax' => false, + 'effectiveDate' => false, + 'uniqueId' => false, + 'holidayEntitlement' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'lowerPointUniqueId' => 'lowerPointUniqueId', + 'upperPointUniqueId' => 'upperPointUniqueId', + 'upperPointUseMax' => 'upperPointUseMax', + 'effectiveDate' => 'effectiveDate', + 'uniqueId' => 'uniqueId', + 'holidayEntitlement' => 'holidayEntitlement' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'lowerPointUniqueId' => 'setLowerPointUniqueId', + 'upperPointUniqueId' => 'setUpperPointUniqueId', + 'upperPointUseMax' => 'setUpperPointUseMax', + 'effectiveDate' => 'setEffectiveDate', + 'uniqueId' => 'setUniqueId', + 'holidayEntitlement' => 'setHolidayEntitlement' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'lowerPointUniqueId' => 'getLowerPointUniqueId', + 'upperPointUniqueId' => 'getUpperPointUniqueId', + 'upperPointUseMax' => 'getUpperPointUseMax', + 'effectiveDate' => 'getEffectiveDate', + 'uniqueId' => 'getUniqueId', + 'holidayEntitlement' => 'getHolidayEntitlement' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('lowerPointUniqueId', $data ?? [], null); + $this->setIfExists('upperPointUniqueId', $data ?? [], null); + $this->setIfExists('upperPointUseMax', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('holidayEntitlement', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Pay spine grade name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets lowerPointUniqueId + * + * @return string|null + */ + public function getLowerPointUniqueId(): ?string + { + return $this->container['lowerPointUniqueId']; + } + + /** + * Sets lowerPointUniqueId + * + * @param string|null $lowerPointUniqueId Id of lower spinal point used. + * + * @return $this + */ + public function setLowerPointUniqueId(?string $lowerPointUniqueId): static + { + if (is_null($lowerPointUniqueId)) { + throw new InvalidArgumentException('non-nullable lowerPointUniqueId cannot be null'); + } + $this->container['lowerPointUniqueId'] = $lowerPointUniqueId; + + return $this; + } + + /** + * Gets upperPointUniqueId + * + * @return string|null + */ + public function getUpperPointUniqueId(): ?string + { + return $this->container['upperPointUniqueId']; + } + + /** + * Sets upperPointUniqueId + * + * @param string|null $upperPointUniqueId Id of upper spinal point used. + * + * @return $this + */ + public function setUpperPointUniqueId(?string $upperPointUniqueId): static + { + if (is_null($upperPointUniqueId)) { + throw new InvalidArgumentException('non-nullable upperPointUniqueId cannot be null'); + } + $this->container['upperPointUniqueId'] = $upperPointUniqueId; + + return $this; + } + + /** + * Gets upperPointUseMax + * + * @return bool|null + */ + public function getUpperPointUseMax(): ?bool + { + return $this->container['upperPointUseMax']; + } + + /** + * Sets upperPointUseMax + * + * @param bool|null $upperPointUseMax Use the Alt Max Value of the Upper Point. (Default false) + * + * @return $this + */ + public function setUpperPointUseMax(?bool $upperPointUseMax): static + { + if (is_null($upperPointUseMax)) { + throw new InvalidArgumentException('non-nullable upperPointUseMax cannot be null'); + } + $this->container['upperPointUseMax'] = $upperPointUseMax; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Date that this configuration is effective from. + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Pay spine grade Id + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets holidayEntitlement + * + * @return float|null + */ + public function getHolidayEntitlement(): ?float + { + return $this->container['holidayEntitlement']; + } + + /** + * Sets holidayEntitlement + * + * @param float|null $holidayEntitlement The number of holiday days entitled for this pay spine grade. + * + * @return $this + */ + public function setHolidayEntitlement(?float $holidayEntitlement): static + { + if (is_null($holidayEntitlement)) { + throw new InvalidArgumentException('non-nullable holidayEntitlement cannot be null'); + } + $this->container['holidayEntitlement'] = $holidayEntitlement; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaySpineRequest.php b/src/Model/ContractPaySpineRequest.php new file mode 100644 index 0000000..e8d8426 --- /dev/null +++ b/src/Model/ContractPaySpineRequest.php @@ -0,0 +1,939 @@ + + */ +class ContractPaySpineRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaySpineRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'fullTimeHours' => 'float', + 'fullTimeWeeks' => 'float', + 'salaryFormula' => 'string', + 'hourlyDivisor' => 'float', + 'hourlyDecimals' => 'int', + 'dailyDivisor' => 'float', + 'dailyDecimals' => 'int', + 'annualDecimals' => 'int', + 'annualRoundingRule' => '\SynergiTech\Staffology\Model\AnnualRoundingRule', + 'incrementRule' => '\SynergiTech\Staffology\Model\IncrementRule', + 'requiresLondonAllowance' => 'bool', + 'gradeEffectiveDate' => '\DateTime', + 'pointEffectiveDate' => '\DateTime', + 'useSpineHolidayRules' => 'bool', + 'holidayEntitlements' => '\SynergiTech\Staffology\Model\ContractHolidayEntitlementRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'fullTimeHours' => 'double', + 'fullTimeWeeks' => 'double', + 'salaryFormula' => null, + 'hourlyDivisor' => 'double', + 'hourlyDecimals' => 'int32', + 'dailyDivisor' => 'double', + 'dailyDecimals' => 'int32', + 'annualDecimals' => 'int32', + 'annualRoundingRule' => null, + 'incrementRule' => null, + 'requiresLondonAllowance' => null, + 'gradeEffectiveDate' => 'date', + 'pointEffectiveDate' => 'date', + 'useSpineHolidayRules' => null, + 'holidayEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'fullTimeHours' => false, + 'fullTimeWeeks' => false, + 'salaryFormula' => true, + 'hourlyDivisor' => false, + 'hourlyDecimals' => false, + 'dailyDivisor' => false, + 'dailyDecimals' => false, + 'annualDecimals' => false, + 'annualRoundingRule' => false, + 'incrementRule' => false, + 'requiresLondonAllowance' => false, + 'gradeEffectiveDate' => false, + 'pointEffectiveDate' => false, + 'useSpineHolidayRules' => false, + 'holidayEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'fullTimeHours' => 'fullTimeHours', + 'fullTimeWeeks' => 'fullTimeWeeks', + 'salaryFormula' => 'salaryFormula', + 'hourlyDivisor' => 'hourlyDivisor', + 'hourlyDecimals' => 'hourlyDecimals', + 'dailyDivisor' => 'dailyDivisor', + 'dailyDecimals' => 'dailyDecimals', + 'annualDecimals' => 'annualDecimals', + 'annualRoundingRule' => 'annualRoundingRule', + 'incrementRule' => 'incrementRule', + 'requiresLondonAllowance' => 'requiresLondonAllowance', + 'gradeEffectiveDate' => 'gradeEffectiveDate', + 'pointEffectiveDate' => 'pointEffectiveDate', + 'useSpineHolidayRules' => 'useSpineHolidayRules', + 'holidayEntitlements' => 'holidayEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'fullTimeHours' => 'setFullTimeHours', + 'fullTimeWeeks' => 'setFullTimeWeeks', + 'salaryFormula' => 'setSalaryFormula', + 'hourlyDivisor' => 'setHourlyDivisor', + 'hourlyDecimals' => 'setHourlyDecimals', + 'dailyDivisor' => 'setDailyDivisor', + 'dailyDecimals' => 'setDailyDecimals', + 'annualDecimals' => 'setAnnualDecimals', + 'annualRoundingRule' => 'setAnnualRoundingRule', + 'incrementRule' => 'setIncrementRule', + 'requiresLondonAllowance' => 'setRequiresLondonAllowance', + 'gradeEffectiveDate' => 'setGradeEffectiveDate', + 'pointEffectiveDate' => 'setPointEffectiveDate', + 'useSpineHolidayRules' => 'setUseSpineHolidayRules', + 'holidayEntitlements' => 'setHolidayEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'fullTimeHours' => 'getFullTimeHours', + 'fullTimeWeeks' => 'getFullTimeWeeks', + 'salaryFormula' => 'getSalaryFormula', + 'hourlyDivisor' => 'getHourlyDivisor', + 'hourlyDecimals' => 'getHourlyDecimals', + 'dailyDivisor' => 'getDailyDivisor', + 'dailyDecimals' => 'getDailyDecimals', + 'annualDecimals' => 'getAnnualDecimals', + 'annualRoundingRule' => 'getAnnualRoundingRule', + 'incrementRule' => 'getIncrementRule', + 'requiresLondonAllowance' => 'getRequiresLondonAllowance', + 'gradeEffectiveDate' => 'getGradeEffectiveDate', + 'pointEffectiveDate' => 'getPointEffectiveDate', + 'useSpineHolidayRules' => 'getUseSpineHolidayRules', + 'holidayEntitlements' => 'getHolidayEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('fullTimeHours', $data ?? [], null); + $this->setIfExists('fullTimeWeeks', $data ?? [], null); + $this->setIfExists('salaryFormula', $data ?? [], null); + $this->setIfExists('hourlyDivisor', $data ?? [], null); + $this->setIfExists('hourlyDecimals', $data ?? [], null); + $this->setIfExists('dailyDivisor', $data ?? [], null); + $this->setIfExists('dailyDecimals', $data ?? [], null); + $this->setIfExists('annualDecimals', $data ?? [], null); + $this->setIfExists('annualRoundingRule', $data ?? [], null); + $this->setIfExists('incrementRule', $data ?? [], null); + $this->setIfExists('requiresLondonAllowance', $data ?? [], null); + $this->setIfExists('gradeEffectiveDate', $data ?? [], null); + $this->setIfExists('pointEffectiveDate', $data ?? [], null); + $this->setIfExists('useSpineHolidayRules', $data ?? [], null); + $this->setIfExists('holidayEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Pay Spine + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets fullTimeHours + * + * @return float|null + */ + public function getFullTimeHours(): ?float + { + return $this->container['fullTimeHours']; + } + + /** + * Sets fullTimeHours + * + * @param float|null $fullTimeHours Maximum Full Time Hours on this Pay Spine + * + * @return $this + */ + public function setFullTimeHours(?float $fullTimeHours): static + { + if (is_null($fullTimeHours)) { + throw new InvalidArgumentException('non-nullable fullTimeHours cannot be null'); + } + $this->container['fullTimeHours'] = $fullTimeHours; + + return $this; + } + + /** + * Gets fullTimeWeeks + * + * @return float|null + */ + public function getFullTimeWeeks(): ?float + { + return $this->container['fullTimeWeeks']; + } + + /** + * Sets fullTimeWeeks + * + * @param float|null $fullTimeWeeks Maximum Full Time Weeks on this Pay Spine + * + * @return $this + */ + public function setFullTimeWeeks(?float $fullTimeWeeks): static + { + if (is_null($fullTimeWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeWeeks cannot be null'); + } + $this->container['fullTimeWeeks'] = $fullTimeWeeks; + + return $this; + } + + /** + * Gets salaryFormula + * + * @return string|null + */ + public function getSalaryFormula(): ?string + { + return $this->container['salaryFormula']; + } + + /** + * Sets salaryFormula + * + * @param string|null $salaryFormula Formula used to derive annual salary The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" + * + * @return $this + */ + public function setSalaryFormula(?string $salaryFormula): static + { + if (is_null($salaryFormula)) { + array_push($this->openAPINullablesSetToNull, 'salaryFormula'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('salaryFormula', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['salaryFormula'] = $salaryFormula; + + return $this; + } + + /** + * Gets hourlyDivisor + * + * @return float|null + */ + public function getHourlyDivisor(): ?float + { + return $this->container['hourlyDivisor']; + } + + /** + * Sets hourlyDivisor + * + * @param float|null $hourlyDivisor Hours used to determine Hourly Rate + * + * @return $this + */ + public function setHourlyDivisor(?float $hourlyDivisor): static + { + if (is_null($hourlyDivisor)) { + throw new InvalidArgumentException('non-nullable hourlyDivisor cannot be null'); + } + $this->container['hourlyDivisor'] = $hourlyDivisor; + + return $this; + } + + /** + * Gets hourlyDecimals + * + * @return int|null + */ + public function getHourlyDecimals(): ?int + { + return $this->container['hourlyDecimals']; + } + + /** + * Sets hourlyDecimals + * + * @param int|null $hourlyDecimals Number of decimal places to calculate Hourly Rates + * + * @return $this + */ + public function setHourlyDecimals(?int $hourlyDecimals): static + { + if (is_null($hourlyDecimals)) { + throw new InvalidArgumentException('non-nullable hourlyDecimals cannot be null'); + } + $this->container['hourlyDecimals'] = $hourlyDecimals; + + return $this; + } + + /** + * Gets dailyDivisor + * + * @return float|null + */ + public function getDailyDivisor(): ?float + { + return $this->container['dailyDivisor']; + } + + /** + * Sets dailyDivisor + * + * @param float|null $dailyDivisor Days used to determine Full time Daily Rate + * + * @return $this + */ + public function setDailyDivisor(?float $dailyDivisor): static + { + if (is_null($dailyDivisor)) { + throw new InvalidArgumentException('non-nullable dailyDivisor cannot be null'); + } + $this->container['dailyDivisor'] = $dailyDivisor; + + return $this; + } + + /** + * Gets dailyDecimals + * + * @return int|null + */ + public function getDailyDecimals(): ?int + { + return $this->container['dailyDecimals']; + } + + /** + * Sets dailyDecimals + * + * @param int|null $dailyDecimals Number of decimal places to calculate Daily Rates + * + * @return $this + */ + public function setDailyDecimals(?int $dailyDecimals): static + { + if (is_null($dailyDecimals)) { + throw new InvalidArgumentException('non-nullable dailyDecimals cannot be null'); + } + $this->container['dailyDecimals'] = $dailyDecimals; + + return $this; + } + + /** + * Gets annualDecimals + * + * @return int|null + */ + public function getAnnualDecimals(): ?int + { + return $this->container['annualDecimals']; + } + + /** + * Sets annualDecimals + * + * @param int|null $annualDecimals Number of decimal places to calculate Annual Salaries + * + * @return $this + */ + public function setAnnualDecimals(?int $annualDecimals): static + { + if (is_null($annualDecimals)) { + throw new InvalidArgumentException('non-nullable annualDecimals cannot be null'); + } + $this->container['annualDecimals'] = $annualDecimals; + + return $this; + } + + /** + * Gets annualRoundingRule + * + * @return \SynergiTech\Staffology\Model\AnnualRoundingRule|null + */ + public function getAnnualRoundingRule(): ?\SynergiTech\Staffology\Model\AnnualRoundingRule + { + return $this->container['annualRoundingRule']; + } + + /** + * Sets annualRoundingRule + * + * @param \SynergiTech\Staffology\Model\AnnualRoundingRule|null $annualRoundingRule annualRoundingRule + * + * @return $this + */ + public function setAnnualRoundingRule(?\SynergiTech\Staffology\Model\AnnualRoundingRule $annualRoundingRule): static + { + if (is_null($annualRoundingRule)) { + throw new InvalidArgumentException('non-nullable annualRoundingRule cannot be null'); + } + $this->container['annualRoundingRule'] = $annualRoundingRule; + + return $this; + } + + /** + * Gets incrementRule + * + * @return \SynergiTech\Staffology\Model\IncrementRule|null + */ + public function getIncrementRule(): ?\SynergiTech\Staffology\Model\IncrementRule + { + return $this->container['incrementRule']; + } + + /** + * Sets incrementRule + * + * @param \SynergiTech\Staffology\Model\IncrementRule|null $incrementRule incrementRule + * + * @return $this + */ + public function setIncrementRule(?\SynergiTech\Staffology\Model\IncrementRule $incrementRule): static + { + if (is_null($incrementRule)) { + throw new InvalidArgumentException('non-nullable incrementRule cannot be null'); + } + $this->container['incrementRule'] = $incrementRule; + + return $this; + } + + /** + * Gets requiresLondonAllowance + * + * @return bool|null + */ + public function getRequiresLondonAllowance(): ?bool + { + return $this->container['requiresLondonAllowance']; + } + + /** + * Sets requiresLondonAllowance + * + * @param bool|null $requiresLondonAllowance Requires LA column to be completed on the spine + * + * @return $this + */ + public function setRequiresLondonAllowance(?bool $requiresLondonAllowance): static + { + if (is_null($requiresLondonAllowance)) { + throw new InvalidArgumentException('non-nullable requiresLondonAllowance cannot be null'); + } + $this->container['requiresLondonAllowance'] = $requiresLondonAllowance; + + return $this; + } + + /** + * Gets gradeEffectiveDate + * + * @return \DateTime|null + */ + public function getGradeEffectiveDate(): ?\DateTime + { + return $this->container['gradeEffectiveDate']; + } + + /** + * Sets gradeEffectiveDate + * + * @param \DateTime|null $gradeEffectiveDate Effective date for applicable grades + * + * @return $this + */ + public function setGradeEffectiveDate(?\DateTime $gradeEffectiveDate): static + { + if (is_null($gradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable gradeEffectiveDate cannot be null'); + } + $this->container['gradeEffectiveDate'] = $gradeEffectiveDate; + + return $this; + } + + /** + * Gets pointEffectiveDate + * + * @return \DateTime|null + */ + public function getPointEffectiveDate(): ?\DateTime + { + return $this->container['pointEffectiveDate']; + } + + /** + * Sets pointEffectiveDate + * + * @param \DateTime|null $pointEffectiveDate Effective date for applicable spinal points + * + * @return $this + */ + public function setPointEffectiveDate(?\DateTime $pointEffectiveDate): static + { + if (is_null($pointEffectiveDate)) { + throw new InvalidArgumentException('non-nullable pointEffectiveDate cannot be null'); + } + $this->container['pointEffectiveDate'] = $pointEffectiveDate; + + return $this; + } + + /** + * Gets useSpineHolidayRules + * + * @return bool|null + */ + public function getUseSpineHolidayRules(): ?bool + { + return $this->container['useSpineHolidayRules']; + } + + /** + * Sets useSpineHolidayRules + * + * @param bool|null $useSpineHolidayRules Flag to include holiday entitlements in Payspine (Default false) + * + * @return $this + */ + public function setUseSpineHolidayRules(?bool $useSpineHolidayRules): static + { + if (is_null($useSpineHolidayRules)) { + throw new InvalidArgumentException('non-nullable useSpineHolidayRules cannot be null'); + } + $this->container['useSpineHolidayRules'] = $useSpineHolidayRules; + + return $this; + } + + /** + * Gets holidayEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractHolidayEntitlementRequest[]|null + */ + public function getHolidayEntitlements(): ?array + { + return $this->container['holidayEntitlements']; + } + + /** + * Sets holidayEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractHolidayEntitlementRequest[]|null $holidayEntitlements PaySpine Holiday Entitlements + * + * @return $this + */ + public function setHolidayEntitlements(?array $holidayEntitlements): static + { + if (is_null($holidayEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'holidayEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidayEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidayEntitlements'] = $holidayEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaySpineResponse.php b/src/Model/ContractPaySpineResponse.php new file mode 100644 index 0000000..3aed0ae --- /dev/null +++ b/src/Model/ContractPaySpineResponse.php @@ -0,0 +1,973 @@ + + */ +class ContractPaySpineResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaySpineResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'fullTimeHours' => 'float', + 'fullTimeWeeks' => 'float', + 'salaryFormula' => 'string', + 'hourlyDivisor' => 'float', + 'hourlyDecimals' => 'int', + 'dailyDivisor' => 'float', + 'dailyDecimals' => 'int', + 'annualDecimals' => 'int', + 'annualRoundingRule' => '\SynergiTech\Staffology\Model\AnnualRoundingRule', + 'incrementRule' => '\SynergiTech\Staffology\Model\IncrementRule', + 'requiresLondonAllowance' => 'bool', + 'gradeEffectiveDate' => '\DateTime', + 'pointEffectiveDate' => '\DateTime', + 'useSpineHolidayRules' => 'bool', + 'holidayEntitlements' => '\SynergiTech\Staffology\Model\ContractHolidayEntitlementResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'fullTimeHours' => 'double', + 'fullTimeWeeks' => 'double', + 'salaryFormula' => null, + 'hourlyDivisor' => 'double', + 'hourlyDecimals' => 'int32', + 'dailyDivisor' => 'double', + 'dailyDecimals' => 'int32', + 'annualDecimals' => 'int32', + 'annualRoundingRule' => null, + 'incrementRule' => null, + 'requiresLondonAllowance' => null, + 'gradeEffectiveDate' => 'date', + 'pointEffectiveDate' => 'date', + 'useSpineHolidayRules' => null, + 'holidayEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'fullTimeHours' => false, + 'fullTimeWeeks' => false, + 'salaryFormula' => true, + 'hourlyDivisor' => false, + 'hourlyDecimals' => false, + 'dailyDivisor' => false, + 'dailyDecimals' => false, + 'annualDecimals' => false, + 'annualRoundingRule' => false, + 'incrementRule' => false, + 'requiresLondonAllowance' => false, + 'gradeEffectiveDate' => false, + 'pointEffectiveDate' => false, + 'useSpineHolidayRules' => false, + 'holidayEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'fullTimeHours' => 'fullTimeHours', + 'fullTimeWeeks' => 'fullTimeWeeks', + 'salaryFormula' => 'salaryFormula', + 'hourlyDivisor' => 'hourlyDivisor', + 'hourlyDecimals' => 'hourlyDecimals', + 'dailyDivisor' => 'dailyDivisor', + 'dailyDecimals' => 'dailyDecimals', + 'annualDecimals' => 'annualDecimals', + 'annualRoundingRule' => 'annualRoundingRule', + 'incrementRule' => 'incrementRule', + 'requiresLondonAllowance' => 'requiresLondonAllowance', + 'gradeEffectiveDate' => 'gradeEffectiveDate', + 'pointEffectiveDate' => 'pointEffectiveDate', + 'useSpineHolidayRules' => 'useSpineHolidayRules', + 'holidayEntitlements' => 'holidayEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'fullTimeHours' => 'setFullTimeHours', + 'fullTimeWeeks' => 'setFullTimeWeeks', + 'salaryFormula' => 'setSalaryFormula', + 'hourlyDivisor' => 'setHourlyDivisor', + 'hourlyDecimals' => 'setHourlyDecimals', + 'dailyDivisor' => 'setDailyDivisor', + 'dailyDecimals' => 'setDailyDecimals', + 'annualDecimals' => 'setAnnualDecimals', + 'annualRoundingRule' => 'setAnnualRoundingRule', + 'incrementRule' => 'setIncrementRule', + 'requiresLondonAllowance' => 'setRequiresLondonAllowance', + 'gradeEffectiveDate' => 'setGradeEffectiveDate', + 'pointEffectiveDate' => 'setPointEffectiveDate', + 'useSpineHolidayRules' => 'setUseSpineHolidayRules', + 'holidayEntitlements' => 'setHolidayEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'fullTimeHours' => 'getFullTimeHours', + 'fullTimeWeeks' => 'getFullTimeWeeks', + 'salaryFormula' => 'getSalaryFormula', + 'hourlyDivisor' => 'getHourlyDivisor', + 'hourlyDecimals' => 'getHourlyDecimals', + 'dailyDivisor' => 'getDailyDivisor', + 'dailyDecimals' => 'getDailyDecimals', + 'annualDecimals' => 'getAnnualDecimals', + 'annualRoundingRule' => 'getAnnualRoundingRule', + 'incrementRule' => 'getIncrementRule', + 'requiresLondonAllowance' => 'getRequiresLondonAllowance', + 'gradeEffectiveDate' => 'getGradeEffectiveDate', + 'pointEffectiveDate' => 'getPointEffectiveDate', + 'useSpineHolidayRules' => 'getUseSpineHolidayRules', + 'holidayEntitlements' => 'getHolidayEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('fullTimeHours', $data ?? [], null); + $this->setIfExists('fullTimeWeeks', $data ?? [], null); + $this->setIfExists('salaryFormula', $data ?? [], null); + $this->setIfExists('hourlyDivisor', $data ?? [], null); + $this->setIfExists('hourlyDecimals', $data ?? [], null); + $this->setIfExists('dailyDivisor', $data ?? [], null); + $this->setIfExists('dailyDecimals', $data ?? [], null); + $this->setIfExists('annualDecimals', $data ?? [], null); + $this->setIfExists('annualRoundingRule', $data ?? [], null); + $this->setIfExists('incrementRule', $data ?? [], null); + $this->setIfExists('requiresLondonAllowance', $data ?? [], null); + $this->setIfExists('gradeEffectiveDate', $data ?? [], null); + $this->setIfExists('pointEffectiveDate', $data ?? [], null); + $this->setIfExists('useSpineHolidayRules', $data ?? [], null); + $this->setIfExists('holidayEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Pay Spine identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Pay Spine + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets fullTimeHours + * + * @return float|null + */ + public function getFullTimeHours(): ?float + { + return $this->container['fullTimeHours']; + } + + /** + * Sets fullTimeHours + * + * @param float|null $fullTimeHours Maximum Full Time Hours on this Pay Spine + * + * @return $this + */ + public function setFullTimeHours(?float $fullTimeHours): static + { + if (is_null($fullTimeHours)) { + throw new InvalidArgumentException('non-nullable fullTimeHours cannot be null'); + } + $this->container['fullTimeHours'] = $fullTimeHours; + + return $this; + } + + /** + * Gets fullTimeWeeks + * + * @return float|null + */ + public function getFullTimeWeeks(): ?float + { + return $this->container['fullTimeWeeks']; + } + + /** + * Sets fullTimeWeeks + * + * @param float|null $fullTimeWeeks Maximum Full Time Weeks on this Pay Spine + * + * @return $this + */ + public function setFullTimeWeeks(?float $fullTimeWeeks): static + { + if (is_null($fullTimeWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeWeeks cannot be null'); + } + $this->container['fullTimeWeeks'] = $fullTimeWeeks; + + return $this; + } + + /** + * Gets salaryFormula + * + * @return string|null + */ + public function getSalaryFormula(): ?string + { + return $this->container['salaryFormula']; + } + + /** + * Sets salaryFormula + * + * @param string|null $salaryFormula Formula used to derive annual salary The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" + * + * @return $this + */ + public function setSalaryFormula(?string $salaryFormula): static + { + if (is_null($salaryFormula)) { + array_push($this->openAPINullablesSetToNull, 'salaryFormula'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('salaryFormula', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['salaryFormula'] = $salaryFormula; + + return $this; + } + + /** + * Gets hourlyDivisor + * + * @return float|null + */ + public function getHourlyDivisor(): ?float + { + return $this->container['hourlyDivisor']; + } + + /** + * Sets hourlyDivisor + * + * @param float|null $hourlyDivisor Hours used to determine Hourly Rate + * + * @return $this + */ + public function setHourlyDivisor(?float $hourlyDivisor): static + { + if (is_null($hourlyDivisor)) { + throw new InvalidArgumentException('non-nullable hourlyDivisor cannot be null'); + } + $this->container['hourlyDivisor'] = $hourlyDivisor; + + return $this; + } + + /** + * Gets hourlyDecimals + * + * @return int|null + */ + public function getHourlyDecimals(): ?int + { + return $this->container['hourlyDecimals']; + } + + /** + * Sets hourlyDecimals + * + * @param int|null $hourlyDecimals Number of decimal places to calculate Hourly Rates + * + * @return $this + */ + public function setHourlyDecimals(?int $hourlyDecimals): static + { + if (is_null($hourlyDecimals)) { + throw new InvalidArgumentException('non-nullable hourlyDecimals cannot be null'); + } + $this->container['hourlyDecimals'] = $hourlyDecimals; + + return $this; + } + + /** + * Gets dailyDivisor + * + * @return float|null + */ + public function getDailyDivisor(): ?float + { + return $this->container['dailyDivisor']; + } + + /** + * Sets dailyDivisor + * + * @param float|null $dailyDivisor Days used to determine Full time Daily Rate + * + * @return $this + */ + public function setDailyDivisor(?float $dailyDivisor): static + { + if (is_null($dailyDivisor)) { + throw new InvalidArgumentException('non-nullable dailyDivisor cannot be null'); + } + $this->container['dailyDivisor'] = $dailyDivisor; + + return $this; + } + + /** + * Gets dailyDecimals + * + * @return int|null + */ + public function getDailyDecimals(): ?int + { + return $this->container['dailyDecimals']; + } + + /** + * Sets dailyDecimals + * + * @param int|null $dailyDecimals Number of decimal places to calculate Daily Rates + * + * @return $this + */ + public function setDailyDecimals(?int $dailyDecimals): static + { + if (is_null($dailyDecimals)) { + throw new InvalidArgumentException('non-nullable dailyDecimals cannot be null'); + } + $this->container['dailyDecimals'] = $dailyDecimals; + + return $this; + } + + /** + * Gets annualDecimals + * + * @return int|null + */ + public function getAnnualDecimals(): ?int + { + return $this->container['annualDecimals']; + } + + /** + * Sets annualDecimals + * + * @param int|null $annualDecimals Number of decimal places to calculate Annual Salaries + * + * @return $this + */ + public function setAnnualDecimals(?int $annualDecimals): static + { + if (is_null($annualDecimals)) { + throw new InvalidArgumentException('non-nullable annualDecimals cannot be null'); + } + $this->container['annualDecimals'] = $annualDecimals; + + return $this; + } + + /** + * Gets annualRoundingRule + * + * @return \SynergiTech\Staffology\Model\AnnualRoundingRule|null + */ + public function getAnnualRoundingRule(): ?\SynergiTech\Staffology\Model\AnnualRoundingRule + { + return $this->container['annualRoundingRule']; + } + + /** + * Sets annualRoundingRule + * + * @param \SynergiTech\Staffology\Model\AnnualRoundingRule|null $annualRoundingRule annualRoundingRule + * + * @return $this + */ + public function setAnnualRoundingRule(?\SynergiTech\Staffology\Model\AnnualRoundingRule $annualRoundingRule): static + { + if (is_null($annualRoundingRule)) { + throw new InvalidArgumentException('non-nullable annualRoundingRule cannot be null'); + } + $this->container['annualRoundingRule'] = $annualRoundingRule; + + return $this; + } + + /** + * Gets incrementRule + * + * @return \SynergiTech\Staffology\Model\IncrementRule|null + */ + public function getIncrementRule(): ?\SynergiTech\Staffology\Model\IncrementRule + { + return $this->container['incrementRule']; + } + + /** + * Sets incrementRule + * + * @param \SynergiTech\Staffology\Model\IncrementRule|null $incrementRule incrementRule + * + * @return $this + */ + public function setIncrementRule(?\SynergiTech\Staffology\Model\IncrementRule $incrementRule): static + { + if (is_null($incrementRule)) { + throw new InvalidArgumentException('non-nullable incrementRule cannot be null'); + } + $this->container['incrementRule'] = $incrementRule; + + return $this; + } + + /** + * Gets requiresLondonAllowance + * + * @return bool|null + */ + public function getRequiresLondonAllowance(): ?bool + { + return $this->container['requiresLondonAllowance']; + } + + /** + * Sets requiresLondonAllowance + * + * @param bool|null $requiresLondonAllowance Requires LA column to be completed on the spine + * + * @return $this + */ + public function setRequiresLondonAllowance(?bool $requiresLondonAllowance): static + { + if (is_null($requiresLondonAllowance)) { + throw new InvalidArgumentException('non-nullable requiresLondonAllowance cannot be null'); + } + $this->container['requiresLondonAllowance'] = $requiresLondonAllowance; + + return $this; + } + + /** + * Gets gradeEffectiveDate + * + * @return \DateTime|null + */ + public function getGradeEffectiveDate(): ?\DateTime + { + return $this->container['gradeEffectiveDate']; + } + + /** + * Sets gradeEffectiveDate + * + * @param \DateTime|null $gradeEffectiveDate Effective date for applicable grades + * + * @return $this + */ + public function setGradeEffectiveDate(?\DateTime $gradeEffectiveDate): static + { + if (is_null($gradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable gradeEffectiveDate cannot be null'); + } + $this->container['gradeEffectiveDate'] = $gradeEffectiveDate; + + return $this; + } + + /** + * Gets pointEffectiveDate + * + * @return \DateTime|null + */ + public function getPointEffectiveDate(): ?\DateTime + { + return $this->container['pointEffectiveDate']; + } + + /** + * Sets pointEffectiveDate + * + * @param \DateTime|null $pointEffectiveDate Effective date for applicable spinal points + * + * @return $this + */ + public function setPointEffectiveDate(?\DateTime $pointEffectiveDate): static + { + if (is_null($pointEffectiveDate)) { + throw new InvalidArgumentException('non-nullable pointEffectiveDate cannot be null'); + } + $this->container['pointEffectiveDate'] = $pointEffectiveDate; + + return $this; + } + + /** + * Gets useSpineHolidayRules + * + * @return bool|null + */ + public function getUseSpineHolidayRules(): ?bool + { + return $this->container['useSpineHolidayRules']; + } + + /** + * Sets useSpineHolidayRules + * + * @param bool|null $useSpineHolidayRules Flag to include holiday entitlements in Payspine (Default false) + * + * @return $this + */ + public function setUseSpineHolidayRules(?bool $useSpineHolidayRules): static + { + if (is_null($useSpineHolidayRules)) { + throw new InvalidArgumentException('non-nullable useSpineHolidayRules cannot be null'); + } + $this->container['useSpineHolidayRules'] = $useSpineHolidayRules; + + return $this; + } + + /** + * Gets holidayEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractHolidayEntitlementResponse[]|null + */ + public function getHolidayEntitlements(): ?array + { + return $this->container['holidayEntitlements']; + } + + /** + * Sets holidayEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractHolidayEntitlementResponse[]|null $holidayEntitlements PaySpine Years Service Entitlements + * + * @return $this + */ + public function setHolidayEntitlements(?array $holidayEntitlements): static + { + if (is_null($holidayEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'holidayEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidayEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidayEntitlements'] = $holidayEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaySpineUpdateRequest.php b/src/Model/ContractPaySpineUpdateRequest.php new file mode 100644 index 0000000..ffda058 --- /dev/null +++ b/src/Model/ContractPaySpineUpdateRequest.php @@ -0,0 +1,939 @@ + + */ +class ContractPaySpineUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaySpineUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'fullTimeHours' => 'float', + 'fullTimeWeeks' => 'float', + 'salaryFormula' => 'string', + 'hourlyDivisor' => 'float', + 'hourlyDecimals' => 'int', + 'dailyDivisor' => 'float', + 'dailyDecimals' => 'int', + 'annualDecimals' => 'int', + 'annualRoundingRule' => '\SynergiTech\Staffology\Model\AnnualRoundingRule', + 'incrementRule' => '\SynergiTech\Staffology\Model\IncrementRule', + 'requiresLondonAllowance' => 'bool', + 'gradeEffectiveDate' => '\DateTime', + 'pointEffectiveDate' => '\DateTime', + 'useSpineHolidayRules' => 'bool', + 'holidayEntitlements' => '\SynergiTech\Staffology\Model\ContractHolidayEntitlementUpdateRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'fullTimeHours' => 'double', + 'fullTimeWeeks' => 'double', + 'salaryFormula' => null, + 'hourlyDivisor' => 'double', + 'hourlyDecimals' => 'int32', + 'dailyDivisor' => 'double', + 'dailyDecimals' => 'int32', + 'annualDecimals' => 'int32', + 'annualRoundingRule' => null, + 'incrementRule' => null, + 'requiresLondonAllowance' => null, + 'gradeEffectiveDate' => 'date', + 'pointEffectiveDate' => 'date', + 'useSpineHolidayRules' => null, + 'holidayEntitlements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'fullTimeHours' => false, + 'fullTimeWeeks' => false, + 'salaryFormula' => true, + 'hourlyDivisor' => false, + 'hourlyDecimals' => false, + 'dailyDivisor' => false, + 'dailyDecimals' => false, + 'annualDecimals' => false, + 'annualRoundingRule' => false, + 'incrementRule' => false, + 'requiresLondonAllowance' => false, + 'gradeEffectiveDate' => false, + 'pointEffectiveDate' => false, + 'useSpineHolidayRules' => false, + 'holidayEntitlements' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'fullTimeHours' => 'fullTimeHours', + 'fullTimeWeeks' => 'fullTimeWeeks', + 'salaryFormula' => 'salaryFormula', + 'hourlyDivisor' => 'hourlyDivisor', + 'hourlyDecimals' => 'hourlyDecimals', + 'dailyDivisor' => 'dailyDivisor', + 'dailyDecimals' => 'dailyDecimals', + 'annualDecimals' => 'annualDecimals', + 'annualRoundingRule' => 'annualRoundingRule', + 'incrementRule' => 'incrementRule', + 'requiresLondonAllowance' => 'requiresLondonAllowance', + 'gradeEffectiveDate' => 'gradeEffectiveDate', + 'pointEffectiveDate' => 'pointEffectiveDate', + 'useSpineHolidayRules' => 'useSpineHolidayRules', + 'holidayEntitlements' => 'holidayEntitlements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'fullTimeHours' => 'setFullTimeHours', + 'fullTimeWeeks' => 'setFullTimeWeeks', + 'salaryFormula' => 'setSalaryFormula', + 'hourlyDivisor' => 'setHourlyDivisor', + 'hourlyDecimals' => 'setHourlyDecimals', + 'dailyDivisor' => 'setDailyDivisor', + 'dailyDecimals' => 'setDailyDecimals', + 'annualDecimals' => 'setAnnualDecimals', + 'annualRoundingRule' => 'setAnnualRoundingRule', + 'incrementRule' => 'setIncrementRule', + 'requiresLondonAllowance' => 'setRequiresLondonAllowance', + 'gradeEffectiveDate' => 'setGradeEffectiveDate', + 'pointEffectiveDate' => 'setPointEffectiveDate', + 'useSpineHolidayRules' => 'setUseSpineHolidayRules', + 'holidayEntitlements' => 'setHolidayEntitlements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'fullTimeHours' => 'getFullTimeHours', + 'fullTimeWeeks' => 'getFullTimeWeeks', + 'salaryFormula' => 'getSalaryFormula', + 'hourlyDivisor' => 'getHourlyDivisor', + 'hourlyDecimals' => 'getHourlyDecimals', + 'dailyDivisor' => 'getDailyDivisor', + 'dailyDecimals' => 'getDailyDecimals', + 'annualDecimals' => 'getAnnualDecimals', + 'annualRoundingRule' => 'getAnnualRoundingRule', + 'incrementRule' => 'getIncrementRule', + 'requiresLondonAllowance' => 'getRequiresLondonAllowance', + 'gradeEffectiveDate' => 'getGradeEffectiveDate', + 'pointEffectiveDate' => 'getPointEffectiveDate', + 'useSpineHolidayRules' => 'getUseSpineHolidayRules', + 'holidayEntitlements' => 'getHolidayEntitlements' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('fullTimeHours', $data ?? [], null); + $this->setIfExists('fullTimeWeeks', $data ?? [], null); + $this->setIfExists('salaryFormula', $data ?? [], null); + $this->setIfExists('hourlyDivisor', $data ?? [], null); + $this->setIfExists('hourlyDecimals', $data ?? [], null); + $this->setIfExists('dailyDivisor', $data ?? [], null); + $this->setIfExists('dailyDecimals', $data ?? [], null); + $this->setIfExists('annualDecimals', $data ?? [], null); + $this->setIfExists('annualRoundingRule', $data ?? [], null); + $this->setIfExists('incrementRule', $data ?? [], null); + $this->setIfExists('requiresLondonAllowance', $data ?? [], null); + $this->setIfExists('gradeEffectiveDate', $data ?? [], null); + $this->setIfExists('pointEffectiveDate', $data ?? [], null); + $this->setIfExists('useSpineHolidayRules', $data ?? [], null); + $this->setIfExists('holidayEntitlements', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Pay Spine + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets fullTimeHours + * + * @return float|null + */ + public function getFullTimeHours(): ?float + { + return $this->container['fullTimeHours']; + } + + /** + * Sets fullTimeHours + * + * @param float|null $fullTimeHours Maximum Full Time Hours on this Pay Spine + * + * @return $this + */ + public function setFullTimeHours(?float $fullTimeHours): static + { + if (is_null($fullTimeHours)) { + throw new InvalidArgumentException('non-nullable fullTimeHours cannot be null'); + } + $this->container['fullTimeHours'] = $fullTimeHours; + + return $this; + } + + /** + * Gets fullTimeWeeks + * + * @return float|null + */ + public function getFullTimeWeeks(): ?float + { + return $this->container['fullTimeWeeks']; + } + + /** + * Sets fullTimeWeeks + * + * @param float|null $fullTimeWeeks Maximum Full Time Weeks on this Pay Spine + * + * @return $this + */ + public function setFullTimeWeeks(?float $fullTimeWeeks): static + { + if (is_null($fullTimeWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeWeeks cannot be null'); + } + $this->container['fullTimeWeeks'] = $fullTimeWeeks; + + return $this; + } + + /** + * Gets salaryFormula + * + * @return string|null + */ + public function getSalaryFormula(): ?string + { + return $this->container['salaryFormula']; + } + + /** + * Sets salaryFormula + * + * @param string|null $salaryFormula Formula used to derive annual salary The salary formula consists of the following elements and Round functions: - PointValue (The value of an individual Spinal Point) - HoursWorked (The hours an employee is contracted to work for in their role) - FTHours (The full time hours specified for an employee in their role) - WeeksWorked (The contracted weeks an employee works in their role) - FTWeeks (The full weeks specified for an employee in their role) Round functions: - ROUND(Value,decimal places): Round the value to specific decimal places. The maximum value is between 0 and 15. - ROUNDUP(Value) - ROUNDDOWN(Value) - TRUNCATE(Value) For example: \"PointValue * ROUND(HoursWorked * WeeksWorked * (7/365),3) / FTHours\" + * + * @return $this + */ + public function setSalaryFormula(?string $salaryFormula): static + { + if (is_null($salaryFormula)) { + array_push($this->openAPINullablesSetToNull, 'salaryFormula'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('salaryFormula', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['salaryFormula'] = $salaryFormula; + + return $this; + } + + /** + * Gets hourlyDivisor + * + * @return float|null + */ + public function getHourlyDivisor(): ?float + { + return $this->container['hourlyDivisor']; + } + + /** + * Sets hourlyDivisor + * + * @param float|null $hourlyDivisor Hours used to determine Hourly Rate + * + * @return $this + */ + public function setHourlyDivisor(?float $hourlyDivisor): static + { + if (is_null($hourlyDivisor)) { + throw new InvalidArgumentException('non-nullable hourlyDivisor cannot be null'); + } + $this->container['hourlyDivisor'] = $hourlyDivisor; + + return $this; + } + + /** + * Gets hourlyDecimals + * + * @return int|null + */ + public function getHourlyDecimals(): ?int + { + return $this->container['hourlyDecimals']; + } + + /** + * Sets hourlyDecimals + * + * @param int|null $hourlyDecimals Number of decimal places to calculate Hourly Rates + * + * @return $this + */ + public function setHourlyDecimals(?int $hourlyDecimals): static + { + if (is_null($hourlyDecimals)) { + throw new InvalidArgumentException('non-nullable hourlyDecimals cannot be null'); + } + $this->container['hourlyDecimals'] = $hourlyDecimals; + + return $this; + } + + /** + * Gets dailyDivisor + * + * @return float|null + */ + public function getDailyDivisor(): ?float + { + return $this->container['dailyDivisor']; + } + + /** + * Sets dailyDivisor + * + * @param float|null $dailyDivisor Days used to determine Full time Daily Rate + * + * @return $this + */ + public function setDailyDivisor(?float $dailyDivisor): static + { + if (is_null($dailyDivisor)) { + throw new InvalidArgumentException('non-nullable dailyDivisor cannot be null'); + } + $this->container['dailyDivisor'] = $dailyDivisor; + + return $this; + } + + /** + * Gets dailyDecimals + * + * @return int|null + */ + public function getDailyDecimals(): ?int + { + return $this->container['dailyDecimals']; + } + + /** + * Sets dailyDecimals + * + * @param int|null $dailyDecimals Number of decimal places to calculate Daily Rates + * + * @return $this + */ + public function setDailyDecimals(?int $dailyDecimals): static + { + if (is_null($dailyDecimals)) { + throw new InvalidArgumentException('non-nullable dailyDecimals cannot be null'); + } + $this->container['dailyDecimals'] = $dailyDecimals; + + return $this; + } + + /** + * Gets annualDecimals + * + * @return int|null + */ + public function getAnnualDecimals(): ?int + { + return $this->container['annualDecimals']; + } + + /** + * Sets annualDecimals + * + * @param int|null $annualDecimals Number of decimal places to calculate Annual Salaries + * + * @return $this + */ + public function setAnnualDecimals(?int $annualDecimals): static + { + if (is_null($annualDecimals)) { + throw new InvalidArgumentException('non-nullable annualDecimals cannot be null'); + } + $this->container['annualDecimals'] = $annualDecimals; + + return $this; + } + + /** + * Gets annualRoundingRule + * + * @return \SynergiTech\Staffology\Model\AnnualRoundingRule|null + */ + public function getAnnualRoundingRule(): ?\SynergiTech\Staffology\Model\AnnualRoundingRule + { + return $this->container['annualRoundingRule']; + } + + /** + * Sets annualRoundingRule + * + * @param \SynergiTech\Staffology\Model\AnnualRoundingRule|null $annualRoundingRule annualRoundingRule + * + * @return $this + */ + public function setAnnualRoundingRule(?\SynergiTech\Staffology\Model\AnnualRoundingRule $annualRoundingRule): static + { + if (is_null($annualRoundingRule)) { + throw new InvalidArgumentException('non-nullable annualRoundingRule cannot be null'); + } + $this->container['annualRoundingRule'] = $annualRoundingRule; + + return $this; + } + + /** + * Gets incrementRule + * + * @return \SynergiTech\Staffology\Model\IncrementRule|null + */ + public function getIncrementRule(): ?\SynergiTech\Staffology\Model\IncrementRule + { + return $this->container['incrementRule']; + } + + /** + * Sets incrementRule + * + * @param \SynergiTech\Staffology\Model\IncrementRule|null $incrementRule incrementRule + * + * @return $this + */ + public function setIncrementRule(?\SynergiTech\Staffology\Model\IncrementRule $incrementRule): static + { + if (is_null($incrementRule)) { + throw new InvalidArgumentException('non-nullable incrementRule cannot be null'); + } + $this->container['incrementRule'] = $incrementRule; + + return $this; + } + + /** + * Gets requiresLondonAllowance + * + * @return bool|null + */ + public function getRequiresLondonAllowance(): ?bool + { + return $this->container['requiresLondonAllowance']; + } + + /** + * Sets requiresLondonAllowance + * + * @param bool|null $requiresLondonAllowance Requires LA column to be completed on the spine + * + * @return $this + */ + public function setRequiresLondonAllowance(?bool $requiresLondonAllowance): static + { + if (is_null($requiresLondonAllowance)) { + throw new InvalidArgumentException('non-nullable requiresLondonAllowance cannot be null'); + } + $this->container['requiresLondonAllowance'] = $requiresLondonAllowance; + + return $this; + } + + /** + * Gets gradeEffectiveDate + * + * @return \DateTime|null + */ + public function getGradeEffectiveDate(): ?\DateTime + { + return $this->container['gradeEffectiveDate']; + } + + /** + * Sets gradeEffectiveDate + * + * @param \DateTime|null $gradeEffectiveDate Effective date for applicable grades + * + * @return $this + */ + public function setGradeEffectiveDate(?\DateTime $gradeEffectiveDate): static + { + if (is_null($gradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable gradeEffectiveDate cannot be null'); + } + $this->container['gradeEffectiveDate'] = $gradeEffectiveDate; + + return $this; + } + + /** + * Gets pointEffectiveDate + * + * @return \DateTime|null + */ + public function getPointEffectiveDate(): ?\DateTime + { + return $this->container['pointEffectiveDate']; + } + + /** + * Sets pointEffectiveDate + * + * @param \DateTime|null $pointEffectiveDate Effective date for applicable spinal points + * + * @return $this + */ + public function setPointEffectiveDate(?\DateTime $pointEffectiveDate): static + { + if (is_null($pointEffectiveDate)) { + throw new InvalidArgumentException('non-nullable pointEffectiveDate cannot be null'); + } + $this->container['pointEffectiveDate'] = $pointEffectiveDate; + + return $this; + } + + /** + * Gets useSpineHolidayRules + * + * @return bool|null + */ + public function getUseSpineHolidayRules(): ?bool + { + return $this->container['useSpineHolidayRules']; + } + + /** + * Sets useSpineHolidayRules + * + * @param bool|null $useSpineHolidayRules Flag to include holiday entitlements in Payspine (Default false) + * + * @return $this + */ + public function setUseSpineHolidayRules(?bool $useSpineHolidayRules): static + { + if (is_null($useSpineHolidayRules)) { + throw new InvalidArgumentException('non-nullable useSpineHolidayRules cannot be null'); + } + $this->container['useSpineHolidayRules'] = $useSpineHolidayRules; + + return $this; + } + + /** + * Gets holidayEntitlements + * + * @return \SynergiTech\Staffology\Model\ContractHolidayEntitlementUpdateRequest[]|null + */ + public function getHolidayEntitlements(): ?array + { + return $this->container['holidayEntitlements']; + } + + /** + * Sets holidayEntitlements + * + * @param \SynergiTech\Staffology\Model\ContractHolidayEntitlementUpdateRequest[]|null $holidayEntitlements PaySpine Holiday Entitlements + * + * @return $this + */ + public function setHolidayEntitlements(?array $holidayEntitlements): static + { + if (is_null($holidayEntitlements)) { + array_push($this->openAPINullablesSetToNull, 'holidayEntitlements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidayEntitlements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidayEntitlements'] = $holidayEntitlements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaylineAnalysisCategoriesCodes.php b/src/Model/ContractPaylineAnalysisCategoriesCodes.php new file mode 100644 index 0000000..14f4611 --- /dev/null +++ b/src/Model/ContractPaylineAnalysisCategoriesCodes.php @@ -0,0 +1,538 @@ + + */ +class ContractPaylineAnalysisCategoriesCodes implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaylineAnalysisCategoriesCodes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'analysisCategory' => 'string', + 'analysisCategoryCode' => 'string', + 'analysisCategoryId' => 'string', + 'analysisCategoryCodeId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'analysisCategory' => null, + 'analysisCategoryCode' => null, + 'analysisCategoryId' => 'uuid', + 'analysisCategoryCodeId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'analysisCategory' => true, + 'analysisCategoryCode' => true, + 'analysisCategoryId' => true, + 'analysisCategoryCodeId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'analysisCategory' => 'analysisCategory', + 'analysisCategoryCode' => 'analysisCategoryCode', + 'analysisCategoryId' => 'analysisCategoryId', + 'analysisCategoryCodeId' => 'analysisCategoryCodeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'analysisCategory' => 'setAnalysisCategory', + 'analysisCategoryCode' => 'setAnalysisCategoryCode', + 'analysisCategoryId' => 'setAnalysisCategoryId', + 'analysisCategoryCodeId' => 'setAnalysisCategoryCodeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'analysisCategory' => 'getAnalysisCategory', + 'analysisCategoryCode' => 'getAnalysisCategoryCode', + 'analysisCategoryId' => 'getAnalysisCategoryId', + 'analysisCategoryCodeId' => 'getAnalysisCategoryCodeId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('analysisCategory', $data ?? [], null); + $this->setIfExists('analysisCategoryCode', $data ?? [], null); + $this->setIfExists('analysisCategoryId', $data ?? [], null); + $this->setIfExists('analysisCategoryCodeId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets analysisCategory + * + * @return string|null + */ + public function getAnalysisCategory(): ?string + { + return $this->container['analysisCategory']; + } + + /** + * Sets analysisCategory + * + * @param string|null $analysisCategory AnalysisCategory Model + * + * @return $this + */ + public function setAnalysisCategory(?string $analysisCategory): static + { + if (is_null($analysisCategory)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategory'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategory', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategory'] = $analysisCategory; + + return $this; + } + + /** + * Gets analysisCategoryCode + * + * @return string|null + */ + public function getAnalysisCategoryCode(): ?string + { + return $this->container['analysisCategoryCode']; + } + + /** + * Sets analysisCategoryCode + * + * @param string|null $analysisCategoryCode AnalysisCategoryCode Model + * + * @return $this + */ + public function setAnalysisCategoryCode(?string $analysisCategoryCode): static + { + if (is_null($analysisCategoryCode)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCode'] = $analysisCategoryCode; + + return $this; + } + + /** + * Gets analysisCategoryId + * + * @return string|null + */ + public function getAnalysisCategoryId(): ?string + { + return $this->container['analysisCategoryId']; + } + + /** + * Sets analysisCategoryId + * + * @param string|null $analysisCategoryId AnalysisCategory Identifier + * + * @return $this + */ + public function setAnalysisCategoryId(?string $analysisCategoryId): static + { + if (is_null($analysisCategoryId)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryId'] = $analysisCategoryId; + + return $this; + } + + /** + * Gets analysisCategoryCodeId + * + * @return string|null + */ + public function getAnalysisCategoryCodeId(): ?string + { + return $this->container['analysisCategoryCodeId']; + } + + /** + * Sets analysisCategoryCodeId + * + * @param string|null $analysisCategoryCodeId AnalysisCategoryCode Identifier + * + * @return $this + */ + public function setAnalysisCategoryCodeId(?string $analysisCategoryCodeId): static + { + if (is_null($analysisCategoryCodeId)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeId'] = $analysisCategoryCodeId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPaylineRequest0.php b/src/Model/ContractPaylineRequest0.php new file mode 100644 index 0000000..c3bf937 --- /dev/null +++ b/src/Model/ContractPaylineRequest0.php @@ -0,0 +1,1985 @@ + + */ +class ContractPaylineRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PaylineRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'analysisCategoryCodeIds' => 'string[]', + 'analysisCategoriesCodes' => '\SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]', + 'annualValue' => 'float', + 'autoAdjustForLeave' => 'bool', + 'calculateAsWhenPaid' => 'bool', + 'childId' => 'string', + 'code' => 'string', + 'contributesToBasicPay' => 'bool', + 'costCentre' => 'string', + 'costCentreId' => 'string', + 'department' => 'string', + 'departmentId' => 'string', + 'description' => 'string', + 'earnedFrom' => '\DateTime', + 'earnedTo' => '\DateTime', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'employeeRoleReference' => 'string', + 'fullTimeAnnualValue' => 'float', + 'ignoreInitialBackPay' => 'bool', + 'isAutoGeneratedBasicPayLine' => 'bool', + 'isAutomaticBackPay' => 'bool', + 'isNetToGross' => 'bool', + 'isZeroHoursTeachersBackPayLine' => 'bool', + 'londonAllowanceId' => 'int', + 'multiplier' => 'float', + 'netToGrossDiscrepancy' => 'float', + 'payGrade' => 'string', + 'paySpine' => 'string', + 'paySpineGradeId' => 'string', + 'paySpineId' => 'string', + 'percentageOfEffectiveDays' => 'float', + 'rate' => 'float', + 'roleId' => 'string', + 'spinePoint' => 'string', + 'spinalPointId' => 'string', + 'tags' => 'string[]', + 'targetNetToGrossValue' => 'float', + 'totalPaidDays' => 'float', + 'totalWorkingDays' => 'float', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'analysisCategoryCodeIds' => 'uuid', + 'analysisCategoriesCodes' => null, + 'annualValue' => 'double', + 'autoAdjustForLeave' => null, + 'calculateAsWhenPaid' => null, + 'childId' => 'uuid', + 'code' => null, + 'contributesToBasicPay' => null, + 'costCentre' => null, + 'costCentreId' => 'uuid', + 'department' => null, + 'departmentId' => 'uuid', + 'description' => null, + 'earnedFrom' => 'date', + 'earnedTo' => 'date', + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'employeeRoleReference' => null, + 'fullTimeAnnualValue' => 'double', + 'ignoreInitialBackPay' => null, + 'isAutoGeneratedBasicPayLine' => null, + 'isAutomaticBackPay' => null, + 'isNetToGross' => null, + 'isZeroHoursTeachersBackPayLine' => null, + 'londonAllowanceId' => 'int32', + 'multiplier' => 'double', + 'netToGrossDiscrepancy' => 'double', + 'payGrade' => null, + 'paySpine' => null, + 'paySpineGradeId' => 'uuid', + 'paySpineId' => 'uuid', + 'percentageOfEffectiveDays' => 'double', + 'rate' => 'double', + 'roleId' => 'uuid', + 'spinePoint' => null, + 'spinalPointId' => 'uuid', + 'tags' => null, + 'targetNetToGrossValue' => 'double', + 'totalPaidDays' => 'double', + 'totalWorkingDays' => 'double', + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'analysisCategoryCodeIds' => true, + 'analysisCategoriesCodes' => true, + 'annualValue' => true, + 'autoAdjustForLeave' => false, + 'calculateAsWhenPaid' => false, + 'childId' => true, + 'code' => true, + 'contributesToBasicPay' => false, + 'costCentre' => true, + 'costCentreId' => true, + 'department' => true, + 'departmentId' => true, + 'description' => true, + 'earnedFrom' => true, + 'earnedTo' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'employeeRoleReference' => true, + 'fullTimeAnnualValue' => false, + 'ignoreInitialBackPay' => false, + 'isAutoGeneratedBasicPayLine' => false, + 'isAutomaticBackPay' => false, + 'isNetToGross' => false, + 'isZeroHoursTeachersBackPayLine' => false, + 'londonAllowanceId' => true, + 'multiplier' => true, + 'netToGrossDiscrepancy' => true, + 'payGrade' => true, + 'paySpine' => true, + 'paySpineGradeId' => true, + 'paySpineId' => true, + 'percentageOfEffectiveDays' => true, + 'rate' => true, + 'roleId' => true, + 'spinePoint' => true, + 'spinalPointId' => true, + 'tags' => true, + 'targetNetToGrossValue' => true, + 'totalPaidDays' => true, + 'totalWorkingDays' => true, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'analysisCategoryCodeIds' => 'analysisCategoryCodeIds', + 'analysisCategoriesCodes' => 'analysisCategoriesCodes', + 'annualValue' => 'annualValue', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'calculateAsWhenPaid' => 'calculateAsWhenPaid', + 'childId' => 'childId', + 'code' => 'code', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'costCentre' => 'costCentre', + 'costCentreId' => 'costCentreId', + 'department' => 'department', + 'departmentId' => 'departmentId', + 'description' => 'description', + 'earnedFrom' => 'earnedFrom', + 'earnedTo' => 'earnedTo', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'employeeRoleReference' => 'employeeRoleReference', + 'fullTimeAnnualValue' => 'fullTimeAnnualValue', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'isAutoGeneratedBasicPayLine' => 'isAutoGeneratedBasicPayLine', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'isNetToGross' => 'isNetToGross', + 'isZeroHoursTeachersBackPayLine' => 'isZeroHoursTeachersBackPayLine', + 'londonAllowanceId' => 'londonAllowanceId', + 'multiplier' => 'multiplier', + 'netToGrossDiscrepancy' => 'netToGrossDiscrepancy', + 'payGrade' => 'payGrade', + 'paySpine' => 'paySpine', + 'paySpineGradeId' => 'paySpineGradeId', + 'paySpineId' => 'paySpineId', + 'percentageOfEffectiveDays' => 'percentageOfEffectiveDays', + 'rate' => 'rate', + 'roleId' => 'roleId', + 'spinePoint' => 'spinePoint', + 'spinalPointId' => 'spinalPointId', + 'tags' => 'tags', + 'targetNetToGrossValue' => 'targetNetToGrossValue', + 'totalPaidDays' => 'totalPaidDays', + 'totalWorkingDays' => 'totalWorkingDays', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'analysisCategoryCodeIds' => 'setAnalysisCategoryCodeIds', + 'analysisCategoriesCodes' => 'setAnalysisCategoriesCodes', + 'annualValue' => 'setAnnualValue', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'calculateAsWhenPaid' => 'setCalculateAsWhenPaid', + 'childId' => 'setChildId', + 'code' => 'setCode', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'costCentre' => 'setCostCentre', + 'costCentreId' => 'setCostCentreId', + 'department' => 'setDepartment', + 'departmentId' => 'setDepartmentId', + 'description' => 'setDescription', + 'earnedFrom' => 'setEarnedFrom', + 'earnedTo' => 'setEarnedTo', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'employeeRoleReference' => 'setEmployeeRoleReference', + 'fullTimeAnnualValue' => 'setFullTimeAnnualValue', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'isAutoGeneratedBasicPayLine' => 'setIsAutoGeneratedBasicPayLine', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'isNetToGross' => 'setIsNetToGross', + 'isZeroHoursTeachersBackPayLine' => 'setIsZeroHoursTeachersBackPayLine', + 'londonAllowanceId' => 'setLondonAllowanceId', + 'multiplier' => 'setMultiplier', + 'netToGrossDiscrepancy' => 'setNetToGrossDiscrepancy', + 'payGrade' => 'setPayGrade', + 'paySpine' => 'setPaySpine', + 'paySpineGradeId' => 'setPaySpineGradeId', + 'paySpineId' => 'setPaySpineId', + 'percentageOfEffectiveDays' => 'setPercentageOfEffectiveDays', + 'rate' => 'setRate', + 'roleId' => 'setRoleId', + 'spinePoint' => 'setSpinePoint', + 'spinalPointId' => 'setSpinalPointId', + 'tags' => 'setTags', + 'targetNetToGrossValue' => 'setTargetNetToGrossValue', + 'totalPaidDays' => 'setTotalPaidDays', + 'totalWorkingDays' => 'setTotalWorkingDays', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'analysisCategoryCodeIds' => 'getAnalysisCategoryCodeIds', + 'analysisCategoriesCodes' => 'getAnalysisCategoriesCodes', + 'annualValue' => 'getAnnualValue', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'calculateAsWhenPaid' => 'getCalculateAsWhenPaid', + 'childId' => 'getChildId', + 'code' => 'getCode', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'costCentre' => 'getCostCentre', + 'costCentreId' => 'getCostCentreId', + 'department' => 'getDepartment', + 'departmentId' => 'getDepartmentId', + 'description' => 'getDescription', + 'earnedFrom' => 'getEarnedFrom', + 'earnedTo' => 'getEarnedTo', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'employeeRoleReference' => 'getEmployeeRoleReference', + 'fullTimeAnnualValue' => 'getFullTimeAnnualValue', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'isAutoGeneratedBasicPayLine' => 'getIsAutoGeneratedBasicPayLine', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'isNetToGross' => 'getIsNetToGross', + 'isZeroHoursTeachersBackPayLine' => 'getIsZeroHoursTeachersBackPayLine', + 'londonAllowanceId' => 'getLondonAllowanceId', + 'multiplier' => 'getMultiplier', + 'netToGrossDiscrepancy' => 'getNetToGrossDiscrepancy', + 'payGrade' => 'getPayGrade', + 'paySpine' => 'getPaySpine', + 'paySpineGradeId' => 'getPaySpineGradeId', + 'paySpineId' => 'getPaySpineId', + 'percentageOfEffectiveDays' => 'getPercentageOfEffectiveDays', + 'rate' => 'getRate', + 'roleId' => 'getRoleId', + 'spinePoint' => 'getSpinePoint', + 'spinalPointId' => 'getSpinalPointId', + 'tags' => 'getTags', + 'targetNetToGrossValue' => 'getTargetNetToGrossValue', + 'totalPaidDays' => 'getTotalPaidDays', + 'totalWorkingDays' => 'getTotalWorkingDays', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('analysisCategoryCodeIds', $data ?? [], null); + $this->setIfExists('analysisCategoriesCodes', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('calculateAsWhenPaid', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('costCentreId', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('departmentId', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('earnedFrom', $data ?? [], null); + $this->setIfExists('earnedTo', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('employeeRoleReference', $data ?? [], null); + $this->setIfExists('fullTimeAnnualValue', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('isAutoGeneratedBasicPayLine', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('isZeroHoursTeachersBackPayLine', $data ?? [], null); + $this->setIfExists('londonAllowanceId', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + $this->setIfExists('netToGrossDiscrepancy', $data ?? [], null); + $this->setIfExists('payGrade', $data ?? [], null); + $this->setIfExists('paySpine', $data ?? [], null); + $this->setIfExists('paySpineGradeId', $data ?? [], null); + $this->setIfExists('paySpineId', $data ?? [], null); + $this->setIfExists('percentageOfEffectiveDays', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('spinePoint', $data ?? [], null); + $this->setIfExists('spinalPointId', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('targetNetToGrossValue', $data ?? [], null); + $this->setIfExists('totalPaidDays', $data ?? [], null); + $this->setIfExists('totalWorkingDays', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets analysisCategoryCodeIds + * + * @return string[]|null + */ + public function getAnalysisCategoryCodeIds(): ?array + { + return $this->container['analysisCategoryCodeIds']; + } + + /** + * Sets analysisCategoryCodeIds + * + * @param string[]|null $analysisCategoryCodeIds List of analysis category code unique ids. + * + * @return $this + */ + public function setAnalysisCategoryCodeIds(?array $analysisCategoryCodeIds): static + { + if (is_null($analysisCategoryCodeIds)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeIds'] = $analysisCategoryCodeIds; + + return $this; + } + + /** + * Gets analysisCategoriesCodes + * + * @return \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null + */ + public function getAnalysisCategoriesCodes(): ?array + { + return $this->container['analysisCategoriesCodes']; + } + + /** + * Sets analysisCategoriesCodes + * + * @param \SynergiTech\Staffology\Model\ContractPaylineAnalysisCategoriesCodes[]|null $analysisCategoriesCodes List of analysis category ids and analysis category code ids. + * + * @return $this + */ + public function setAnalysisCategoriesCodes(?array $analysisCategoriesCodes): static + { + if (is_null($analysisCategoriesCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoriesCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoriesCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoriesCodes'] = $analysisCategoriesCodes; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue The original value from the PayLine before we modify it. Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the payline value needs calculating or not. To recalculate set to null with annual amount recorded in Value. + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + array_push($this->openAPINullablesSetToNull, 'annualValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling midway through a PayRun. + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets calculateAsWhenPaid + * + * @return bool|null + */ + public function getCalculateAsWhenPaid(): ?bool + { + return $this->container['calculateAsWhenPaid']; + } + + /** + * Sets calculateAsWhenPaid + * + * @param bool|null $calculateAsWhenPaid Indicates whether this pay line should be treated as When Paid rather than When Earned. + * + * @return $this + */ + public function setCalculateAsWhenPaid(?bool $calculateAsWhenPaid): static + { + if (is_null($calculateAsWhenPaid)) { + throw new InvalidArgumentException('non-nullable calculateAsWhenPaid cannot be null'); + } + $this->container['calculateAsWhenPaid'] = $calculateAsWhenPaid; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId The child id. + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + array_push($this->openAPINullablesSetToNull, 'childId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('childId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['childId'] = $childId; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay Indicates whether this PayLine contributes to the basic pay of the Employee. + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre CostCentre code which we want to override in the payline. + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets costCentreId + * + * @return string|null + */ + public function getCostCentreId(): ?string + { + return $this->container['costCentreId']; + } + + /** + * Sets costCentreId + * + * @param string|null $costCentreId CostCentre uniqueId which we want to override in the payline. + * + * @return $this + */ + public function setCostCentreId(?string $costCentreId): static + { + if (is_null($costCentreId)) { + array_push($this->openAPINullablesSetToNull, 'costCentreId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentreId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentreId'] = $costCentreId; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department Department code which we want to override in the payline. + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets departmentId + * + * @return string|null + */ + public function getDepartmentId(): ?string + { + return $this->container['departmentId']; + } + + /** + * Sets departmentId + * + * @param string|null $departmentId Department uniqueId which we want to override in the payline. + * + * @return $this + */ + public function setDepartmentId(?string $departmentId): static + { + if (is_null($departmentId)) { + array_push($this->openAPINullablesSetToNull, 'departmentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentId'] = $departmentId; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description to accompany this line. It will be displayed on the payslip. + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets earnedFrom + * + * @return \DateTime|null + */ + public function getEarnedFrom(): ?\DateTime + { + return $this->container['earnedFrom']; + } + + /** + * Sets earnedFrom + * + * @param \DateTime|null $earnedFrom The earned from date. + * + * @return $this + */ + public function setEarnedFrom(?\DateTime $earnedFrom): static + { + if (is_null($earnedFrom)) { + array_push($this->openAPINullablesSetToNull, 'earnedFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedFrom'] = $earnedFrom; + + return $this; + } + + /** + * Gets earnedTo + * + * @return \DateTime|null + */ + public function getEarnedTo(): ?\DateTime + { + return $this->container['earnedTo']; + } + + /** + * Sets earnedTo + * + * @param \DateTime|null $earnedTo The earned to date. + * + * @return $this + */ + public function setEarnedTo(?\DateTime $earnedTo): static + { + if (is_null($earnedTo)) { + array_push($this->openAPINullablesSetToNull, 'earnedTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedTo'] = $earnedTo; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date the payline starts being calculated in the payrun. + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo The date the payline stops being calculated in the payrun. + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets employeeRoleReference + * + * @return string|null + */ + public function getEmployeeRoleReference(): ?string + { + return $this->container['employeeRoleReference']; + } + + /** + * Sets employeeRoleReference + * + * @param string|null $employeeRoleReference The employee role reference. + * + * @return $this + */ + public function setEmployeeRoleReference(?string $employeeRoleReference): static + { + if (is_null($employeeRoleReference)) { + array_push($this->openAPINullablesSetToNull, 'employeeRoleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeRoleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeRoleReference'] = $employeeRoleReference; + + return $this; + } + + /** + * Gets fullTimeAnnualValue + * + * @return float|null + */ + public function getFullTimeAnnualValue(): ?float + { + return $this->container['fullTimeAnnualValue']; + } + + /** + * Sets fullTimeAnnualValue + * + * @param float|null $fullTimeAnnualValue Used to set the Full Time Annual Value for the payline. + * + * @return $this + */ + public function setFullTimeAnnualValue(?float $fullTimeAnnualValue): static + { + if (is_null($fullTimeAnnualValue)) { + throw new InvalidArgumentException('non-nullable fullTimeAnnualValue cannot be null'); + } + $this->container['fullTimeAnnualValue'] = $fullTimeAnnualValue; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside of Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets isAutoGeneratedBasicPayLine + * + * @return bool|null + */ + public function getIsAutoGeneratedBasicPayLine(): ?bool + { + return $this->container['isAutoGeneratedBasicPayLine']; + } + + /** + * Sets isAutoGeneratedBasicPayLine + * + * @param bool|null $isAutoGeneratedBasicPayLine If the PayLine is an auto-generated basic payline. + * + * @return $this + */ + public function setIsAutoGeneratedBasicPayLine(?bool $isAutoGeneratedBasicPayLine): static + { + if (is_null($isAutoGeneratedBasicPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoGeneratedBasicPayLine cannot be null'); + } + $this->container['isAutoGeneratedBasicPayLine'] = $isAutoGeneratedBasicPayLine; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay Automatically calculate backpay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of backpay lines. + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets isZeroHoursTeachersBackPayLine + * + * @return bool|null + */ + public function getIsZeroHoursTeachersBackPayLine(): ?bool + { + return $this->container['isZeroHoursTeachersBackPayLine']; + } + + /** + * Sets isZeroHoursTeachersBackPayLine + * + * @param bool|null $isZeroHoursTeachersBackPayLine If the PayLine is a zero-hours teachers back-pay line. + * + * @return $this + */ + public function setIsZeroHoursTeachersBackPayLine(?bool $isZeroHoursTeachersBackPayLine): static + { + if (is_null($isZeroHoursTeachersBackPayLine)) { + throw new InvalidArgumentException('non-nullable isZeroHoursTeachersBackPayLine cannot be null'); + } + $this->container['isZeroHoursTeachersBackPayLine'] = $isZeroHoursTeachersBackPayLine; + + return $this; + } + + /** + * Gets londonAllowanceId + * + * @return int|null + */ + public function getLondonAllowanceId(): ?int + { + return $this->container['londonAllowanceId']; + } + + /** + * Sets londonAllowanceId + * + * @param int|null $londonAllowanceId Used to set London allowance id for payline. + * + * @return $this + */ + public function setLondonAllowanceId(?int $londonAllowanceId): static + { + if (is_null($londonAllowanceId)) { + array_push($this->openAPINullablesSetToNull, 'londonAllowanceId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('londonAllowanceId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['londonAllowanceId'] = $londonAllowanceId; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours. + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets netToGrossDiscrepancy + * + * @return float|null + */ + public function getNetToGrossDiscrepancy(): ?float + { + return $this->container['netToGrossDiscrepancy']; + } + + /** + * Sets netToGrossDiscrepancy + * + * @param float|null $netToGrossDiscrepancy The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation. + * + * @return $this + */ + public function setNetToGrossDiscrepancy(?float $netToGrossDiscrepancy): static + { + if (is_null($netToGrossDiscrepancy)) { + array_push($this->openAPINullablesSetToNull, 'netToGrossDiscrepancy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netToGrossDiscrepancy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netToGrossDiscrepancy'] = $netToGrossDiscrepancy; + + return $this; + } + + /** + * Gets payGrade + * + * @return string|null + */ + public function getPayGrade(): ?string + { + return $this->container['payGrade']; + } + + /** + * Sets payGrade + * + * @param string|null $payGrade PayGrade for imported pay lines + * + * @return $this + */ + public function setPayGrade(?string $payGrade): static + { + if (is_null($payGrade)) { + array_push($this->openAPINullablesSetToNull, 'payGrade'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payGrade', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payGrade'] = $payGrade; + + return $this; + } + + /** + * Gets paySpine + * + * @return string|null + */ + public function getPaySpine(): ?string + { + return $this->container['paySpine']; + } + + /** + * Sets paySpine + * + * @param string|null $paySpine PaySpine for imported pay lines + * + * @return $this + */ + public function setPaySpine(?string $paySpine): static + { + if (is_null($paySpine)) { + array_push($this->openAPINullablesSetToNull, 'paySpine'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpine', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpine'] = $paySpine; + + return $this; + } + + /** + * Gets paySpineGradeId + * + * @return string|null + */ + public function getPaySpineGradeId(): ?string + { + return $this->container['paySpineGradeId']; + } + + /** + * Sets paySpineGradeId + * + * @param string|null $paySpineGradeId The Id of the associated pay spine grade. + * + * @return $this + */ + public function setPaySpineGradeId(?string $paySpineGradeId): static + { + if (is_null($paySpineGradeId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineGradeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineGradeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineGradeId'] = $paySpineGradeId; + + return $this; + } + + /** + * Gets paySpineId + * + * @return string|null + */ + public function getPaySpineId(): ?string + { + return $this->container['paySpineId']; + } + + /** + * Sets paySpineId + * + * @param string|null $paySpineId The Id of the associated pay spine. + * + * @return $this + */ + public function setPaySpineId(?string $paySpineId): static + { + if (is_null($paySpineId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineId'] = $paySpineId; + + return $this; + } + + /** + * Gets percentageOfEffectiveDays + * + * @return float|null + */ + public function getPercentageOfEffectiveDays(): ?float + { + return $this->container['percentageOfEffectiveDays']; + } + + /** + * Sets percentageOfEffectiveDays + * + * @param float|null $percentageOfEffectiveDays The percentage of working days the effective dates span for pro-rata values, calculated and set during each payrun. + * + * @return $this + */ + public function setPercentageOfEffectiveDays(?float $percentageOfEffectiveDays): static + { + if (is_null($percentageOfEffectiveDays)) { + array_push($this->openAPINullablesSetToNull, 'percentageOfEffectiveDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('percentageOfEffectiveDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['percentageOfEffectiveDays'] = $percentageOfEffectiveDays; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used. + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + array_push($this->openAPINullablesSetToNull, 'rate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets spinePoint + * + * @return string|null + */ + public function getSpinePoint(): ?string + { + return $this->container['spinePoint']; + } + + /** + * Sets spinePoint + * + * @param string|null $spinePoint SpinePoint for imported pay lines + * + * @return $this + */ + public function setSpinePoint(?string $spinePoint): static + { + if (is_null($spinePoint)) { + array_push($this->openAPINullablesSetToNull, 'spinePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinePoint'] = $spinePoint; + + return $this; + } + + /** + * Gets spinalPointId + * + * @return string|null + */ + public function getSpinalPointId(): ?string + { + return $this->container['spinalPointId']; + } + + /** + * Sets spinalPointId + * + * @param string|null $spinalPointId The Id of the associated spinal point. + * + * @return $this + */ + public function setSpinalPointId(?string $spinalPointId): static + { + if (is_null($spinalPointId)) { + array_push($this->openAPINullablesSetToNull, 'spinalPointId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinalPointId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinalPointId'] = $spinalPointId; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags Tags related to this line. + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets targetNetToGrossValue + * + * @return float|null + */ + public function getTargetNetToGrossValue(): ?float + { + return $this->container['targetNetToGrossValue']; + } + + /** + * Sets targetNetToGrossValue + * + * @param float|null $targetNetToGrossValue The orginal net fixed addition amount that is considered to be a take home pay target. + * + * @return $this + */ + public function setTargetNetToGrossValue(?float $targetNetToGrossValue): static + { + if (is_null($targetNetToGrossValue)) { + array_push($this->openAPINullablesSetToNull, 'targetNetToGrossValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('targetNetToGrossValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['targetNetToGrossValue'] = $targetNetToGrossValue; + + return $this; + } + + /** + * Gets totalPaidDays + * + * @return float|null + */ + public function getTotalPaidDays(): ?float + { + return $this->container['totalPaidDays']; + } + + /** + * Sets totalPaidDays + * + * @param float|null $totalPaidDays The total paid days. + * + * @return $this + */ + public function setTotalPaidDays(?float $totalPaidDays): static + { + if (is_null($totalPaidDays)) { + array_push($this->openAPINullablesSetToNull, 'totalPaidDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaidDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaidDays'] = $totalPaidDays; + + return $this; + } + + /** + * Gets totalWorkingDays + * + * @return float|null + */ + public function getTotalWorkingDays(): ?float + { + return $this->container['totalWorkingDays']; + } + + /** + * Sets totalWorkingDays + * + * @param float|null $totalWorkingDays The total working days. + * + * @return $this + */ + public function setTotalWorkingDays(?float $totalWorkingDays): static + { + if (is_null($totalWorkingDays)) { + array_push($this->openAPINullablesSetToNull, 'totalWorkingDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalWorkingDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalWorkingDays'] = $totalWorkingDays; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadEmployerRequest.php b/src/Model/ContractPayrollSquadEmployerRequest.php new file mode 100644 index 0000000..225fe1e --- /dev/null +++ b/src/Model/ContractPayrollSquadEmployerRequest.php @@ -0,0 +1,449 @@ + + */ +class ContractPayrollSquadEmployerRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadEmployerRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollSquadId' => 'string', + 'employerIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollSquadId' => 'uuid', + 'employerIds' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollSquadId' => false, + 'employerIds' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollSquadId' => 'payrollSquadId', + 'employerIds' => 'employerIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollSquadId' => 'setPayrollSquadId', + 'employerIds' => 'setEmployerIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollSquadId' => 'getPayrollSquadId', + 'employerIds' => 'getEmployerIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollSquadId', $data ?? [], null); + $this->setIfExists('employerIds', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollSquadId + * + * @return string|null + */ + public function getPayrollSquadId(): ?string + { + return $this->container['payrollSquadId']; + } + + /** + * Sets payrollSquadId + * + * @param string|null $payrollSquadId UniqueId of Payroll Squad + * + * @return $this + */ + public function setPayrollSquadId(?string $payrollSquadId): static + { + if (is_null($payrollSquadId)) { + throw new InvalidArgumentException('non-nullable payrollSquadId cannot be null'); + } + $this->container['payrollSquadId'] = $payrollSquadId; + + return $this; + } + + /** + * Gets employerIds + * + * @return string[]|null + */ + public function getEmployerIds(): ?array + { + return $this->container['employerIds']; + } + + /** + * Sets employerIds + * + * @param string[]|null $employerIds UniqueIds of Employers + * + * @return $this + */ + public function setEmployerIds(?array $employerIds): static + { + if (is_null($employerIds)) { + array_push($this->openAPINullablesSetToNull, 'employerIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerIds'] = $employerIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadEmployerResponse.php b/src/Model/ContractPayrollSquadEmployerResponse.php new file mode 100644 index 0000000..3778e0d --- /dev/null +++ b/src/Model/ContractPayrollSquadEmployerResponse.php @@ -0,0 +1,442 @@ + + */ +class ContractPayrollSquadEmployerResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadEmployerResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'employerId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'employerId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employerId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employerId' => 'employerId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employerId' => 'setEmployerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employerId' => 'getEmployerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employerId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Payroll Squad Employer Id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employerId + * + * @return string|null + */ + public function getEmployerId(): ?string + { + return $this->container['employerId']; + } + + /** + * Sets employerId + * + * @param string|null $employerId Employer Id + * + * @return $this + */ + public function setEmployerId(?string $employerId): static + { + if (is_null($employerId)) { + throw new InvalidArgumentException('non-nullable employerId cannot be null'); + } + $this->container['employerId'] = $employerId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadMemberRequest.php b/src/Model/ContractPayrollSquadMemberRequest.php new file mode 100644 index 0000000..cbc527b --- /dev/null +++ b/src/Model/ContractPayrollSquadMemberRequest.php @@ -0,0 +1,476 @@ + + */ +class ContractPayrollSquadMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadMemberRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'userId' => 'string', + 'payrollSquadId' => 'string', + 'role' => '\SynergiTech\Staffology\Model\UserRole' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'userId' => 'uuid', + 'payrollSquadId' => 'uuid', + 'role' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'userId' => false, + 'payrollSquadId' => false, + 'role' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'userId' => 'userId', + 'payrollSquadId' => 'payrollSquadId', + 'role' => 'role' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'userId' => 'setUserId', + 'payrollSquadId' => 'setPayrollSquadId', + 'role' => 'setRole' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'userId' => 'getUserId', + 'payrollSquadId' => 'getPayrollSquadId', + 'role' => 'getRole' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('userId', $data ?? [], null); + $this->setIfExists('payrollSquadId', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets userId + * + * @return string|null + */ + public function getUserId(): ?string + { + return $this->container['userId']; + } + + /** + * Sets userId + * + * @param string|null $userId Payroll Squad Selected UserId + * + * @return $this + */ + public function setUserId(?string $userId): static + { + if (is_null($userId)) { + throw new InvalidArgumentException('non-nullable userId cannot be null'); + } + $this->container['userId'] = $userId; + + return $this; + } + + /** + * Gets payrollSquadId + * + * @return string|null + */ + public function getPayrollSquadId(): ?string + { + return $this->container['payrollSquadId']; + } + + /** + * Sets payrollSquadId + * + * @param string|null $payrollSquadId UniqueId of Payroll Squad + * + * @return $this + */ + public function setPayrollSquadId(?string $payrollSquadId): static + { + if (is_null($payrollSquadId)) { + throw new InvalidArgumentException('non-nullable payrollSquadId cannot be null'); + } + $this->container['payrollSquadId'] = $payrollSquadId; + + return $this; + } + + /** + * Gets role + * + * @return \SynergiTech\Staffology\Model\UserRole|null + */ + public function getRole(): ?\SynergiTech\Staffology\Model\UserRole + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param \SynergiTech\Staffology\Model\UserRole|null $role role + * + * @return $this + */ + public function setRole(?\SynergiTech\Staffology\Model\UserRole $role): static + { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadMemberResponse.php b/src/Model/ContractPayrollSquadMemberResponse.php new file mode 100644 index 0000000..f1e7877 --- /dev/null +++ b/src/Model/ContractPayrollSquadMemberResponse.php @@ -0,0 +1,599 @@ + + */ +class ContractPayrollSquadMemberResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadMemberResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'userId' => 'string', + 'displayName' => 'string', + 'emailAddress' => 'string', + 'lastLogin' => '\DateTime', + 'role' => '\SynergiTech\Staffology\Model\UserRole' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'userId' => 'uuid', + 'displayName' => null, + 'emailAddress' => null, + 'lastLogin' => 'date', + 'role' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'userId' => false, + 'displayName' => true, + 'emailAddress' => true, + 'lastLogin' => true, + 'role' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'userId' => 'userId', + 'displayName' => 'displayName', + 'emailAddress' => 'emailAddress', + 'lastLogin' => 'lastLogin', + 'role' => 'role' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'userId' => 'setUserId', + 'displayName' => 'setDisplayName', + 'emailAddress' => 'setEmailAddress', + 'lastLogin' => 'setLastLogin', + 'role' => 'setRole' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'userId' => 'getUserId', + 'displayName' => 'getDisplayName', + 'emailAddress' => 'getEmailAddress', + 'lastLogin' => 'getLastLogin', + 'role' => 'getRole' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('userId', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('emailAddress', $data ?? [], null); + $this->setIfExists('lastLogin', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Payroll Squad Member Identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets userId + * + * @return string|null + */ + public function getUserId(): ?string + { + return $this->container['userId']; + } + + /** + * Sets userId + * + * @param string|null $userId Payroll Squad User Identifier + * + * @return $this + */ + public function setUserId(?string $userId): static + { + if (is_null($userId)) { + throw new InvalidArgumentException('non-nullable userId cannot be null'); + } + $this->container['userId'] = $userId; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName Payroll Squad Member DisplayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets emailAddress + * + * @return string|null + */ + public function getEmailAddress(): ?string + { + return $this->container['emailAddress']; + } + + /** + * Sets emailAddress + * + * @param string|null $emailAddress Payroll Squad Member EmailAddress + * + * @return $this + */ + public function setEmailAddress(?string $emailAddress): static + { + if (is_null($emailAddress)) { + array_push($this->openAPINullablesSetToNull, 'emailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailAddress'] = $emailAddress; + + return $this; + } + + /** + * Gets lastLogin + * + * @return \DateTime|null + */ + public function getLastLogin(): ?\DateTime + { + return $this->container['lastLogin']; + } + + /** + * Sets lastLogin + * + * @param \DateTime|null $lastLogin Payroll Squad Member LastLogin + * + * @return $this + */ + public function setLastLogin(?\DateTime $lastLogin): static + { + if (is_null($lastLogin)) { + array_push($this->openAPINullablesSetToNull, 'lastLogin'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastLogin', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastLogin'] = $lastLogin; + + return $this; + } + + /** + * Gets role + * + * @return \SynergiTech\Staffology\Model\UserRole|null + */ + public function getRole(): ?\SynergiTech\Staffology\Model\UserRole + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param \SynergiTech\Staffology\Model\UserRole|null $role role + * + * @return $this + */ + public function setRole(?\SynergiTech\Staffology\Model\UserRole $role): static + { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadRequest.php b/src/Model/ContractPayrollSquadRequest.php new file mode 100644 index 0000000..2bf26e3 --- /dev/null +++ b/src/Model/ContractPayrollSquadRequest.php @@ -0,0 +1,456 @@ + + */ +class ContractPayrollSquadRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'employerIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'employerIds' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'employerIds' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'employerIds' => 'employerIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'employerIds' => 'setEmployerIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'employerIds' => 'getEmployerIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('employerIds', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of Payroll Squad + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets employerIds + * + * @return string[]|null + */ + public function getEmployerIds(): ?array + { + return $this->container['employerIds']; + } + + /** + * Sets employerIds + * + * @param string[]|null $employerIds Employer ids of Payroll Squad + * + * @return $this + */ + public function setEmployerIds(?array $employerIds): static + { + if (is_null($employerIds)) { + array_push($this->openAPINullablesSetToNull, 'employerIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerIds'] = $employerIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPayrollSquadResponse.php b/src/Model/ContractPayrollSquadResponse.php new file mode 100644 index 0000000..a6abe45 --- /dev/null +++ b/src/Model/ContractPayrollSquadResponse.php @@ -0,0 +1,565 @@ + + */ +class ContractPayrollSquadResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PayrollSquadResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'tenantId' => 'string', + 'members' => '\SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse[]', + 'employers' => '\SynergiTech\Staffology\Model\ContractEmployerBase[]', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'tenantId' => 'uuid', + 'members' => null, + 'employers' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'tenantId' => false, + 'members' => true, + 'employers' => true, + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'tenantId' => 'tenantId', + 'members' => 'members', + 'employers' => 'employers', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'tenantId' => 'setTenantId', + 'members' => 'setMembers', + 'employers' => 'setEmployers', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'tenantId' => 'getTenantId', + 'members' => 'getMembers', + 'employers' => 'getEmployers', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('tenantId', $data ?? [], null); + $this->setIfExists('members', $data ?? [], null); + $this->setIfExists('employers', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Payroll Squad Identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets tenantId + * + * @return string|null + */ + public function getTenantId(): ?string + { + return $this->container['tenantId']; + } + + /** + * Sets tenantId + * + * @param string|null $tenantId Current Tenant Id + * + * @return $this + */ + public function setTenantId(?string $tenantId): static + { + if (is_null($tenantId)) { + throw new InvalidArgumentException('non-nullable tenantId cannot be null'); + } + $this->container['tenantId'] = $tenantId; + + return $this; + } + + /** + * Gets members + * + * @return \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse[]|null + */ + public function getMembers(): ?array + { + return $this->container['members']; + } + + /** + * Sets members + * + * @param \SynergiTech\Staffology\Model\ContractPayrollSquadMemberResponse[]|null $members List of all Members + * + * @return $this + */ + public function setMembers(?array $members): static + { + if (is_null($members)) { + array_push($this->openAPINullablesSetToNull, 'members'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('members', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['members'] = $members; + + return $this; + } + + /** + * Gets employers + * + * @return \SynergiTech\Staffology\Model\ContractEmployerBase[]|null + */ + public function getEmployers(): ?array + { + return $this->container['employers']; + } + + /** + * Sets employers + * + * @param \SynergiTech\Staffology\Model\ContractEmployerBase[]|null $employers List of all Employers + * + * @return $this + */ + public function setEmployers(?array $employers): static + { + if (is_null($employers)) { + array_push($this->openAPINullablesSetToNull, 'employers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employers'] = $employers; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of Payroll Squad + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPendingLettersCountResponse.php b/src/Model/ContractPendingLettersCountResponse.php new file mode 100644 index 0000000..cd47246 --- /dev/null +++ b/src/Model/ContractPendingLettersCountResponse.php @@ -0,0 +1,442 @@ + + */ +class ContractPendingLettersCountResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PendingLettersCountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pendingLettersCount' => 'int', + 'requiringAePostponementLettersCount' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pendingLettersCount' => 'int32', + 'requiringAePostponementLettersCount' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pendingLettersCount' => false, + 'requiringAePostponementLettersCount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pendingLettersCount' => 'pendingLettersCount', + 'requiringAePostponementLettersCount' => 'requiringAePostponementLettersCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pendingLettersCount' => 'setPendingLettersCount', + 'requiringAePostponementLettersCount' => 'setRequiringAePostponementLettersCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pendingLettersCount' => 'getPendingLettersCount', + 'requiringAePostponementLettersCount' => 'getRequiringAePostponementLettersCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pendingLettersCount', $data ?? [], null); + $this->setIfExists('requiringAePostponementLettersCount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pendingLettersCount + * + * @return int|null + */ + public function getPendingLettersCount(): ?int + { + return $this->container['pendingLettersCount']; + } + + /** + * Sets pendingLettersCount + * + * @param int|null $pendingLettersCount pendingLettersCount + * + * @return $this + */ + public function setPendingLettersCount(?int $pendingLettersCount): static + { + if (is_null($pendingLettersCount)) { + throw new InvalidArgumentException('non-nullable pendingLettersCount cannot be null'); + } + $this->container['pendingLettersCount'] = $pendingLettersCount; + + return $this; + } + + /** + * Gets requiringAePostponementLettersCount + * + * @return int|null + */ + public function getRequiringAePostponementLettersCount(): ?int + { + return $this->container['requiringAePostponementLettersCount']; + } + + /** + * Sets requiringAePostponementLettersCount + * + * @param int|null $requiringAePostponementLettersCount requiringAePostponementLettersCount + * + * @return $this + */ + public function setRequiringAePostponementLettersCount(?int $requiringAePostponementLettersCount): static + { + if (is_null($requiringAePostponementLettersCount)) { + throw new InvalidArgumentException('non-nullable requiringAePostponementLettersCount cannot be null'); + } + $this->container['requiringAePostponementLettersCount'] = $requiringAePostponementLettersCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPensionerPayroll.php b/src/Model/ContractPensionerPayroll.php new file mode 100644 index 0000000..bd6e37a --- /dev/null +++ b/src/Model/ContractPensionerPayroll.php @@ -0,0 +1,517 @@ + + */ +class ContractPensionerPayroll implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PensionerPayroll'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'inReceiptOfPension' => 'bool', + 'bereaved' => 'bool', + 'amount' => 'float', + 'startDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'inReceiptOfPension' => null, + 'bereaved' => null, + 'amount' => 'double', + 'startDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'inReceiptOfPension' => false, + 'bereaved' => false, + 'amount' => false, + 'startDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'inReceiptOfPension' => 'inReceiptOfPension', + 'bereaved' => 'bereaved', + 'amount' => 'amount', + 'startDate' => 'startDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'inReceiptOfPension' => 'setInReceiptOfPension', + 'bereaved' => 'setBereaved', + 'amount' => 'setAmount', + 'startDate' => 'setStartDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'inReceiptOfPension' => 'getInReceiptOfPension', + 'bereaved' => 'getBereaved', + 'amount' => 'getAmount', + 'startDate' => 'getStartDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('inReceiptOfPension', $data ?? [], null); + $this->setIfExists('bereaved', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets inReceiptOfPension + * + * @return bool|null + */ + public function getInReceiptOfPension(): ?bool + { + return $this->container['inReceiptOfPension']; + } + + /** + * Sets inReceiptOfPension + * + * @param bool|null $inReceiptOfPension If set to true then the FPS will have the OccPenInd flag set to 'yes' + * + * @return $this + */ + public function setInReceiptOfPension(?bool $inReceiptOfPension): static + { + if (is_null($inReceiptOfPension)) { + throw new InvalidArgumentException('non-nullable inReceiptOfPension cannot be null'); + } + $this->container['inReceiptOfPension'] = $inReceiptOfPension; + + return $this; + } + + /** + * Gets bereaved + * + * @return bool|null + */ + public function getBereaved(): ?bool + { + return $this->container['bereaved']; + } + + /** + * Sets bereaved + * + * @param bool|null $bereaved Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner + * + * @return $this + */ + public function setBereaved(?bool $bereaved): static + { + if (is_null($bereaved)) { + throw new InvalidArgumentException('non-nullable bereaved cannot be null'); + } + $this->container['bereaved'] = $bereaved; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount Annual amount of occupational pension + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate Start date of occupational Pension + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPersonalDetailsRequest.php b/src/Model/ContractPersonalDetailsRequest.php new file mode 100644 index 0000000..c22e728 --- /dev/null +++ b/src/Model/ContractPersonalDetailsRequest.php @@ -0,0 +1,1325 @@ + + */ +class ContractPersonalDetailsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PersonalDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'address' => '\SynergiTech\Staffology\Model\ContractAddress', + 'maritalStatus' => '\SynergiTech\Staffology\Model\MaritalStatus', + 'title' => 'string', + 'firstName' => 'string', + 'middleName' => 'string', + 'lastName' => 'string', + 'alternativeEmail' => 'string', + 'previousSurName' => 'string', + 'email' => 'string', + 'emailPayslip' => 'bool', + 'pdfPassword' => 'string', + 'pdfPasswordType' => '\SynergiTech\Staffology\Model\PdfPasswordType', + 'emailStatement' => 'bool', + 'photoUrl' => 'string', + 'telephone' => 'string', + 'photoSasUrl' => 'string', + 'mobile' => 'string', + 'dateOfBirth' => '\DateTime', + 'gender' => '\SynergiTech\Staffology\Model\Gender', + 'niNumber' => 'string', + 'passportNumber' => 'string', + 'partnerDetails' => '\SynergiTech\Staffology\Model\ContractPartnerDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'address' => null, + 'maritalStatus' => null, + 'title' => null, + 'firstName' => null, + 'middleName' => null, + 'lastName' => null, + 'alternativeEmail' => 'email', + 'previousSurName' => null, + 'email' => null, + 'emailPayslip' => null, + 'pdfPassword' => null, + 'pdfPasswordType' => null, + 'emailStatement' => null, + 'photoUrl' => null, + 'telephone' => null, + 'photoSasUrl' => null, + 'mobile' => null, + 'dateOfBirth' => 'date', + 'gender' => null, + 'niNumber' => null, + 'passportNumber' => null, + 'partnerDetails' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'address' => false, + 'maritalStatus' => false, + 'title' => true, + 'firstName' => true, + 'middleName' => true, + 'lastName' => true, + 'alternativeEmail' => true, + 'previousSurName' => true, + 'email' => true, + 'emailPayslip' => false, + 'pdfPassword' => true, + 'pdfPasswordType' => false, + 'emailStatement' => false, + 'photoUrl' => true, + 'telephone' => true, + 'photoSasUrl' => true, + 'mobile' => true, + 'dateOfBirth' => false, + 'gender' => false, + 'niNumber' => true, + 'passportNumber' => true, + 'partnerDetails' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'address' => 'address', + 'maritalStatus' => 'maritalStatus', + 'title' => 'title', + 'firstName' => 'firstName', + 'middleName' => 'middleName', + 'lastName' => 'lastName', + 'alternativeEmail' => 'alternativeEmail', + 'previousSurName' => 'previousSurName', + 'email' => 'email', + 'emailPayslip' => 'emailPayslip', + 'pdfPassword' => 'pdfPassword', + 'pdfPasswordType' => 'pdfPasswordType', + 'emailStatement' => 'emailStatement', + 'photoUrl' => 'photoUrl', + 'telephone' => 'telephone', + 'photoSasUrl' => 'photoSasUrl', + 'mobile' => 'mobile', + 'dateOfBirth' => 'dateOfBirth', + 'gender' => 'gender', + 'niNumber' => 'niNumber', + 'passportNumber' => 'passportNumber', + 'partnerDetails' => 'partnerDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'address' => 'setAddress', + 'maritalStatus' => 'setMaritalStatus', + 'title' => 'setTitle', + 'firstName' => 'setFirstName', + 'middleName' => 'setMiddleName', + 'lastName' => 'setLastName', + 'alternativeEmail' => 'setAlternativeEmail', + 'previousSurName' => 'setPreviousSurName', + 'email' => 'setEmail', + 'emailPayslip' => 'setEmailPayslip', + 'pdfPassword' => 'setPdfPassword', + 'pdfPasswordType' => 'setPdfPasswordType', + 'emailStatement' => 'setEmailStatement', + 'photoUrl' => 'setPhotoUrl', + 'telephone' => 'setTelephone', + 'photoSasUrl' => 'setPhotoSasUrl', + 'mobile' => 'setMobile', + 'dateOfBirth' => 'setDateOfBirth', + 'gender' => 'setGender', + 'niNumber' => 'setNiNumber', + 'passportNumber' => 'setPassportNumber', + 'partnerDetails' => 'setPartnerDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'address' => 'getAddress', + 'maritalStatus' => 'getMaritalStatus', + 'title' => 'getTitle', + 'firstName' => 'getFirstName', + 'middleName' => 'getMiddleName', + 'lastName' => 'getLastName', + 'alternativeEmail' => 'getAlternativeEmail', + 'previousSurName' => 'getPreviousSurName', + 'email' => 'getEmail', + 'emailPayslip' => 'getEmailPayslip', + 'pdfPassword' => 'getPdfPassword', + 'pdfPasswordType' => 'getPdfPasswordType', + 'emailStatement' => 'getEmailStatement', + 'photoUrl' => 'getPhotoUrl', + 'telephone' => 'getTelephone', + 'photoSasUrl' => 'getPhotoSasUrl', + 'mobile' => 'getMobile', + 'dateOfBirth' => 'getDateOfBirth', + 'gender' => 'getGender', + 'niNumber' => 'getNiNumber', + 'passportNumber' => 'getPassportNumber', + 'partnerDetails' => 'getPartnerDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('maritalStatus', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('middleName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('alternativeEmail', $data ?? [], null); + $this->setIfExists('previousSurName', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('emailPayslip', $data ?? [], null); + $this->setIfExists('pdfPassword', $data ?? [], null); + $this->setIfExists('pdfPasswordType', $data ?? [], null); + $this->setIfExists('emailStatement', $data ?? [], null); + $this->setIfExists('photoUrl', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('photoSasUrl', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('passportNumber', $data ?? [], null); + $this->setIfExists('partnerDetails', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['maritalStatus'] === null) { + $invalidProperties[] = "'maritalStatus' can't be null"; + } + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 30)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 35)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['middleName']) && (mb_strlen($this->container['middleName']) > 35)) { + $invalidProperties[] = "invalid value for 'middleName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 35)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['alternativeEmail']) && (mb_strlen($this->container['alternativeEmail']) > 100)) { + $invalidProperties[] = "invalid value for 'alternativeEmail', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['previousSurName']) && (mb_strlen($this->container['previousSurName']) > 35)) { + $invalidProperties[] = "invalid value for 'previousSurName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 100)) { + $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['photoUrl']) && (mb_strlen($this->container['photoUrl']) > 250)) { + $invalidProperties[] = "invalid value for 'photoUrl', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 30)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['mobile']) && (mb_strlen($this->container['mobile']) > 30)) { + $invalidProperties[] = "invalid value for 'mobile', the character length must be smaller than or equal to 30."; + } + + if ($this->container['dateOfBirth'] === null) { + $invalidProperties[] = "'dateOfBirth' can't be null"; + } + if ($this->container['gender'] === null) { + $invalidProperties[] = "'gender' can't be null"; + } + if (!is_null($this->container['niNumber']) && (mb_strlen($this->container['niNumber']) > 15)) { + $invalidProperties[] = "invalid value for 'niNumber', the character length must be smaller than or equal to 15."; + } + + if (!is_null($this->container['passportNumber']) && (mb_strlen($this->container['passportNumber']) > 25)) { + $invalidProperties[] = "invalid value for 'passportNumber', the character length must be smaller than or equal to 25."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\ContractAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\ContractAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\ContractAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\ContractAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets maritalStatus + * + * @return \SynergiTech\Staffology\Model\MaritalStatus + */ + public function getMaritalStatus(): \SynergiTech\Staffology\Model\MaritalStatus + { + return $this->container['maritalStatus']; + } + + /** + * Sets maritalStatus + * + * @param \SynergiTech\Staffology\Model\MaritalStatus $maritalStatus maritalStatus + * + * @return $this + */ + public function setMaritalStatus(\SynergiTech\Staffology\Model\MaritalStatus $maritalStatus): static + { + if (is_null($maritalStatus)) { + throw new InvalidArgumentException('non-nullable maritalStatus cannot be null'); + } + $this->container['maritalStatus'] = $maritalStatus; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($title) && (mb_strlen($title) > 30)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractPersonalDetailsRequest., must be smaller than or equal to 30.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 35)) { + throw new InvalidArgumentException('invalid length for $firstName when calling ContractPersonalDetailsRequest., must be smaller than or equal to 35.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets middleName + * + * @return string|null + */ + public function getMiddleName(): ?string + { + return $this->container['middleName']; + } + + /** + * Sets middleName + * + * @param string|null $middleName middleName + * + * @return $this + */ + public function setMiddleName(?string $middleName): static + { + if (is_null($middleName)) { + array_push($this->openAPINullablesSetToNull, 'middleName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('middleName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($middleName) && (mb_strlen($middleName) > 35)) { + throw new InvalidArgumentException('invalid length for $middleName when calling ContractPersonalDetailsRequest., must be smaller than or equal to 35.'); + } + + $this->container['middleName'] = $middleName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 35)) { + throw new InvalidArgumentException('invalid length for $lastName when calling ContractPersonalDetailsRequest., must be smaller than or equal to 35.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets alternativeEmail + * + * @return string|null + */ + public function getAlternativeEmail(): ?string + { + return $this->container['alternativeEmail']; + } + + /** + * Sets alternativeEmail + * + * @param string|null $alternativeEmail alternativeEmail + * + * @return $this + */ + public function setAlternativeEmail(?string $alternativeEmail): static + { + if (is_null($alternativeEmail)) { + array_push($this->openAPINullablesSetToNull, 'alternativeEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('alternativeEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($alternativeEmail) && (mb_strlen($alternativeEmail) > 100)) { + throw new InvalidArgumentException('invalid length for $alternativeEmail when calling ContractPersonalDetailsRequest., must be smaller than or equal to 100.'); + } + + $this->container['alternativeEmail'] = $alternativeEmail; + + return $this; + } + + /** + * Gets previousSurName + * + * @return string|null + */ + public function getPreviousSurName(): ?string + { + return $this->container['previousSurName']; + } + + /** + * Sets previousSurName + * + * @param string|null $previousSurName previousSurName + * + * @return $this + */ + public function setPreviousSurName(?string $previousSurName): static + { + if (is_null($previousSurName)) { + array_push($this->openAPINullablesSetToNull, 'previousSurName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousSurName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($previousSurName) && (mb_strlen($previousSurName) > 35)) { + throw new InvalidArgumentException('invalid length for $previousSurName when calling ContractPersonalDetailsRequest., must be smaller than or equal to 35.'); + } + + $this->container['previousSurName'] = $previousSurName; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail(): ?string + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail(?string $email): static + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($email) && (mb_strlen($email) > 100)) { + throw new InvalidArgumentException('invalid length for $email when calling ContractPersonalDetailsRequest., must be smaller than or equal to 100.'); + } + + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets emailPayslip + * + * @return bool|null + */ + public function getEmailPayslip(): ?bool + { + return $this->container['emailPayslip']; + } + + /** + * Sets emailPayslip + * + * @param bool|null $emailPayslip If set to true then the employees Payslip will be sent by email when a PayRun is finalised. + * + * @return $this + */ + public function setEmailPayslip(?bool $emailPayslip): static + { + if (is_null($emailPayslip)) { + throw new InvalidArgumentException('non-nullable emailPayslip cannot be null'); + } + $this->container['emailPayslip'] = $emailPayslip; + + return $this; + } + + /** + * Gets pdfPassword + * + * @return string|null + */ + public function getPdfPassword(): ?string + { + return $this->container['pdfPassword']; + } + + /** + * Sets pdfPassword + * + * @param string|null $pdfPassword Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. + * + * @return $this + */ + public function setPdfPassword(?string $pdfPassword): static + { + if (is_null($pdfPassword)) { + array_push($this->openAPINullablesSetToNull, 'pdfPassword'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdfPassword', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pdfPassword'] = $pdfPassword; + + return $this; + } + + /** + * Gets pdfPasswordType + * + * @return \SynergiTech\Staffology\Model\PdfPasswordType|null + */ + public function getPdfPasswordType(): ?\SynergiTech\Staffology\Model\PdfPasswordType + { + return $this->container['pdfPasswordType']; + } + + /** + * Sets pdfPasswordType + * + * @param \SynergiTech\Staffology\Model\PdfPasswordType|null $pdfPasswordType pdfPasswordType + * + * @return $this + */ + public function setPdfPasswordType(?\SynergiTech\Staffology\Model\PdfPasswordType $pdfPasswordType): static + { + if (is_null($pdfPasswordType)) { + throw new InvalidArgumentException('non-nullable pdfPasswordType cannot be null'); + } + $this->container['pdfPasswordType'] = $pdfPasswordType; + + return $this; + } + + /** + * Gets emailStatement + * + * @return bool|null + */ + public function getEmailStatement(): ?bool + { + return $this->container['emailStatement']; + } + + /** + * Sets emailStatement + * + * @param bool|null $emailStatement Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. + * + * @return $this + */ + public function setEmailStatement(?bool $emailStatement): static + { + if (is_null($emailStatement)) { + throw new InvalidArgumentException('non-nullable emailStatement cannot be null'); + } + $this->container['emailStatement'] = $emailStatement; + + return $this; + } + + /** + * Gets photoUrl + * + * @return string|null + */ + public function getPhotoUrl(): ?string + { + return $this->container['photoUrl']; + } + + /** + * Sets photoUrl + * + * @param string|null $photoUrl photoUrl + * + * @return $this + */ + public function setPhotoUrl(?string $photoUrl): static + { + if (is_null($photoUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($photoUrl) && (mb_strlen($photoUrl) > 250)) { + throw new InvalidArgumentException('invalid length for $photoUrl when calling ContractPersonalDetailsRequest., must be smaller than or equal to 250.'); + } + + $this->container['photoUrl'] = $photoUrl; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 30)) { + throw new InvalidArgumentException('invalid length for $telephone when calling ContractPersonalDetailsRequest., must be smaller than or equal to 30.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets photoSasUrl + * + * @return string|null + */ + public function getPhotoSasUrl(): ?string + { + return $this->container['photoSasUrl']; + } + + /** + * Sets photoSasUrl + * + * @param string|null $photoSasUrl photoSasUrl + * + * @return $this + */ + public function setPhotoSasUrl(?string $photoSasUrl): static + { + if (is_null($photoSasUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoSasUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoSasUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['photoSasUrl'] = $photoSasUrl; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile(): ?string + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile mobile + * + * @return $this + */ + public function setMobile(?string $mobile): static + { + if (is_null($mobile)) { + array_push($this->openAPINullablesSetToNull, 'mobile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mobile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($mobile) && (mb_strlen($mobile) > 30)) { + throw new InvalidArgumentException('invalid length for $mobile when calling ContractPersonalDetailsRequest., must be smaller than or equal to 30.'); + } + + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime + */ + public function getDateOfBirth(): \DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime $dateOfBirth dateOfBirth + * + * @return $this + */ + public function setDateOfBirth(\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets gender + * + * @return \SynergiTech\Staffology\Model\Gender + */ + public function getGender(): \SynergiTech\Staffology\Model\Gender + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \SynergiTech\Staffology\Model\Gender $gender gender + * + * @return $this + */ + public function setGender(\SynergiTech\Staffology\Model\Gender $gender): static + { + if (is_null($gender)) { + throw new InvalidArgumentException('non-nullable gender cannot be null'); + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($niNumber) && (mb_strlen($niNumber) > 15)) { + throw new InvalidArgumentException('invalid length for $niNumber when calling ContractPersonalDetailsRequest., must be smaller than or equal to 15.'); + } + + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets passportNumber + * + * @return string|null + */ + public function getPassportNumber(): ?string + { + return $this->container['passportNumber']; + } + + /** + * Sets passportNumber + * + * @param string|null $passportNumber passportNumber + * + * @return $this + */ + public function setPassportNumber(?string $passportNumber): static + { + if (is_null($passportNumber)) { + array_push($this->openAPINullablesSetToNull, 'passportNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('passportNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($passportNumber) && (mb_strlen($passportNumber) > 25)) { + throw new InvalidArgumentException('invalid length for $passportNumber when calling ContractPersonalDetailsRequest., must be smaller than or equal to 25.'); + } + + $this->container['passportNumber'] = $passportNumber; + + return $this; + } + + /** + * Gets partnerDetails + * + * @return \SynergiTech\Staffology\Model\ContractPartnerDetails|null + */ + public function getPartnerDetails(): ?\SynergiTech\Staffology\Model\ContractPartnerDetails + { + return $this->container['partnerDetails']; + } + + /** + * Sets partnerDetails + * + * @param \SynergiTech\Staffology\Model\ContractPartnerDetails|null $partnerDetails partnerDetails + * + * @return $this + */ + public function setPartnerDetails(?\SynergiTech\Staffology\Model\ContractPartnerDetails $partnerDetails): static + { + if (is_null($partnerDetails)) { + throw new InvalidArgumentException('non-nullable partnerDetails cannot be null'); + } + $this->container['partnerDetails'] = $partnerDetails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractPersonalDetailsResponse.php b/src/Model/ContractPersonalDetailsResponse.php new file mode 100644 index 0000000..b2e4fa4 --- /dev/null +++ b/src/Model/ContractPersonalDetailsResponse.php @@ -0,0 +1,1359 @@ + + */ +class ContractPersonalDetailsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.PersonalDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'statePensionAge' => 'int', + 'address' => '\SynergiTech\Staffology\Model\ContractAddress', + 'maritalStatus' => '\SynergiTech\Staffology\Model\MaritalStatus', + 'title' => 'string', + 'firstName' => 'string', + 'middleName' => 'string', + 'lastName' => 'string', + 'alternativeEmail' => 'string', + 'previousSurName' => 'string', + 'email' => 'string', + 'emailPayslip' => 'bool', + 'pdfPassword' => 'string', + 'pdfPasswordType' => '\SynergiTech\Staffology\Model\PdfPasswordType', + 'emailStatement' => 'bool', + 'photoUrl' => 'string', + 'telephone' => 'string', + 'photoSasUrl' => 'string', + 'mobile' => 'string', + 'dateOfBirth' => '\DateTime', + 'gender' => '\SynergiTech\Staffology\Model\Gender', + 'niNumber' => 'string', + 'passportNumber' => 'string', + 'partnerDetails' => '\SynergiTech\Staffology\Model\ContractPartnerDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'statePensionAge' => 'int32', + 'address' => null, + 'maritalStatus' => null, + 'title' => null, + 'firstName' => null, + 'middleName' => null, + 'lastName' => null, + 'alternativeEmail' => 'email', + 'previousSurName' => null, + 'email' => null, + 'emailPayslip' => null, + 'pdfPassword' => null, + 'pdfPasswordType' => null, + 'emailStatement' => null, + 'photoUrl' => null, + 'telephone' => null, + 'photoSasUrl' => null, + 'mobile' => null, + 'dateOfBirth' => 'date', + 'gender' => null, + 'niNumber' => null, + 'passportNumber' => null, + 'partnerDetails' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'statePensionAge' => false, + 'address' => false, + 'maritalStatus' => false, + 'title' => true, + 'firstName' => true, + 'middleName' => true, + 'lastName' => true, + 'alternativeEmail' => true, + 'previousSurName' => true, + 'email' => true, + 'emailPayslip' => false, + 'pdfPassword' => true, + 'pdfPasswordType' => false, + 'emailStatement' => false, + 'photoUrl' => true, + 'telephone' => true, + 'photoSasUrl' => true, + 'mobile' => true, + 'dateOfBirth' => false, + 'gender' => false, + 'niNumber' => true, + 'passportNumber' => true, + 'partnerDetails' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'statePensionAge' => 'statePensionAge', + 'address' => 'address', + 'maritalStatus' => 'maritalStatus', + 'title' => 'title', + 'firstName' => 'firstName', + 'middleName' => 'middleName', + 'lastName' => 'lastName', + 'alternativeEmail' => 'alternativeEmail', + 'previousSurName' => 'previousSurName', + 'email' => 'email', + 'emailPayslip' => 'emailPayslip', + 'pdfPassword' => 'pdfPassword', + 'pdfPasswordType' => 'pdfPasswordType', + 'emailStatement' => 'emailStatement', + 'photoUrl' => 'photoUrl', + 'telephone' => 'telephone', + 'photoSasUrl' => 'photoSasUrl', + 'mobile' => 'mobile', + 'dateOfBirth' => 'dateOfBirth', + 'gender' => 'gender', + 'niNumber' => 'niNumber', + 'passportNumber' => 'passportNumber', + 'partnerDetails' => 'partnerDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'statePensionAge' => 'setStatePensionAge', + 'address' => 'setAddress', + 'maritalStatus' => 'setMaritalStatus', + 'title' => 'setTitle', + 'firstName' => 'setFirstName', + 'middleName' => 'setMiddleName', + 'lastName' => 'setLastName', + 'alternativeEmail' => 'setAlternativeEmail', + 'previousSurName' => 'setPreviousSurName', + 'email' => 'setEmail', + 'emailPayslip' => 'setEmailPayslip', + 'pdfPassword' => 'setPdfPassword', + 'pdfPasswordType' => 'setPdfPasswordType', + 'emailStatement' => 'setEmailStatement', + 'photoUrl' => 'setPhotoUrl', + 'telephone' => 'setTelephone', + 'photoSasUrl' => 'setPhotoSasUrl', + 'mobile' => 'setMobile', + 'dateOfBirth' => 'setDateOfBirth', + 'gender' => 'setGender', + 'niNumber' => 'setNiNumber', + 'passportNumber' => 'setPassportNumber', + 'partnerDetails' => 'setPartnerDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'statePensionAge' => 'getStatePensionAge', + 'address' => 'getAddress', + 'maritalStatus' => 'getMaritalStatus', + 'title' => 'getTitle', + 'firstName' => 'getFirstName', + 'middleName' => 'getMiddleName', + 'lastName' => 'getLastName', + 'alternativeEmail' => 'getAlternativeEmail', + 'previousSurName' => 'getPreviousSurName', + 'email' => 'getEmail', + 'emailPayslip' => 'getEmailPayslip', + 'pdfPassword' => 'getPdfPassword', + 'pdfPasswordType' => 'getPdfPasswordType', + 'emailStatement' => 'getEmailStatement', + 'photoUrl' => 'getPhotoUrl', + 'telephone' => 'getTelephone', + 'photoSasUrl' => 'getPhotoSasUrl', + 'mobile' => 'getMobile', + 'dateOfBirth' => 'getDateOfBirth', + 'gender' => 'getGender', + 'niNumber' => 'getNiNumber', + 'passportNumber' => 'getPassportNumber', + 'partnerDetails' => 'getPartnerDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('statePensionAge', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('maritalStatus', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('middleName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('alternativeEmail', $data ?? [], null); + $this->setIfExists('previousSurName', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('emailPayslip', $data ?? [], null); + $this->setIfExists('pdfPassword', $data ?? [], null); + $this->setIfExists('pdfPasswordType', $data ?? [], null); + $this->setIfExists('emailStatement', $data ?? [], null); + $this->setIfExists('photoUrl', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('photoSasUrl', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('passportNumber', $data ?? [], null); + $this->setIfExists('partnerDetails', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['maritalStatus'] === null) { + $invalidProperties[] = "'maritalStatus' can't be null"; + } + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 30)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 35)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['middleName']) && (mb_strlen($this->container['middleName']) > 35)) { + $invalidProperties[] = "invalid value for 'middleName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 35)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['alternativeEmail']) && (mb_strlen($this->container['alternativeEmail']) > 100)) { + $invalidProperties[] = "invalid value for 'alternativeEmail', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['previousSurName']) && (mb_strlen($this->container['previousSurName']) > 35)) { + $invalidProperties[] = "invalid value for 'previousSurName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 100)) { + $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['photoUrl']) && (mb_strlen($this->container['photoUrl']) > 250)) { + $invalidProperties[] = "invalid value for 'photoUrl', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 30)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['mobile']) && (mb_strlen($this->container['mobile']) > 30)) { + $invalidProperties[] = "invalid value for 'mobile', the character length must be smaller than or equal to 30."; + } + + if ($this->container['dateOfBirth'] === null) { + $invalidProperties[] = "'dateOfBirth' can't be null"; + } + if ($this->container['gender'] === null) { + $invalidProperties[] = "'gender' can't be null"; + } + if (!is_null($this->container['niNumber']) && (mb_strlen($this->container['niNumber']) > 15)) { + $invalidProperties[] = "invalid value for 'niNumber', the character length must be smaller than or equal to 15."; + } + + if (!is_null($this->container['passportNumber']) && (mb_strlen($this->container['passportNumber']) > 25)) { + $invalidProperties[] = "invalid value for 'passportNumber', the character length must be smaller than or equal to 25."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets statePensionAge + * + * @return int|null + */ + public function getStatePensionAge(): ?int + { + return $this->container['statePensionAge']; + } + + /** + * Sets statePensionAge + * + * @param int|null $statePensionAge Automatically calculated. + * + * @return $this + */ + public function setStatePensionAge(?int $statePensionAge): static + { + if (is_null($statePensionAge)) { + throw new InvalidArgumentException('non-nullable statePensionAge cannot be null'); + } + $this->container['statePensionAge'] = $statePensionAge; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\ContractAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\ContractAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\ContractAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\ContractAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets maritalStatus + * + * @return \SynergiTech\Staffology\Model\MaritalStatus + */ + public function getMaritalStatus(): \SynergiTech\Staffology\Model\MaritalStatus + { + return $this->container['maritalStatus']; + } + + /** + * Sets maritalStatus + * + * @param \SynergiTech\Staffology\Model\MaritalStatus $maritalStatus maritalStatus + * + * @return $this + */ + public function setMaritalStatus(\SynergiTech\Staffology\Model\MaritalStatus $maritalStatus): static + { + if (is_null($maritalStatus)) { + throw new InvalidArgumentException('non-nullable maritalStatus cannot be null'); + } + $this->container['maritalStatus'] = $maritalStatus; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($title) && (mb_strlen($title) > 30)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractPersonalDetailsResponse., must be smaller than or equal to 30.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 35)) { + throw new InvalidArgumentException('invalid length for $firstName when calling ContractPersonalDetailsResponse., must be smaller than or equal to 35.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets middleName + * + * @return string|null + */ + public function getMiddleName(): ?string + { + return $this->container['middleName']; + } + + /** + * Sets middleName + * + * @param string|null $middleName middleName + * + * @return $this + */ + public function setMiddleName(?string $middleName): static + { + if (is_null($middleName)) { + array_push($this->openAPINullablesSetToNull, 'middleName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('middleName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($middleName) && (mb_strlen($middleName) > 35)) { + throw new InvalidArgumentException('invalid length for $middleName when calling ContractPersonalDetailsResponse., must be smaller than or equal to 35.'); + } + + $this->container['middleName'] = $middleName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 35)) { + throw new InvalidArgumentException('invalid length for $lastName when calling ContractPersonalDetailsResponse., must be smaller than or equal to 35.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets alternativeEmail + * + * @return string|null + */ + public function getAlternativeEmail(): ?string + { + return $this->container['alternativeEmail']; + } + + /** + * Sets alternativeEmail + * + * @param string|null $alternativeEmail alternativeEmail + * + * @return $this + */ + public function setAlternativeEmail(?string $alternativeEmail): static + { + if (is_null($alternativeEmail)) { + array_push($this->openAPINullablesSetToNull, 'alternativeEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('alternativeEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($alternativeEmail) && (mb_strlen($alternativeEmail) > 100)) { + throw new InvalidArgumentException('invalid length for $alternativeEmail when calling ContractPersonalDetailsResponse., must be smaller than or equal to 100.'); + } + + $this->container['alternativeEmail'] = $alternativeEmail; + + return $this; + } + + /** + * Gets previousSurName + * + * @return string|null + */ + public function getPreviousSurName(): ?string + { + return $this->container['previousSurName']; + } + + /** + * Sets previousSurName + * + * @param string|null $previousSurName previousSurName + * + * @return $this + */ + public function setPreviousSurName(?string $previousSurName): static + { + if (is_null($previousSurName)) { + array_push($this->openAPINullablesSetToNull, 'previousSurName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousSurName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($previousSurName) && (mb_strlen($previousSurName) > 35)) { + throw new InvalidArgumentException('invalid length for $previousSurName when calling ContractPersonalDetailsResponse., must be smaller than or equal to 35.'); + } + + $this->container['previousSurName'] = $previousSurName; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail(): ?string + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail(?string $email): static + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($email) && (mb_strlen($email) > 100)) { + throw new InvalidArgumentException('invalid length for $email when calling ContractPersonalDetailsResponse., must be smaller than or equal to 100.'); + } + + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets emailPayslip + * + * @return bool|null + */ + public function getEmailPayslip(): ?bool + { + return $this->container['emailPayslip']; + } + + /** + * Sets emailPayslip + * + * @param bool|null $emailPayslip If set to true then the employees Payslip will be sent by email when a PayRun is finalised. + * + * @return $this + */ + public function setEmailPayslip(?bool $emailPayslip): static + { + if (is_null($emailPayslip)) { + throw new InvalidArgumentException('non-nullable emailPayslip cannot be null'); + } + $this->container['emailPayslip'] = $emailPayslip; + + return $this; + } + + /** + * Gets pdfPassword + * + * @return string|null + */ + public function getPdfPassword(): ?string + { + return $this->container['pdfPassword']; + } + + /** + * Sets pdfPassword + * + * @param string|null $pdfPassword Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. + * + * @return $this + */ + public function setPdfPassword(?string $pdfPassword): static + { + if (is_null($pdfPassword)) { + array_push($this->openAPINullablesSetToNull, 'pdfPassword'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdfPassword', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pdfPassword'] = $pdfPassword; + + return $this; + } + + /** + * Gets pdfPasswordType + * + * @return \SynergiTech\Staffology\Model\PdfPasswordType|null + */ + public function getPdfPasswordType(): ?\SynergiTech\Staffology\Model\PdfPasswordType + { + return $this->container['pdfPasswordType']; + } + + /** + * Sets pdfPasswordType + * + * @param \SynergiTech\Staffology\Model\PdfPasswordType|null $pdfPasswordType pdfPasswordType + * + * @return $this + */ + public function setPdfPasswordType(?\SynergiTech\Staffology\Model\PdfPasswordType $pdfPasswordType): static + { + if (is_null($pdfPasswordType)) { + throw new InvalidArgumentException('non-nullable pdfPasswordType cannot be null'); + } + $this->container['pdfPasswordType'] = $pdfPasswordType; + + return $this; + } + + /** + * Gets emailStatement + * + * @return bool|null + */ + public function getEmailStatement(): ?bool + { + return $this->container['emailStatement']; + } + + /** + * Sets emailStatement + * + * @param bool|null $emailStatement Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. + * + * @return $this + */ + public function setEmailStatement(?bool $emailStatement): static + { + if (is_null($emailStatement)) { + throw new InvalidArgumentException('non-nullable emailStatement cannot be null'); + } + $this->container['emailStatement'] = $emailStatement; + + return $this; + } + + /** + * Gets photoUrl + * + * @return string|null + */ + public function getPhotoUrl(): ?string + { + return $this->container['photoUrl']; + } + + /** + * Sets photoUrl + * + * @param string|null $photoUrl photoUrl + * + * @return $this + */ + public function setPhotoUrl(?string $photoUrl): static + { + if (is_null($photoUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($photoUrl) && (mb_strlen($photoUrl) > 250)) { + throw new InvalidArgumentException('invalid length for $photoUrl when calling ContractPersonalDetailsResponse., must be smaller than or equal to 250.'); + } + + $this->container['photoUrl'] = $photoUrl; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 30)) { + throw new InvalidArgumentException('invalid length for $telephone when calling ContractPersonalDetailsResponse., must be smaller than or equal to 30.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets photoSasUrl + * + * @return string|null + */ + public function getPhotoSasUrl(): ?string + { + return $this->container['photoSasUrl']; + } + + /** + * Sets photoSasUrl + * + * @param string|null $photoSasUrl photoSasUrl + * + * @return $this + */ + public function setPhotoSasUrl(?string $photoSasUrl): static + { + if (is_null($photoSasUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoSasUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoSasUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['photoSasUrl'] = $photoSasUrl; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile(): ?string + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile mobile + * + * @return $this + */ + public function setMobile(?string $mobile): static + { + if (is_null($mobile)) { + array_push($this->openAPINullablesSetToNull, 'mobile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mobile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($mobile) && (mb_strlen($mobile) > 30)) { + throw new InvalidArgumentException('invalid length for $mobile when calling ContractPersonalDetailsResponse., must be smaller than or equal to 30.'); + } + + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime + */ + public function getDateOfBirth(): \DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime $dateOfBirth dateOfBirth + * + * @return $this + */ + public function setDateOfBirth(\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets gender + * + * @return \SynergiTech\Staffology\Model\Gender + */ + public function getGender(): \SynergiTech\Staffology\Model\Gender + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \SynergiTech\Staffology\Model\Gender $gender gender + * + * @return $this + */ + public function setGender(\SynergiTech\Staffology\Model\Gender $gender): static + { + if (is_null($gender)) { + throw new InvalidArgumentException('non-nullable gender cannot be null'); + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($niNumber) && (mb_strlen($niNumber) > 15)) { + throw new InvalidArgumentException('invalid length for $niNumber when calling ContractPersonalDetailsResponse., must be smaller than or equal to 15.'); + } + + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets passportNumber + * + * @return string|null + */ + public function getPassportNumber(): ?string + { + return $this->container['passportNumber']; + } + + /** + * Sets passportNumber + * + * @param string|null $passportNumber passportNumber + * + * @return $this + */ + public function setPassportNumber(?string $passportNumber): static + { + if (is_null($passportNumber)) { + array_push($this->openAPINullablesSetToNull, 'passportNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('passportNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($passportNumber) && (mb_strlen($passportNumber) > 25)) { + throw new InvalidArgumentException('invalid length for $passportNumber when calling ContractPersonalDetailsResponse., must be smaller than or equal to 25.'); + } + + $this->container['passportNumber'] = $passportNumber; + + return $this; + } + + /** + * Gets partnerDetails + * + * @return \SynergiTech\Staffology\Model\ContractPartnerDetails|null + */ + public function getPartnerDetails(): ?\SynergiTech\Staffology\Model\ContractPartnerDetails + { + return $this->container['partnerDetails']; + } + + /** + * Sets partnerDetails + * + * @param \SynergiTech\Staffology\Model\ContractPartnerDetails|null $partnerDetails partnerDetails + * + * @return $this + */ + public function setPartnerDetails(?\SynergiTech\Staffology\Model\ContractPartnerDetails $partnerDetails): static + { + if (is_null($partnerDetails)) { + throw new InvalidArgumentException('non-nullable partnerDetails cannot be null'); + } + $this->container['partnerDetails'] = $partnerDetails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractReapplyDpsNoticeResponse.php b/src/Model/ContractReapplyDpsNoticeResponse.php new file mode 100644 index 0000000..bd96b3a --- /dev/null +++ b/src/Model/ContractReapplyDpsNoticeResponse.php @@ -0,0 +1,442 @@ + + */ +class ContractReapplyDpsNoticeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.ReapplyDpsNoticeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'numberOfAppliedNotices' => 'int', + 'numberOfFailedNotices' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'numberOfAppliedNotices' => 'int32', + 'numberOfFailedNotices' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'numberOfAppliedNotices' => false, + 'numberOfFailedNotices' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'numberOfAppliedNotices' => 'numberOfAppliedNotices', + 'numberOfFailedNotices' => 'numberOfFailedNotices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'numberOfAppliedNotices' => 'setNumberOfAppliedNotices', + 'numberOfFailedNotices' => 'setNumberOfFailedNotices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'numberOfAppliedNotices' => 'getNumberOfAppliedNotices', + 'numberOfFailedNotices' => 'getNumberOfFailedNotices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('numberOfAppliedNotices', $data ?? [], null); + $this->setIfExists('numberOfFailedNotices', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets numberOfAppliedNotices + * + * @return int|null + */ + public function getNumberOfAppliedNotices(): ?int + { + return $this->container['numberOfAppliedNotices']; + } + + /** + * Sets numberOfAppliedNotices + * + * @param int|null $numberOfAppliedNotices numberOfAppliedNotices + * + * @return $this + */ + public function setNumberOfAppliedNotices(?int $numberOfAppliedNotices): static + { + if (is_null($numberOfAppliedNotices)) { + throw new InvalidArgumentException('non-nullable numberOfAppliedNotices cannot be null'); + } + $this->container['numberOfAppliedNotices'] = $numberOfAppliedNotices; + + return $this; + } + + /** + * Gets numberOfFailedNotices + * + * @return int|null + */ + public function getNumberOfFailedNotices(): ?int + { + return $this->container['numberOfFailedNotices']; + } + + /** + * Sets numberOfFailedNotices + * + * @param int|null $numberOfFailedNotices numberOfFailedNotices + * + * @return $this + */ + public function setNumberOfFailedNotices(?int $numberOfFailedNotices): static + { + if (is_null($numberOfFailedNotices)) { + throw new InvalidArgumentException('non-nullable numberOfFailedNotices cannot be null'); + } + $this->container['numberOfFailedNotices'] = $numberOfFailedNotices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractRightToWork.php b/src/Model/ContractRightToWork.php new file mode 100644 index 0000000..f221c69 --- /dev/null +++ b/src/Model/ContractRightToWork.php @@ -0,0 +1,581 @@ + + */ +class ContractRightToWork implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.RightToWork'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'checked' => 'bool', + 'documentType' => '\SynergiTech\Staffology\Model\RightToWorkDocumentType', + 'documentRef' => 'string', + 'documentExpiry' => '\DateTime', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'checked' => null, + 'documentType' => null, + 'documentRef' => null, + 'documentExpiry' => 'date', + 'note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'checked' => false, + 'documentType' => false, + 'documentRef' => true, + 'documentExpiry' => true, + 'note' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'checked' => 'checked', + 'documentType' => 'documentType', + 'documentRef' => 'documentRef', + 'documentExpiry' => 'documentExpiry', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'checked' => 'setChecked', + 'documentType' => 'setDocumentType', + 'documentRef' => 'setDocumentRef', + 'documentExpiry' => 'setDocumentExpiry', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'checked' => 'getChecked', + 'documentType' => 'getDocumentType', + 'documentRef' => 'getDocumentRef', + 'documentExpiry' => 'getDocumentExpiry', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checked', $data ?? [], null); + $this->setIfExists('documentType', $data ?? [], null); + $this->setIfExists('documentRef', $data ?? [], null); + $this->setIfExists('documentExpiry', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['documentRef']) && (mb_strlen($this->container['documentRef']) > 80)) { + $invalidProperties[] = "invalid value for 'documentRef', the character length must be smaller than or equal to 80."; + } + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 200)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 200."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checked + * + * @return bool|null + */ + public function getChecked(): ?bool + { + return $this->container['checked']; + } + + /** + * Sets checked + * + * @param bool|null $checked checked + * + * @return $this + */ + public function setChecked(?bool $checked): static + { + if (is_null($checked)) { + throw new InvalidArgumentException('non-nullable checked cannot be null'); + } + $this->container['checked'] = $checked; + + return $this; + } + + /** + * Gets documentType + * + * @return \SynergiTech\Staffology\Model\RightToWorkDocumentType|null + */ + public function getDocumentType(): ?\SynergiTech\Staffology\Model\RightToWorkDocumentType + { + return $this->container['documentType']; + } + + /** + * Sets documentType + * + * @param \SynergiTech\Staffology\Model\RightToWorkDocumentType|null $documentType documentType + * + * @return $this + */ + public function setDocumentType(?\SynergiTech\Staffology\Model\RightToWorkDocumentType $documentType): static + { + if (is_null($documentType)) { + throw new InvalidArgumentException('non-nullable documentType cannot be null'); + } + $this->container['documentType'] = $documentType; + + return $this; + } + + /** + * Gets documentRef + * + * @return string|null + */ + public function getDocumentRef(): ?string + { + return $this->container['documentRef']; + } + + /** + * Sets documentRef + * + * @param string|null $documentRef documentRef + * + * @return $this + */ + public function setDocumentRef(?string $documentRef): static + { + if (is_null($documentRef)) { + array_push($this->openAPINullablesSetToNull, 'documentRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documentRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($documentRef) && (mb_strlen($documentRef) > 80)) { + throw new InvalidArgumentException('invalid length for $documentRef when calling ContractRightToWork., must be smaller than or equal to 80.'); + } + + $this->container['documentRef'] = $documentRef; + + return $this; + } + + /** + * Gets documentExpiry + * + * @return \DateTime|null + */ + public function getDocumentExpiry(): ?\DateTime + { + return $this->container['documentExpiry']; + } + + /** + * Sets documentExpiry + * + * @param \DateTime|null $documentExpiry documentExpiry + * + * @return $this + */ + public function setDocumentExpiry(?\DateTime $documentExpiry): static + { + if (is_null($documentExpiry)) { + array_push($this->openAPINullablesSetToNull, 'documentExpiry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documentExpiry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documentExpiry'] = $documentExpiry; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note note + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 200)) { + throw new InvalidArgumentException('invalid length for $note when calling ContractRightToWork., must be smaller than or equal to 200.'); + } + + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractRtiEmployeeAddress.php b/src/Model/ContractRtiEmployeeAddress.php new file mode 100644 index 0000000..15653c8 --- /dev/null +++ b/src/Model/ContractRtiEmployeeAddress.php @@ -0,0 +1,620 @@ + + */ +class ContractRtiEmployeeAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.RtiEmployeeAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'line' => 'string[]', + 'postcode' => 'string', + 'postCode' => 'string', + 'ukPostcode' => 'string', + 'country' => 'string', + 'foreignCountry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'line' => null, + 'postcode' => null, + 'postCode' => null, + 'ukPostcode' => null, + 'country' => null, + 'foreignCountry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'line' => true, + 'postcode' => true, + 'postCode' => true, + 'ukPostcode' => true, + 'country' => true, + 'foreignCountry' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'line' => 'line', + 'postcode' => 'postcode', + 'postCode' => 'postCode', + 'ukPostcode' => 'ukPostcode', + 'country' => 'country', + 'foreignCountry' => 'foreignCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'line' => 'setLine', + 'postcode' => 'setPostcode', + 'postCode' => 'setPostCode', + 'ukPostcode' => 'setUkPostcode', + 'country' => 'setCountry', + 'foreignCountry' => 'setForeignCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'line' => 'getLine', + 'postcode' => 'getPostcode', + 'postCode' => 'getPostCode', + 'ukPostcode' => 'getUkPostcode', + 'country' => 'getCountry', + 'foreignCountry' => 'getForeignCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('line', $data ?? [], null); + $this->setIfExists('postcode', $data ?? [], null); + $this->setIfExists('postCode', $data ?? [], null); + $this->setIfExists('ukPostcode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('foreignCountry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line + * + * @return string[]|null + */ + public function getLine(): ?array + { + return $this->container['line']; + } + + /** + * Sets line + * + * @param string[]|null $line line + * + * @return $this + */ + public function setLine(?array $line): static + { + if (is_null($line)) { + array_push($this->openAPINullablesSetToNull, 'line'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['line'] = $line; + + return $this; + } + + /** + * Gets postcode + * + * @return string|null + */ + public function getPostcode(): ?string + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string|null $postcode postcode + * + * @return $this + */ + public function setPostcode(?string $postcode): static + { + if (is_null($postcode)) { + array_push($this->openAPINullablesSetToNull, 'postcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postcode'] = $postcode; + + return $this; + } + + /** + * Gets postCode + * + * @return string|null + */ + public function getPostCode(): ?string + { + return $this->container['postCode']; + } + + /** + * Sets postCode + * + * @param string|null $postCode postCode + * + * @return $this + */ + public function setPostCode(?string $postCode): static + { + if (is_null($postCode)) { + array_push($this->openAPINullablesSetToNull, 'postCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postCode'] = $postCode; + + return $this; + } + + /** + * Gets ukPostcode + * + * @return string|null + */ + public function getUkPostcode(): ?string + { + return $this->container['ukPostcode']; + } + + /** + * Sets ukPostcode + * + * @param string|null $ukPostcode ukPostcode + * + * @return $this + */ + public function setUkPostcode(?string $ukPostcode): static + { + if (is_null($ukPostcode)) { + array_push($this->openAPINullablesSetToNull, 'ukPostcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ukPostcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ukPostcode'] = $ukPostcode; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry(): ?string + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return $this + */ + public function setCountry(?string $country): static + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets foreignCountry + * + * @return string|null + */ + public function getForeignCountry(): ?string + { + return $this->container['foreignCountry']; + } + + /** + * Sets foreignCountry + * + * @param string|null $foreignCountry foreignCountry + * + * @return $this + */ + public function setForeignCountry(?string $foreignCountry): static + { + if (is_null($foreignCountry)) { + array_push($this->openAPINullablesSetToNull, 'foreignCountry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignCountry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['foreignCountry'] = $foreignCountry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractRtiEmployeeName.php b/src/Model/ContractRtiEmployeeName.php new file mode 100644 index 0000000..242f406 --- /dev/null +++ b/src/Model/ContractRtiEmployeeName.php @@ -0,0 +1,538 @@ + + */ +class ContractRtiEmployeeName implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.RtiEmployeeName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'ttl' => 'string', + 'fore' => 'string[]', + 'initials' => 'string', + 'sur' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'ttl' => null, + 'fore' => null, + 'initials' => null, + 'sur' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'ttl' => true, + 'fore' => true, + 'initials' => true, + 'sur' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'ttl' => 'ttl', + 'fore' => 'fore', + 'initials' => 'initials', + 'sur' => 'sur' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'ttl' => 'setTtl', + 'fore' => 'setFore', + 'initials' => 'setInitials', + 'sur' => 'setSur' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'ttl' => 'getTtl', + 'fore' => 'getFore', + 'initials' => 'getInitials', + 'sur' => 'getSur' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ttl', $data ?? [], null); + $this->setIfExists('fore', $data ?? [], null); + $this->setIfExists('initials', $data ?? [], null); + $this->setIfExists('sur', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ttl + * + * @return string|null + */ + public function getTtl(): ?string + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param string|null $ttl ttl + * + * @return $this + */ + public function setTtl(?string $ttl): static + { + if (is_null($ttl)) { + array_push($this->openAPINullablesSetToNull, 'ttl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ttl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ttl'] = $ttl; + + return $this; + } + + /** + * Gets fore + * + * @return string[]|null + */ + public function getFore(): ?array + { + return $this->container['fore']; + } + + /** + * Sets fore + * + * @param string[]|null $fore fore + * + * @return $this + */ + public function setFore(?array $fore): static + { + if (is_null($fore)) { + array_push($this->openAPINullablesSetToNull, 'fore'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fore', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fore'] = $fore; + + return $this; + } + + /** + * Gets initials + * + * @return string|null + */ + public function getInitials(): ?string + { + return $this->container['initials']; + } + + /** + * Sets initials + * + * @param string|null $initials initials + * + * @return $this + */ + public function setInitials(?string $initials): static + { + if (is_null($initials)) { + array_push($this->openAPINullablesSetToNull, 'initials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initials'] = $initials; + + return $this; + } + + /** + * Gets sur + * + * @return string|null + */ + public function getSur(): ?string + { + return $this->container['sur']; + } + + /** + * Sets sur + * + * @param string|null $sur sur + * + * @return $this + */ + public function setSur(?string $sur): static + { + if (is_null($sur)) { + array_push($this->openAPINullablesSetToNull, 'sur'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sur', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sur'] = $sur; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractShiftWorkingPatternDayRequest.php b/src/Model/ContractShiftWorkingPatternDayRequest.php new file mode 100644 index 0000000..8219e29 --- /dev/null +++ b/src/Model/ContractShiftWorkingPatternDayRequest.php @@ -0,0 +1,510 @@ + + */ +class ContractShiftWorkingPatternDayRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.ShiftWorkingPatternDayRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'day' => 'int', + 'isWorkingDay' => 'bool', + 'hours' => 'float', + 'workingPatternHoursType' => '\SynergiTech\Staffology\Model\WorkingPatternHoursType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'day' => 'int32', + 'isWorkingDay' => null, + 'hours' => 'double', + 'workingPatternHoursType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'day' => false, + 'isWorkingDay' => false, + 'hours' => false, + 'workingPatternHoursType' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'day' => 'day', + 'isWorkingDay' => 'isWorkingDay', + 'hours' => 'hours', + 'workingPatternHoursType' => 'workingPatternHoursType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'day' => 'setDay', + 'isWorkingDay' => 'setIsWorkingDay', + 'hours' => 'setHours', + 'workingPatternHoursType' => 'setWorkingPatternHoursType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'day' => 'getDay', + 'isWorkingDay' => 'getIsWorkingDay', + 'hours' => 'getHours', + 'workingPatternHoursType' => 'getWorkingPatternHoursType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('isWorkingDay', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('workingPatternHoursType', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets day + * + * @return int|null + */ + public function getDay(): ?int + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int|null $day day + * + * @return $this + */ + public function setDay(?int $day): static + { + if (is_null($day)) { + throw new InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets isWorkingDay + * + * @return bool|null + */ + public function getIsWorkingDay(): ?bool + { + return $this->container['isWorkingDay']; + } + + /** + * Sets isWorkingDay + * + * @param bool|null $isWorkingDay isWorkingDay + * + * @return $this + */ + public function setIsWorkingDay(?bool $isWorkingDay): static + { + if (is_null($isWorkingDay)) { + throw new InvalidArgumentException('non-nullable isWorkingDay cannot be null'); + } + $this->container['isWorkingDay'] = $isWorkingDay; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours hours + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets workingPatternHoursType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternHoursType|null + */ + public function getWorkingPatternHoursType(): ?\SynergiTech\Staffology\Model\WorkingPatternHoursType + { + return $this->container['workingPatternHoursType']; + } + + /** + * Sets workingPatternHoursType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternHoursType|null $workingPatternHoursType workingPatternHoursType + * + * @return $this + */ + public function setWorkingPatternHoursType(?\SynergiTech\Staffology\Model\WorkingPatternHoursType $workingPatternHoursType): static + { + if (is_null($workingPatternHoursType)) { + throw new InvalidArgumentException('non-nullable workingPatternHoursType cannot be null'); + } + $this->container['workingPatternHoursType'] = $workingPatternHoursType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractShiftWorkingPatternDayResponse.php b/src/Model/ContractShiftWorkingPatternDayResponse.php new file mode 100644 index 0000000..fff464b --- /dev/null +++ b/src/Model/ContractShiftWorkingPatternDayResponse.php @@ -0,0 +1,476 @@ + + */ +class ContractShiftWorkingPatternDayResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.ShiftWorkingPatternDayResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'day' => 'int', + 'isWorkingDay' => 'bool', + 'hours' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'day' => 'int32', + 'isWorkingDay' => null, + 'hours' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'day' => false, + 'isWorkingDay' => false, + 'hours' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'day' => 'day', + 'isWorkingDay' => 'isWorkingDay', + 'hours' => 'hours' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'day' => 'setDay', + 'isWorkingDay' => 'setIsWorkingDay', + 'hours' => 'setHours' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'day' => 'getDay', + 'isWorkingDay' => 'getIsWorkingDay', + 'hours' => 'getHours' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('isWorkingDay', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets day + * + * @return int|null + */ + public function getDay(): ?int + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int|null $day day + * + * @return $this + */ + public function setDay(?int $day): static + { + if (is_null($day)) { + throw new InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets isWorkingDay + * + * @return bool|null + */ + public function getIsWorkingDay(): ?bool + { + return $this->container['isWorkingDay']; + } + + /** + * Sets isWorkingDay + * + * @param bool|null $isWorkingDay isWorkingDay + * + * @return $this + */ + public function setIsWorkingDay(?bool $isWorkingDay): static + { + if (is_null($isWorkingDay)) { + throw new InvalidArgumentException('non-nullable isWorkingDay cannot be null'); + } + $this->container['isWorkingDay'] = $isWorkingDay; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours hours + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpinalPointRequest.php b/src/Model/ContractSpinalPointRequest.php new file mode 100644 index 0000000..1946cae --- /dev/null +++ b/src/Model/ContractSpinalPointRequest.php @@ -0,0 +1,796 @@ + + */ +class ContractSpinalPointRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpinalPointRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'number' => 'int', + 'annualValue' => 'float', + 'annualValueAltMax' => 'float', + 'annualValueLAInner' => 'float', + 'annualValueLAInnerAltMax' => 'float', + 'annualValueLAOuter' => 'float', + 'annualValueLAOuterAltMax' => 'float', + 'annualValueLAFringe' => 'float', + 'annualValueLAFringeAltMax' => 'float', + 'effectiveDate' => '\DateTime', + 'predecessorId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'number' => 'int32', + 'annualValue' => 'double', + 'annualValueAltMax' => 'double', + 'annualValueLAInner' => 'double', + 'annualValueLAInnerAltMax' => 'double', + 'annualValueLAOuter' => 'double', + 'annualValueLAOuterAltMax' => 'double', + 'annualValueLAFringe' => 'double', + 'annualValueLAFringeAltMax' => 'double', + 'effectiveDate' => 'date', + 'predecessorId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'number' => false, + 'annualValue' => false, + 'annualValueAltMax' => false, + 'annualValueLAInner' => false, + 'annualValueLAInnerAltMax' => false, + 'annualValueLAOuter' => false, + 'annualValueLAOuterAltMax' => false, + 'annualValueLAFringe' => false, + 'annualValueLAFringeAltMax' => false, + 'effectiveDate' => false, + 'predecessorId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'number' => 'number', + 'annualValue' => 'annualValue', + 'annualValueAltMax' => 'annualValueAltMax', + 'annualValueLAInner' => 'annualValueLAInner', + 'annualValueLAInnerAltMax' => 'annualValueLAInnerAltMax', + 'annualValueLAOuter' => 'annualValueLAOuter', + 'annualValueLAOuterAltMax' => 'annualValueLAOuterAltMax', + 'annualValueLAFringe' => 'annualValueLAFringe', + 'annualValueLAFringeAltMax' => 'annualValueLAFringeAltMax', + 'effectiveDate' => 'effectiveDate', + 'predecessorId' => 'predecessorId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'number' => 'setNumber', + 'annualValue' => 'setAnnualValue', + 'annualValueAltMax' => 'setAnnualValueAltMax', + 'annualValueLAInner' => 'setAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'setAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'setAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'setAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'setAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'setAnnualValueLAFringeAltMax', + 'effectiveDate' => 'setEffectiveDate', + 'predecessorId' => 'setPredecessorId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'number' => 'getNumber', + 'annualValue' => 'getAnnualValue', + 'annualValueAltMax' => 'getAnnualValueAltMax', + 'annualValueLAInner' => 'getAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'getAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'getAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'getAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'getAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'getAnnualValueLAFringeAltMax', + 'effectiveDate' => 'getEffectiveDate', + 'predecessorId' => 'getPredecessorId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('annualValueAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAInner', $data ?? [], null); + $this->setIfExists('annualValueLAInnerAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAOuter', $data ?? [], null); + $this->setIfExists('annualValueLAOuterAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAFringe', $data ?? [], null); + $this->setIfExists('annualValueLAFringeAltMax', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('predecessorId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Spinal Point + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets number + * + * @return int|null + */ + public function getNumber(): ?int + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param int|null $number Number of Spinal Point within the Scale + * + * @return $this + */ + public function setNumber(?int $number): static + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue Annual Value for the Spinal Point + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + throw new InvalidArgumentException('non-nullable annualValue cannot be null'); + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets annualValueAltMax + * + * @return float|null + */ + public function getAnnualValueAltMax(): ?float + { + return $this->container['annualValueAltMax']; + } + + /** + * Sets annualValueAltMax + * + * @param float|null $annualValueAltMax Annual Value for the Spinal Point (Alternative Max Value) + * + * @return $this + */ + public function setAnnualValueAltMax(?float $annualValueAltMax): static + { + if (is_null($annualValueAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueAltMax cannot be null'); + } + $this->container['annualValueAltMax'] = $annualValueAltMax; + + return $this; + } + + /** + * Gets annualValueLAInner + * + * @return float|null + */ + public function getAnnualValueLAInner(): ?float + { + return $this->container['annualValueLAInner']; + } + + /** + * Sets annualValueLAInner + * + * @param float|null $annualValueLAInner Annual Value for the Spinal Point Inner London Allowance + * + * @return $this + */ + public function setAnnualValueLAInner(?float $annualValueLAInner): static + { + if (is_null($annualValueLAInner)) { + throw new InvalidArgumentException('non-nullable annualValueLAInner cannot be null'); + } + $this->container['annualValueLAInner'] = $annualValueLAInner; + + return $this; + } + + /** + * Gets annualValueLAInnerAltMax + * + * @return float|null + */ + public function getAnnualValueLAInnerAltMax(): ?float + { + return $this->container['annualValueLAInnerAltMax']; + } + + /** + * Sets annualValueLAInnerAltMax + * + * @param float|null $annualValueLAInnerAltMax Annual Value for the Spinal Point Inner LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAInnerAltMax(?float $annualValueLAInnerAltMax): static + { + if (is_null($annualValueLAInnerAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAInnerAltMax cannot be null'); + } + $this->container['annualValueLAInnerAltMax'] = $annualValueLAInnerAltMax; + + return $this; + } + + /** + * Gets annualValueLAOuter + * + * @return float|null + */ + public function getAnnualValueLAOuter(): ?float + { + return $this->container['annualValueLAOuter']; + } + + /** + * Sets annualValueLAOuter + * + * @param float|null $annualValueLAOuter Annual Value for the Spinal Point Outer London Allowance + * + * @return $this + */ + public function setAnnualValueLAOuter(?float $annualValueLAOuter): static + { + if (is_null($annualValueLAOuter)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuter cannot be null'); + } + $this->container['annualValueLAOuter'] = $annualValueLAOuter; + + return $this; + } + + /** + * Gets annualValueLAOuterAltMax + * + * @return float|null + */ + public function getAnnualValueLAOuterAltMax(): ?float + { + return $this->container['annualValueLAOuterAltMax']; + } + + /** + * Sets annualValueLAOuterAltMax + * + * @param float|null $annualValueLAOuterAltMax Annual Value for the Spinal Point Outer LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAOuterAltMax(?float $annualValueLAOuterAltMax): static + { + if (is_null($annualValueLAOuterAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuterAltMax cannot be null'); + } + $this->container['annualValueLAOuterAltMax'] = $annualValueLAOuterAltMax; + + return $this; + } + + /** + * Gets annualValueLAFringe + * + * @return float|null + */ + public function getAnnualValueLAFringe(): ?float + { + return $this->container['annualValueLAFringe']; + } + + /** + * Sets annualValueLAFringe + * + * @param float|null $annualValueLAFringe Annual Value for the Spinal Point Fringe London Allowance + * + * @return $this + */ + public function setAnnualValueLAFringe(?float $annualValueLAFringe): static + { + if (is_null($annualValueLAFringe)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringe cannot be null'); + } + $this->container['annualValueLAFringe'] = $annualValueLAFringe; + + return $this; + } + + /** + * Gets annualValueLAFringeAltMax + * + * @return float|null + */ + public function getAnnualValueLAFringeAltMax(): ?float + { + return $this->container['annualValueLAFringeAltMax']; + } + + /** + * Sets annualValueLAFringeAltMax + * + * @param float|null $annualValueLAFringeAltMax Annual Value for the Spinal Point Fringe LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAFringeAltMax(?float $annualValueLAFringeAltMax): static + { + if (is_null($annualValueLAFringeAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringeAltMax cannot be null'); + } + $this->container['annualValueLAFringeAltMax'] = $annualValueLAFringeAltMax; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Date these rates became effective + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets predecessorId + * + * @return string|null + */ + public function getPredecessorId(): ?string + { + return $this->container['predecessorId']; + } + + /** + * Sets predecessorId + * + * @param string|null $predecessorId Spinal point predecessorId + * + * @return $this + */ + public function setPredecessorId(?string $predecessorId): static + { + if (is_null($predecessorId)) { + array_push($this->openAPINullablesSetToNull, 'predecessorId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('predecessorId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['predecessorId'] = $predecessorId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpinalPointResponse.php b/src/Model/ContractSpinalPointResponse.php new file mode 100644 index 0000000..8ab015a --- /dev/null +++ b/src/Model/ContractSpinalPointResponse.php @@ -0,0 +1,830 @@ + + */ +class ContractSpinalPointResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpinalPointResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'number' => 'int', + 'annualValue' => 'float', + 'annualValueAltMax' => 'float', + 'annualValueLAInner' => 'float', + 'annualValueLAInnerAltMax' => 'float', + 'annualValueLAOuter' => 'float', + 'annualValueLAOuterAltMax' => 'float', + 'annualValueLAFringe' => 'float', + 'annualValueLAFringeAltMax' => 'float', + 'effectiveDate' => '\DateTime', + 'predecessorId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'number' => 'int32', + 'annualValue' => 'double', + 'annualValueAltMax' => 'double', + 'annualValueLAInner' => 'double', + 'annualValueLAInnerAltMax' => 'double', + 'annualValueLAOuter' => 'double', + 'annualValueLAOuterAltMax' => 'double', + 'annualValueLAFringe' => 'double', + 'annualValueLAFringeAltMax' => 'double', + 'effectiveDate' => 'date', + 'predecessorId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'number' => false, + 'annualValue' => false, + 'annualValueAltMax' => false, + 'annualValueLAInner' => false, + 'annualValueLAInnerAltMax' => false, + 'annualValueLAOuter' => false, + 'annualValueLAOuterAltMax' => false, + 'annualValueLAFringe' => false, + 'annualValueLAFringeAltMax' => false, + 'effectiveDate' => false, + 'predecessorId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'number' => 'number', + 'annualValue' => 'annualValue', + 'annualValueAltMax' => 'annualValueAltMax', + 'annualValueLAInner' => 'annualValueLAInner', + 'annualValueLAInnerAltMax' => 'annualValueLAInnerAltMax', + 'annualValueLAOuter' => 'annualValueLAOuter', + 'annualValueLAOuterAltMax' => 'annualValueLAOuterAltMax', + 'annualValueLAFringe' => 'annualValueLAFringe', + 'annualValueLAFringeAltMax' => 'annualValueLAFringeAltMax', + 'effectiveDate' => 'effectiveDate', + 'predecessorId' => 'predecessorId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'number' => 'setNumber', + 'annualValue' => 'setAnnualValue', + 'annualValueAltMax' => 'setAnnualValueAltMax', + 'annualValueLAInner' => 'setAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'setAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'setAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'setAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'setAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'setAnnualValueLAFringeAltMax', + 'effectiveDate' => 'setEffectiveDate', + 'predecessorId' => 'setPredecessorId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'number' => 'getNumber', + 'annualValue' => 'getAnnualValue', + 'annualValueAltMax' => 'getAnnualValueAltMax', + 'annualValueLAInner' => 'getAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'getAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'getAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'getAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'getAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'getAnnualValueLAFringeAltMax', + 'effectiveDate' => 'getEffectiveDate', + 'predecessorId' => 'getPredecessorId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('annualValueAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAInner', $data ?? [], null); + $this->setIfExists('annualValueLAInnerAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAOuter', $data ?? [], null); + $this->setIfExists('annualValueLAOuterAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAFringe', $data ?? [], null); + $this->setIfExists('annualValueLAFringeAltMax', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('predecessorId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Spinal Point identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Spinal Point + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets number + * + * @return int|null + */ + public function getNumber(): ?int + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param int|null $number Number of Spinal Point within the Scale + * + * @return $this + */ + public function setNumber(?int $number): static + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue Annual Value for the Spinal Point + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + throw new InvalidArgumentException('non-nullable annualValue cannot be null'); + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets annualValueAltMax + * + * @return float|null + */ + public function getAnnualValueAltMax(): ?float + { + return $this->container['annualValueAltMax']; + } + + /** + * Sets annualValueAltMax + * + * @param float|null $annualValueAltMax Annual Value for the Spinal Point (Alternative Max Value) + * + * @return $this + */ + public function setAnnualValueAltMax(?float $annualValueAltMax): static + { + if (is_null($annualValueAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueAltMax cannot be null'); + } + $this->container['annualValueAltMax'] = $annualValueAltMax; + + return $this; + } + + /** + * Gets annualValueLAInner + * + * @return float|null + */ + public function getAnnualValueLAInner(): ?float + { + return $this->container['annualValueLAInner']; + } + + /** + * Sets annualValueLAInner + * + * @param float|null $annualValueLAInner Annual Value for the Spinal Point Inner London Allowance + * + * @return $this + */ + public function setAnnualValueLAInner(?float $annualValueLAInner): static + { + if (is_null($annualValueLAInner)) { + throw new InvalidArgumentException('non-nullable annualValueLAInner cannot be null'); + } + $this->container['annualValueLAInner'] = $annualValueLAInner; + + return $this; + } + + /** + * Gets annualValueLAInnerAltMax + * + * @return float|null + */ + public function getAnnualValueLAInnerAltMax(): ?float + { + return $this->container['annualValueLAInnerAltMax']; + } + + /** + * Sets annualValueLAInnerAltMax + * + * @param float|null $annualValueLAInnerAltMax Annual Value for the Spinal Point Inner LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAInnerAltMax(?float $annualValueLAInnerAltMax): static + { + if (is_null($annualValueLAInnerAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAInnerAltMax cannot be null'); + } + $this->container['annualValueLAInnerAltMax'] = $annualValueLAInnerAltMax; + + return $this; + } + + /** + * Gets annualValueLAOuter + * + * @return float|null + */ + public function getAnnualValueLAOuter(): ?float + { + return $this->container['annualValueLAOuter']; + } + + /** + * Sets annualValueLAOuter + * + * @param float|null $annualValueLAOuter Annual Value for the Spinal Point Outer London Allowance + * + * @return $this + */ + public function setAnnualValueLAOuter(?float $annualValueLAOuter): static + { + if (is_null($annualValueLAOuter)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuter cannot be null'); + } + $this->container['annualValueLAOuter'] = $annualValueLAOuter; + + return $this; + } + + /** + * Gets annualValueLAOuterAltMax + * + * @return float|null + */ + public function getAnnualValueLAOuterAltMax(): ?float + { + return $this->container['annualValueLAOuterAltMax']; + } + + /** + * Sets annualValueLAOuterAltMax + * + * @param float|null $annualValueLAOuterAltMax Annual Value for the Spinal Point Outer LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAOuterAltMax(?float $annualValueLAOuterAltMax): static + { + if (is_null($annualValueLAOuterAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuterAltMax cannot be null'); + } + $this->container['annualValueLAOuterAltMax'] = $annualValueLAOuterAltMax; + + return $this; + } + + /** + * Gets annualValueLAFringe + * + * @return float|null + */ + public function getAnnualValueLAFringe(): ?float + { + return $this->container['annualValueLAFringe']; + } + + /** + * Sets annualValueLAFringe + * + * @param float|null $annualValueLAFringe Annual Value for the Spinal Point Fringe London Allowance + * + * @return $this + */ + public function setAnnualValueLAFringe(?float $annualValueLAFringe): static + { + if (is_null($annualValueLAFringe)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringe cannot be null'); + } + $this->container['annualValueLAFringe'] = $annualValueLAFringe; + + return $this; + } + + /** + * Gets annualValueLAFringeAltMax + * + * @return float|null + */ + public function getAnnualValueLAFringeAltMax(): ?float + { + return $this->container['annualValueLAFringeAltMax']; + } + + /** + * Sets annualValueLAFringeAltMax + * + * @param float|null $annualValueLAFringeAltMax Annual Value for the Spinal Point Fringe LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAFringeAltMax(?float $annualValueLAFringeAltMax): static + { + if (is_null($annualValueLAFringeAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringeAltMax cannot be null'); + } + $this->container['annualValueLAFringeAltMax'] = $annualValueLAFringeAltMax; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Date these rates became effective + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets predecessorId + * + * @return string|null + */ + public function getPredecessorId(): ?string + { + return $this->container['predecessorId']; + } + + /** + * Sets predecessorId + * + * @param string|null $predecessorId Spinal point predecessorId + * + * @return $this + */ + public function setPredecessorId(?string $predecessorId): static + { + if (is_null($predecessorId)) { + array_push($this->openAPINullablesSetToNull, 'predecessorId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('predecessorId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['predecessorId'] = $predecessorId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpinalPointUpdateRequest.php b/src/Model/ContractSpinalPointUpdateRequest.php new file mode 100644 index 0000000..cbb4aa9 --- /dev/null +++ b/src/Model/ContractSpinalPointUpdateRequest.php @@ -0,0 +1,830 @@ + + */ +class ContractSpinalPointUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpinalPointUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'name' => 'string', + 'number' => 'int', + 'annualValue' => 'float', + 'annualValueAltMax' => 'float', + 'annualValueLAInner' => 'float', + 'annualValueLAInnerAltMax' => 'float', + 'annualValueLAOuter' => 'float', + 'annualValueLAOuterAltMax' => 'float', + 'annualValueLAFringe' => 'float', + 'annualValueLAFringeAltMax' => 'float', + 'effectiveDate' => '\DateTime', + 'predecessorId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'name' => null, + 'number' => 'int32', + 'annualValue' => 'double', + 'annualValueAltMax' => 'double', + 'annualValueLAInner' => 'double', + 'annualValueLAInnerAltMax' => 'double', + 'annualValueLAOuter' => 'double', + 'annualValueLAOuterAltMax' => 'double', + 'annualValueLAFringe' => 'double', + 'annualValueLAFringeAltMax' => 'double', + 'effectiveDate' => 'date', + 'predecessorId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'name' => true, + 'number' => false, + 'annualValue' => false, + 'annualValueAltMax' => false, + 'annualValueLAInner' => false, + 'annualValueLAInnerAltMax' => false, + 'annualValueLAOuter' => false, + 'annualValueLAOuterAltMax' => false, + 'annualValueLAFringe' => false, + 'annualValueLAFringeAltMax' => false, + 'effectiveDate' => false, + 'predecessorId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'name' => 'name', + 'number' => 'number', + 'annualValue' => 'annualValue', + 'annualValueAltMax' => 'annualValueAltMax', + 'annualValueLAInner' => 'annualValueLAInner', + 'annualValueLAInnerAltMax' => 'annualValueLAInnerAltMax', + 'annualValueLAOuter' => 'annualValueLAOuter', + 'annualValueLAOuterAltMax' => 'annualValueLAOuterAltMax', + 'annualValueLAFringe' => 'annualValueLAFringe', + 'annualValueLAFringeAltMax' => 'annualValueLAFringeAltMax', + 'effectiveDate' => 'effectiveDate', + 'predecessorId' => 'predecessorId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'name' => 'setName', + 'number' => 'setNumber', + 'annualValue' => 'setAnnualValue', + 'annualValueAltMax' => 'setAnnualValueAltMax', + 'annualValueLAInner' => 'setAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'setAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'setAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'setAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'setAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'setAnnualValueLAFringeAltMax', + 'effectiveDate' => 'setEffectiveDate', + 'predecessorId' => 'setPredecessorId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'name' => 'getName', + 'number' => 'getNumber', + 'annualValue' => 'getAnnualValue', + 'annualValueAltMax' => 'getAnnualValueAltMax', + 'annualValueLAInner' => 'getAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'getAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'getAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'getAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'getAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'getAnnualValueLAFringeAltMax', + 'effectiveDate' => 'getEffectiveDate', + 'predecessorId' => 'getPredecessorId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('annualValueAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAInner', $data ?? [], null); + $this->setIfExists('annualValueLAInnerAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAOuter', $data ?? [], null); + $this->setIfExists('annualValueLAOuterAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAFringe', $data ?? [], null); + $this->setIfExists('annualValueLAFringeAltMax', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('predecessorId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId uniqueId + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the Spinal Point + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets number + * + * @return int|null + */ + public function getNumber(): ?int + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param int|null $number Number of Spinal Point within the Scale + * + * @return $this + */ + public function setNumber(?int $number): static + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue Annual Value for the Spinal Point + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + throw new InvalidArgumentException('non-nullable annualValue cannot be null'); + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets annualValueAltMax + * + * @return float|null + */ + public function getAnnualValueAltMax(): ?float + { + return $this->container['annualValueAltMax']; + } + + /** + * Sets annualValueAltMax + * + * @param float|null $annualValueAltMax Annual Value for the Spinal Point (Alternative Max Value) + * + * @return $this + */ + public function setAnnualValueAltMax(?float $annualValueAltMax): static + { + if (is_null($annualValueAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueAltMax cannot be null'); + } + $this->container['annualValueAltMax'] = $annualValueAltMax; + + return $this; + } + + /** + * Gets annualValueLAInner + * + * @return float|null + */ + public function getAnnualValueLAInner(): ?float + { + return $this->container['annualValueLAInner']; + } + + /** + * Sets annualValueLAInner + * + * @param float|null $annualValueLAInner Annual Value for the Spinal Point Inner London Allowance + * + * @return $this + */ + public function setAnnualValueLAInner(?float $annualValueLAInner): static + { + if (is_null($annualValueLAInner)) { + throw new InvalidArgumentException('non-nullable annualValueLAInner cannot be null'); + } + $this->container['annualValueLAInner'] = $annualValueLAInner; + + return $this; + } + + /** + * Gets annualValueLAInnerAltMax + * + * @return float|null + */ + public function getAnnualValueLAInnerAltMax(): ?float + { + return $this->container['annualValueLAInnerAltMax']; + } + + /** + * Sets annualValueLAInnerAltMax + * + * @param float|null $annualValueLAInnerAltMax Annual Value for the Spinal Point Inner LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAInnerAltMax(?float $annualValueLAInnerAltMax): static + { + if (is_null($annualValueLAInnerAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAInnerAltMax cannot be null'); + } + $this->container['annualValueLAInnerAltMax'] = $annualValueLAInnerAltMax; + + return $this; + } + + /** + * Gets annualValueLAOuter + * + * @return float|null + */ + public function getAnnualValueLAOuter(): ?float + { + return $this->container['annualValueLAOuter']; + } + + /** + * Sets annualValueLAOuter + * + * @param float|null $annualValueLAOuter Annual Value for the Spinal Point Outer London Allowance + * + * @return $this + */ + public function setAnnualValueLAOuter(?float $annualValueLAOuter): static + { + if (is_null($annualValueLAOuter)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuter cannot be null'); + } + $this->container['annualValueLAOuter'] = $annualValueLAOuter; + + return $this; + } + + /** + * Gets annualValueLAOuterAltMax + * + * @return float|null + */ + public function getAnnualValueLAOuterAltMax(): ?float + { + return $this->container['annualValueLAOuterAltMax']; + } + + /** + * Sets annualValueLAOuterAltMax + * + * @param float|null $annualValueLAOuterAltMax Annual Value for the Spinal Point Outer LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAOuterAltMax(?float $annualValueLAOuterAltMax): static + { + if (is_null($annualValueLAOuterAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAOuterAltMax cannot be null'); + } + $this->container['annualValueLAOuterAltMax'] = $annualValueLAOuterAltMax; + + return $this; + } + + /** + * Gets annualValueLAFringe + * + * @return float|null + */ + public function getAnnualValueLAFringe(): ?float + { + return $this->container['annualValueLAFringe']; + } + + /** + * Sets annualValueLAFringe + * + * @param float|null $annualValueLAFringe Annual Value for the Spinal Point Fringe London Allowance + * + * @return $this + */ + public function setAnnualValueLAFringe(?float $annualValueLAFringe): static + { + if (is_null($annualValueLAFringe)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringe cannot be null'); + } + $this->container['annualValueLAFringe'] = $annualValueLAFringe; + + return $this; + } + + /** + * Gets annualValueLAFringeAltMax + * + * @return float|null + */ + public function getAnnualValueLAFringeAltMax(): ?float + { + return $this->container['annualValueLAFringeAltMax']; + } + + /** + * Sets annualValueLAFringeAltMax + * + * @param float|null $annualValueLAFringeAltMax Annual Value for the Spinal Point Fringe LA (Alt Max Value) + * + * @return $this + */ + public function setAnnualValueLAFringeAltMax(?float $annualValueLAFringeAltMax): static + { + if (is_null($annualValueLAFringeAltMax)) { + throw new InvalidArgumentException('non-nullable annualValueLAFringeAltMax cannot be null'); + } + $this->container['annualValueLAFringeAltMax'] = $annualValueLAFringeAltMax; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Date these rates became effective + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets predecessorId + * + * @return string|null + */ + public function getPredecessorId(): ?string + { + return $this->container['predecessorId']; + } + + /** + * Sets predecessorId + * + * @param string|null $predecessorId Spinal point predecessorId + * + * @return $this + */ + public function setPredecessorId(?string $predecessorId): static + { + if (is_null($predecessorId)) { + array_push($this->openAPINullablesSetToNull, 'predecessorId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('predecessorId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['predecessorId'] = $predecessorId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpineAllowanceRequest.php b/src/Model/ContractSpineAllowanceRequest.php new file mode 100644 index 0000000..7805381 --- /dev/null +++ b/src/Model/ContractSpineAllowanceRequest.php @@ -0,0 +1,701 @@ + + */ +class ContractSpineAllowanceRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpineAllowanceRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowanceName' => 'string', + 'allowanceType' => '\SynergiTech\Staffology\Model\AllowanceType', + 'allowanceUsualAnnualValue' => 'float', + 'allowanceRangeLowerValue' => 'float', + 'allowanceRangeUpperValue' => 'float', + 'allowanceEffectiveDate' => '\DateTime', + 'allowanceAlwaysFTE' => 'bool', + 'payCode' => 'string', + 'payCodeTitle' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowanceName' => null, + 'allowanceType' => null, + 'allowanceUsualAnnualValue' => 'double', + 'allowanceRangeLowerValue' => 'double', + 'allowanceRangeUpperValue' => 'double', + 'allowanceEffectiveDate' => 'date', + 'allowanceAlwaysFTE' => null, + 'payCode' => null, + 'payCodeTitle' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowanceName' => true, + 'allowanceType' => false, + 'allowanceUsualAnnualValue' => false, + 'allowanceRangeLowerValue' => false, + 'allowanceRangeUpperValue' => false, + 'allowanceEffectiveDate' => false, + 'allowanceAlwaysFTE' => false, + 'payCode' => true, + 'payCodeTitle' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowanceName' => 'allowanceName', + 'allowanceType' => 'allowanceType', + 'allowanceUsualAnnualValue' => 'allowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'allowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'allowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'allowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'allowanceAlwaysFTE', + 'payCode' => 'payCode', + 'payCodeTitle' => 'payCodeTitle' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowanceName' => 'setAllowanceName', + 'allowanceType' => 'setAllowanceType', + 'allowanceUsualAnnualValue' => 'setAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'setAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'setAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'setAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'setAllowanceAlwaysFTE', + 'payCode' => 'setPayCode', + 'payCodeTitle' => 'setPayCodeTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowanceName' => 'getAllowanceName', + 'allowanceType' => 'getAllowanceType', + 'allowanceUsualAnnualValue' => 'getAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'getAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'getAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'getAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'getAllowanceAlwaysFTE', + 'payCode' => 'getPayCode', + 'payCodeTitle' => 'getPayCodeTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowanceName', $data ?? [], null); + $this->setIfExists('allowanceType', $data ?? [], null); + $this->setIfExists('allowanceUsualAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceRangeLowerValue', $data ?? [], null); + $this->setIfExists('allowanceRangeUpperValue', $data ?? [], null); + $this->setIfExists('allowanceEffectiveDate', $data ?? [], null); + $this->setIfExists('allowanceAlwaysFTE', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('payCodeTitle', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Name of Allowance + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + + /** + * Gets allowanceType + * + * @return \SynergiTech\Staffology\Model\AllowanceType|null + */ + public function getAllowanceType(): ?\SynergiTech\Staffology\Model\AllowanceType + { + return $this->container['allowanceType']; + } + + /** + * Sets allowanceType + * + * @param \SynergiTech\Staffology\Model\AllowanceType|null $allowanceType allowanceType + * + * @return $this + */ + public function setAllowanceType(?\SynergiTech\Staffology\Model\AllowanceType $allowanceType): static + { + if (is_null($allowanceType)) { + throw new InvalidArgumentException('non-nullable allowanceType cannot be null'); + } + $this->container['allowanceType'] = $allowanceType; + + return $this; + } + + /** + * Gets allowanceUsualAnnualValue + * + * @return float|null + */ + public function getAllowanceUsualAnnualValue(): ?float + { + return $this->container['allowanceUsualAnnualValue']; + } + + /** + * Sets allowanceUsualAnnualValue + * + * @param float|null $allowanceUsualAnnualValue Value of Allowance Usual Annual + * + * @return $this + */ + public function setAllowanceUsualAnnualValue(?float $allowanceUsualAnnualValue): static + { + if (is_null($allowanceUsualAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceUsualAnnualValue cannot be null'); + } + $this->container['allowanceUsualAnnualValue'] = $allowanceUsualAnnualValue; + + return $this; + } + + /** + * Gets allowanceRangeLowerValue + * + * @return float|null + */ + public function getAllowanceRangeLowerValue(): ?float + { + return $this->container['allowanceRangeLowerValue']; + } + + /** + * Sets allowanceRangeLowerValue + * + * @param float|null $allowanceRangeLowerValue Value of Allowance Range Lower + * + * @return $this + */ + public function setAllowanceRangeLowerValue(?float $allowanceRangeLowerValue): static + { + if (is_null($allowanceRangeLowerValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeLowerValue cannot be null'); + } + $this->container['allowanceRangeLowerValue'] = $allowanceRangeLowerValue; + + return $this; + } + + /** + * Gets allowanceRangeUpperValue + * + * @return float|null + */ + public function getAllowanceRangeUpperValue(): ?float + { + return $this->container['allowanceRangeUpperValue']; + } + + /** + * Sets allowanceRangeUpperValue + * + * @param float|null $allowanceRangeUpperValue Value of Allowance Range Upper + * + * @return $this + */ + public function setAllowanceRangeUpperValue(?float $allowanceRangeUpperValue): static + { + if (is_null($allowanceRangeUpperValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeUpperValue cannot be null'); + } + $this->container['allowanceRangeUpperValue'] = $allowanceRangeUpperValue; + + return $this; + } + + /** + * Gets allowanceEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceEffectiveDate(): ?\DateTime + { + return $this->container['allowanceEffectiveDate']; + } + + /** + * Sets allowanceEffectiveDate + * + * @param \DateTime|null $allowanceEffectiveDate Allowance Effective Date + * + * @return $this + */ + public function setAllowanceEffectiveDate(?\DateTime $allowanceEffectiveDate): static + { + if (is_null($allowanceEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceEffectiveDate cannot be null'); + } + $this->container['allowanceEffectiveDate'] = $allowanceEffectiveDate; + + return $this; + } + + /** + * Gets allowanceAlwaysFTE + * + * @return bool|null + */ + public function getAllowanceAlwaysFTE(): ?bool + { + return $this->container['allowanceAlwaysFTE']; + } + + /** + * Sets allowanceAlwaysFTE + * + * @param bool|null $allowanceAlwaysFTE Allowance Always FTE or Not + * + * @return $this + */ + public function setAllowanceAlwaysFTE(?bool $allowanceAlwaysFTE): static + { + if (is_null($allowanceAlwaysFTE)) { + throw new InvalidArgumentException('non-nullable allowanceAlwaysFTE cannot be null'); + } + $this->container['allowanceAlwaysFTE'] = $allowanceAlwaysFTE; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode Pay Code + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets payCodeTitle + * + * @return string|null + */ + public function getPayCodeTitle(): ?string + { + return $this->container['payCodeTitle']; + } + + /** + * Sets payCodeTitle + * + * @param string|null $payCodeTitle Pay Code Title + * + * @return $this + */ + public function setPayCodeTitle(?string $payCodeTitle): static + { + if (is_null($payCodeTitle)) { + array_push($this->openAPINullablesSetToNull, 'payCodeTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeTitle'] = $payCodeTitle; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpineAllowanceResponse.php b/src/Model/ContractSpineAllowanceResponse.php new file mode 100644 index 0000000..af83de6 --- /dev/null +++ b/src/Model/ContractSpineAllowanceResponse.php @@ -0,0 +1,735 @@ + + */ +class ContractSpineAllowanceResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpineAllowanceResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowanceName' => 'string', + 'allowanceType' => '\SynergiTech\Staffology\Model\AllowanceType', + 'allowanceUsualAnnualValue' => 'float', + 'allowanceRangeLowerValue' => 'float', + 'allowanceRangeUpperValue' => 'float', + 'allowanceEffectiveDate' => '\DateTime', + 'allowanceAlwaysFTE' => 'bool', + 'uniqueId' => 'string', + 'payCode' => 'string', + 'payCodeTitle' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowanceName' => null, + 'allowanceType' => null, + 'allowanceUsualAnnualValue' => 'double', + 'allowanceRangeLowerValue' => 'double', + 'allowanceRangeUpperValue' => 'double', + 'allowanceEffectiveDate' => 'date', + 'allowanceAlwaysFTE' => null, + 'uniqueId' => 'uuid', + 'payCode' => null, + 'payCodeTitle' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowanceName' => true, + 'allowanceType' => false, + 'allowanceUsualAnnualValue' => false, + 'allowanceRangeLowerValue' => false, + 'allowanceRangeUpperValue' => false, + 'allowanceEffectiveDate' => false, + 'allowanceAlwaysFTE' => false, + 'uniqueId' => false, + 'payCode' => true, + 'payCodeTitle' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowanceName' => 'allowanceName', + 'allowanceType' => 'allowanceType', + 'allowanceUsualAnnualValue' => 'allowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'allowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'allowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'allowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'allowanceAlwaysFTE', + 'uniqueId' => 'uniqueId', + 'payCode' => 'payCode', + 'payCodeTitle' => 'payCodeTitle' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowanceName' => 'setAllowanceName', + 'allowanceType' => 'setAllowanceType', + 'allowanceUsualAnnualValue' => 'setAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'setAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'setAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'setAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'setAllowanceAlwaysFTE', + 'uniqueId' => 'setUniqueId', + 'payCode' => 'setPayCode', + 'payCodeTitle' => 'setPayCodeTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowanceName' => 'getAllowanceName', + 'allowanceType' => 'getAllowanceType', + 'allowanceUsualAnnualValue' => 'getAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'getAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'getAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'getAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'getAllowanceAlwaysFTE', + 'uniqueId' => 'getUniqueId', + 'payCode' => 'getPayCode', + 'payCodeTitle' => 'getPayCodeTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowanceName', $data ?? [], null); + $this->setIfExists('allowanceType', $data ?? [], null); + $this->setIfExists('allowanceUsualAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceRangeLowerValue', $data ?? [], null); + $this->setIfExists('allowanceRangeUpperValue', $data ?? [], null); + $this->setIfExists('allowanceEffectiveDate', $data ?? [], null); + $this->setIfExists('allowanceAlwaysFTE', $data ?? [], null); + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('payCodeTitle', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Name of Allowance + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + + /** + * Gets allowanceType + * + * @return \SynergiTech\Staffology\Model\AllowanceType|null + */ + public function getAllowanceType(): ?\SynergiTech\Staffology\Model\AllowanceType + { + return $this->container['allowanceType']; + } + + /** + * Sets allowanceType + * + * @param \SynergiTech\Staffology\Model\AllowanceType|null $allowanceType allowanceType + * + * @return $this + */ + public function setAllowanceType(?\SynergiTech\Staffology\Model\AllowanceType $allowanceType): static + { + if (is_null($allowanceType)) { + throw new InvalidArgumentException('non-nullable allowanceType cannot be null'); + } + $this->container['allowanceType'] = $allowanceType; + + return $this; + } + + /** + * Gets allowanceUsualAnnualValue + * + * @return float|null + */ + public function getAllowanceUsualAnnualValue(): ?float + { + return $this->container['allowanceUsualAnnualValue']; + } + + /** + * Sets allowanceUsualAnnualValue + * + * @param float|null $allowanceUsualAnnualValue Value of Allowance Usual Annual + * + * @return $this + */ + public function setAllowanceUsualAnnualValue(?float $allowanceUsualAnnualValue): static + { + if (is_null($allowanceUsualAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceUsualAnnualValue cannot be null'); + } + $this->container['allowanceUsualAnnualValue'] = $allowanceUsualAnnualValue; + + return $this; + } + + /** + * Gets allowanceRangeLowerValue + * + * @return float|null + */ + public function getAllowanceRangeLowerValue(): ?float + { + return $this->container['allowanceRangeLowerValue']; + } + + /** + * Sets allowanceRangeLowerValue + * + * @param float|null $allowanceRangeLowerValue Value of Allowance Range Lower + * + * @return $this + */ + public function setAllowanceRangeLowerValue(?float $allowanceRangeLowerValue): static + { + if (is_null($allowanceRangeLowerValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeLowerValue cannot be null'); + } + $this->container['allowanceRangeLowerValue'] = $allowanceRangeLowerValue; + + return $this; + } + + /** + * Gets allowanceRangeUpperValue + * + * @return float|null + */ + public function getAllowanceRangeUpperValue(): ?float + { + return $this->container['allowanceRangeUpperValue']; + } + + /** + * Sets allowanceRangeUpperValue + * + * @param float|null $allowanceRangeUpperValue Value of Allowance Range Upper + * + * @return $this + */ + public function setAllowanceRangeUpperValue(?float $allowanceRangeUpperValue): static + { + if (is_null($allowanceRangeUpperValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeUpperValue cannot be null'); + } + $this->container['allowanceRangeUpperValue'] = $allowanceRangeUpperValue; + + return $this; + } + + /** + * Gets allowanceEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceEffectiveDate(): ?\DateTime + { + return $this->container['allowanceEffectiveDate']; + } + + /** + * Sets allowanceEffectiveDate + * + * @param \DateTime|null $allowanceEffectiveDate Allowance Effective Date + * + * @return $this + */ + public function setAllowanceEffectiveDate(?\DateTime $allowanceEffectiveDate): static + { + if (is_null($allowanceEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceEffectiveDate cannot be null'); + } + $this->container['allowanceEffectiveDate'] = $allowanceEffectiveDate; + + return $this; + } + + /** + * Gets allowanceAlwaysFTE + * + * @return bool|null + */ + public function getAllowanceAlwaysFTE(): ?bool + { + return $this->container['allowanceAlwaysFTE']; + } + + /** + * Sets allowanceAlwaysFTE + * + * @param bool|null $allowanceAlwaysFTE Allowance Always FTE or Not + * + * @return $this + */ + public function setAllowanceAlwaysFTE(?bool $allowanceAlwaysFTE): static + { + if (is_null($allowanceAlwaysFTE)) { + throw new InvalidArgumentException('non-nullable allowanceAlwaysFTE cannot be null'); + } + $this->container['allowanceAlwaysFTE'] = $allowanceAlwaysFTE; + + return $this; + } + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Spine Allowance identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode Pay Code + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets payCodeTitle + * + * @return string|null + */ + public function getPayCodeTitle(): ?string + { + return $this->container['payCodeTitle']; + } + + /** + * Sets payCodeTitle + * + * @param string|null $payCodeTitle Pay Code Title + * + * @return $this + */ + public function setPayCodeTitle(?string $payCodeTitle): static + { + if (is_null($payCodeTitle)) { + array_push($this->openAPINullablesSetToNull, 'payCodeTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeTitle'] = $payCodeTitle; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractSpineAllowanceUpdateRequest.php b/src/Model/ContractSpineAllowanceUpdateRequest.php new file mode 100644 index 0000000..c2898b0 --- /dev/null +++ b/src/Model/ContractSpineAllowanceUpdateRequest.php @@ -0,0 +1,735 @@ + + */ +class ContractSpineAllowanceUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.SpineAllowanceUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'allowanceName' => 'string', + 'allowanceType' => '\SynergiTech\Staffology\Model\AllowanceType', + 'allowanceUsualAnnualValue' => 'float', + 'allowanceRangeLowerValue' => 'float', + 'allowanceRangeUpperValue' => 'float', + 'allowanceEffectiveDate' => '\DateTime', + 'allowanceAlwaysFTE' => 'bool', + 'payCode' => 'string', + 'payCodeTitle' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'allowanceName' => null, + 'allowanceType' => null, + 'allowanceUsualAnnualValue' => 'double', + 'allowanceRangeLowerValue' => 'double', + 'allowanceRangeUpperValue' => 'double', + 'allowanceEffectiveDate' => 'date', + 'allowanceAlwaysFTE' => null, + 'payCode' => null, + 'payCodeTitle' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'allowanceName' => true, + 'allowanceType' => false, + 'allowanceUsualAnnualValue' => false, + 'allowanceRangeLowerValue' => false, + 'allowanceRangeUpperValue' => false, + 'allowanceEffectiveDate' => false, + 'allowanceAlwaysFTE' => false, + 'payCode' => true, + 'payCodeTitle' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'allowanceName' => 'allowanceName', + 'allowanceType' => 'allowanceType', + 'allowanceUsualAnnualValue' => 'allowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'allowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'allowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'allowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'allowanceAlwaysFTE', + 'payCode' => 'payCode', + 'payCodeTitle' => 'payCodeTitle' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'allowanceName' => 'setAllowanceName', + 'allowanceType' => 'setAllowanceType', + 'allowanceUsualAnnualValue' => 'setAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'setAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'setAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'setAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'setAllowanceAlwaysFTE', + 'payCode' => 'setPayCode', + 'payCodeTitle' => 'setPayCodeTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'allowanceName' => 'getAllowanceName', + 'allowanceType' => 'getAllowanceType', + 'allowanceUsualAnnualValue' => 'getAllowanceUsualAnnualValue', + 'allowanceRangeLowerValue' => 'getAllowanceRangeLowerValue', + 'allowanceRangeUpperValue' => 'getAllowanceRangeUpperValue', + 'allowanceEffectiveDate' => 'getAllowanceEffectiveDate', + 'allowanceAlwaysFTE' => 'getAllowanceAlwaysFTE', + 'payCode' => 'getPayCode', + 'payCodeTitle' => 'getPayCodeTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('allowanceName', $data ?? [], null); + $this->setIfExists('allowanceType', $data ?? [], null); + $this->setIfExists('allowanceUsualAnnualValue', $data ?? [], null); + $this->setIfExists('allowanceRangeLowerValue', $data ?? [], null); + $this->setIfExists('allowanceRangeUpperValue', $data ?? [], null); + $this->setIfExists('allowanceEffectiveDate', $data ?? [], null); + $this->setIfExists('allowanceAlwaysFTE', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('payCodeTitle', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Spine Allowance identifier + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets allowanceName + * + * @return string|null + */ + public function getAllowanceName(): ?string + { + return $this->container['allowanceName']; + } + + /** + * Sets allowanceName + * + * @param string|null $allowanceName Name of Allowance + * + * @return $this + */ + public function setAllowanceName(?string $allowanceName): static + { + if (is_null($allowanceName)) { + array_push($this->openAPINullablesSetToNull, 'allowanceName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceName'] = $allowanceName; + + return $this; + } + + /** + * Gets allowanceType + * + * @return \SynergiTech\Staffology\Model\AllowanceType|null + */ + public function getAllowanceType(): ?\SynergiTech\Staffology\Model\AllowanceType + { + return $this->container['allowanceType']; + } + + /** + * Sets allowanceType + * + * @param \SynergiTech\Staffology\Model\AllowanceType|null $allowanceType allowanceType + * + * @return $this + */ + public function setAllowanceType(?\SynergiTech\Staffology\Model\AllowanceType $allowanceType): static + { + if (is_null($allowanceType)) { + throw new InvalidArgumentException('non-nullable allowanceType cannot be null'); + } + $this->container['allowanceType'] = $allowanceType; + + return $this; + } + + /** + * Gets allowanceUsualAnnualValue + * + * @return float|null + */ + public function getAllowanceUsualAnnualValue(): ?float + { + return $this->container['allowanceUsualAnnualValue']; + } + + /** + * Sets allowanceUsualAnnualValue + * + * @param float|null $allowanceUsualAnnualValue Value of Allowance Usual Annual + * + * @return $this + */ + public function setAllowanceUsualAnnualValue(?float $allowanceUsualAnnualValue): static + { + if (is_null($allowanceUsualAnnualValue)) { + throw new InvalidArgumentException('non-nullable allowanceUsualAnnualValue cannot be null'); + } + $this->container['allowanceUsualAnnualValue'] = $allowanceUsualAnnualValue; + + return $this; + } + + /** + * Gets allowanceRangeLowerValue + * + * @return float|null + */ + public function getAllowanceRangeLowerValue(): ?float + { + return $this->container['allowanceRangeLowerValue']; + } + + /** + * Sets allowanceRangeLowerValue + * + * @param float|null $allowanceRangeLowerValue Value of Allowance Range Lower + * + * @return $this + */ + public function setAllowanceRangeLowerValue(?float $allowanceRangeLowerValue): static + { + if (is_null($allowanceRangeLowerValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeLowerValue cannot be null'); + } + $this->container['allowanceRangeLowerValue'] = $allowanceRangeLowerValue; + + return $this; + } + + /** + * Gets allowanceRangeUpperValue + * + * @return float|null + */ + public function getAllowanceRangeUpperValue(): ?float + { + return $this->container['allowanceRangeUpperValue']; + } + + /** + * Sets allowanceRangeUpperValue + * + * @param float|null $allowanceRangeUpperValue Value of Allowance Range Upper + * + * @return $this + */ + public function setAllowanceRangeUpperValue(?float $allowanceRangeUpperValue): static + { + if (is_null($allowanceRangeUpperValue)) { + throw new InvalidArgumentException('non-nullable allowanceRangeUpperValue cannot be null'); + } + $this->container['allowanceRangeUpperValue'] = $allowanceRangeUpperValue; + + return $this; + } + + /** + * Gets allowanceEffectiveDate + * + * @return \DateTime|null + */ + public function getAllowanceEffectiveDate(): ?\DateTime + { + return $this->container['allowanceEffectiveDate']; + } + + /** + * Sets allowanceEffectiveDate + * + * @param \DateTime|null $allowanceEffectiveDate Allowance Effective Date + * + * @return $this + */ + public function setAllowanceEffectiveDate(?\DateTime $allowanceEffectiveDate): static + { + if (is_null($allowanceEffectiveDate)) { + throw new InvalidArgumentException('non-nullable allowanceEffectiveDate cannot be null'); + } + $this->container['allowanceEffectiveDate'] = $allowanceEffectiveDate; + + return $this; + } + + /** + * Gets allowanceAlwaysFTE + * + * @return bool|null + */ + public function getAllowanceAlwaysFTE(): ?bool + { + return $this->container['allowanceAlwaysFTE']; + } + + /** + * Sets allowanceAlwaysFTE + * + * @param bool|null $allowanceAlwaysFTE Allowance Always FTE or Not + * + * @return $this + */ + public function setAllowanceAlwaysFTE(?bool $allowanceAlwaysFTE): static + { + if (is_null($allowanceAlwaysFTE)) { + throw new InvalidArgumentException('non-nullable allowanceAlwaysFTE cannot be null'); + } + $this->container['allowanceAlwaysFTE'] = $allowanceAlwaysFTE; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode Pay Code + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets payCodeTitle + * + * @return string|null + */ + public function getPayCodeTitle(): ?string + { + return $this->container['payCodeTitle']; + } + + /** + * Sets payCodeTitle + * + * @param string|null $payCodeTitle Pay Code Title + * + * @return $this + */ + public function setPayCodeTitle(?string $payCodeTitle): static + { + if (is_null($payCodeTitle)) { + array_push($this->openAPINullablesSetToNull, 'payCodeTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeTitle'] = $payCodeTitle; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractStarterDetails.php b/src/Model/ContractStarterDetails.php new file mode 100644 index 0000000..844b934 --- /dev/null +++ b/src/Model/ContractStarterDetails.php @@ -0,0 +1,516 @@ + + */ +class ContractStarterDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.StarterDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'startDate' => '\DateTime', + 'starterDeclaration' => '\SynergiTech\Staffology\Model\StarterDeclaration', + 'overseasEmployerDetails' => '\SynergiTech\Staffology\Model\ContractOverseasEmployerDetails', + 'pensionerPayroll' => '\SynergiTech\Staffology\Model\ContractPensionerPayroll' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'startDate' => 'date', + 'starterDeclaration' => null, + 'overseasEmployerDetails' => null, + 'pensionerPayroll' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'startDate' => false, + 'starterDeclaration' => false, + 'overseasEmployerDetails' => false, + 'pensionerPayroll' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'startDate' => 'startDate', + 'starterDeclaration' => 'starterDeclaration', + 'overseasEmployerDetails' => 'overseasEmployerDetails', + 'pensionerPayroll' => 'pensionerPayroll' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'startDate' => 'setStartDate', + 'starterDeclaration' => 'setStarterDeclaration', + 'overseasEmployerDetails' => 'setOverseasEmployerDetails', + 'pensionerPayroll' => 'setPensionerPayroll' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'startDate' => 'getStartDate', + 'starterDeclaration' => 'getStarterDeclaration', + 'overseasEmployerDetails' => 'getOverseasEmployerDetails', + 'pensionerPayroll' => 'getPensionerPayroll' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('starterDeclaration', $data ?? [], null); + $this->setIfExists('overseasEmployerDetails', $data ?? [], null); + $this->setIfExists('pensionerPayroll', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['startDate'] === null) { + $invalidProperties[] = "'startDate' can't be null"; + } + if ($this->container['starterDeclaration'] === null) { + $invalidProperties[] = "'starterDeclaration' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets startDate + * + * @return \DateTime + */ + public function getStartDate(): \DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime $startDate startDate + * + * @return $this + */ + public function setStartDate(\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets starterDeclaration + * + * @return \SynergiTech\Staffology\Model\StarterDeclaration + */ + public function getStarterDeclaration(): \SynergiTech\Staffology\Model\StarterDeclaration + { + return $this->container['starterDeclaration']; + } + + /** + * Sets starterDeclaration + * + * @param \SynergiTech\Staffology\Model\StarterDeclaration $starterDeclaration starterDeclaration + * + * @return $this + */ + public function setStarterDeclaration(\SynergiTech\Staffology\Model\StarterDeclaration $starterDeclaration): static + { + if (is_null($starterDeclaration)) { + throw new InvalidArgumentException('non-nullable starterDeclaration cannot be null'); + } + $this->container['starterDeclaration'] = $starterDeclaration; + + return $this; + } + + /** + * Gets overseasEmployerDetails + * + * @return \SynergiTech\Staffology\Model\ContractOverseasEmployerDetails|null + */ + public function getOverseasEmployerDetails(): ?\SynergiTech\Staffology\Model\ContractOverseasEmployerDetails + { + return $this->container['overseasEmployerDetails']; + } + + /** + * Sets overseasEmployerDetails + * + * @param \SynergiTech\Staffology\Model\ContractOverseasEmployerDetails|null $overseasEmployerDetails overseasEmployerDetails + * + * @return $this + */ + public function setOverseasEmployerDetails(?\SynergiTech\Staffology\Model\ContractOverseasEmployerDetails $overseasEmployerDetails): static + { + if (is_null($overseasEmployerDetails)) { + throw new InvalidArgumentException('non-nullable overseasEmployerDetails cannot be null'); + } + $this->container['overseasEmployerDetails'] = $overseasEmployerDetails; + + return $this; + } + + /** + * Gets pensionerPayroll + * + * @return \SynergiTech\Staffology\Model\ContractPensionerPayroll|null + */ + public function getPensionerPayroll(): ?\SynergiTech\Staffology\Model\ContractPensionerPayroll + { + return $this->container['pensionerPayroll']; + } + + /** + * Sets pensionerPayroll + * + * @param \SynergiTech\Staffology\Model\ContractPensionerPayroll|null $pensionerPayroll pensionerPayroll + * + * @return $this + */ + public function setPensionerPayroll(?\SynergiTech\Staffology\Model\ContractPensionerPayroll $pensionerPayroll): static + { + if (is_null($pensionerPayroll)) { + throw new InvalidArgumentException('non-nullable pensionerPayroll cannot be null'); + } + $this->container['pensionerPayroll'] = $pensionerPayroll; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractTaxAndNi.php b/src/Model/ContractTaxAndNi.php new file mode 100644 index 0000000..3121eaa --- /dev/null +++ b/src/Model/ContractTaxAndNi.php @@ -0,0 +1,794 @@ + + */ +class ContractTaxAndNi implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.TaxAndNi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'niTable' => 'string', + 'secondaryClass1NotPayable' => 'bool', + 'postgradLoan' => 'bool', + 'postgraduateLoanStartDate' => '\DateTime', + 'postgraduateLoanEndDate' => '\DateTime', + 'studentLoan' => '\SynergiTech\Staffology\Model\StudentLoan', + 'studentLoanStartDate' => '\DateTime', + 'studentLoanEndDate' => '\DateTime', + 'taxCode' => 'string', + 'week1Month1' => 'bool', + 'foreignTaxCredit' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'niTable' => null, + 'secondaryClass1NotPayable' => null, + 'postgradLoan' => null, + 'postgraduateLoanStartDate' => 'date', + 'postgraduateLoanEndDate' => 'date', + 'studentLoan' => null, + 'studentLoanStartDate' => 'date', + 'studentLoanEndDate' => 'date', + 'taxCode' => null, + 'week1Month1' => null, + 'foreignTaxCredit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'niTable' => false, + 'secondaryClass1NotPayable' => false, + 'postgradLoan' => false, + 'postgraduateLoanStartDate' => true, + 'postgraduateLoanEndDate' => true, + 'studentLoan' => false, + 'studentLoanStartDate' => true, + 'studentLoanEndDate' => true, + 'taxCode' => true, + 'week1Month1' => false, + 'foreignTaxCredit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'niTable' => 'niTable', + 'secondaryClass1NotPayable' => 'secondaryClass1NotPayable', + 'postgradLoan' => 'postgradLoan', + 'postgraduateLoanStartDate' => 'postgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'postgraduateLoanEndDate', + 'studentLoan' => 'studentLoan', + 'studentLoanStartDate' => 'studentLoanStartDate', + 'studentLoanEndDate' => 'studentLoanEndDate', + 'taxCode' => 'taxCode', + 'week1Month1' => 'week1Month1', + 'foreignTaxCredit' => 'foreignTaxCredit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'niTable' => 'setNiTable', + 'secondaryClass1NotPayable' => 'setSecondaryClass1NotPayable', + 'postgradLoan' => 'setPostgradLoan', + 'postgraduateLoanStartDate' => 'setPostgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'setPostgraduateLoanEndDate', + 'studentLoan' => 'setStudentLoan', + 'studentLoanStartDate' => 'setStudentLoanStartDate', + 'studentLoanEndDate' => 'setStudentLoanEndDate', + 'taxCode' => 'setTaxCode', + 'week1Month1' => 'setWeek1Month1', + 'foreignTaxCredit' => 'setForeignTaxCredit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'niTable' => 'getNiTable', + 'secondaryClass1NotPayable' => 'getSecondaryClass1NotPayable', + 'postgradLoan' => 'getPostgradLoan', + 'postgraduateLoanStartDate' => 'getPostgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'getPostgraduateLoanEndDate', + 'studentLoan' => 'getStudentLoan', + 'studentLoanStartDate' => 'getStudentLoanStartDate', + 'studentLoanEndDate' => 'getStudentLoanEndDate', + 'taxCode' => 'getTaxCode', + 'week1Month1' => 'getWeek1Month1', + 'foreignTaxCredit' => 'getForeignTaxCredit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('secondaryClass1NotPayable', $data ?? [], null); + $this->setIfExists('postgradLoan', $data ?? [], null); + $this->setIfExists('postgraduateLoanStartDate', $data ?? [], null); + $this->setIfExists('postgraduateLoanEndDate', $data ?? [], null); + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('studentLoanStartDate', $data ?? [], null); + $this->setIfExists('studentLoanEndDate', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('week1Month1', $data ?? [], null); + $this->setIfExists('foreignTaxCredit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['niTable'] === null) { + $invalidProperties[] = "'niTable' can't be null"; + } + if (!is_null($this->container['taxCode']) && (mb_strlen($this->container['taxCode']) > 12)) { + $invalidProperties[] = "invalid value for 'taxCode', the character length must be smaller than or equal to 12."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets niTable + * + * @return string + */ + public function getNiTable(): string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string $niTable The appropriate NI letter for this Employee + * + * @return $this + */ + public function setNiTable(string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets secondaryClass1NotPayable + * + * @return bool|null + */ + public function getSecondaryClass1NotPayable(): ?bool + { + return $this->container['secondaryClass1NotPayable']; + } + + /** + * Sets secondaryClass1NotPayable + * + * @param bool|null $secondaryClass1NotPayable If set to true then no Employer NI will be paid for this Employee + * + * @return $this + */ + public function setSecondaryClass1NotPayable(?bool $secondaryClass1NotPayable): static + { + if (is_null($secondaryClass1NotPayable)) { + throw new InvalidArgumentException('non-nullable secondaryClass1NotPayable cannot be null'); + } + $this->container['secondaryClass1NotPayable'] = $secondaryClass1NotPayable; + + return $this; + } + + /** + * Gets postgradLoan + * + * @return bool|null + */ + public function getPostgradLoan(): ?bool + { + return $this->container['postgradLoan']; + } + + /** + * Sets postgradLoan + * + * @param bool|null $postgradLoan Set to true if the Employee needs to make Post Graduate Loan repayments + * + * @return $this + */ + public function setPostgradLoan(?bool $postgradLoan): static + { + if (is_null($postgradLoan)) { + throw new InvalidArgumentException('non-nullable postgradLoan cannot be null'); + } + $this->container['postgradLoan'] = $postgradLoan; + + return $this; + } + + /** + * Gets postgraduateLoanStartDate + * + * @return \DateTime|null + */ + public function getPostgraduateLoanStartDate(): ?\DateTime + { + return $this->container['postgraduateLoanStartDate']; + } + + /** + * Sets postgraduateLoanStartDate + * + * @param \DateTime|null $postgraduateLoanStartDate postgraduateLoanStartDate + * + * @return $this + */ + public function setPostgraduateLoanStartDate(?\DateTime $postgraduateLoanStartDate): static + { + if (is_null($postgraduateLoanStartDate)) { + array_push($this->openAPINullablesSetToNull, 'postgraduateLoanStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgraduateLoanStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgraduateLoanStartDate'] = $postgraduateLoanStartDate; + + return $this; + } + + /** + * Gets postgraduateLoanEndDate + * + * @return \DateTime|null + */ + public function getPostgraduateLoanEndDate(): ?\DateTime + { + return $this->container['postgraduateLoanEndDate']; + } + + /** + * Sets postgraduateLoanEndDate + * + * @param \DateTime|null $postgraduateLoanEndDate postgraduateLoanEndDate + * + * @return $this + */ + public function setPostgraduateLoanEndDate(?\DateTime $postgraduateLoanEndDate): static + { + if (is_null($postgraduateLoanEndDate)) { + array_push($this->openAPINullablesSetToNull, 'postgraduateLoanEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgraduateLoanEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgraduateLoanEndDate'] = $postgraduateLoanEndDate; + + return $this; + } + + /** + * Gets studentLoan + * + * @return \SynergiTech\Staffology\Model\StudentLoan|null + */ + public function getStudentLoan(): ?\SynergiTech\Staffology\Model\StudentLoan + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param \SynergiTech\Staffology\Model\StudentLoan|null $studentLoan studentLoan + * + * @return $this + */ + public function setStudentLoan(?\SynergiTech\Staffology\Model\StudentLoan $studentLoan): static + { + if (is_null($studentLoan)) { + throw new InvalidArgumentException('non-nullable studentLoan cannot be null'); + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets studentLoanStartDate + * + * @return \DateTime|null + */ + public function getStudentLoanStartDate(): ?\DateTime + { + return $this->container['studentLoanStartDate']; + } + + /** + * Sets studentLoanStartDate + * + * @param \DateTime|null $studentLoanStartDate studentLoanStartDate + * + * @return $this + */ + public function setStudentLoanStartDate(?\DateTime $studentLoanStartDate): static + { + if (is_null($studentLoanStartDate)) { + array_push($this->openAPINullablesSetToNull, 'studentLoanStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoanStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoanStartDate'] = $studentLoanStartDate; + + return $this; + } + + /** + * Gets studentLoanEndDate + * + * @return \DateTime|null + */ + public function getStudentLoanEndDate(): ?\DateTime + { + return $this->container['studentLoanEndDate']; + } + + /** + * Sets studentLoanEndDate + * + * @param \DateTime|null $studentLoanEndDate studentLoanEndDate + * + * @return $this + */ + public function setStudentLoanEndDate(?\DateTime $studentLoanEndDate): static + { + if (is_null($studentLoanEndDate)) { + array_push($this->openAPINullablesSetToNull, 'studentLoanEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoanEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoanEndDate'] = $studentLoanEndDate; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode The Tax Code for this Employee + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($taxCode) && (mb_strlen($taxCode) > 12)) { + throw new InvalidArgumentException('invalid length for $taxCode when calling ContractTaxAndNi., must be smaller than or equal to 12.'); + } + + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets week1Month1 + * + * @return bool|null + */ + public function getWeek1Month1(): ?bool + { + return $this->container['week1Month1']; + } + + /** + * Sets week1Month1 + * + * @param bool|null $week1Month1 Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis. This is automatically set to false for any existing Employees when you start a new Tax Year. + * + * @return $this + */ + public function setWeek1Month1(?bool $week1Month1): static + { + if (is_null($week1Month1)) { + throw new InvalidArgumentException('non-nullable week1Month1 cannot be null'); + } + $this->container['week1Month1'] = $week1Month1; + + return $this; + } + + /** + * Gets foreignTaxCredit + * + * @return bool|null + */ + public function getForeignTaxCredit(): ?bool + { + return $this->container['foreignTaxCredit']; + } + + /** + * Sets foreignTaxCredit + * + * @param bool|null $foreignTaxCredit If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities. + * + * @return $this + */ + public function setForeignTaxCredit(?bool $foreignTaxCredit): static + { + if (is_null($foreignTaxCredit)) { + throw new InvalidArgumentException('non-nullable foreignTaxCredit cannot be null'); + } + $this->container['foreignTaxCredit'] = $foreignTaxCredit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractTermCalendarRequest.php b/src/Model/ContractTermCalendarRequest.php new file mode 100644 index 0000000..37716bf --- /dev/null +++ b/src/Model/ContractTermCalendarRequest.php @@ -0,0 +1,449 @@ + + */ +class ContractTermCalendarRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.TermCalendarRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'academicYearStartMonth' => '\SynergiTech\Staffology\Model\CalendarMonth' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'academicYearStartMonth' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => true, + 'academicYearStartMonth' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'academicYearStartMonth' => 'academicYearStartMonth' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'academicYearStartMonth' => 'setAcademicYearStartMonth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'academicYearStartMonth' => 'getAcademicYearStartMonth' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('academicYearStartMonth', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Title of the Term Calendar + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets academicYearStartMonth + * + * @return \SynergiTech\Staffology\Model\CalendarMonth|null + */ + public function getAcademicYearStartMonth(): ?\SynergiTech\Staffology\Model\CalendarMonth + { + return $this->container['academicYearStartMonth']; + } + + /** + * Sets academicYearStartMonth + * + * @param \SynergiTech\Staffology\Model\CalendarMonth|null $academicYearStartMonth academicYearStartMonth + * + * @return $this + */ + public function setAcademicYearStartMonth(?\SynergiTech\Staffology\Model\CalendarMonth $academicYearStartMonth): static + { + if (is_null($academicYearStartMonth)) { + throw new InvalidArgumentException('non-nullable academicYearStartMonth cannot be null'); + } + $this->container['academicYearStartMonth'] = $academicYearStartMonth; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractTermCalendarResponse.php b/src/Model/ContractTermCalendarResponse.php new file mode 100644 index 0000000..84c240a --- /dev/null +++ b/src/Model/ContractTermCalendarResponse.php @@ -0,0 +1,483 @@ + + */ +class ContractTermCalendarResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.TermCalendarResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'title' => 'string', + 'academicYearStartMonth' => '\SynergiTech\Staffology\Model\CalendarMonth' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'title' => null, + 'academicYearStartMonth' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => true, + 'academicYearStartMonth' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'title' => 'title', + 'academicYearStartMonth' => 'academicYearStartMonth' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'title' => 'setTitle', + 'academicYearStartMonth' => 'setAcademicYearStartMonth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'title' => 'getTitle', + 'academicYearStartMonth' => 'getAcademicYearStartMonth' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('academicYearStartMonth', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Term Calendar identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Title of the Term Calendar + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets academicYearStartMonth + * + * @return \SynergiTech\Staffology\Model\CalendarMonth|null + */ + public function getAcademicYearStartMonth(): ?\SynergiTech\Staffology\Model\CalendarMonth + { + return $this->container['academicYearStartMonth']; + } + + /** + * Sets academicYearStartMonth + * + * @param \SynergiTech\Staffology\Model\CalendarMonth|null $academicYearStartMonth academicYearStartMonth + * + * @return $this + */ + public function setAcademicYearStartMonth(?\SynergiTech\Staffology\Model\CalendarMonth $academicYearStartMonth): static + { + if (is_null($academicYearStartMonth)) { + throw new InvalidArgumentException('non-nullable academicYearStartMonth cannot be null'); + } + $this->container['academicYearStartMonth'] = $academicYearStartMonth; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractTermCalendarYearRequest.php b/src/Model/ContractTermCalendarYearRequest.php new file mode 100644 index 0000000..cb1e6cc --- /dev/null +++ b/src/Model/ContractTermCalendarYearRequest.php @@ -0,0 +1,578 @@ + + */ +class ContractTermCalendarYearRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.TermCalendarYearRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'autumnTermStartDate' => '\DateTime', + 'autumnTermEndDate' => '\DateTime', + 'springTermStartDate' => '\DateTime', + 'springTermEndDate' => '\DateTime', + 'summerTermStartDate' => '\DateTime', + 'summerTermEndDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'autumnTermStartDate' => 'date', + 'autumnTermEndDate' => 'date', + 'springTermStartDate' => 'date', + 'springTermEndDate' => 'date', + 'summerTermStartDate' => 'date', + 'summerTermEndDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'autumnTermStartDate' => false, + 'autumnTermEndDate' => false, + 'springTermStartDate' => false, + 'springTermEndDate' => false, + 'summerTermStartDate' => false, + 'summerTermEndDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'autumnTermStartDate' => 'autumnTermStartDate', + 'autumnTermEndDate' => 'autumnTermEndDate', + 'springTermStartDate' => 'springTermStartDate', + 'springTermEndDate' => 'springTermEndDate', + 'summerTermStartDate' => 'summerTermStartDate', + 'summerTermEndDate' => 'summerTermEndDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'autumnTermStartDate' => 'setAutumnTermStartDate', + 'autumnTermEndDate' => 'setAutumnTermEndDate', + 'springTermStartDate' => 'setSpringTermStartDate', + 'springTermEndDate' => 'setSpringTermEndDate', + 'summerTermStartDate' => 'setSummerTermStartDate', + 'summerTermEndDate' => 'setSummerTermEndDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'autumnTermStartDate' => 'getAutumnTermStartDate', + 'autumnTermEndDate' => 'getAutumnTermEndDate', + 'springTermStartDate' => 'getSpringTermStartDate', + 'springTermEndDate' => 'getSpringTermEndDate', + 'summerTermStartDate' => 'getSummerTermStartDate', + 'summerTermEndDate' => 'getSummerTermEndDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('autumnTermStartDate', $data ?? [], null); + $this->setIfExists('autumnTermEndDate', $data ?? [], null); + $this->setIfExists('springTermStartDate', $data ?? [], null); + $this->setIfExists('springTermEndDate', $data ?? [], null); + $this->setIfExists('summerTermStartDate', $data ?? [], null); + $this->setIfExists('summerTermEndDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets autumnTermStartDate + * + * @return \DateTime|null + */ + public function getAutumnTermStartDate(): ?\DateTime + { + return $this->container['autumnTermStartDate']; + } + + /** + * Sets autumnTermStartDate + * + * @param \DateTime|null $autumnTermStartDate Autumn Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setAutumnTermStartDate(?\DateTime $autumnTermStartDate): static + { + if (is_null($autumnTermStartDate)) { + throw new InvalidArgumentException('non-nullable autumnTermStartDate cannot be null'); + } + $this->container['autumnTermStartDate'] = $autumnTermStartDate; + + return $this; + } + + /** + * Gets autumnTermEndDate + * + * @return \DateTime|null + */ + public function getAutumnTermEndDate(): ?\DateTime + { + return $this->container['autumnTermEndDate']; + } + + /** + * Sets autumnTermEndDate + * + * @param \DateTime|null $autumnTermEndDate Autumn Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setAutumnTermEndDate(?\DateTime $autumnTermEndDate): static + { + if (is_null($autumnTermEndDate)) { + throw new InvalidArgumentException('non-nullable autumnTermEndDate cannot be null'); + } + $this->container['autumnTermEndDate'] = $autumnTermEndDate; + + return $this; + } + + /** + * Gets springTermStartDate + * + * @return \DateTime|null + */ + public function getSpringTermStartDate(): ?\DateTime + { + return $this->container['springTermStartDate']; + } + + /** + * Sets springTermStartDate + * + * @param \DateTime|null $springTermStartDate Spring Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setSpringTermStartDate(?\DateTime $springTermStartDate): static + { + if (is_null($springTermStartDate)) { + throw new InvalidArgumentException('non-nullable springTermStartDate cannot be null'); + } + $this->container['springTermStartDate'] = $springTermStartDate; + + return $this; + } + + /** + * Gets springTermEndDate + * + * @return \DateTime|null + */ + public function getSpringTermEndDate(): ?\DateTime + { + return $this->container['springTermEndDate']; + } + + /** + * Sets springTermEndDate + * + * @param \DateTime|null $springTermEndDate Spring Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setSpringTermEndDate(?\DateTime $springTermEndDate): static + { + if (is_null($springTermEndDate)) { + throw new InvalidArgumentException('non-nullable springTermEndDate cannot be null'); + } + $this->container['springTermEndDate'] = $springTermEndDate; + + return $this; + } + + /** + * Gets summerTermStartDate + * + * @return \DateTime|null + */ + public function getSummerTermStartDate(): ?\DateTime + { + return $this->container['summerTermStartDate']; + } + + /** + * Sets summerTermStartDate + * + * @param \DateTime|null $summerTermStartDate Summer Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setSummerTermStartDate(?\DateTime $summerTermStartDate): static + { + if (is_null($summerTermStartDate)) { + throw new InvalidArgumentException('non-nullable summerTermStartDate cannot be null'); + } + $this->container['summerTermStartDate'] = $summerTermStartDate; + + return $this; + } + + /** + * Gets summerTermEndDate + * + * @return \DateTime|null + */ + public function getSummerTermEndDate(): ?\DateTime + { + return $this->container['summerTermEndDate']; + } + + /** + * Sets summerTermEndDate + * + * @param \DateTime|null $summerTermEndDate Summer Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setSummerTermEndDate(?\DateTime $summerTermEndDate): static + { + if (is_null($summerTermEndDate)) { + throw new InvalidArgumentException('non-nullable summerTermEndDate cannot be null'); + } + $this->container['summerTermEndDate'] = $summerTermEndDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractTermCalendarYearResponse.php b/src/Model/ContractTermCalendarYearResponse.php new file mode 100644 index 0000000..88638c8 --- /dev/null +++ b/src/Model/ContractTermCalendarYearResponse.php @@ -0,0 +1,612 @@ + + */ +class ContractTermCalendarYearResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.TermCalendarYearResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'autumnTermStartDate' => '\DateTime', + 'autumnTermEndDate' => '\DateTime', + 'springTermStartDate' => '\DateTime', + 'springTermEndDate' => '\DateTime', + 'summerTermStartDate' => '\DateTime', + 'summerTermEndDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'autumnTermStartDate' => 'date', + 'autumnTermEndDate' => 'date', + 'springTermStartDate' => 'date', + 'springTermEndDate' => 'date', + 'summerTermStartDate' => 'date', + 'summerTermEndDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'autumnTermStartDate' => false, + 'autumnTermEndDate' => false, + 'springTermStartDate' => false, + 'springTermEndDate' => false, + 'summerTermStartDate' => false, + 'summerTermEndDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'autumnTermStartDate' => 'autumnTermStartDate', + 'autumnTermEndDate' => 'autumnTermEndDate', + 'springTermStartDate' => 'springTermStartDate', + 'springTermEndDate' => 'springTermEndDate', + 'summerTermStartDate' => 'summerTermStartDate', + 'summerTermEndDate' => 'summerTermEndDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'autumnTermStartDate' => 'setAutumnTermStartDate', + 'autumnTermEndDate' => 'setAutumnTermEndDate', + 'springTermStartDate' => 'setSpringTermStartDate', + 'springTermEndDate' => 'setSpringTermEndDate', + 'summerTermStartDate' => 'setSummerTermStartDate', + 'summerTermEndDate' => 'setSummerTermEndDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'autumnTermStartDate' => 'getAutumnTermStartDate', + 'autumnTermEndDate' => 'getAutumnTermEndDate', + 'springTermStartDate' => 'getSpringTermStartDate', + 'springTermEndDate' => 'getSpringTermEndDate', + 'summerTermStartDate' => 'getSummerTermStartDate', + 'summerTermEndDate' => 'getSummerTermEndDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('autumnTermStartDate', $data ?? [], null); + $this->setIfExists('autumnTermEndDate', $data ?? [], null); + $this->setIfExists('springTermStartDate', $data ?? [], null); + $this->setIfExists('springTermEndDate', $data ?? [], null); + $this->setIfExists('summerTermStartDate', $data ?? [], null); + $this->setIfExists('summerTermEndDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Term Calendar Year identifier + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets autumnTermStartDate + * + * @return \DateTime|null + */ + public function getAutumnTermStartDate(): ?\DateTime + { + return $this->container['autumnTermStartDate']; + } + + /** + * Sets autumnTermStartDate + * + * @param \DateTime|null $autumnTermStartDate Autumn Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setAutumnTermStartDate(?\DateTime $autumnTermStartDate): static + { + if (is_null($autumnTermStartDate)) { + throw new InvalidArgumentException('non-nullable autumnTermStartDate cannot be null'); + } + $this->container['autumnTermStartDate'] = $autumnTermStartDate; + + return $this; + } + + /** + * Gets autumnTermEndDate + * + * @return \DateTime|null + */ + public function getAutumnTermEndDate(): ?\DateTime + { + return $this->container['autumnTermEndDate']; + } + + /** + * Sets autumnTermEndDate + * + * @param \DateTime|null $autumnTermEndDate Autumn Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setAutumnTermEndDate(?\DateTime $autumnTermEndDate): static + { + if (is_null($autumnTermEndDate)) { + throw new InvalidArgumentException('non-nullable autumnTermEndDate cannot be null'); + } + $this->container['autumnTermEndDate'] = $autumnTermEndDate; + + return $this; + } + + /** + * Gets springTermStartDate + * + * @return \DateTime|null + */ + public function getSpringTermStartDate(): ?\DateTime + { + return $this->container['springTermStartDate']; + } + + /** + * Sets springTermStartDate + * + * @param \DateTime|null $springTermStartDate Spring Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setSpringTermStartDate(?\DateTime $springTermStartDate): static + { + if (is_null($springTermStartDate)) { + throw new InvalidArgumentException('non-nullable springTermStartDate cannot be null'); + } + $this->container['springTermStartDate'] = $springTermStartDate; + + return $this; + } + + /** + * Gets springTermEndDate + * + * @return \DateTime|null + */ + public function getSpringTermEndDate(): ?\DateTime + { + return $this->container['springTermEndDate']; + } + + /** + * Sets springTermEndDate + * + * @param \DateTime|null $springTermEndDate Spring Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setSpringTermEndDate(?\DateTime $springTermEndDate): static + { + if (is_null($springTermEndDate)) { + throw new InvalidArgumentException('non-nullable springTermEndDate cannot be null'); + } + $this->container['springTermEndDate'] = $springTermEndDate; + + return $this; + } + + /** + * Gets summerTermStartDate + * + * @return \DateTime|null + */ + public function getSummerTermStartDate(): ?\DateTime + { + return $this->container['summerTermStartDate']; + } + + /** + * Sets summerTermStartDate + * + * @param \DateTime|null $summerTermStartDate Summer Term Start Date of Term Calendar Year View + * + * @return $this + */ + public function setSummerTermStartDate(?\DateTime $summerTermStartDate): static + { + if (is_null($summerTermStartDate)) { + throw new InvalidArgumentException('non-nullable summerTermStartDate cannot be null'); + } + $this->container['summerTermStartDate'] = $summerTermStartDate; + + return $this; + } + + /** + * Gets summerTermEndDate + * + * @return \DateTime|null + */ + public function getSummerTermEndDate(): ?\DateTime + { + return $this->container['summerTermEndDate']; + } + + /** + * Sets summerTermEndDate + * + * @param \DateTime|null $summerTermEndDate Summer Term End Date of Term Calendar Year View + * + * @return $this + */ + public function setSummerTermEndDate(?\DateTime $summerTermEndDate): static + { + if (is_null($summerTermEndDate)) { + throw new InvalidArgumentException('non-nullable summerTermEndDate cannot be null'); + } + $this->container['summerTermEndDate'] = $summerTermEndDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractUpdateEmployeeRequest.php b/src/Model/ContractUpdateEmployeeRequest.php new file mode 100644 index 0000000..6324ea0 --- /dev/null +++ b/src/Model/ContractUpdateEmployeeRequest.php @@ -0,0 +1,859 @@ + + */ +class ContractUpdateEmployeeRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.UpdateEmployeeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'personalDetails' => '\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest', + 'employmentDetails' => '\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest', + 'autoEnrolment' => '\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest', + 'leaveSettings' => '\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest', + 'rightToWork' => '\SynergiTech\Staffology\Model\ContractRightToWork', + 'bankDetails' => '\SynergiTech\Staffology\Model\ContractBankDetails', + 'payOptions' => '\SynergiTech\Staffology\Model\ContractPayOptionsRequest', + 'tags' => 'string[]', + 'holidaySchemeUniqueId' => 'string', + 'aggregatedServiceDate' => '\DateTime', + 'evcId' => 'string', + 'sourceSystemId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'personalDetails' => null, + 'employmentDetails' => null, + 'autoEnrolment' => null, + 'leaveSettings' => null, + 'rightToWork' => null, + 'bankDetails' => null, + 'payOptions' => null, + 'tags' => null, + 'holidaySchemeUniqueId' => 'uuid', + 'aggregatedServiceDate' => 'date', + 'evcId' => 'uuid', + 'sourceSystemId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'personalDetails' => false, + 'employmentDetails' => false, + 'autoEnrolment' => false, + 'leaveSettings' => false, + 'rightToWork' => false, + 'bankDetails' => false, + 'payOptions' => false, + 'tags' => true, + 'holidaySchemeUniqueId' => true, + 'aggregatedServiceDate' => true, + 'evcId' => true, + 'sourceSystemId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'personalDetails' => 'personalDetails', + 'employmentDetails' => 'employmentDetails', + 'autoEnrolment' => 'autoEnrolment', + 'leaveSettings' => 'leaveSettings', + 'rightToWork' => 'rightToWork', + 'bankDetails' => 'bankDetails', + 'payOptions' => 'payOptions', + 'tags' => 'tags', + 'holidaySchemeUniqueId' => 'holidaySchemeUniqueId', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'evcId' => 'evcId', + 'sourceSystemId' => 'sourceSystemId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'personalDetails' => 'setPersonalDetails', + 'employmentDetails' => 'setEmploymentDetails', + 'autoEnrolment' => 'setAutoEnrolment', + 'leaveSettings' => 'setLeaveSettings', + 'rightToWork' => 'setRightToWork', + 'bankDetails' => 'setBankDetails', + 'payOptions' => 'setPayOptions', + 'tags' => 'setTags', + 'holidaySchemeUniqueId' => 'setHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'evcId' => 'setEvcId', + 'sourceSystemId' => 'setSourceSystemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'personalDetails' => 'getPersonalDetails', + 'employmentDetails' => 'getEmploymentDetails', + 'autoEnrolment' => 'getAutoEnrolment', + 'leaveSettings' => 'getLeaveSettings', + 'rightToWork' => 'getRightToWork', + 'bankDetails' => 'getBankDetails', + 'payOptions' => 'getPayOptions', + 'tags' => 'getTags', + 'holidaySchemeUniqueId' => 'getHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'evcId' => 'getEvcId', + 'sourceSystemId' => 'getSourceSystemId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('autoEnrolment', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + $this->setIfExists('rightToWork', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('holidaySchemeUniqueId', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('evcId', $data ?? [], null); + $this->setIfExists('sourceSystemId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['sourceSystemId']) && (mb_strlen($this->container['sourceSystemId']) > 50)) { + $invalidProperties[] = "invalid value for 'sourceSystemId', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\ContractPersonalDetailsRequest|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\ContractPersonalDetailsRequest|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\ContractPersonalDetailsRequest $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\ContractEmploymentDetailsRequest $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets autoEnrolment + * + * @return \SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest|null + */ + public function getAutoEnrolment(): ?\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest + { + return $this->container['autoEnrolment']; + } + + /** + * Sets autoEnrolment + * + * @param \SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest|null $autoEnrolment autoEnrolment + * + * @return $this + */ + public function setAutoEnrolment(?\SynergiTech\Staffology\Model\ContractAutoEnrolmentRequest $autoEnrolment): static + { + if (is_null($autoEnrolment)) { + throw new InvalidArgumentException('non-nullable autoEnrolment cannot be null'); + } + $this->container['autoEnrolment'] = $autoEnrolment; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\ContractLeaveSettingsRequest|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\ContractLeaveSettingsRequest|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\ContractLeaveSettingsRequest $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + + /** + * Gets rightToWork + * + * @return \SynergiTech\Staffology\Model\ContractRightToWork|null + */ + public function getRightToWork(): ?\SynergiTech\Staffology\Model\ContractRightToWork + { + return $this->container['rightToWork']; + } + + /** + * Sets rightToWork + * + * @param \SynergiTech\Staffology\Model\ContractRightToWork|null $rightToWork rightToWork + * + * @return $this + */ + public function setRightToWork(?\SynergiTech\Staffology\Model\ContractRightToWork $rightToWork): static + { + if (is_null($rightToWork)) { + throw new InvalidArgumentException('non-nullable rightToWork cannot be null'); + } + $this->container['rightToWork'] = $rightToWork; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\ContractBankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\ContractBankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\ContractBankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\ContractBankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\ContractPayOptionsRequest|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\ContractPayOptionsRequest + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\ContractPayOptionsRequest|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\ContractPayOptionsRequest $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets holidaySchemeUniqueId + * + * @return string|null + */ + public function getHolidaySchemeUniqueId(): ?string + { + return $this->container['holidaySchemeUniqueId']; + } + + /** + * Sets holidaySchemeUniqueId + * + * @param string|null $holidaySchemeUniqueId holidaySchemeUniqueId + * + * @return $this + */ + public function setHolidaySchemeUniqueId(?string $holidaySchemeUniqueId): static + { + if (is_null($holidaySchemeUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'holidaySchemeUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidaySchemeUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidaySchemeUniqueId'] = $holidaySchemeUniqueId; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets evcId + * + * @return string|null + */ + public function getEvcId(): ?string + { + return $this->container['evcId']; + } + + /** + * Sets evcId + * + * @param string|null $evcId If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. + * + * @return $this + */ + public function setEvcId(?string $evcId): static + { + if (is_null($evcId)) { + array_push($this->openAPINullablesSetToNull, 'evcId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('evcId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['evcId'] = $evcId; + + return $this; + } + + /** + * Gets sourceSystemId + * + * @return string|null + */ + public function getSourceSystemId(): ?string + { + return $this->container['sourceSystemId']; + } + + /** + * Sets sourceSystemId + * + * @param string|null $sourceSystemId Used by external systems so they can store an immutable reference. Once this property is set it cannot be changed. + * + * @return $this + */ + public function setSourceSystemId(?string $sourceSystemId): static + { + if (is_null($sourceSystemId)) { + array_push($this->openAPINullablesSetToNull, 'sourceSystemId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sourceSystemId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($sourceSystemId) && (mb_strlen($sourceSystemId) > 50)) { + throw new InvalidArgumentException('invalid length for $sourceSystemId when calling ContractUpdateEmployeeRequest., must be smaller than or equal to 50.'); + } + + $this->container['sourceSystemId'] = $sourceSystemId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractVeteranDetails.php b/src/Model/ContractVeteranDetails.php new file mode 100644 index 0000000..94ec945 --- /dev/null +++ b/src/Model/ContractVeteranDetails.php @@ -0,0 +1,449 @@ + + */ +class ContractVeteranDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.VeteranDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isVeteran' => 'bool', + 'firstCivilianEmploymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isVeteran' => null, + 'firstCivilianEmploymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isVeteran' => false, + 'firstCivilianEmploymentDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isVeteran' => 'isVeteran', + 'firstCivilianEmploymentDate' => 'firstCivilianEmploymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isVeteran' => 'setIsVeteran', + 'firstCivilianEmploymentDate' => 'setFirstCivilianEmploymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isVeteran' => 'getIsVeteran', + 'firstCivilianEmploymentDate' => 'getFirstCivilianEmploymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isVeteran', $data ?? [], null); + $this->setIfExists('firstCivilianEmploymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isVeteran + * + * @return bool|null + */ + public function getIsVeteran(): ?bool + { + return $this->container['isVeteran']; + } + + /** + * Sets isVeteran + * + * @param bool|null $isVeteran Set to true if the employee is a veteran + * + * @return $this + */ + public function setIsVeteran(?bool $isVeteran): static + { + if (is_null($isVeteran)) { + throw new InvalidArgumentException('non-nullable isVeteran cannot be null'); + } + $this->container['isVeteran'] = $isVeteran; + + return $this; + } + + /** + * Gets firstCivilianEmploymentDate + * + * @return \DateTime|null + */ + public function getFirstCivilianEmploymentDate(): ?\DateTime + { + return $this->container['firstCivilianEmploymentDate']; + } + + /** + * Sets firstCivilianEmploymentDate + * + * @param \DateTime|null $firstCivilianEmploymentDate Date of Veteran's first civilian employment + * + * @return $this + */ + public function setFirstCivilianEmploymentDate(?\DateTime $firstCivilianEmploymentDate): static + { + if (is_null($firstCivilianEmploymentDate)) { + array_push($this->openAPINullablesSetToNull, 'firstCivilianEmploymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstCivilianEmploymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstCivilianEmploymentDate'] = $firstCivilianEmploymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractWorkingPatternRequest.php b/src/Model/ContractWorkingPatternRequest.php new file mode 100644 index 0000000..b486adf --- /dev/null +++ b/src/Model/ContractWorkingPatternRequest.php @@ -0,0 +1,1345 @@ + + */ +class ContractWorkingPatternRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.WorkingPatternRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'title' => 'string', + 'mon' => 'float', + 'tue' => 'float', + 'wed' => 'float', + 'thu' => 'float', + 'fri' => 'float', + 'sat' => 'float', + 'sun' => 'float', + 'monIsWorkingDay' => 'bool', + 'tueIsWorkingDay' => 'bool', + 'wedIsWorkingDay' => 'bool', + 'thuIsWorkingDay' => 'bool', + 'friIsWorkingDay' => 'bool', + 'satIsWorkingDay' => 'bool', + 'sunIsWorkingDay' => 'bool', + 'totalHours' => 'float', + 'contractedWeeks' => 'float', + 'fullTimeContractedWeeks' => 'float', + 'fullTimeContractedHours' => 'float', + 'bankHolidays' => '\SynergiTech\Staffology\Model\BankHolidayCollection', + 'proRataRule' => '\SynergiTech\Staffology\Model\ProRataRule', + 'workingPatternHoursType' => '\SynergiTech\Staffology\Model\WorkingPatternHoursType', + 'isDefault' => 'bool', + 'workingPatternType' => '\SynergiTech\Staffology\Model\WorkingPatternType', + 'effectiveFrom' => '\DateTime', + 'shiftWorkingPatternDays' => '\SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'title' => null, + 'mon' => 'double', + 'tue' => 'double', + 'wed' => 'double', + 'thu' => 'double', + 'fri' => 'double', + 'sat' => 'double', + 'sun' => 'double', + 'monIsWorkingDay' => null, + 'tueIsWorkingDay' => null, + 'wedIsWorkingDay' => null, + 'thuIsWorkingDay' => null, + 'friIsWorkingDay' => null, + 'satIsWorkingDay' => null, + 'sunIsWorkingDay' => null, + 'totalHours' => 'double', + 'contractedWeeks' => 'double', + 'fullTimeContractedWeeks' => 'double', + 'fullTimeContractedHours' => 'double', + 'bankHolidays' => null, + 'proRataRule' => null, + 'workingPatternHoursType' => null, + 'isDefault' => null, + 'workingPatternType' => null, + 'effectiveFrom' => 'date', + 'shiftWorkingPatternDays' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'mon' => false, + 'tue' => false, + 'wed' => false, + 'thu' => false, + 'fri' => false, + 'sat' => false, + 'sun' => false, + 'monIsWorkingDay' => false, + 'tueIsWorkingDay' => false, + 'wedIsWorkingDay' => false, + 'thuIsWorkingDay' => false, + 'friIsWorkingDay' => false, + 'satIsWorkingDay' => false, + 'sunIsWorkingDay' => false, + 'totalHours' => false, + 'contractedWeeks' => true, + 'fullTimeContractedWeeks' => true, + 'fullTimeContractedHours' => true, + 'bankHolidays' => false, + 'proRataRule' => false, + 'workingPatternHoursType' => false, + 'isDefault' => false, + 'workingPatternType' => false, + 'effectiveFrom' => true, + 'shiftWorkingPatternDays' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'title' => 'title', + 'mon' => 'mon', + 'tue' => 'tue', + 'wed' => 'wed', + 'thu' => 'thu', + 'fri' => 'fri', + 'sat' => 'sat', + 'sun' => 'sun', + 'monIsWorkingDay' => 'monIsWorkingDay', + 'tueIsWorkingDay' => 'tueIsWorkingDay', + 'wedIsWorkingDay' => 'wedIsWorkingDay', + 'thuIsWorkingDay' => 'thuIsWorkingDay', + 'friIsWorkingDay' => 'friIsWorkingDay', + 'satIsWorkingDay' => 'satIsWorkingDay', + 'sunIsWorkingDay' => 'sunIsWorkingDay', + 'totalHours' => 'totalHours', + 'contractedWeeks' => 'contractedWeeks', + 'fullTimeContractedWeeks' => 'fullTimeContractedWeeks', + 'fullTimeContractedHours' => 'fullTimeContractedHours', + 'bankHolidays' => 'bankHolidays', + 'proRataRule' => 'proRataRule', + 'workingPatternHoursType' => 'workingPatternHoursType', + 'isDefault' => 'isDefault', + 'workingPatternType' => 'workingPatternType', + 'effectiveFrom' => 'effectiveFrom', + 'shiftWorkingPatternDays' => 'shiftWorkingPatternDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'title' => 'setTitle', + 'mon' => 'setMon', + 'tue' => 'setTue', + 'wed' => 'setWed', + 'thu' => 'setThu', + 'fri' => 'setFri', + 'sat' => 'setSat', + 'sun' => 'setSun', + 'monIsWorkingDay' => 'setMonIsWorkingDay', + 'tueIsWorkingDay' => 'setTueIsWorkingDay', + 'wedIsWorkingDay' => 'setWedIsWorkingDay', + 'thuIsWorkingDay' => 'setThuIsWorkingDay', + 'friIsWorkingDay' => 'setFriIsWorkingDay', + 'satIsWorkingDay' => 'setSatIsWorkingDay', + 'sunIsWorkingDay' => 'setSunIsWorkingDay', + 'totalHours' => 'setTotalHours', + 'contractedWeeks' => 'setContractedWeeks', + 'fullTimeContractedWeeks' => 'setFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'setFullTimeContractedHours', + 'bankHolidays' => 'setBankHolidays', + 'proRataRule' => 'setProRataRule', + 'workingPatternHoursType' => 'setWorkingPatternHoursType', + 'isDefault' => 'setIsDefault', + 'workingPatternType' => 'setWorkingPatternType', + 'effectiveFrom' => 'setEffectiveFrom', + 'shiftWorkingPatternDays' => 'setShiftWorkingPatternDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'title' => 'getTitle', + 'mon' => 'getMon', + 'tue' => 'getTue', + 'wed' => 'getWed', + 'thu' => 'getThu', + 'fri' => 'getFri', + 'sat' => 'getSat', + 'sun' => 'getSun', + 'monIsWorkingDay' => 'getMonIsWorkingDay', + 'tueIsWorkingDay' => 'getTueIsWorkingDay', + 'wedIsWorkingDay' => 'getWedIsWorkingDay', + 'thuIsWorkingDay' => 'getThuIsWorkingDay', + 'friIsWorkingDay' => 'getFriIsWorkingDay', + 'satIsWorkingDay' => 'getSatIsWorkingDay', + 'sunIsWorkingDay' => 'getSunIsWorkingDay', + 'totalHours' => 'getTotalHours', + 'contractedWeeks' => 'getContractedWeeks', + 'fullTimeContractedWeeks' => 'getFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'getFullTimeContractedHours', + 'bankHolidays' => 'getBankHolidays', + 'proRataRule' => 'getProRataRule', + 'workingPatternHoursType' => 'getWorkingPatternHoursType', + 'isDefault' => 'getIsDefault', + 'workingPatternType' => 'getWorkingPatternType', + 'effectiveFrom' => 'getEffectiveFrom', + 'shiftWorkingPatternDays' => 'getShiftWorkingPatternDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('mon', $data ?? [], null); + $this->setIfExists('tue', $data ?? [], null); + $this->setIfExists('wed', $data ?? [], null); + $this->setIfExists('thu', $data ?? [], null); + $this->setIfExists('fri', $data ?? [], null); + $this->setIfExists('sat', $data ?? [], null); + $this->setIfExists('sun', $data ?? [], null); + $this->setIfExists('monIsWorkingDay', $data ?? [], null); + $this->setIfExists('tueIsWorkingDay', $data ?? [], null); + $this->setIfExists('wedIsWorkingDay', $data ?? [], null); + $this->setIfExists('thuIsWorkingDay', $data ?? [], null); + $this->setIfExists('friIsWorkingDay', $data ?? [], null); + $this->setIfExists('satIsWorkingDay', $data ?? [], null); + $this->setIfExists('sunIsWorkingDay', $data ?? [], null); + $this->setIfExists('totalHours', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedHours', $data ?? [], null); + $this->setIfExists('bankHolidays', $data ?? [], null); + $this->setIfExists('proRataRule', $data ?? [], null); + $this->setIfExists('workingPatternHoursType', $data ?? [], null); + $this->setIfExists('isDefault', $data ?? [], null); + $this->setIfExists('workingPatternType', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('shiftWorkingPatternDays', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 100)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 100)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractWorkingPatternRequest., must be smaller than or equal to 100.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractWorkingPatternRequest., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets mon + * + * @return float|null + */ + public function getMon(): ?float + { + return $this->container['mon']; + } + + /** + * Sets mon + * + * @param float|null $mon mon + * + * @return $this + */ + public function setMon(?float $mon): static + { + if (is_null($mon)) { + throw new InvalidArgumentException('non-nullable mon cannot be null'); + } + $this->container['mon'] = $mon; + + return $this; + } + + /** + * Gets tue + * + * @return float|null + */ + public function getTue(): ?float + { + return $this->container['tue']; + } + + /** + * Sets tue + * + * @param float|null $tue tue + * + * @return $this + */ + public function setTue(?float $tue): static + { + if (is_null($tue)) { + throw new InvalidArgumentException('non-nullable tue cannot be null'); + } + $this->container['tue'] = $tue; + + return $this; + } + + /** + * Gets wed + * + * @return float|null + */ + public function getWed(): ?float + { + return $this->container['wed']; + } + + /** + * Sets wed + * + * @param float|null $wed wed + * + * @return $this + */ + public function setWed(?float $wed): static + { + if (is_null($wed)) { + throw new InvalidArgumentException('non-nullable wed cannot be null'); + } + $this->container['wed'] = $wed; + + return $this; + } + + /** + * Gets thu + * + * @return float|null + */ + public function getThu(): ?float + { + return $this->container['thu']; + } + + /** + * Sets thu + * + * @param float|null $thu thu + * + * @return $this + */ + public function setThu(?float $thu): static + { + if (is_null($thu)) { + throw new InvalidArgumentException('non-nullable thu cannot be null'); + } + $this->container['thu'] = $thu; + + return $this; + } + + /** + * Gets fri + * + * @return float|null + */ + public function getFri(): ?float + { + return $this->container['fri']; + } + + /** + * Sets fri + * + * @param float|null $fri fri + * + * @return $this + */ + public function setFri(?float $fri): static + { + if (is_null($fri)) { + throw new InvalidArgumentException('non-nullable fri cannot be null'); + } + $this->container['fri'] = $fri; + + return $this; + } + + /** + * Gets sat + * + * @return float|null + */ + public function getSat(): ?float + { + return $this->container['sat']; + } + + /** + * Sets sat + * + * @param float|null $sat sat + * + * @return $this + */ + public function setSat(?float $sat): static + { + if (is_null($sat)) { + throw new InvalidArgumentException('non-nullable sat cannot be null'); + } + $this->container['sat'] = $sat; + + return $this; + } + + /** + * Gets sun + * + * @return float|null + */ + public function getSun(): ?float + { + return $this->container['sun']; + } + + /** + * Sets sun + * + * @param float|null $sun sun + * + * @return $this + */ + public function setSun(?float $sun): static + { + if (is_null($sun)) { + throw new InvalidArgumentException('non-nullable sun cannot be null'); + } + $this->container['sun'] = $sun; + + return $this; + } + + /** + * Gets monIsWorkingDay + * + * @return bool|null + */ + public function getMonIsWorkingDay(): ?bool + { + return $this->container['monIsWorkingDay']; + } + + /** + * Sets monIsWorkingDay + * + * @param bool|null $monIsWorkingDay monIsWorkingDay + * + * @return $this + */ + public function setMonIsWorkingDay(?bool $monIsWorkingDay): static + { + if (is_null($monIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable monIsWorkingDay cannot be null'); + } + $this->container['monIsWorkingDay'] = $monIsWorkingDay; + + return $this; + } + + /** + * Gets tueIsWorkingDay + * + * @return bool|null + */ + public function getTueIsWorkingDay(): ?bool + { + return $this->container['tueIsWorkingDay']; + } + + /** + * Sets tueIsWorkingDay + * + * @param bool|null $tueIsWorkingDay tueIsWorkingDay + * + * @return $this + */ + public function setTueIsWorkingDay(?bool $tueIsWorkingDay): static + { + if (is_null($tueIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable tueIsWorkingDay cannot be null'); + } + $this->container['tueIsWorkingDay'] = $tueIsWorkingDay; + + return $this; + } + + /** + * Gets wedIsWorkingDay + * + * @return bool|null + */ + public function getWedIsWorkingDay(): ?bool + { + return $this->container['wedIsWorkingDay']; + } + + /** + * Sets wedIsWorkingDay + * + * @param bool|null $wedIsWorkingDay wedIsWorkingDay + * + * @return $this + */ + public function setWedIsWorkingDay(?bool $wedIsWorkingDay): static + { + if (is_null($wedIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable wedIsWorkingDay cannot be null'); + } + $this->container['wedIsWorkingDay'] = $wedIsWorkingDay; + + return $this; + } + + /** + * Gets thuIsWorkingDay + * + * @return bool|null + */ + public function getThuIsWorkingDay(): ?bool + { + return $this->container['thuIsWorkingDay']; + } + + /** + * Sets thuIsWorkingDay + * + * @param bool|null $thuIsWorkingDay thuIsWorkingDay + * + * @return $this + */ + public function setThuIsWorkingDay(?bool $thuIsWorkingDay): static + { + if (is_null($thuIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable thuIsWorkingDay cannot be null'); + } + $this->container['thuIsWorkingDay'] = $thuIsWorkingDay; + + return $this; + } + + /** + * Gets friIsWorkingDay + * + * @return bool|null + */ + public function getFriIsWorkingDay(): ?bool + { + return $this->container['friIsWorkingDay']; + } + + /** + * Sets friIsWorkingDay + * + * @param bool|null $friIsWorkingDay friIsWorkingDay + * + * @return $this + */ + public function setFriIsWorkingDay(?bool $friIsWorkingDay): static + { + if (is_null($friIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable friIsWorkingDay cannot be null'); + } + $this->container['friIsWorkingDay'] = $friIsWorkingDay; + + return $this; + } + + /** + * Gets satIsWorkingDay + * + * @return bool|null + */ + public function getSatIsWorkingDay(): ?bool + { + return $this->container['satIsWorkingDay']; + } + + /** + * Sets satIsWorkingDay + * + * @param bool|null $satIsWorkingDay satIsWorkingDay + * + * @return $this + */ + public function setSatIsWorkingDay(?bool $satIsWorkingDay): static + { + if (is_null($satIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable satIsWorkingDay cannot be null'); + } + $this->container['satIsWorkingDay'] = $satIsWorkingDay; + + return $this; + } + + /** + * Gets sunIsWorkingDay + * + * @return bool|null + */ + public function getSunIsWorkingDay(): ?bool + { + return $this->container['sunIsWorkingDay']; + } + + /** + * Sets sunIsWorkingDay + * + * @param bool|null $sunIsWorkingDay sunIsWorkingDay + * + * @return $this + */ + public function setSunIsWorkingDay(?bool $sunIsWorkingDay): static + { + if (is_null($sunIsWorkingDay)) { + throw new InvalidArgumentException('non-nullable sunIsWorkingDay cannot be null'); + } + $this->container['sunIsWorkingDay'] = $sunIsWorkingDay; + + return $this; + } + + /** + * Gets totalHours + * + * @return float|null + */ + public function getTotalHours(): ?float + { + return $this->container['totalHours']; + } + + /** + * Sets totalHours + * + * @param float|null $totalHours totalHours + * + * @return $this + */ + public function setTotalHours(?float $totalHours): static + { + if (is_null($totalHours)) { + throw new InvalidArgumentException('non-nullable totalHours cannot be null'); + } + $this->container['totalHours'] = $totalHours; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'contractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedWeeks + * + * @return float|null + */ + public function getFullTimeContractedWeeks(): ?float + { + return $this->container['fullTimeContractedWeeks']; + } + + /** + * Sets fullTimeContractedWeeks + * + * @param float|null $fullTimeContractedWeeks The amount of weeks an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedWeeks(?float $fullTimeContractedWeeks): static + { + if (is_null($fullTimeContractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedWeeks'] = $fullTimeContractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedHours + * + * @return float|null + */ + public function getFullTimeContractedHours(): ?float + { + return $this->container['fullTimeContractedHours']; + } + + /** + * Sets fullTimeContractedHours + * + * @param float|null $fullTimeContractedHours The amount of hours an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedHours(?float $fullTimeContractedHours): static + { + if (is_null($fullTimeContractedHours)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedHours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedHours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedHours'] = $fullTimeContractedHours; + + return $this; + } + + /** + * Gets bankHolidays + * + * @return \SynergiTech\Staffology\Model\BankHolidayCollection|null + */ + public function getBankHolidays(): ?\SynergiTech\Staffology\Model\BankHolidayCollection + { + return $this->container['bankHolidays']; + } + + /** + * Sets bankHolidays + * + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHolidays bankHolidays + * + * @return $this + */ + public function setBankHolidays(?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHolidays): static + { + if (is_null($bankHolidays)) { + throw new InvalidArgumentException('non-nullable bankHolidays cannot be null'); + } + $this->container['bankHolidays'] = $bankHolidays; + + return $this; + } + + /** + * Gets proRataRule + * + * @return \SynergiTech\Staffology\Model\ProRataRule|null + */ + public function getProRataRule(): ?\SynergiTech\Staffology\Model\ProRataRule + { + return $this->container['proRataRule']; + } + + /** + * Sets proRataRule + * + * @param \SynergiTech\Staffology\Model\ProRataRule|null $proRataRule proRataRule + * + * @return $this + */ + public function setProRataRule(?\SynergiTech\Staffology\Model\ProRataRule $proRataRule): static + { + if (is_null($proRataRule)) { + throw new InvalidArgumentException('non-nullable proRataRule cannot be null'); + } + $this->container['proRataRule'] = $proRataRule; + + return $this; + } + + /** + * Gets workingPatternHoursType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternHoursType|null + */ + public function getWorkingPatternHoursType(): ?\SynergiTech\Staffology\Model\WorkingPatternHoursType + { + return $this->container['workingPatternHoursType']; + } + + /** + * Sets workingPatternHoursType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternHoursType|null $workingPatternHoursType workingPatternHoursType + * + * @return $this + */ + public function setWorkingPatternHoursType(?\SynergiTech\Staffology\Model\WorkingPatternHoursType $workingPatternHoursType): static + { + if (is_null($workingPatternHoursType)) { + throw new InvalidArgumentException('non-nullable workingPatternHoursType cannot be null'); + } + $this->container['workingPatternHoursType'] = $workingPatternHoursType; + + return $this; + } + + /** + * Gets isDefault + * + * @return bool|null + */ + public function getIsDefault(): ?bool + { + return $this->container['isDefault']; + } + + /** + * Sets isDefault + * + * @param bool|null $isDefault isDefault + * + * @return $this + */ + public function setIsDefault(?bool $isDefault): static + { + if (is_null($isDefault)) { + throw new InvalidArgumentException('non-nullable isDefault cannot be null'); + } + $this->container['isDefault'] = $isDefault; + + return $this; + } + + /** + * Gets workingPatternType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternType|null + */ + public function getWorkingPatternType(): ?\SynergiTech\Staffology\Model\WorkingPatternType + { + return $this->container['workingPatternType']; + } + + /** + * Sets workingPatternType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternType|null $workingPatternType workingPatternType + * + * @return $this + */ + public function setWorkingPatternType(?\SynergiTech\Staffology\Model\WorkingPatternType $workingPatternType): static + { + if (is_null($workingPatternType)) { + throw new InvalidArgumentException('non-nullable workingPatternType cannot be null'); + } + $this->container['workingPatternType'] = $workingPatternType; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom effectiveFrom + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets shiftWorkingPatternDays + * + * @return \SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayRequest[]|null + */ + public function getShiftWorkingPatternDays(): ?array + { + return $this->container['shiftWorkingPatternDays']; + } + + /** + * Sets shiftWorkingPatternDays + * + * @param \SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayRequest[]|null $shiftWorkingPatternDays shiftWorkingPatternDays + * + * @return $this + */ + public function setShiftWorkingPatternDays(?array $shiftWorkingPatternDays): static + { + if (is_null($shiftWorkingPatternDays)) { + array_push($this->openAPINullablesSetToNull, 'shiftWorkingPatternDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shiftWorkingPatternDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shiftWorkingPatternDays'] = $shiftWorkingPatternDays; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractWorkingPatternResponse.php b/src/Model/ContractWorkingPatternResponse.php new file mode 100644 index 0000000..c09f2cc --- /dev/null +++ b/src/Model/ContractWorkingPatternResponse.php @@ -0,0 +1,1189 @@ + + */ +class ContractWorkingPatternResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.WorkingPatternResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'title' => 'string', + 'mon' => 'float', + 'tue' => 'float', + 'wed' => 'float', + 'thu' => 'float', + 'fri' => 'float', + 'sat' => 'float', + 'sun' => 'float', + 'contractedWeeks' => 'float', + 'fullTimeContractedWeeks' => 'float', + 'fullTimeContractedHours' => 'float', + 'bankHolidays' => '\SynergiTech\Staffology\Model\BankHolidayCollection', + 'proRataRule' => '\SynergiTech\Staffology\Model\ProRataRule', + 'bankHolidayDates' => '\DateTime[]', + 'workingPatternHoursType' => '\SynergiTech\Staffology\Model\WorkingPatternHoursType', + 'isDefault' => 'bool', + 'displayName' => 'string', + 'totalHours' => 'float', + 'workingPatternType' => '\SynergiTech\Staffology\Model\WorkingPatternType', + 'effectiveFrom' => '\DateTime', + 'shiftWorkingPatternDays' => '\SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'title' => null, + 'mon' => 'double', + 'tue' => 'double', + 'wed' => 'double', + 'thu' => 'double', + 'fri' => 'double', + 'sat' => 'double', + 'sun' => 'double', + 'contractedWeeks' => 'double', + 'fullTimeContractedWeeks' => 'double', + 'fullTimeContractedHours' => 'double', + 'bankHolidays' => null, + 'proRataRule' => null, + 'bankHolidayDates' => 'date-time', + 'workingPatternHoursType' => null, + 'isDefault' => null, + 'displayName' => null, + 'totalHours' => 'double', + 'workingPatternType' => null, + 'effectiveFrom' => 'date', + 'shiftWorkingPatternDays' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'mon' => false, + 'tue' => false, + 'wed' => false, + 'thu' => false, + 'fri' => false, + 'sat' => false, + 'sun' => false, + 'contractedWeeks' => true, + 'fullTimeContractedWeeks' => true, + 'fullTimeContractedHours' => true, + 'bankHolidays' => false, + 'proRataRule' => false, + 'bankHolidayDates' => true, + 'workingPatternHoursType' => false, + 'isDefault' => false, + 'displayName' => true, + 'totalHours' => false, + 'workingPatternType' => false, + 'effectiveFrom' => true, + 'shiftWorkingPatternDays' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'title' => 'title', + 'mon' => 'mon', + 'tue' => 'tue', + 'wed' => 'wed', + 'thu' => 'thu', + 'fri' => 'fri', + 'sat' => 'sat', + 'sun' => 'sun', + 'contractedWeeks' => 'contractedWeeks', + 'fullTimeContractedWeeks' => 'fullTimeContractedWeeks', + 'fullTimeContractedHours' => 'fullTimeContractedHours', + 'bankHolidays' => 'bankHolidays', + 'proRataRule' => 'proRataRule', + 'bankHolidayDates' => 'bankHolidayDates', + 'workingPatternHoursType' => 'workingPatternHoursType', + 'isDefault' => 'isDefault', + 'displayName' => 'displayName', + 'totalHours' => 'totalHours', + 'workingPatternType' => 'workingPatternType', + 'effectiveFrom' => 'effectiveFrom', + 'shiftWorkingPatternDays' => 'shiftWorkingPatternDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'title' => 'setTitle', + 'mon' => 'setMon', + 'tue' => 'setTue', + 'wed' => 'setWed', + 'thu' => 'setThu', + 'fri' => 'setFri', + 'sat' => 'setSat', + 'sun' => 'setSun', + 'contractedWeeks' => 'setContractedWeeks', + 'fullTimeContractedWeeks' => 'setFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'setFullTimeContractedHours', + 'bankHolidays' => 'setBankHolidays', + 'proRataRule' => 'setProRataRule', + 'bankHolidayDates' => 'setBankHolidayDates', + 'workingPatternHoursType' => 'setWorkingPatternHoursType', + 'isDefault' => 'setIsDefault', + 'displayName' => 'setDisplayName', + 'totalHours' => 'setTotalHours', + 'workingPatternType' => 'setWorkingPatternType', + 'effectiveFrom' => 'setEffectiveFrom', + 'shiftWorkingPatternDays' => 'setShiftWorkingPatternDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'title' => 'getTitle', + 'mon' => 'getMon', + 'tue' => 'getTue', + 'wed' => 'getWed', + 'thu' => 'getThu', + 'fri' => 'getFri', + 'sat' => 'getSat', + 'sun' => 'getSun', + 'contractedWeeks' => 'getContractedWeeks', + 'fullTimeContractedWeeks' => 'getFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'getFullTimeContractedHours', + 'bankHolidays' => 'getBankHolidays', + 'proRataRule' => 'getProRataRule', + 'bankHolidayDates' => 'getBankHolidayDates', + 'workingPatternHoursType' => 'getWorkingPatternHoursType', + 'isDefault' => 'getIsDefault', + 'displayName' => 'getDisplayName', + 'totalHours' => 'getTotalHours', + 'workingPatternType' => 'getWorkingPatternType', + 'effectiveFrom' => 'getEffectiveFrom', + 'shiftWorkingPatternDays' => 'getShiftWorkingPatternDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('mon', $data ?? [], null); + $this->setIfExists('tue', $data ?? [], null); + $this->setIfExists('wed', $data ?? [], null); + $this->setIfExists('thu', $data ?? [], null); + $this->setIfExists('fri', $data ?? [], null); + $this->setIfExists('sat', $data ?? [], null); + $this->setIfExists('sun', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedHours', $data ?? [], null); + $this->setIfExists('bankHolidays', $data ?? [], null); + $this->setIfExists('proRataRule', $data ?? [], null); + $this->setIfExists('bankHolidayDates', $data ?? [], null); + $this->setIfExists('workingPatternHoursType', $data ?? [], null); + $this->setIfExists('isDefault', $data ?? [], null); + $this->setIfExists('displayName', $data ?? [], null); + $this->setIfExists('totalHours', $data ?? [], null); + $this->setIfExists('workingPatternType', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('shiftWorkingPatternDays', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 100)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 100)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractWorkingPatternResponse., must be smaller than or equal to 100.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling ContractWorkingPatternResponse., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets mon + * + * @return float|null + */ + public function getMon(): ?float + { + return $this->container['mon']; + } + + /** + * Sets mon + * + * @param float|null $mon mon + * + * @return $this + */ + public function setMon(?float $mon): static + { + if (is_null($mon)) { + throw new InvalidArgumentException('non-nullable mon cannot be null'); + } + $this->container['mon'] = $mon; + + return $this; + } + + /** + * Gets tue + * + * @return float|null + */ + public function getTue(): ?float + { + return $this->container['tue']; + } + + /** + * Sets tue + * + * @param float|null $tue tue + * + * @return $this + */ + public function setTue(?float $tue): static + { + if (is_null($tue)) { + throw new InvalidArgumentException('non-nullable tue cannot be null'); + } + $this->container['tue'] = $tue; + + return $this; + } + + /** + * Gets wed + * + * @return float|null + */ + public function getWed(): ?float + { + return $this->container['wed']; + } + + /** + * Sets wed + * + * @param float|null $wed wed + * + * @return $this + */ + public function setWed(?float $wed): static + { + if (is_null($wed)) { + throw new InvalidArgumentException('non-nullable wed cannot be null'); + } + $this->container['wed'] = $wed; + + return $this; + } + + /** + * Gets thu + * + * @return float|null + */ + public function getThu(): ?float + { + return $this->container['thu']; + } + + /** + * Sets thu + * + * @param float|null $thu thu + * + * @return $this + */ + public function setThu(?float $thu): static + { + if (is_null($thu)) { + throw new InvalidArgumentException('non-nullable thu cannot be null'); + } + $this->container['thu'] = $thu; + + return $this; + } + + /** + * Gets fri + * + * @return float|null + */ + public function getFri(): ?float + { + return $this->container['fri']; + } + + /** + * Sets fri + * + * @param float|null $fri fri + * + * @return $this + */ + public function setFri(?float $fri): static + { + if (is_null($fri)) { + throw new InvalidArgumentException('non-nullable fri cannot be null'); + } + $this->container['fri'] = $fri; + + return $this; + } + + /** + * Gets sat + * + * @return float|null + */ + public function getSat(): ?float + { + return $this->container['sat']; + } + + /** + * Sets sat + * + * @param float|null $sat sat + * + * @return $this + */ + public function setSat(?float $sat): static + { + if (is_null($sat)) { + throw new InvalidArgumentException('non-nullable sat cannot be null'); + } + $this->container['sat'] = $sat; + + return $this; + } + + /** + * Gets sun + * + * @return float|null + */ + public function getSun(): ?float + { + return $this->container['sun']; + } + + /** + * Sets sun + * + * @param float|null $sun sun + * + * @return $this + */ + public function setSun(?float $sun): static + { + if (is_null($sun)) { + throw new InvalidArgumentException('non-nullable sun cannot be null'); + } + $this->container['sun'] = $sun; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'contractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedWeeks + * + * @return float|null + */ + public function getFullTimeContractedWeeks(): ?float + { + return $this->container['fullTimeContractedWeeks']; + } + + /** + * Sets fullTimeContractedWeeks + * + * @param float|null $fullTimeContractedWeeks The amount of weeks an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedWeeks(?float $fullTimeContractedWeeks): static + { + if (is_null($fullTimeContractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedWeeks'] = $fullTimeContractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedHours + * + * @return float|null + */ + public function getFullTimeContractedHours(): ?float + { + return $this->container['fullTimeContractedHours']; + } + + /** + * Sets fullTimeContractedHours + * + * @param float|null $fullTimeContractedHours The amount of hours an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedHours(?float $fullTimeContractedHours): static + { + if (is_null($fullTimeContractedHours)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedHours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedHours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedHours'] = $fullTimeContractedHours; + + return $this; + } + + /** + * Gets bankHolidays + * + * @return \SynergiTech\Staffology\Model\BankHolidayCollection|null + */ + public function getBankHolidays(): ?\SynergiTech\Staffology\Model\BankHolidayCollection + { + return $this->container['bankHolidays']; + } + + /** + * Sets bankHolidays + * + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHolidays bankHolidays + * + * @return $this + */ + public function setBankHolidays(?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHolidays): static + { + if (is_null($bankHolidays)) { + throw new InvalidArgumentException('non-nullable bankHolidays cannot be null'); + } + $this->container['bankHolidays'] = $bankHolidays; + + return $this; + } + + /** + * Gets proRataRule + * + * @return \SynergiTech\Staffology\Model\ProRataRule|null + */ + public function getProRataRule(): ?\SynergiTech\Staffology\Model\ProRataRule + { + return $this->container['proRataRule']; + } + + /** + * Sets proRataRule + * + * @param \SynergiTech\Staffology\Model\ProRataRule|null $proRataRule proRataRule + * + * @return $this + */ + public function setProRataRule(?\SynergiTech\Staffology\Model\ProRataRule $proRataRule): static + { + if (is_null($proRataRule)) { + throw new InvalidArgumentException('non-nullable proRataRule cannot be null'); + } + $this->container['proRataRule'] = $proRataRule; + + return $this; + } + + /** + * Gets bankHolidayDates + * + * @return \DateTime[]|null + */ + public function getBankHolidayDates(): ?array + { + return $this->container['bankHolidayDates']; + } + + /** + * Sets bankHolidayDates + * + * @param \DateTime[]|null $bankHolidayDates [readonly] The dates that are classed as Bank Holidays for this Working Pattern + * + * @return $this + */ + public function setBankHolidayDates(?array $bankHolidayDates): static + { + if (is_null($bankHolidayDates)) { + array_push($this->openAPINullablesSetToNull, 'bankHolidayDates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankHolidayDates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankHolidayDates'] = $bankHolidayDates; + + return $this; + } + + /** + * Gets workingPatternHoursType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternHoursType|null + */ + public function getWorkingPatternHoursType(): ?\SynergiTech\Staffology\Model\WorkingPatternHoursType + { + return $this->container['workingPatternHoursType']; + } + + /** + * Sets workingPatternHoursType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternHoursType|null $workingPatternHoursType workingPatternHoursType + * + * @return $this + */ + public function setWorkingPatternHoursType(?\SynergiTech\Staffology\Model\WorkingPatternHoursType $workingPatternHoursType): static + { + if (is_null($workingPatternHoursType)) { + throw new InvalidArgumentException('non-nullable workingPatternHoursType cannot be null'); + } + $this->container['workingPatternHoursType'] = $workingPatternHoursType; + + return $this; + } + + /** + * Gets isDefault + * + * @return bool|null + */ + public function getIsDefault(): ?bool + { + return $this->container['isDefault']; + } + + /** + * Sets isDefault + * + * @param bool|null $isDefault isDefault + * + * @return $this + */ + public function setIsDefault(?bool $isDefault): static + { + if (is_null($isDefault)) { + throw new InvalidArgumentException('non-nullable isDefault cannot be null'); + } + $this->container['isDefault'] = $isDefault; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName(): ?string + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName displayName + * + * @return $this + */ + public function setDisplayName(?string $displayName): static + { + if (is_null($displayName)) { + array_push($this->openAPINullablesSetToNull, 'displayName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets totalHours + * + * @return float|null + */ + public function getTotalHours(): ?float + { + return $this->container['totalHours']; + } + + /** + * Sets totalHours + * + * @param float|null $totalHours totalHours + * + * @return $this + */ + public function setTotalHours(?float $totalHours): static + { + if (is_null($totalHours)) { + throw new InvalidArgumentException('non-nullable totalHours cannot be null'); + } + $this->container['totalHours'] = $totalHours; + + return $this; + } + + /** + * Gets workingPatternType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternType|null + */ + public function getWorkingPatternType(): ?\SynergiTech\Staffology\Model\WorkingPatternType + { + return $this->container['workingPatternType']; + } + + /** + * Sets workingPatternType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternType|null $workingPatternType workingPatternType + * + * @return $this + */ + public function setWorkingPatternType(?\SynergiTech\Staffology\Model\WorkingPatternType $workingPatternType): static + { + if (is_null($workingPatternType)) { + throw new InvalidArgumentException('non-nullable workingPatternType cannot be null'); + } + $this->container['workingPatternType'] = $workingPatternType; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom effectiveFrom + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets shiftWorkingPatternDays + * + * @return \SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayResponse[]|null + */ + public function getShiftWorkingPatternDays(): ?array + { + return $this->container['shiftWorkingPatternDays']; + } + + /** + * Sets shiftWorkingPatternDays + * + * @param \SynergiTech\Staffology\Model\ContractShiftWorkingPatternDayResponse[]|null $shiftWorkingPatternDays shiftWorkingPatternDays + * + * @return $this + */ + public function setShiftWorkingPatternDays(?array $shiftWorkingPatternDays): static + { + if (is_null($shiftWorkingPatternDays)) { + array_push($this->openAPINullablesSetToNull, 'shiftWorkingPatternDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shiftWorkingPatternDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shiftWorkingPatternDays'] = $shiftWorkingPatternDays; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractYearsServiceEntitlementRequest.php b/src/Model/ContractYearsServiceEntitlementRequest.php new file mode 100644 index 0000000..67ea4c6 --- /dev/null +++ b/src/Model/ContractYearsServiceEntitlementRequest.php @@ -0,0 +1,456 @@ + + */ +class ContractYearsServiceEntitlementRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.YearsServiceEntitlementRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'yearsService' => 'int', + 'totalAdditionalDaysHoliday' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'yearsService' => 'int32', + 'totalAdditionalDaysHoliday' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'yearsService' => true, + 'totalAdditionalDaysHoliday' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'yearsService' => 'yearsService', + 'totalAdditionalDaysHoliday' => 'totalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'yearsService' => 'setYearsService', + 'totalAdditionalDaysHoliday' => 'setTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'yearsService' => 'getYearsService', + 'totalAdditionalDaysHoliday' => 'getTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('yearsService', $data ?? [], null); + $this->setIfExists('totalAdditionalDaysHoliday', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets yearsService + * + * @return int|null + */ + public function getYearsService(): ?int + { + return $this->container['yearsService']; + } + + /** + * Sets yearsService + * + * @param int|null $yearsService Number of years of service. + * + * @return $this + */ + public function setYearsService(?int $yearsService): static + { + if (is_null($yearsService)) { + array_push($this->openAPINullablesSetToNull, 'yearsService'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsService', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsService'] = $yearsService; + + return $this; + } + + /** + * Gets totalAdditionalDaysHoliday + * + * @return float|null + */ + public function getTotalAdditionalDaysHoliday(): ?float + { + return $this->container['totalAdditionalDaysHoliday']; + } + + /** + * Sets totalAdditionalDaysHoliday + * + * @param float|null $totalAdditionalDaysHoliday Total additional days of holiday entitlement. + * + * @return $this + */ + public function setTotalAdditionalDaysHoliday(?float $totalAdditionalDaysHoliday): static + { + if (is_null($totalAdditionalDaysHoliday)) { + array_push($this->openAPINullablesSetToNull, 'totalAdditionalDaysHoliday'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalAdditionalDaysHoliday', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalAdditionalDaysHoliday'] = $totalAdditionalDaysHoliday; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractYearsServiceEntitlementResponse.php b/src/Model/ContractYearsServiceEntitlementResponse.php new file mode 100644 index 0000000..4983507 --- /dev/null +++ b/src/Model/ContractYearsServiceEntitlementResponse.php @@ -0,0 +1,490 @@ + + */ +class ContractYearsServiceEntitlementResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.YearsServiceEntitlementResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'yearsService' => 'int', + 'totalAdditionalDaysHoliday' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'yearsService' => 'int32', + 'totalAdditionalDaysHoliday' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'yearsService' => true, + 'totalAdditionalDaysHoliday' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'yearsService' => 'yearsService', + 'totalAdditionalDaysHoliday' => 'totalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'yearsService' => 'setYearsService', + 'totalAdditionalDaysHoliday' => 'setTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'yearsService' => 'getYearsService', + 'totalAdditionalDaysHoliday' => 'getTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('yearsService', $data ?? [], null); + $this->setIfExists('totalAdditionalDaysHoliday', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique identifier for the Years Service Entitlement. + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets yearsService + * + * @return int|null + */ + public function getYearsService(): ?int + { + return $this->container['yearsService']; + } + + /** + * Sets yearsService + * + * @param int|null $yearsService Number of years of service. + * + * @return $this + */ + public function setYearsService(?int $yearsService): static + { + if (is_null($yearsService)) { + array_push($this->openAPINullablesSetToNull, 'yearsService'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsService', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsService'] = $yearsService; + + return $this; + } + + /** + * Gets totalAdditionalDaysHoliday + * + * @return float|null + */ + public function getTotalAdditionalDaysHoliday(): ?float + { + return $this->container['totalAdditionalDaysHoliday']; + } + + /** + * Sets totalAdditionalDaysHoliday + * + * @param float|null $totalAdditionalDaysHoliday Total additional days of holiday entitlement. + * + * @return $this + */ + public function setTotalAdditionalDaysHoliday(?float $totalAdditionalDaysHoliday): static + { + if (is_null($totalAdditionalDaysHoliday)) { + array_push($this->openAPINullablesSetToNull, 'totalAdditionalDaysHoliday'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalAdditionalDaysHoliday', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalAdditionalDaysHoliday'] = $totalAdditionalDaysHoliday; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ContractYearsServiceEntitlementUpdateRequest.php b/src/Model/ContractYearsServiceEntitlementUpdateRequest.php new file mode 100644 index 0000000..c112f49 --- /dev/null +++ b/src/Model/ContractYearsServiceEntitlementUpdateRequest.php @@ -0,0 +1,490 @@ + + */ +class ContractYearsServiceEntitlementUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Contract.YearsServiceEntitlementUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'uniqueId' => 'string', + 'yearsService' => 'int', + 'totalAdditionalDaysHoliday' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'uniqueId' => 'uuid', + 'yearsService' => 'int32', + 'totalAdditionalDaysHoliday' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'uniqueId' => false, + 'yearsService' => true, + 'totalAdditionalDaysHoliday' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'uniqueId' => 'uniqueId', + 'yearsService' => 'yearsService', + 'totalAdditionalDaysHoliday' => 'totalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'uniqueId' => 'setUniqueId', + 'yearsService' => 'setYearsService', + 'totalAdditionalDaysHoliday' => 'setTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'uniqueId' => 'getUniqueId', + 'yearsService' => 'getYearsService', + 'totalAdditionalDaysHoliday' => 'getTotalAdditionalDaysHoliday' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('uniqueId', $data ?? [], null); + $this->setIfExists('yearsService', $data ?? [], null); + $this->setIfExists('totalAdditionalDaysHoliday', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uniqueId + * + * @return string|null + */ + public function getUniqueId(): ?string + { + return $this->container['uniqueId']; + } + + /** + * Sets uniqueId + * + * @param string|null $uniqueId Unique identifier for the request. + * + * @return $this + */ + public function setUniqueId(?string $uniqueId): static + { + if (is_null($uniqueId)) { + throw new InvalidArgumentException('non-nullable uniqueId cannot be null'); + } + $this->container['uniqueId'] = $uniqueId; + + return $this; + } + + /** + * Gets yearsService + * + * @return int|null + */ + public function getYearsService(): ?int + { + return $this->container['yearsService']; + } + + /** + * Sets yearsService + * + * @param int|null $yearsService Number of years of service. + * + * @return $this + */ + public function setYearsService(?int $yearsService): static + { + if (is_null($yearsService)) { + array_push($this->openAPINullablesSetToNull, 'yearsService'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearsService', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearsService'] = $yearsService; + + return $this; + } + + /** + * Gets totalAdditionalDaysHoliday + * + * @return float|null + */ + public function getTotalAdditionalDaysHoliday(): ?float + { + return $this->container['totalAdditionalDaysHoliday']; + } + + /** + * Sets totalAdditionalDaysHoliday + * + * @param float|null $totalAdditionalDaysHoliday Total additional days of holiday entitlement. + * + * @return $this + */ + public function setTotalAdditionalDaysHoliday(?float $totalAdditionalDaysHoliday): static + { + if (is_null($totalAdditionalDaysHoliday)) { + array_push($this->openAPINullablesSetToNull, 'totalAdditionalDaysHoliday'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalAdditionalDaysHoliday', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalAdditionalDaysHoliday'] = $totalAdditionalDaysHoliday; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostAnalysisReport.php b/src/Model/CostAnalysisReport.php new file mode 100644 index 0000000..fc8fb37 --- /dev/null +++ b/src/Model/CostAnalysisReport.php @@ -0,0 +1,1279 @@ + + */ +class CostAnalysisReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostAnalysisReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'singlePayrun' => '\SynergiTech\Staffology\Model\PayRun', + 'totalPay' => 'float', + 'pension' => 'float', + 'aeoFees' => 'float', + 'totalCost' => 'float', + 'employerNic' => 'float', + 'netPayrollCost' => 'float', + 'maleCount' => 'int', + 'femaleCount' => 'int', + 'leaverCount' => 'int', + 'joinerCount' => 'int', + 'paymentAfterLeavingCount' => 'int', + 'recoverableAmounts' => '\SynergiTech\Staffology\Model\RecoverableAmounts', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'singlePayrun' => null, + 'totalPay' => 'double', + 'pension' => 'double', + 'aeoFees' => 'double', + 'totalCost' => 'double', + 'employerNic' => 'double', + 'netPayrollCost' => 'double', + 'maleCount' => 'int32', + 'femaleCount' => 'int32', + 'leaverCount' => 'int32', + 'joinerCount' => 'int32', + 'paymentAfterLeavingCount' => 'int32', + 'recoverableAmounts' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'singlePayrun' => false, + 'totalPay' => false, + 'pension' => false, + 'aeoFees' => false, + 'totalCost' => false, + 'employerNic' => false, + 'netPayrollCost' => false, + 'maleCount' => false, + 'femaleCount' => false, + 'leaverCount' => false, + 'joinerCount' => false, + 'paymentAfterLeavingCount' => false, + 'recoverableAmounts' => false, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'singlePayrun' => 'singlePayrun', + 'totalPay' => 'totalPay', + 'pension' => 'pension', + 'aeoFees' => 'aeoFees', + 'totalCost' => 'totalCost', + 'employerNic' => 'employerNic', + 'netPayrollCost' => 'netPayrollCost', + 'maleCount' => 'maleCount', + 'femaleCount' => 'femaleCount', + 'leaverCount' => 'leaverCount', + 'joinerCount' => 'joinerCount', + 'paymentAfterLeavingCount' => 'paymentAfterLeavingCount', + 'recoverableAmounts' => 'recoverableAmounts', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'singlePayrun' => 'setSinglePayrun', + 'totalPay' => 'setTotalPay', + 'pension' => 'setPension', + 'aeoFees' => 'setAeoFees', + 'totalCost' => 'setTotalCost', + 'employerNic' => 'setEmployerNic', + 'netPayrollCost' => 'setNetPayrollCost', + 'maleCount' => 'setMaleCount', + 'femaleCount' => 'setFemaleCount', + 'leaverCount' => 'setLeaverCount', + 'joinerCount' => 'setJoinerCount', + 'paymentAfterLeavingCount' => 'setPaymentAfterLeavingCount', + 'recoverableAmounts' => 'setRecoverableAmounts', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'singlePayrun' => 'getSinglePayrun', + 'totalPay' => 'getTotalPay', + 'pension' => 'getPension', + 'aeoFees' => 'getAeoFees', + 'totalCost' => 'getTotalCost', + 'employerNic' => 'getEmployerNic', + 'netPayrollCost' => 'getNetPayrollCost', + 'maleCount' => 'getMaleCount', + 'femaleCount' => 'getFemaleCount', + 'leaverCount' => 'getLeaverCount', + 'joinerCount' => 'getJoinerCount', + 'paymentAfterLeavingCount' => 'getPaymentAfterLeavingCount', + 'recoverableAmounts' => 'getRecoverableAmounts', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('singlePayrun', $data ?? [], null); + $this->setIfExists('totalPay', $data ?? [], null); + $this->setIfExists('pension', $data ?? [], null); + $this->setIfExists('aeoFees', $data ?? [], null); + $this->setIfExists('totalCost', $data ?? [], null); + $this->setIfExists('employerNic', $data ?? [], null); + $this->setIfExists('netPayrollCost', $data ?? [], null); + $this->setIfExists('maleCount', $data ?? [], null); + $this->setIfExists('femaleCount', $data ?? [], null); + $this->setIfExists('leaverCount', $data ?? [], null); + $this->setIfExists('joinerCount', $data ?? [], null); + $this->setIfExists('paymentAfterLeavingCount', $data ?? [], null); + $this->setIfExists('recoverableAmounts', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets singlePayrun + * + * @return \SynergiTech\Staffology\Model\PayRun|null + */ + public function getSinglePayrun(): ?\SynergiTech\Staffology\Model\PayRun + { + return $this->container['singlePayrun']; + } + + /** + * Sets singlePayrun + * + * @param \SynergiTech\Staffology\Model\PayRun|null $singlePayrun singlePayrun + * + * @return $this + */ + public function setSinglePayrun(?\SynergiTech\Staffology\Model\PayRun $singlePayrun): static + { + if (is_null($singlePayrun)) { + throw new InvalidArgumentException('non-nullable singlePayrun cannot be null'); + } + $this->container['singlePayrun'] = $singlePayrun; + + return $this; + } + + /** + * Gets totalPay + * + * @return float|null + */ + public function getTotalPay(): ?float + { + return $this->container['totalPay']; + } + + /** + * Sets totalPay + * + * @param float|null $totalPay totalPay + * + * @return $this + */ + public function setTotalPay(?float $totalPay): static + { + if (is_null($totalPay)) { + throw new InvalidArgumentException('non-nullable totalPay cannot be null'); + } + $this->container['totalPay'] = $totalPay; + + return $this; + } + + /** + * Gets pension + * + * @return float|null + */ + public function getPension(): ?float + { + return $this->container['pension']; + } + + /** + * Sets pension + * + * @param float|null $pension pension + * + * @return $this + */ + public function setPension(?float $pension): static + { + if (is_null($pension)) { + throw new InvalidArgumentException('non-nullable pension cannot be null'); + } + $this->container['pension'] = $pension; + + return $this; + } + + /** + * Gets aeoFees + * + * @return float|null + */ + public function getAeoFees(): ?float + { + return $this->container['aeoFees']; + } + + /** + * Sets aeoFees + * + * @param float|null $aeoFees aeoFees + * + * @return $this + */ + public function setAeoFees(?float $aeoFees): static + { + if (is_null($aeoFees)) { + throw new InvalidArgumentException('non-nullable aeoFees cannot be null'); + } + $this->container['aeoFees'] = $aeoFees; + + return $this; + } + + /** + * Gets totalCost + * + * @return float|null + */ + public function getTotalCost(): ?float + { + return $this->container['totalCost']; + } + + /** + * Sets totalCost + * + * @param float|null $totalCost totalCost + * + * @return $this + */ + public function setTotalCost(?float $totalCost): static + { + if (is_null($totalCost)) { + throw new InvalidArgumentException('non-nullable totalCost cannot be null'); + } + $this->container['totalCost'] = $totalCost; + + return $this; + } + + /** + * Gets employerNic + * + * @return float|null + */ + public function getEmployerNic(): ?float + { + return $this->container['employerNic']; + } + + /** + * Sets employerNic + * + * @param float|null $employerNic employerNic + * + * @return $this + */ + public function setEmployerNic(?float $employerNic): static + { + if (is_null($employerNic)) { + throw new InvalidArgumentException('non-nullable employerNic cannot be null'); + } + $this->container['employerNic'] = $employerNic; + + return $this; + } + + /** + * Gets netPayrollCost + * + * @return float|null + */ + public function getNetPayrollCost(): ?float + { + return $this->container['netPayrollCost']; + } + + /** + * Sets netPayrollCost + * + * @param float|null $netPayrollCost netPayrollCost + * + * @return $this + */ + public function setNetPayrollCost(?float $netPayrollCost): static + { + if (is_null($netPayrollCost)) { + throw new InvalidArgumentException('non-nullable netPayrollCost cannot be null'); + } + $this->container['netPayrollCost'] = $netPayrollCost; + + return $this; + } + + /** + * Gets maleCount + * + * @return int|null + */ + public function getMaleCount(): ?int + { + return $this->container['maleCount']; + } + + /** + * Sets maleCount + * + * @param int|null $maleCount maleCount + * + * @return $this + */ + public function setMaleCount(?int $maleCount): static + { + if (is_null($maleCount)) { + throw new InvalidArgumentException('non-nullable maleCount cannot be null'); + } + $this->container['maleCount'] = $maleCount; + + return $this; + } + + /** + * Gets femaleCount + * + * @return int|null + */ + public function getFemaleCount(): ?int + { + return $this->container['femaleCount']; + } + + /** + * Sets femaleCount + * + * @param int|null $femaleCount femaleCount + * + * @return $this + */ + public function setFemaleCount(?int $femaleCount): static + { + if (is_null($femaleCount)) { + throw new InvalidArgumentException('non-nullable femaleCount cannot be null'); + } + $this->container['femaleCount'] = $femaleCount; + + return $this; + } + + /** + * Gets leaverCount + * + * @return int|null + */ + public function getLeaverCount(): ?int + { + return $this->container['leaverCount']; + } + + /** + * Sets leaverCount + * + * @param int|null $leaverCount leaverCount + * + * @return $this + */ + public function setLeaverCount(?int $leaverCount): static + { + if (is_null($leaverCount)) { + throw new InvalidArgumentException('non-nullable leaverCount cannot be null'); + } + $this->container['leaverCount'] = $leaverCount; + + return $this; + } + + /** + * Gets joinerCount + * + * @return int|null + */ + public function getJoinerCount(): ?int + { + return $this->container['joinerCount']; + } + + /** + * Sets joinerCount + * + * @param int|null $joinerCount joinerCount + * + * @return $this + */ + public function setJoinerCount(?int $joinerCount): static + { + if (is_null($joinerCount)) { + throw new InvalidArgumentException('non-nullable joinerCount cannot be null'); + } + $this->container['joinerCount'] = $joinerCount; + + return $this; + } + + /** + * Gets paymentAfterLeavingCount + * + * @return int|null + */ + public function getPaymentAfterLeavingCount(): ?int + { + return $this->container['paymentAfterLeavingCount']; + } + + /** + * Sets paymentAfterLeavingCount + * + * @param int|null $paymentAfterLeavingCount paymentAfterLeavingCount + * + * @return $this + */ + public function setPaymentAfterLeavingCount(?int $paymentAfterLeavingCount): static + { + if (is_null($paymentAfterLeavingCount)) { + throw new InvalidArgumentException('non-nullable paymentAfterLeavingCount cannot be null'); + } + $this->container['paymentAfterLeavingCount'] = $paymentAfterLeavingCount; + + return $this; + } + + /** + * Gets recoverableAmounts + * + * @return \SynergiTech\Staffology\Model\RecoverableAmounts|null + */ + public function getRecoverableAmounts(): ?\SynergiTech\Staffology\Model\RecoverableAmounts + { + return $this->container['recoverableAmounts']; + } + + /** + * Sets recoverableAmounts + * + * @param \SynergiTech\Staffology\Model\RecoverableAmounts|null $recoverableAmounts recoverableAmounts + * + * @return $this + */ + public function setRecoverableAmounts(?\SynergiTech\Staffology\Model\RecoverableAmounts $recoverableAmounts): static + { + if (is_null($recoverableAmounts)) { + throw new InvalidArgumentException('non-nullable recoverableAmounts cannot be null'); + } + $this->container['recoverableAmounts'] = $recoverableAmounts; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostAnalysisReportReportResponse.php b/src/Model/CostAnalysisReportReportResponse.php new file mode 100644 index 0000000..72ab818 --- /dev/null +++ b/src/Model/CostAnalysisReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class CostAnalysisReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostAnalysisReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\CostAnalysisReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\CostAnalysisReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\CostAnalysisReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\CostAnalysisReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\CostAnalysisReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostCentre.php b/src/Model/CostCentre.php new file mode 100644 index 0000000..89a97a9 --- /dev/null +++ b/src/Model/CostCentre.php @@ -0,0 +1,644 @@ + + */ +class CostCentre implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostCentre'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'accountingCode' => 'string', + 'employeeCount' => 'int', + 'hasJournalOverrides' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null, + 'accountingCode' => null, + 'employeeCount' => 'int32', + 'hasJournalOverrides' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'title' => false, + 'color' => true, + 'accountingCode' => true, + 'employeeCount' => false, + 'hasJournalOverrides' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'accountingCode' => 'accountingCode', + 'employeeCount' => 'employeeCount', + 'hasJournalOverrides' => 'hasJournalOverrides' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'accountingCode' => 'setAccountingCode', + 'employeeCount' => 'setEmployeeCount', + 'hasJournalOverrides' => 'setHasJournalOverrides' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'accountingCode' => 'getAccountingCode', + 'employeeCount' => 'getEmployeeCount', + 'hasJournalOverrides' => 'getHasJournalOverrides' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('hasJournalOverrides', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['accountingCode']) && (mb_strlen($this->container['accountingCode']) > 50)) { + $invalidProperties[] = "invalid value for 'accountingCode', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this Cost Centre + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling CostCentre., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling CostCentre., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Cost Centre + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling CostCentre., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling CostCentre., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Cost Centre, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling CostCentre., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountingCode) && (mb_strlen($accountingCode) > 50)) { + throw new InvalidArgumentException('invalid length for $accountingCode when calling CostCentre., must be smaller than or equal to 50.'); + } + + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of employees with this set as their primary cost centre + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets hasJournalOverrides + * + * @return bool|null + */ + public function getHasJournalOverrides(): ?bool + { + return $this->container['hasJournalOverrides']; + } + + /** + * Sets hasJournalOverrides + * + * @param bool|null $hasJournalOverrides Has Journal Overrides + * + * @return $this + */ + public function setHasJournalOverrides(?bool $hasJournalOverrides): static + { + if (is_null($hasJournalOverrides)) { + throw new InvalidArgumentException('non-nullable hasJournalOverrides cannot be null'); + } + $this->container['hasJournalOverrides'] = $hasJournalOverrides; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostOfEmploymentReport.php b/src/Model/CostOfEmploymentReport.php new file mode 100644 index 0000000..ccc7e17 --- /dev/null +++ b/src/Model/CostOfEmploymentReport.php @@ -0,0 +1,912 @@ + + */ +class CostOfEmploymentReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostOfEmploymentReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'hasDepartments' => 'bool', + 'lines' => '\SynergiTech\Staffology\Model\CostOfEmploymentReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'hasDepartments' => null, + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'hasDepartments' => false, + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'hasDepartments' => 'hasDepartments', + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'hasDepartments' => 'setHasDepartments', + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'hasDepartments' => 'getHasDepartments', + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('hasDepartments', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasDepartments + * + * @return bool|null + */ + public function getHasDepartments(): ?bool + { + return $this->container['hasDepartments']; + } + + /** + * Sets hasDepartments + * + * @param bool|null $hasDepartments hasDepartments + * + * @return $this + */ + public function setHasDepartments(?bool $hasDepartments): static + { + if (is_null($hasDepartments)) { + throw new InvalidArgumentException('non-nullable hasDepartments cannot be null'); + } + $this->container['hasDepartments'] = $hasDepartments; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\CostOfEmploymentReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\CostOfEmploymentReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostOfEmploymentReportLine.php b/src/Model/CostOfEmploymentReportLine.php new file mode 100644 index 0000000..492b5a9 --- /dev/null +++ b/src/Model/CostOfEmploymentReportLine.php @@ -0,0 +1,694 @@ + + */ +class CostOfEmploymentReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostOfEmploymentReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pay' => 'float', + 'employerNic' => 'float', + 'pension' => 'float', + 'aeoFees' => 'float', + 'statPayReclaim' => 'float', + 'totalCost' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pay' => 'double', + 'employerNic' => 'double', + 'pension' => 'double', + 'aeoFees' => 'double', + 'statPayReclaim' => 'double', + 'totalCost' => 'double', + 'employee' => null, + 'payrollCode' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pay' => false, + 'employerNic' => false, + 'pension' => false, + 'aeoFees' => false, + 'statPayReclaim' => false, + 'totalCost' => false, + 'employee' => false, + 'payrollCode' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pay' => 'pay', + 'employerNic' => 'employerNic', + 'pension' => 'pension', + 'aeoFees' => 'aeoFees', + 'statPayReclaim' => 'statPayReclaim', + 'totalCost' => 'totalCost', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pay' => 'setPay', + 'employerNic' => 'setEmployerNic', + 'pension' => 'setPension', + 'aeoFees' => 'setAeoFees', + 'statPayReclaim' => 'setStatPayReclaim', + 'totalCost' => 'setTotalCost', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pay' => 'getPay', + 'employerNic' => 'getEmployerNic', + 'pension' => 'getPension', + 'aeoFees' => 'getAeoFees', + 'statPayReclaim' => 'getStatPayReclaim', + 'totalCost' => 'getTotalCost', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pay', $data ?? [], null); + $this->setIfExists('employerNic', $data ?? [], null); + $this->setIfExists('pension', $data ?? [], null); + $this->setIfExists('aeoFees', $data ?? [], null); + $this->setIfExists('statPayReclaim', $data ?? [], null); + $this->setIfExists('totalCost', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pay + * + * @return float|null + */ + public function getPay(): ?float + { + return $this->container['pay']; + } + + /** + * Sets pay + * + * @param float|null $pay pay + * + * @return $this + */ + public function setPay(?float $pay): static + { + if (is_null($pay)) { + throw new InvalidArgumentException('non-nullable pay cannot be null'); + } + $this->container['pay'] = $pay; + + return $this; + } + + /** + * Gets employerNic + * + * @return float|null + */ + public function getEmployerNic(): ?float + { + return $this->container['employerNic']; + } + + /** + * Sets employerNic + * + * @param float|null $employerNic employerNic + * + * @return $this + */ + public function setEmployerNic(?float $employerNic): static + { + if (is_null($employerNic)) { + throw new InvalidArgumentException('non-nullable employerNic cannot be null'); + } + $this->container['employerNic'] = $employerNic; + + return $this; + } + + /** + * Gets pension + * + * @return float|null + */ + public function getPension(): ?float + { + return $this->container['pension']; + } + + /** + * Sets pension + * + * @param float|null $pension pension + * + * @return $this + */ + public function setPension(?float $pension): static + { + if (is_null($pension)) { + throw new InvalidArgumentException('non-nullable pension cannot be null'); + } + $this->container['pension'] = $pension; + + return $this; + } + + /** + * Gets aeoFees + * + * @return float|null + */ + public function getAeoFees(): ?float + { + return $this->container['aeoFees']; + } + + /** + * Sets aeoFees + * + * @param float|null $aeoFees aeoFees + * + * @return $this + */ + public function setAeoFees(?float $aeoFees): static + { + if (is_null($aeoFees)) { + throw new InvalidArgumentException('non-nullable aeoFees cannot be null'); + } + $this->container['aeoFees'] = $aeoFees; + + return $this; + } + + /** + * Gets statPayReclaim + * + * @return float|null + */ + public function getStatPayReclaim(): ?float + { + return $this->container['statPayReclaim']; + } + + /** + * Sets statPayReclaim + * + * @param float|null $statPayReclaim statPayReclaim + * + * @return $this + */ + public function setStatPayReclaim(?float $statPayReclaim): static + { + if (is_null($statPayReclaim)) { + throw new InvalidArgumentException('non-nullable statPayReclaim cannot be null'); + } + $this->container['statPayReclaim'] = $statPayReclaim; + + return $this; + } + + /** + * Gets totalCost + * + * @return float|null + */ + public function getTotalCost(): ?float + { + return $this->container['totalCost']; + } + + /** + * Sets totalCost + * + * @param float|null $totalCost totalCost + * + * @return $this + */ + public function setTotalCost(?float $totalCost): static + { + if (is_null($totalCost)) { + throw new InvalidArgumentException('non-nullable totalCost cannot be null'); + } + $this->container['totalCost'] = $totalCost; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CostOfEmploymentReportReportResponse.php b/src/Model/CostOfEmploymentReportReportResponse.php new file mode 100644 index 0000000..943f800 --- /dev/null +++ b/src/Model/CostOfEmploymentReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class CostOfEmploymentReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CostOfEmploymentReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\CostOfEmploymentReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\CostOfEmploymentReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\CostOfEmploymentReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\CostOfEmploymentReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\CostOfEmploymentReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Country.php b/src/Model/Country.php new file mode 100644 index 0000000..edbcbcf --- /dev/null +++ b/src/Model/Country.php @@ -0,0 +1,53 @@ + + */ +class DecimalTaxYearConfigPrimitiveValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DecimalTaxYearConfigPrimitiveValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'value' => 'float', + 'effectiveFrom' => '\DateTime', + 'midYearChanges' => '\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'value' => 'double', + 'effectiveFrom' => 'date', + 'midYearChanges' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'value' => false, + 'effectiveFrom' => true, + 'midYearChanges' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'value' => 'value', + 'effectiveFrom' => 'effectiveFrom', + 'midYearChanges' => 'midYearChanges' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'value' => 'setValue', + 'effectiveFrom' => 'setEffectiveFrom', + 'midYearChanges' => 'setMidYearChanges' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'value' => 'getValue', + 'effectiveFrom' => 'getEffectiveFrom', + 'midYearChanges' => 'getMidYearChanges' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('midYearChanges', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when these period values are effective + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets midYearChanges + * + * @return \SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue[]|null + */ + public function getMidYearChanges(): ?array + { + return $this->container['midYearChanges']; + } + + /** + * Sets midYearChanges + * + * @param \SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue[]|null $midYearChanges Any optional changes to the period values that are effective from a specified date in the middle of a tax year + * + * @return $this + */ + public function setMidYearChanges(?array $midYearChanges): static + { + if (is_null($midYearChanges)) { + array_push($this->openAPINullablesSetToNull, 'midYearChanges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('midYearChanges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['midYearChanges'] = $midYearChanges; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeferalPeriodType.php b/src/Model/DeferalPeriodType.php new file mode 100644 index 0000000..edee432 --- /dev/null +++ b/src/Model/DeferalPeriodType.php @@ -0,0 +1,49 @@ + + */ +class Department implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Department'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string', + 'employeeCount' => 'int', + 'accountingCode' => 'string', + 'hasJournalOverrides' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null, + 'employeeCount' => 'int32', + 'accountingCode' => null, + 'hasJournalOverrides' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'title' => false, + 'color' => true, + 'employeeCount' => false, + 'accountingCode' => true, + 'hasJournalOverrides' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color', + 'employeeCount' => 'employeeCount', + 'accountingCode' => 'accountingCode', + 'hasJournalOverrides' => 'hasJournalOverrides' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor', + 'employeeCount' => 'setEmployeeCount', + 'accountingCode' => 'setAccountingCode', + 'hasJournalOverrides' => 'setHasJournalOverrides' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor', + 'employeeCount' => 'getEmployeeCount', + 'accountingCode' => 'getAccountingCode', + 'hasJournalOverrides' => 'getHasJournalOverrides' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('accountingCode', $data ?? [], null); + $this->setIfExists('hasJournalOverrides', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['accountingCode']) && (mb_strlen($this->container['accountingCode']) > 50)) { + $invalidProperties[] = "invalid value for 'accountingCode', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this Department + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling Department., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling Department., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Department + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling Department., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling Department., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Department, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling Department., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of employees with this set as their primary department + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets accountingCode + * + * @return string|null + */ + public function getAccountingCode(): ?string + { + return $this->container['accountingCode']; + } + + /** + * Sets accountingCode + * + * @param string|null $accountingCode accountingCode + * + * @return $this + */ + public function setAccountingCode(?string $accountingCode): static + { + if (is_null($accountingCode)) { + array_push($this->openAPINullablesSetToNull, 'accountingCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountingCode) && (mb_strlen($accountingCode) > 50)) { + throw new InvalidArgumentException('invalid length for $accountingCode when calling Department., must be smaller than or equal to 50.'); + } + + $this->container['accountingCode'] = $accountingCode; + + return $this; + } + + /** + * Gets hasJournalOverrides + * + * @return bool|null + */ + public function getHasJournalOverrides(): ?bool + { + return $this->container['hasJournalOverrides']; + } + + /** + * Sets hasJournalOverrides + * + * @param bool|null $hasJournalOverrides Has Overrides + * + * @return $this + */ + public function setHasJournalOverrides(?bool $hasJournalOverrides): static + { + if (is_null($hasJournalOverrides)) { + throw new InvalidArgumentException('non-nullable hasJournalOverrides cannot be null'); + } + $this->container['hasJournalOverrides'] = $hasJournalOverrides; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DepartmentMembership.php b/src/Model/DepartmentMembership.php new file mode 100644 index 0000000..4927540 --- /dev/null +++ b/src/Model/DepartmentMembership.php @@ -0,0 +1,605 @@ + + */ +class DepartmentMembership implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DepartmentMembership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'primary' => 'bool', + 'weighting' => 'float', + 'employeeRoleUniqueId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'color' => null, + 'title' => null, + 'primary' => null, + 'weighting' => 'double', + 'employeeRoleUniqueId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'color' => true, + 'title' => true, + 'primary' => false, + 'weighting' => false, + 'employeeRoleUniqueId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'primary' => 'primary', + 'weighting' => 'weighting', + 'employeeRoleUniqueId' => 'employeeRoleUniqueId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'primary' => 'setPrimary', + 'weighting' => 'setWeighting', + 'employeeRoleUniqueId' => 'setEmployeeRoleUniqueId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'primary' => 'getPrimary', + 'weighting' => 'getWeighting', + 'employeeRoleUniqueId' => 'getEmployeeRoleUniqueId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('primary', $data ?? [], null); + $this->setIfExists('weighting', $data ?? [], null); + $this->setIfExists('employeeRoleUniqueId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The Code for the Department + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling DepartmentMembership., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color [readonly] The Color for the Department + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] The Title for the Department + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary(): ?bool + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Set to true if this is the primary Department for the Employee. Only one department can be set as the primary. + * + * @return $this + */ + public function setPrimary(?bool $primary): static + { + if (is_null($primary)) { + throw new InvalidArgumentException('non-nullable primary cannot be null'); + } + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets weighting + * + * @return float|null + */ + public function getWeighting(): ?float + { + return $this->container['weighting']; + } + + /** + * Sets weighting + * + * @param float|null $weighting If there is more than one Department Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two departments you might set the primary as 0.8 and the secondary as 0.2; + * + * @return $this + */ + public function setWeighting(?float $weighting): static + { + if (is_null($weighting)) { + throw new InvalidArgumentException('non-nullable weighting cannot be null'); + } + $this->container['weighting'] = $weighting; + + return $this; + } + + /** + * Gets employeeRoleUniqueId + * + * @return string|null + */ + public function getEmployeeRoleUniqueId(): ?string + { + return $this->container['employeeRoleUniqueId']; + } + + /** + * Sets employeeRoleUniqueId + * + * @param string|null $employeeRoleUniqueId employeeRoleUniqueId + * + * @return $this + */ + public function setEmployeeRoleUniqueId(?string $employeeRoleUniqueId): static + { + if (is_null($employeeRoleUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeRoleUniqueId cannot be null'); + } + $this->container['employeeRoleUniqueId'] = $employeeRoleUniqueId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DirectDebitMandate.php b/src/Model/DirectDebitMandate.php new file mode 100644 index 0000000..d2b9720 --- /dev/null +++ b/src/Model/DirectDebitMandate.php @@ -0,0 +1,606 @@ + + */ +class DirectDebitMandate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DirectDebitMandate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isCompleted' => 'bool', + 'mandateLink' => 'string', + 'customerLink' => 'string', + 'bankName' => 'string', + 'accountNumberEnding' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isCompleted' => null, + 'mandateLink' => null, + 'customerLink' => null, + 'bankName' => null, + 'accountNumberEnding' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isCompleted' => false, + 'mandateLink' => true, + 'customerLink' => true, + 'bankName' => true, + 'accountNumberEnding' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isCompleted' => 'isCompleted', + 'mandateLink' => 'mandateLink', + 'customerLink' => 'customerLink', + 'bankName' => 'bankName', + 'accountNumberEnding' => 'accountNumberEnding', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isCompleted' => 'setIsCompleted', + 'mandateLink' => 'setMandateLink', + 'customerLink' => 'setCustomerLink', + 'bankName' => 'setBankName', + 'accountNumberEnding' => 'setAccountNumberEnding', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isCompleted' => 'getIsCompleted', + 'mandateLink' => 'getMandateLink', + 'customerLink' => 'getCustomerLink', + 'bankName' => 'getBankName', + 'accountNumberEnding' => 'getAccountNumberEnding', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isCompleted', $data ?? [], null); + $this->setIfExists('mandateLink', $data ?? [], null); + $this->setIfExists('customerLink', $data ?? [], null); + $this->setIfExists('bankName', $data ?? [], null); + $this->setIfExists('accountNumberEnding', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isCompleted + * + * @return bool|null + */ + public function getIsCompleted(): ?bool + { + return $this->container['isCompleted']; + } + + /** + * Sets isCompleted + * + * @param bool|null $isCompleted isCompleted + * + * @return $this + */ + public function setIsCompleted(?bool $isCompleted): static + { + if (is_null($isCompleted)) { + throw new InvalidArgumentException('non-nullable isCompleted cannot be null'); + } + $this->container['isCompleted'] = $isCompleted; + + return $this; + } + + /** + * Gets mandateLink + * + * @return string|null + */ + public function getMandateLink(): ?string + { + return $this->container['mandateLink']; + } + + /** + * Sets mandateLink + * + * @param string|null $mandateLink mandateLink + * + * @return $this + */ + public function setMandateLink(?string $mandateLink): static + { + if (is_null($mandateLink)) { + array_push($this->openAPINullablesSetToNull, 'mandateLink'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mandateLink', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mandateLink'] = $mandateLink; + + return $this; + } + + /** + * Gets customerLink + * + * @return string|null + */ + public function getCustomerLink(): ?string + { + return $this->container['customerLink']; + } + + /** + * Sets customerLink + * + * @param string|null $customerLink customerLink + * + * @return $this + */ + public function setCustomerLink(?string $customerLink): static + { + if (is_null($customerLink)) { + array_push($this->openAPINullablesSetToNull, 'customerLink'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customerLink', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customerLink'] = $customerLink; + + return $this; + } + + /** + * Gets bankName + * + * @return string|null + */ + public function getBankName(): ?string + { + return $this->container['bankName']; + } + + /** + * Sets bankName + * + * @param string|null $bankName bankName + * + * @return $this + */ + public function setBankName(?string $bankName): static + { + if (is_null($bankName)) { + array_push($this->openAPINullablesSetToNull, 'bankName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankName'] = $bankName; + + return $this; + } + + /** + * Gets accountNumberEnding + * + * @return string|null + */ + public function getAccountNumberEnding(): ?string + { + return $this->container['accountNumberEnding']; + } + + /** + * Sets accountNumberEnding + * + * @param string|null $accountNumberEnding accountNumberEnding + * + * @return $this + */ + public function setAccountNumberEnding(?string $accountNumberEnding): static + { + if (is_null($accountNumberEnding)) { + array_push($this->openAPINullablesSetToNull, 'accountNumberEnding'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNumberEnding', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountNumberEnding'] = $accountNumberEnding; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DirectorshipDetails.php b/src/Model/DirectorshipDetails.php new file mode 100644 index 0000000..79c65ae --- /dev/null +++ b/src/Model/DirectorshipDetails.php @@ -0,0 +1,524 @@ + + */ +class DirectorshipDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DirectorshipDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isDirector' => 'bool', + 'startDate' => '\DateTime', + 'leaveDate' => '\DateTime', + 'niAlternativeMethod' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isDirector' => null, + 'startDate' => 'date', + 'leaveDate' => 'date', + 'niAlternativeMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isDirector' => false, + 'startDate' => true, + 'leaveDate' => true, + 'niAlternativeMethod' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isDirector' => 'isDirector', + 'startDate' => 'startDate', + 'leaveDate' => 'leaveDate', + 'niAlternativeMethod' => 'niAlternativeMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isDirector' => 'setIsDirector', + 'startDate' => 'setStartDate', + 'leaveDate' => 'setLeaveDate', + 'niAlternativeMethod' => 'setNiAlternativeMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isDirector' => 'getIsDirector', + 'startDate' => 'getStartDate', + 'leaveDate' => 'getLeaveDate', + 'niAlternativeMethod' => 'getNiAlternativeMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isDirector', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('niAlternativeMethod', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isDirector + * + * @return bool|null + */ + public function getIsDirector(): ?bool + { + return $this->container['isDirector']; + } + + /** + * Sets isDirector + * + * @param bool|null $isDirector isDirector + * + * @return $this + */ + public function setIsDirector(?bool $isDirector): static + { + if (is_null($isDirector)) { + throw new InvalidArgumentException('non-nullable isDirector cannot be null'); + } + $this->container['isDirector'] = $isDirector; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets niAlternativeMethod + * + * @return bool|null + */ + public function getNiAlternativeMethod(): ?bool + { + return $this->container['niAlternativeMethod']; + } + + /** + * Sets niAlternativeMethod + * + * @param bool|null $niAlternativeMethod niAlternativeMethod + * + * @return $this + */ + public function setNiAlternativeMethod(?bool $niAlternativeMethod): static + { + if (is_null($niAlternativeMethod)) { + throw new InvalidArgumentException('non-nullable niAlternativeMethod cannot be null'); + } + $this->container['niAlternativeMethod'] = $niAlternativeMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DpsDataType.php b/src/Model/DpsDataType.php new file mode 100644 index 0000000..69d0ece --- /dev/null +++ b/src/Model/DpsDataType.php @@ -0,0 +1,61 @@ + + */ +class DpsNotice implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DpsNotice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'issueDate' => '\DateTime', + 'effectiveDate' => '\DateTime', + 'taxYear' => 'int', + 'sequenceNumber' => 'int', + 'type' => '\SynergiTech\Staffology\Model\DpsDataType', + 'formType' => 'string', + 'forename' => 'string', + 'surname' => 'string', + 'niNo' => 'string', + 'worksNumber' => 'string', + 'taxCode' => 'string', + 'week1Month1' => 'bool', + 'previousTax' => 'float', + 'previousPay' => 'float', + 'planType' => '\SynergiTech\Staffology\Model\StudentLoan', + 'appliedOn' => '\DateTime', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'issueDate' => 'date', + 'effectiveDate' => 'date', + 'taxYear' => 'int32', + 'sequenceNumber' => 'int32', + 'type' => null, + 'formType' => null, + 'forename' => null, + 'surname' => null, + 'niNo' => null, + 'worksNumber' => null, + 'taxCode' => null, + 'week1Month1' => null, + 'previousTax' => 'double', + 'previousPay' => 'double', + 'planType' => null, + 'appliedOn' => 'date', + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'issueDate' => false, + 'effectiveDate' => false, + 'taxYear' => false, + 'sequenceNumber' => false, + 'type' => false, + 'formType' => true, + 'forename' => true, + 'surname' => true, + 'niNo' => true, + 'worksNumber' => true, + 'taxCode' => true, + 'week1Month1' => true, + 'previousTax' => true, + 'previousPay' => true, + 'planType' => false, + 'appliedOn' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'issueDate' => 'issueDate', + 'effectiveDate' => 'effectiveDate', + 'taxYear' => 'taxYear', + 'sequenceNumber' => 'sequenceNumber', + 'type' => 'type', + 'formType' => 'formType', + 'forename' => 'forename', + 'surname' => 'surname', + 'niNo' => 'niNo', + 'worksNumber' => 'worksNumber', + 'taxCode' => 'taxCode', + 'week1Month1' => 'week1Month1', + 'previousTax' => 'previousTax', + 'previousPay' => 'previousPay', + 'planType' => 'planType', + 'appliedOn' => 'appliedOn', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'issueDate' => 'setIssueDate', + 'effectiveDate' => 'setEffectiveDate', + 'taxYear' => 'setTaxYear', + 'sequenceNumber' => 'setSequenceNumber', + 'type' => 'setType', + 'formType' => 'setFormType', + 'forename' => 'setForename', + 'surname' => 'setSurname', + 'niNo' => 'setNiNo', + 'worksNumber' => 'setWorksNumber', + 'taxCode' => 'setTaxCode', + 'week1Month1' => 'setWeek1Month1', + 'previousTax' => 'setPreviousTax', + 'previousPay' => 'setPreviousPay', + 'planType' => 'setPlanType', + 'appliedOn' => 'setAppliedOn', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'issueDate' => 'getIssueDate', + 'effectiveDate' => 'getEffectiveDate', + 'taxYear' => 'getTaxYear', + 'sequenceNumber' => 'getSequenceNumber', + 'type' => 'getType', + 'formType' => 'getFormType', + 'forename' => 'getForename', + 'surname' => 'getSurname', + 'niNo' => 'getNiNo', + 'worksNumber' => 'getWorksNumber', + 'taxCode' => 'getTaxCode', + 'week1Month1' => 'getWeek1Month1', + 'previousTax' => 'getPreviousTax', + 'previousPay' => 'getPreviousPay', + 'planType' => 'getPlanType', + 'appliedOn' => 'getAppliedOn', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('issueDate', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('sequenceNumber', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('formType', $data ?? [], null); + $this->setIfExists('forename', $data ?? [], null); + $this->setIfExists('surname', $data ?? [], null); + $this->setIfExists('niNo', $data ?? [], null); + $this->setIfExists('worksNumber', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('week1Month1', $data ?? [], null); + $this->setIfExists('previousTax', $data ?? [], null); + $this->setIfExists('previousPay', $data ?? [], null); + $this->setIfExists('planType', $data ?? [], null); + $this->setIfExists('appliedOn', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets issueDate + * + * @return \DateTime|null + */ + public function getIssueDate(): ?\DateTime + { + return $this->container['issueDate']; + } + + /** + * Sets issueDate + * + * @param \DateTime|null $issueDate issueDate + * + * @return $this + */ + public function setIssueDate(?\DateTime $issueDate): static + { + if (is_null($issueDate)) { + throw new InvalidArgumentException('non-nullable issueDate cannot be null'); + } + $this->container['issueDate'] = $issueDate; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate effectiveDate + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets taxYear + * + * @return int|null + */ + public function getTaxYear(): ?int + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param int|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?int $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets sequenceNumber + * + * @return int|null + */ + public function getSequenceNumber(): ?int + { + return $this->container['sequenceNumber']; + } + + /** + * Sets sequenceNumber + * + * @param int|null $sequenceNumber sequenceNumber + * + * @return $this + */ + public function setSequenceNumber(?int $sequenceNumber): static + { + if (is_null($sequenceNumber)) { + throw new InvalidArgumentException('non-nullable sequenceNumber cannot be null'); + } + $this->container['sequenceNumber'] = $sequenceNumber; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\DpsDataType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\DpsDataType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\DpsDataType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\DpsDataType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets formType + * + * @return string|null + */ + public function getFormType(): ?string + { + return $this->container['formType']; + } + + /** + * Sets formType + * + * @param string|null $formType formType + * + * @return $this + */ + public function setFormType(?string $formType): static + { + if (is_null($formType)) { + array_push($this->openAPINullablesSetToNull, 'formType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('formType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['formType'] = $formType; + + return $this; + } + + /** + * Gets forename + * + * @return string|null + */ + public function getForename(): ?string + { + return $this->container['forename']; + } + + /** + * Sets forename + * + * @param string|null $forename forename + * + * @return $this + */ + public function setForename(?string $forename): static + { + if (is_null($forename)) { + array_push($this->openAPINullablesSetToNull, 'forename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forename'] = $forename; + + return $this; + } + + /** + * Gets surname + * + * @return string|null + */ + public function getSurname(): ?string + { + return $this->container['surname']; + } + + /** + * Sets surname + * + * @param string|null $surname surname + * + * @return $this + */ + public function setSurname(?string $surname): static + { + if (is_null($surname)) { + array_push($this->openAPINullablesSetToNull, 'surname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('surname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['surname'] = $surname; + + return $this; + } + + /** + * Gets niNo + * + * @return string|null + */ + public function getNiNo(): ?string + { + return $this->container['niNo']; + } + + /** + * Sets niNo + * + * @param string|null $niNo niNo + * + * @return $this + */ + public function setNiNo(?string $niNo): static + { + if (is_null($niNo)) { + array_push($this->openAPINullablesSetToNull, 'niNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNo'] = $niNo; + + return $this; + } + + /** + * Gets worksNumber + * + * @return string|null + */ + public function getWorksNumber(): ?string + { + return $this->container['worksNumber']; + } + + /** + * Sets worksNumber + * + * @param string|null $worksNumber worksNumber + * + * @return $this + */ + public function setWorksNumber(?string $worksNumber): static + { + if (is_null($worksNumber)) { + array_push($this->openAPINullablesSetToNull, 'worksNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('worksNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['worksNumber'] = $worksNumber; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode taxCode + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets week1Month1 + * + * @return bool|null + */ + public function getWeek1Month1(): ?bool + { + return $this->container['week1Month1']; + } + + /** + * Sets week1Month1 + * + * @param bool|null $week1Month1 week1Month1 + * + * @return $this + */ + public function setWeek1Month1(?bool $week1Month1): static + { + if (is_null($week1Month1)) { + array_push($this->openAPINullablesSetToNull, 'week1Month1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('week1Month1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['week1Month1'] = $week1Month1; + + return $this; + } + + /** + * Gets previousTax + * + * @return float|null + */ + public function getPreviousTax(): ?float + { + return $this->container['previousTax']; + } + + /** + * Sets previousTax + * + * @param float|null $previousTax previousTax + * + * @return $this + */ + public function setPreviousTax(?float $previousTax): static + { + if (is_null($previousTax)) { + array_push($this->openAPINullablesSetToNull, 'previousTax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousTax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['previousTax'] = $previousTax; + + return $this; + } + + /** + * Gets previousPay + * + * @return float|null + */ + public function getPreviousPay(): ?float + { + return $this->container['previousPay']; + } + + /** + * Sets previousPay + * + * @param float|null $previousPay previousPay + * + * @return $this + */ + public function setPreviousPay(?float $previousPay): static + { + if (is_null($previousPay)) { + array_push($this->openAPINullablesSetToNull, 'previousPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['previousPay'] = $previousPay; + + return $this; + } + + /** + * Gets planType + * + * @return \SynergiTech\Staffology\Model\StudentLoan|null + */ + public function getPlanType(): ?\SynergiTech\Staffology\Model\StudentLoan + { + return $this->container['planType']; + } + + /** + * Sets planType + * + * @param \SynergiTech\Staffology\Model\StudentLoan|null $planType planType + * + * @return $this + */ + public function setPlanType(?\SynergiTech\Staffology\Model\StudentLoan $planType): static + { + if (is_null($planType)) { + throw new InvalidArgumentException('non-nullable planType cannot be null'); + } + $this->container['planType'] = $planType; + + return $this; + } + + /** + * Gets appliedOn + * + * @return \DateTime|null + */ + public function getAppliedOn(): ?\DateTime + { + return $this->container['appliedOn']; + } + + /** + * Sets appliedOn + * + * @param \DateTime|null $appliedOn appliedOn + * + * @return $this + */ + public function setAppliedOn(?\DateTime $appliedOn): static + { + if (is_null($appliedOn)) { + array_push($this->openAPINullablesSetToNull, 'appliedOn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('appliedOn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['appliedOn'] = $appliedOn; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DpsSettings.php b/src/Model/DpsSettings.php new file mode 100644 index 0000000..8e3a0f2 --- /dev/null +++ b/src/Model/DpsSettings.php @@ -0,0 +1,559 @@ + + */ +class DpsSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DpsSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'enabled' => 'bool', + 'retrieveFrom' => '\DateTime', + 'autoApply' => 'bool', + 'lastChecked' => '\DateTime', + 'error' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'enabled' => null, + 'retrieveFrom' => 'date', + 'autoApply' => null, + 'lastChecked' => 'date', + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'retrieveFrom' => false, + 'autoApply' => false, + 'lastChecked' => true, + 'error' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'enabled' => 'enabled', + 'retrieveFrom' => 'retrieveFrom', + 'autoApply' => 'autoApply', + 'lastChecked' => 'lastChecked', + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'enabled' => 'setEnabled', + 'retrieveFrom' => 'setRetrieveFrom', + 'autoApply' => 'setAutoApply', + 'lastChecked' => 'setLastChecked', + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'enabled' => 'getEnabled', + 'retrieveFrom' => 'getRetrieveFrom', + 'autoApply' => 'getAutoApply', + 'lastChecked' => 'getLastChecked', + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('retrieveFrom', $data ?? [], null); + $this->setIfExists('autoApply', $data ?? [], null); + $this->setIfExists('lastChecked', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled(): ?bool + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled If enabled, we'll automatically retrieve DPS notices from HMRC for you + * + * @return $this + */ + public function setEnabled(?bool $enabled): static + { + if (is_null($enabled)) { + throw new InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets retrieveFrom + * + * @return \DateTime|null + */ + public function getRetrieveFrom(): ?\DateTime + { + return $this->container['retrieveFrom']; + } + + /** + * Sets retrieveFrom + * + * @param \DateTime|null $retrieveFrom The date from which notices should be retrieved + * + * @return $this + */ + public function setRetrieveFrom(?\DateTime $retrieveFrom): static + { + if (is_null($retrieveFrom)) { + throw new InvalidArgumentException('non-nullable retrieveFrom cannot be null'); + } + $this->container['retrieveFrom'] = $retrieveFrom; + + return $this; + } + + /** + * Gets autoApply + * + * @return bool|null + */ + public function getAutoApply(): ?bool + { + return $this->container['autoApply']; + } + + /** + * Sets autoApply + * + * @param bool|null $autoApply If enabled, we'll automatically apply DPSNotices before starting a payrun that covers the EffectiveDate + * + * @return $this + */ + public function setAutoApply(?bool $autoApply): static + { + if (is_null($autoApply)) { + throw new InvalidArgumentException('non-nullable autoApply cannot be null'); + } + $this->container['autoApply'] = $autoApply; + + return $this; + } + + /** + * Gets lastChecked + * + * @return \DateTime|null + */ + public function getLastChecked(): ?\DateTime + { + return $this->container['lastChecked']; + } + + /** + * Sets lastChecked + * + * @param \DateTime|null $lastChecked [readonly] The time we last checked for notices + * + * @return $this + */ + public function setLastChecked(?\DateTime $lastChecked): static + { + if (is_null($lastChecked)) { + array_push($this->openAPINullablesSetToNull, 'lastChecked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastChecked', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastChecked'] = $lastChecked; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError(): ?string + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error [readonly] If we received an error from HMRC when checking for notices, it'll be displayed here + * + * @return $this + */ + public function setError(?string $error): static + { + if (is_null($error)) { + array_push($this->openAPINullablesSetToNull, 'error'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmailAttachment.php b/src/Model/EmailAttachment.php new file mode 100644 index 0000000..440f32f --- /dev/null +++ b/src/Model/EmailAttachment.php @@ -0,0 +1,534 @@ + + */ +class EmailAttachment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmailAttachment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'url' => 'string', + 'filename' => 'string', + 'pdfPasswordType' => '\SynergiTech\Staffology\Model\PdfPasswordType', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'url' => null, + 'filename' => null, + 'pdfPasswordType' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'url' => false, + 'filename' => false, + 'pdfPasswordType' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'url' => 'url', + 'filename' => 'filename', + 'pdfPasswordType' => 'pdfPasswordType', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'url' => 'setUrl', + 'filename' => 'setFilename', + 'pdfPasswordType' => 'setPdfPasswordType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'url' => 'getUrl', + 'filename' => 'getFilename', + 'pdfPasswordType' => 'getPdfPasswordType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('filename', $data ?? [], null); + $this->setIfExists('pdfPasswordType', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + if ($this->container['filename'] === null) { + $invalidProperties[] = "'filename' can't be null"; + } + if ((mb_strlen($this->container['filename']) < 1)) { + $invalidProperties[] = "invalid value for 'filename', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl(): string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return $this + */ + public function setUrl(string $url): static + { + if (is_null($url)) { + throw new InvalidArgumentException('non-nullable url cannot be null'); + } + + if ((mb_strlen($url) < 1)) { + throw new InvalidArgumentException('invalid length for $url when calling EmailAttachment., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets filename + * + * @return string + */ + public function getFilename(): string + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string $filename filename + * + * @return $this + */ + public function setFilename(string $filename): static + { + if (is_null($filename)) { + throw new InvalidArgumentException('non-nullable filename cannot be null'); + } + + if ((mb_strlen($filename) < 1)) { + throw new InvalidArgumentException('invalid length for $filename when calling EmailAttachment., must be bigger than or equal to 1.'); + } + + $this->container['filename'] = $filename; + + return $this; + } + + /** + * Gets pdfPasswordType + * + * @return \SynergiTech\Staffology\Model\PdfPasswordType|null + */ + public function getPdfPasswordType(): ?\SynergiTech\Staffology\Model\PdfPasswordType + { + return $this->container['pdfPasswordType']; + } + + /** + * Sets pdfPasswordType + * + * @param \SynergiTech\Staffology\Model\PdfPasswordType|null $pdfPasswordType pdfPasswordType + * + * @return $this + */ + public function setPdfPasswordType(?\SynergiTech\Staffology\Model\PdfPasswordType $pdfPasswordType): static + { + if (is_null($pdfPasswordType)) { + throw new InvalidArgumentException('non-nullable pdfPasswordType cannot be null'); + } + $this->container['pdfPasswordType'] = $pdfPasswordType; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmpRefs.php b/src/Model/EmpRefs.php new file mode 100644 index 0000000..f0bf148 --- /dev/null +++ b/src/Model/EmpRefs.php @@ -0,0 +1,620 @@ + + */ +class EmpRefs implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmpRefs'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'officeNo' => 'string', + 'payeRef' => 'string', + 'aoRef' => 'string', + 'econ' => 'string', + 'cotaxRef' => 'string', + 'sautr' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'officeNo' => null, + 'payeRef' => null, + 'aoRef' => null, + 'econ' => null, + 'cotaxRef' => null, + 'sautr' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'officeNo' => true, + 'payeRef' => true, + 'aoRef' => true, + 'econ' => true, + 'cotaxRef' => true, + 'sautr' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'officeNo' => 'officeNo', + 'payeRef' => 'payeRef', + 'aoRef' => 'aoRef', + 'econ' => 'econ', + 'cotaxRef' => 'cotaxRef', + 'sautr' => 'sautr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'officeNo' => 'setOfficeNo', + 'payeRef' => 'setPayeRef', + 'aoRef' => 'setAoRef', + 'econ' => 'setEcon', + 'cotaxRef' => 'setCotaxRef', + 'sautr' => 'setSautr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'officeNo' => 'getOfficeNo', + 'payeRef' => 'getPayeRef', + 'aoRef' => 'getAoRef', + 'econ' => 'getEcon', + 'cotaxRef' => 'getCotaxRef', + 'sautr' => 'getSautr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('officeNo', $data ?? [], null); + $this->setIfExists('payeRef', $data ?? [], null); + $this->setIfExists('aoRef', $data ?? [], null); + $this->setIfExists('econ', $data ?? [], null); + $this->setIfExists('cotaxRef', $data ?? [], null); + $this->setIfExists('sautr', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets officeNo + * + * @return string|null + */ + public function getOfficeNo(): ?string + { + return $this->container['officeNo']; + } + + /** + * Sets officeNo + * + * @param string|null $officeNo officeNo + * + * @return $this + */ + public function setOfficeNo(?string $officeNo): static + { + if (is_null($officeNo)) { + array_push($this->openAPINullablesSetToNull, 'officeNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('officeNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['officeNo'] = $officeNo; + + return $this; + } + + /** + * Gets payeRef + * + * @return string|null + */ + public function getPayeRef(): ?string + { + return $this->container['payeRef']; + } + + /** + * Sets payeRef + * + * @param string|null $payeRef payeRef + * + * @return $this + */ + public function setPayeRef(?string $payeRef): static + { + if (is_null($payeRef)) { + array_push($this->openAPINullablesSetToNull, 'payeRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payeRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payeRef'] = $payeRef; + + return $this; + } + + /** + * Gets aoRef + * + * @return string|null + */ + public function getAoRef(): ?string + { + return $this->container['aoRef']; + } + + /** + * Sets aoRef + * + * @param string|null $aoRef aoRef + * + * @return $this + */ + public function setAoRef(?string $aoRef): static + { + if (is_null($aoRef)) { + array_push($this->openAPINullablesSetToNull, 'aoRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aoRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aoRef'] = $aoRef; + + return $this; + } + + /** + * Gets econ + * + * @return string|null + */ + public function getEcon(): ?string + { + return $this->container['econ']; + } + + /** + * Sets econ + * + * @param string|null $econ econ + * + * @return $this + */ + public function setEcon(?string $econ): static + { + if (is_null($econ)) { + array_push($this->openAPINullablesSetToNull, 'econ'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('econ', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['econ'] = $econ; + + return $this; + } + + /** + * Gets cotaxRef + * + * @return string|null + */ + public function getCotaxRef(): ?string + { + return $this->container['cotaxRef']; + } + + /** + * Sets cotaxRef + * + * @param string|null $cotaxRef cotaxRef + * + * @return $this + */ + public function setCotaxRef(?string $cotaxRef): static + { + if (is_null($cotaxRef)) { + array_push($this->openAPINullablesSetToNull, 'cotaxRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cotaxRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cotaxRef'] = $cotaxRef; + + return $this; + } + + /** + * Gets sautr + * + * @return string|null + */ + public function getSautr(): ?string + { + return $this->container['sautr']; + } + + /** + * Sets sautr + * + * @param string|null $sautr sautr + * + * @return $this + */ + public function setSautr(?string $sautr): static + { + if (is_null($sautr)) { + array_push($this->openAPINullablesSetToNull, 'sautr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sautr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sautr'] = $sautr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Employee.php b/src/Model/Employee.php new file mode 100644 index 0000000..af06ad9 --- /dev/null +++ b/src/Model/Employee.php @@ -0,0 +1,961 @@ + + */ +class Employee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Employee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'holidaySchemeUniqueId' => 'string', + 'aggregatedServiceDate' => '\DateTime', + 'leaveHolidayAccrualDefaultRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'id' => 'string', + 'personalDetails' => '\SynergiTech\Staffology\Model\PersonalDetails', + 'employmentDetails' => '\SynergiTech\Staffology\Model\EmploymentDetails', + 'autoEnrolment' => '\SynergiTech\Staffology\Model\AutoEnrolment', + 'leaveSettings' => '\SynergiTech\Staffology\Model\LeaveSettings', + 'rightToWork' => '\SynergiTech\Staffology\Model\RightToWork', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'tags' => 'string[]', + 'payOptions' => '\SynergiTech\Staffology\Model\PayOptions', + 'status' => '\SynergiTech\Staffology\Model\EmployeeStatus', + 'aeNotEnroledWarning' => 'bool', + 'sourceSystemId' => 'string', + 'evcId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'holidaySchemeUniqueId' => 'uuid', + 'aggregatedServiceDate' => 'date', + 'leaveHolidayAccrualDefaultRateType' => null, + 'id' => 'uuid', + 'personalDetails' => null, + 'employmentDetails' => null, + 'autoEnrolment' => null, + 'leaveSettings' => null, + 'rightToWork' => null, + 'bankDetails' => null, + 'tags' => null, + 'payOptions' => null, + 'status' => null, + 'aeNotEnroledWarning' => null, + 'sourceSystemId' => null, + 'evcId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'holidaySchemeUniqueId' => true, + 'aggregatedServiceDate' => true, + 'leaveHolidayAccrualDefaultRateType' => false, + 'id' => false, + 'personalDetails' => false, + 'employmentDetails' => false, + 'autoEnrolment' => false, + 'leaveSettings' => false, + 'rightToWork' => false, + 'bankDetails' => false, + 'tags' => true, + 'payOptions' => false, + 'status' => false, + 'aeNotEnroledWarning' => false, + 'sourceSystemId' => true, + 'evcId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'holidaySchemeUniqueId' => 'holidaySchemeUniqueId', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'leaveHolidayAccrualDefaultRateType' => 'leaveHolidayAccrualDefaultRateType', + 'id' => 'id', + 'personalDetails' => 'personalDetails', + 'employmentDetails' => 'employmentDetails', + 'autoEnrolment' => 'autoEnrolment', + 'leaveSettings' => 'leaveSettings', + 'rightToWork' => 'rightToWork', + 'bankDetails' => 'bankDetails', + 'tags' => 'tags', + 'payOptions' => 'payOptions', + 'status' => 'status', + 'aeNotEnroledWarning' => 'aeNotEnroledWarning', + 'sourceSystemId' => 'sourceSystemId', + 'evcId' => 'evcId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'holidaySchemeUniqueId' => 'setHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'leaveHolidayAccrualDefaultRateType' => 'setLeaveHolidayAccrualDefaultRateType', + 'id' => 'setId', + 'personalDetails' => 'setPersonalDetails', + 'employmentDetails' => 'setEmploymentDetails', + 'autoEnrolment' => 'setAutoEnrolment', + 'leaveSettings' => 'setLeaveSettings', + 'rightToWork' => 'setRightToWork', + 'bankDetails' => 'setBankDetails', + 'tags' => 'setTags', + 'payOptions' => 'setPayOptions', + 'status' => 'setStatus', + 'aeNotEnroledWarning' => 'setAeNotEnroledWarning', + 'sourceSystemId' => 'setSourceSystemId', + 'evcId' => 'setEvcId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'holidaySchemeUniqueId' => 'getHolidaySchemeUniqueId', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'leaveHolidayAccrualDefaultRateType' => 'getLeaveHolidayAccrualDefaultRateType', + 'id' => 'getId', + 'personalDetails' => 'getPersonalDetails', + 'employmentDetails' => 'getEmploymentDetails', + 'autoEnrolment' => 'getAutoEnrolment', + 'leaveSettings' => 'getLeaveSettings', + 'rightToWork' => 'getRightToWork', + 'bankDetails' => 'getBankDetails', + 'tags' => 'getTags', + 'payOptions' => 'getPayOptions', + 'status' => 'getStatus', + 'aeNotEnroledWarning' => 'getAeNotEnroledWarning', + 'sourceSystemId' => 'getSourceSystemId', + 'evcId' => 'getEvcId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('holidaySchemeUniqueId', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('leaveHolidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('autoEnrolment', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + $this->setIfExists('rightToWork', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('aeNotEnroledWarning', $data ?? [], null); + $this->setIfExists('sourceSystemId', $data ?? [], null); + $this->setIfExists('evcId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['sourceSystemId']) && (mb_strlen($this->container['sourceSystemId']) > 50)) { + $invalidProperties[] = "invalid value for 'sourceSystemId', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets holidaySchemeUniqueId + * + * @return string|null + */ + public function getHolidaySchemeUniqueId(): ?string + { + return $this->container['holidaySchemeUniqueId']; + } + + /** + * Sets holidaySchemeUniqueId + * + * @param string|null $holidaySchemeUniqueId holidaySchemeUniqueId + * + * @return $this + */ + public function setHolidaySchemeUniqueId(?string $holidaySchemeUniqueId): static + { + if (is_null($holidaySchemeUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'holidaySchemeUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidaySchemeUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidaySchemeUniqueId'] = $holidaySchemeUniqueId; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets leaveHolidayAccrualDefaultRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getLeaveHolidayAccrualDefaultRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['leaveHolidayAccrualDefaultRateType']; + } + + /** + * Sets leaveHolidayAccrualDefaultRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $leaveHolidayAccrualDefaultRateType leaveHolidayAccrualDefaultRateType + * + * @return $this + */ + public function setLeaveHolidayAccrualDefaultRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $leaveHolidayAccrualDefaultRateType): static + { + if (is_null($leaveHolidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable leaveHolidayAccrualDefaultRateType cannot be null'); + } + $this->container['leaveHolidayAccrualDefaultRateType'] = $leaveHolidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\PersonalDetails|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\PersonalDetails + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\PersonalDetails|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\PersonalDetails $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\EmploymentDetails|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\EmploymentDetails + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\EmploymentDetails|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\EmploymentDetails $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets autoEnrolment + * + * @return \SynergiTech\Staffology\Model\AutoEnrolment|null + */ + public function getAutoEnrolment(): ?\SynergiTech\Staffology\Model\AutoEnrolment + { + return $this->container['autoEnrolment']; + } + + /** + * Sets autoEnrolment + * + * @param \SynergiTech\Staffology\Model\AutoEnrolment|null $autoEnrolment autoEnrolment + * + * @return $this + */ + public function setAutoEnrolment(?\SynergiTech\Staffology\Model\AutoEnrolment $autoEnrolment): static + { + if (is_null($autoEnrolment)) { + throw new InvalidArgumentException('non-nullable autoEnrolment cannot be null'); + } + $this->container['autoEnrolment'] = $autoEnrolment; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\LeaveSettings|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\LeaveSettings + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\LeaveSettings|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\LeaveSettings $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + + /** + * Gets rightToWork + * + * @return \SynergiTech\Staffology\Model\RightToWork|null + */ + public function getRightToWork(): ?\SynergiTech\Staffology\Model\RightToWork + { + return $this->container['rightToWork']; + } + + /** + * Sets rightToWork + * + * @param \SynergiTech\Staffology\Model\RightToWork|null $rightToWork rightToWork + * + * @return $this + */ + public function setRightToWork(?\SynergiTech\Staffology\Model\RightToWork $rightToWork): static + { + if (is_null($rightToWork)) { + throw new InvalidArgumentException('non-nullable rightToWork cannot be null'); + } + $this->container['rightToWork'] = $rightToWork; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\PayOptions|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\PayOptions + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\PayOptions $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\EmployeeStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\EmployeeStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\EmployeeStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\EmployeeStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets aeNotEnroledWarning + * + * @return bool|null + */ + public function getAeNotEnroledWarning(): ?bool + { + return $this->container['aeNotEnroledWarning']; + } + + /** + * Sets aeNotEnroledWarning + * + * @param bool|null $aeNotEnroledWarning [readonly] If true then the employee should be enrolled in an Auto Enrolment Qualifying pension but isn't + * + * @return $this + */ + public function setAeNotEnroledWarning(?bool $aeNotEnroledWarning): static + { + if (is_null($aeNotEnroledWarning)) { + throw new InvalidArgumentException('non-nullable aeNotEnroledWarning cannot be null'); + } + $this->container['aeNotEnroledWarning'] = $aeNotEnroledWarning; + + return $this; + } + + /** + * Gets sourceSystemId + * + * @return string|null + */ + public function getSourceSystemId(): ?string + { + return $this->container['sourceSystemId']; + } + + /** + * Sets sourceSystemId + * + * @param string|null $sourceSystemId [readonly] Can only be given a value when the employee is created. It can then never be changed. Used by external systems so they can store an immutable reference + * + * @return $this + */ + public function setSourceSystemId(?string $sourceSystemId): static + { + if (is_null($sourceSystemId)) { + array_push($this->openAPINullablesSetToNull, 'sourceSystemId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sourceSystemId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($sourceSystemId) && (mb_strlen($sourceSystemId) > 50)) { + throw new InvalidArgumentException('invalid length for $sourceSystemId when calling Employee., must be smaller than or equal to 50.'); + } + + $this->container['sourceSystemId'] = $sourceSystemId; + + return $this; + } + + /** + * Gets evcId + * + * @return string|null + */ + public function getEvcId(): ?string + { + return $this->container['evcId']; + } + + /** + * Sets evcId + * + * @param string|null $evcId If set then this will be used as the EmployeeIDFromProduct sent to EVC in place of the standard EmployeeId. + * + * @return $this + */ + public function setEvcId(?string $evcId): static + { + if (is_null($evcId)) { + array_push($this->openAPINullablesSetToNull, 'evcId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('evcId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['evcId'] = $evcId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeBenefitsReport.php b/src/Model/EmployeeBenefitsReport.php new file mode 100644 index 0000000..24478bc --- /dev/null +++ b/src/Model/EmployeeBenefitsReport.php @@ -0,0 +1,517 @@ + + */ +class EmployeeBenefitsReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeBenefitsReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeBenefitsReportReportResponse.php b/src/Model/EmployeeBenefitsReportReportResponse.php new file mode 100644 index 0000000..63df2bd --- /dev/null +++ b/src/Model/EmployeeBenefitsReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class EmployeeBenefitsReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeBenefitsReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\EmployeeBenefitsReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\EmployeeBenefitsReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\EmployeeBenefitsReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\EmployeeBenefitsReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\EmployeeBenefitsReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeCostCentre.php b/src/Model/EmployeeCostCentre.php new file mode 100644 index 0000000..8b277cc --- /dev/null +++ b/src/Model/EmployeeCostCentre.php @@ -0,0 +1,639 @@ + + */ +class EmployeeCostCentre implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeCostCentre'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'isPrimary' => 'bool', + 'weighting' => 'float', + 'employeeRoleUniqueId' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'color' => null, + 'title' => null, + 'isPrimary' => null, + 'weighting' => 'double', + 'employeeRoleUniqueId' => 'uuid', + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'color' => true, + 'title' => true, + 'isPrimary' => false, + 'weighting' => false, + 'employeeRoleUniqueId' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'isPrimary' => 'isPrimary', + 'weighting' => 'weighting', + 'employeeRoleUniqueId' => 'employeeRoleUniqueId', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'isPrimary' => 'setIsPrimary', + 'weighting' => 'setWeighting', + 'employeeRoleUniqueId' => 'setEmployeeRoleUniqueId', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'isPrimary' => 'getIsPrimary', + 'weighting' => 'getWeighting', + 'employeeRoleUniqueId' => 'getEmployeeRoleUniqueId', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('weighting', $data ?? [], null); + $this->setIfExists('employeeRoleUniqueId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The Code for the Cost Centre + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling EmployeeCostCentre., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color [readonly] The Color for the Cost Centre + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] The Title for the Cost Centre + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Set to true if this is the primary Cost Centre for the Employee. Only one Cost Centre can be set as the primary. + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets weighting + * + * @return float|null + */ + public function getWeighting(): ?float + { + return $this->container['weighting']; + } + + /** + * Sets weighting + * + * @param float|null $weighting If there is more than one Cost Centre Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two Cost Centre you might set the primary as 0.8 and the secondary as 0.2; + * + * @return $this + */ + public function setWeighting(?float $weighting): static + { + if (is_null($weighting)) { + throw new InvalidArgumentException('non-nullable weighting cannot be null'); + } + $this->container['weighting'] = $weighting; + + return $this; + } + + /** + * Gets employeeRoleUniqueId + * + * @return string|null + */ + public function getEmployeeRoleUniqueId(): ?string + { + return $this->container['employeeRoleUniqueId']; + } + + /** + * Sets employeeRoleUniqueId + * + * @param string|null $employeeRoleUniqueId employeeRoleUniqueId + * + * @return $this + */ + public function setEmployeeRoleUniqueId(?string $employeeRoleUniqueId): static + { + if (is_null($employeeRoleUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeRoleUniqueId cannot be null'); + } + $this->container['employeeRoleUniqueId'] = $employeeRoleUniqueId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeLeaveReport.php b/src/Model/EmployeeLeaveReport.php new file mode 100644 index 0000000..818299a --- /dev/null +++ b/src/Model/EmployeeLeaveReport.php @@ -0,0 +1,558 @@ + + */ +class EmployeeLeaveReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeLeaveReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\EmployeeLeaveReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\EmployeeLeaveReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\EmployeeLeaveReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeLeaveReportLine.php b/src/Model/EmployeeLeaveReportLine.php new file mode 100644 index 0000000..e982da5 --- /dev/null +++ b/src/Model/EmployeeLeaveReportLine.php @@ -0,0 +1,1492 @@ + + */ +class EmployeeLeaveReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeLeaveReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'firstName' => 'string', + 'lastName' => 'string', + 'type' => '\SynergiTech\Staffology\Model\LeaveType', + 'payment' => '\SynergiTech\Staffology\Model\LeavePayType', + 'payrollCode' => 'string', + 'openEndedAbsence' => 'bool', + 'percentOfPay' => 'float', + 'paySSPInAddition' => 'bool', + 'payFrequency' => '\SynergiTech\Staffology\Model\StatPayFrequency', + 'occupationalPolicy' => 'string', + 'from' => '\DateTime', + 'to' => '\DateTime', + 'useOpeningPay' => 'bool', + 'openingPay' => 'float', + 'openingOmpPay' => 'float', + 'babyDueDate' => '\DateTime', + 'babyBirthDate' => '\DateTime', + 'matchingDate' => '\DateTime', + 'expectedPlacementDate' => '\DateTime', + 'placementDate' => '\DateTime', + 'deathDate' => '\DateTime', + 'averageWeeklyEarnings' => 'float', + 'automaticAWECalculation' => 'bool', + 'calculationType' => '\SynergiTech\Staffology\Model\LeaveCalculationType', + 'strikeHoursToDeduct' => 'float', + 'historicLeaveRequiresProcessing' => 'bool', + 'offsetPay' => 'bool', + 'useAssumedPensionablePay' => 'bool', + 'automaticAPPCalculation' => 'bool', + 'assumedPensionablePay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'firstName' => null, + 'lastName' => null, + 'type' => null, + 'payment' => null, + 'payrollCode' => null, + 'openEndedAbsence' => null, + 'percentOfPay' => 'double', + 'paySSPInAddition' => null, + 'payFrequency' => null, + 'occupationalPolicy' => null, + 'from' => 'date', + 'to' => 'date', + 'useOpeningPay' => null, + 'openingPay' => 'double', + 'openingOmpPay' => 'double', + 'babyDueDate' => 'date', + 'babyBirthDate' => 'date', + 'matchingDate' => 'date', + 'expectedPlacementDate' => 'date', + 'placementDate' => 'date', + 'deathDate' => 'date', + 'averageWeeklyEarnings' => 'double', + 'automaticAWECalculation' => null, + 'calculationType' => null, + 'strikeHoursToDeduct' => 'double', + 'historicLeaveRequiresProcessing' => null, + 'offsetPay' => null, + 'useAssumedPensionablePay' => null, + 'automaticAPPCalculation' => null, + 'assumedPensionablePay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'firstName' => true, + 'lastName' => true, + 'type' => false, + 'payment' => false, + 'payrollCode' => true, + 'openEndedAbsence' => false, + 'percentOfPay' => false, + 'paySSPInAddition' => false, + 'payFrequency' => false, + 'occupationalPolicy' => true, + 'from' => false, + 'to' => false, + 'useOpeningPay' => false, + 'openingPay' => true, + 'openingOmpPay' => true, + 'babyDueDate' => true, + 'babyBirthDate' => true, + 'matchingDate' => true, + 'expectedPlacementDate' => true, + 'placementDate' => true, + 'deathDate' => true, + 'averageWeeklyEarnings' => false, + 'automaticAWECalculation' => false, + 'calculationType' => false, + 'strikeHoursToDeduct' => true, + 'historicLeaveRequiresProcessing' => false, + 'offsetPay' => false, + 'useAssumedPensionablePay' => false, + 'automaticAPPCalculation' => false, + 'assumedPensionablePay' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'type' => 'type', + 'payment' => 'payment', + 'payrollCode' => 'payrollCode', + 'openEndedAbsence' => 'openEndedAbsence', + 'percentOfPay' => 'percentOfPay', + 'paySSPInAddition' => 'paySSPInAddition', + 'payFrequency' => 'payFrequency', + 'occupationalPolicy' => 'occupationalPolicy', + 'from' => 'from', + 'to' => 'to', + 'useOpeningPay' => 'useOpeningPay', + 'openingPay' => 'openingPay', + 'openingOmpPay' => 'openingOmpPay', + 'babyDueDate' => 'babyDueDate', + 'babyBirthDate' => 'babyBirthDate', + 'matchingDate' => 'matchingDate', + 'expectedPlacementDate' => 'expectedPlacementDate', + 'placementDate' => 'placementDate', + 'deathDate' => 'deathDate', + 'averageWeeklyEarnings' => 'averageWeeklyEarnings', + 'automaticAWECalculation' => 'automaticAWECalculation', + 'calculationType' => 'calculationType', + 'strikeHoursToDeduct' => 'strikeHoursToDeduct', + 'historicLeaveRequiresProcessing' => 'historicLeaveRequiresProcessing', + 'offsetPay' => 'offsetPay', + 'useAssumedPensionablePay' => 'useAssumedPensionablePay', + 'automaticAPPCalculation' => 'automaticAPPCalculation', + 'assumedPensionablePay' => 'assumedPensionablePay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'type' => 'setType', + 'payment' => 'setPayment', + 'payrollCode' => 'setPayrollCode', + 'openEndedAbsence' => 'setOpenEndedAbsence', + 'percentOfPay' => 'setPercentOfPay', + 'paySSPInAddition' => 'setPaySSPInAddition', + 'payFrequency' => 'setPayFrequency', + 'occupationalPolicy' => 'setOccupationalPolicy', + 'from' => 'setFrom', + 'to' => 'setTo', + 'useOpeningPay' => 'setUseOpeningPay', + 'openingPay' => 'setOpeningPay', + 'openingOmpPay' => 'setOpeningOmpPay', + 'babyDueDate' => 'setBabyDueDate', + 'babyBirthDate' => 'setBabyBirthDate', + 'matchingDate' => 'setMatchingDate', + 'expectedPlacementDate' => 'setExpectedPlacementDate', + 'placementDate' => 'setPlacementDate', + 'deathDate' => 'setDeathDate', + 'averageWeeklyEarnings' => 'setAverageWeeklyEarnings', + 'automaticAWECalculation' => 'setAutomaticAWECalculation', + 'calculationType' => 'setCalculationType', + 'strikeHoursToDeduct' => 'setStrikeHoursToDeduct', + 'historicLeaveRequiresProcessing' => 'setHistoricLeaveRequiresProcessing', + 'offsetPay' => 'setOffsetPay', + 'useAssumedPensionablePay' => 'setUseAssumedPensionablePay', + 'automaticAPPCalculation' => 'setAutomaticAPPCalculation', + 'assumedPensionablePay' => 'setAssumedPensionablePay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'type' => 'getType', + 'payment' => 'getPayment', + 'payrollCode' => 'getPayrollCode', + 'openEndedAbsence' => 'getOpenEndedAbsence', + 'percentOfPay' => 'getPercentOfPay', + 'paySSPInAddition' => 'getPaySSPInAddition', + 'payFrequency' => 'getPayFrequency', + 'occupationalPolicy' => 'getOccupationalPolicy', + 'from' => 'getFrom', + 'to' => 'getTo', + 'useOpeningPay' => 'getUseOpeningPay', + 'openingPay' => 'getOpeningPay', + 'openingOmpPay' => 'getOpeningOmpPay', + 'babyDueDate' => 'getBabyDueDate', + 'babyBirthDate' => 'getBabyBirthDate', + 'matchingDate' => 'getMatchingDate', + 'expectedPlacementDate' => 'getExpectedPlacementDate', + 'placementDate' => 'getPlacementDate', + 'deathDate' => 'getDeathDate', + 'averageWeeklyEarnings' => 'getAverageWeeklyEarnings', + 'automaticAWECalculation' => 'getAutomaticAWECalculation', + 'calculationType' => 'getCalculationType', + 'strikeHoursToDeduct' => 'getStrikeHoursToDeduct', + 'historicLeaveRequiresProcessing' => 'getHistoricLeaveRequiresProcessing', + 'offsetPay' => 'getOffsetPay', + 'useAssumedPensionablePay' => 'getUseAssumedPensionablePay', + 'automaticAPPCalculation' => 'getAutomaticAPPCalculation', + 'assumedPensionablePay' => 'getAssumedPensionablePay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('openEndedAbsence', $data ?? [], null); + $this->setIfExists('percentOfPay', $data ?? [], null); + $this->setIfExists('paySSPInAddition', $data ?? [], null); + $this->setIfExists('payFrequency', $data ?? [], null); + $this->setIfExists('occupationalPolicy', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('useOpeningPay', $data ?? [], null); + $this->setIfExists('openingPay', $data ?? [], null); + $this->setIfExists('openingOmpPay', $data ?? [], null); + $this->setIfExists('babyDueDate', $data ?? [], null); + $this->setIfExists('babyBirthDate', $data ?? [], null); + $this->setIfExists('matchingDate', $data ?? [], null); + $this->setIfExists('expectedPlacementDate', $data ?? [], null); + $this->setIfExists('placementDate', $data ?? [], null); + $this->setIfExists('deathDate', $data ?? [], null); + $this->setIfExists('averageWeeklyEarnings', $data ?? [], null); + $this->setIfExists('automaticAWECalculation', $data ?? [], null); + $this->setIfExists('calculationType', $data ?? [], null); + $this->setIfExists('strikeHoursToDeduct', $data ?? [], null); + $this->setIfExists('historicLeaveRequiresProcessing', $data ?? [], null); + $this->setIfExists('offsetPay', $data ?? [], null); + $this->setIfExists('useAssumedPensionablePay', $data ?? [], null); + $this->setIfExists('automaticAPPCalculation', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LeaveType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LeaveType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LeaveType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LeaveType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets payment + * + * @return \SynergiTech\Staffology\Model\LeavePayType|null + */ + public function getPayment(): ?\SynergiTech\Staffology\Model\LeavePayType + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \SynergiTech\Staffology\Model\LeavePayType|null $payment payment + * + * @return $this + */ + public function setPayment(?\SynergiTech\Staffology\Model\LeavePayType $payment): static + { + if (is_null($payment)) { + throw new InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets openEndedAbsence + * + * @return bool|null + */ + public function getOpenEndedAbsence(): ?bool + { + return $this->container['openEndedAbsence']; + } + + /** + * Sets openEndedAbsence + * + * @param bool|null $openEndedAbsence openEndedAbsence + * + * @return $this + */ + public function setOpenEndedAbsence(?bool $openEndedAbsence): static + { + if (is_null($openEndedAbsence)) { + throw new InvalidArgumentException('non-nullable openEndedAbsence cannot be null'); + } + $this->container['openEndedAbsence'] = $openEndedAbsence; + + return $this; + } + + /** + * Gets percentOfPay + * + * @return float|null + */ + public function getPercentOfPay(): ?float + { + return $this->container['percentOfPay']; + } + + /** + * Sets percentOfPay + * + * @param float|null $percentOfPay percentOfPay + * + * @return $this + */ + public function setPercentOfPay(?float $percentOfPay): static + { + if (is_null($percentOfPay)) { + throw new InvalidArgumentException('non-nullable percentOfPay cannot be null'); + } + $this->container['percentOfPay'] = $percentOfPay; + + return $this; + } + + /** + * Gets paySSPInAddition + * + * @return bool|null + */ + public function getPaySSPInAddition(): ?bool + { + return $this->container['paySSPInAddition']; + } + + /** + * Sets paySSPInAddition + * + * @param bool|null $paySSPInAddition paySSPInAddition + * + * @return $this + */ + public function setPaySSPInAddition(?bool $paySSPInAddition): static + { + if (is_null($paySSPInAddition)) { + throw new InvalidArgumentException('non-nullable paySSPInAddition cannot be null'); + } + $this->container['paySSPInAddition'] = $paySSPInAddition; + + return $this; + } + + /** + * Gets payFrequency + * + * @return \SynergiTech\Staffology\Model\StatPayFrequency|null + */ + public function getPayFrequency(): ?\SynergiTech\Staffology\Model\StatPayFrequency + { + return $this->container['payFrequency']; + } + + /** + * Sets payFrequency + * + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency payFrequency + * + * @return $this + */ + public function setPayFrequency(?\SynergiTech\Staffology\Model\StatPayFrequency $payFrequency): static + { + if (is_null($payFrequency)) { + throw new InvalidArgumentException('non-nullable payFrequency cannot be null'); + } + $this->container['payFrequency'] = $payFrequency; + + return $this; + } + + /** + * Gets occupationalPolicy + * + * @return string|null + */ + public function getOccupationalPolicy(): ?string + { + return $this->container['occupationalPolicy']; + } + + /** + * Sets occupationalPolicy + * + * @param string|null $occupationalPolicy occupationalPolicy + * + * @return $this + */ + public function setOccupationalPolicy(?string $occupationalPolicy): static + { + if (is_null($occupationalPolicy)) { + array_push($this->openAPINullablesSetToNull, 'occupationalPolicy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalPolicy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalPolicy'] = $occupationalPolicy; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime|null + */ + public function getFrom(): ?\DateTime + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime|null $from from + * + * @return $this + */ + public function setFrom(?\DateTime $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \DateTime|null + */ + public function getTo(): ?\DateTime + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \DateTime|null $to to + * + * @return $this + */ + public function setTo(?\DateTime $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets useOpeningPay + * + * @return bool|null + */ + public function getUseOpeningPay(): ?bool + { + return $this->container['useOpeningPay']; + } + + /** + * Sets useOpeningPay + * + * @param bool|null $useOpeningPay useOpeningPay + * + * @return $this + */ + public function setUseOpeningPay(?bool $useOpeningPay): static + { + if (is_null($useOpeningPay)) { + throw new InvalidArgumentException('non-nullable useOpeningPay cannot be null'); + } + $this->container['useOpeningPay'] = $useOpeningPay; + + return $this; + } + + /** + * Gets openingPay + * + * @return float|null + */ + public function getOpeningPay(): ?float + { + return $this->container['openingPay']; + } + + /** + * Sets openingPay + * + * @param float|null $openingPay openingPay + * + * @return $this + */ + public function setOpeningPay(?float $openingPay): static + { + if (is_null($openingPay)) { + array_push($this->openAPINullablesSetToNull, 'openingPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('openingPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['openingPay'] = $openingPay; + + return $this; + } + + /** + * Gets openingOmpPay + * + * @return float|null + */ + public function getOpeningOmpPay(): ?float + { + return $this->container['openingOmpPay']; + } + + /** + * Sets openingOmpPay + * + * @param float|null $openingOmpPay openingOmpPay + * + * @return $this + */ + public function setOpeningOmpPay(?float $openingOmpPay): static + { + if (is_null($openingOmpPay)) { + array_push($this->openAPINullablesSetToNull, 'openingOmpPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('openingOmpPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['openingOmpPay'] = $openingOmpPay; + + return $this; + } + + /** + * Gets babyDueDate + * + * @return \DateTime|null + */ + public function getBabyDueDate(): ?\DateTime + { + return $this->container['babyDueDate']; + } + + /** + * Sets babyDueDate + * + * @param \DateTime|null $babyDueDate babyDueDate + * + * @return $this + */ + public function setBabyDueDate(?\DateTime $babyDueDate): static + { + if (is_null($babyDueDate)) { + array_push($this->openAPINullablesSetToNull, 'babyDueDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('babyDueDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['babyDueDate'] = $babyDueDate; + + return $this; + } + + /** + * Gets babyBirthDate + * + * @return \DateTime|null + */ + public function getBabyBirthDate(): ?\DateTime + { + return $this->container['babyBirthDate']; + } + + /** + * Sets babyBirthDate + * + * @param \DateTime|null $babyBirthDate babyBirthDate + * + * @return $this + */ + public function setBabyBirthDate(?\DateTime $babyBirthDate): static + { + if (is_null($babyBirthDate)) { + array_push($this->openAPINullablesSetToNull, 'babyBirthDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('babyBirthDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['babyBirthDate'] = $babyBirthDate; + + return $this; + } + + /** + * Gets matchingDate + * + * @return \DateTime|null + */ + public function getMatchingDate(): ?\DateTime + { + return $this->container['matchingDate']; + } + + /** + * Sets matchingDate + * + * @param \DateTime|null $matchingDate matchingDate + * + * @return $this + */ + public function setMatchingDate(?\DateTime $matchingDate): static + { + if (is_null($matchingDate)) { + array_push($this->openAPINullablesSetToNull, 'matchingDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matchingDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['matchingDate'] = $matchingDate; + + return $this; + } + + /** + * Gets expectedPlacementDate + * + * @return \DateTime|null + */ + public function getExpectedPlacementDate(): ?\DateTime + { + return $this->container['expectedPlacementDate']; + } + + /** + * Sets expectedPlacementDate + * + * @param \DateTime|null $expectedPlacementDate expectedPlacementDate + * + * @return $this + */ + public function setExpectedPlacementDate(?\DateTime $expectedPlacementDate): static + { + if (is_null($expectedPlacementDate)) { + array_push($this->openAPINullablesSetToNull, 'expectedPlacementDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expectedPlacementDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expectedPlacementDate'] = $expectedPlacementDate; + + return $this; + } + + /** + * Gets placementDate + * + * @return \DateTime|null + */ + public function getPlacementDate(): ?\DateTime + { + return $this->container['placementDate']; + } + + /** + * Sets placementDate + * + * @param \DateTime|null $placementDate placementDate + * + * @return $this + */ + public function setPlacementDate(?\DateTime $placementDate): static + { + if (is_null($placementDate)) { + array_push($this->openAPINullablesSetToNull, 'placementDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('placementDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['placementDate'] = $placementDate; + + return $this; + } + + /** + * Gets deathDate + * + * @return \DateTime|null + */ + public function getDeathDate(): ?\DateTime + { + return $this->container['deathDate']; + } + + /** + * Sets deathDate + * + * @param \DateTime|null $deathDate deathDate + * + * @return $this + */ + public function setDeathDate(?\DateTime $deathDate): static + { + if (is_null($deathDate)) { + array_push($this->openAPINullablesSetToNull, 'deathDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deathDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deathDate'] = $deathDate; + + return $this; + } + + /** + * Gets averageWeeklyEarnings + * + * @return float|null + */ + public function getAverageWeeklyEarnings(): ?float + { + return $this->container['averageWeeklyEarnings']; + } + + /** + * Sets averageWeeklyEarnings + * + * @param float|null $averageWeeklyEarnings averageWeeklyEarnings + * + * @return $this + */ + public function setAverageWeeklyEarnings(?float $averageWeeklyEarnings): static + { + if (is_null($averageWeeklyEarnings)) { + throw new InvalidArgumentException('non-nullable averageWeeklyEarnings cannot be null'); + } + $this->container['averageWeeklyEarnings'] = $averageWeeklyEarnings; + + return $this; + } + + /** + * Gets automaticAWECalculation + * + * @return bool|null + */ + public function getAutomaticAWECalculation(): ?bool + { + return $this->container['automaticAWECalculation']; + } + + /** + * Sets automaticAWECalculation + * + * @param bool|null $automaticAWECalculation automaticAWECalculation + * + * @return $this + */ + public function setAutomaticAWECalculation(?bool $automaticAWECalculation): static + { + if (is_null($automaticAWECalculation)) { + throw new InvalidArgumentException('non-nullable automaticAWECalculation cannot be null'); + } + $this->container['automaticAWECalculation'] = $automaticAWECalculation; + + return $this; + } + + /** + * Gets calculationType + * + * @return \SynergiTech\Staffology\Model\LeaveCalculationType|null + */ + public function getCalculationType(): ?\SynergiTech\Staffology\Model\LeaveCalculationType + { + return $this->container['calculationType']; + } + + /** + * Sets calculationType + * + * @param \SynergiTech\Staffology\Model\LeaveCalculationType|null $calculationType calculationType + * + * @return $this + */ + public function setCalculationType(?\SynergiTech\Staffology\Model\LeaveCalculationType $calculationType): static + { + if (is_null($calculationType)) { + throw new InvalidArgumentException('non-nullable calculationType cannot be null'); + } + $this->container['calculationType'] = $calculationType; + + return $this; + } + + /** + * Gets strikeHoursToDeduct + * + * @return float|null + */ + public function getStrikeHoursToDeduct(): ?float + { + return $this->container['strikeHoursToDeduct']; + } + + /** + * Sets strikeHoursToDeduct + * + * @param float|null $strikeHoursToDeduct strikeHoursToDeduct + * + * @return $this + */ + public function setStrikeHoursToDeduct(?float $strikeHoursToDeduct): static + { + if (is_null($strikeHoursToDeduct)) { + array_push($this->openAPINullablesSetToNull, 'strikeHoursToDeduct'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('strikeHoursToDeduct', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['strikeHoursToDeduct'] = $strikeHoursToDeduct; + + return $this; + } + + /** + * Gets historicLeaveRequiresProcessing + * + * @return bool|null + */ + public function getHistoricLeaveRequiresProcessing(): ?bool + { + return $this->container['historicLeaveRequiresProcessing']; + } + + /** + * Sets historicLeaveRequiresProcessing + * + * @param bool|null $historicLeaveRequiresProcessing historicLeaveRequiresProcessing + * + * @return $this + */ + public function setHistoricLeaveRequiresProcessing(?bool $historicLeaveRequiresProcessing): static + { + if (is_null($historicLeaveRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicLeaveRequiresProcessing cannot be null'); + } + $this->container['historicLeaveRequiresProcessing'] = $historicLeaveRequiresProcessing; + + return $this; + } + + /** + * Gets offsetPay + * + * @return bool|null + */ + public function getOffsetPay(): ?bool + { + return $this->container['offsetPay']; + } + + /** + * Sets offsetPay + * + * @param bool|null $offsetPay offsetPay + * + * @return $this + */ + public function setOffsetPay(?bool $offsetPay): static + { + if (is_null($offsetPay)) { + throw new InvalidArgumentException('non-nullable offsetPay cannot be null'); + } + $this->container['offsetPay'] = $offsetPay; + + return $this; + } + + /** + * Gets useAssumedPensionablePay + * + * @return bool|null + */ + public function getUseAssumedPensionablePay(): ?bool + { + return $this->container['useAssumedPensionablePay']; + } + + /** + * Sets useAssumedPensionablePay + * + * @param bool|null $useAssumedPensionablePay useAssumedPensionablePay + * + * @return $this + */ + public function setUseAssumedPensionablePay(?bool $useAssumedPensionablePay): static + { + if (is_null($useAssumedPensionablePay)) { + throw new InvalidArgumentException('non-nullable useAssumedPensionablePay cannot be null'); + } + $this->container['useAssumedPensionablePay'] = $useAssumedPensionablePay; + + return $this; + } + + /** + * Gets automaticAPPCalculation + * + * @return bool|null + */ + public function getAutomaticAPPCalculation(): ?bool + { + return $this->container['automaticAPPCalculation']; + } + + /** + * Sets automaticAPPCalculation + * + * @param bool|null $automaticAPPCalculation automaticAPPCalculation + * + * @return $this + */ + public function setAutomaticAPPCalculation(?bool $automaticAPPCalculation): static + { + if (is_null($automaticAPPCalculation)) { + throw new InvalidArgumentException('non-nullable automaticAPPCalculation cannot be null'); + } + $this->container['automaticAPPCalculation'] = $automaticAPPCalculation; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float|null + */ + public function getAssumedPensionablePay(): ?float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float|null $assumedPensionablePay assumedPensionablePay + * + * @return $this + */ + public function setAssumedPensionablePay(?float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeLeaveReportReportResponse.php b/src/Model/EmployeeLeaveReportReportResponse.php new file mode 100644 index 0000000..5a40472 --- /dev/null +++ b/src/Model/EmployeeLeaveReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class EmployeeLeaveReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeLeaveReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\EmployeeLeaveReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\EmployeeLeaveReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\EmployeeLeaveReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\EmployeeLeaveReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\EmployeeLeaveReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeNiYtdValues.php b/src/Model/EmployeeNiYtdValues.php new file mode 100644 index 0000000..ee22075 --- /dev/null +++ b/src/Model/EmployeeNiYtdValues.php @@ -0,0 +1,606 @@ + + */ +class EmployeeNiYtdValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeNiYtdValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'niTable' => 'string', + 'values' => '\SynergiTech\Staffology\Model\NiYtdValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'firstName' => null, + 'lastName' => null, + 'niTable' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'firstName' => true, + 'lastName' => true, + 'niTable' => false, + 'values' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'niTable' => 'niTable', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'niTable' => 'setNiTable', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'niTable' => 'getNiTable', + 'values' => 'getValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets values + * + * @return \SynergiTech\Staffology\Model\NiYtdValue[]|null + */ + public function getValues(): ?array + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \SynergiTech\Staffology\Model\NiYtdValue[]|null $values values + * + * @return $this + */ + public function setValues(?array $values): static + { + if (is_null($values)) { + array_push($this->openAPINullablesSetToNull, 'values'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('values', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeePayRunTotal.php b/src/Model/EmployeePayRunTotal.php new file mode 100644 index 0000000..b82ee19 --- /dev/null +++ b/src/Model/EmployeePayRunTotal.php @@ -0,0 +1,790 @@ + + */ +class EmployeePayRunTotal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeePayRunTotal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'grossForNi' => 'float', + 'grossPensionPay' => 'float', + 'employerPensionContribution' => 'float', + 'employerNi' => 'float', + 'grossTaxablePay' => 'float', + 'employeeNi' => 'float', + 'tax' => 'float', + 'studentLoanRecovered' => 'float', + 'employeePension' => 'float', + 'employeePensionContributionReliefAtSource' => 'float', + 'employeePensionContributionSalarySacrifice' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'grossForNi' => 'double', + 'grossPensionPay' => 'double', + 'employerPensionContribution' => 'double', + 'employerNi' => 'double', + 'grossTaxablePay' => 'double', + 'employeeNi' => 'double', + 'tax' => 'double', + 'studentLoanRecovered' => 'double', + 'employeePension' => 'double', + 'employeePensionContributionReliefAtSource' => 'double', + 'employeePensionContributionSalarySacrifice' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'grossForNi' => false, + 'grossPensionPay' => false, + 'employerPensionContribution' => false, + 'employerNi' => false, + 'grossTaxablePay' => false, + 'employeeNi' => false, + 'tax' => false, + 'studentLoanRecovered' => false, + 'employeePension' => false, + 'employeePensionContributionReliefAtSource' => false, + 'employeePensionContributionSalarySacrifice' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'grossForNi' => 'grossForNi', + 'grossPensionPay' => 'grossPensionPay', + 'employerPensionContribution' => 'employerPensionContribution', + 'employerNi' => 'employerNi', + 'grossTaxablePay' => 'grossTaxablePay', + 'employeeNi' => 'employeeNi', + 'tax' => 'tax', + 'studentLoanRecovered' => 'studentLoanRecovered', + 'employeePension' => 'employeePension', + 'employeePensionContributionReliefAtSource' => 'employeePensionContributionReliefAtSource', + 'employeePensionContributionSalarySacrifice' => 'employeePensionContributionSalarySacrifice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'grossForNi' => 'setGrossForNi', + 'grossPensionPay' => 'setGrossPensionPay', + 'employerPensionContribution' => 'setEmployerPensionContribution', + 'employerNi' => 'setEmployerNi', + 'grossTaxablePay' => 'setGrossTaxablePay', + 'employeeNi' => 'setEmployeeNi', + 'tax' => 'setTax', + 'studentLoanRecovered' => 'setStudentLoanRecovered', + 'employeePension' => 'setEmployeePension', + 'employeePensionContributionReliefAtSource' => 'setEmployeePensionContributionReliefAtSource', + 'employeePensionContributionSalarySacrifice' => 'setEmployeePensionContributionSalarySacrifice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'grossForNi' => 'getGrossForNi', + 'grossPensionPay' => 'getGrossPensionPay', + 'employerPensionContribution' => 'getEmployerPensionContribution', + 'employerNi' => 'getEmployerNi', + 'grossTaxablePay' => 'getGrossTaxablePay', + 'employeeNi' => 'getEmployeeNi', + 'tax' => 'getTax', + 'studentLoanRecovered' => 'getStudentLoanRecovered', + 'employeePension' => 'getEmployeePension', + 'employeePensionContributionReliefAtSource' => 'getEmployeePensionContributionReliefAtSource', + 'employeePensionContributionSalarySacrifice' => 'getEmployeePensionContributionSalarySacrifice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('grossForNi', $data ?? [], null); + $this->setIfExists('grossPensionPay', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('grossTaxablePay', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('studentLoanRecovered', $data ?? [], null); + $this->setIfExists('employeePension', $data ?? [], null); + $this->setIfExists('employeePensionContributionReliefAtSource', $data ?? [], null); + $this->setIfExists('employeePensionContributionSalarySacrifice', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode Payroll code of the employee + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets grossForNi + * + * @return float|null + */ + public function getGrossForNi(): ?float + { + return $this->container['grossForNi']; + } + + /** + * Sets grossForNi + * + * @param float|null $grossForNi The amount of the Gross that is subject to NI + * + * @return $this + */ + public function setGrossForNi(?float $grossForNi): static + { + if (is_null($grossForNi)) { + throw new InvalidArgumentException('non-nullable grossForNi cannot be null'); + } + $this->container['grossForNi'] = $grossForNi; + + return $this; + } + + /** + * Gets grossPensionPay + * + * @return float|null + */ + public function getGrossPensionPay(): ?float + { + return $this->container['grossPensionPay']; + } + + /** + * Sets grossPensionPay + * + * @param float|null $grossPensionPay The amount of the Gross that is subject to PensionPay + * + * @return $this + */ + public function setGrossPensionPay(?float $grossPensionPay): static + { + if (is_null($grossPensionPay)) { + throw new InvalidArgumentException('non-nullable grossPensionPay cannot be null'); + } + $this->container['grossPensionPay'] = $grossPensionPay; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return float|null + */ + public function getEmployerPensionContribution(): ?float + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param float|null $employerPensionContribution The value of the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setEmployerPensionContribution(?float $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + throw new InvalidArgumentException('non-nullable employerPensionContribution cannot be null'); + } + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi The Employer NI Contribution amount + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets grossTaxablePay + * + * @return float|null + */ + public function getGrossTaxablePay(): ?float + { + return $this->container['grossTaxablePay']; + } + + /** + * Sets grossTaxablePay + * + * @param float|null $grossTaxablePay The amount of the Gross that is subject to TaxablePay + * + * @return $this + */ + public function setGrossTaxablePay(?float $grossTaxablePay): static + { + if (is_null($grossTaxablePay)) { + throw new InvalidArgumentException('non-nullable grossTaxablePay cannot be null'); + } + $this->container['grossTaxablePay'] = $grossTaxablePay; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi The Employee NI Contribution amount + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The Employee Tax amount + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets studentLoanRecovered + * + * @return float|null + */ + public function getStudentLoanRecovered(): ?float + { + return $this->container['studentLoanRecovered']; + } + + /** + * Sets studentLoanRecovered + * + * @param float|null $studentLoanRecovered The Employee Student Loan recovered amount + * + * @return $this + */ + public function setStudentLoanRecovered(?float $studentLoanRecovered): static + { + if (is_null($studentLoanRecovered)) { + throw new InvalidArgumentException('non-nullable studentLoanRecovered cannot be null'); + } + $this->container['studentLoanRecovered'] = $studentLoanRecovered; + + return $this; + } + + /** + * Gets employeePension + * + * @return float|null + */ + public function getEmployeePension(): ?float + { + return $this->container['employeePension']; + } + + /** + * Sets employeePension + * + * @param float|null $employeePension The value of the Pension Contribution(PENSION) being made by the Employee as a Net Pay Arrangement + * + * @return $this + */ + public function setEmployeePension(?float $employeePension): static + { + if (is_null($employeePension)) { + throw new InvalidArgumentException('non-nullable employeePension cannot be null'); + } + $this->container['employeePension'] = $employeePension; + + return $this; + } + + /** + * Gets employeePensionContributionReliefAtSource + * + * @return float|null + */ + public function getEmployeePensionContributionReliefAtSource(): ?float + { + return $this->container['employeePensionContributionReliefAtSource']; + } + + /** + * Sets employeePensionContributionReliefAtSource + * + * @param float|null $employeePensionContributionReliefAtSource The value of employee pension contributions Relief At Source(PENSIONRAS) that are not paid under 'net pay arrangements' + * + * @return $this + */ + public function setEmployeePensionContributionReliefAtSource(?float $employeePensionContributionReliefAtSource): static + { + if (is_null($employeePensionContributionReliefAtSource)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionReliefAtSource cannot be null'); + } + $this->container['employeePensionContributionReliefAtSource'] = $employeePensionContributionReliefAtSource; + + return $this; + } + + /** + * Gets employeePensionContributionSalarySacrifice + * + * @return float|null + */ + public function getEmployeePensionContributionSalarySacrifice(): ?float + { + return $this->container['employeePensionContributionSalarySacrifice']; + } + + /** + * Sets employeePensionContributionSalarySacrifice + * + * @param float|null $employeePensionContributionSalarySacrifice The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee as a Salary Sacrifice + * + * @return $this + */ + public function setEmployeePensionContributionSalarySacrifice(?float $employeePensionContributionSalarySacrifice): static + { + if (is_null($employeePensionContributionSalarySacrifice)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionSalarySacrifice cannot be null'); + } + $this->container['employeePensionContributionSalarySacrifice'] = $employeePensionContributionSalarySacrifice; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeRole.php b/src/Model/EmployeeRole.php new file mode 100644 index 0000000..098a9a3 --- /dev/null +++ b/src/Model/EmployeeRole.php @@ -0,0 +1,868 @@ + + */ +class EmployeeRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'jobTitle' => 'string', + 'isPrimary' => 'bool', + 'reference' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'basis' => '\SynergiTech\Staffology\Model\RoleBasis', + 'type' => '\SynergiTech\Staffology\Model\RoleType', + 'payOptions' => '\SynergiTech\Staffology\Model\EmployeeRolePayOptions', + 'workingPatternId' => 'string', + 'occupationalMaternityPolicyUniqueId' => 'string', + 'occupationalSicknessPolicyUniqueId' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'jobTitle' => null, + 'isPrimary' => null, + 'reference' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'basis' => null, + 'type' => null, + 'payOptions' => null, + 'workingPatternId' => 'uuid', + 'occupationalMaternityPolicyUniqueId' => 'uuid', + 'occupationalSicknessPolicyUniqueId' => 'uuid', + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'jobTitle' => true, + 'isPrimary' => false, + 'reference' => true, + 'startDate' => false, + 'endDate' => true, + 'basis' => false, + 'type' => false, + 'payOptions' => false, + 'workingPatternId' => true, + 'occupationalMaternityPolicyUniqueId' => true, + 'occupationalSicknessPolicyUniqueId' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'jobTitle' => 'jobTitle', + 'isPrimary' => 'isPrimary', + 'reference' => 'reference', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'basis' => 'basis', + 'type' => 'type', + 'payOptions' => 'payOptions', + 'workingPatternId' => 'workingPatternId', + 'occupationalMaternityPolicyUniqueId' => 'occupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'occupationalSicknessPolicyUniqueId', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'jobTitle' => 'setJobTitle', + 'isPrimary' => 'setIsPrimary', + 'reference' => 'setReference', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'basis' => 'setBasis', + 'type' => 'setType', + 'payOptions' => 'setPayOptions', + 'workingPatternId' => 'setWorkingPatternId', + 'occupationalMaternityPolicyUniqueId' => 'setOccupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'setOccupationalSicknessPolicyUniqueId', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'jobTitle' => 'getJobTitle', + 'isPrimary' => 'getIsPrimary', + 'reference' => 'getReference', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'basis' => 'getBasis', + 'type' => 'getType', + 'payOptions' => 'getPayOptions', + 'workingPatternId' => 'getWorkingPatternId', + 'occupationalMaternityPolicyUniqueId' => 'getOccupationalMaternityPolicyUniqueId', + 'occupationalSicknessPolicyUniqueId' => 'getOccupationalSicknessPolicyUniqueId', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('workingPatternId', $data ?? [], null); + $this->setIfExists('occupationalMaternityPolicyUniqueId', $data ?? [], null); + $this->setIfExists('occupationalSicknessPolicyUniqueId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reference']) && (mb_strlen($this->container['reference']) > 35)) { + $invalidProperties[] = "invalid value for 'reference', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle Job Title of the Role + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Set to True if this is Primary role of the Employee + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference reference + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reference) && (mb_strlen($reference) > 35)) { + throw new InvalidArgumentException('invalid length for $reference when calling EmployeeRole., must be smaller than or equal to 35.'); + } + + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\RoleBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\RoleBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\RoleBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\RoleBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\RoleType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\RoleType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\RoleType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\RoleType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\EmployeeRolePayOptions|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\EmployeeRolePayOptions + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\EmployeeRolePayOptions|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\EmployeeRolePayOptions $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets workingPatternId + * + * @return string|null + * @deprecated + */ + public function getWorkingPatternId(): ?string + { + return $this->container['workingPatternId']; + } + + /** + * Sets workingPatternId + * + * @param string|null $workingPatternId Used when calculating payments for Leave. If null then the default Working Pattern is used + * + * @return $this + * @deprecated + */ + public function setWorkingPatternId(?string $workingPatternId): static + { + if (is_null($workingPatternId)) { + array_push($this->openAPINullablesSetToNull, 'workingPatternId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workingPatternId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workingPatternId'] = $workingPatternId; + + return $this; + } + + /** + * Gets occupationalMaternityPolicyUniqueId + * + * @return string|null + */ + public function getOccupationalMaternityPolicyUniqueId(): ?string + { + return $this->container['occupationalMaternityPolicyUniqueId']; + } + + /** + * Sets occupationalMaternityPolicyUniqueId + * + * @param string|null $occupationalMaternityPolicyUniqueId Used for assigning occupational maternity policy + * + * @return $this + */ + public function setOccupationalMaternityPolicyUniqueId(?string $occupationalMaternityPolicyUniqueId): static + { + if (is_null($occupationalMaternityPolicyUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalMaternityPolicyUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalMaternityPolicyUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalMaternityPolicyUniqueId'] = $occupationalMaternityPolicyUniqueId; + + return $this; + } + + /** + * Gets occupationalSicknessPolicyUniqueId + * + * @return string|null + */ + public function getOccupationalSicknessPolicyUniqueId(): ?string + { + return $this->container['occupationalSicknessPolicyUniqueId']; + } + + /** + * Sets occupationalSicknessPolicyUniqueId + * + * @param string|null $occupationalSicknessPolicyUniqueId Used for assigning occupational sickness policy + * + * @return $this + */ + public function setOccupationalSicknessPolicyUniqueId(?string $occupationalSicknessPolicyUniqueId): static + { + if (is_null($occupationalSicknessPolicyUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalSicknessPolicyUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalSicknessPolicyUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalSicknessPolicyUniqueId'] = $occupationalSicknessPolicyUniqueId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeRoleAnalysisCategoryCode.php b/src/Model/EmployeeRoleAnalysisCategoryCode.php new file mode 100644 index 0000000..9e31d73 --- /dev/null +++ b/src/Model/EmployeeRoleAnalysisCategoryCode.php @@ -0,0 +1,713 @@ + + */ +class EmployeeRoleAnalysisCategoryCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeRoleAnalysisCategoryCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'isPrimary' => 'bool', + 'weighting' => 'float', + 'analysisCategoryName' => 'string', + 'analysisCategoryPublicId' => 'string', + 'employeeRolePublicId' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'color' => null, + 'title' => null, + 'isPrimary' => null, + 'weighting' => 'double', + 'analysisCategoryName' => null, + 'analysisCategoryPublicId' => 'uuid', + 'employeeRolePublicId' => 'uuid', + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'color' => true, + 'title' => true, + 'isPrimary' => false, + 'weighting' => false, + 'analysisCategoryName' => true, + 'analysisCategoryPublicId' => false, + 'employeeRolePublicId' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'isPrimary' => 'isPrimary', + 'weighting' => 'weighting', + 'analysisCategoryName' => 'analysisCategoryName', + 'analysisCategoryPublicId' => 'analysisCategoryPublicId', + 'employeeRolePublicId' => 'employeeRolePublicId', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'isPrimary' => 'setIsPrimary', + 'weighting' => 'setWeighting', + 'analysisCategoryName' => 'setAnalysisCategoryName', + 'analysisCategoryPublicId' => 'setAnalysisCategoryPublicId', + 'employeeRolePublicId' => 'setEmployeeRolePublicId', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'isPrimary' => 'getIsPrimary', + 'weighting' => 'getWeighting', + 'analysisCategoryName' => 'getAnalysisCategoryName', + 'analysisCategoryPublicId' => 'getAnalysisCategoryPublicId', + 'employeeRolePublicId' => 'getEmployeeRolePublicId', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('weighting', $data ?? [], null); + $this->setIfExists('analysisCategoryName', $data ?? [], null); + $this->setIfExists('analysisCategoryPublicId', $data ?? [], null); + $this->setIfExists('employeeRolePublicId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The Code for the AnalysisCategoryCode + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling EmployeeRoleAnalysisCategoryCode., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color [readonly] The Color for the AnalysisCategoryCode + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] The Title for the AnalysisCategoryCode + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Set to true if this is the primary AnalysisCategoryCode for the Employee. Only one AnalysisCategoryCode can be set as the primary. + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets weighting + * + * @return float|null + */ + public function getWeighting(): ?float + { + return $this->container['weighting']; + } + + /** + * Sets weighting + * + * @param float|null $weighting If there is more than one AnalysisCategoryCode Membership for the Employee then this determines the weighting to give to this membership. ie, if he is in two AnalysisCategoryCode you might set the primary as 0.8 and the secondary as 0.2; + * + * @return $this + */ + public function setWeighting(?float $weighting): static + { + if (is_null($weighting)) { + throw new InvalidArgumentException('non-nullable weighting cannot be null'); + } + $this->container['weighting'] = $weighting; + + return $this; + } + + /** + * Gets analysisCategoryName + * + * @return string|null + */ + public function getAnalysisCategoryName(): ?string + { + return $this->container['analysisCategoryName']; + } + + /** + * Sets analysisCategoryName + * + * @param string|null $analysisCategoryName Analysis Category Name + * + * @return $this + */ + public function setAnalysisCategoryName(?string $analysisCategoryName): static + { + if (is_null($analysisCategoryName)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryName'] = $analysisCategoryName; + + return $this; + } + + /** + * Gets analysisCategoryPublicId + * + * @return string|null + */ + public function getAnalysisCategoryPublicId(): ?string + { + return $this->container['analysisCategoryPublicId']; + } + + /** + * Sets analysisCategoryPublicId + * + * @param string|null $analysisCategoryPublicId Analysis Category Public Id + * + * @return $this + */ + public function setAnalysisCategoryPublicId(?string $analysisCategoryPublicId): static + { + if (is_null($analysisCategoryPublicId)) { + throw new InvalidArgumentException('non-nullable analysisCategoryPublicId cannot be null'); + } + $this->container['analysisCategoryPublicId'] = $analysisCategoryPublicId; + + return $this; + } + + /** + * Gets employeeRolePublicId + * + * @return string|null + */ + public function getEmployeeRolePublicId(): ?string + { + return $this->container['employeeRolePublicId']; + } + + /** + * Sets employeeRolePublicId + * + * @param string|null $employeeRolePublicId Employee Role Public Id + * + * @return $this + */ + public function setEmployeeRolePublicId(?string $employeeRolePublicId): static + { + if (is_null($employeeRolePublicId)) { + throw new InvalidArgumentException('non-nullable employeeRolePublicId cannot be null'); + } + $this->container['employeeRolePublicId'] = $employeeRolePublicId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeRolePayItem.php b/src/Model/EmployeeRolePayItem.php new file mode 100644 index 0000000..325f50e --- /dev/null +++ b/src/Model/EmployeeRolePayItem.php @@ -0,0 +1,544 @@ + + */ +class EmployeeRolePayItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeRolePayItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'roleId' => 'string', + 'isPrimary' => 'bool', + 'baseDailyRate' => 'float', + 'baseHourlyRate' => 'float', + 'weight' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'roleId' => 'uuid', + 'isPrimary' => null, + 'baseDailyRate' => 'double', + 'baseHourlyRate' => 'double', + 'weight' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'roleId' => false, + 'isPrimary' => false, + 'baseDailyRate' => false, + 'baseHourlyRate' => false, + 'weight' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'roleId' => 'roleId', + 'isPrimary' => 'isPrimary', + 'baseDailyRate' => 'baseDailyRate', + 'baseHourlyRate' => 'baseHourlyRate', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'roleId' => 'setRoleId', + 'isPrimary' => 'setIsPrimary', + 'baseDailyRate' => 'setBaseDailyRate', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'roleId' => 'getRoleId', + 'isPrimary' => 'getIsPrimary', + 'baseDailyRate' => 'getBaseDailyRate', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'weight' => 'getWeight' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('weight', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId roleId + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + throw new InvalidArgumentException('non-nullable roleId cannot be null'); + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary isPrimary + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets weight + * + * @return float|null + */ + public function getWeight(): ?float + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param float|null $weight This property is used to calculate values for the relative weight of the usual pay for each role compared to the sum of all roles' usual pay Usual pay for the purpose of the current value's calculation is based on the employee's permanent pay items including employee basic pay and permanent addition and deduction pay lines subject to NI or Tax + * + * @return $this + */ + public function setWeight(?float $weight): static + { + if (is_null($weight)) { + throw new InvalidArgumentException('non-nullable weight cannot be null'); + } + $this->container['weight'] = $weight; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeRolePayOptions.php b/src/Model/EmployeeRolePayOptions.php new file mode 100644 index 0000000..d1cb9af --- /dev/null +++ b/src/Model/EmployeeRolePayOptions.php @@ -0,0 +1,912 @@ + + */ +class EmployeeRolePayOptions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeRolePayOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'nationalMinimumWage' => 'bool', + 'payCode' => 'string', + 'mileageVehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'mapsMiles' => 'int', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'baseHourlyRate' => 'float', + 'baseDailyRate' => 'float', + 'basicPay' => 'float', + 'autoAdjustForLeave' => 'bool', + 'niTable' => 'string', + 'regularPayLines' => '\SynergiTech\Staffology\Model\PayLine[]', + 'excludedRegularPayLines' => '\SynergiTech\Staffology\Model\PayLine[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'basis' => null, + 'nationalMinimumWage' => null, + 'payCode' => null, + 'mileageVehicleType' => null, + 'mapsMiles' => 'int32', + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'baseHourlyRate' => 'double', + 'baseDailyRate' => 'double', + 'basicPay' => 'double', + 'autoAdjustForLeave' => null, + 'niTable' => null, + 'regularPayLines' => null, + 'excludedRegularPayLines' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'basis' => false, + 'nationalMinimumWage' => false, + 'payCode' => true, + 'mileageVehicleType' => false, + 'mapsMiles' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'baseHourlyRate' => false, + 'baseDailyRate' => false, + 'basicPay' => false, + 'autoAdjustForLeave' => false, + 'niTable' => false, + 'regularPayLines' => true, + 'excludedRegularPayLines' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'basis' => 'basis', + 'nationalMinimumWage' => 'nationalMinimumWage', + 'payCode' => 'payCode', + 'mileageVehicleType' => 'mileageVehicleType', + 'mapsMiles' => 'mapsMiles', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'baseHourlyRate' => 'baseHourlyRate', + 'baseDailyRate' => 'baseDailyRate', + 'basicPay' => 'basicPay', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'niTable' => 'niTable', + 'regularPayLines' => 'regularPayLines', + 'excludedRegularPayLines' => 'excludedRegularPayLines', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'basis' => 'setBasis', + 'nationalMinimumWage' => 'setNationalMinimumWage', + 'payCode' => 'setPayCode', + 'mileageVehicleType' => 'setMileageVehicleType', + 'mapsMiles' => 'setMapsMiles', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'baseDailyRate' => 'setBaseDailyRate', + 'basicPay' => 'setBasicPay', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'niTable' => 'setNiTable', + 'regularPayLines' => 'setRegularPayLines', + 'excludedRegularPayLines' => 'setExcludedRegularPayLines', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'basis' => 'getBasis', + 'nationalMinimumWage' => 'getNationalMinimumWage', + 'payCode' => 'getPayCode', + 'mileageVehicleType' => 'getMileageVehicleType', + 'mapsMiles' => 'getMapsMiles', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'baseDailyRate' => 'getBaseDailyRate', + 'basicPay' => 'getBasicPay', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'niTable' => 'getNiTable', + 'regularPayLines' => 'getRegularPayLines', + 'excludedRegularPayLines' => 'getExcludedRegularPayLines', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('nationalMinimumWage', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('mileageVehicleType', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('basicPay', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('regularPayLines', $data ?? [], null); + $this->setIfExists('excludedRegularPayLines', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets nationalMinimumWage + * + * @return bool|null + */ + public function getNationalMinimumWage(): ?bool + { + return $this->container['nationalMinimumWage']; + } + + /** + * Sets nationalMinimumWage + * + * @param bool|null $nationalMinimumWage nationalMinimumWage + * + * @return $this + */ + public function setNationalMinimumWage(?bool $nationalMinimumWage): static + { + if (is_null($nationalMinimumWage)) { + throw new InvalidArgumentException('non-nullable nationalMinimumWage cannot be null'); + } + $this->container['nationalMinimumWage'] = $nationalMinimumWage; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want the Employees pay to be allocated to a code other than BASIC, specify it here + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets mileageVehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getMileageVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['mileageVehicleType']; + } + + /** + * Sets mileageVehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $mileageVehicleType mileageVehicleType + * + * @return $this + */ + public function setMileageVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $mileageVehicleType): static + { + if (is_null($mileageVehicleType)) { + throw new InvalidArgumentException('non-nullable mileageVehicleType cannot be null'); + } + $this->container['mileageVehicleType'] = $mileageVehicleType; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles The number of miles to pay for as Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets basicPay + * + * @return float|null + */ + public function getBasicPay(): ?float + { + return $this->container['basicPay']; + } + + /** + * Sets basicPay + * + * @param float|null $basicPay The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay + * + * @return $this + */ + public function setBasicPay(?float $basicPay): static + { + if (is_null($basicPay)) { + throw new InvalidArgumentException('non-nullable basicPay cannot be null'); + } + $this->container['basicPay'] = $basicPay; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets regularPayLines + * + * @return \SynergiTech\Staffology\Model\PayLine[]|null + */ + public function getRegularPayLines(): ?array + { + return $this->container['regularPayLines']; + } + + /** + * Sets regularPayLines + * + * @param \SynergiTech\Staffology\Model\PayLine[]|null $regularPayLines These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. + * + * @return $this + */ + public function setRegularPayLines(?array $regularPayLines): static + { + if (is_null($regularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'regularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('regularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['regularPayLines'] = $regularPayLines; + + return $this; + } + + /** + * Gets excludedRegularPayLines + * + * @return \SynergiTech\Staffology\Model\PayLine[]|null + */ + public function getExcludedRegularPayLines(): ?array + { + return $this->container['excludedRegularPayLines']; + } + + /** + * Sets excludedRegularPayLines + * + * @param \SynergiTech\Staffology\Model\PayLine[]|null $excludedRegularPayLines These used to store the PayLines that have been excluded from RegularPaylines. + * + * @return $this + */ + public function setExcludedRegularPayLines(?array $excludedRegularPayLines): static + { + if (is_null($excludedRegularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'excludedRegularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('excludedRegularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['excludedRegularPayLines'] = $excludedRegularPayLines; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployeeSortBy.php b/src/Model/EmployeeSortBy.php new file mode 100644 index 0000000..bb3c945 --- /dev/null +++ b/src/Model/EmployeeSortBy.php @@ -0,0 +1,49 @@ + + */ +class EmployeeYtdValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployeeYtdValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'values' => '\SynergiTech\Staffology\Model\YtdValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'firstName' => null, + 'lastName' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'firstName' => true, + 'lastName' => true, + 'values' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'values' => 'getValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets values + * + * @return \SynergiTech\Staffology\Model\YtdValue[]|null + */ + public function getValues(): ?array + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \SynergiTech\Staffology\Model\YtdValue[]|null $values values + * + * @return $this + */ + public function setValues(?array $values): static + { + if (is_null($values)) { + array_push($this->openAPINullablesSetToNull, 'values'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('values', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Employer.php b/src/Model/Employer.php new file mode 100644 index 0000000..d0e28f8 --- /dev/null +++ b/src/Model/Employer.php @@ -0,0 +1,2286 @@ + + */ +class Employer implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Employer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'crn' => 'string', + 'logoUrl' => 'string', + 'logoSasUrl' => 'string', + 'alternativeId' => 'string', + 'bankPaymentsCsvFormat' => '\SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat', + 'bacsServiceUserNumber' => 'string', + 'bacsBureauNumber' => 'string', + 'rejectInvalidBankDetails' => 'bool', + 'bankPaymentsReferenceFormat' => 'string', + 'bacsIncludeAEO' => 'bool', + 'bacsIncludeDeductions' => 'bool', + 'bacsIncludeHmrc' => 'bool', + 'bacsIncludePensions' => 'bool', + 'useTenantRtiSubmissionSettings' => 'bool', + 'address' => '\SynergiTech\Staffology\Model\Address', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'defaultPayOptions' => '\SynergiTech\Staffology\Model\PayOptions', + 'hmrcDetails' => '\SynergiTech\Staffology\Model\HmrcDetails', + 'defaultPension' => '\SynergiTech\Staffology\Model\PensionSelection', + 'rtiSubmissionSettings' => '\SynergiTech\Staffology\Model\RtiSubmissionSettings', + 'autoEnrolmentSettings' => '\SynergiTech\Staffology\Model\AutoEnrolmentSettings', + 'accruePayCodeSetUniqueId' => 'string', + 'leaveSettings' => '\SynergiTech\Staffology\Model\LeaveSettings', + 'settings' => '\SynergiTech\Staffology\Model\EmployerSettings', + 'umbrellaSettings' => '\SynergiTech\Staffology\Model\UmbrellaSettings', + 'employeeCount' => 'int', + 'subcontractorCount' => 'int', + 'startYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'currentYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'supportAccessEnabled' => 'bool', + 'archived' => 'bool', + 'canUseBureauFeatures' => 'bool', + 'multiRoleEnabled' => 'bool', + 'educationPayrollEnabled' => 'bool', + 'effectiveDateWorkingPatternsEnabled' => 'bool', + 'backPayEnabled' => 'bool', + 'isOptedInToEvc' => 'bool', + 'evcId' => 'string', + 'holidayAccrualBasis' => '\SynergiTech\Staffology\Model\HolidayAccrual', + 'holidayAccrualDefaultRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'mfaEnabled' => 'bool', + 'departmentJournalOverridesEnabled' => 'bool', + 'costCentreJournalOverridesEnabled' => 'bool', + 'settingsSortPayrollNumbersAlphanumerically' => 'bool', + 'unauthorisedLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'holidayLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'sickLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'parentalLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'bereavementLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'id' => 'string', + 'sourceSystemId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'crn' => null, + 'logoUrl' => null, + 'logoSasUrl' => null, + 'alternativeId' => null, + 'bankPaymentsCsvFormat' => null, + 'bacsServiceUserNumber' => null, + 'bacsBureauNumber' => null, + 'rejectInvalidBankDetails' => null, + 'bankPaymentsReferenceFormat' => null, + 'bacsIncludeAEO' => null, + 'bacsIncludeDeductions' => null, + 'bacsIncludeHmrc' => null, + 'bacsIncludePensions' => null, + 'useTenantRtiSubmissionSettings' => null, + 'address' => null, + 'bankDetails' => null, + 'defaultPayOptions' => null, + 'hmrcDetails' => null, + 'defaultPension' => null, + 'rtiSubmissionSettings' => null, + 'autoEnrolmentSettings' => null, + 'accruePayCodeSetUniqueId' => 'uuid', + 'leaveSettings' => null, + 'settings' => null, + 'umbrellaSettings' => null, + 'employeeCount' => 'int32', + 'subcontractorCount' => 'int32', + 'startYear' => null, + 'currentYear' => null, + 'supportAccessEnabled' => null, + 'archived' => null, + 'canUseBureauFeatures' => null, + 'multiRoleEnabled' => null, + 'educationPayrollEnabled' => null, + 'effectiveDateWorkingPatternsEnabled' => null, + 'backPayEnabled' => null, + 'isOptedInToEvc' => null, + 'evcId' => 'uuid', + 'holidayAccrualBasis' => null, + 'holidayAccrualDefaultRateType' => null, + 'mfaEnabled' => null, + 'departmentJournalOverridesEnabled' => null, + 'costCentreJournalOverridesEnabled' => null, + 'settingsSortPayrollNumbersAlphanumerically' => null, + 'unauthorisedLeaveProRataRule' => null, + 'holidayLeaveProRataRule' => null, + 'sickLeaveProRataRule' => null, + 'parentalLeaveProRataRule' => null, + 'bereavementLeaveProRataRule' => null, + 'id' => 'uuid', + 'sourceSystemId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'crn' => true, + 'logoUrl' => true, + 'logoSasUrl' => true, + 'alternativeId' => true, + 'bankPaymentsCsvFormat' => false, + 'bacsServiceUserNumber' => true, + 'bacsBureauNumber' => true, + 'rejectInvalidBankDetails' => false, + 'bankPaymentsReferenceFormat' => true, + 'bacsIncludeAEO' => false, + 'bacsIncludeDeductions' => false, + 'bacsIncludeHmrc' => false, + 'bacsIncludePensions' => false, + 'useTenantRtiSubmissionSettings' => false, + 'address' => false, + 'bankDetails' => false, + 'defaultPayOptions' => false, + 'hmrcDetails' => false, + 'defaultPension' => false, + 'rtiSubmissionSettings' => false, + 'autoEnrolmentSettings' => false, + 'accruePayCodeSetUniqueId' => true, + 'leaveSettings' => false, + 'settings' => false, + 'umbrellaSettings' => false, + 'employeeCount' => false, + 'subcontractorCount' => false, + 'startYear' => false, + 'currentYear' => false, + 'supportAccessEnabled' => false, + 'archived' => false, + 'canUseBureauFeatures' => false, + 'multiRoleEnabled' => false, + 'educationPayrollEnabled' => false, + 'effectiveDateWorkingPatternsEnabled' => false, + 'backPayEnabled' => false, + 'isOptedInToEvc' => false, + 'evcId' => true, + 'holidayAccrualBasis' => false, + 'holidayAccrualDefaultRateType' => false, + 'mfaEnabled' => false, + 'departmentJournalOverridesEnabled' => false, + 'costCentreJournalOverridesEnabled' => false, + 'settingsSortPayrollNumbersAlphanumerically' => false, + 'unauthorisedLeaveProRataRule' => false, + 'holidayLeaveProRataRule' => false, + 'sickLeaveProRataRule' => false, + 'parentalLeaveProRataRule' => false, + 'bereavementLeaveProRataRule' => false, + 'id' => false, + 'sourceSystemId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'crn' => 'crn', + 'logoUrl' => 'logoUrl', + 'logoSasUrl' => 'logoSasUrl', + 'alternativeId' => 'alternativeId', + 'bankPaymentsCsvFormat' => 'bankPaymentsCsvFormat', + 'bacsServiceUserNumber' => 'bacsServiceUserNumber', + 'bacsBureauNumber' => 'bacsBureauNumber', + 'rejectInvalidBankDetails' => 'rejectInvalidBankDetails', + 'bankPaymentsReferenceFormat' => 'bankPaymentsReferenceFormat', + 'bacsIncludeAEO' => 'bacsIncludeAEO', + 'bacsIncludeDeductions' => 'bacsIncludeDeductions', + 'bacsIncludeHmrc' => 'bacsIncludeHmrc', + 'bacsIncludePensions' => 'bacsIncludePensions', + 'useTenantRtiSubmissionSettings' => 'useTenantRtiSubmissionSettings', + 'address' => 'address', + 'bankDetails' => 'bankDetails', + 'defaultPayOptions' => 'defaultPayOptions', + 'hmrcDetails' => 'hmrcDetails', + 'defaultPension' => 'defaultPension', + 'rtiSubmissionSettings' => 'rtiSubmissionSettings', + 'autoEnrolmentSettings' => 'autoEnrolmentSettings', + 'accruePayCodeSetUniqueId' => 'accruePayCodeSetUniqueId', + 'leaveSettings' => 'leaveSettings', + 'settings' => 'settings', + 'umbrellaSettings' => 'umbrellaSettings', + 'employeeCount' => 'employeeCount', + 'subcontractorCount' => 'subcontractorCount', + 'startYear' => 'startYear', + 'currentYear' => 'currentYear', + 'supportAccessEnabled' => 'supportAccessEnabled', + 'archived' => 'archived', + 'canUseBureauFeatures' => 'canUseBureauFeatures', + 'multiRoleEnabled' => 'multiRoleEnabled', + 'educationPayrollEnabled' => 'educationPayrollEnabled', + 'effectiveDateWorkingPatternsEnabled' => 'effectiveDateWorkingPatternsEnabled', + 'backPayEnabled' => 'backPayEnabled', + 'isOptedInToEvc' => 'isOptedInToEvc', + 'evcId' => 'evcId', + 'holidayAccrualBasis' => 'holidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'holidayAccrualDefaultRateType', + 'mfaEnabled' => 'mfaEnabled', + 'departmentJournalOverridesEnabled' => 'departmentJournalOverridesEnabled', + 'costCentreJournalOverridesEnabled' => 'costCentreJournalOverridesEnabled', + 'settingsSortPayrollNumbersAlphanumerically' => 'settingsSortPayrollNumbersAlphanumerically', + 'unauthorisedLeaveProRataRule' => 'unauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'holidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'sickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'parentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'bereavementLeaveProRataRule', + 'id' => 'id', + 'sourceSystemId' => 'sourceSystemId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'crn' => 'setCrn', + 'logoUrl' => 'setLogoUrl', + 'logoSasUrl' => 'setLogoSasUrl', + 'alternativeId' => 'setAlternativeId', + 'bankPaymentsCsvFormat' => 'setBankPaymentsCsvFormat', + 'bacsServiceUserNumber' => 'setBacsServiceUserNumber', + 'bacsBureauNumber' => 'setBacsBureauNumber', + 'rejectInvalidBankDetails' => 'setRejectInvalidBankDetails', + 'bankPaymentsReferenceFormat' => 'setBankPaymentsReferenceFormat', + 'bacsIncludeAEO' => 'setBacsIncludeAEO', + 'bacsIncludeDeductions' => 'setBacsIncludeDeductions', + 'bacsIncludeHmrc' => 'setBacsIncludeHmrc', + 'bacsIncludePensions' => 'setBacsIncludePensions', + 'useTenantRtiSubmissionSettings' => 'setUseTenantRtiSubmissionSettings', + 'address' => 'setAddress', + 'bankDetails' => 'setBankDetails', + 'defaultPayOptions' => 'setDefaultPayOptions', + 'hmrcDetails' => 'setHmrcDetails', + 'defaultPension' => 'setDefaultPension', + 'rtiSubmissionSettings' => 'setRtiSubmissionSettings', + 'autoEnrolmentSettings' => 'setAutoEnrolmentSettings', + 'accruePayCodeSetUniqueId' => 'setAccruePayCodeSetUniqueId', + 'leaveSettings' => 'setLeaveSettings', + 'settings' => 'setSettings', + 'umbrellaSettings' => 'setUmbrellaSettings', + 'employeeCount' => 'setEmployeeCount', + 'subcontractorCount' => 'setSubcontractorCount', + 'startYear' => 'setStartYear', + 'currentYear' => 'setCurrentYear', + 'supportAccessEnabled' => 'setSupportAccessEnabled', + 'archived' => 'setArchived', + 'canUseBureauFeatures' => 'setCanUseBureauFeatures', + 'multiRoleEnabled' => 'setMultiRoleEnabled', + 'educationPayrollEnabled' => 'setEducationPayrollEnabled', + 'effectiveDateWorkingPatternsEnabled' => 'setEffectiveDateWorkingPatternsEnabled', + 'backPayEnabled' => 'setBackPayEnabled', + 'isOptedInToEvc' => 'setIsOptedInToEvc', + 'evcId' => 'setEvcId', + 'holidayAccrualBasis' => 'setHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'setHolidayAccrualDefaultRateType', + 'mfaEnabled' => 'setMfaEnabled', + 'departmentJournalOverridesEnabled' => 'setDepartmentJournalOverridesEnabled', + 'costCentreJournalOverridesEnabled' => 'setCostCentreJournalOverridesEnabled', + 'settingsSortPayrollNumbersAlphanumerically' => 'setSettingsSortPayrollNumbersAlphanumerically', + 'unauthorisedLeaveProRataRule' => 'setUnauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'setHolidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'setSickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'setParentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'setBereavementLeaveProRataRule', + 'id' => 'setId', + 'sourceSystemId' => 'setSourceSystemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'crn' => 'getCrn', + 'logoUrl' => 'getLogoUrl', + 'logoSasUrl' => 'getLogoSasUrl', + 'alternativeId' => 'getAlternativeId', + 'bankPaymentsCsvFormat' => 'getBankPaymentsCsvFormat', + 'bacsServiceUserNumber' => 'getBacsServiceUserNumber', + 'bacsBureauNumber' => 'getBacsBureauNumber', + 'rejectInvalidBankDetails' => 'getRejectInvalidBankDetails', + 'bankPaymentsReferenceFormat' => 'getBankPaymentsReferenceFormat', + 'bacsIncludeAEO' => 'getBacsIncludeAEO', + 'bacsIncludeDeductions' => 'getBacsIncludeDeductions', + 'bacsIncludeHmrc' => 'getBacsIncludeHmrc', + 'bacsIncludePensions' => 'getBacsIncludePensions', + 'useTenantRtiSubmissionSettings' => 'getUseTenantRtiSubmissionSettings', + 'address' => 'getAddress', + 'bankDetails' => 'getBankDetails', + 'defaultPayOptions' => 'getDefaultPayOptions', + 'hmrcDetails' => 'getHmrcDetails', + 'defaultPension' => 'getDefaultPension', + 'rtiSubmissionSettings' => 'getRtiSubmissionSettings', + 'autoEnrolmentSettings' => 'getAutoEnrolmentSettings', + 'accruePayCodeSetUniqueId' => 'getAccruePayCodeSetUniqueId', + 'leaveSettings' => 'getLeaveSettings', + 'settings' => 'getSettings', + 'umbrellaSettings' => 'getUmbrellaSettings', + 'employeeCount' => 'getEmployeeCount', + 'subcontractorCount' => 'getSubcontractorCount', + 'startYear' => 'getStartYear', + 'currentYear' => 'getCurrentYear', + 'supportAccessEnabled' => 'getSupportAccessEnabled', + 'archived' => 'getArchived', + 'canUseBureauFeatures' => 'getCanUseBureauFeatures', + 'multiRoleEnabled' => 'getMultiRoleEnabled', + 'educationPayrollEnabled' => 'getEducationPayrollEnabled', + 'effectiveDateWorkingPatternsEnabled' => 'getEffectiveDateWorkingPatternsEnabled', + 'backPayEnabled' => 'getBackPayEnabled', + 'isOptedInToEvc' => 'getIsOptedInToEvc', + 'evcId' => 'getEvcId', + 'holidayAccrualBasis' => 'getHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'getHolidayAccrualDefaultRateType', + 'mfaEnabled' => 'getMfaEnabled', + 'departmentJournalOverridesEnabled' => 'getDepartmentJournalOverridesEnabled', + 'costCentreJournalOverridesEnabled' => 'getCostCentreJournalOverridesEnabled', + 'settingsSortPayrollNumbersAlphanumerically' => 'getSettingsSortPayrollNumbersAlphanumerically', + 'unauthorisedLeaveProRataRule' => 'getUnauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'getHolidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'getSickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'getParentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'getBereavementLeaveProRataRule', + 'id' => 'getId', + 'sourceSystemId' => 'getSourceSystemId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('crn', $data ?? [], null); + $this->setIfExists('logoUrl', $data ?? [], null); + $this->setIfExists('logoSasUrl', $data ?? [], null); + $this->setIfExists('alternativeId', $data ?? [], null); + $this->setIfExists('bankPaymentsCsvFormat', $data ?? [], null); + $this->setIfExists('bacsServiceUserNumber', $data ?? [], null); + $this->setIfExists('bacsBureauNumber', $data ?? [], null); + $this->setIfExists('rejectInvalidBankDetails', $data ?? [], null); + $this->setIfExists('bankPaymentsReferenceFormat', $data ?? [], null); + $this->setIfExists('bacsIncludeAEO', $data ?? [], null); + $this->setIfExists('bacsIncludeDeductions', $data ?? [], null); + $this->setIfExists('bacsIncludeHmrc', $data ?? [], null); + $this->setIfExists('bacsIncludePensions', $data ?? [], null); + $this->setIfExists('useTenantRtiSubmissionSettings', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('defaultPayOptions', $data ?? [], null); + $this->setIfExists('hmrcDetails', $data ?? [], null); + $this->setIfExists('defaultPension', $data ?? [], null); + $this->setIfExists('rtiSubmissionSettings', $data ?? [], null); + $this->setIfExists('autoEnrolmentSettings', $data ?? [], null); + $this->setIfExists('accruePayCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + $this->setIfExists('umbrellaSettings', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('subcontractorCount', $data ?? [], null); + $this->setIfExists('startYear', $data ?? [], null); + $this->setIfExists('currentYear', $data ?? [], null); + $this->setIfExists('supportAccessEnabled', $data ?? [], null); + $this->setIfExists('archived', $data ?? [], null); + $this->setIfExists('canUseBureauFeatures', $data ?? [], null); + $this->setIfExists('multiRoleEnabled', $data ?? [], null); + $this->setIfExists('educationPayrollEnabled', $data ?? [], null); + $this->setIfExists('effectiveDateWorkingPatternsEnabled', $data ?? [], null); + $this->setIfExists('backPayEnabled', $data ?? [], null); + $this->setIfExists('isOptedInToEvc', $data ?? [], null); + $this->setIfExists('evcId', $data ?? [], null); + $this->setIfExists('holidayAccrualBasis', $data ?? [], null); + $this->setIfExists('holidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('mfaEnabled', $data ?? [], null); + $this->setIfExists('departmentJournalOverridesEnabled', $data ?? [], null); + $this->setIfExists('costCentreJournalOverridesEnabled', $data ?? [], null); + $this->setIfExists('settingsSortPayrollNumbersAlphanumerically', $data ?? [], null); + $this->setIfExists('unauthorisedLeaveProRataRule', $data ?? [], null); + $this->setIfExists('holidayLeaveProRataRule', $data ?? [], null); + $this->setIfExists('sickLeaveProRataRule', $data ?? [], null); + $this->setIfExists('parentalLeaveProRataRule', $data ?? [], null); + $this->setIfExists('bereavementLeaveProRataRule', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('sourceSystemId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 200)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 200."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['crn']) && (mb_strlen($this->container['crn']) > 25)) { + $invalidProperties[] = "invalid value for 'crn', the character length must be smaller than or equal to 25."; + } + + if (!is_null($this->container['logoUrl']) && (mb_strlen($this->container['logoUrl']) > 200)) { + $invalidProperties[] = "invalid value for 'logoUrl', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['alternativeId']) && (mb_strlen($this->container['alternativeId']) > 30)) { + $invalidProperties[] = "invalid value for 'alternativeId', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['bacsServiceUserNumber']) && (mb_strlen($this->container['bacsServiceUserNumber']) > 6)) { + $invalidProperties[] = "invalid value for 'bacsServiceUserNumber', the character length must be smaller than or equal to 6."; + } + + if (!is_null($this->container['bacsBureauNumber']) && (mb_strlen($this->container['bacsBureauNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'bacsBureauNumber', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['bankPaymentsReferenceFormat']) && (mb_strlen($this->container['bankPaymentsReferenceFormat']) > 120)) { + $invalidProperties[] = "invalid value for 'bankPaymentsReferenceFormat', the character length must be smaller than or equal to 120."; + } + + if (!is_null($this->container['sourceSystemId']) && (mb_strlen($this->container['sourceSystemId']) > 50)) { + $invalidProperties[] = "invalid value for 'sourceSystemId', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 200)) { + throw new InvalidArgumentException('invalid length for $name when calling Employer., must be smaller than or equal to 200.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling Employer., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets crn + * + * @return string|null + */ + public function getCrn(): ?string + { + return $this->container['crn']; + } + + /** + * Sets crn + * + * @param string|null $crn Company Registration Number + * + * @return $this + */ + public function setCrn(?string $crn): static + { + if (is_null($crn)) { + array_push($this->openAPINullablesSetToNull, 'crn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('crn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($crn) && (mb_strlen($crn) > 25)) { + throw new InvalidArgumentException('invalid length for $crn when calling Employer., must be smaller than or equal to 25.'); + } + + $this->container['crn'] = $crn; + + return $this; + } + + /** + * Gets logoUrl + * + * @return string|null + */ + public function getLogoUrl(): ?string + { + return $this->container['logoUrl']; + } + + /** + * Sets logoUrl + * + * @param string|null $logoUrl logoUrl + * + * @return $this + */ + public function setLogoUrl(?string $logoUrl): static + { + if (is_null($logoUrl)) { + array_push($this->openAPINullablesSetToNull, 'logoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($logoUrl) && (mb_strlen($logoUrl) > 200)) { + throw new InvalidArgumentException('invalid length for $logoUrl when calling Employer., must be smaller than or equal to 200.'); + } + + $this->container['logoUrl'] = $logoUrl; + + return $this; + } + + /** + * Gets logoSasUrl + * + * @return string|null + */ + public function getLogoSasUrl(): ?string + { + return $this->container['logoSasUrl']; + } + + /** + * Sets logoSasUrl + * + * @param string|null $logoSasUrl logoSasUrl + * + * @return $this + */ + public function setLogoSasUrl(?string $logoSasUrl): static + { + if (is_null($logoSasUrl)) { + array_push($this->openAPINullablesSetToNull, 'logoSasUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logoSasUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['logoSasUrl'] = $logoSasUrl; + + return $this; + } + + /** + * Gets alternativeId + * + * @return string|null + */ + public function getAlternativeId(): ?string + { + return $this->container['alternativeId']; + } + + /** + * Sets alternativeId + * + * @param string|null $alternativeId alternativeId + * + * @return $this + */ + public function setAlternativeId(?string $alternativeId): static + { + if (is_null($alternativeId)) { + array_push($this->openAPINullablesSetToNull, 'alternativeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('alternativeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($alternativeId) && (mb_strlen($alternativeId) > 30)) { + throw new InvalidArgumentException('invalid length for $alternativeId when calling Employer., must be smaller than or equal to 30.'); + } + + $this->container['alternativeId'] = $alternativeId; + + return $this; + } + + /** + * Gets bankPaymentsCsvFormat + * + * @return \SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat|null + */ + public function getBankPaymentsCsvFormat(): ?\SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat + { + return $this->container['bankPaymentsCsvFormat']; + } + + /** + * Sets bankPaymentsCsvFormat + * + * @param \SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat|null $bankPaymentsCsvFormat bankPaymentsCsvFormat + * + * @return $this + */ + public function setBankPaymentsCsvFormat(?\SynergiTech\Staffology\Model\BankPaymentInstructionsCsvFormat $bankPaymentsCsvFormat): static + { + if (is_null($bankPaymentsCsvFormat)) { + throw new InvalidArgumentException('non-nullable bankPaymentsCsvFormat cannot be null'); + } + $this->container['bankPaymentsCsvFormat'] = $bankPaymentsCsvFormat; + + return $this; + } + + /** + * Gets bacsServiceUserNumber + * + * @return string|null + */ + public function getBacsServiceUserNumber(): ?string + { + return $this->container['bacsServiceUserNumber']; + } + + /** + * Sets bacsServiceUserNumber + * + * @param string|null $bacsServiceUserNumber bacsServiceUserNumber + * + * @return $this + */ + public function setBacsServiceUserNumber(?string $bacsServiceUserNumber): static + { + if (is_null($bacsServiceUserNumber)) { + array_push($this->openAPINullablesSetToNull, 'bacsServiceUserNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsServiceUserNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bacsServiceUserNumber) && (mb_strlen($bacsServiceUserNumber) > 6)) { + throw new InvalidArgumentException('invalid length for $bacsServiceUserNumber when calling Employer., must be smaller than or equal to 6.'); + } + + $this->container['bacsServiceUserNumber'] = $bacsServiceUserNumber; + + return $this; + } + + /** + * Gets bacsBureauNumber + * + * @return string|null + */ + public function getBacsBureauNumber(): ?string + { + return $this->container['bacsBureauNumber']; + } + + /** + * Sets bacsBureauNumber + * + * @param string|null $bacsBureauNumber bacsBureauNumber + * + * @return $this + */ + public function setBacsBureauNumber(?string $bacsBureauNumber): static + { + if (is_null($bacsBureauNumber)) { + array_push($this->openAPINullablesSetToNull, 'bacsBureauNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsBureauNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bacsBureauNumber) && (mb_strlen($bacsBureauNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $bacsBureauNumber when calling Employer., must be smaller than or equal to 20.'); + } + + $this->container['bacsBureauNumber'] = $bacsBureauNumber; + + return $this; + } + + /** + * Gets rejectInvalidBankDetails + * + * @return bool|null + */ + public function getRejectInvalidBankDetails(): ?bool + { + return $this->container['rejectInvalidBankDetails']; + } + + /** + * Sets rejectInvalidBankDetails + * + * @param bool|null $rejectInvalidBankDetails rejectInvalidBankDetails + * + * @return $this + */ + public function setRejectInvalidBankDetails(?bool $rejectInvalidBankDetails): static + { + if (is_null($rejectInvalidBankDetails)) { + throw new InvalidArgumentException('non-nullable rejectInvalidBankDetails cannot be null'); + } + $this->container['rejectInvalidBankDetails'] = $rejectInvalidBankDetails; + + return $this; + } + + /** + * Gets bankPaymentsReferenceFormat + * + * @return string|null + */ + public function getBankPaymentsReferenceFormat(): ?string + { + return $this->container['bankPaymentsReferenceFormat']; + } + + /** + * Sets bankPaymentsReferenceFormat + * + * @param string|null $bankPaymentsReferenceFormat bankPaymentsReferenceFormat + * + * @return $this + */ + public function setBankPaymentsReferenceFormat(?string $bankPaymentsReferenceFormat): static + { + if (is_null($bankPaymentsReferenceFormat)) { + array_push($this->openAPINullablesSetToNull, 'bankPaymentsReferenceFormat'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankPaymentsReferenceFormat', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bankPaymentsReferenceFormat) && (mb_strlen($bankPaymentsReferenceFormat) > 120)) { + throw new InvalidArgumentException('invalid length for $bankPaymentsReferenceFormat when calling Employer., must be smaller than or equal to 120.'); + } + + $this->container['bankPaymentsReferenceFormat'] = $bankPaymentsReferenceFormat; + + return $this; + } + + /** + * Gets bacsIncludeAEO + * + * @return bool|null + */ + public function getBacsIncludeAEO(): ?bool + { + return $this->container['bacsIncludeAEO']; + } + + /** + * Sets bacsIncludeAEO + * + * @param bool|null $bacsIncludeAEO bacsIncludeAEO + * + * @return $this + */ + public function setBacsIncludeAEO(?bool $bacsIncludeAEO): static + { + if (is_null($bacsIncludeAEO)) { + throw new InvalidArgumentException('non-nullable bacsIncludeAEO cannot be null'); + } + $this->container['bacsIncludeAEO'] = $bacsIncludeAEO; + + return $this; + } + + /** + * Gets bacsIncludeDeductions + * + * @return bool|null + */ + public function getBacsIncludeDeductions(): ?bool + { + return $this->container['bacsIncludeDeductions']; + } + + /** + * Sets bacsIncludeDeductions + * + * @param bool|null $bacsIncludeDeductions bacsIncludeDeductions + * + * @return $this + */ + public function setBacsIncludeDeductions(?bool $bacsIncludeDeductions): static + { + if (is_null($bacsIncludeDeductions)) { + throw new InvalidArgumentException('non-nullable bacsIncludeDeductions cannot be null'); + } + $this->container['bacsIncludeDeductions'] = $bacsIncludeDeductions; + + return $this; + } + + /** + * Gets bacsIncludeHmrc + * + * @return bool|null + */ + public function getBacsIncludeHmrc(): ?bool + { + return $this->container['bacsIncludeHmrc']; + } + + /** + * Sets bacsIncludeHmrc + * + * @param bool|null $bacsIncludeHmrc bacsIncludeHmrc + * + * @return $this + */ + public function setBacsIncludeHmrc(?bool $bacsIncludeHmrc): static + { + if (is_null($bacsIncludeHmrc)) { + throw new InvalidArgumentException('non-nullable bacsIncludeHmrc cannot be null'); + } + $this->container['bacsIncludeHmrc'] = $bacsIncludeHmrc; + + return $this; + } + + /** + * Gets bacsIncludePensions + * + * @return bool|null + */ + public function getBacsIncludePensions(): ?bool + { + return $this->container['bacsIncludePensions']; + } + + /** + * Sets bacsIncludePensions + * + * @param bool|null $bacsIncludePensions bacsIncludePensions + * + * @return $this + */ + public function setBacsIncludePensions(?bool $bacsIncludePensions): static + { + if (is_null($bacsIncludePensions)) { + throw new InvalidArgumentException('non-nullable bacsIncludePensions cannot be null'); + } + $this->container['bacsIncludePensions'] = $bacsIncludePensions; + + return $this; + } + + /** + * Gets useTenantRtiSubmissionSettings + * + * @return bool|null + */ + public function getUseTenantRtiSubmissionSettings(): ?bool + { + return $this->container['useTenantRtiSubmissionSettings']; + } + + /** + * Sets useTenantRtiSubmissionSettings + * + * @param bool|null $useTenantRtiSubmissionSettings If the Tenant for this employer has Bureau Features enabled then they can set RtiSubmissionSettings to be used across multiple employers. If this is set to true then those settings will be used instead of any set at the Employer level + * + * @return $this + */ + public function setUseTenantRtiSubmissionSettings(?bool $useTenantRtiSubmissionSettings): static + { + if (is_null($useTenantRtiSubmissionSettings)) { + throw new InvalidArgumentException('non-nullable useTenantRtiSubmissionSettings cannot be null'); + } + $this->container['useTenantRtiSubmissionSettings'] = $useTenantRtiSubmissionSettings; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets defaultPayOptions + * + * @return \SynergiTech\Staffology\Model\PayOptions|null + */ + public function getDefaultPayOptions(): ?\SynergiTech\Staffology\Model\PayOptions + { + return $this->container['defaultPayOptions']; + } + + /** + * Sets defaultPayOptions + * + * @param \SynergiTech\Staffology\Model\PayOptions|null $defaultPayOptions defaultPayOptions + * + * @return $this + */ + public function setDefaultPayOptions(?\SynergiTech\Staffology\Model\PayOptions $defaultPayOptions): static + { + if (is_null($defaultPayOptions)) { + throw new InvalidArgumentException('non-nullable defaultPayOptions cannot be null'); + } + $this->container['defaultPayOptions'] = $defaultPayOptions; + + return $this; + } + + /** + * Gets hmrcDetails + * + * @return \SynergiTech\Staffology\Model\HmrcDetails|null + */ + public function getHmrcDetails(): ?\SynergiTech\Staffology\Model\HmrcDetails + { + return $this->container['hmrcDetails']; + } + + /** + * Sets hmrcDetails + * + * @param \SynergiTech\Staffology\Model\HmrcDetails|null $hmrcDetails hmrcDetails + * + * @return $this + */ + public function setHmrcDetails(?\SynergiTech\Staffology\Model\HmrcDetails $hmrcDetails): static + { + if (is_null($hmrcDetails)) { + throw new InvalidArgumentException('non-nullable hmrcDetails cannot be null'); + } + $this->container['hmrcDetails'] = $hmrcDetails; + + return $this; + } + + /** + * Gets defaultPension + * + * @return \SynergiTech\Staffology\Model\PensionSelection|null + */ + public function getDefaultPension(): ?\SynergiTech\Staffology\Model\PensionSelection + { + return $this->container['defaultPension']; + } + + /** + * Sets defaultPension + * + * @param \SynergiTech\Staffology\Model\PensionSelection|null $defaultPension defaultPension + * + * @return $this + */ + public function setDefaultPension(?\SynergiTech\Staffology\Model\PensionSelection $defaultPension): static + { + if (is_null($defaultPension)) { + throw new InvalidArgumentException('non-nullable defaultPension cannot be null'); + } + $this->container['defaultPension'] = $defaultPension; + + return $this; + } + + /** + * Gets rtiSubmissionSettings + * + * @return \SynergiTech\Staffology\Model\RtiSubmissionSettings|null + */ + public function getRtiSubmissionSettings(): ?\SynergiTech\Staffology\Model\RtiSubmissionSettings + { + return $this->container['rtiSubmissionSettings']; + } + + /** + * Sets rtiSubmissionSettings + * + * @param \SynergiTech\Staffology\Model\RtiSubmissionSettings|null $rtiSubmissionSettings rtiSubmissionSettings + * + * @return $this + */ + public function setRtiSubmissionSettings(?\SynergiTech\Staffology\Model\RtiSubmissionSettings $rtiSubmissionSettings): static + { + if (is_null($rtiSubmissionSettings)) { + throw new InvalidArgumentException('non-nullable rtiSubmissionSettings cannot be null'); + } + $this->container['rtiSubmissionSettings'] = $rtiSubmissionSettings; + + return $this; + } + + /** + * Gets autoEnrolmentSettings + * + * @return \SynergiTech\Staffology\Model\AutoEnrolmentSettings|null + */ + public function getAutoEnrolmentSettings(): ?\SynergiTech\Staffology\Model\AutoEnrolmentSettings + { + return $this->container['autoEnrolmentSettings']; + } + + /** + * Sets autoEnrolmentSettings + * + * @param \SynergiTech\Staffology\Model\AutoEnrolmentSettings|null $autoEnrolmentSettings autoEnrolmentSettings + * + * @return $this + */ + public function setAutoEnrolmentSettings(?\SynergiTech\Staffology\Model\AutoEnrolmentSettings $autoEnrolmentSettings): static + { + if (is_null($autoEnrolmentSettings)) { + throw new InvalidArgumentException('non-nullable autoEnrolmentSettings cannot be null'); + } + $this->container['autoEnrolmentSettings'] = $autoEnrolmentSettings; + + return $this; + } + + /** + * Gets accruePayCodeSetUniqueId + * + * @return string|null + */ + public function getAccruePayCodeSetUniqueId(): ?string + { + return $this->container['accruePayCodeSetUniqueId']; + } + + /** + * Sets accruePayCodeSetUniqueId + * + * @param string|null $accruePayCodeSetUniqueId accruePayCodeSetUniqueId + * + * @return $this + */ + public function setAccruePayCodeSetUniqueId(?string $accruePayCodeSetUniqueId): static + { + if (is_null($accruePayCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'accruePayCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accruePayCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accruePayCodeSetUniqueId'] = $accruePayCodeSetUniqueId; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\LeaveSettings|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\LeaveSettings + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\LeaveSettings|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\LeaveSettings $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + + /** + * Gets settings + * + * @return \SynergiTech\Staffology\Model\EmployerSettings|null + */ + public function getSettings(): ?\SynergiTech\Staffology\Model\EmployerSettings + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \SynergiTech\Staffology\Model\EmployerSettings|null $settings settings + * + * @return $this + */ + public function setSettings(?\SynergiTech\Staffology\Model\EmployerSettings $settings): static + { + if (is_null($settings)) { + throw new InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + + /** + * Gets umbrellaSettings + * + * @return \SynergiTech\Staffology\Model\UmbrellaSettings|null + */ + public function getUmbrellaSettings(): ?\SynergiTech\Staffology\Model\UmbrellaSettings + { + return $this->container['umbrellaSettings']; + } + + /** + * Sets umbrellaSettings + * + * @param \SynergiTech\Staffology\Model\UmbrellaSettings|null $umbrellaSettings umbrellaSettings + * + * @return $this + */ + public function setUmbrellaSettings(?\SynergiTech\Staffology\Model\UmbrellaSettings $umbrellaSettings): static + { + if (is_null($umbrellaSettings)) { + throw new InvalidArgumentException('non-nullable umbrellaSettings cannot be null'); + } + $this->container['umbrellaSettings'] = $umbrellaSettings; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of Employees this Employer has, including CIS Subcontractors. + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets subcontractorCount + * + * @return int|null + */ + public function getSubcontractorCount(): ?int + { + return $this->container['subcontractorCount']; + } + + /** + * Sets subcontractorCount + * + * @param int|null $subcontractorCount [readonly] The number of CIS Subcontractors this Employer has. + * + * @return $this + */ + public function setSubcontractorCount(?int $subcontractorCount): static + { + if (is_null($subcontractorCount)) { + throw new InvalidArgumentException('non-nullable subcontractorCount cannot be null'); + } + $this->container['subcontractorCount'] = $subcontractorCount; + + return $this; + } + + /** + * Gets startYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getStartYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['startYear']; + } + + /** + * Sets startYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $startYear startYear + * + * @return $this + */ + public function setStartYear(?\SynergiTech\Staffology\Model\TaxYear $startYear): static + { + if (is_null($startYear)) { + throw new InvalidArgumentException('non-nullable startYear cannot be null'); + } + $this->container['startYear'] = $startYear; + + return $this; + } + + /** + * Gets currentYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getCurrentYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['currentYear']; + } + + /** + * Sets currentYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $currentYear currentYear + * + * @return $this + */ + public function setCurrentYear(?\SynergiTech\Staffology\Model\TaxYear $currentYear): static + { + if (is_null($currentYear)) { + throw new InvalidArgumentException('non-nullable currentYear cannot be null'); + } + $this->container['currentYear'] = $currentYear; + + return $this; + } + + /** + * Gets supportAccessEnabled + * + * @return bool|null + */ + public function getSupportAccessEnabled(): ?bool + { + return $this->container['supportAccessEnabled']; + } + + /** + * Sets supportAccessEnabled + * + * @param bool|null $supportAccessEnabled If set to true then the support team can access this employer to help resolve support queries + * + * @return $this + */ + public function setSupportAccessEnabled(?bool $supportAccessEnabled): static + { + if (is_null($supportAccessEnabled)) { + throw new InvalidArgumentException('non-nullable supportAccessEnabled cannot be null'); + } + $this->container['supportAccessEnabled'] = $supportAccessEnabled; + + return $this; + } + + /** + * Gets archived + * + * @return bool|null + */ + public function getArchived(): ?bool + { + return $this->container['archived']; + } + + /** + * Sets archived + * + * @param bool|null $archived A flag to indicate whather or not the employer is Archived, ie no longer actively used + * + * @return $this + */ + public function setArchived(?bool $archived): static + { + if (is_null($archived)) { + throw new InvalidArgumentException('non-nullable archived cannot be null'); + } + $this->container['archived'] = $archived; + + return $this; + } + + /** + * Gets canUseBureauFeatures + * + * @return bool|null + */ + public function getCanUseBureauFeatures(): ?bool + { + return $this->container['canUseBureauFeatures']; + } + + /** + * Sets canUseBureauFeatures + * + * @param bool|null $canUseBureauFeatures canUseBureauFeatures + * + * @return $this + */ + public function setCanUseBureauFeatures(?bool $canUseBureauFeatures): static + { + if (is_null($canUseBureauFeatures)) { + throw new InvalidArgumentException('non-nullable canUseBureauFeatures cannot be null'); + } + $this->container['canUseBureauFeatures'] = $canUseBureauFeatures; + + return $this; + } + + /** + * Gets multiRoleEnabled + * + * @return bool|null + */ + public function getMultiRoleEnabled(): ?bool + { + return $this->container['multiRoleEnabled']; + } + + /** + * Sets multiRoleEnabled + * + * @param bool|null $multiRoleEnabled multiRoleEnabled + * + * @return $this + */ + public function setMultiRoleEnabled(?bool $multiRoleEnabled): static + { + if (is_null($multiRoleEnabled)) { + throw new InvalidArgumentException('non-nullable multiRoleEnabled cannot be null'); + } + $this->container['multiRoleEnabled'] = $multiRoleEnabled; + + return $this; + } + + /** + * Gets educationPayrollEnabled + * + * @return bool|null + */ + public function getEducationPayrollEnabled(): ?bool + { + return $this->container['educationPayrollEnabled']; + } + + /** + * Sets educationPayrollEnabled + * + * @param bool|null $educationPayrollEnabled educationPayrollEnabled + * + * @return $this + */ + public function setEducationPayrollEnabled(?bool $educationPayrollEnabled): static + { + if (is_null($educationPayrollEnabled)) { + throw new InvalidArgumentException('non-nullable educationPayrollEnabled cannot be null'); + } + $this->container['educationPayrollEnabled'] = $educationPayrollEnabled; + + return $this; + } + + /** + * Gets effectiveDateWorkingPatternsEnabled + * + * @return bool|null + */ + public function getEffectiveDateWorkingPatternsEnabled(): ?bool + { + return $this->container['effectiveDateWorkingPatternsEnabled']; + } + + /** + * Sets effectiveDateWorkingPatternsEnabled + * + * @param bool|null $effectiveDateWorkingPatternsEnabled effectiveDateWorkingPatternsEnabled + * + * @return $this + */ + public function setEffectiveDateWorkingPatternsEnabled(?bool $effectiveDateWorkingPatternsEnabled): static + { + if (is_null($effectiveDateWorkingPatternsEnabled)) { + throw new InvalidArgumentException('non-nullable effectiveDateWorkingPatternsEnabled cannot be null'); + } + $this->container['effectiveDateWorkingPatternsEnabled'] = $effectiveDateWorkingPatternsEnabled; + + return $this; + } + + /** + * Gets backPayEnabled + * + * @return bool|null + */ + public function getBackPayEnabled(): ?bool + { + return $this->container['backPayEnabled']; + } + + /** + * Sets backPayEnabled + * + * @param bool|null $backPayEnabled backPayEnabled + * + * @return $this + */ + public function setBackPayEnabled(?bool $backPayEnabled): static + { + if (is_null($backPayEnabled)) { + throw new InvalidArgumentException('non-nullable backPayEnabled cannot be null'); + } + $this->container['backPayEnabled'] = $backPayEnabled; + + return $this; + } + + /** + * Gets isOptedInToEvc + * + * @return bool|null + */ + public function getIsOptedInToEvc(): ?bool + { + return $this->container['isOptedInToEvc']; + } + + /** + * Sets isOptedInToEvc + * + * @param bool|null $isOptedInToEvc [readonly] Indicates whether or not the Employer is opted in to the Employee Verification Programme. Value can only be changed by its dedicated API end point. + * + * @return $this + */ + public function setIsOptedInToEvc(?bool $isOptedInToEvc): static + { + if (is_null($isOptedInToEvc)) { + throw new InvalidArgumentException('non-nullable isOptedInToEvc cannot be null'); + } + $this->container['isOptedInToEvc'] = $isOptedInToEvc; + + return $this; + } + + /** + * Gets evcId + * + * @return string|null + */ + public function getEvcId(): ?string + { + return $this->container['evcId']; + } + + /** + * Sets evcId + * + * @param string|null $evcId If set then this will be used as the Employer ID sent to EVC in place of the standard EmployerId. + * + * @return $this + */ + public function setEvcId(?string $evcId): static + { + if (is_null($evcId)) { + array_push($this->openAPINullablesSetToNull, 'evcId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('evcId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['evcId'] = $evcId; + + return $this; + } + + /** + * Gets holidayAccrualBasis + * + * @return \SynergiTech\Staffology\Model\HolidayAccrual|null + */ + public function getHolidayAccrualBasis(): ?\SynergiTech\Staffology\Model\HolidayAccrual + { + return $this->container['holidayAccrualBasis']; + } + + /** + * Sets holidayAccrualBasis + * + * @param \SynergiTech\Staffology\Model\HolidayAccrual|null $holidayAccrualBasis holidayAccrualBasis + * + * @return $this + */ + public function setHolidayAccrualBasis(?\SynergiTech\Staffology\Model\HolidayAccrual $holidayAccrualBasis): static + { + if (is_null($holidayAccrualBasis)) { + throw new InvalidArgumentException('non-nullable holidayAccrualBasis cannot be null'); + } + $this->container['holidayAccrualBasis'] = $holidayAccrualBasis; + + return $this; + } + + /** + * Gets holidayAccrualDefaultRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayAccrualDefaultRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayAccrualDefaultRateType']; + } + + /** + * Sets holidayAccrualDefaultRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayAccrualDefaultRateType holidayAccrualDefaultRateType + * + * @return $this + */ + public function setHolidayAccrualDefaultRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayAccrualDefaultRateType): static + { + if (is_null($holidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable holidayAccrualDefaultRateType cannot be null'); + } + $this->container['holidayAccrualDefaultRateType'] = $holidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets mfaEnabled + * + * @return bool|null + */ + public function getMfaEnabled(): ?bool + { + return $this->container['mfaEnabled']; + } + + /** + * Sets mfaEnabled + * + * @param bool|null $mfaEnabled if set to true requires all users to setup MFA support queries + * + * @return $this + */ + public function setMfaEnabled(?bool $mfaEnabled): static + { + if (is_null($mfaEnabled)) { + throw new InvalidArgumentException('non-nullable mfaEnabled cannot be null'); + } + $this->container['mfaEnabled'] = $mfaEnabled; + + return $this; + } + + /** + * Gets departmentJournalOverridesEnabled + * + * @return bool|null + */ + public function getDepartmentJournalOverridesEnabled(): ?bool + { + return $this->container['departmentJournalOverridesEnabled']; + } + + /** + * Sets departmentJournalOverridesEnabled + * + * @param bool|null $departmentJournalOverridesEnabled Enables the journal overrides for departments, if set to true. + * + * @return $this + */ + public function setDepartmentJournalOverridesEnabled(?bool $departmentJournalOverridesEnabled): static + { + if (is_null($departmentJournalOverridesEnabled)) { + throw new InvalidArgumentException('non-nullable departmentJournalOverridesEnabled cannot be null'); + } + $this->container['departmentJournalOverridesEnabled'] = $departmentJournalOverridesEnabled; + + return $this; + } + + /** + * Gets costCentreJournalOverridesEnabled + * + * @return bool|null + */ + public function getCostCentreJournalOverridesEnabled(): ?bool + { + return $this->container['costCentreJournalOverridesEnabled']; + } + + /** + * Sets costCentreJournalOverridesEnabled + * + * @param bool|null $costCentreJournalOverridesEnabled Enables the journal overrides for cost centre, if set to true. + * + * @return $this + */ + public function setCostCentreJournalOverridesEnabled(?bool $costCentreJournalOverridesEnabled): static + { + if (is_null($costCentreJournalOverridesEnabled)) { + throw new InvalidArgumentException('non-nullable costCentreJournalOverridesEnabled cannot be null'); + } + $this->container['costCentreJournalOverridesEnabled'] = $costCentreJournalOverridesEnabled; + + return $this; + } + + /** + * Gets settingsSortPayrollNumbersAlphanumerically + * + * @return bool|null + */ + public function getSettingsSortPayrollNumbersAlphanumerically(): ?bool + { + return $this->container['settingsSortPayrollNumbersAlphanumerically']; + } + + /** + * Sets settingsSortPayrollNumbersAlphanumerically + * + * @param bool|null $settingsSortPayrollNumbersAlphanumerically Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied + * + * @return $this + */ + public function setSettingsSortPayrollNumbersAlphanumerically(?bool $settingsSortPayrollNumbersAlphanumerically): static + { + if (is_null($settingsSortPayrollNumbersAlphanumerically)) { + throw new InvalidArgumentException('non-nullable settingsSortPayrollNumbersAlphanumerically cannot be null'); + } + $this->container['settingsSortPayrollNumbersAlphanumerically'] = $settingsSortPayrollNumbersAlphanumerically; + + return $this; + } + + /** + * Gets unauthorisedLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getUnauthorisedLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['unauthorisedLeaveProRataRule']; + } + + /** + * Sets unauthorisedLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $unauthorisedLeaveProRataRule unauthorisedLeaveProRataRule + * + * @return $this + */ + public function setUnauthorisedLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $unauthorisedLeaveProRataRule): static + { + if (is_null($unauthorisedLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable unauthorisedLeaveProRataRule cannot be null'); + } + $this->container['unauthorisedLeaveProRataRule'] = $unauthorisedLeaveProRataRule; + + return $this; + } + + /** + * Gets holidayLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getHolidayLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['holidayLeaveProRataRule']; + } + + /** + * Sets holidayLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $holidayLeaveProRataRule holidayLeaveProRataRule + * + * @return $this + */ + public function setHolidayLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $holidayLeaveProRataRule): static + { + if (is_null($holidayLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable holidayLeaveProRataRule cannot be null'); + } + $this->container['holidayLeaveProRataRule'] = $holidayLeaveProRataRule; + + return $this; + } + + /** + * Gets sickLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getSickLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['sickLeaveProRataRule']; + } + + /** + * Sets sickLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $sickLeaveProRataRule sickLeaveProRataRule + * + * @return $this + */ + public function setSickLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $sickLeaveProRataRule): static + { + if (is_null($sickLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable sickLeaveProRataRule cannot be null'); + } + $this->container['sickLeaveProRataRule'] = $sickLeaveProRataRule; + + return $this; + } + + /** + * Gets parentalLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getParentalLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['parentalLeaveProRataRule']; + } + + /** + * Sets parentalLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $parentalLeaveProRataRule parentalLeaveProRataRule + * + * @return $this + */ + public function setParentalLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $parentalLeaveProRataRule): static + { + if (is_null($parentalLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable parentalLeaveProRataRule cannot be null'); + } + $this->container['parentalLeaveProRataRule'] = $parentalLeaveProRataRule; + + return $this; + } + + /** + * Gets bereavementLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getBereavementLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['bereavementLeaveProRataRule']; + } + + /** + * Sets bereavementLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $bereavementLeaveProRataRule bereavementLeaveProRataRule + * + * @return $this + */ + public function setBereavementLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $bereavementLeaveProRataRule): static + { + if (is_null($bereavementLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable bereavementLeaveProRataRule cannot be null'); + } + $this->container['bereavementLeaveProRataRule'] = $bereavementLeaveProRataRule; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets sourceSystemId + * + * @return string|null + */ + public function getSourceSystemId(): ?string + { + return $this->container['sourceSystemId']; + } + + /** + * Sets sourceSystemId + * + * @param string|null $sourceSystemId [readonly] Can only be given a value when the employer is created. It can then never be changed. Used by external systems so they can store an immutable reference + * + * @return $this + */ + public function setSourceSystemId(?string $sourceSystemId): static + { + if (is_null($sourceSystemId)) { + array_push($this->openAPINullablesSetToNull, 'sourceSystemId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sourceSystemId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($sourceSystemId) && (mb_strlen($sourceSystemId) > 50)) { + throw new InvalidArgumentException('invalid length for $sourceSystemId when calling Employer., must be smaller than or equal to 50.'); + } + + $this->container['sourceSystemId'] = $sourceSystemId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerDefaults.php b/src/Model/EmployerDefaults.php new file mode 100644 index 0000000..be9527b --- /dev/null +++ b/src/Model/EmployerDefaults.php @@ -0,0 +1,817 @@ + + */ +class EmployerDefaults implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerDefaults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employer' => '\SynergiTech\Staffology\Model\EmployerItem', + 'payCodes' => 'bool', + 'csvMappings' => 'bool', + 'departments' => 'bool', + 'rti' => 'bool', + 'users' => 'bool', + 'hmrcNoticeSettings' => 'bool', + 'payOptions' => 'bool', + 'workingPatterns' => 'bool', + 'occupationalPolicies' => 'bool', + 'pensionSchemes' => 'bool', + 'payees' => 'bool', + 'reportPacks' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employer' => null, + 'payCodes' => null, + 'csvMappings' => null, + 'departments' => null, + 'rti' => null, + 'users' => null, + 'hmrcNoticeSettings' => null, + 'payOptions' => null, + 'workingPatterns' => null, + 'occupationalPolicies' => null, + 'pensionSchemes' => null, + 'payees' => null, + 'reportPacks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employer' => false, + 'payCodes' => false, + 'csvMappings' => false, + 'departments' => false, + 'rti' => false, + 'users' => false, + 'hmrcNoticeSettings' => false, + 'payOptions' => false, + 'workingPatterns' => false, + 'occupationalPolicies' => false, + 'pensionSchemes' => false, + 'payees' => false, + 'reportPacks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employer' => 'employer', + 'payCodes' => 'payCodes', + 'csvMappings' => 'csvMappings', + 'departments' => 'departments', + 'rti' => 'rti', + 'users' => 'users', + 'hmrcNoticeSettings' => 'hmrcNoticeSettings', + 'payOptions' => 'payOptions', + 'workingPatterns' => 'workingPatterns', + 'occupationalPolicies' => 'occupationalPolicies', + 'pensionSchemes' => 'pensionSchemes', + 'payees' => 'payees', + 'reportPacks' => 'reportPacks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employer' => 'setEmployer', + 'payCodes' => 'setPayCodes', + 'csvMappings' => 'setCsvMappings', + 'departments' => 'setDepartments', + 'rti' => 'setRti', + 'users' => 'setUsers', + 'hmrcNoticeSettings' => 'setHmrcNoticeSettings', + 'payOptions' => 'setPayOptions', + 'workingPatterns' => 'setWorkingPatterns', + 'occupationalPolicies' => 'setOccupationalPolicies', + 'pensionSchemes' => 'setPensionSchemes', + 'payees' => 'setPayees', + 'reportPacks' => 'setReportPacks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employer' => 'getEmployer', + 'payCodes' => 'getPayCodes', + 'csvMappings' => 'getCsvMappings', + 'departments' => 'getDepartments', + 'rti' => 'getRti', + 'users' => 'getUsers', + 'hmrcNoticeSettings' => 'getHmrcNoticeSettings', + 'payOptions' => 'getPayOptions', + 'workingPatterns' => 'getWorkingPatterns', + 'occupationalPolicies' => 'getOccupationalPolicies', + 'pensionSchemes' => 'getPensionSchemes', + 'payees' => 'getPayees', + 'reportPacks' => 'getReportPacks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('csvMappings', $data ?? [], null); + $this->setIfExists('departments', $data ?? [], null); + $this->setIfExists('rti', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('hmrcNoticeSettings', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('workingPatterns', $data ?? [], null); + $this->setIfExists('occupationalPolicies', $data ?? [], null); + $this->setIfExists('pensionSchemes', $data ?? [], null); + $this->setIfExists('payees', $data ?? [], null); + $this->setIfExists('reportPacks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\EmployerItem|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\EmployerItem + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\EmployerItem|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\EmployerItem $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payCodes + * + * @return bool|null + */ + public function getPayCodes(): ?bool + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param bool|null $payCodes If true then PayCodes and PayCodeSets will be copied from the specified Employer + * + * @return $this + */ + public function setPayCodes(?bool $payCodes): static + { + if (is_null($payCodes)) { + throw new InvalidArgumentException('non-nullable payCodes cannot be null'); + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets csvMappings + * + * @return bool|null + */ + public function getCsvMappings(): ?bool + { + return $this->container['csvMappings']; + } + + /** + * Sets csvMappings + * + * @param bool|null $csvMappings If true then CSV Mappings will be copied from the specified Employer + * + * @return $this + */ + public function setCsvMappings(?bool $csvMappings): static + { + if (is_null($csvMappings)) { + throw new InvalidArgumentException('non-nullable csvMappings cannot be null'); + } + $this->container['csvMappings'] = $csvMappings; + + return $this; + } + + /** + * Gets departments + * + * @return bool|null + */ + public function getDepartments(): ?bool + { + return $this->container['departments']; + } + + /** + * Sets departments + * + * @param bool|null $departments If true then Departments, Cost Centres and Analysis Categories will be copied from the specified Employer + * + * @return $this + */ + public function setDepartments(?bool $departments): static + { + if (is_null($departments)) { + throw new InvalidArgumentException('non-nullable departments cannot be null'); + } + $this->container['departments'] = $departments; + + return $this; + } + + /** + * Gets rti + * + * @return bool|null + */ + public function getRti(): ?bool + { + return $this->container['rti']; + } + + /** + * Sets rti + * + * @param bool|null $rti If true then RTI Settings will be copied from the specified Employer + * + * @return $this + */ + public function setRti(?bool $rti): static + { + if (is_null($rti)) { + throw new InvalidArgumentException('non-nullable rti cannot be null'); + } + $this->container['rti'] = $rti; + + return $this; + } + + /** + * Gets users + * + * @return bool|null + */ + public function getUsers(): ?bool + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param bool|null $users If true then Users will be copied from the specified Employer + * + * @return $this + */ + public function setUsers(?bool $users): static + { + if (is_null($users)) { + throw new InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets hmrcNoticeSettings + * + * @return bool|null + */ + public function getHmrcNoticeSettings(): ?bool + { + return $this->container['hmrcNoticeSettings']; + } + + /** + * Sets hmrcNoticeSettings + * + * @param bool|null $hmrcNoticeSettings If true then HMRC Notice Settings will be copied from the specified Employer + * + * @return $this + */ + public function setHmrcNoticeSettings(?bool $hmrcNoticeSettings): static + { + if (is_null($hmrcNoticeSettings)) { + throw new InvalidArgumentException('non-nullable hmrcNoticeSettings cannot be null'); + } + $this->container['hmrcNoticeSettings'] = $hmrcNoticeSettings; + + return $this; + } + + /** + * Gets payOptions + * + * @return bool|null + */ + public function getPayOptions(): ?bool + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param bool|null $payOptions If true then Default Pay Options will be copied from the specified Employer. + * + * @return $this + */ + public function setPayOptions(?bool $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets workingPatterns + * + * @return bool|null + */ + public function getWorkingPatterns(): ?bool + { + return $this->container['workingPatterns']; + } + + /** + * Sets workingPatterns + * + * @param bool|null $workingPatterns If true then WorkingPatterns will be copied from the specified Employer + * + * @return $this + */ + public function setWorkingPatterns(?bool $workingPatterns): static + { + if (is_null($workingPatterns)) { + throw new InvalidArgumentException('non-nullable workingPatterns cannot be null'); + } + $this->container['workingPatterns'] = $workingPatterns; + + return $this; + } + + /** + * Gets occupationalPolicies + * + * @return bool|null + */ + public function getOccupationalPolicies(): ?bool + { + return $this->container['occupationalPolicies']; + } + + /** + * Sets occupationalPolicies + * + * @param bool|null $occupationalPolicies If true then Occupational Absence Schemes will be copied from the specified Employer. + * + * @return $this + */ + public function setOccupationalPolicies(?bool $occupationalPolicies): static + { + if (is_null($occupationalPolicies)) { + throw new InvalidArgumentException('non-nullable occupationalPolicies cannot be null'); + } + $this->container['occupationalPolicies'] = $occupationalPolicies; + + return $this; + } + + /** + * Gets pensionSchemes + * + * @return bool|null + */ + public function getPensionSchemes(): ?bool + { + return $this->container['pensionSchemes']; + } + + /** + * Sets pensionSchemes + * + * @param bool|null $pensionSchemes If true then PensionSchemes will be copied from the specified Employer + * + * @return $this + */ + public function setPensionSchemes(?bool $pensionSchemes): static + { + if (is_null($pensionSchemes)) { + throw new InvalidArgumentException('non-nullable pensionSchemes cannot be null'); + } + $this->container['pensionSchemes'] = $pensionSchemes; + + return $this; + } + + /** + * Gets payees + * + * @return bool|null + */ + public function getPayees(): ?bool + { + return $this->container['payees']; + } + + /** + * Sets payees + * + * @param bool|null $payees If true then Payees will be copied from the specified Employer + * + * @return $this + */ + public function setPayees(?bool $payees): static + { + if (is_null($payees)) { + throw new InvalidArgumentException('non-nullable payees cannot be null'); + } + $this->container['payees'] = $payees; + + return $this; + } + + /** + * Gets reportPacks + * + * @return bool|null + */ + public function getReportPacks(): ?bool + { + return $this->container['reportPacks']; + } + + /** + * Sets reportPacks + * + * @param bool|null $reportPacks If true then ReportPacks will be copied from the specified Employer + * + * @return $this + */ + public function setReportPacks(?bool $reportPacks): static + { + if (is_null($reportPacks)) { + throw new InvalidArgumentException('non-nullable reportPacks cannot be null'); + } + $this->container['reportPacks'] = $reportPacks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerEmail.php b/src/Model/EmployerEmail.php new file mode 100644 index 0000000..9a0316c --- /dev/null +++ b/src/Model/EmployerEmail.php @@ -0,0 +1,1018 @@ + + */ +class EmployerEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerEmail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'toName' => 'string', + 'toEmail' => 'string', + 'subject' => 'string', + 'buttonText' => 'string', + 'buttonLink' => 'string', + 'bodyPreview' => 'string', + 'body' => 'string', + 'afterBtnBody' => 'string', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusDate' => '\DateTime', + 'statusMessage' => 'string', + 'sendAttempts' => 'int', + 'webAppBaseUrl' => 'string', + 'attachments' => '\SynergiTech\Staffology\Model\EmailAttachment[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'toName' => null, + 'toEmail' => null, + 'subject' => null, + 'buttonText' => null, + 'buttonLink' => null, + 'bodyPreview' => null, + 'body' => null, + 'afterBtnBody' => null, + 'status' => null, + 'statusDate' => 'date-time', + 'statusMessage' => null, + 'sendAttempts' => 'int32', + 'webAppBaseUrl' => null, + 'attachments' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'toName' => false, + 'toEmail' => false, + 'subject' => false, + 'buttonText' => true, + 'buttonLink' => true, + 'bodyPreview' => true, + 'body' => true, + 'afterBtnBody' => true, + 'status' => false, + 'statusDate' => false, + 'statusMessage' => true, + 'sendAttempts' => false, + 'webAppBaseUrl' => true, + 'attachments' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'toName' => 'toName', + 'toEmail' => 'toEmail', + 'subject' => 'subject', + 'buttonText' => 'buttonText', + 'buttonLink' => 'buttonLink', + 'bodyPreview' => 'bodyPreview', + 'body' => 'body', + 'afterBtnBody' => 'afterBtnBody', + 'status' => 'status', + 'statusDate' => 'statusDate', + 'statusMessage' => 'statusMessage', + 'sendAttempts' => 'sendAttempts', + 'webAppBaseUrl' => 'webAppBaseUrl', + 'attachments' => 'attachments', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'toName' => 'setToName', + 'toEmail' => 'setToEmail', + 'subject' => 'setSubject', + 'buttonText' => 'setButtonText', + 'buttonLink' => 'setButtonLink', + 'bodyPreview' => 'setBodyPreview', + 'body' => 'setBody', + 'afterBtnBody' => 'setAfterBtnBody', + 'status' => 'setStatus', + 'statusDate' => 'setStatusDate', + 'statusMessage' => 'setStatusMessage', + 'sendAttempts' => 'setSendAttempts', + 'webAppBaseUrl' => 'setWebAppBaseUrl', + 'attachments' => 'setAttachments', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'toName' => 'getToName', + 'toEmail' => 'getToEmail', + 'subject' => 'getSubject', + 'buttonText' => 'getButtonText', + 'buttonLink' => 'getButtonLink', + 'bodyPreview' => 'getBodyPreview', + 'body' => 'getBody', + 'afterBtnBody' => 'getAfterBtnBody', + 'status' => 'getStatus', + 'statusDate' => 'getStatusDate', + 'statusMessage' => 'getStatusMessage', + 'sendAttempts' => 'getSendAttempts', + 'webAppBaseUrl' => 'getWebAppBaseUrl', + 'attachments' => 'getAttachments', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('toName', $data ?? [], null); + $this->setIfExists('toEmail', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('buttonText', $data ?? [], null); + $this->setIfExists('buttonLink', $data ?? [], null); + $this->setIfExists('bodyPreview', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('afterBtnBody', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusDate', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('sendAttempts', $data ?? [], null); + $this->setIfExists('webAppBaseUrl', $data ?? [], null); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['toName'] === null) { + $invalidProperties[] = "'toName' can't be null"; + } + if ((mb_strlen($this->container['toName']) > 150)) { + $invalidProperties[] = "invalid value for 'toName', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['toName']) < 1)) { + $invalidProperties[] = "invalid value for 'toName', the character length must be bigger than or equal to 1."; + } + + if ($this->container['toEmail'] === null) { + $invalidProperties[] = "'toEmail' can't be null"; + } + if ((mb_strlen($this->container['toEmail']) > 150)) { + $invalidProperties[] = "invalid value for 'toEmail', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['toEmail']) < 1)) { + $invalidProperties[] = "invalid value for 'toEmail', the character length must be bigger than or equal to 1."; + } + + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ((mb_strlen($this->container['subject']) > 150)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['subject']) < 1)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['buttonText']) && (mb_strlen($this->container['buttonText']) > 100)) { + $invalidProperties[] = "invalid value for 'buttonText', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['buttonLink']) && (mb_strlen($this->container['buttonLink']) > 250)) { + $invalidProperties[] = "invalid value for 'buttonLink', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['bodyPreview']) && (mb_strlen($this->container['bodyPreview']) > 100)) { + $invalidProperties[] = "invalid value for 'bodyPreview', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets toName + * + * @return string + */ + public function getToName(): string + { + return $this->container['toName']; + } + + /** + * Sets toName + * + * @param string $toName toName + * + * @return $this + */ + public function setToName(string $toName): static + { + if (is_null($toName)) { + throw new InvalidArgumentException('non-nullable toName cannot be null'); + } + if ((mb_strlen($toName) > 150)) { + throw new InvalidArgumentException('invalid length for $toName when calling EmployerEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($toName) < 1)) { + throw new InvalidArgumentException('invalid length for $toName when calling EmployerEmail., must be bigger than or equal to 1.'); + } + + $this->container['toName'] = $toName; + + return $this; + } + + /** + * Gets toEmail + * + * @return string + */ + public function getToEmail(): string + { + return $this->container['toEmail']; + } + + /** + * Sets toEmail + * + * @param string $toEmail toEmail + * + * @return $this + */ + public function setToEmail(string $toEmail): static + { + if (is_null($toEmail)) { + throw new InvalidArgumentException('non-nullable toEmail cannot be null'); + } + if ((mb_strlen($toEmail) > 150)) { + throw new InvalidArgumentException('invalid length for $toEmail when calling EmployerEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($toEmail) < 1)) { + throw new InvalidArgumentException('invalid length for $toEmail when calling EmployerEmail., must be bigger than or equal to 1.'); + } + + $this->container['toEmail'] = $toEmail; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject(): string + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject subject + * + * @return $this + */ + public function setSubject(string $subject): static + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if ((mb_strlen($subject) > 150)) { + throw new InvalidArgumentException('invalid length for $subject when calling EmployerEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($subject) < 1)) { + throw new InvalidArgumentException('invalid length for $subject when calling EmployerEmail., must be bigger than or equal to 1.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets buttonText + * + * @return string|null + */ + public function getButtonText(): ?string + { + return $this->container['buttonText']; + } + + /** + * Sets buttonText + * + * @param string|null $buttonText buttonText + * + * @return $this + */ + public function setButtonText(?string $buttonText): static + { + if (is_null($buttonText)) { + array_push($this->openAPINullablesSetToNull, 'buttonText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buttonText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buttonText) && (mb_strlen($buttonText) > 100)) { + throw new InvalidArgumentException('invalid length for $buttonText when calling EmployerEmail., must be smaller than or equal to 100.'); + } + + $this->container['buttonText'] = $buttonText; + + return $this; + } + + /** + * Gets buttonLink + * + * @return string|null + */ + public function getButtonLink(): ?string + { + return $this->container['buttonLink']; + } + + /** + * Sets buttonLink + * + * @param string|null $buttonLink buttonLink + * + * @return $this + */ + public function setButtonLink(?string $buttonLink): static + { + if (is_null($buttonLink)) { + array_push($this->openAPINullablesSetToNull, 'buttonLink'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buttonLink', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buttonLink) && (mb_strlen($buttonLink) > 250)) { + throw new InvalidArgumentException('invalid length for $buttonLink when calling EmployerEmail., must be smaller than or equal to 250.'); + } + + $this->container['buttonLink'] = $buttonLink; + + return $this; + } + + /** + * Gets bodyPreview + * + * @return string|null + */ + public function getBodyPreview(): ?string + { + return $this->container['bodyPreview']; + } + + /** + * Sets bodyPreview + * + * @param string|null $bodyPreview bodyPreview + * + * @return $this + */ + public function setBodyPreview(?string $bodyPreview): static + { + if (is_null($bodyPreview)) { + array_push($this->openAPINullablesSetToNull, 'bodyPreview'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bodyPreview', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bodyPreview) && (mb_strlen($bodyPreview) > 100)) { + throw new InvalidArgumentException('invalid length for $bodyPreview when calling EmployerEmail., must be smaller than or equal to 100.'); + } + + $this->container['bodyPreview'] = $bodyPreview; + + return $this; + } + + /** + * Gets body + * + * @return string|null + */ + public function getBody(): ?string + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body body + * + * @return $this + */ + public function setBody(?string $body): static + { + if (is_null($body)) { + array_push($this->openAPINullablesSetToNull, 'body'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets afterBtnBody + * + * @return string|null + */ + public function getAfterBtnBody(): ?string + { + return $this->container['afterBtnBody']; + } + + /** + * Sets afterBtnBody + * + * @param string|null $afterBtnBody afterBtnBody + * + * @return $this + */ + public function setAfterBtnBody(?string $afterBtnBody): static + { + if (is_null($afterBtnBody)) { + array_push($this->openAPINullablesSetToNull, 'afterBtnBody'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('afterBtnBody', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['afterBtnBody'] = $afterBtnBody; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusDate + * + * @return \DateTime|null + */ + public function getStatusDate(): ?\DateTime + { + return $this->container['statusDate']; + } + + /** + * Sets statusDate + * + * @param \DateTime|null $statusDate statusDate + * + * @return $this + */ + public function setStatusDate(?\DateTime $statusDate): static + { + if (is_null($statusDate)) { + throw new InvalidArgumentException('non-nullable statusDate cannot be null'); + } + $this->container['statusDate'] = $statusDate; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage statusMessage + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets sendAttempts + * + * @return int|null + */ + public function getSendAttempts(): ?int + { + return $this->container['sendAttempts']; + } + + /** + * Sets sendAttempts + * + * @param int|null $sendAttempts sendAttempts + * + * @return $this + */ + public function setSendAttempts(?int $sendAttempts): static + { + if (is_null($sendAttempts)) { + throw new InvalidArgumentException('non-nullable sendAttempts cannot be null'); + } + $this->container['sendAttempts'] = $sendAttempts; + + return $this; + } + + /** + * Gets webAppBaseUrl + * + * @return string|null + */ + public function getWebAppBaseUrl(): ?string + { + return $this->container['webAppBaseUrl']; + } + + /** + * Sets webAppBaseUrl + * + * @param string|null $webAppBaseUrl webAppBaseUrl + * + * @return $this + */ + public function setWebAppBaseUrl(?string $webAppBaseUrl): static + { + if (is_null($webAppBaseUrl)) { + array_push($this->openAPINullablesSetToNull, 'webAppBaseUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webAppBaseUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webAppBaseUrl'] = $webAppBaseUrl; + + return $this; + } + + /** + * Gets attachments + * + * @return \SynergiTech\Staffology\Model\EmailAttachment[]|null + */ + public function getAttachments(): ?array + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param \SynergiTech\Staffology\Model\EmailAttachment[]|null $attachments attachments + * + * @return $this + */ + public function setAttachments(?array $attachments): static + { + if (is_null($attachments)) { + array_push($this->openAPINullablesSetToNull, 'attachments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachments'] = $attachments; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerEvcOptInHistory.php b/src/Model/EmployerEvcOptInHistory.php new file mode 100644 index 0000000..1d0c0a7 --- /dev/null +++ b/src/Model/EmployerEvcOptInHistory.php @@ -0,0 +1,483 @@ + + */ +class EmployerEvcOptInHistory implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerEvcOptInHistory'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'optIn' => 'bool', + 'date' => '\DateTime', + 'userEmail' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'optIn' => null, + 'date' => 'date', + 'userEmail' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'optIn' => false, + 'date' => false, + 'userEmail' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'optIn' => 'optIn', + 'date' => 'date', + 'userEmail' => 'userEmail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'optIn' => 'setOptIn', + 'date' => 'setDate', + 'userEmail' => 'setUserEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'optIn' => 'getOptIn', + 'date' => 'getDate', + 'userEmail' => 'getUserEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('optIn', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('userEmail', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets optIn + * + * @return bool|null + */ + public function getOptIn(): ?bool + { + return $this->container['optIn']; + } + + /** + * Sets optIn + * + * @param bool|null $optIn optIn + * + * @return $this + */ + public function setOptIn(?bool $optIn): static + { + if (is_null($optIn)) { + throw new InvalidArgumentException('non-nullable optIn cannot be null'); + } + $this->container['optIn'] = $optIn; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets userEmail + * + * @return string|null + */ + public function getUserEmail(): ?string + { + return $this->container['userEmail']; + } + + /** + * Sets userEmail + * + * @param string|null $userEmail userEmail + * + * @return $this + */ + public function setUserEmail(?string $userEmail): static + { + if (is_null($userEmail)) { + array_push($this->openAPINullablesSetToNull, 'userEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('userEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['userEmail'] = $userEmail; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerGroup.php b/src/Model/EmployerGroup.php new file mode 100644 index 0000000..8f47616 --- /dev/null +++ b/src/Model/EmployerGroup.php @@ -0,0 +1,561 @@ + + */ +class EmployerGroup implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'employerCount' => 'int', + 'color' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'employerCount' => 'int32', + 'color' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'employerCount' => false, + 'color' => true, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'employerCount' => 'employerCount', + 'color' => 'color', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'employerCount' => 'setEmployerCount', + 'color' => 'setColor', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'employerCount' => 'getEmployerCount', + 'color' => 'getColor', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('employerCount', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 150)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this EmployerGroup + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling EmployerGroup., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling EmployerGroup., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets employerCount + * + * @return int|null + */ + public function getEmployerCount(): ?int + { + return $this->container['employerCount']; + } + + /** + * Sets employerCount + * + * @param int|null $employerCount employerCount + * + * @return $this + */ + public function setEmployerCount(?int $employerCount): static + { + if (is_null($employerCount)) { + throw new InvalidArgumentException('non-nullable employerCount cannot be null'); + } + $this->container['employerCount'] = $employerCount; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this EmployerGroup, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling EmployerGroup., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 150)) { + throw new InvalidArgumentException('invalid length for $name when calling EmployerGroup., must be smaller than or equal to 150.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling EmployerGroup., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerGroupMembership.php b/src/Model/EmployerGroupMembership.php new file mode 100644 index 0000000..1a7ff3a --- /dev/null +++ b/src/Model/EmployerGroupMembership.php @@ -0,0 +1,537 @@ + + */ +class EmployerGroupMembership implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerGroupMembership'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'color' => 'string', + 'title' => 'string', + 'primary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'color' => null, + 'title' => null, + 'primary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'color' => true, + 'title' => true, + 'primary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'color' => 'color', + 'title' => 'title', + 'primary' => 'primary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'color' => 'setColor', + 'title' => 'setTitle', + 'primary' => 'setPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'color' => 'getColor', + 'title' => 'getTitle', + 'primary' => 'getPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('primary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The Code for the EmployerGroup + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling EmployerGroupMembership., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color [readonly] The Color for the EmployerGroup + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] The Title for the EmployerGroup + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary(): ?bool + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Set to true if this is the primary EmployerGroup for the Employer. Only one EmployerGroup can be set as the primary. + * + * @return $this + */ + public function setPrimary(?bool $primary): static + { + if (is_null($primary)) { + throw new InvalidArgumentException('non-nullable primary cannot be null'); + } + $this->container['primary'] = $primary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerItem.php b/src/Model/EmployerItem.php new file mode 100644 index 0000000..2869a01 --- /dev/null +++ b/src/Model/EmployerItem.php @@ -0,0 +1,599 @@ + + */ +class EmployerItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isOwner' => 'bool', + 'role' => '\SynergiTech\Staffology\Model\UserRole', + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isOwner' => null, + 'role' => null, + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isOwner' => false, + 'role' => false, + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isOwner' => 'isOwner', + 'role' => 'role', + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isOwner' => 'setIsOwner', + 'role' => 'setRole', + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isOwner' => 'getIsOwner', + 'role' => 'getRole', + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isOwner', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isOwner + * + * @return bool|null + */ + public function getIsOwner(): ?bool + { + return $this->container['isOwner']; + } + + /** + * Sets isOwner + * + * @param bool|null $isOwner isOwner + * + * @return $this + */ + public function setIsOwner(?bool $isOwner): static + { + if (is_null($isOwner)) { + throw new InvalidArgumentException('non-nullable isOwner cannot be null'); + } + $this->container['isOwner'] = $isOwner; + + return $this; + } + + /** + * Gets role + * + * @return \SynergiTech\Staffology\Model\UserRole|null + */ + public function getRole(): ?\SynergiTech\Staffology\Model\UserRole + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param \SynergiTech\Staffology\Model\UserRole|null $role role + * + * @return $this + */ + public function setRole(?\SynergiTech\Staffology\Model\UserRole $role): static + { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerOpeningBalances.php b/src/Model/EmployerOpeningBalances.php new file mode 100644 index 0000000..b169d6a --- /dev/null +++ b/src/Model/EmployerOpeningBalances.php @@ -0,0 +1,816 @@ + + */ +class EmployerOpeningBalances implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerOpeningBalances'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'smpRecovered' => 'float', + 'sppRecovered' => 'float', + 'sapRecovered' => 'float', + 'shPPRecovered' => 'float', + 'spbpRecovered' => 'float', + 'nicCompensationOnSMP' => 'float', + 'nicCompensationOnSPP' => 'float', + 'nicCompensationOnSAP' => 'float', + 'nicCompensationOnShPP' => 'float', + 'nicCompensationOnSPBP' => 'float', + 'cisDeductionsSuffered' => 'float', + 'apprenticeshipLevy' => 'float', + 'employmentAllowance' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'smpRecovered' => 'double', + 'sppRecovered' => 'double', + 'sapRecovered' => 'double', + 'shPPRecovered' => 'double', + 'spbpRecovered' => 'double', + 'nicCompensationOnSMP' => 'double', + 'nicCompensationOnSPP' => 'double', + 'nicCompensationOnSAP' => 'double', + 'nicCompensationOnShPP' => 'double', + 'nicCompensationOnSPBP' => 'double', + 'cisDeductionsSuffered' => 'double', + 'apprenticeshipLevy' => 'double', + 'employmentAllowance' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'smpRecovered' => false, + 'sppRecovered' => false, + 'sapRecovered' => false, + 'shPPRecovered' => false, + 'spbpRecovered' => false, + 'nicCompensationOnSMP' => false, + 'nicCompensationOnSPP' => false, + 'nicCompensationOnSAP' => false, + 'nicCompensationOnShPP' => false, + 'nicCompensationOnSPBP' => false, + 'cisDeductionsSuffered' => false, + 'apprenticeshipLevy' => false, + 'employmentAllowance' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'smpRecovered' => 'smpRecovered', + 'sppRecovered' => 'sppRecovered', + 'sapRecovered' => 'sapRecovered', + 'shPPRecovered' => 'shPPRecovered', + 'spbpRecovered' => 'spbpRecovered', + 'nicCompensationOnSMP' => 'nicCompensationOnSMP', + 'nicCompensationOnSPP' => 'nicCompensationOnSPP', + 'nicCompensationOnSAP' => 'nicCompensationOnSAP', + 'nicCompensationOnShPP' => 'nicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'nicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'cisDeductionsSuffered', + 'apprenticeshipLevy' => 'apprenticeshipLevy', + 'employmentAllowance' => 'employmentAllowance' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'smpRecovered' => 'setSmpRecovered', + 'sppRecovered' => 'setSppRecovered', + 'sapRecovered' => 'setSapRecovered', + 'shPPRecovered' => 'setShPPRecovered', + 'spbpRecovered' => 'setSpbpRecovered', + 'nicCompensationOnSMP' => 'setNicCompensationOnSMP', + 'nicCompensationOnSPP' => 'setNicCompensationOnSPP', + 'nicCompensationOnSAP' => 'setNicCompensationOnSAP', + 'nicCompensationOnShPP' => 'setNicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'setNicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'setCisDeductionsSuffered', + 'apprenticeshipLevy' => 'setApprenticeshipLevy', + 'employmentAllowance' => 'setEmploymentAllowance' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'smpRecovered' => 'getSmpRecovered', + 'sppRecovered' => 'getSppRecovered', + 'sapRecovered' => 'getSapRecovered', + 'shPPRecovered' => 'getShPPRecovered', + 'spbpRecovered' => 'getSpbpRecovered', + 'nicCompensationOnSMP' => 'getNicCompensationOnSMP', + 'nicCompensationOnSPP' => 'getNicCompensationOnSPP', + 'nicCompensationOnSAP' => 'getNicCompensationOnSAP', + 'nicCompensationOnShPP' => 'getNicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'getNicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'getCisDeductionsSuffered', + 'apprenticeshipLevy' => 'getApprenticeshipLevy', + 'employmentAllowance' => 'getEmploymentAllowance' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('smpRecovered', $data ?? [], null); + $this->setIfExists('sppRecovered', $data ?? [], null); + $this->setIfExists('sapRecovered', $data ?? [], null); + $this->setIfExists('shPPRecovered', $data ?? [], null); + $this->setIfExists('spbpRecovered', $data ?? [], null); + $this->setIfExists('nicCompensationOnSMP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSPP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSAP', $data ?? [], null); + $this->setIfExists('nicCompensationOnShPP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSPBP', $data ?? [], null); + $this->setIfExists('cisDeductionsSuffered', $data ?? [], null); + $this->setIfExists('apprenticeshipLevy', $data ?? [], null); + $this->setIfExists('employmentAllowance', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets smpRecovered + * + * @return float|null + */ + public function getSmpRecovered(): ?float + { + return $this->container['smpRecovered']; + } + + /** + * Sets smpRecovered + * + * @param float|null $smpRecovered Value of Statutory Maternity Pay recovered year to date + * + * @return $this + */ + public function setSmpRecovered(?float $smpRecovered): static + { + if (is_null($smpRecovered)) { + throw new InvalidArgumentException('non-nullable smpRecovered cannot be null'); + } + $this->container['smpRecovered'] = $smpRecovered; + + return $this; + } + + /** + * Gets sppRecovered + * + * @return float|null + */ + public function getSppRecovered(): ?float + { + return $this->container['sppRecovered']; + } + + /** + * Sets sppRecovered + * + * @param float|null $sppRecovered Value of Statutory Paternity Pay recovered year to date + * + * @return $this + */ + public function setSppRecovered(?float $sppRecovered): static + { + if (is_null($sppRecovered)) { + throw new InvalidArgumentException('non-nullable sppRecovered cannot be null'); + } + $this->container['sppRecovered'] = $sppRecovered; + + return $this; + } + + /** + * Gets sapRecovered + * + * @return float|null + */ + public function getSapRecovered(): ?float + { + return $this->container['sapRecovered']; + } + + /** + * Sets sapRecovered + * + * @param float|null $sapRecovered Value of Statutory Adoption Pay recovered year to date + * + * @return $this + */ + public function setSapRecovered(?float $sapRecovered): static + { + if (is_null($sapRecovered)) { + throw new InvalidArgumentException('non-nullable sapRecovered cannot be null'); + } + $this->container['sapRecovered'] = $sapRecovered; + + return $this; + } + + /** + * Gets shPPRecovered + * + * @return float|null + */ + public function getShPPRecovered(): ?float + { + return $this->container['shPPRecovered']; + } + + /** + * Sets shPPRecovered + * + * @param float|null $shPPRecovered Value of Shared Parental Pay recovered year to date + * + * @return $this + */ + public function setShPPRecovered(?float $shPPRecovered): static + { + if (is_null($shPPRecovered)) { + throw new InvalidArgumentException('non-nullable shPPRecovered cannot be null'); + } + $this->container['shPPRecovered'] = $shPPRecovered; + + return $this; + } + + /** + * Gets spbpRecovered + * + * @return float|null + */ + public function getSpbpRecovered(): ?float + { + return $this->container['spbpRecovered']; + } + + /** + * Sets spbpRecovered + * + * @param float|null $spbpRecovered Value of Statutory Parental Bereavment Pay recovered year to date + * + * @return $this + */ + public function setSpbpRecovered(?float $spbpRecovered): static + { + if (is_null($spbpRecovered)) { + throw new InvalidArgumentException('non-nullable spbpRecovered cannot be null'); + } + $this->container['spbpRecovered'] = $spbpRecovered; + + return $this; + } + + /** + * Gets nicCompensationOnSMP + * + * @return float|null + */ + public function getNicCompensationOnSMP(): ?float + { + return $this->container['nicCompensationOnSMP']; + } + + /** + * Sets nicCompensationOnSMP + * + * @param float|null $nicCompensationOnSMP Value of NIC compensation on SMP year to date + * + * @return $this + */ + public function setNicCompensationOnSMP(?float $nicCompensationOnSMP): static + { + if (is_null($nicCompensationOnSMP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSMP cannot be null'); + } + $this->container['nicCompensationOnSMP'] = $nicCompensationOnSMP; + + return $this; + } + + /** + * Gets nicCompensationOnSPP + * + * @return float|null + */ + public function getNicCompensationOnSPP(): ?float + { + return $this->container['nicCompensationOnSPP']; + } + + /** + * Sets nicCompensationOnSPP + * + * @param float|null $nicCompensationOnSPP Value of NIC compensation on Statutory Paternity Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSPP(?float $nicCompensationOnSPP): static + { + if (is_null($nicCompensationOnSPP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSPP cannot be null'); + } + $this->container['nicCompensationOnSPP'] = $nicCompensationOnSPP; + + return $this; + } + + /** + * Gets nicCompensationOnSAP + * + * @return float|null + */ + public function getNicCompensationOnSAP(): ?float + { + return $this->container['nicCompensationOnSAP']; + } + + /** + * Sets nicCompensationOnSAP + * + * @param float|null $nicCompensationOnSAP Value of NIC compensation on Statutory Adoption Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSAP(?float $nicCompensationOnSAP): static + { + if (is_null($nicCompensationOnSAP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSAP cannot be null'); + } + $this->container['nicCompensationOnSAP'] = $nicCompensationOnSAP; + + return $this; + } + + /** + * Gets nicCompensationOnShPP + * + * @return float|null + */ + public function getNicCompensationOnShPP(): ?float + { + return $this->container['nicCompensationOnShPP']; + } + + /** + * Sets nicCompensationOnShPP + * + * @param float|null $nicCompensationOnShPP Value of NIC compensation on Shared Parental Pay year to date + * + * @return $this + */ + public function setNicCompensationOnShPP(?float $nicCompensationOnShPP): static + { + if (is_null($nicCompensationOnShPP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnShPP cannot be null'); + } + $this->container['nicCompensationOnShPP'] = $nicCompensationOnShPP; + + return $this; + } + + /** + * Gets nicCompensationOnSPBP + * + * @return float|null + */ + public function getNicCompensationOnSPBP(): ?float + { + return $this->container['nicCompensationOnSPBP']; + } + + /** + * Sets nicCompensationOnSPBP + * + * @param float|null $nicCompensationOnSPBP Value of NIC compensation on Statutory Parental Bereavement Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSPBP(?float $nicCompensationOnSPBP): static + { + if (is_null($nicCompensationOnSPBP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSPBP cannot be null'); + } + $this->container['nicCompensationOnSPBP'] = $nicCompensationOnSPBP; + + return $this; + } + + /** + * Gets cisDeductionsSuffered + * + * @return float|null + */ + public function getCisDeductionsSuffered(): ?float + { + return $this->container['cisDeductionsSuffered']; + } + + /** + * Sets cisDeductionsSuffered + * + * @param float|null $cisDeductionsSuffered Value of CIS deductions suffered year to date + * + * @return $this + */ + public function setCisDeductionsSuffered(?float $cisDeductionsSuffered): static + { + if (is_null($cisDeductionsSuffered)) { + throw new InvalidArgumentException('non-nullable cisDeductionsSuffered cannot be null'); + } + $this->container['cisDeductionsSuffered'] = $cisDeductionsSuffered; + + return $this; + } + + /** + * Gets apprenticeshipLevy + * + * @return float|null + */ + public function getApprenticeshipLevy(): ?float + { + return $this->container['apprenticeshipLevy']; + } + + /** + * Sets apprenticeshipLevy + * + * @param float|null $apprenticeshipLevy Value of Apprenticeship levy paid year to date + * + * @return $this + */ + public function setApprenticeshipLevy(?float $apprenticeshipLevy): static + { + if (is_null($apprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevy cannot be null'); + } + $this->container['apprenticeshipLevy'] = $apprenticeshipLevy; + + return $this; + } + + /** + * Gets employmentAllowance + * + * @return float|null + */ + public function getEmploymentAllowance(): ?float + { + return $this->container['employmentAllowance']; + } + + /** + * Sets employmentAllowance + * + * @param float|null $employmentAllowance Value of Employment Allowance claimed year to date + * + * @return $this + */ + public function setEmploymentAllowance(?float $employmentAllowance): static + { + if (is_null($employmentAllowance)) { + throw new InvalidArgumentException('non-nullable employmentAllowance cannot be null'); + } + $this->container['employmentAllowance'] = $employmentAllowance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerPensionContribution.php b/src/Model/EmployerPensionContribution.php new file mode 100644 index 0000000..f012d93 --- /dev/null +++ b/src/Model/EmployerPensionContribution.php @@ -0,0 +1,517 @@ + + */ +class EmployerPensionContribution implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerPensionContribution'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionName' => 'string', + 'contributionAmount' => 'float', + 'contributionPercentage' => 'float', + 'isPercentage' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionName' => null, + 'contributionAmount' => 'double', + 'contributionPercentage' => 'double', + 'isPercentage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionName' => true, + 'contributionAmount' => false, + 'contributionPercentage' => false, + 'isPercentage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionName' => 'pensionName', + 'contributionAmount' => 'contributionAmount', + 'contributionPercentage' => 'contributionPercentage', + 'isPercentage' => 'isPercentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionName' => 'setPensionName', + 'contributionAmount' => 'setContributionAmount', + 'contributionPercentage' => 'setContributionPercentage', + 'isPercentage' => 'setIsPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionName' => 'getPensionName', + 'contributionAmount' => 'getContributionAmount', + 'contributionPercentage' => 'getContributionPercentage', + 'isPercentage' => 'getIsPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionName', $data ?? [], null); + $this->setIfExists('contributionAmount', $data ?? [], null); + $this->setIfExists('contributionPercentage', $data ?? [], null); + $this->setIfExists('isPercentage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionName + * + * @return string|null + */ + public function getPensionName(): ?string + { + return $this->container['pensionName']; + } + + /** + * Sets pensionName + * + * @param string|null $pensionName pensionName + * + * @return $this + */ + public function setPensionName(?string $pensionName): static + { + if (is_null($pensionName)) { + array_push($this->openAPINullablesSetToNull, 'pensionName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionName'] = $pensionName; + + return $this; + } + + /** + * Gets contributionAmount + * + * @return float|null + */ + public function getContributionAmount(): ?float + { + return $this->container['contributionAmount']; + } + + /** + * Sets contributionAmount + * + * @param float|null $contributionAmount contributionAmount + * + * @return $this + */ + public function setContributionAmount(?float $contributionAmount): static + { + if (is_null($contributionAmount)) { + throw new InvalidArgumentException('non-nullable contributionAmount cannot be null'); + } + $this->container['contributionAmount'] = $contributionAmount; + + return $this; + } + + /** + * Gets contributionPercentage + * + * @return float|null + */ + public function getContributionPercentage(): ?float + { + return $this->container['contributionPercentage']; + } + + /** + * Sets contributionPercentage + * + * @param float|null $contributionPercentage contributionPercentage + * + * @return $this + */ + public function setContributionPercentage(?float $contributionPercentage): static + { + if (is_null($contributionPercentage)) { + throw new InvalidArgumentException('non-nullable contributionPercentage cannot be null'); + } + $this->container['contributionPercentage'] = $contributionPercentage; + + return $this; + } + + /** + * Gets isPercentage + * + * @return bool|null + */ + public function getIsPercentage(): ?bool + { + return $this->container['isPercentage']; + } + + /** + * Sets isPercentage + * + * @param bool|null $isPercentage isPercentage + * + * @return $this + */ + public function setIsPercentage(?bool $isPercentage): static + { + if (is_null($isPercentage)) { + throw new InvalidArgumentException('non-nullable isPercentage cannot be null'); + } + $this->container['isPercentage'] = $isPercentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerSettings.php b/src/Model/EmployerSettings.php new file mode 100644 index 0000000..b786fa6 --- /dev/null +++ b/src/Model/EmployerSettings.php @@ -0,0 +1,896 @@ + + */ +class EmployerSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'allowNegativePay' => 'bool', + 'manualStatutoryPayLinesEnabled' => 'bool', + 'mergeMatchingNominalsEnabled' => 'bool', + 'autoCalcBackPayForNewStarters' => 'bool', + 'payCodeValidationEnabled' => 'bool', + 'calculateEffectiveDateSalaryChanges' => 'bool', + 'groupPayLinesEnabled' => 'bool', + 'contractedWeeks' => 'float', + 'fullTimeContractedWeeks' => 'float', + 'fullTimeContractedHours' => 'float', + 'disabledPayRunWarningsList' => '\SynergiTech\Staffology\Model\PayRunEntryWarningType[]', + 'journalCsvFormat' => '\SynergiTech\Staffology\Model\JournalCsvFormat', + 'preferAsyncPayrunApiCalls' => 'bool', + 'nominalMappingsEnabled' => 'bool', + 'sortPayrollNumbersAlphanumerically' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'allowNegativePay' => null, + 'manualStatutoryPayLinesEnabled' => null, + 'mergeMatchingNominalsEnabled' => null, + 'autoCalcBackPayForNewStarters' => null, + 'payCodeValidationEnabled' => null, + 'calculateEffectiveDateSalaryChanges' => null, + 'groupPayLinesEnabled' => null, + 'contractedWeeks' => 'double', + 'fullTimeContractedWeeks' => 'double', + 'fullTimeContractedHours' => 'double', + 'disabledPayRunWarningsList' => null, + 'journalCsvFormat' => null, + 'preferAsyncPayrunApiCalls' => null, + 'nominalMappingsEnabled' => null, + 'sortPayrollNumbersAlphanumerically' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'allowNegativePay' => false, + 'manualStatutoryPayLinesEnabled' => false, + 'mergeMatchingNominalsEnabled' => false, + 'autoCalcBackPayForNewStarters' => false, + 'payCodeValidationEnabled' => false, + 'calculateEffectiveDateSalaryChanges' => false, + 'groupPayLinesEnabled' => false, + 'contractedWeeks' => false, + 'fullTimeContractedWeeks' => false, + 'fullTimeContractedHours' => false, + 'disabledPayRunWarningsList' => true, + 'journalCsvFormat' => false, + 'preferAsyncPayrunApiCalls' => false, + 'nominalMappingsEnabled' => false, + 'sortPayrollNumbersAlphanumerically' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'allowNegativePay' => 'allowNegativePay', + 'manualStatutoryPayLinesEnabled' => 'manualStatutoryPayLinesEnabled', + 'mergeMatchingNominalsEnabled' => 'mergeMatchingNominalsEnabled', + 'autoCalcBackPayForNewStarters' => 'autoCalcBackPayForNewStarters', + 'payCodeValidationEnabled' => 'payCodeValidationEnabled', + 'calculateEffectiveDateSalaryChanges' => 'calculateEffectiveDateSalaryChanges', + 'groupPayLinesEnabled' => 'groupPayLinesEnabled', + 'contractedWeeks' => 'contractedWeeks', + 'fullTimeContractedWeeks' => 'fullTimeContractedWeeks', + 'fullTimeContractedHours' => 'fullTimeContractedHours', + 'disabledPayRunWarningsList' => 'disabledPayRunWarningsList', + 'journalCsvFormat' => 'journalCsvFormat', + 'preferAsyncPayrunApiCalls' => 'preferAsyncPayrunApiCalls', + 'nominalMappingsEnabled' => 'nominalMappingsEnabled', + 'sortPayrollNumbersAlphanumerically' => 'sortPayrollNumbersAlphanumerically' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'allowNegativePay' => 'setAllowNegativePay', + 'manualStatutoryPayLinesEnabled' => 'setManualStatutoryPayLinesEnabled', + 'mergeMatchingNominalsEnabled' => 'setMergeMatchingNominalsEnabled', + 'autoCalcBackPayForNewStarters' => 'setAutoCalcBackPayForNewStarters', + 'payCodeValidationEnabled' => 'setPayCodeValidationEnabled', + 'calculateEffectiveDateSalaryChanges' => 'setCalculateEffectiveDateSalaryChanges', + 'groupPayLinesEnabled' => 'setGroupPayLinesEnabled', + 'contractedWeeks' => 'setContractedWeeks', + 'fullTimeContractedWeeks' => 'setFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'setFullTimeContractedHours', + 'disabledPayRunWarningsList' => 'setDisabledPayRunWarningsList', + 'journalCsvFormat' => 'setJournalCsvFormat', + 'preferAsyncPayrunApiCalls' => 'setPreferAsyncPayrunApiCalls', + 'nominalMappingsEnabled' => 'setNominalMappingsEnabled', + 'sortPayrollNumbersAlphanumerically' => 'setSortPayrollNumbersAlphanumerically' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'allowNegativePay' => 'getAllowNegativePay', + 'manualStatutoryPayLinesEnabled' => 'getManualStatutoryPayLinesEnabled', + 'mergeMatchingNominalsEnabled' => 'getMergeMatchingNominalsEnabled', + 'autoCalcBackPayForNewStarters' => 'getAutoCalcBackPayForNewStarters', + 'payCodeValidationEnabled' => 'getPayCodeValidationEnabled', + 'calculateEffectiveDateSalaryChanges' => 'getCalculateEffectiveDateSalaryChanges', + 'groupPayLinesEnabled' => 'getGroupPayLinesEnabled', + 'contractedWeeks' => 'getContractedWeeks', + 'fullTimeContractedWeeks' => 'getFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'getFullTimeContractedHours', + 'disabledPayRunWarningsList' => 'getDisabledPayRunWarningsList', + 'journalCsvFormat' => 'getJournalCsvFormat', + 'preferAsyncPayrunApiCalls' => 'getPreferAsyncPayrunApiCalls', + 'nominalMappingsEnabled' => 'getNominalMappingsEnabled', + 'sortPayrollNumbersAlphanumerically' => 'getSortPayrollNumbersAlphanumerically' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowNegativePay', $data ?? [], null); + $this->setIfExists('manualStatutoryPayLinesEnabled', $data ?? [], null); + $this->setIfExists('mergeMatchingNominalsEnabled', $data ?? [], null); + $this->setIfExists('autoCalcBackPayForNewStarters', $data ?? [], null); + $this->setIfExists('payCodeValidationEnabled', $data ?? [], null); + $this->setIfExists('calculateEffectiveDateSalaryChanges', $data ?? [], null); + $this->setIfExists('groupPayLinesEnabled', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedHours', $data ?? [], null); + $this->setIfExists('disabledPayRunWarningsList', $data ?? [], null); + $this->setIfExists('journalCsvFormat', $data ?? [], null); + $this->setIfExists('preferAsyncPayrunApiCalls', $data ?? [], null); + $this->setIfExists('nominalMappingsEnabled', $data ?? [], null); + $this->setIfExists('sortPayrollNumbersAlphanumerically', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowNegativePay + * + * @return bool|null + */ + public function getAllowNegativePay(): ?bool + { + return $this->container['allowNegativePay']; + } + + /** + * Sets allowNegativePay + * + * @param bool|null $allowNegativePay allowNegativePay + * + * @return $this + */ + public function setAllowNegativePay(?bool $allowNegativePay): static + { + if (is_null($allowNegativePay)) { + throw new InvalidArgumentException('non-nullable allowNegativePay cannot be null'); + } + $this->container['allowNegativePay'] = $allowNegativePay; + + return $this; + } + + /** + * Gets manualStatutoryPayLinesEnabled + * + * @return bool|null + */ + public function getManualStatutoryPayLinesEnabled(): ?bool + { + return $this->container['manualStatutoryPayLinesEnabled']; + } + + /** + * Sets manualStatutoryPayLinesEnabled + * + * @param bool|null $manualStatutoryPayLinesEnabled manualStatutoryPayLinesEnabled + * + * @return $this + */ + public function setManualStatutoryPayLinesEnabled(?bool $manualStatutoryPayLinesEnabled): static + { + if (is_null($manualStatutoryPayLinesEnabled)) { + throw new InvalidArgumentException('non-nullable manualStatutoryPayLinesEnabled cannot be null'); + } + $this->container['manualStatutoryPayLinesEnabled'] = $manualStatutoryPayLinesEnabled; + + return $this; + } + + /** + * Gets mergeMatchingNominalsEnabled + * + * @return bool|null + */ + public function getMergeMatchingNominalsEnabled(): ?bool + { + return $this->container['mergeMatchingNominalsEnabled']; + } + + /** + * Sets mergeMatchingNominalsEnabled + * + * @param bool|null $mergeMatchingNominalsEnabled mergeMatchingNominalsEnabled + * + * @return $this + */ + public function setMergeMatchingNominalsEnabled(?bool $mergeMatchingNominalsEnabled): static + { + if (is_null($mergeMatchingNominalsEnabled)) { + throw new InvalidArgumentException('non-nullable mergeMatchingNominalsEnabled cannot be null'); + } + $this->container['mergeMatchingNominalsEnabled'] = $mergeMatchingNominalsEnabled; + + return $this; + } + + /** + * Gets autoCalcBackPayForNewStarters + * + * @return bool|null + */ + public function getAutoCalcBackPayForNewStarters(): ?bool + { + return $this->container['autoCalcBackPayForNewStarters']; + } + + /** + * Sets autoCalcBackPayForNewStarters + * + * @param bool|null $autoCalcBackPayForNewStarters autoCalcBackPayForNewStarters + * + * @return $this + */ + public function setAutoCalcBackPayForNewStarters(?bool $autoCalcBackPayForNewStarters): static + { + if (is_null($autoCalcBackPayForNewStarters)) { + throw new InvalidArgumentException('non-nullable autoCalcBackPayForNewStarters cannot be null'); + } + $this->container['autoCalcBackPayForNewStarters'] = $autoCalcBackPayForNewStarters; + + return $this; + } + + /** + * Gets payCodeValidationEnabled + * + * @return bool|null + */ + public function getPayCodeValidationEnabled(): ?bool + { + return $this->container['payCodeValidationEnabled']; + } + + /** + * Sets payCodeValidationEnabled + * + * @param bool|null $payCodeValidationEnabled payCodeValidationEnabled + * + * @return $this + */ + public function setPayCodeValidationEnabled(?bool $payCodeValidationEnabled): static + { + if (is_null($payCodeValidationEnabled)) { + throw new InvalidArgumentException('non-nullable payCodeValidationEnabled cannot be null'); + } + $this->container['payCodeValidationEnabled'] = $payCodeValidationEnabled; + + return $this; + } + + /** + * Gets calculateEffectiveDateSalaryChanges + * + * @return bool|null + */ + public function getCalculateEffectiveDateSalaryChanges(): ?bool + { + return $this->container['calculateEffectiveDateSalaryChanges']; + } + + /** + * Sets calculateEffectiveDateSalaryChanges + * + * @param bool|null $calculateEffectiveDateSalaryChanges calculateEffectiveDateSalaryChanges + * + * @return $this + */ + public function setCalculateEffectiveDateSalaryChanges(?bool $calculateEffectiveDateSalaryChanges): static + { + if (is_null($calculateEffectiveDateSalaryChanges)) { + throw new InvalidArgumentException('non-nullable calculateEffectiveDateSalaryChanges cannot be null'); + } + $this->container['calculateEffectiveDateSalaryChanges'] = $calculateEffectiveDateSalaryChanges; + + return $this; + } + + /** + * Gets groupPayLinesEnabled + * + * @return bool|null + */ + public function getGroupPayLinesEnabled(): ?bool + { + return $this->container['groupPayLinesEnabled']; + } + + /** + * Sets groupPayLinesEnabled + * + * @param bool|null $groupPayLinesEnabled A flag to indicate whether paylines should be grouped. The grouping is done based on the following PayLine properties: Rate, Multiplier, Code, Description and RoleId + * + * @return $this + */ + public function setGroupPayLinesEnabled(?bool $groupPayLinesEnabled): static + { + if (is_null($groupPayLinesEnabled)) { + throw new InvalidArgumentException('non-nullable groupPayLinesEnabled cannot be null'); + } + $this->container['groupPayLinesEnabled'] = $groupPayLinesEnabled; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks The amount of weeks an employee works, utilise for employees who aren't working full time. This value is the default which can be inherited when creating/updating a WorkingPattern. + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + throw new InvalidArgumentException('non-nullable contractedWeeks cannot be null'); + } + + + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedWeeks + * + * @return float|null + */ + public function getFullTimeContractedWeeks(): ?float + { + return $this->container['fullTimeContractedWeeks']; + } + + /** + * Sets fullTimeContractedWeeks + * + * @param float|null $fullTimeContractedWeeks The amount of weeks an employee works (Full Time). This value is the default which can be inherited when creating/updating a WorkingPattern. + * + * @return $this + */ + public function setFullTimeContractedWeeks(?float $fullTimeContractedWeeks): static + { + if (is_null($fullTimeContractedWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeContractedWeeks cannot be null'); + } + + + $this->container['fullTimeContractedWeeks'] = $fullTimeContractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedHours + * + * @return float|null + */ + public function getFullTimeContractedHours(): ?float + { + return $this->container['fullTimeContractedHours']; + } + + /** + * Sets fullTimeContractedHours + * + * @param float|null $fullTimeContractedHours The amount of hours an employee works (Full Time). This value is the default which can be inherited when creating/updating a WorkingPattern. + * + * @return $this + */ + public function setFullTimeContractedHours(?float $fullTimeContractedHours): static + { + if (is_null($fullTimeContractedHours)) { + throw new InvalidArgumentException('non-nullable fullTimeContractedHours cannot be null'); + } + $this->container['fullTimeContractedHours'] = $fullTimeContractedHours; + + return $this; + } + + /** + * Gets disabledPayRunWarningsList + * + * @return \SynergiTech\Staffology\Model\PayRunEntryWarningType[]|null + */ + public function getDisabledPayRunWarningsList(): ?array + { + return $this->container['disabledPayRunWarningsList']; + } + + /** + * Sets disabledPayRunWarningsList + * + * @param \SynergiTech\Staffology\Model\PayRunEntryWarningType[]|null $disabledPayRunWarningsList Pay run warnings that the user has opted to ignore. + * + * @return $this + */ + public function setDisabledPayRunWarningsList(?array $disabledPayRunWarningsList): static + { + if (is_null($disabledPayRunWarningsList)) { + array_push($this->openAPINullablesSetToNull, 'disabledPayRunWarningsList'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('disabledPayRunWarningsList', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['disabledPayRunWarningsList'] = $disabledPayRunWarningsList; + + return $this; + } + + /** + * Gets journalCsvFormat + * + * @return \SynergiTech\Staffology\Model\JournalCsvFormat|null + */ + public function getJournalCsvFormat(): ?\SynergiTech\Staffology\Model\JournalCsvFormat + { + return $this->container['journalCsvFormat']; + } + + /** + * Sets journalCsvFormat + * + * @param \SynergiTech\Staffology\Model\JournalCsvFormat|null $journalCsvFormat journalCsvFormat + * + * @return $this + */ + public function setJournalCsvFormat(?\SynergiTech\Staffology\Model\JournalCsvFormat $journalCsvFormat): static + { + if (is_null($journalCsvFormat)) { + throw new InvalidArgumentException('non-nullable journalCsvFormat cannot be null'); + } + $this->container['journalCsvFormat'] = $journalCsvFormat; + + return $this; + } + + /** + * Gets preferAsyncPayrunApiCalls + * + * @return bool|null + */ + public function getPreferAsyncPayrunApiCalls(): ?bool + { + return $this->container['preferAsyncPayrunApiCalls']; + } + + /** + * Sets preferAsyncPayrunApiCalls + * + * @param bool|null $preferAsyncPayrunApiCalls This setting is only available temporarily and is only setable by users with access to beta features enabled. If set to true the the web applicaiton will use new async API calls for managing payruns + * + * @return $this + */ + public function setPreferAsyncPayrunApiCalls(?bool $preferAsyncPayrunApiCalls): static + { + if (is_null($preferAsyncPayrunApiCalls)) { + throw new InvalidArgumentException('non-nullable preferAsyncPayrunApiCalls cannot be null'); + } + $this->container['preferAsyncPayrunApiCalls'] = $preferAsyncPayrunApiCalls; + + return $this; + } + + /** + * Gets nominalMappingsEnabled + * + * @return bool|null + */ + public function getNominalMappingsEnabled(): ?bool + { + return $this->container['nominalMappingsEnabled']; + } + + /** + * Sets nominalMappingsEnabled + * + * @param bool|null $nominalMappingsEnabled Enables the nominal mappings(Custom Codes,System Codes,Control Codes,Employer Codes) for the employer, if set to true. + * + * @return $this + */ + public function setNominalMappingsEnabled(?bool $nominalMappingsEnabled): static + { + if (is_null($nominalMappingsEnabled)) { + throw new InvalidArgumentException('non-nullable nominalMappingsEnabled cannot be null'); + } + $this->container['nominalMappingsEnabled'] = $nominalMappingsEnabled; + + return $this; + } + + /** + * Gets sortPayrollNumbersAlphanumerically + * + * @return bool|null + */ + public function getSortPayrollNumbersAlphanumerically(): ?bool + { + return $this->container['sortPayrollNumbersAlphanumerically']; + } + + /** + * Sets sortPayrollNumbersAlphanumerically + * + * @param bool|null $sortPayrollNumbersAlphanumerically Enables the default sorting to be alphanumerically for payroll code, if set to true else numerical sorting will be applied + * + * @return $this + */ + public function setSortPayrollNumbersAlphanumerically(?bool $sortPayrollNumbersAlphanumerically): static + { + if (is_null($sortPayrollNumbersAlphanumerically)) { + throw new InvalidArgumentException('non-nullable sortPayrollNumbersAlphanumerically cannot be null'); + } + $this->container['sortPayrollNumbersAlphanumerically'] = $sortPayrollNumbersAlphanumerically; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerTemplate.php b/src/Model/EmployerTemplate.php new file mode 100644 index 0000000..95e7a54 --- /dev/null +++ b/src/Model/EmployerTemplate.php @@ -0,0 +1,798 @@ + + */ +class EmployerTemplate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmployerTemplate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\EmployerTemplateType', + 'description' => 'string', + 'isCustom' => 'bool', + 'content' => 'string', + 'subject' => 'string', + 'defaultContent' => 'string', + 'defaultSubject' => 'string', + 'hasSubject' => 'bool', + 'tokens' => 'string[]', + 'tokensExpanded' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'description' => null, + 'isCustom' => null, + 'content' => null, + 'subject' => null, + 'defaultContent' => null, + 'defaultSubject' => null, + 'hasSubject' => null, + 'tokens' => null, + 'tokensExpanded' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'description' => true, + 'isCustom' => false, + 'content' => true, + 'subject' => true, + 'defaultContent' => true, + 'defaultSubject' => true, + 'hasSubject' => false, + 'tokens' => true, + 'tokensExpanded' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'description' => 'description', + 'isCustom' => 'isCustom', + 'content' => 'content', + 'subject' => 'subject', + 'defaultContent' => 'defaultContent', + 'defaultSubject' => 'defaultSubject', + 'hasSubject' => 'hasSubject', + 'tokens' => 'tokens', + 'tokensExpanded' => 'tokensExpanded', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'description' => 'setDescription', + 'isCustom' => 'setIsCustom', + 'content' => 'setContent', + 'subject' => 'setSubject', + 'defaultContent' => 'setDefaultContent', + 'defaultSubject' => 'setDefaultSubject', + 'hasSubject' => 'setHasSubject', + 'tokens' => 'setTokens', + 'tokensExpanded' => 'setTokensExpanded', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'description' => 'getDescription', + 'isCustom' => 'getIsCustom', + 'content' => 'getContent', + 'subject' => 'getSubject', + 'defaultContent' => 'getDefaultContent', + 'defaultSubject' => 'getDefaultSubject', + 'hasSubject' => 'getHasSubject', + 'tokens' => 'getTokens', + 'tokensExpanded' => 'getTokensExpanded', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('isCustom', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('defaultContent', $data ?? [], null); + $this->setIfExists('defaultSubject', $data ?? [], null); + $this->setIfExists('hasSubject', $data ?? [], null); + $this->setIfExists('tokens', $data ?? [], null); + $this->setIfExists('tokensExpanded', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 250)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 250."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\EmployerTemplateType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\EmployerTemplateType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\EmployerTemplateType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\EmployerTemplateType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Explains the purpose of this template + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets isCustom + * + * @return bool|null + */ + public function getIsCustom(): ?bool + { + return $this->container['isCustom']; + } + + /** + * Sets isCustom + * + * @param bool|null $isCustom Indicates whether or not this template has been changed from the default content. + * + * @return $this + */ + public function setIsCustom(?bool $isCustom): static + { + if (is_null($isCustom)) { + throw new InvalidArgumentException('non-nullable isCustom cannot be null'); + } + $this->container['isCustom'] = $isCustom; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject(): ?string + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject subject + * + * @return $this + */ + public function setSubject(?string $subject): static + { + if (is_null($subject)) { + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($subject) && (mb_strlen($subject) > 250)) { + throw new InvalidArgumentException('invalid length for $subject when calling EmployerTemplate., must be smaller than or equal to 250.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets defaultContent + * + * @return string|null + */ + public function getDefaultContent(): ?string + { + return $this->container['defaultContent']; + } + + /** + * Sets defaultContent + * + * @param string|null $defaultContent [readonly] The default content for this template + * + * @return $this + */ + public function setDefaultContent(?string $defaultContent): static + { + if (is_null($defaultContent)) { + array_push($this->openAPINullablesSetToNull, 'defaultContent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('defaultContent', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['defaultContent'] = $defaultContent; + + return $this; + } + + /** + * Gets defaultSubject + * + * @return string|null + */ + public function getDefaultSubject(): ?string + { + return $this->container['defaultSubject']; + } + + /** + * Sets defaultSubject + * + * @param string|null $defaultSubject [readonly] The default subject for this template + * + * @return $this + */ + public function setDefaultSubject(?string $defaultSubject): static + { + if (is_null($defaultSubject)) { + array_push($this->openAPINullablesSetToNull, 'defaultSubject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('defaultSubject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['defaultSubject'] = $defaultSubject; + + return $this; + } + + /** + * Gets hasSubject + * + * @return bool|null + */ + public function getHasSubject(): ?bool + { + return $this->container['hasSubject']; + } + + /** + * Sets hasSubject + * + * @param bool|null $hasSubject [readonly] If false then the Subject property is not relevant for this template type + * + * @return $this + */ + public function setHasSubject(?bool $hasSubject): static + { + if (is_null($hasSubject)) { + throw new InvalidArgumentException('non-nullable hasSubject cannot be null'); + } + $this->container['hasSubject'] = $hasSubject; + + return $this; + } + + /** + * Gets tokens + * + * @return string[]|null + */ + public function getTokens(): ?array + { + return $this->container['tokens']; + } + + /** + * Sets tokens + * + * @param string[]|null $tokens [readonly] A list of tokens that can be used with this template. For example, if 'Employee.FirstName' is in the list then use '{Employee.FirstName}' in the Content or Subject and it'll be replaced with the relevant value when the template is parsed. + * + * @return $this + */ + public function setTokens(?array $tokens): static + { + if (is_null($tokens)) { + array_push($this->openAPINullablesSetToNull, 'tokens'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tokens', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tokens'] = $tokens; + + return $this; + } + + /** + * Gets tokensExpanded + * + * @return bool|null + */ + public function getTokensExpanded(): ?bool + { + return $this->container['tokensExpanded']; + } + + /** + * Sets tokensExpanded + * + * @param bool|null $tokensExpanded tokensExpanded + * + * @return $this + */ + public function setTokensExpanded(?bool $tokensExpanded): static + { + if (is_null($tokensExpanded)) { + throw new InvalidArgumentException('non-nullable tokensExpanded cannot be null'); + } + $this->container['tokensExpanded'] = $tokensExpanded; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EmployerTemplateType.php b/src/Model/EmployerTemplateType.php new file mode 100644 index 0000000..ea99ea7 --- /dev/null +++ b/src/Model/EmployerTemplateType.php @@ -0,0 +1,75 @@ + + */ +class EmploymentDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmploymentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'cisSubContractor' => 'bool', + 'payrollCode' => 'string', + 'jobTitle' => 'string', + 'onHold' => 'bool', + 'onFurlough' => 'bool', + 'furloughStart' => '\DateTime', + 'furloughEnd' => '\DateTime', + 'furloughCalculationBasis' => '\SynergiTech\Staffology\Model\FurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'float', + 'partialFurlough' => 'bool', + 'furloughHoursNormallyWorked' => 'float', + 'furloughHoursOnFurlough' => 'float', + 'isApprentice' => 'bool', + 'apprenticeshipStartDate' => '\DateTime', + 'apprenticeshipEndDate' => '\DateTime', + 'workingPattern' => 'string', + 'forcePreviousPayrollCode' => 'string', + 'starterDetails' => '\SynergiTech\Staffology\Model\StarterDetails', + 'directorshipDetails' => '\SynergiTech\Staffology\Model\DirectorshipDetails', + 'leaverDetails' => '\SynergiTech\Staffology\Model\LeaverDetails', + 'cis' => '\SynergiTech\Staffology\Model\CisDetails', + 'department' => '\SynergiTech\Staffology\Model\Department', + 'roles' => '\SynergiTech\Staffology\Model\Item[]', + 'isWorkingInFreePort' => 'bool', + 'veteranDetails' => '\SynergiTech\Staffology\Model\VeteranDetails', + 'continuousEmploymentDate' => '\DateTime', + 'includeSecondedInfoOnStarter' => 'bool', + 'isWorkingInInvestmentZone' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'cisSubContractor' => null, + 'payrollCode' => null, + 'jobTitle' => null, + 'onHold' => null, + 'onFurlough' => null, + 'furloughStart' => 'date', + 'furloughEnd' => 'date', + 'furloughCalculationBasis' => null, + 'furloughCalculationBasisAmount' => 'double', + 'partialFurlough' => null, + 'furloughHoursNormallyWorked' => 'double', + 'furloughHoursOnFurlough' => 'double', + 'isApprentice' => null, + 'apprenticeshipStartDate' => 'date', + 'apprenticeshipEndDate' => 'date', + 'workingPattern' => 'uuid', + 'forcePreviousPayrollCode' => null, + 'starterDetails' => null, + 'directorshipDetails' => null, + 'leaverDetails' => null, + 'cis' => null, + 'department' => null, + 'roles' => null, + 'isWorkingInFreePort' => null, + 'veteranDetails' => null, + 'continuousEmploymentDate' => 'date', + 'includeSecondedInfoOnStarter' => null, + 'isWorkingInInvestmentZone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'cisSubContractor' => false, + 'payrollCode' => false, + 'jobTitle' => true, + 'onHold' => false, + 'onFurlough' => false, + 'furloughStart' => true, + 'furloughEnd' => true, + 'furloughCalculationBasis' => false, + 'furloughCalculationBasisAmount' => false, + 'partialFurlough' => false, + 'furloughHoursNormallyWorked' => false, + 'furloughHoursOnFurlough' => false, + 'isApprentice' => false, + 'apprenticeshipStartDate' => true, + 'apprenticeshipEndDate' => true, + 'workingPattern' => true, + 'forcePreviousPayrollCode' => true, + 'starterDetails' => false, + 'directorshipDetails' => false, + 'leaverDetails' => false, + 'cis' => false, + 'department' => false, + 'roles' => true, + 'isWorkingInFreePort' => false, + 'veteranDetails' => false, + 'continuousEmploymentDate' => true, + 'includeSecondedInfoOnStarter' => false, + 'isWorkingInInvestmentZone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'cisSubContractor' => 'cisSubContractor', + 'payrollCode' => 'payrollCode', + 'jobTitle' => 'jobTitle', + 'onHold' => 'onHold', + 'onFurlough' => 'onFurlough', + 'furloughStart' => 'furloughStart', + 'furloughEnd' => 'furloughEnd', + 'furloughCalculationBasis' => 'furloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'furloughCalculationBasisAmount', + 'partialFurlough' => 'partialFurlough', + 'furloughHoursNormallyWorked' => 'furloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'furloughHoursOnFurlough', + 'isApprentice' => 'isApprentice', + 'apprenticeshipStartDate' => 'apprenticeshipStartDate', + 'apprenticeshipEndDate' => 'apprenticeshipEndDate', + 'workingPattern' => 'workingPattern', + 'forcePreviousPayrollCode' => 'forcePreviousPayrollCode', + 'starterDetails' => 'starterDetails', + 'directorshipDetails' => 'directorshipDetails', + 'leaverDetails' => 'leaverDetails', + 'cis' => 'cis', + 'department' => 'department', + 'roles' => 'roles', + 'isWorkingInFreePort' => 'isWorkingInFreePort', + 'veteranDetails' => 'veteranDetails', + 'continuousEmploymentDate' => 'continuousEmploymentDate', + 'includeSecondedInfoOnStarter' => 'includeSecondedInfoOnStarter', + 'isWorkingInInvestmentZone' => 'isWorkingInInvestmentZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'cisSubContractor' => 'setCisSubContractor', + 'payrollCode' => 'setPayrollCode', + 'jobTitle' => 'setJobTitle', + 'onHold' => 'setOnHold', + 'onFurlough' => 'setOnFurlough', + 'furloughStart' => 'setFurloughStart', + 'furloughEnd' => 'setFurloughEnd', + 'furloughCalculationBasis' => 'setFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'setFurloughCalculationBasisAmount', + 'partialFurlough' => 'setPartialFurlough', + 'furloughHoursNormallyWorked' => 'setFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'setFurloughHoursOnFurlough', + 'isApprentice' => 'setIsApprentice', + 'apprenticeshipStartDate' => 'setApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'setApprenticeshipEndDate', + 'workingPattern' => 'setWorkingPattern', + 'forcePreviousPayrollCode' => 'setForcePreviousPayrollCode', + 'starterDetails' => 'setStarterDetails', + 'directorshipDetails' => 'setDirectorshipDetails', + 'leaverDetails' => 'setLeaverDetails', + 'cis' => 'setCis', + 'department' => 'setDepartment', + 'roles' => 'setRoles', + 'isWorkingInFreePort' => 'setIsWorkingInFreePort', + 'veteranDetails' => 'setVeteranDetails', + 'continuousEmploymentDate' => 'setContinuousEmploymentDate', + 'includeSecondedInfoOnStarter' => 'setIncludeSecondedInfoOnStarter', + 'isWorkingInInvestmentZone' => 'setIsWorkingInInvestmentZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'cisSubContractor' => 'getCisSubContractor', + 'payrollCode' => 'getPayrollCode', + 'jobTitle' => 'getJobTitle', + 'onHold' => 'getOnHold', + 'onFurlough' => 'getOnFurlough', + 'furloughStart' => 'getFurloughStart', + 'furloughEnd' => 'getFurloughEnd', + 'furloughCalculationBasis' => 'getFurloughCalculationBasis', + 'furloughCalculationBasisAmount' => 'getFurloughCalculationBasisAmount', + 'partialFurlough' => 'getPartialFurlough', + 'furloughHoursNormallyWorked' => 'getFurloughHoursNormallyWorked', + 'furloughHoursOnFurlough' => 'getFurloughHoursOnFurlough', + 'isApprentice' => 'getIsApprentice', + 'apprenticeshipStartDate' => 'getApprenticeshipStartDate', + 'apprenticeshipEndDate' => 'getApprenticeshipEndDate', + 'workingPattern' => 'getWorkingPattern', + 'forcePreviousPayrollCode' => 'getForcePreviousPayrollCode', + 'starterDetails' => 'getStarterDetails', + 'directorshipDetails' => 'getDirectorshipDetails', + 'leaverDetails' => 'getLeaverDetails', + 'cis' => 'getCis', + 'department' => 'getDepartment', + 'roles' => 'getRoles', + 'isWorkingInFreePort' => 'getIsWorkingInFreePort', + 'veteranDetails' => 'getVeteranDetails', + 'continuousEmploymentDate' => 'getContinuousEmploymentDate', + 'includeSecondedInfoOnStarter' => 'getIncludeSecondedInfoOnStarter', + 'isWorkingInInvestmentZone' => 'getIsWorkingInInvestmentZone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cisSubContractor', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('onHold', $data ?? [], null); + $this->setIfExists('onFurlough', $data ?? [], null); + $this->setIfExists('furloughStart', $data ?? [], null); + $this->setIfExists('furloughEnd', $data ?? [], null); + $this->setIfExists('furloughCalculationBasis', $data ?? [], null); + $this->setIfExists('furloughCalculationBasisAmount', $data ?? [], null); + $this->setIfExists('partialFurlough', $data ?? [], null); + $this->setIfExists('furloughHoursNormallyWorked', $data ?? [], null); + $this->setIfExists('furloughHoursOnFurlough', $data ?? [], null); + $this->setIfExists('isApprentice', $data ?? [], null); + $this->setIfExists('apprenticeshipStartDate', $data ?? [], null); + $this->setIfExists('apprenticeshipEndDate', $data ?? [], null); + $this->setIfExists('workingPattern', $data ?? [], null); + $this->setIfExists('forcePreviousPayrollCode', $data ?? [], null); + $this->setIfExists('starterDetails', $data ?? [], null); + $this->setIfExists('directorshipDetails', $data ?? [], null); + $this->setIfExists('leaverDetails', $data ?? [], null); + $this->setIfExists('cis', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('isWorkingInFreePort', $data ?? [], null); + $this->setIfExists('veteranDetails', $data ?? [], null); + $this->setIfExists('continuousEmploymentDate', $data ?? [], null); + $this->setIfExists('includeSecondedInfoOnStarter', $data ?? [], null); + $this->setIfExists('isWorkingInInvestmentZone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['payrollCode'] === null) { + $invalidProperties[] = "'payrollCode' can't be null"; + } + if ((mb_strlen($this->container['payrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be smaller than or equal to 35."; + } + + if ((mb_strlen($this->container['payrollCode']) < 1)) { + $invalidProperties[] = "invalid value for 'payrollCode', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['jobTitle']) && (mb_strlen($this->container['jobTitle']) > 120)) { + $invalidProperties[] = "invalid value for 'jobTitle', the character length must be smaller than or equal to 120."; + } + + if (!is_null($this->container['forcePreviousPayrollCode']) && (mb_strlen($this->container['forcePreviousPayrollCode']) > 35)) { + $invalidProperties[] = "invalid value for 'forcePreviousPayrollCode', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cisSubContractor + * + * @return bool|null + */ + public function getCisSubContractor(): ?bool + { + return $this->container['cisSubContractor']; + } + + /** + * Sets cisSubContractor + * + * @param bool|null $cisSubContractor Set to True if this Employee is a CIS Subcontractor. The ```Cis``` property contains further information + * + * @return $this + */ + public function setCisSubContractor(?bool $cisSubContractor): static + { + if (is_null($cisSubContractor)) { + throw new InvalidArgumentException('non-nullable cisSubContractor cannot be null'); + } + $this->container['cisSubContractor'] = $cisSubContractor; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string + */ + public function getPayrollCode(): string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string $payrollCode The Employees Payroll Code. Must be unique within the Employer. + * + * @return $this + */ + public function setPayrollCode(string $payrollCode): static + { + if (is_null($payrollCode)) { + throw new InvalidArgumentException('non-nullable payrollCode cannot be null'); + } + if ((mb_strlen($payrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling EmploymentDetails., must be smaller than or equal to 35.'); + } + if ((mb_strlen($payrollCode) < 1)) { + throw new InvalidArgumentException('invalid length for $payrollCode when calling EmploymentDetails., must be bigger than or equal to 1.'); + } + + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle Job Title of Primary role of the Employee + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($jobTitle) && (mb_strlen($jobTitle) > 120)) { + throw new InvalidArgumentException('invalid length for $jobTitle when calling EmploymentDetails., must be smaller than or equal to 120.'); + } + + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets onHold + * + * @return bool|null + */ + public function getOnHold(): ?bool + { + return $this->container['onHold']; + } + + /** + * Sets onHold + * + * @param bool|null $onHold Set to true to temporarily exclude the employee from payruns + * + * @return $this + */ + public function setOnHold(?bool $onHold): static + { + if (is_null($onHold)) { + throw new InvalidArgumentException('non-nullable onHold cannot be null'); + } + $this->container['onHold'] = $onHold; + + return $this; + } + + /** + * Gets onFurlough + * + * @return bool|null + */ + public function getOnFurlough(): ?bool + { + return $this->container['onFurlough']; + } + + /** + * Sets onFurlough + * + * @param bool|null $onFurlough Set to true if the employee is on furlough. + * + * @return $this + */ + public function setOnFurlough(?bool $onFurlough): static + { + if (is_null($onFurlough)) { + throw new InvalidArgumentException('non-nullable onFurlough cannot be null'); + } + $this->container['onFurlough'] = $onFurlough; + + return $this; + } + + /** + * Gets furloughStart + * + * @return \DateTime|null + */ + public function getFurloughStart(): ?\DateTime + { + return $this->container['furloughStart']; + } + + /** + * Sets furloughStart + * + * @param \DateTime|null $furloughStart Furlough Start Date. + * + * @return $this + */ + public function setFurloughStart(?\DateTime $furloughStart): static + { + if (is_null($furloughStart)) { + array_push($this->openAPINullablesSetToNull, 'furloughStart'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughStart', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughStart'] = $furloughStart; + + return $this; + } + + /** + * Gets furloughEnd + * + * @return \DateTime|null + */ + public function getFurloughEnd(): ?\DateTime + { + return $this->container['furloughEnd']; + } + + /** + * Sets furloughEnd + * + * @param \DateTime|null $furloughEnd Furlough End Date. + * + * @return $this + */ + public function setFurloughEnd(?\DateTime $furloughEnd): static + { + if (is_null($furloughEnd)) { + array_push($this->openAPINullablesSetToNull, 'furloughEnd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughEnd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughEnd'] = $furloughEnd; + + return $this; + } + + /** + * Gets furloughCalculationBasis + * + * @return \SynergiTech\Staffology\Model\FurloughCalculationBasis|null + */ + public function getFurloughCalculationBasis(): ?\SynergiTech\Staffology\Model\FurloughCalculationBasis + { + return $this->container['furloughCalculationBasis']; + } + + /** + * Sets furloughCalculationBasis + * + * @param \SynergiTech\Staffology\Model\FurloughCalculationBasis|null $furloughCalculationBasis furloughCalculationBasis + * + * @return $this + */ + public function setFurloughCalculationBasis(?\SynergiTech\Staffology\Model\FurloughCalculationBasis $furloughCalculationBasis): static + { + if (is_null($furloughCalculationBasis)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasis cannot be null'); + } + $this->container['furloughCalculationBasis'] = $furloughCalculationBasis; + + return $this; + } + + /** + * Gets furloughCalculationBasisAmount + * + * @return float|null + */ + public function getFurloughCalculationBasisAmount(): ?float + { + return $this->container['furloughCalculationBasisAmount']; + } + + /** + * Sets furloughCalculationBasisAmount + * + * @param float|null $furloughCalculationBasisAmount furloughCalculationBasisAmount + * + * @return $this + */ + public function setFurloughCalculationBasisAmount(?float $furloughCalculationBasisAmount): static + { + if (is_null($furloughCalculationBasisAmount)) { + throw new InvalidArgumentException('non-nullable furloughCalculationBasisAmount cannot be null'); + } + $this->container['furloughCalculationBasisAmount'] = $furloughCalculationBasisAmount; + + return $this; + } + + /** + * Gets partialFurlough + * + * @return bool|null + */ + public function getPartialFurlough(): ?bool + { + return $this->container['partialFurlough']; + } + + /** + * Sets partialFurlough + * + * @param bool|null $partialFurlough Set to true if the employee is partially furloughed. + * + * @return $this + */ + public function setPartialFurlough(?bool $partialFurlough): static + { + if (is_null($partialFurlough)) { + throw new InvalidArgumentException('non-nullable partialFurlough cannot be null'); + } + $this->container['partialFurlough'] = $partialFurlough; + + return $this; + } + + /** + * Gets furloughHoursNormallyWorked + * + * @return float|null + */ + public function getFurloughHoursNormallyWorked(): ?float + { + return $this->container['furloughHoursNormallyWorked']; + } + + /** + * Sets furloughHoursNormallyWorked + * + * @param float|null $furloughHoursNormallyWorked furloughHoursNormallyWorked + * + * @return $this + */ + public function setFurloughHoursNormallyWorked(?float $furloughHoursNormallyWorked): static + { + if (is_null($furloughHoursNormallyWorked)) { + throw new InvalidArgumentException('non-nullable furloughHoursNormallyWorked cannot be null'); + } + $this->container['furloughHoursNormallyWorked'] = $furloughHoursNormallyWorked; + + return $this; + } + + /** + * Gets furloughHoursOnFurlough + * + * @return float|null + */ + public function getFurloughHoursOnFurlough(): ?float + { + return $this->container['furloughHoursOnFurlough']; + } + + /** + * Sets furloughHoursOnFurlough + * + * @param float|null $furloughHoursOnFurlough furloughHoursOnFurlough + * + * @return $this + */ + public function setFurloughHoursOnFurlough(?float $furloughHoursOnFurlough): static + { + if (is_null($furloughHoursOnFurlough)) { + throw new InvalidArgumentException('non-nullable furloughHoursOnFurlough cannot be null'); + } + $this->container['furloughHoursOnFurlough'] = $furloughHoursOnFurlough; + + return $this; + } + + /** + * Gets isApprentice + * + * @return bool|null + */ + public function getIsApprentice(): ?bool + { + return $this->container['isApprentice']; + } + + /** + * Sets isApprentice + * + * @param bool|null $isApprentice Set to True if this Employee is an apprentice. This affects the calculations for National Minimum Wage + * + * @return $this + */ + public function setIsApprentice(?bool $isApprentice): static + { + if (is_null($isApprentice)) { + throw new InvalidArgumentException('non-nullable isApprentice cannot be null'); + } + $this->container['isApprentice'] = $isApprentice; + + return $this; + } + + /** + * Gets apprenticeshipStartDate + * + * @return \DateTime|null + */ + public function getApprenticeshipStartDate(): ?\DateTime + { + return $this->container['apprenticeshipStartDate']; + } + + /** + * Sets apprenticeshipStartDate + * + * @param \DateTime|null $apprenticeshipStartDate apprenticeshipStartDate + * + * @return $this + */ + public function setApprenticeshipStartDate(?\DateTime $apprenticeshipStartDate): static + { + if (is_null($apprenticeshipStartDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipStartDate'] = $apprenticeshipStartDate; + + return $this; + } + + /** + * Gets apprenticeshipEndDate + * + * @return \DateTime|null + */ + public function getApprenticeshipEndDate(): ?\DateTime + { + return $this->container['apprenticeshipEndDate']; + } + + /** + * Sets apprenticeshipEndDate + * + * @param \DateTime|null $apprenticeshipEndDate apprenticeshipEndDate + * + * @return $this + */ + public function setApprenticeshipEndDate(?\DateTime $apprenticeshipEndDate): static + { + if (is_null($apprenticeshipEndDate)) { + array_push($this->openAPINullablesSetToNull, 'apprenticeshipEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprenticeshipEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprenticeshipEndDate'] = $apprenticeshipEndDate; + + return $this; + } + + /** + * Gets workingPattern + * + * @return string|null + */ + public function getWorkingPattern(): ?string + { + return $this->container['workingPattern']; + } + + /** + * Sets workingPattern + * + * @param string|null $workingPattern Used when calculating payments for Leave. If null then the default Working Pattern is used + * + * @return $this + */ + public function setWorkingPattern(?string $workingPattern): static + { + if (is_null($workingPattern)) { + array_push($this->openAPINullablesSetToNull, 'workingPattern'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workingPattern', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workingPattern'] = $workingPattern; + + return $this; + } + + /** + * Gets forcePreviousPayrollCode + * + * @return string|null + */ + public function getForcePreviousPayrollCode(): ?string + { + return $this->container['forcePreviousPayrollCode']; + } + + /** + * Sets forcePreviousPayrollCode + * + * @param string|null $forcePreviousPayrollCode If this property has a non-empty value then a change of Payroll code will be declared on the next FPS. + * + * @return $this + */ + public function setForcePreviousPayrollCode(?string $forcePreviousPayrollCode): static + { + if (is_null($forcePreviousPayrollCode)) { + array_push($this->openAPINullablesSetToNull, 'forcePreviousPayrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcePreviousPayrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($forcePreviousPayrollCode) && (mb_strlen($forcePreviousPayrollCode) > 35)) { + throw new InvalidArgumentException('invalid length for $forcePreviousPayrollCode when calling EmploymentDetails., must be smaller than or equal to 35.'); + } + + $this->container['forcePreviousPayrollCode'] = $forcePreviousPayrollCode; + + return $this; + } + + /** + * Gets starterDetails + * + * @return \SynergiTech\Staffology\Model\StarterDetails|null + */ + public function getStarterDetails(): ?\SynergiTech\Staffology\Model\StarterDetails + { + return $this->container['starterDetails']; + } + + /** + * Sets starterDetails + * + * @param \SynergiTech\Staffology\Model\StarterDetails|null $starterDetails starterDetails + * + * @return $this + */ + public function setStarterDetails(?\SynergiTech\Staffology\Model\StarterDetails $starterDetails): static + { + if (is_null($starterDetails)) { + throw new InvalidArgumentException('non-nullable starterDetails cannot be null'); + } + $this->container['starterDetails'] = $starterDetails; + + return $this; + } + + /** + * Gets directorshipDetails + * + * @return \SynergiTech\Staffology\Model\DirectorshipDetails|null + */ + public function getDirectorshipDetails(): ?\SynergiTech\Staffology\Model\DirectorshipDetails + { + return $this->container['directorshipDetails']; + } + + /** + * Sets directorshipDetails + * + * @param \SynergiTech\Staffology\Model\DirectorshipDetails|null $directorshipDetails directorshipDetails + * + * @return $this + */ + public function setDirectorshipDetails(?\SynergiTech\Staffology\Model\DirectorshipDetails $directorshipDetails): static + { + if (is_null($directorshipDetails)) { + throw new InvalidArgumentException('non-nullable directorshipDetails cannot be null'); + } + $this->container['directorshipDetails'] = $directorshipDetails; + + return $this; + } + + /** + * Gets leaverDetails + * + * @return \SynergiTech\Staffology\Model\LeaverDetails|null + */ + public function getLeaverDetails(): ?\SynergiTech\Staffology\Model\LeaverDetails + { + return $this->container['leaverDetails']; + } + + /** + * Sets leaverDetails + * + * @param \SynergiTech\Staffology\Model\LeaverDetails|null $leaverDetails leaverDetails + * + * @return $this + */ + public function setLeaverDetails(?\SynergiTech\Staffology\Model\LeaverDetails $leaverDetails): static + { + if (is_null($leaverDetails)) { + throw new InvalidArgumentException('non-nullable leaverDetails cannot be null'); + } + $this->container['leaverDetails'] = $leaverDetails; + + return $this; + } + + /** + * Gets cis + * + * @return \SynergiTech\Staffology\Model\CisDetails|null + */ + public function getCis(): ?\SynergiTech\Staffology\Model\CisDetails + { + return $this->container['cis']; + } + + /** + * Sets cis + * + * @param \SynergiTech\Staffology\Model\CisDetails|null $cis cis + * + * @return $this + */ + public function setCis(?\SynergiTech\Staffology\Model\CisDetails $cis): static + { + if (is_null($cis)) { + throw new InvalidArgumentException('non-nullable cis cannot be null'); + } + $this->container['cis'] = $cis; + + return $this; + } + + /** + * Gets department + * + * @return \SynergiTech\Staffology\Model\Department|null + */ + public function getDepartment(): ?\SynergiTech\Staffology\Model\Department + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param \SynergiTech\Staffology\Model\Department|null $department department + * + * @return $this + */ + public function setDepartment(?\SynergiTech\Staffology\Model\Department $department): static + { + if (is_null($department)) { + throw new InvalidArgumentException('non-nullable department cannot be null'); + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets roles + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getRoles(): ?array + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param \SynergiTech\Staffology\Model\Item[]|null $roles List of Roles held by Employee + * + * @return $this + */ + public function setRoles(?array $roles): static + { + if (is_null($roles)) { + array_push($this->openAPINullablesSetToNull, 'roles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets isWorkingInFreePort + * + * @return bool|null + */ + public function getIsWorkingInFreePort(): ?bool + { + return $this->container['isWorkingInFreePort']; + } + + /** + * Sets isWorkingInFreePort + * + * @param bool|null $isWorkingInFreePort Flag indicating the employee is employed in a Freeport + * + * @return $this + */ + public function setIsWorkingInFreePort(?bool $isWorkingInFreePort): static + { + if (is_null($isWorkingInFreePort)) { + throw new InvalidArgumentException('non-nullable isWorkingInFreePort cannot be null'); + } + $this->container['isWorkingInFreePort'] = $isWorkingInFreePort; + + return $this; + } + + /** + * Gets veteranDetails + * + * @return \SynergiTech\Staffology\Model\VeteranDetails|null + */ + public function getVeteranDetails(): ?\SynergiTech\Staffology\Model\VeteranDetails + { + return $this->container['veteranDetails']; + } + + /** + * Sets veteranDetails + * + * @param \SynergiTech\Staffology\Model\VeteranDetails|null $veteranDetails veteranDetails + * + * @return $this + */ + public function setVeteranDetails(?\SynergiTech\Staffology\Model\VeteranDetails $veteranDetails): static + { + if (is_null($veteranDetails)) { + throw new InvalidArgumentException('non-nullable veteranDetails cannot be null'); + } + $this->container['veteranDetails'] = $veteranDetails; + + return $this; + } + + /** + * Gets continuousEmploymentDate + * + * @return \DateTime|null + */ + public function getContinuousEmploymentDate(): ?\DateTime + { + return $this->container['continuousEmploymentDate']; + } + + /** + * Sets continuousEmploymentDate + * + * @param \DateTime|null $continuousEmploymentDate [readonly] Continuous employment date for the occupational scheme. + * + * @return $this + */ + public function setContinuousEmploymentDate(?\DateTime $continuousEmploymentDate): static + { + if (is_null($continuousEmploymentDate)) { + array_push($this->openAPINullablesSetToNull, 'continuousEmploymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('continuousEmploymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['continuousEmploymentDate'] = $continuousEmploymentDate; + + return $this; + } + + /** + * Gets includeSecondedInfoOnStarter + * + * @return bool|null + */ + public function getIncludeSecondedInfoOnStarter(): ?bool + { + return $this->container['includeSecondedInfoOnStarter']; + } + + /** + * Sets includeSecondedInfoOnStarter + * + * @param bool|null $includeSecondedInfoOnStarter [readonly] If true then include seconded information on starter of FPS + * + * @return $this + */ + public function setIncludeSecondedInfoOnStarter(?bool $includeSecondedInfoOnStarter): static + { + if (is_null($includeSecondedInfoOnStarter)) { + throw new InvalidArgumentException('non-nullable includeSecondedInfoOnStarter cannot be null'); + } + $this->container['includeSecondedInfoOnStarter'] = $includeSecondedInfoOnStarter; + + return $this; + } + + /** + * Gets isWorkingInInvestmentZone + * + * @return bool|null + */ + public function getIsWorkingInInvestmentZone(): ?bool + { + return $this->container['isWorkingInInvestmentZone']; + } + + /** + * Sets isWorkingInInvestmentZone + * + * @param bool|null $isWorkingInInvestmentZone Flag indicating the employee is employed in an Investment Zone + * + * @return $this + */ + public function setIsWorkingInInvestmentZone(?bool $isWorkingInInvestmentZone): static + { + if (is_null($isWorkingInInvestmentZone)) { + throw new InvalidArgumentException('non-nullable isWorkingInInvestmentZone cannot be null'); + } + $this->container['isWorkingInInvestmentZone'] = $isWorkingInInvestmentZone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EntitlementBand.php b/src/Model/EntitlementBand.php new file mode 100644 index 0000000..7215e29 --- /dev/null +++ b/src/Model/EntitlementBand.php @@ -0,0 +1,544 @@ + + */ +class EntitlementBand implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EntitlementBand'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'percentOfPay' => 'float', + 'period' => 'int', + 'paySspInAddition' => 'bool', + 'order' => 'int', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'percentOfPay' => 'double', + 'period' => 'int32', + 'paySspInAddition' => null, + 'order' => 'int32', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'percentOfPay' => false, + 'period' => false, + 'paySspInAddition' => false, + 'order' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'percentOfPay' => 'percentOfPay', + 'period' => 'period', + 'paySspInAddition' => 'paySspInAddition', + 'order' => 'order', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'percentOfPay' => 'setPercentOfPay', + 'period' => 'setPeriod', + 'paySspInAddition' => 'setPaySspInAddition', + 'order' => 'setOrder', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'percentOfPay' => 'getPercentOfPay', + 'period' => 'getPeriod', + 'paySspInAddition' => 'getPaySspInAddition', + 'order' => 'getOrder', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('percentOfPay', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('paySspInAddition', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets percentOfPay + * + * @return float|null + */ + public function getPercentOfPay(): ?float + { + return $this->container['percentOfPay']; + } + + /** + * Sets percentOfPay + * + * @param float|null $percentOfPay percentOfPay + * + * @return $this + */ + public function setPercentOfPay(?float $percentOfPay): static + { + if (is_null($percentOfPay)) { + throw new InvalidArgumentException('non-nullable percentOfPay cannot be null'); + } + $this->container['percentOfPay'] = $percentOfPay; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets paySspInAddition + * + * @return bool|null + */ + public function getPaySspInAddition(): ?bool + { + return $this->container['paySspInAddition']; + } + + /** + * Sets paySspInAddition + * + * @param bool|null $paySspInAddition paySspInAddition + * + * @return $this + */ + public function setPaySspInAddition(?bool $paySspInAddition): static + { + if (is_null($paySspInAddition)) { + throw new InvalidArgumentException('non-nullable paySspInAddition cannot be null'); + } + $this->container['paySspInAddition'] = $paySspInAddition; + + return $this; + } + + /** + * Gets order + * + * @return int|null + */ + public function getOrder(): ?int + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param int|null $order order + * + * @return $this + */ + public function setOrder(?int $order): static + { + if (is_null($order)) { + throw new InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EntityType.php b/src/Model/EntityType.php new file mode 100644 index 0000000..82660eb --- /dev/null +++ b/src/Model/EntityType.php @@ -0,0 +1,91 @@ + + */ +class Eps implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Eps'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'periodOfInactivity' => '\SynergiTech\Staffology\Model\FromToDates', + 'noPaymentForPeriod' => '\SynergiTech\Staffology\Model\FromToDates', + 'finalSubmission' => '\SynergiTech\Staffology\Model\EpsFinalSubmission', + 'recoverableAmounts' => '\SynergiTech\Staffology\Model\RecoverableAmounts', + 'apprenticeshipLevy' => '\SynergiTech\Staffology\Model\EpsApprenticeshipLevy', + 'account' => '\SynergiTech\Staffology\Model\EpsAccount', + 'eligibleForEmploymentAllowance' => 'bool', + 'deMinimisStateAid' => '\SynergiTech\Staffology\Model\EpsDeMinimisStateAid', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'periodOfInactivity' => null, + 'noPaymentForPeriod' => null, + 'finalSubmission' => null, + 'recoverableAmounts' => null, + 'apprenticeshipLevy' => null, + 'account' => null, + 'eligibleForEmploymentAllowance' => null, + 'deMinimisStateAid' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'periodOfInactivity' => false, + 'noPaymentForPeriod' => false, + 'finalSubmission' => false, + 'recoverableAmounts' => false, + 'apprenticeshipLevy' => false, + 'account' => false, + 'eligibleForEmploymentAllowance' => true, + 'deMinimisStateAid' => false, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'periodOfInactivity' => 'periodOfInactivity', + 'noPaymentForPeriod' => 'noPaymentForPeriod', + 'finalSubmission' => 'finalSubmission', + 'recoverableAmounts' => 'recoverableAmounts', + 'apprenticeshipLevy' => 'apprenticeshipLevy', + 'account' => 'account', + 'eligibleForEmploymentAllowance' => 'eligibleForEmploymentAllowance', + 'deMinimisStateAid' => 'deMinimisStateAid', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'periodOfInactivity' => 'setPeriodOfInactivity', + 'noPaymentForPeriod' => 'setNoPaymentForPeriod', + 'finalSubmission' => 'setFinalSubmission', + 'recoverableAmounts' => 'setRecoverableAmounts', + 'apprenticeshipLevy' => 'setApprenticeshipLevy', + 'account' => 'setAccount', + 'eligibleForEmploymentAllowance' => 'setEligibleForEmploymentAllowance', + 'deMinimisStateAid' => 'setDeMinimisStateAid', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'periodOfInactivity' => 'getPeriodOfInactivity', + 'noPaymentForPeriod' => 'getNoPaymentForPeriod', + 'finalSubmission' => 'getFinalSubmission', + 'recoverableAmounts' => 'getRecoverableAmounts', + 'apprenticeshipLevy' => 'getApprenticeshipLevy', + 'account' => 'getAccount', + 'eligibleForEmploymentAllowance' => 'getEligibleForEmploymentAllowance', + 'deMinimisStateAid' => 'getDeMinimisStateAid', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('periodOfInactivity', $data ?? [], null); + $this->setIfExists('noPaymentForPeriod', $data ?? [], null); + $this->setIfExists('finalSubmission', $data ?? [], null); + $this->setIfExists('recoverableAmounts', $data ?? [], null); + $this->setIfExists('apprenticeshipLevy', $data ?? [], null); + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('eligibleForEmploymentAllowance', $data ?? [], null); + $this->setIfExists('deMinimisStateAid', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets periodOfInactivity + * + * @return \SynergiTech\Staffology\Model\FromToDates|null + */ + public function getPeriodOfInactivity(): ?\SynergiTech\Staffology\Model\FromToDates + { + return $this->container['periodOfInactivity']; + } + + /** + * Sets periodOfInactivity + * + * @param \SynergiTech\Staffology\Model\FromToDates|null $periodOfInactivity periodOfInactivity + * + * @return $this + */ + public function setPeriodOfInactivity(?\SynergiTech\Staffology\Model\FromToDates $periodOfInactivity): static + { + if (is_null($periodOfInactivity)) { + throw new InvalidArgumentException('non-nullable periodOfInactivity cannot be null'); + } + $this->container['periodOfInactivity'] = $periodOfInactivity; + + return $this; + } + + /** + * Gets noPaymentForPeriod + * + * @return \SynergiTech\Staffology\Model\FromToDates|null + */ + public function getNoPaymentForPeriod(): ?\SynergiTech\Staffology\Model\FromToDates + { + return $this->container['noPaymentForPeriod']; + } + + /** + * Sets noPaymentForPeriod + * + * @param \SynergiTech\Staffology\Model\FromToDates|null $noPaymentForPeriod noPaymentForPeriod + * + * @return $this + */ + public function setNoPaymentForPeriod(?\SynergiTech\Staffology\Model\FromToDates $noPaymentForPeriod): static + { + if (is_null($noPaymentForPeriod)) { + throw new InvalidArgumentException('non-nullable noPaymentForPeriod cannot be null'); + } + $this->container['noPaymentForPeriod'] = $noPaymentForPeriod; + + return $this; + } + + /** + * Gets finalSubmission + * + * @return \SynergiTech\Staffology\Model\EpsFinalSubmission|null + */ + public function getFinalSubmission(): ?\SynergiTech\Staffology\Model\EpsFinalSubmission + { + return $this->container['finalSubmission']; + } + + /** + * Sets finalSubmission + * + * @param \SynergiTech\Staffology\Model\EpsFinalSubmission|null $finalSubmission finalSubmission + * + * @return $this + */ + public function setFinalSubmission(?\SynergiTech\Staffology\Model\EpsFinalSubmission $finalSubmission): static + { + if (is_null($finalSubmission)) { + throw new InvalidArgumentException('non-nullable finalSubmission cannot be null'); + } + $this->container['finalSubmission'] = $finalSubmission; + + return $this; + } + + /** + * Gets recoverableAmounts + * + * @return \SynergiTech\Staffology\Model\RecoverableAmounts|null + */ + public function getRecoverableAmounts(): ?\SynergiTech\Staffology\Model\RecoverableAmounts + { + return $this->container['recoverableAmounts']; + } + + /** + * Sets recoverableAmounts + * + * @param \SynergiTech\Staffology\Model\RecoverableAmounts|null $recoverableAmounts recoverableAmounts + * + * @return $this + */ + public function setRecoverableAmounts(?\SynergiTech\Staffology\Model\RecoverableAmounts $recoverableAmounts): static + { + if (is_null($recoverableAmounts)) { + throw new InvalidArgumentException('non-nullable recoverableAmounts cannot be null'); + } + $this->container['recoverableAmounts'] = $recoverableAmounts; + + return $this; + } + + /** + * Gets apprenticeshipLevy + * + * @return \SynergiTech\Staffology\Model\EpsApprenticeshipLevy|null + */ + public function getApprenticeshipLevy(): ?\SynergiTech\Staffology\Model\EpsApprenticeshipLevy + { + return $this->container['apprenticeshipLevy']; + } + + /** + * Sets apprenticeshipLevy + * + * @param \SynergiTech\Staffology\Model\EpsApprenticeshipLevy|null $apprenticeshipLevy apprenticeshipLevy + * + * @return $this + */ + public function setApprenticeshipLevy(?\SynergiTech\Staffology\Model\EpsApprenticeshipLevy $apprenticeshipLevy): static + { + if (is_null($apprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevy cannot be null'); + } + $this->container['apprenticeshipLevy'] = $apprenticeshipLevy; + + return $this; + } + + /** + * Gets account + * + * @return \SynergiTech\Staffology\Model\EpsAccount|null + */ + public function getAccount(): ?\SynergiTech\Staffology\Model\EpsAccount + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param \SynergiTech\Staffology\Model\EpsAccount|null $account account + * + * @return $this + */ + public function setAccount(?\SynergiTech\Staffology\Model\EpsAccount $account): static + { + if (is_null($account)) { + throw new InvalidArgumentException('non-nullable account cannot be null'); + } + $this->container['account'] = $account; + + return $this; + } + + /** + * Gets eligibleForEmploymentAllowance + * + * @return bool|null + */ + public function getEligibleForEmploymentAllowance(): ?bool + { + return $this->container['eligibleForEmploymentAllowance']; + } + + /** + * Sets eligibleForEmploymentAllowance + * + * @param bool|null $eligibleForEmploymentAllowance eligibleForEmploymentAllowance + * + * @return $this + */ + public function setEligibleForEmploymentAllowance(?bool $eligibleForEmploymentAllowance): static + { + if (is_null($eligibleForEmploymentAllowance)) { + array_push($this->openAPINullablesSetToNull, 'eligibleForEmploymentAllowance'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('eligibleForEmploymentAllowance', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['eligibleForEmploymentAllowance'] = $eligibleForEmploymentAllowance; + + return $this; + } + + /** + * Gets deMinimisStateAid + * + * @return \SynergiTech\Staffology\Model\EpsDeMinimisStateAid|null + */ + public function getDeMinimisStateAid(): ?\SynergiTech\Staffology\Model\EpsDeMinimisStateAid + { + return $this->container['deMinimisStateAid']; + } + + /** + * Sets deMinimisStateAid + * + * @param \SynergiTech\Staffology\Model\EpsDeMinimisStateAid|null $deMinimisStateAid deMinimisStateAid + * + * @return $this + */ + public function setDeMinimisStateAid(?\SynergiTech\Staffology\Model\EpsDeMinimisStateAid $deMinimisStateAid): static + { + if (is_null($deMinimisStateAid)) { + throw new InvalidArgumentException('non-nullable deMinimisStateAid cannot be null'); + } + $this->container['deMinimisStateAid'] = $deMinimisStateAid; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EpsAccount.php b/src/Model/EpsAccount.php new file mode 100644 index 0000000..bfbd425 --- /dev/null +++ b/src/Model/EpsAccount.php @@ -0,0 +1,539 @@ + + */ +class EpsAccount implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EpsAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'accountHoldersName' => 'string', + 'accountNo' => 'string', + 'sortCode' => 'string', + 'buildingSocRef' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'accountHoldersName' => null, + 'accountNo' => null, + 'sortCode' => null, + 'buildingSocRef' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'accountHoldersName' => true, + 'accountNo' => true, + 'sortCode' => true, + 'buildingSocRef' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'accountHoldersName' => 'accountHoldersName', + 'accountNo' => 'accountNo', + 'sortCode' => 'sortCode', + 'buildingSocRef' => 'buildingSocRef' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'accountHoldersName' => 'setAccountHoldersName', + 'accountNo' => 'setAccountNo', + 'sortCode' => 'setSortCode', + 'buildingSocRef' => 'setBuildingSocRef' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'accountHoldersName' => 'getAccountHoldersName', + 'accountNo' => 'getAccountNo', + 'sortCode' => 'getSortCode', + 'buildingSocRef' => 'getBuildingSocRef' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accountHoldersName', $data ?? [], null); + $this->setIfExists('accountNo', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('buildingSocRef', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accountHoldersName + * + * @return string|null + */ + public function getAccountHoldersName(): ?string + { + return $this->container['accountHoldersName']; + } + + /** + * Sets accountHoldersName + * + * @param string|null $accountHoldersName accountHoldersName + * + * @return $this + */ + public function setAccountHoldersName(?string $accountHoldersName): static + { + if (is_null($accountHoldersName)) { + array_push($this->openAPINullablesSetToNull, 'accountHoldersName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountHoldersName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountHoldersName'] = $accountHoldersName; + + return $this; + } + + /** + * Gets accountNo + * + * @return string|null + */ + public function getAccountNo(): ?string + { + return $this->container['accountNo']; + } + + /** + * Sets accountNo + * + * @param string|null $accountNo accountNo + * + * @return $this + */ + public function setAccountNo(?string $accountNo): static + { + if (is_null($accountNo)) { + array_push($this->openAPINullablesSetToNull, 'accountNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountNo'] = $accountNo; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode(): ?string + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode sortCode + * + * @return $this + */ + public function setSortCode(?string $sortCode): static + { + if (is_null($sortCode)) { + array_push($this->openAPINullablesSetToNull, 'sortCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sortCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets buildingSocRef + * + * @return string|null + */ + public function getBuildingSocRef(): ?string + { + return $this->container['buildingSocRef']; + } + + /** + * Sets buildingSocRef + * + * @param string|null $buildingSocRef buildingSocRef + * + * @return $this + */ + public function setBuildingSocRef(?string $buildingSocRef): static + { + if (is_null($buildingSocRef)) { + array_push($this->openAPINullablesSetToNull, 'buildingSocRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buildingSocRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['buildingSocRef'] = $buildingSocRef; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EpsApprenticeshipLevy.php b/src/Model/EpsApprenticeshipLevy.php new file mode 100644 index 0000000..212833c --- /dev/null +++ b/src/Model/EpsApprenticeshipLevy.php @@ -0,0 +1,477 @@ + + */ +class EpsApprenticeshipLevy implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EpsApprenticeshipLevy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxMonth' => 'int', + 'levyDueYTD' => 'float', + 'annualAllce' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxMonth' => 'int32', + 'levyDueYTD' => 'double', + 'annualAllce' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxMonth' => false, + 'levyDueYTD' => false, + 'annualAllce' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxMonth' => 'taxMonth', + 'levyDueYTD' => 'levyDueYTD', + 'annualAllce' => 'annualAllce' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxMonth' => 'setTaxMonth', + 'levyDueYTD' => 'setLevyDueYTD', + 'annualAllce' => 'setAnnualAllce' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxMonth' => 'getTaxMonth', + 'levyDueYTD' => 'getLevyDueYTD', + 'annualAllce' => 'getAnnualAllce' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('levyDueYTD', $data ?? [], null); + $this->setIfExists('annualAllce', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth taxMonth + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets levyDueYTD + * + * @return float|null + */ + public function getLevyDueYTD(): ?float + { + return $this->container['levyDueYTD']; + } + + /** + * Sets levyDueYTD + * + * @param float|null $levyDueYTD levyDueYTD + * + * @return $this + */ + public function setLevyDueYTD(?float $levyDueYTD): static + { + if (is_null($levyDueYTD)) { + throw new InvalidArgumentException('non-nullable levyDueYTD cannot be null'); + } + $this->container['levyDueYTD'] = $levyDueYTD; + + return $this; + } + + /** + * Gets annualAllce + * + * @return float|null + */ + public function getAnnualAllce(): ?float + { + return $this->container['annualAllce']; + } + + /** + * Sets annualAllce + * + * @param float|null $annualAllce annualAllce + * + * @return $this + */ + public function setAnnualAllce(?float $annualAllce): static + { + if (is_null($annualAllce)) { + throw new InvalidArgumentException('non-nullable annualAllce cannot be null'); + } + $this->container['annualAllce'] = $annualAllce; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EpsDeMinimisStateAid.php b/src/Model/EpsDeMinimisStateAid.php new file mode 100644 index 0000000..44a88ae --- /dev/null +++ b/src/Model/EpsDeMinimisStateAid.php @@ -0,0 +1,511 @@ + + */ +class EpsDeMinimisStateAid implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EpsDeMinimisStateAid'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'agri' => 'bool', + 'fisheriesAqua' => 'bool', + 'roadTrans' => 'bool', + 'indust' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'agri' => null, + 'fisheriesAqua' => null, + 'roadTrans' => null, + 'indust' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'agri' => false, + 'fisheriesAqua' => false, + 'roadTrans' => false, + 'indust' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'agri' => 'agri', + 'fisheriesAqua' => 'fisheriesAqua', + 'roadTrans' => 'roadTrans', + 'indust' => 'indust' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'agri' => 'setAgri', + 'fisheriesAqua' => 'setFisheriesAqua', + 'roadTrans' => 'setRoadTrans', + 'indust' => 'setIndust' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'agri' => 'getAgri', + 'fisheriesAqua' => 'getFisheriesAqua', + 'roadTrans' => 'getRoadTrans', + 'indust' => 'getIndust' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('agri', $data ?? [], null); + $this->setIfExists('fisheriesAqua', $data ?? [], null); + $this->setIfExists('roadTrans', $data ?? [], null); + $this->setIfExists('indust', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets agri + * + * @return bool|null + */ + public function getAgri(): ?bool + { + return $this->container['agri']; + } + + /** + * Sets agri + * + * @param bool|null $agri agri + * + * @return $this + */ + public function setAgri(?bool $agri): static + { + if (is_null($agri)) { + throw new InvalidArgumentException('non-nullable agri cannot be null'); + } + $this->container['agri'] = $agri; + + return $this; + } + + /** + * Gets fisheriesAqua + * + * @return bool|null + */ + public function getFisheriesAqua(): ?bool + { + return $this->container['fisheriesAqua']; + } + + /** + * Sets fisheriesAqua + * + * @param bool|null $fisheriesAqua fisheriesAqua + * + * @return $this + */ + public function setFisheriesAqua(?bool $fisheriesAqua): static + { + if (is_null($fisheriesAqua)) { + throw new InvalidArgumentException('non-nullable fisheriesAqua cannot be null'); + } + $this->container['fisheriesAqua'] = $fisheriesAqua; + + return $this; + } + + /** + * Gets roadTrans + * + * @return bool|null + */ + public function getRoadTrans(): ?bool + { + return $this->container['roadTrans']; + } + + /** + * Sets roadTrans + * + * @param bool|null $roadTrans roadTrans + * + * @return $this + */ + public function setRoadTrans(?bool $roadTrans): static + { + if (is_null($roadTrans)) { + throw new InvalidArgumentException('non-nullable roadTrans cannot be null'); + } + $this->container['roadTrans'] = $roadTrans; + + return $this; + } + + /** + * Gets indust + * + * @return bool|null + */ + public function getIndust(): ?bool + { + return $this->container['indust']; + } + + /** + * Sets indust + * + * @param bool|null $indust indust + * + * @return $this + */ + public function setIndust(?bool $indust): static + { + if (is_null($indust)) { + throw new InvalidArgumentException('non-nullable indust cannot be null'); + } + $this->container['indust'] = $indust; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EpsFinalSubmission.php b/src/Model/EpsFinalSubmission.php new file mode 100644 index 0000000..4ee0948 --- /dev/null +++ b/src/Model/EpsFinalSubmission.php @@ -0,0 +1,484 @@ + + */ +class EpsFinalSubmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EpsFinalSubmission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isFinalSubmission' => 'bool', + 'becauseSchemeCeased' => 'bool', + 'dateCeased' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isFinalSubmission' => null, + 'becauseSchemeCeased' => null, + 'dateCeased' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isFinalSubmission' => false, + 'becauseSchemeCeased' => false, + 'dateCeased' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isFinalSubmission' => 'isFinalSubmission', + 'becauseSchemeCeased' => 'becauseSchemeCeased', + 'dateCeased' => 'dateCeased' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isFinalSubmission' => 'setIsFinalSubmission', + 'becauseSchemeCeased' => 'setBecauseSchemeCeased', + 'dateCeased' => 'setDateCeased' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isFinalSubmission' => 'getIsFinalSubmission', + 'becauseSchemeCeased' => 'getBecauseSchemeCeased', + 'dateCeased' => 'getDateCeased' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isFinalSubmission', $data ?? [], null); + $this->setIfExists('becauseSchemeCeased', $data ?? [], null); + $this->setIfExists('dateCeased', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isFinalSubmission + * + * @return bool|null + */ + public function getIsFinalSubmission(): ?bool + { + return $this->container['isFinalSubmission']; + } + + /** + * Sets isFinalSubmission + * + * @param bool|null $isFinalSubmission isFinalSubmission + * + * @return $this + */ + public function setIsFinalSubmission(?bool $isFinalSubmission): static + { + if (is_null($isFinalSubmission)) { + throw new InvalidArgumentException('non-nullable isFinalSubmission cannot be null'); + } + $this->container['isFinalSubmission'] = $isFinalSubmission; + + return $this; + } + + /** + * Gets becauseSchemeCeased + * + * @return bool|null + */ + public function getBecauseSchemeCeased(): ?bool + { + return $this->container['becauseSchemeCeased']; + } + + /** + * Sets becauseSchemeCeased + * + * @param bool|null $becauseSchemeCeased becauseSchemeCeased + * + * @return $this + */ + public function setBecauseSchemeCeased(?bool $becauseSchemeCeased): static + { + if (is_null($becauseSchemeCeased)) { + throw new InvalidArgumentException('non-nullable becauseSchemeCeased cannot be null'); + } + $this->container['becauseSchemeCeased'] = $becauseSchemeCeased; + + return $this; + } + + /** + * Gets dateCeased + * + * @return \DateTime|null + */ + public function getDateCeased(): ?\DateTime + { + return $this->container['dateCeased']; + } + + /** + * Sets dateCeased + * + * @param \DateTime|null $dateCeased dateCeased + * + * @return $this + */ + public function setDateCeased(?\DateTime $dateCeased): static + { + if (is_null($dateCeased)) { + array_push($this->openAPINullablesSetToNull, 'dateCeased'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dateCeased', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dateCeased'] = $dateCeased; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Establishment.php b/src/Model/Establishment.php new file mode 100644 index 0000000..bec5605 --- /dev/null +++ b/src/Model/Establishment.php @@ -0,0 +1,531 @@ + + */ +class Establishment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Establishment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'localAuthorityNumber' => 'string', + 'schoolEmployerType' => 'string', + 'establishmentCode' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'localAuthorityNumber' => null, + 'schoolEmployerType' => null, + 'establishmentCode' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'localAuthorityNumber' => true, + 'schoolEmployerType' => true, + 'establishmentCode' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'localAuthorityNumber' => 'localAuthorityNumber', + 'schoolEmployerType' => 'schoolEmployerType', + 'establishmentCode' => 'establishmentCode', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'localAuthorityNumber' => 'setLocalAuthorityNumber', + 'schoolEmployerType' => 'setSchoolEmployerType', + 'establishmentCode' => 'setEstablishmentCode', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'localAuthorityNumber' => 'getLocalAuthorityNumber', + 'schoolEmployerType' => 'getSchoolEmployerType', + 'establishmentCode' => 'getEstablishmentCode', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('localAuthorityNumber', $data ?? [], null); + $this->setIfExists('schoolEmployerType', $data ?? [], null); + $this->setIfExists('establishmentCode', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets localAuthorityNumber + * + * @return string|null + */ + public function getLocalAuthorityNumber(): ?string + { + return $this->container['localAuthorityNumber']; + } + + /** + * Sets localAuthorityNumber + * + * @param string|null $localAuthorityNumber localAuthorityNumber + * + * @return $this + */ + public function setLocalAuthorityNumber(?string $localAuthorityNumber): static + { + if (is_null($localAuthorityNumber)) { + array_push($this->openAPINullablesSetToNull, 'localAuthorityNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('localAuthorityNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['localAuthorityNumber'] = $localAuthorityNumber; + + return $this; + } + + /** + * Gets schoolEmployerType + * + * @return string|null + */ + public function getSchoolEmployerType(): ?string + { + return $this->container['schoolEmployerType']; + } + + /** + * Sets schoolEmployerType + * + * @param string|null $schoolEmployerType schoolEmployerType + * + * @return $this + */ + public function setSchoolEmployerType(?string $schoolEmployerType): static + { + if (is_null($schoolEmployerType)) { + array_push($this->openAPINullablesSetToNull, 'schoolEmployerType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('schoolEmployerType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['schoolEmployerType'] = $schoolEmployerType; + + return $this; + } + + /** + * Gets establishmentCode + * + * @return string|null + */ + public function getEstablishmentCode(): ?string + { + return $this->container['establishmentCode']; + } + + /** + * Sets establishmentCode + * + * @param string|null $establishmentCode establishmentCode + * + * @return $this + */ + public function setEstablishmentCode(?string $establishmentCode): static + { + if (is_null($establishmentCode)) { + array_push($this->openAPINullablesSetToNull, 'establishmentCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('establishmentCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['establishmentCode'] = $establishmentCode; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/EvcSettings.php b/src/Model/EvcSettings.php new file mode 100644 index 0000000..0e68e54 --- /dev/null +++ b/src/Model/EvcSettings.php @@ -0,0 +1,511 @@ + + */ +class EvcSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EvcSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'rightToRestrict' => 'bool', + 'rightToDelete' => 'bool', + 'subjectAccessRequest' => 'bool', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'rightToRestrict' => null, + 'rightToDelete' => null, + 'subjectAccessRequest' => null, + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'rightToRestrict' => false, + 'rightToDelete' => false, + 'subjectAccessRequest' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'rightToRestrict' => 'rightToRestrict', + 'rightToDelete' => 'rightToDelete', + 'subjectAccessRequest' => 'subjectAccessRequest', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'rightToRestrict' => 'setRightToRestrict', + 'rightToDelete' => 'setRightToDelete', + 'subjectAccessRequest' => 'setSubjectAccessRequest', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'rightToRestrict' => 'getRightToRestrict', + 'rightToDelete' => 'getRightToDelete', + 'subjectAccessRequest' => 'getSubjectAccessRequest', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('rightToRestrict', $data ?? [], null); + $this->setIfExists('rightToDelete', $data ?? [], null); + $this->setIfExists('subjectAccessRequest', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rightToRestrict + * + * @return bool|null + */ + public function getRightToRestrict(): ?bool + { + return $this->container['rightToRestrict']; + } + + /** + * Sets rightToRestrict + * + * @param bool|null $rightToRestrict If set to True then this employee shouldn't be included in data sent to EVC + * + * @return $this + */ + public function setRightToRestrict(?bool $rightToRestrict): static + { + if (is_null($rightToRestrict)) { + throw new InvalidArgumentException('non-nullable rightToRestrict cannot be null'); + } + $this->container['rightToRestrict'] = $rightToRestrict; + + return $this; + } + + /** + * Gets rightToDelete + * + * @return bool|null + */ + public function getRightToDelete(): ?bool + { + return $this->container['rightToDelete']; + } + + /** + * Sets rightToDelete + * + * @param bool|null $rightToDelete If set to True then the EVC service will be informed that the employee has invoked their GDPR Right To Delete + * + * @return $this + */ + public function setRightToDelete(?bool $rightToDelete): static + { + if (is_null($rightToDelete)) { + throw new InvalidArgumentException('non-nullable rightToDelete cannot be null'); + } + $this->container['rightToDelete'] = $rightToDelete; + + return $this; + } + + /** + * Gets subjectAccessRequest + * + * @return bool|null + */ + public function getSubjectAccessRequest(): ?bool + { + return $this->container['subjectAccessRequest']; + } + + /** + * Sets subjectAccessRequest + * + * @param bool|null $subjectAccessRequest If set to True then the EVC service will be informed that the employee has made a Subject Access Request + * + * @return $this + */ + public function setSubjectAccessRequest(?bool $subjectAccessRequest): static + { + if (is_null($subjectAccessRequest)) { + throw new InvalidArgumentException('non-nullable subjectAccessRequest cannot be null'); + } + $this->container['subjectAccessRequest'] = $subjectAccessRequest; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Exb.php b/src/Model/Exb.php new file mode 100644 index 0000000..f384f2a --- /dev/null +++ b/src/Model/Exb.php @@ -0,0 +1,962 @@ + + */ +class Exb implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Exb'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'additionsAmount' => 'float', + 'additionsDescription' => 'string', + 'deductionsAmount' => 'float', + 'deductionsDescription' => 'string', + 'employeeCount' => 'int', + 'totalBenefits' => 'float', + 'totalAdjustedBenefits' => 'float', + 'nicsRate' => 'float', + 'nicsPayable' => 'float', + 'expensesAndBenefits' => '\SynergiTech\Staffology\Model\ExpensesAndBenefits', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'additionsAmount' => 'double', + 'additionsDescription' => null, + 'deductionsAmount' => 'double', + 'deductionsDescription' => null, + 'employeeCount' => 'int32', + 'totalBenefits' => 'double', + 'totalAdjustedBenefits' => 'double', + 'nicsRate' => 'double', + 'nicsPayable' => 'double', + 'expensesAndBenefits' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'additionsAmount' => false, + 'additionsDescription' => true, + 'deductionsAmount' => false, + 'deductionsDescription' => true, + 'employeeCount' => false, + 'totalBenefits' => false, + 'totalAdjustedBenefits' => false, + 'nicsRate' => false, + 'nicsPayable' => false, + 'expensesAndBenefits' => false, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'additionsAmount' => 'additionsAmount', + 'additionsDescription' => 'additionsDescription', + 'deductionsAmount' => 'deductionsAmount', + 'deductionsDescription' => 'deductionsDescription', + 'employeeCount' => 'employeeCount', + 'totalBenefits' => 'totalBenefits', + 'totalAdjustedBenefits' => 'totalAdjustedBenefits', + 'nicsRate' => 'nicsRate', + 'nicsPayable' => 'nicsPayable', + 'expensesAndBenefits' => 'expensesAndBenefits', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'additionsAmount' => 'setAdditionsAmount', + 'additionsDescription' => 'setAdditionsDescription', + 'deductionsAmount' => 'setDeductionsAmount', + 'deductionsDescription' => 'setDeductionsDescription', + 'employeeCount' => 'setEmployeeCount', + 'totalBenefits' => 'setTotalBenefits', + 'totalAdjustedBenefits' => 'setTotalAdjustedBenefits', + 'nicsRate' => 'setNicsRate', + 'nicsPayable' => 'setNicsPayable', + 'expensesAndBenefits' => 'setExpensesAndBenefits', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'additionsAmount' => 'getAdditionsAmount', + 'additionsDescription' => 'getAdditionsDescription', + 'deductionsAmount' => 'getDeductionsAmount', + 'deductionsDescription' => 'getDeductionsDescription', + 'employeeCount' => 'getEmployeeCount', + 'totalBenefits' => 'getTotalBenefits', + 'totalAdjustedBenefits' => 'getTotalAdjustedBenefits', + 'nicsRate' => 'getNicsRate', + 'nicsPayable' => 'getNicsPayable', + 'expensesAndBenefits' => 'getExpensesAndBenefits', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additionsAmount', $data ?? [], null); + $this->setIfExists('additionsDescription', $data ?? [], null); + $this->setIfExists('deductionsAmount', $data ?? [], null); + $this->setIfExists('deductionsDescription', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('totalBenefits', $data ?? [], null); + $this->setIfExists('totalAdjustedBenefits', $data ?? [], null); + $this->setIfExists('nicsRate', $data ?? [], null); + $this->setIfExists('nicsPayable', $data ?? [], null); + $this->setIfExists('expensesAndBenefits', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['additionsDescription']) && (mb_strlen($this->container['additionsDescription']) > 35)) { + $invalidProperties[] = "invalid value for 'additionsDescription', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['deductionsDescription']) && (mb_strlen($this->container['deductionsDescription']) > 35)) { + $invalidProperties[] = "invalid value for 'deductionsDescription', the character length must be smaller than or equal to 35."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets additionsAmount + * + * @return float|null + */ + public function getAdditionsAmount(): ?float + { + return $this->container['additionsAmount']; + } + + /** + * Sets additionsAmount + * + * @param float|null $additionsAmount additionsAmount + * + * @return $this + */ + public function setAdditionsAmount(?float $additionsAmount): static + { + if (is_null($additionsAmount)) { + throw new InvalidArgumentException('non-nullable additionsAmount cannot be null'); + } + $this->container['additionsAmount'] = $additionsAmount; + + return $this; + } + + /** + * Gets additionsDescription + * + * @return string|null + */ + public function getAdditionsDescription(): ?string + { + return $this->container['additionsDescription']; + } + + /** + * Sets additionsDescription + * + * @param string|null $additionsDescription additionsDescription + * + * @return $this + */ + public function setAdditionsDescription(?string $additionsDescription): static + { + if (is_null($additionsDescription)) { + array_push($this->openAPINullablesSetToNull, 'additionsDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('additionsDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($additionsDescription) && (mb_strlen($additionsDescription) > 35)) { + throw new InvalidArgumentException('invalid length for $additionsDescription when calling Exb., must be smaller than or equal to 35.'); + } + + $this->container['additionsDescription'] = $additionsDescription; + + return $this; + } + + /** + * Gets deductionsAmount + * + * @return float|null + */ + public function getDeductionsAmount(): ?float + { + return $this->container['deductionsAmount']; + } + + /** + * Sets deductionsAmount + * + * @param float|null $deductionsAmount deductionsAmount + * + * @return $this + */ + public function setDeductionsAmount(?float $deductionsAmount): static + { + if (is_null($deductionsAmount)) { + throw new InvalidArgumentException('non-nullable deductionsAmount cannot be null'); + } + $this->container['deductionsAmount'] = $deductionsAmount; + + return $this; + } + + /** + * Gets deductionsDescription + * + * @return string|null + */ + public function getDeductionsDescription(): ?string + { + return $this->container['deductionsDescription']; + } + + /** + * Sets deductionsDescription + * + * @param string|null $deductionsDescription deductionsDescription + * + * @return $this + */ + public function setDeductionsDescription(?string $deductionsDescription): static + { + if (is_null($deductionsDescription)) { + array_push($this->openAPINullablesSetToNull, 'deductionsDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deductionsDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($deductionsDescription) && (mb_strlen($deductionsDescription) > 35)) { + throw new InvalidArgumentException('invalid length for $deductionsDescription when calling Exb., must be smaller than or equal to 35.'); + } + + $this->container['deductionsDescription'] = $deductionsDescription; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of employees with a P11D + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets totalBenefits + * + * @return float|null + */ + public function getTotalBenefits(): ?float + { + return $this->container['totalBenefits']; + } + + /** + * Sets totalBenefits + * + * @param float|null $totalBenefits [readonly] Total value of benefits, not including any deductions or additions + * + * @return $this + */ + public function setTotalBenefits(?float $totalBenefits): static + { + if (is_null($totalBenefits)) { + throw new InvalidArgumentException('non-nullable totalBenefits cannot be null'); + } + $this->container['totalBenefits'] = $totalBenefits; + + return $this; + } + + /** + * Gets totalAdjustedBenefits + * + * @return float|null + */ + public function getTotalAdjustedBenefits(): ?float + { + return $this->container['totalAdjustedBenefits']; + } + + /** + * Sets totalAdjustedBenefits + * + * @param float|null $totalAdjustedBenefits [readonly] Total value of benefits + * + * @return $this + */ + public function setTotalAdjustedBenefits(?float $totalAdjustedBenefits): static + { + if (is_null($totalAdjustedBenefits)) { + throw new InvalidArgumentException('non-nullable totalAdjustedBenefits cannot be null'); + } + $this->container['totalAdjustedBenefits'] = $totalAdjustedBenefits; + + return $this; + } + + /** + * Gets nicsRate + * + * @return float|null + */ + public function getNicsRate(): ?float + { + return $this->container['nicsRate']; + } + + /** + * Sets nicsRate + * + * @param float|null $nicsRate [readonly] The Class 1A NICS Rate + * + * @return $this + */ + public function setNicsRate(?float $nicsRate): static + { + if (is_null($nicsRate)) { + throw new InvalidArgumentException('non-nullable nicsRate cannot be null'); + } + $this->container['nicsRate'] = $nicsRate; + + return $this; + } + + /** + * Gets nicsPayable + * + * @return float|null + */ + public function getNicsPayable(): ?float + { + return $this->container['nicsPayable']; + } + + /** + * Sets nicsPayable + * + * @param float|null $nicsPayable [readonly] NICs Payable + * + * @return $this + */ + public function setNicsPayable(?float $nicsPayable): static + { + if (is_null($nicsPayable)) { + throw new InvalidArgumentException('non-nullable nicsPayable cannot be null'); + } + $this->container['nicsPayable'] = $nicsPayable; + + return $this; + } + + /** + * Gets expensesAndBenefits + * + * @return \SynergiTech\Staffology\Model\ExpensesAndBenefits|null + */ + public function getExpensesAndBenefits(): ?\SynergiTech\Staffology\Model\ExpensesAndBenefits + { + return $this->container['expensesAndBenefits']; + } + + /** + * Sets expensesAndBenefits + * + * @param \SynergiTech\Staffology\Model\ExpensesAndBenefits|null $expensesAndBenefits expensesAndBenefits + * + * @return $this + */ + public function setExpensesAndBenefits(?\SynergiTech\Staffology\Model\ExpensesAndBenefits $expensesAndBenefits): static + { + if (is_null($expensesAndBenefits)) { + throw new InvalidArgumentException('non-nullable expensesAndBenefits cannot be null'); + } + $this->container['expensesAndBenefits'] = $expensesAndBenefits; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbDeclarations.php b/src/Model/ExbDeclarations.php new file mode 100644 index 0000000..eaf1918 --- /dev/null +++ b/src/Model/ExbDeclarations.php @@ -0,0 +1,456 @@ + + */ +class ExbDeclarations implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbDeclarations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'p11Dincluded' => 'string', + 'p46CarDeclaration' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'p11Dincluded' => null, + 'p46CarDeclaration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'p11Dincluded' => true, + 'p46CarDeclaration' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'p11Dincluded' => 'p11Dincluded', + 'p46CarDeclaration' => 'p46CarDeclaration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'p11Dincluded' => 'setP11Dincluded', + 'p46CarDeclaration' => 'setP46CarDeclaration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'p11Dincluded' => 'getP11Dincluded', + 'p46CarDeclaration' => 'getP46CarDeclaration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('p11Dincluded', $data ?? [], null); + $this->setIfExists('p46CarDeclaration', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets p11Dincluded + * + * @return string|null + */ + public function getP11Dincluded(): ?string + { + return $this->container['p11Dincluded']; + } + + /** + * Sets p11Dincluded + * + * @param string|null $p11Dincluded p11Dincluded + * + * @return $this + */ + public function setP11Dincluded(?string $p11Dincluded): static + { + if (is_null($p11Dincluded)) { + array_push($this->openAPINullablesSetToNull, 'p11Dincluded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('p11Dincluded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['p11Dincluded'] = $p11Dincluded; + + return $this; + } + + /** + * Gets p46CarDeclaration + * + * @return string|null + */ + public function getP46CarDeclaration(): ?string + { + return $this->container['p46CarDeclaration']; + } + + /** + * Sets p46CarDeclaration + * + * @param string|null $p46CarDeclaration p46CarDeclaration + * + * @return $this + */ + public function setP46CarDeclaration(?string $p46CarDeclaration): static + { + if (is_null($p46CarDeclaration)) { + array_push($this->openAPINullablesSetToNull, 'p46CarDeclaration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('p46CarDeclaration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['p46CarDeclaration'] = $p46CarDeclaration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbEmployer.php b/src/Model/ExbEmployer.php new file mode 100644 index 0000000..53282f7 --- /dev/null +++ b/src/Model/ExbEmployer.php @@ -0,0 +1,415 @@ + + */ +class ExbEmployer implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbEmployer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11d.php b/src/Model/ExbP11d.php new file mode 100644 index 0000000..f9d4617 --- /dev/null +++ b/src/Model/ExbP11d.php @@ -0,0 +1,884 @@ + + */ +class ExbP11d implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11d'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\ExbP11dEmployee', + 'transferred' => '\SynergiTech\Staffology\Model\P11DAssetTransferredCollection', + 'payments' => '\SynergiTech\Staffology\Model\P11DPaymentCollection', + 'vouchersOrCCs' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'livingAccom' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'mileageAllow' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'cars' => '\SynergiTech\Staffology\Model\P11DCarCollection', + 'vans' => '\SynergiTech\Staffology\Model\P11dVans', + 'loans' => '\SynergiTech\Staffology\Model\P11DLoanCollection', + 'medical' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'relocation' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'services' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'assetsAvail' => '\SynergiTech\Staffology\Model\P11DAssetAvailableCollection', + 'other' => '\SynergiTech\Staffology\Model\P11DOther', + 'expPaid' => '\SynergiTech\Staffology\Model\P11dExpenses' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'transferred' => null, + 'payments' => null, + 'vouchersOrCCs' => null, + 'livingAccom' => null, + 'mileageAllow' => null, + 'cars' => null, + 'vans' => null, + 'loans' => null, + 'medical' => null, + 'relocation' => null, + 'services' => null, + 'assetsAvail' => null, + 'other' => null, + 'expPaid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'transferred' => false, + 'payments' => false, + 'vouchersOrCCs' => false, + 'livingAccom' => false, + 'mileageAllow' => false, + 'cars' => false, + 'vans' => false, + 'loans' => false, + 'medical' => false, + 'relocation' => false, + 'services' => false, + 'assetsAvail' => false, + 'other' => false, + 'expPaid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'transferred' => 'transferred', + 'payments' => 'payments', + 'vouchersOrCCs' => 'vouchersOrCCs', + 'livingAccom' => 'livingAccom', + 'mileageAllow' => 'mileageAllow', + 'cars' => 'cars', + 'vans' => 'vans', + 'loans' => 'loans', + 'medical' => 'medical', + 'relocation' => 'relocation', + 'services' => 'services', + 'assetsAvail' => 'assetsAvail', + 'other' => 'other', + 'expPaid' => 'expPaid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'transferred' => 'setTransferred', + 'payments' => 'setPayments', + 'vouchersOrCCs' => 'setVouchersOrCCs', + 'livingAccom' => 'setLivingAccom', + 'mileageAllow' => 'setMileageAllow', + 'cars' => 'setCars', + 'vans' => 'setVans', + 'loans' => 'setLoans', + 'medical' => 'setMedical', + 'relocation' => 'setRelocation', + 'services' => 'setServices', + 'assetsAvail' => 'setAssetsAvail', + 'other' => 'setOther', + 'expPaid' => 'setExpPaid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'transferred' => 'getTransferred', + 'payments' => 'getPayments', + 'vouchersOrCCs' => 'getVouchersOrCCs', + 'livingAccom' => 'getLivingAccom', + 'mileageAllow' => 'getMileageAllow', + 'cars' => 'getCars', + 'vans' => 'getVans', + 'loans' => 'getLoans', + 'medical' => 'getMedical', + 'relocation' => 'getRelocation', + 'services' => 'getServices', + 'assetsAvail' => 'getAssetsAvail', + 'other' => 'getOther', + 'expPaid' => 'getExpPaid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('transferred', $data ?? [], null); + $this->setIfExists('payments', $data ?? [], null); + $this->setIfExists('vouchersOrCCs', $data ?? [], null); + $this->setIfExists('livingAccom', $data ?? [], null); + $this->setIfExists('mileageAllow', $data ?? [], null); + $this->setIfExists('cars', $data ?? [], null); + $this->setIfExists('vans', $data ?? [], null); + $this->setIfExists('loans', $data ?? [], null); + $this->setIfExists('medical', $data ?? [], null); + $this->setIfExists('relocation', $data ?? [], null); + $this->setIfExists('services', $data ?? [], null); + $this->setIfExists('assetsAvail', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('expPaid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\ExbP11dEmployee|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\ExbP11dEmployee + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\ExbP11dEmployee|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\ExbP11dEmployee $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets transferred + * + * @return \SynergiTech\Staffology\Model\P11DAssetTransferredCollection|null + */ + public function getTransferred(): ?\SynergiTech\Staffology\Model\P11DAssetTransferredCollection + { + return $this->container['transferred']; + } + + /** + * Sets transferred + * + * @param \SynergiTech\Staffology\Model\P11DAssetTransferredCollection|null $transferred transferred + * + * @return $this + */ + public function setTransferred(?\SynergiTech\Staffology\Model\P11DAssetTransferredCollection $transferred): static + { + if (is_null($transferred)) { + throw new InvalidArgumentException('non-nullable transferred cannot be null'); + } + $this->container['transferred'] = $transferred; + + return $this; + } + + /** + * Gets payments + * + * @return \SynergiTech\Staffology\Model\P11DPaymentCollection|null + */ + public function getPayments(): ?\SynergiTech\Staffology\Model\P11DPaymentCollection + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param \SynergiTech\Staffology\Model\P11DPaymentCollection|null $payments payments + * + * @return $this + */ + public function setPayments(?\SynergiTech\Staffology\Model\P11DPaymentCollection $payments): static + { + if (is_null($payments)) { + throw new InvalidArgumentException('non-nullable payments cannot be null'); + } + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets vouchersOrCCs + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getVouchersOrCCs(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['vouchersOrCCs']; + } + + /** + * Sets vouchersOrCCs + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $vouchersOrCCs vouchersOrCCs + * + * @return $this + */ + public function setVouchersOrCCs(?\SynergiTech\Staffology\Model\P11DSingleItem $vouchersOrCCs): static + { + if (is_null($vouchersOrCCs)) { + throw new InvalidArgumentException('non-nullable vouchersOrCCs cannot be null'); + } + $this->container['vouchersOrCCs'] = $vouchersOrCCs; + + return $this; + } + + /** + * Gets livingAccom + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getLivingAccom(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['livingAccom']; + } + + /** + * Sets livingAccom + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $livingAccom livingAccom + * + * @return $this + */ + public function setLivingAccom(?\SynergiTech\Staffology\Model\P11DSingleItem $livingAccom): static + { + if (is_null($livingAccom)) { + throw new InvalidArgumentException('non-nullable livingAccom cannot be null'); + } + $this->container['livingAccom'] = $livingAccom; + + return $this; + } + + /** + * Gets mileageAllow + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getMileageAllow(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['mileageAllow']; + } + + /** + * Sets mileageAllow + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $mileageAllow mileageAllow + * + * @return $this + */ + public function setMileageAllow(?\SynergiTech\Staffology\Model\P11DSingleItem $mileageAllow): static + { + if (is_null($mileageAllow)) { + throw new InvalidArgumentException('non-nullable mileageAllow cannot be null'); + } + $this->container['mileageAllow'] = $mileageAllow; + + return $this; + } + + /** + * Gets cars + * + * @return \SynergiTech\Staffology\Model\P11DCarCollection|null + */ + public function getCars(): ?\SynergiTech\Staffology\Model\P11DCarCollection + { + return $this->container['cars']; + } + + /** + * Sets cars + * + * @param \SynergiTech\Staffology\Model\P11DCarCollection|null $cars cars + * + * @return $this + */ + public function setCars(?\SynergiTech\Staffology\Model\P11DCarCollection $cars): static + { + if (is_null($cars)) { + throw new InvalidArgumentException('non-nullable cars cannot be null'); + } + $this->container['cars'] = $cars; + + return $this; + } + + /** + * Gets vans + * + * @return \SynergiTech\Staffology\Model\P11dVans|null + */ + public function getVans(): ?\SynergiTech\Staffology\Model\P11dVans + { + return $this->container['vans']; + } + + /** + * Sets vans + * + * @param \SynergiTech\Staffology\Model\P11dVans|null $vans vans + * + * @return $this + */ + public function setVans(?\SynergiTech\Staffology\Model\P11dVans $vans): static + { + if (is_null($vans)) { + throw new InvalidArgumentException('non-nullable vans cannot be null'); + } + $this->container['vans'] = $vans; + + return $this; + } + + /** + * Gets loans + * + * @return \SynergiTech\Staffology\Model\P11DLoanCollection|null + */ + public function getLoans(): ?\SynergiTech\Staffology\Model\P11DLoanCollection + { + return $this->container['loans']; + } + + /** + * Sets loans + * + * @param \SynergiTech\Staffology\Model\P11DLoanCollection|null $loans loans + * + * @return $this + */ + public function setLoans(?\SynergiTech\Staffology\Model\P11DLoanCollection $loans): static + { + if (is_null($loans)) { + throw new InvalidArgumentException('non-nullable loans cannot be null'); + } + $this->container['loans'] = $loans; + + return $this; + } + + /** + * Gets medical + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getMedical(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['medical']; + } + + /** + * Sets medical + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $medical medical + * + * @return $this + */ + public function setMedical(?\SynergiTech\Staffology\Model\P11DSingleItem $medical): static + { + if (is_null($medical)) { + throw new InvalidArgumentException('non-nullable medical cannot be null'); + } + $this->container['medical'] = $medical; + + return $this; + } + + /** + * Gets relocation + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getRelocation(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['relocation']; + } + + /** + * Sets relocation + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $relocation relocation + * + * @return $this + */ + public function setRelocation(?\SynergiTech\Staffology\Model\P11DSingleItem $relocation): static + { + if (is_null($relocation)) { + throw new InvalidArgumentException('non-nullable relocation cannot be null'); + } + $this->container['relocation'] = $relocation; + + return $this; + } + + /** + * Gets services + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getServices(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['services']; + } + + /** + * Sets services + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $services services + * + * @return $this + */ + public function setServices(?\SynergiTech\Staffology\Model\P11DSingleItem $services): static + { + if (is_null($services)) { + throw new InvalidArgumentException('non-nullable services cannot be null'); + } + $this->container['services'] = $services; + + return $this; + } + + /** + * Gets assetsAvail + * + * @return \SynergiTech\Staffology\Model\P11DAssetAvailableCollection|null + */ + public function getAssetsAvail(): ?\SynergiTech\Staffology\Model\P11DAssetAvailableCollection + { + return $this->container['assetsAvail']; + } + + /** + * Sets assetsAvail + * + * @param \SynergiTech\Staffology\Model\P11DAssetAvailableCollection|null $assetsAvail assetsAvail + * + * @return $this + */ + public function setAssetsAvail(?\SynergiTech\Staffology\Model\P11DAssetAvailableCollection $assetsAvail): static + { + if (is_null($assetsAvail)) { + throw new InvalidArgumentException('non-nullable assetsAvail cannot be null'); + } + $this->container['assetsAvail'] = $assetsAvail; + + return $this; + } + + /** + * Gets other + * + * @return \SynergiTech\Staffology\Model\P11DOther|null + */ + public function getOther(): ?\SynergiTech\Staffology\Model\P11DOther + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param \SynergiTech\Staffology\Model\P11DOther|null $other other + * + * @return $this + */ + public function setOther(?\SynergiTech\Staffology\Model\P11DOther $other): static + { + if (is_null($other)) { + throw new InvalidArgumentException('non-nullable other cannot be null'); + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets expPaid + * + * @return \SynergiTech\Staffology\Model\P11dExpenses|null + */ + public function getExpPaid(): ?\SynergiTech\Staffology\Model\P11dExpenses + { + return $this->container['expPaid']; + } + + /** + * Sets expPaid + * + * @param \SynergiTech\Staffology\Model\P11dExpenses|null $expPaid expPaid + * + * @return $this + */ + public function setExpPaid(?\SynergiTech\Staffology\Model\P11dExpenses $expPaid): static + { + if (is_null($expPaid)) { + throw new InvalidArgumentException('non-nullable expPaid cannot be null'); + } + $this->container['expPaid'] = $expPaid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11dEmployee.php b/src/Model/ExbP11dEmployee.php new file mode 100644 index 0000000..184e762 --- /dev/null +++ b/src/Model/ExbP11dEmployee.php @@ -0,0 +1,647 @@ + + */ +class ExbP11dEmployee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11dEmployee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeUniqueId' => 'string', + 'dirInd' => 'string', + 'name' => '\SynergiTech\Staffology\Model\RtiEmployeeName', + 'wksNo' => 'string', + 'nino' => 'string', + 'birthDate' => 'string', + 'gender' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeUniqueId' => 'uuid', + 'dirInd' => null, + 'name' => null, + 'wksNo' => null, + 'nino' => null, + 'birthDate' => null, + 'gender' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeUniqueId' => false, + 'dirInd' => true, + 'name' => false, + 'wksNo' => true, + 'nino' => true, + 'birthDate' => true, + 'gender' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeUniqueId' => 'employeeUniqueId', + 'dirInd' => 'dirInd', + 'name' => 'name', + 'wksNo' => 'wksNo', + 'nino' => 'nino', + 'birthDate' => 'birthDate', + 'gender' => 'gender' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'dirInd' => 'setDirInd', + 'name' => 'setName', + 'wksNo' => 'setWksNo', + 'nino' => 'setNino', + 'birthDate' => 'setBirthDate', + 'gender' => 'setGender' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'dirInd' => 'getDirInd', + 'name' => 'getName', + 'wksNo' => 'getWksNo', + 'nino' => 'getNino', + 'birthDate' => 'getBirthDate', + 'gender' => 'getGender' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('dirInd', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('wksNo', $data ?? [], null); + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('birthDate', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId employeeUniqueId + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets dirInd + * + * @return string|null + */ + public function getDirInd(): ?string + { + return $this->container['dirInd']; + } + + /** + * Sets dirInd + * + * @param string|null $dirInd dirInd + * + * @return $this + */ + public function setDirInd(?string $dirInd): static + { + if (is_null($dirInd)) { + array_push($this->openAPINullablesSetToNull, 'dirInd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dirInd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dirInd'] = $dirInd; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\RtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets wksNo + * + * @return string|null + */ + public function getWksNo(): ?string + { + return $this->container['wksNo']; + } + + /** + * Sets wksNo + * + * @param string|null $wksNo wksNo + * + * @return $this + */ + public function setWksNo(?string $wksNo): static + { + if (is_null($wksNo)) { + array_push($this->openAPINullablesSetToNull, 'wksNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('wksNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['wksNo'] = $wksNo; + + return $this; + } + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets birthDate + * + * @return string|null + */ + public function getBirthDate(): ?string + { + return $this->container['birthDate']; + } + + /** + * Sets birthDate + * + * @param string|null $birthDate birthDate + * + * @return $this + */ + public function setBirthDate(?string $birthDate): static + { + if (is_null($birthDate)) { + array_push($this->openAPINullablesSetToNull, 'birthDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('birthDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['birthDate'] = $birthDate; + + return $this; + } + + /** + * Gets gender + * + * @return string|null + */ + public function getGender(): ?string + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param string|null $gender gender + * + * @return $this + */ + public function setGender(?string $gender): static + { + if (is_null($gender)) { + array_push($this->openAPINullablesSetToNull, 'gender'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gender', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['gender'] = $gender; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11db.php b/src/Model/ExbP11db.php new file mode 100644 index 0000000..d77cd73 --- /dev/null +++ b/src/Model/ExbP11db.php @@ -0,0 +1,408 @@ + + */ +class ExbP11db implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11db'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'class1AcontributionsDue' => '\SynergiTech\Staffology\Model\ExbP11dbClass1A' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'class1AcontributionsDue' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'class1AcontributionsDue' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'class1AcontributionsDue' => 'class1AcontributionsDue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'class1AcontributionsDue' => 'setClass1AcontributionsDue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'class1AcontributionsDue' => 'getClass1AcontributionsDue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('class1AcontributionsDue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets class1AcontributionsDue + * + * @return \SynergiTech\Staffology\Model\ExbP11dbClass1A|null + */ + public function getClass1AcontributionsDue(): ?\SynergiTech\Staffology\Model\ExbP11dbClass1A + { + return $this->container['class1AcontributionsDue']; + } + + /** + * Sets class1AcontributionsDue + * + * @param \SynergiTech\Staffology\Model\ExbP11dbClass1A|null $class1AcontributionsDue class1AcontributionsDue + * + * @return $this + */ + public function setClass1AcontributionsDue(?\SynergiTech\Staffology\Model\ExbP11dbClass1A $class1AcontributionsDue): static + { + if (is_null($class1AcontributionsDue)) { + throw new InvalidArgumentException('non-nullable class1AcontributionsDue cannot be null'); + } + $this->container['class1AcontributionsDue'] = $class1AcontributionsDue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11dbClass1A.php b/src/Model/ExbP11dbClass1A.php new file mode 100644 index 0000000..0f94674 --- /dev/null +++ b/src/Model/ExbP11dbClass1A.php @@ -0,0 +1,524 @@ + + */ +class ExbP11dbClass1A implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11dbClass1A'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'niCsRate' => 'string', + 'totalBenefit' => '\SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit', + 'adjustments' => '\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments', + 'niCpayable' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'niCsRate' => null, + 'totalBenefit' => null, + 'adjustments' => null, + 'niCpayable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'niCsRate' => true, + 'totalBenefit' => false, + 'adjustments' => false, + 'niCpayable' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'niCsRate' => 'niCsRate', + 'totalBenefit' => 'totalBenefit', + 'adjustments' => 'adjustments', + 'niCpayable' => 'niCpayable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'niCsRate' => 'setNiCsRate', + 'totalBenefit' => 'setTotalBenefit', + 'adjustments' => 'setAdjustments', + 'niCpayable' => 'setNiCpayable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'niCsRate' => 'getNiCsRate', + 'totalBenefit' => 'getTotalBenefit', + 'adjustments' => 'getAdjustments', + 'niCpayable' => 'getNiCpayable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('niCsRate', $data ?? [], null); + $this->setIfExists('totalBenefit', $data ?? [], null); + $this->setIfExists('adjustments', $data ?? [], null); + $this->setIfExists('niCpayable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets niCsRate + * + * @return string|null + */ + public function getNiCsRate(): ?string + { + return $this->container['niCsRate']; + } + + /** + * Sets niCsRate + * + * @param string|null $niCsRate niCsRate + * + * @return $this + */ + public function setNiCsRate(?string $niCsRate): static + { + if (is_null($niCsRate)) { + array_push($this->openAPINullablesSetToNull, 'niCsRate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niCsRate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niCsRate'] = $niCsRate; + + return $this; + } + + /** + * Gets totalBenefit + * + * @return \SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit|null + */ + public function getTotalBenefit(): ?\SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit + { + return $this->container['totalBenefit']; + } + + /** + * Sets totalBenefit + * + * @param \SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit|null $totalBenefit totalBenefit + * + * @return $this + */ + public function setTotalBenefit(?\SynergiTech\Staffology\Model\ExbP11dbClass1ATotalBenefit $totalBenefit): static + { + if (is_null($totalBenefit)) { + throw new InvalidArgumentException('non-nullable totalBenefit cannot be null'); + } + $this->container['totalBenefit'] = $totalBenefit; + + return $this; + } + + /** + * Gets adjustments + * + * @return \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments|null + */ + public function getAdjustments(): ?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments + { + return $this->container['adjustments']; + } + + /** + * Sets adjustments + * + * @param \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments|null $adjustments adjustments + * + * @return $this + */ + public function setAdjustments(?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustments $adjustments): static + { + if (is_null($adjustments)) { + throw new InvalidArgumentException('non-nullable adjustments cannot be null'); + } + $this->container['adjustments'] = $adjustments; + + return $this; + } + + /** + * Gets niCpayable + * + * @return string|null + */ + public function getNiCpayable(): ?string + { + return $this->container['niCpayable']; + } + + /** + * Sets niCpayable + * + * @param string|null $niCpayable niCpayable + * + * @return $this + */ + public function setNiCpayable(?string $niCpayable): static + { + if (is_null($niCpayable)) { + array_push($this->openAPINullablesSetToNull, 'niCpayable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niCpayable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niCpayable'] = $niCpayable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11dbClass1AAdjustment.php b/src/Model/ExbP11dbClass1AAdjustment.php new file mode 100644 index 0000000..54a3e52 --- /dev/null +++ b/src/Model/ExbP11dbClass1AAdjustment.php @@ -0,0 +1,456 @@ + + */ +class ExbP11dbClass1AAdjustment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11dbClass1AAdjustment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'description' => 'string', + 'adjustment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'description' => null, + 'adjustment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'description' => true, + 'adjustment' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'description' => 'description', + 'adjustment' => 'adjustment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'description' => 'setDescription', + 'adjustment' => 'setAdjustment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'description' => 'getDescription', + 'adjustment' => 'getAdjustment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('adjustment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets adjustment + * + * @return string|null + */ + public function getAdjustment(): ?string + { + return $this->container['adjustment']; + } + + /** + * Sets adjustment + * + * @param string|null $adjustment adjustment + * + * @return $this + */ + public function setAdjustment(?string $adjustment): static + { + if (is_null($adjustment)) { + array_push($this->openAPINullablesSetToNull, 'adjustment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustment'] = $adjustment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11dbClass1AAdjustments.php b/src/Model/ExbP11dbClass1AAdjustments.php new file mode 100644 index 0000000..509ad84 --- /dev/null +++ b/src/Model/ExbP11dbClass1AAdjustments.php @@ -0,0 +1,565 @@ + + */ +class ExbP11dbClass1AAdjustments implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11dbClass1AAdjustments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'totalBenefit' => 'string', + 'amountDue' => '\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment', + 'amountNotDue' => '\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment', + 'total' => 'string', + 'payable' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'totalBenefit' => null, + 'amountDue' => null, + 'amountNotDue' => null, + 'total' => null, + 'payable' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'totalBenefit' => true, + 'amountDue' => false, + 'amountNotDue' => false, + 'total' => true, + 'payable' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'totalBenefit' => 'totalBenefit', + 'amountDue' => 'amountDue', + 'amountNotDue' => 'amountNotDue', + 'total' => 'total', + 'payable' => 'payable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'totalBenefit' => 'setTotalBenefit', + 'amountDue' => 'setAmountDue', + 'amountNotDue' => 'setAmountNotDue', + 'total' => 'setTotal', + 'payable' => 'setPayable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'totalBenefit' => 'getTotalBenefit', + 'amountDue' => 'getAmountDue', + 'amountNotDue' => 'getAmountNotDue', + 'total' => 'getTotal', + 'payable' => 'getPayable' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('totalBenefit', $data ?? [], null); + $this->setIfExists('amountDue', $data ?? [], null); + $this->setIfExists('amountNotDue', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('payable', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets totalBenefit + * + * @return string|null + */ + public function getTotalBenefit(): ?string + { + return $this->container['totalBenefit']; + } + + /** + * Sets totalBenefit + * + * @param string|null $totalBenefit totalBenefit + * + * @return $this + */ + public function setTotalBenefit(?string $totalBenefit): static + { + if (is_null($totalBenefit)) { + array_push($this->openAPINullablesSetToNull, 'totalBenefit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalBenefit', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalBenefit'] = $totalBenefit; + + return $this; + } + + /** + * Gets amountDue + * + * @return \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment|null + */ + public function getAmountDue(): ?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment + { + return $this->container['amountDue']; + } + + /** + * Sets amountDue + * + * @param \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment|null $amountDue amountDue + * + * @return $this + */ + public function setAmountDue(?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment $amountDue): static + { + if (is_null($amountDue)) { + throw new InvalidArgumentException('non-nullable amountDue cannot be null'); + } + $this->container['amountDue'] = $amountDue; + + return $this; + } + + /** + * Gets amountNotDue + * + * @return \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment|null + */ + public function getAmountNotDue(): ?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment + { + return $this->container['amountNotDue']; + } + + /** + * Sets amountNotDue + * + * @param \SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment|null $amountNotDue amountNotDue + * + * @return $this + */ + public function setAmountNotDue(?\SynergiTech\Staffology\Model\ExbP11dbClass1AAdjustment $amountNotDue): static + { + if (is_null($amountNotDue)) { + throw new InvalidArgumentException('non-nullable amountNotDue cannot be null'); + } + $this->container['amountNotDue'] = $amountNotDue; + + return $this; + } + + /** + * Gets total + * + * @return string|null + */ + public function getTotal(): ?string + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param string|null $total total + * + * @return $this + */ + public function setTotal(?string $total): static + { + if (is_null($total)) { + array_push($this->openAPINullablesSetToNull, 'total'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('total', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets payable + * + * @return string|null + */ + public function getPayable(): ?string + { + return $this->container['payable']; + } + + /** + * Sets payable + * + * @param string|null $payable payable + * + * @return $this + */ + public function setPayable(?string $payable): static + { + if (is_null($payable)) { + array_push($this->openAPINullablesSetToNull, 'payable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payable'] = $payable; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbP11dbClass1ATotalBenefit.php b/src/Model/ExbP11dbClass1ATotalBenefit.php new file mode 100644 index 0000000..bfd321b --- /dev/null +++ b/src/Model/ExbP11dbClass1ATotalBenefit.php @@ -0,0 +1,456 @@ + + */ +class ExbP11dbClass1ATotalBenefit implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbP11dbClass1ATotalBenefit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'adjustmentRequired' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'adjustmentRequired' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'adjustmentRequired' => true, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'adjustmentRequired' => 'adjustmentRequired', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'adjustmentRequired' => 'setAdjustmentRequired', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'adjustmentRequired' => 'getAdjustmentRequired', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('adjustmentRequired', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets adjustmentRequired + * + * @return string|null + */ + public function getAdjustmentRequired(): ?string + { + return $this->container['adjustmentRequired']; + } + + /** + * Sets adjustmentRequired + * + * @param string|null $adjustmentRequired adjustmentRequired + * + * @return $this + */ + public function setAdjustmentRequired(?string $adjustmentRequired): static + { + if (is_null($adjustmentRequired)) { + array_push($this->openAPINullablesSetToNull, 'adjustmentRequired'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustmentRequired', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustmentRequired'] = $adjustmentRequired; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return $this + */ + public function setValue(?string $value): static + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExbReportResponse.php b/src/Model/ExbReportResponse.php new file mode 100644 index 0000000..f664169 --- /dev/null +++ b/src/Model/ExbReportResponse.php @@ -0,0 +1,532 @@ + + */ +class ExbReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExbReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\Exb', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\Exb|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\Exb + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\Exb|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\Exb $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExpensesAndBenefits.php b/src/Model/ExpensesAndBenefits.php new file mode 100644 index 0000000..9ef7f57 --- /dev/null +++ b/src/Model/ExpensesAndBenefits.php @@ -0,0 +1,626 @@ + + */ +class ExpensesAndBenefits implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExpensesAndBenefits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employer' => '\SynergiTech\Staffology\Model\ExbEmployer', + 'declarations' => '\SynergiTech\Staffology\Model\ExbDeclarations', + 'p11Db' => '\SynergiTech\Staffology\Model\ExbP11db', + 'p11DrecordCount' => 'int', + 'p46CarRecordCount' => 'int', + 'p11D' => '\SynergiTech\Staffology\Model\ExbP11d[]', + 'relatedTaxYear' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employer' => null, + 'declarations' => null, + 'p11Db' => null, + 'p11DrecordCount' => 'int32', + 'p46CarRecordCount' => 'int32', + 'p11D' => null, + 'relatedTaxYear' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employer' => false, + 'declarations' => false, + 'p11Db' => false, + 'p11DrecordCount' => false, + 'p46CarRecordCount' => false, + 'p11D' => true, + 'relatedTaxYear' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employer' => 'employer', + 'declarations' => 'declarations', + 'p11Db' => 'p11Db', + 'p11DrecordCount' => 'p11DrecordCount', + 'p46CarRecordCount' => 'p46CarRecordCount', + 'p11D' => 'p11D', + 'relatedTaxYear' => 'relatedTaxYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employer' => 'setEmployer', + 'declarations' => 'setDeclarations', + 'p11Db' => 'setP11Db', + 'p11DrecordCount' => 'setP11DrecordCount', + 'p46CarRecordCount' => 'setP46CarRecordCount', + 'p11D' => 'setP11D', + 'relatedTaxYear' => 'setRelatedTaxYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employer' => 'getEmployer', + 'declarations' => 'getDeclarations', + 'p11Db' => 'getP11Db', + 'p11DrecordCount' => 'getP11DrecordCount', + 'p46CarRecordCount' => 'getP46CarRecordCount', + 'p11D' => 'getP11D', + 'relatedTaxYear' => 'getRelatedTaxYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('declarations', $data ?? [], null); + $this->setIfExists('p11Db', $data ?? [], null); + $this->setIfExists('p11DrecordCount', $data ?? [], null); + $this->setIfExists('p46CarRecordCount', $data ?? [], null); + $this->setIfExists('p11D', $data ?? [], null); + $this->setIfExists('relatedTaxYear', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\ExbEmployer|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\ExbEmployer + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\ExbEmployer|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\ExbEmployer $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets declarations + * + * @return \SynergiTech\Staffology\Model\ExbDeclarations|null + */ + public function getDeclarations(): ?\SynergiTech\Staffology\Model\ExbDeclarations + { + return $this->container['declarations']; + } + + /** + * Sets declarations + * + * @param \SynergiTech\Staffology\Model\ExbDeclarations|null $declarations declarations + * + * @return $this + */ + public function setDeclarations(?\SynergiTech\Staffology\Model\ExbDeclarations $declarations): static + { + if (is_null($declarations)) { + throw new InvalidArgumentException('non-nullable declarations cannot be null'); + } + $this->container['declarations'] = $declarations; + + return $this; + } + + /** + * Gets p11Db + * + * @return \SynergiTech\Staffology\Model\ExbP11db|null + */ + public function getP11Db(): ?\SynergiTech\Staffology\Model\ExbP11db + { + return $this->container['p11Db']; + } + + /** + * Sets p11Db + * + * @param \SynergiTech\Staffology\Model\ExbP11db|null $p11Db p11Db + * + * @return $this + */ + public function setP11Db(?\SynergiTech\Staffology\Model\ExbP11db $p11Db): static + { + if (is_null($p11Db)) { + throw new InvalidArgumentException('non-nullable p11Db cannot be null'); + } + $this->container['p11Db'] = $p11Db; + + return $this; + } + + /** + * Gets p11DrecordCount + * + * @return int|null + */ + public function getP11DrecordCount(): ?int + { + return $this->container['p11DrecordCount']; + } + + /** + * Sets p11DrecordCount + * + * @param int|null $p11DrecordCount p11DrecordCount + * + * @return $this + */ + public function setP11DrecordCount(?int $p11DrecordCount): static + { + if (is_null($p11DrecordCount)) { + throw new InvalidArgumentException('non-nullable p11DrecordCount cannot be null'); + } + $this->container['p11DrecordCount'] = $p11DrecordCount; + + return $this; + } + + /** + * Gets p46CarRecordCount + * + * @return int|null + */ + public function getP46CarRecordCount(): ?int + { + return $this->container['p46CarRecordCount']; + } + + /** + * Sets p46CarRecordCount + * + * @param int|null $p46CarRecordCount p46CarRecordCount + * + * @return $this + */ + public function setP46CarRecordCount(?int $p46CarRecordCount): static + { + if (is_null($p46CarRecordCount)) { + throw new InvalidArgumentException('non-nullable p46CarRecordCount cannot be null'); + } + $this->container['p46CarRecordCount'] = $p46CarRecordCount; + + return $this; + } + + /** + * Gets p11D + * + * @return \SynergiTech\Staffology\Model\ExbP11d[]|null + */ + public function getP11D(): ?array + { + return $this->container['p11D']; + } + + /** + * Sets p11D + * + * @param \SynergiTech\Staffology\Model\ExbP11d[]|null $p11D p11D + * + * @return $this + */ + public function setP11D(?array $p11D): static + { + if (is_null($p11D)) { + array_push($this->openAPINullablesSetToNull, 'p11D'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('p11D', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['p11D'] = $p11D; + + return $this; + } + + /** + * Gets relatedTaxYear + * + * @return string|null + */ + public function getRelatedTaxYear(): ?string + { + return $this->container['relatedTaxYear']; + } + + /** + * Sets relatedTaxYear + * + * @param string|null $relatedTaxYear relatedTaxYear + * + * @return $this + */ + public function setRelatedTaxYear(?string $relatedTaxYear): static + { + if (is_null($relatedTaxYear)) { + array_push($this->openAPINullablesSetToNull, 'relatedTaxYear'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('relatedTaxYear', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['relatedTaxYear'] = $relatedTaxYear; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExternalDataCompany.php b/src/Model/ExternalDataCompany.php new file mode 100644 index 0000000..14ecc64 --- /dev/null +++ b/src/Model/ExternalDataCompany.php @@ -0,0 +1,498 @@ + + */ +class ExternalDataCompany implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExternalDataCompany'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'schemeName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'schemeName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => true, + 'name' => true, + 'schemeName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'schemeName' => 'schemeName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'schemeName' => 'setSchemeName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'schemeName' => 'getSchemeName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('schemeName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets schemeName + * + * @return string|null + */ + public function getSchemeName(): ?string + { + return $this->container['schemeName']; + } + + /** + * Sets schemeName + * + * @param string|null $schemeName schemeName + * + * @return $this + */ + public function setSchemeName(?string $schemeName): static + { + if (is_null($schemeName)) { + array_push($this->openAPINullablesSetToNull, 'schemeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('schemeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['schemeName'] = $schemeName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExternalDataProvider.php b/src/Model/ExternalDataProvider.php new file mode 100644 index 0000000..b1c3ab0 --- /dev/null +++ b/src/Model/ExternalDataProvider.php @@ -0,0 +1,756 @@ + + */ +class ExternalDataProvider implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExternalDataProvider'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'id' => '\SynergiTech\Staffology\Model\ExternalDataProviderId', + 'authScheme' => '\SynergiTech\Staffology\Model\AuthScheme', + 'logoUrl' => 'string', + 'iconUrl' => 'string', + 'connected' => 'bool', + 'connectedAs' => 'string', + 'requiresConfig' => 'bool', + 'deferralUrl' => 'string', + 'types' => '\SynergiTech\Staffology\Model\ExternalDataProviderType[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'id' => null, + 'authScheme' => null, + 'logoUrl' => null, + 'iconUrl' => null, + 'connected' => null, + 'connectedAs' => null, + 'requiresConfig' => null, + 'deferralUrl' => null, + 'types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'id' => false, + 'authScheme' => false, + 'logoUrl' => true, + 'iconUrl' => true, + 'connected' => false, + 'connectedAs' => true, + 'requiresConfig' => false, + 'deferralUrl' => true, + 'types' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'id' => 'id', + 'authScheme' => 'authScheme', + 'logoUrl' => 'logoUrl', + 'iconUrl' => 'iconUrl', + 'connected' => 'connected', + 'connectedAs' => 'connectedAs', + 'requiresConfig' => 'requiresConfig', + 'deferralUrl' => 'deferralUrl', + 'types' => 'types' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'id' => 'setId', + 'authScheme' => 'setAuthScheme', + 'logoUrl' => 'setLogoUrl', + 'iconUrl' => 'setIconUrl', + 'connected' => 'setConnected', + 'connectedAs' => 'setConnectedAs', + 'requiresConfig' => 'setRequiresConfig', + 'deferralUrl' => 'setDeferralUrl', + 'types' => 'setTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'id' => 'getId', + 'authScheme' => 'getAuthScheme', + 'logoUrl' => 'getLogoUrl', + 'iconUrl' => 'getIconUrl', + 'connected' => 'getConnected', + 'connectedAs' => 'getConnectedAs', + 'requiresConfig' => 'getRequiresConfig', + 'deferralUrl' => 'getDeferralUrl', + 'types' => 'getTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('authScheme', $data ?? [], null); + $this->setIfExists('logoUrl', $data ?? [], null); + $this->setIfExists('iconUrl', $data ?? [], null); + $this->setIfExists('connected', $data ?? [], null); + $this->setIfExists('connectedAs', $data ?? [], null); + $this->setIfExists('requiresConfig', $data ?? [], null); + $this->setIfExists('deferralUrl', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets id + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderId|null + */ + public function getId(): ?\SynergiTech\Staffology\Model\ExternalDataProviderId + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $id id + * + * @return $this + */ + public function setId(?\SynergiTech\Staffology\Model\ExternalDataProviderId $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets authScheme + * + * @return \SynergiTech\Staffology\Model\AuthScheme|null + */ + public function getAuthScheme(): ?\SynergiTech\Staffology\Model\AuthScheme + { + return $this->container['authScheme']; + } + + /** + * Sets authScheme + * + * @param \SynergiTech\Staffology\Model\AuthScheme|null $authScheme authScheme + * + * @return $this + */ + public function setAuthScheme(?\SynergiTech\Staffology\Model\AuthScheme $authScheme): static + { + if (is_null($authScheme)) { + throw new InvalidArgumentException('non-nullable authScheme cannot be null'); + } + $this->container['authScheme'] = $authScheme; + + return $this; + } + + /** + * Gets logoUrl + * + * @return string|null + */ + public function getLogoUrl(): ?string + { + return $this->container['logoUrl']; + } + + /** + * Sets logoUrl + * + * @param string|null $logoUrl logoUrl + * + * @return $this + */ + public function setLogoUrl(?string $logoUrl): static + { + if (is_null($logoUrl)) { + array_push($this->openAPINullablesSetToNull, 'logoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['logoUrl'] = $logoUrl; + + return $this; + } + + /** + * Gets iconUrl + * + * @return string|null + */ + public function getIconUrl(): ?string + { + return $this->container['iconUrl']; + } + + /** + * Sets iconUrl + * + * @param string|null $iconUrl iconUrl + * + * @return $this + */ + public function setIconUrl(?string $iconUrl): static + { + if (is_null($iconUrl)) { + array_push($this->openAPINullablesSetToNull, 'iconUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iconUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iconUrl'] = $iconUrl; + + return $this; + } + + /** + * Gets connected + * + * @return bool|null + */ + public function getConnected(): ?bool + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool|null $connected connected + * + * @return $this + */ + public function setConnected(?bool $connected): static + { + if (is_null($connected)) { + throw new InvalidArgumentException('non-nullable connected cannot be null'); + } + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets connectedAs + * + * @return string|null + */ + public function getConnectedAs(): ?string + { + return $this->container['connectedAs']; + } + + /** + * Sets connectedAs + * + * @param string|null $connectedAs connectedAs + * + * @return $this + */ + public function setConnectedAs(?string $connectedAs): static + { + if (is_null($connectedAs)) { + array_push($this->openAPINullablesSetToNull, 'connectedAs'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('connectedAs', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['connectedAs'] = $connectedAs; + + return $this; + } + + /** + * Gets requiresConfig + * + * @return bool|null + */ + public function getRequiresConfig(): ?bool + { + return $this->container['requiresConfig']; + } + + /** + * Sets requiresConfig + * + * @param bool|null $requiresConfig requiresConfig + * + * @return $this + */ + public function setRequiresConfig(?bool $requiresConfig): static + { + if (is_null($requiresConfig)) { + throw new InvalidArgumentException('non-nullable requiresConfig cannot be null'); + } + $this->container['requiresConfig'] = $requiresConfig; + + return $this; + } + + /** + * Gets deferralUrl + * + * @return string|null + */ + public function getDeferralUrl(): ?string + { + return $this->container['deferralUrl']; + } + + /** + * Sets deferralUrl + * + * @param string|null $deferralUrl deferralUrl + * + * @return $this + */ + public function setDeferralUrl(?string $deferralUrl): static + { + if (is_null($deferralUrl)) { + array_push($this->openAPINullablesSetToNull, 'deferralUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deferralUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deferralUrl'] = $deferralUrl; + + return $this; + } + + /** + * Gets types + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderType[]|null + */ + public function getTypes(): ?array + { + return $this->container['types']; + } + + /** + * Sets types + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderType[]|null $types types + * + * @return $this + */ + public function setTypes(?array $types): static + { + if (is_null($types)) { + array_push($this->openAPINullablesSetToNull, 'types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['types'] = $types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExternalDataProviderId.php b/src/Model/ExternalDataProviderId.php new file mode 100644 index 0000000..ead3cea --- /dev/null +++ b/src/Model/ExternalDataProviderId.php @@ -0,0 +1,105 @@ + + */ +class ExternalEmployeeMapping implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExternalEmployeeMapping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'externalId' => 'string', + 'providerId' => '\SynergiTech\Staffology\Model\ExternalDataProviderId', + 'status' => '\SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'externalEmployee' => '\SynergiTech\Staffology\Model\Employee', + 'lastSyncDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'externalId' => null, + 'providerId' => null, + 'status' => null, + 'employee' => null, + 'externalEmployee' => null, + 'lastSyncDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'externalId' => true, + 'providerId' => false, + 'status' => false, + 'employee' => false, + 'externalEmployee' => false, + 'lastSyncDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'externalId' => 'externalId', + 'providerId' => 'providerId', + 'status' => 'status', + 'employee' => 'employee', + 'externalEmployee' => 'externalEmployee', + 'lastSyncDate' => 'lastSyncDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'externalId' => 'setExternalId', + 'providerId' => 'setProviderId', + 'status' => 'setStatus', + 'employee' => 'setEmployee', + 'externalEmployee' => 'setExternalEmployee', + 'lastSyncDate' => 'setLastSyncDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'externalId' => 'getExternalId', + 'providerId' => 'getProviderId', + 'status' => 'getStatus', + 'employee' => 'getEmployee', + 'externalEmployee' => 'getExternalEmployee', + 'lastSyncDate' => 'getLastSyncDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('externalId', $data ?? [], null); + $this->setIfExists('providerId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('externalEmployee', $data ?? [], null); + $this->setIfExists('lastSyncDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets externalId + * + * @return string|null + */ + public function getExternalId(): ?string + { + return $this->container['externalId']; + } + + /** + * Sets externalId + * + * @param string|null $externalId [readonly] The id for the employee in the external system + * + * @return $this + */ + public function setExternalId(?string $externalId): static + { + if (is_null($externalId)) { + array_push($this->openAPINullablesSetToNull, 'externalId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('externalId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['externalId'] = $externalId; + + return $this; + } + + /** + * Gets providerId + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderId|null + */ + public function getProviderId(): ?\SynergiTech\Staffology\Model\ExternalDataProviderId + { + return $this->container['providerId']; + } + + /** + * Sets providerId + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId providerId + * + * @return $this + */ + public function setProviderId(?\SynergiTech\Staffology\Model\ExternalDataProviderId $providerId): static + { + if (is_null($providerId)) { + throw new InvalidArgumentException('non-nullable providerId cannot be null'); + } + $this->container['providerId'] = $providerId; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\ExternalEmployeeMappingStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets externalEmployee + * + * @return \SynergiTech\Staffology\Model\Employee|null + */ + public function getExternalEmployee(): ?\SynergiTech\Staffology\Model\Employee + { + return $this->container['externalEmployee']; + } + + /** + * Sets externalEmployee + * + * @param \SynergiTech\Staffology\Model\Employee|null $externalEmployee externalEmployee + * + * @return $this + */ + public function setExternalEmployee(?\SynergiTech\Staffology\Model\Employee $externalEmployee): static + { + if (is_null($externalEmployee)) { + throw new InvalidArgumentException('non-nullable externalEmployee cannot be null'); + } + $this->container['externalEmployee'] = $externalEmployee; + + return $this; + } + + /** + * Gets lastSyncDate + * + * @return \DateTime|null + */ + public function getLastSyncDate(): ?\DateTime + { + return $this->container['lastSyncDate']; + } + + /** + * Sets lastSyncDate + * + * @param \DateTime|null $lastSyncDate [readonly] The date and time this mapping was last synchronised + * + * @return $this + */ + public function setLastSyncDate(?\DateTime $lastSyncDate): static + { + if (is_null($lastSyncDate)) { + array_push($this->openAPINullablesSetToNull, 'lastSyncDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastSyncDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastSyncDate'] = $lastSyncDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ExternalEmployeeMappingStatus.php b/src/Model/ExternalEmployeeMappingStatus.php new file mode 100644 index 0000000..b546548 --- /dev/null +++ b/src/Model/ExternalEmployeeMappingStatus.php @@ -0,0 +1,49 @@ + + */ +class ExternalProviderConversation implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExternalProviderConversation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'contentType' => 'string', + 'url' => 'string', + 'request' => 'string', + 'response' => 'string', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusMessage' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'contentType' => null, + 'url' => null, + 'request' => null, + 'response' => null, + 'status' => null, + 'statusMessage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => true, + 'contentType' => true, + 'url' => true, + 'request' => true, + 'response' => true, + 'status' => false, + 'statusMessage' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'contentType' => 'contentType', + 'url' => 'url', + 'request' => 'request', + 'response' => 'response', + 'status' => 'status', + 'statusMessage' => 'statusMessage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'contentType' => 'setContentType', + 'url' => 'setUrl', + 'request' => 'setRequest', + 'response' => 'setResponse', + 'status' => 'setStatus', + 'statusMessage' => 'setStatusMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'contentType' => 'getContentType', + 'url' => 'getUrl', + 'request' => 'getRequest', + 'response' => 'getResponse', + 'status' => 'getStatus', + 'statusMessage' => 'getStatusMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('contentType', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('request', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets contentType + * + * @return string|null + */ + public function getContentType(): ?string + { + return $this->container['contentType']; + } + + /** + * Sets contentType + * + * @param string|null $contentType contentType + * + * @return $this + */ + public function setContentType(?string $contentType): static + { + if (is_null($contentType)) { + array_push($this->openAPINullablesSetToNull, 'contentType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contentType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contentType'] = $contentType; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets request + * + * @return string|null + */ + public function getRequest(): ?string + { + return $this->container['request']; + } + + /** + * Sets request + * + * @param string|null $request request + * + * @return $this + */ + public function setRequest(?string $request): static + { + if (is_null($request)) { + array_push($this->openAPINullablesSetToNull, 'request'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['request'] = $request; + + return $this; + } + + /** + * Gets response + * + * @return string|null + */ + public function getResponse(): ?string + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param string|null $response response + * + * @return $this + */ + public function setResponse(?string $response): static + { + if (is_null($response)) { + array_push($this->openAPINullablesSetToNull, 'response'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('response', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage statusMessage + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FieldModification.php b/src/Model/FieldModification.php new file mode 100644 index 0000000..f0506eb --- /dev/null +++ b/src/Model/FieldModification.php @@ -0,0 +1,531 @@ + + */ +class FieldModification implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldModification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fieldName' => 'string', + 'isSignificant' => 'bool', + 'oldValue' => 'string', + 'newValue' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fieldName' => null, + 'isSignificant' => null, + 'oldValue' => null, + 'newValue' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fieldName' => true, + 'isSignificant' => false, + 'oldValue' => true, + 'newValue' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fieldName' => 'fieldName', + 'isSignificant' => 'isSignificant', + 'oldValue' => 'oldValue', + 'newValue' => 'newValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fieldName' => 'setFieldName', + 'isSignificant' => 'setIsSignificant', + 'oldValue' => 'setOldValue', + 'newValue' => 'setNewValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fieldName' => 'getFieldName', + 'isSignificant' => 'getIsSignificant', + 'oldValue' => 'getOldValue', + 'newValue' => 'getNewValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fieldName', $data ?? [], null); + $this->setIfExists('isSignificant', $data ?? [], null); + $this->setIfExists('oldValue', $data ?? [], null); + $this->setIfExists('newValue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fieldName + * + * @return string|null + */ + public function getFieldName(): ?string + { + return $this->container['fieldName']; + } + + /** + * Sets fieldName + * + * @param string|null $fieldName fieldName + * + * @return $this + */ + public function setFieldName(?string $fieldName): static + { + if (is_null($fieldName)) { + array_push($this->openAPINullablesSetToNull, 'fieldName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fieldName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fieldName'] = $fieldName; + + return $this; + } + + /** + * Gets isSignificant + * + * @return bool|null + */ + public function getIsSignificant(): ?bool + { + return $this->container['isSignificant']; + } + + /** + * Sets isSignificant + * + * @param bool|null $isSignificant isSignificant + * + * @return $this + */ + public function setIsSignificant(?bool $isSignificant): static + { + if (is_null($isSignificant)) { + throw new InvalidArgumentException('non-nullable isSignificant cannot be null'); + } + $this->container['isSignificant'] = $isSignificant; + + return $this; + } + + /** + * Gets oldValue + * + * @return string|null + */ + public function getOldValue(): ?string + { + return $this->container['oldValue']; + } + + /** + * Sets oldValue + * + * @param string|null $oldValue oldValue + * + * @return $this + */ + public function setOldValue(?string $oldValue): static + { + if (is_null($oldValue)) { + array_push($this->openAPINullablesSetToNull, 'oldValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('oldValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['oldValue'] = $oldValue; + + return $this; + } + + /** + * Gets newValue + * + * @return string|null + */ + public function getNewValue(): ?string + { + return $this->container['newValue']; + } + + /** + * Sets newValue + * + * @param string|null $newValue newValue + * + * @return $this + */ + public function setNewValue(?string $newValue): static + { + if (is_null($newValue)) { + array_push($this->openAPINullablesSetToNull, 'newValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('newValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['newValue'] = $newValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FixedCode.php b/src/Model/FixedCode.php new file mode 100644 index 0000000..d161b2e --- /dev/null +++ b/src/Model/FixedCode.php @@ -0,0 +1,450 @@ + + */ +class FixedCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FixedCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'rate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'rate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => true, + 'rate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'rate' => 'rate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'rate' => 'setRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'rate' => 'getRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code [readonly] + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate [readonly] + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FlexibleDrawdown.php b/src/Model/FlexibleDrawdown.php new file mode 100644 index 0000000..70023b7 --- /dev/null +++ b/src/Model/FlexibleDrawdown.php @@ -0,0 +1,49 @@ + + */ +class Fps implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Fps'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lateReason' => '\SynergiTech\Staffology\Model\FpsLateReason', + 'paymentDate' => '\DateTime', + 'overridePaymentDate' => '\DateTime', + 'employeeCount' => 'int', + 'isCorrection' => 'bool', + 'supersededCount' => 'int', + 'fullPaymentSubmission' => '\SynergiTech\Staffology\Model\FullPaymentSubmission', + 'versions' => '\SynergiTech\Staffology\Model\FpsPriorVersion[]', + 'validationWarnings' => '\SynergiTech\Staffology\Model\RtiValidationWarning[]', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lateReason' => null, + 'paymentDate' => 'date', + 'overridePaymentDate' => 'date', + 'employeeCount' => 'int32', + 'isCorrection' => null, + 'supersededCount' => 'int32', + 'fullPaymentSubmission' => null, + 'versions' => null, + 'validationWarnings' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lateReason' => false, + 'paymentDate' => false, + 'overridePaymentDate' => true, + 'employeeCount' => false, + 'isCorrection' => false, + 'supersededCount' => false, + 'fullPaymentSubmission' => false, + 'versions' => true, + 'validationWarnings' => true, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lateReason' => 'lateReason', + 'paymentDate' => 'paymentDate', + 'overridePaymentDate' => 'overridePaymentDate', + 'employeeCount' => 'employeeCount', + 'isCorrection' => 'isCorrection', + 'supersededCount' => 'supersededCount', + 'fullPaymentSubmission' => 'fullPaymentSubmission', + 'versions' => 'versions', + 'validationWarnings' => 'validationWarnings', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lateReason' => 'setLateReason', + 'paymentDate' => 'setPaymentDate', + 'overridePaymentDate' => 'setOverridePaymentDate', + 'employeeCount' => 'setEmployeeCount', + 'isCorrection' => 'setIsCorrection', + 'supersededCount' => 'setSupersededCount', + 'fullPaymentSubmission' => 'setFullPaymentSubmission', + 'versions' => 'setVersions', + 'validationWarnings' => 'setValidationWarnings', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lateReason' => 'getLateReason', + 'paymentDate' => 'getPaymentDate', + 'overridePaymentDate' => 'getOverridePaymentDate', + 'employeeCount' => 'getEmployeeCount', + 'isCorrection' => 'getIsCorrection', + 'supersededCount' => 'getSupersededCount', + 'fullPaymentSubmission' => 'getFullPaymentSubmission', + 'versions' => 'getVersions', + 'validationWarnings' => 'getValidationWarnings', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lateReason', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('overridePaymentDate', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('isCorrection', $data ?? [], null); + $this->setIfExists('supersededCount', $data ?? [], null); + $this->setIfExists('fullPaymentSubmission', $data ?? [], null); + $this->setIfExists('versions', $data ?? [], null); + $this->setIfExists('validationWarnings', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lateReason + * + * @return \SynergiTech\Staffology\Model\FpsLateReason|null + */ + public function getLateReason(): ?\SynergiTech\Staffology\Model\FpsLateReason + { + return $this->container['lateReason']; + } + + /** + * Sets lateReason + * + * @param \SynergiTech\Staffology\Model\FpsLateReason|null $lateReason lateReason + * + * @return $this + */ + public function setLateReason(?\SynergiTech\Staffology\Model\FpsLateReason $lateReason): static + { + if (is_null($lateReason)) { + throw new InvalidArgumentException('non-nullable lateReason cannot be null'); + } + $this->container['lateReason'] = $lateReason; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate paymentDate + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets overridePaymentDate + * + * @return \DateTime|null + */ + public function getOverridePaymentDate(): ?\DateTime + { + return $this->container['overridePaymentDate']; + } + + /** + * Sets overridePaymentDate + * + * @param \DateTime|null $overridePaymentDate If a value if provided here then it will be used in place of the actual PaymentDate on the FPS. The value must fall in to the same Tax Period as the PaymentDate + * + * @return $this + */ + public function setOverridePaymentDate(?\DateTime $overridePaymentDate): static + { + if (is_null($overridePaymentDate)) { + array_push($this->openAPINullablesSetToNull, 'overridePaymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overridePaymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['overridePaymentDate'] = $overridePaymentDate; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount employeeCount + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets isCorrection + * + * @return bool|null + */ + public function getIsCorrection(): ?bool + { + return $this->container['isCorrection']; + } + + /** + * Sets isCorrection + * + * @param bool|null $isCorrection isCorrection + * + * @return $this + */ + public function setIsCorrection(?bool $isCorrection): static + { + if (is_null($isCorrection)) { + throw new InvalidArgumentException('non-nullable isCorrection cannot be null'); + } + $this->container['isCorrection'] = $isCorrection; + + return $this; + } + + /** + * Gets supersededCount + * + * @return int|null + */ + public function getSupersededCount(): ?int + { + return $this->container['supersededCount']; + } + + /** + * Sets supersededCount + * + * @param int|null $supersededCount The number of payments on this FPS that have been superseded by later versions + * + * @return $this + */ + public function setSupersededCount(?int $supersededCount): static + { + if (is_null($supersededCount)) { + throw new InvalidArgumentException('non-nullable supersededCount cannot be null'); + } + $this->container['supersededCount'] = $supersededCount; + + return $this; + } + + /** + * Gets fullPaymentSubmission + * + * @return \SynergiTech\Staffology\Model\FullPaymentSubmission|null + */ + public function getFullPaymentSubmission(): ?\SynergiTech\Staffology\Model\FullPaymentSubmission + { + return $this->container['fullPaymentSubmission']; + } + + /** + * Sets fullPaymentSubmission + * + * @param \SynergiTech\Staffology\Model\FullPaymentSubmission|null $fullPaymentSubmission fullPaymentSubmission + * + * @return $this + */ + public function setFullPaymentSubmission(?\SynergiTech\Staffology\Model\FullPaymentSubmission $fullPaymentSubmission): static + { + if (is_null($fullPaymentSubmission)) { + throw new InvalidArgumentException('non-nullable fullPaymentSubmission cannot be null'); + } + $this->container['fullPaymentSubmission'] = $fullPaymentSubmission; + + return $this; + } + + /** + * Gets versions + * + * @return \SynergiTech\Staffology\Model\FpsPriorVersion[]|null + */ + public function getVersions(): ?array + { + return $this->container['versions']; + } + + /** + * Sets versions + * + * @param \SynergiTech\Staffology\Model\FpsPriorVersion[]|null $versions If any of the payments on this FPS appear on another FPS then then there will be an entry here for each of them. If there is an entry where the FpsId matches this FPS then that means the FpsEmployee on this Fps is itself a prior version (ie, it's been superseded) + * + * @return $this + */ + public function setVersions(?array $versions): static + { + if (is_null($versions)) { + array_push($this->openAPINullablesSetToNull, 'versions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('versions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['versions'] = $versions; + + return $this; + } + + /** + * Gets validationWarnings + * + * @return \SynergiTech\Staffology\Model\RtiValidationWarning[]|null + */ + public function getValidationWarnings(): ?array + { + return $this->container['validationWarnings']; + } + + /** + * Sets validationWarnings + * + * @param \SynergiTech\Staffology\Model\RtiValidationWarning[]|null $validationWarnings validationWarnings + * + * @return $this + */ + public function setValidationWarnings(?array $validationWarnings): static + { + if (is_null($validationWarnings)) { + array_push($this->openAPINullablesSetToNull, 'validationWarnings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validationWarnings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['validationWarnings'] = $validationWarnings; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsBenefit.php b/src/Model/FpsBenefit.php new file mode 100644 index 0000000..9e05636 --- /dev/null +++ b/src/Model/FpsBenefit.php @@ -0,0 +1,415 @@ + + */ +class FpsBenefit implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsBenefit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'car' => '\SynergiTech\Staffology\Model\FpsCar[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'car' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'car' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'car' => 'car' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'car' => 'setCar' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'car' => 'getCar' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('car', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets car + * + * @return \SynergiTech\Staffology\Model\FpsCar[]|null + */ + public function getCar(): ?array + { + return $this->container['car']; + } + + /** + * Sets car + * + * @param \SynergiTech\Staffology\Model\FpsCar[]|null $car car + * + * @return $this + */ + public function setCar(?array $car): static + { + if (is_null($car)) { + array_push($this->openAPINullablesSetToNull, 'car'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('car', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['car'] = $car; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsCar.php b/src/Model/FpsCar.php new file mode 100644 index 0000000..4640624 --- /dev/null +++ b/src/Model/FpsCar.php @@ -0,0 +1,859 @@ + + */ +class FpsCar implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsCar'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'make' => 'string', + 'firstRegd' => 'string', + 'cO2' => 'string', + 'zeroEmissionsMileage' => 'string', + 'fuel' => 'string', + 'id' => 'string', + 'amendment' => 'string', + 'price' => 'string', + 'availFrom' => 'string', + 'cashEquiv' => 'string', + 'availTo' => 'string', + 'freeFuel' => '\SynergiTech\Staffology\Model\FpsCarFuel' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'make' => null, + 'firstRegd' => null, + 'cO2' => null, + 'zeroEmissionsMileage' => null, + 'fuel' => null, + 'id' => null, + 'amendment' => null, + 'price' => null, + 'availFrom' => null, + 'cashEquiv' => null, + 'availTo' => null, + 'freeFuel' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'make' => true, + 'firstRegd' => true, + 'cO2' => true, + 'zeroEmissionsMileage' => true, + 'fuel' => true, + 'id' => true, + 'amendment' => true, + 'price' => true, + 'availFrom' => true, + 'cashEquiv' => true, + 'availTo' => true, + 'freeFuel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'make' => 'make', + 'firstRegd' => 'firstRegd', + 'cO2' => 'cO2', + 'zeroEmissionsMileage' => 'zeroEmissionsMileage', + 'fuel' => 'fuel', + 'id' => 'id', + 'amendment' => 'amendment', + 'price' => 'price', + 'availFrom' => 'availFrom', + 'cashEquiv' => 'cashEquiv', + 'availTo' => 'availTo', + 'freeFuel' => 'freeFuel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'make' => 'setMake', + 'firstRegd' => 'setFirstRegd', + 'cO2' => 'setCO2', + 'zeroEmissionsMileage' => 'setZeroEmissionsMileage', + 'fuel' => 'setFuel', + 'id' => 'setId', + 'amendment' => 'setAmendment', + 'price' => 'setPrice', + 'availFrom' => 'setAvailFrom', + 'cashEquiv' => 'setCashEquiv', + 'availTo' => 'setAvailTo', + 'freeFuel' => 'setFreeFuel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'make' => 'getMake', + 'firstRegd' => 'getFirstRegd', + 'cO2' => 'getCO2', + 'zeroEmissionsMileage' => 'getZeroEmissionsMileage', + 'fuel' => 'getFuel', + 'id' => 'getId', + 'amendment' => 'getAmendment', + 'price' => 'getPrice', + 'availFrom' => 'getAvailFrom', + 'cashEquiv' => 'getCashEquiv', + 'availTo' => 'getAvailTo', + 'freeFuel' => 'getFreeFuel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('make', $data ?? [], null); + $this->setIfExists('firstRegd', $data ?? [], null); + $this->setIfExists('cO2', $data ?? [], null); + $this->setIfExists('zeroEmissionsMileage', $data ?? [], null); + $this->setIfExists('fuel', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('amendment', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('availFrom', $data ?? [], null); + $this->setIfExists('cashEquiv', $data ?? [], null); + $this->setIfExists('availTo', $data ?? [], null); + $this->setIfExists('freeFuel', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets make + * + * @return string|null + */ + public function getMake(): ?string + { + return $this->container['make']; + } + + /** + * Sets make + * + * @param string|null $make make + * + * @return $this + */ + public function setMake(?string $make): static + { + if (is_null($make)) { + array_push($this->openAPINullablesSetToNull, 'make'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('make', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['make'] = $make; + + return $this; + } + + /** + * Gets firstRegd + * + * @return string|null + */ + public function getFirstRegd(): ?string + { + return $this->container['firstRegd']; + } + + /** + * Sets firstRegd + * + * @param string|null $firstRegd firstRegd + * + * @return $this + */ + public function setFirstRegd(?string $firstRegd): static + { + if (is_null($firstRegd)) { + array_push($this->openAPINullablesSetToNull, 'firstRegd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstRegd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstRegd'] = $firstRegd; + + return $this; + } + + /** + * Gets cO2 + * + * @return string|null + */ + public function getCO2(): ?string + { + return $this->container['cO2']; + } + + /** + * Sets cO2 + * + * @param string|null $cO2 cO2 + * + * @return $this + */ + public function setCO2(?string $cO2): static + { + if (is_null($cO2)) { + array_push($this->openAPINullablesSetToNull, 'cO2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cO2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cO2'] = $cO2; + + return $this; + } + + /** + * Gets zeroEmissionsMileage + * + * @return string|null + */ + public function getZeroEmissionsMileage(): ?string + { + return $this->container['zeroEmissionsMileage']; + } + + /** + * Sets zeroEmissionsMileage + * + * @param string|null $zeroEmissionsMileage zeroEmissionsMileage + * + * @return $this + */ + public function setZeroEmissionsMileage(?string $zeroEmissionsMileage): static + { + if (is_null($zeroEmissionsMileage)) { + array_push($this->openAPINullablesSetToNull, 'zeroEmissionsMileage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('zeroEmissionsMileage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['zeroEmissionsMileage'] = $zeroEmissionsMileage; + + return $this; + } + + /** + * Gets fuel + * + * @return string|null + */ + public function getFuel(): ?string + { + return $this->container['fuel']; + } + + /** + * Sets fuel + * + * @param string|null $fuel fuel + * + * @return $this + */ + public function setFuel(?string $fuel): static + { + if (is_null($fuel)) { + array_push($this->openAPINullablesSetToNull, 'fuel'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuel', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuel'] = $fuel; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets amendment + * + * @return string|null + */ + public function getAmendment(): ?string + { + return $this->container['amendment']; + } + + /** + * Sets amendment + * + * @param string|null $amendment amendment + * + * @return $this + */ + public function setAmendment(?string $amendment): static + { + if (is_null($amendment)) { + array_push($this->openAPINullablesSetToNull, 'amendment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('amendment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['amendment'] = $amendment; + + return $this; + } + + /** + * Gets price + * + * @return string|null + */ + public function getPrice(): ?string + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param string|null $price price + * + * @return $this + */ + public function setPrice(?string $price): static + { + if (is_null($price)) { + array_push($this->openAPINullablesSetToNull, 'price'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('price', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets availFrom + * + * @return string|null + */ + public function getAvailFrom(): ?string + { + return $this->container['availFrom']; + } + + /** + * Sets availFrom + * + * @param string|null $availFrom availFrom + * + * @return $this + */ + public function setAvailFrom(?string $availFrom): static + { + if (is_null($availFrom)) { + array_push($this->openAPINullablesSetToNull, 'availFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availFrom'] = $availFrom; + + return $this; + } + + /** + * Gets cashEquiv + * + * @return string|null + */ + public function getCashEquiv(): ?string + { + return $this->container['cashEquiv']; + } + + /** + * Sets cashEquiv + * + * @param string|null $cashEquiv cashEquiv + * + * @return $this + */ + public function setCashEquiv(?string $cashEquiv): static + { + if (is_null($cashEquiv)) { + array_push($this->openAPINullablesSetToNull, 'cashEquiv'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquiv', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquiv'] = $cashEquiv; + + return $this; + } + + /** + * Gets availTo + * + * @return string|null + */ + public function getAvailTo(): ?string + { + return $this->container['availTo']; + } + + /** + * Sets availTo + * + * @param string|null $availTo availTo + * + * @return $this + */ + public function setAvailTo(?string $availTo): static + { + if (is_null($availTo)) { + array_push($this->openAPINullablesSetToNull, 'availTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availTo'] = $availTo; + + return $this; + } + + /** + * Gets freeFuel + * + * @return \SynergiTech\Staffology\Model\FpsCarFuel|null + */ + public function getFreeFuel(): ?\SynergiTech\Staffology\Model\FpsCarFuel + { + return $this->container['freeFuel']; + } + + /** + * Sets freeFuel + * + * @param \SynergiTech\Staffology\Model\FpsCarFuel|null $freeFuel freeFuel + * + * @return $this + */ + public function setFreeFuel(?\SynergiTech\Staffology\Model\FpsCarFuel $freeFuel): static + { + if (is_null($freeFuel)) { + throw new InvalidArgumentException('non-nullable freeFuel cannot be null'); + } + $this->container['freeFuel'] = $freeFuel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsCarFuel.php b/src/Model/FpsCarFuel.php new file mode 100644 index 0000000..03253f7 --- /dev/null +++ b/src/Model/FpsCarFuel.php @@ -0,0 +1,497 @@ + + */ +class FpsCarFuel implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsCarFuel'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'provided' => 'string', + 'cashEquiv' => 'string', + 'withdrawn' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'provided' => null, + 'cashEquiv' => null, + 'withdrawn' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'provided' => true, + 'cashEquiv' => true, + 'withdrawn' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'provided' => 'provided', + 'cashEquiv' => 'cashEquiv', + 'withdrawn' => 'withdrawn' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'provided' => 'setProvided', + 'cashEquiv' => 'setCashEquiv', + 'withdrawn' => 'setWithdrawn' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'provided' => 'getProvided', + 'cashEquiv' => 'getCashEquiv', + 'withdrawn' => 'getWithdrawn' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('provided', $data ?? [], null); + $this->setIfExists('cashEquiv', $data ?? [], null); + $this->setIfExists('withdrawn', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provided + * + * @return string|null + */ + public function getProvided(): ?string + { + return $this->container['provided']; + } + + /** + * Sets provided + * + * @param string|null $provided provided + * + * @return $this + */ + public function setProvided(?string $provided): static + { + if (is_null($provided)) { + array_push($this->openAPINullablesSetToNull, 'provided'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('provided', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['provided'] = $provided; + + return $this; + } + + /** + * Gets cashEquiv + * + * @return string|null + */ + public function getCashEquiv(): ?string + { + return $this->container['cashEquiv']; + } + + /** + * Sets cashEquiv + * + * @param string|null $cashEquiv cashEquiv + * + * @return $this + */ + public function setCashEquiv(?string $cashEquiv): static + { + if (is_null($cashEquiv)) { + array_push($this->openAPINullablesSetToNull, 'cashEquiv'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquiv', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquiv'] = $cashEquiv; + + return $this; + } + + /** + * Gets withdrawn + * + * @return string|null + */ + public function getWithdrawn(): ?string + { + return $this->container['withdrawn']; + } + + /** + * Sets withdrawn + * + * @param string|null $withdrawn withdrawn + * + * @return $this + */ + public function setWithdrawn(?string $withdrawn): static + { + if (is_null($withdrawn)) { + array_push($this->openAPINullablesSetToNull, 'withdrawn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('withdrawn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['withdrawn'] = $withdrawn; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployee.php b/src/Model/FpsEmployee.php new file mode 100644 index 0000000..d46c2a6 --- /dev/null +++ b/src/Model/FpsEmployee.php @@ -0,0 +1,585 @@ + + */ +class FpsEmployee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrunEntryId' => 'string', + 'employeeUniqueId' => 'string', + 'item' => '\SynergiTech\Staffology\Model\Item', + 'employeeDetails' => '\SynergiTech\Staffology\Model\FpsEmployeeDetails', + 'employment' => '\SynergiTech\Staffology\Model\FpsEmployment', + 'validationWarnings' => '\SynergiTech\Staffology\Model\RtiValidationWarning[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrunEntryId' => 'uuid', + 'employeeUniqueId' => 'uuid', + 'item' => null, + 'employeeDetails' => null, + 'employment' => null, + 'validationWarnings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrunEntryId' => false, + 'employeeUniqueId' => false, + 'item' => false, + 'employeeDetails' => false, + 'employment' => false, + 'validationWarnings' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrunEntryId' => 'payrunEntryId', + 'employeeUniqueId' => 'employeeUniqueId', + 'item' => 'item', + 'employeeDetails' => 'employeeDetails', + 'employment' => 'employment', + 'validationWarnings' => 'validationWarnings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrunEntryId' => 'setPayrunEntryId', + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'item' => 'setItem', + 'employeeDetails' => 'setEmployeeDetails', + 'employment' => 'setEmployment', + 'validationWarnings' => 'setValidationWarnings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrunEntryId' => 'getPayrunEntryId', + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'item' => 'getItem', + 'employeeDetails' => 'getEmployeeDetails', + 'employment' => 'getEmployment', + 'validationWarnings' => 'getValidationWarnings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrunEntryId', $data ?? [], null); + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('item', $data ?? [], null); + $this->setIfExists('employeeDetails', $data ?? [], null); + $this->setIfExists('employment', $data ?? [], null); + $this->setIfExists('validationWarnings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrunEntryId + * + * @return string|null + */ + public function getPayrunEntryId(): ?string + { + return $this->container['payrunEntryId']; + } + + /** + * Sets payrunEntryId + * + * @param string|null $payrunEntryId payrunEntryId + * + * @return $this + */ + public function setPayrunEntryId(?string $payrunEntryId): static + { + if (is_null($payrunEntryId)) { + throw new InvalidArgumentException('non-nullable payrunEntryId cannot be null'); + } + $this->container['payrunEntryId'] = $payrunEntryId; + + return $this; + } + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId employeeUniqueId + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets item + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getItem(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \SynergiTech\Staffology\Model\Item|null $item item + * + * @return $this + */ + public function setItem(?\SynergiTech\Staffology\Model\Item $item): static + { + if (is_null($item)) { + throw new InvalidArgumentException('non-nullable item cannot be null'); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets employeeDetails + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeDetails|null + */ + public function getEmployeeDetails(): ?\SynergiTech\Staffology\Model\FpsEmployeeDetails + { + return $this->container['employeeDetails']; + } + + /** + * Sets employeeDetails + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeDetails|null $employeeDetails employeeDetails + * + * @return $this + */ + public function setEmployeeDetails(?\SynergiTech\Staffology\Model\FpsEmployeeDetails $employeeDetails): static + { + if (is_null($employeeDetails)) { + throw new InvalidArgumentException('non-nullable employeeDetails cannot be null'); + } + $this->container['employeeDetails'] = $employeeDetails; + + return $this; + } + + /** + * Gets employment + * + * @return \SynergiTech\Staffology\Model\FpsEmployment|null + */ + public function getEmployment(): ?\SynergiTech\Staffology\Model\FpsEmployment + { + return $this->container['employment']; + } + + /** + * Sets employment + * + * @param \SynergiTech\Staffology\Model\FpsEmployment|null $employment employment + * + * @return $this + */ + public function setEmployment(?\SynergiTech\Staffology\Model\FpsEmployment $employment): static + { + if (is_null($employment)) { + throw new InvalidArgumentException('non-nullable employment cannot be null'); + } + $this->container['employment'] = $employment; + + return $this; + } + + /** + * Gets validationWarnings + * + * @return \SynergiTech\Staffology\Model\RtiValidationWarning[]|null + */ + public function getValidationWarnings(): ?array + { + return $this->container['validationWarnings']; + } + + /** + * Sets validationWarnings + * + * @param \SynergiTech\Staffology\Model\RtiValidationWarning[]|null $validationWarnings validationWarnings + * + * @return $this + */ + public function setValidationWarnings(?array $validationWarnings): static + { + if (is_null($validationWarnings)) { + array_push($this->openAPINullablesSetToNull, 'validationWarnings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validationWarnings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['validationWarnings'] = $validationWarnings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeDetails.php b/src/Model/FpsEmployeeDetails.php new file mode 100644 index 0000000..e76f2c6 --- /dev/null +++ b/src/Model/FpsEmployeeDetails.php @@ -0,0 +1,640 @@ + + */ +class FpsEmployeeDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nino' => 'string', + 'name' => '\SynergiTech\Staffology\Model\RtiEmployeeName', + 'address' => '\SynergiTech\Staffology\Model\RtiEmployeeAddress', + 'birthDate' => 'string', + 'gender' => 'string', + 'passportNumber' => 'string', + 'partnerDetails' => '\SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nino' => null, + 'name' => null, + 'address' => null, + 'birthDate' => null, + 'gender' => null, + 'passportNumber' => null, + 'partnerDetails' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nino' => true, + 'name' => false, + 'address' => false, + 'birthDate' => true, + 'gender' => true, + 'passportNumber' => true, + 'partnerDetails' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nino' => 'nino', + 'name' => 'name', + 'address' => 'address', + 'birthDate' => 'birthDate', + 'gender' => 'gender', + 'passportNumber' => 'passportNumber', + 'partnerDetails' => 'partnerDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nino' => 'setNino', + 'name' => 'setName', + 'address' => 'setAddress', + 'birthDate' => 'setBirthDate', + 'gender' => 'setGender', + 'passportNumber' => 'setPassportNumber', + 'partnerDetails' => 'setPartnerDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nino' => 'getNino', + 'name' => 'getName', + 'address' => 'getAddress', + 'birthDate' => 'getBirthDate', + 'gender' => 'getGender', + 'passportNumber' => 'getPassportNumber', + 'partnerDetails' => 'getPartnerDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('birthDate', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('passportNumber', $data ?? [], null); + $this->setIfExists('partnerDetails', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\RtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\RtiEmployeeAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\RtiEmployeeAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets birthDate + * + * @return string|null + */ + public function getBirthDate(): ?string + { + return $this->container['birthDate']; + } + + /** + * Sets birthDate + * + * @param string|null $birthDate birthDate + * + * @return $this + */ + public function setBirthDate(?string $birthDate): static + { + if (is_null($birthDate)) { + array_push($this->openAPINullablesSetToNull, 'birthDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('birthDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['birthDate'] = $birthDate; + + return $this; + } + + /** + * Gets gender + * + * @return string|null + */ + public function getGender(): ?string + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param string|null $gender gender + * + * @return $this + */ + public function setGender(?string $gender): static + { + if (is_null($gender)) { + array_push($this->openAPINullablesSetToNull, 'gender'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gender', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets passportNumber + * + * @return string|null + */ + public function getPassportNumber(): ?string + { + return $this->container['passportNumber']; + } + + /** + * Sets passportNumber + * + * @param string|null $passportNumber passportNumber + * + * @return $this + */ + public function setPassportNumber(?string $passportNumber): static + { + if (is_null($passportNumber)) { + array_push($this->openAPINullablesSetToNull, 'passportNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('passportNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['passportNumber'] = $passportNumber; + + return $this; + } + + /** + * Gets partnerDetails + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails|null + */ + public function getPartnerDetails(): ?\SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails + { + return $this->container['partnerDetails']; + } + + /** + * Sets partnerDetails + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails|null $partnerDetails partnerDetails + * + * @return $this + */ + public function setPartnerDetails(?\SynergiTech\Staffology\Model\FpsEmployeeDetailsPartnerDetails $partnerDetails): static + { + if (is_null($partnerDetails)) { + throw new InvalidArgumentException('non-nullable partnerDetails cannot be null'); + } + $this->container['partnerDetails'] = $partnerDetails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeDetailsPartnerDetails.php b/src/Model/FpsEmployeeDetailsPartnerDetails.php new file mode 100644 index 0000000..2d0b400 --- /dev/null +++ b/src/Model/FpsEmployeeDetailsPartnerDetails.php @@ -0,0 +1,449 @@ + + */ +class FpsEmployeeDetailsPartnerDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeDetailsPartnerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nino' => 'string', + 'name' => '\SynergiTech\Staffology\Model\RtiEmployeeName' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nino' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nino' => true, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nino' => 'nino', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nino' => 'setNino', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nino' => 'getNino', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\RtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeFigsToDate.php b/src/Model/FpsEmployeeFigsToDate.php new file mode 100644 index 0000000..2b8f3b1 --- /dev/null +++ b/src/Model/FpsEmployeeFigsToDate.php @@ -0,0 +1,1604 @@ + + */ +class FpsEmployeeFigsToDate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeFigsToDate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxablePay' => 'string', + 'totalTax' => 'string', + 'studentLoansTD' => 'string', + 'postgradLoansTD' => 'string', + 'benefitsTaxedViaPayrollYTD' => 'string', + 'empeePenContribnsPaidYTD' => 'string', + 'empeePenContribnsNotPaidYTD' => 'string', + 'smpytd' => 'string', + 'sppytd' => 'string', + 'sapytd' => 'string', + 'shppytd' => 'string', + 'spbpytd' => 'string', + 'sspytd' => 'string', + 'gross' => 'string', + 'netPay' => 'string', + 'additions' => 'string', + 'deductions' => 'string', + 'takeHomePay' => 'string', + 'adjustments' => 'string', + 'mapsMiles' => 'string', + 'foreignTaxAmount' => 'string', + 'foreignTaxAmountReclaimed' => 'string', + 'pensionableEarnings' => 'string', + 'pensionablePay' => 'string', + 'employerPensionContribution' => 'string', + 'employeePensionContribution' => 'string', + 'employeePensionContributionAvc' => 'string', + 'paymentAfterLeaving' => 'string', + 'taxOnPaymentAfterLeaving' => 'string', + 'nonTaxOrNICPmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxablePay' => null, + 'totalTax' => null, + 'studentLoansTD' => null, + 'postgradLoansTD' => null, + 'benefitsTaxedViaPayrollYTD' => null, + 'empeePenContribnsPaidYTD' => null, + 'empeePenContribnsNotPaidYTD' => null, + 'smpytd' => null, + 'sppytd' => null, + 'sapytd' => null, + 'shppytd' => null, + 'spbpytd' => null, + 'sspytd' => null, + 'gross' => null, + 'netPay' => null, + 'additions' => null, + 'deductions' => null, + 'takeHomePay' => null, + 'adjustments' => null, + 'mapsMiles' => null, + 'foreignTaxAmount' => null, + 'foreignTaxAmountReclaimed' => null, + 'pensionableEarnings' => null, + 'pensionablePay' => null, + 'employerPensionContribution' => null, + 'employeePensionContribution' => null, + 'employeePensionContributionAvc' => null, + 'paymentAfterLeaving' => null, + 'taxOnPaymentAfterLeaving' => null, + 'nonTaxOrNICPmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxablePay' => true, + 'totalTax' => true, + 'studentLoansTD' => true, + 'postgradLoansTD' => true, + 'benefitsTaxedViaPayrollYTD' => true, + 'empeePenContribnsPaidYTD' => true, + 'empeePenContribnsNotPaidYTD' => true, + 'smpytd' => true, + 'sppytd' => true, + 'sapytd' => true, + 'shppytd' => true, + 'spbpytd' => true, + 'sspytd' => true, + 'gross' => true, + 'netPay' => true, + 'additions' => true, + 'deductions' => true, + 'takeHomePay' => true, + 'adjustments' => true, + 'mapsMiles' => true, + 'foreignTaxAmount' => true, + 'foreignTaxAmountReclaimed' => true, + 'pensionableEarnings' => true, + 'pensionablePay' => true, + 'employerPensionContribution' => true, + 'employeePensionContribution' => true, + 'employeePensionContributionAvc' => true, + 'paymentAfterLeaving' => true, + 'taxOnPaymentAfterLeaving' => true, + 'nonTaxOrNICPmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxablePay' => 'taxablePay', + 'totalTax' => 'totalTax', + 'studentLoansTD' => 'studentLoansTD', + 'postgradLoansTD' => 'postgradLoansTD', + 'benefitsTaxedViaPayrollYTD' => 'benefitsTaxedViaPayrollYTD', + 'empeePenContribnsPaidYTD' => 'empeePenContribnsPaidYTD', + 'empeePenContribnsNotPaidYTD' => 'empeePenContribnsNotPaidYTD', + 'smpytd' => 'smpytd', + 'sppytd' => 'sppytd', + 'sapytd' => 'sapytd', + 'shppytd' => 'shppytd', + 'spbpytd' => 'spbpytd', + 'sspytd' => 'sspytd', + 'gross' => 'gross', + 'netPay' => 'netPay', + 'additions' => 'additions', + 'deductions' => 'deductions', + 'takeHomePay' => 'takeHomePay', + 'adjustments' => 'adjustments', + 'mapsMiles' => 'mapsMiles', + 'foreignTaxAmount' => 'foreignTaxAmount', + 'foreignTaxAmountReclaimed' => 'foreignTaxAmountReclaimed', + 'pensionableEarnings' => 'pensionableEarnings', + 'pensionablePay' => 'pensionablePay', + 'employerPensionContribution' => 'employerPensionContribution', + 'employeePensionContribution' => 'employeePensionContribution', + 'employeePensionContributionAvc' => 'employeePensionContributionAvc', + 'paymentAfterLeaving' => 'paymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'taxOnPaymentAfterLeaving', + 'nonTaxOrNICPmt' => 'nonTaxOrNICPmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxablePay' => 'setTaxablePay', + 'totalTax' => 'setTotalTax', + 'studentLoansTD' => 'setStudentLoansTD', + 'postgradLoansTD' => 'setPostgradLoansTD', + 'benefitsTaxedViaPayrollYTD' => 'setBenefitsTaxedViaPayrollYTD', + 'empeePenContribnsPaidYTD' => 'setEmpeePenContribnsPaidYTD', + 'empeePenContribnsNotPaidYTD' => 'setEmpeePenContribnsNotPaidYTD', + 'smpytd' => 'setSmpytd', + 'sppytd' => 'setSppytd', + 'sapytd' => 'setSapytd', + 'shppytd' => 'setShppytd', + 'spbpytd' => 'setSpbpytd', + 'sspytd' => 'setSspytd', + 'gross' => 'setGross', + 'netPay' => 'setNetPay', + 'additions' => 'setAdditions', + 'deductions' => 'setDeductions', + 'takeHomePay' => 'setTakeHomePay', + 'adjustments' => 'setAdjustments', + 'mapsMiles' => 'setMapsMiles', + 'foreignTaxAmount' => 'setForeignTaxAmount', + 'foreignTaxAmountReclaimed' => 'setForeignTaxAmountReclaimed', + 'pensionableEarnings' => 'setPensionableEarnings', + 'pensionablePay' => 'setPensionablePay', + 'employerPensionContribution' => 'setEmployerPensionContribution', + 'employeePensionContribution' => 'setEmployeePensionContribution', + 'employeePensionContributionAvc' => 'setEmployeePensionContributionAvc', + 'paymentAfterLeaving' => 'setPaymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'setTaxOnPaymentAfterLeaving', + 'nonTaxOrNICPmt' => 'setNonTaxOrNICPmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxablePay' => 'getTaxablePay', + 'totalTax' => 'getTotalTax', + 'studentLoansTD' => 'getStudentLoansTD', + 'postgradLoansTD' => 'getPostgradLoansTD', + 'benefitsTaxedViaPayrollYTD' => 'getBenefitsTaxedViaPayrollYTD', + 'empeePenContribnsPaidYTD' => 'getEmpeePenContribnsPaidYTD', + 'empeePenContribnsNotPaidYTD' => 'getEmpeePenContribnsNotPaidYTD', + 'smpytd' => 'getSmpytd', + 'sppytd' => 'getSppytd', + 'sapytd' => 'getSapytd', + 'shppytd' => 'getShppytd', + 'spbpytd' => 'getSpbpytd', + 'sspytd' => 'getSspytd', + 'gross' => 'getGross', + 'netPay' => 'getNetPay', + 'additions' => 'getAdditions', + 'deductions' => 'getDeductions', + 'takeHomePay' => 'getTakeHomePay', + 'adjustments' => 'getAdjustments', + 'mapsMiles' => 'getMapsMiles', + 'foreignTaxAmount' => 'getForeignTaxAmount', + 'foreignTaxAmountReclaimed' => 'getForeignTaxAmountReclaimed', + 'pensionableEarnings' => 'getPensionableEarnings', + 'pensionablePay' => 'getPensionablePay', + 'employerPensionContribution' => 'getEmployerPensionContribution', + 'employeePensionContribution' => 'getEmployeePensionContribution', + 'employeePensionContributionAvc' => 'getEmployeePensionContributionAvc', + 'paymentAfterLeaving' => 'getPaymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'getTaxOnPaymentAfterLeaving', + 'nonTaxOrNICPmt' => 'getNonTaxOrNICPmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxablePay', $data ?? [], null); + $this->setIfExists('totalTax', $data ?? [], null); + $this->setIfExists('studentLoansTD', $data ?? [], null); + $this->setIfExists('postgradLoansTD', $data ?? [], null); + $this->setIfExists('benefitsTaxedViaPayrollYTD', $data ?? [], null); + $this->setIfExists('empeePenContribnsPaidYTD', $data ?? [], null); + $this->setIfExists('empeePenContribnsNotPaidYTD', $data ?? [], null); + $this->setIfExists('smpytd', $data ?? [], null); + $this->setIfExists('sppytd', $data ?? [], null); + $this->setIfExists('sapytd', $data ?? [], null); + $this->setIfExists('shppytd', $data ?? [], null); + $this->setIfExists('spbpytd', $data ?? [], null); + $this->setIfExists('sspytd', $data ?? [], null); + $this->setIfExists('gross', $data ?? [], null); + $this->setIfExists('netPay', $data ?? [], null); + $this->setIfExists('additions', $data ?? [], null); + $this->setIfExists('deductions', $data ?? [], null); + $this->setIfExists('takeHomePay', $data ?? [], null); + $this->setIfExists('adjustments', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('foreignTaxAmount', $data ?? [], null); + $this->setIfExists('foreignTaxAmountReclaimed', $data ?? [], null); + $this->setIfExists('pensionableEarnings', $data ?? [], null); + $this->setIfExists('pensionablePay', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + $this->setIfExists('employeePensionContribution', $data ?? [], null); + $this->setIfExists('employeePensionContributionAvc', $data ?? [], null); + $this->setIfExists('paymentAfterLeaving', $data ?? [], null); + $this->setIfExists('taxOnPaymentAfterLeaving', $data ?? [], null); + $this->setIfExists('nonTaxOrNICPmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxablePay + * + * @return string|null + */ + public function getTaxablePay(): ?string + { + return $this->container['taxablePay']; + } + + /** + * Sets taxablePay + * + * @param string|null $taxablePay taxablePay + * + * @return $this + */ + public function setTaxablePay(?string $taxablePay): static + { + if (is_null($taxablePay)) { + array_push($this->openAPINullablesSetToNull, 'taxablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePay'] = $taxablePay; + + return $this; + } + + /** + * Gets totalTax + * + * @return string|null + */ + public function getTotalTax(): ?string + { + return $this->container['totalTax']; + } + + /** + * Sets totalTax + * + * @param string|null $totalTax totalTax + * + * @return $this + */ + public function setTotalTax(?string $totalTax): static + { + if (is_null($totalTax)) { + array_push($this->openAPINullablesSetToNull, 'totalTax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalTax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalTax'] = $totalTax; + + return $this; + } + + /** + * Gets studentLoansTD + * + * @return string|null + */ + public function getStudentLoansTD(): ?string + { + return $this->container['studentLoansTD']; + } + + /** + * Sets studentLoansTD + * + * @param string|null $studentLoansTD studentLoansTD + * + * @return $this + */ + public function setStudentLoansTD(?string $studentLoansTD): static + { + if (is_null($studentLoansTD)) { + array_push($this->openAPINullablesSetToNull, 'studentLoansTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoansTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoansTD'] = $studentLoansTD; + + return $this; + } + + /** + * Gets postgradLoansTD + * + * @return string|null + */ + public function getPostgradLoansTD(): ?string + { + return $this->container['postgradLoansTD']; + } + + /** + * Sets postgradLoansTD + * + * @param string|null $postgradLoansTD postgradLoansTD + * + * @return $this + */ + public function setPostgradLoansTD(?string $postgradLoansTD): static + { + if (is_null($postgradLoansTD)) { + array_push($this->openAPINullablesSetToNull, 'postgradLoansTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgradLoansTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgradLoansTD'] = $postgradLoansTD; + + return $this; + } + + /** + * Gets benefitsTaxedViaPayrollYTD + * + * @return string|null + */ + public function getBenefitsTaxedViaPayrollYTD(): ?string + { + return $this->container['benefitsTaxedViaPayrollYTD']; + } + + /** + * Sets benefitsTaxedViaPayrollYTD + * + * @param string|null $benefitsTaxedViaPayrollYTD benefitsTaxedViaPayrollYTD + * + * @return $this + */ + public function setBenefitsTaxedViaPayrollYTD(?string $benefitsTaxedViaPayrollYTD): static + { + if (is_null($benefitsTaxedViaPayrollYTD)) { + array_push($this->openAPINullablesSetToNull, 'benefitsTaxedViaPayrollYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('benefitsTaxedViaPayrollYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['benefitsTaxedViaPayrollYTD'] = $benefitsTaxedViaPayrollYTD; + + return $this; + } + + /** + * Gets empeePenContribnsPaidYTD + * + * @return string|null + */ + public function getEmpeePenContribnsPaidYTD(): ?string + { + return $this->container['empeePenContribnsPaidYTD']; + } + + /** + * Sets empeePenContribnsPaidYTD + * + * @param string|null $empeePenContribnsPaidYTD empeePenContribnsPaidYTD + * + * @return $this + */ + public function setEmpeePenContribnsPaidYTD(?string $empeePenContribnsPaidYTD): static + { + if (is_null($empeePenContribnsPaidYTD)) { + array_push($this->openAPINullablesSetToNull, 'empeePenContribnsPaidYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeePenContribnsPaidYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeePenContribnsPaidYTD'] = $empeePenContribnsPaidYTD; + + return $this; + } + + /** + * Gets empeePenContribnsNotPaidYTD + * + * @return string|null + */ + public function getEmpeePenContribnsNotPaidYTD(): ?string + { + return $this->container['empeePenContribnsNotPaidYTD']; + } + + /** + * Sets empeePenContribnsNotPaidYTD + * + * @param string|null $empeePenContribnsNotPaidYTD empeePenContribnsNotPaidYTD + * + * @return $this + */ + public function setEmpeePenContribnsNotPaidYTD(?string $empeePenContribnsNotPaidYTD): static + { + if (is_null($empeePenContribnsNotPaidYTD)) { + array_push($this->openAPINullablesSetToNull, 'empeePenContribnsNotPaidYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeePenContribnsNotPaidYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeePenContribnsNotPaidYTD'] = $empeePenContribnsNotPaidYTD; + + return $this; + } + + /** + * Gets smpytd + * + * @return string|null + */ + public function getSmpytd(): ?string + { + return $this->container['smpytd']; + } + + /** + * Sets smpytd + * + * @param string|null $smpytd smpytd + * + * @return $this + */ + public function setSmpytd(?string $smpytd): static + { + if (is_null($smpytd)) { + array_push($this->openAPINullablesSetToNull, 'smpytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('smpytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['smpytd'] = $smpytd; + + return $this; + } + + /** + * Gets sppytd + * + * @return string|null + */ + public function getSppytd(): ?string + { + return $this->container['sppytd']; + } + + /** + * Sets sppytd + * + * @param string|null $sppytd sppytd + * + * @return $this + */ + public function setSppytd(?string $sppytd): static + { + if (is_null($sppytd)) { + array_push($this->openAPINullablesSetToNull, 'sppytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sppytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sppytd'] = $sppytd; + + return $this; + } + + /** + * Gets sapytd + * + * @return string|null + */ + public function getSapytd(): ?string + { + return $this->container['sapytd']; + } + + /** + * Sets sapytd + * + * @param string|null $sapytd sapytd + * + * @return $this + */ + public function setSapytd(?string $sapytd): static + { + if (is_null($sapytd)) { + array_push($this->openAPINullablesSetToNull, 'sapytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sapytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sapytd'] = $sapytd; + + return $this; + } + + /** + * Gets shppytd + * + * @return string|null + */ + public function getShppytd(): ?string + { + return $this->container['shppytd']; + } + + /** + * Sets shppytd + * + * @param string|null $shppytd shppytd + * + * @return $this + */ + public function setShppytd(?string $shppytd): static + { + if (is_null($shppytd)) { + array_push($this->openAPINullablesSetToNull, 'shppytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shppytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shppytd'] = $shppytd; + + return $this; + } + + /** + * Gets spbpytd + * + * @return string|null + */ + public function getSpbpytd(): ?string + { + return $this->container['spbpytd']; + } + + /** + * Sets spbpytd + * + * @param string|null $spbpytd spbpytd + * + * @return $this + */ + public function setSpbpytd(?string $spbpytd): static + { + if (is_null($spbpytd)) { + array_push($this->openAPINullablesSetToNull, 'spbpytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spbpytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spbpytd'] = $spbpytd; + + return $this; + } + + /** + * Gets sspytd + * + * @return string|null + */ + public function getSspytd(): ?string + { + return $this->container['sspytd']; + } + + /** + * Sets sspytd + * + * @param string|null $sspytd sspytd + * + * @return $this + */ + public function setSspytd(?string $sspytd): static + { + if (is_null($sspytd)) { + array_push($this->openAPINullablesSetToNull, 'sspytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sspytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sspytd'] = $sspytd; + + return $this; + } + + /** + * Gets gross + * + * @return string|null + */ + public function getGross(): ?string + { + return $this->container['gross']; + } + + /** + * Sets gross + * + * @param string|null $gross gross + * + * @return $this + */ + public function setGross(?string $gross): static + { + if (is_null($gross)) { + array_push($this->openAPINullablesSetToNull, 'gross'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gross', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['gross'] = $gross; + + return $this; + } + + /** + * Gets netPay + * + * @return string|null + */ + public function getNetPay(): ?string + { + return $this->container['netPay']; + } + + /** + * Sets netPay + * + * @param string|null $netPay netPay + * + * @return $this + */ + public function setNetPay(?string $netPay): static + { + if (is_null($netPay)) { + array_push($this->openAPINullablesSetToNull, 'netPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netPay'] = $netPay; + + return $this; + } + + /** + * Gets additions + * + * @return string|null + */ + public function getAdditions(): ?string + { + return $this->container['additions']; + } + + /** + * Sets additions + * + * @param string|null $additions additions + * + * @return $this + */ + public function setAdditions(?string $additions): static + { + if (is_null($additions)) { + array_push($this->openAPINullablesSetToNull, 'additions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('additions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['additions'] = $additions; + + return $this; + } + + /** + * Gets deductions + * + * @return string|null + */ + public function getDeductions(): ?string + { + return $this->container['deductions']; + } + + /** + * Sets deductions + * + * @param string|null $deductions deductions + * + * @return $this + */ + public function setDeductions(?string $deductions): static + { + if (is_null($deductions)) { + array_push($this->openAPINullablesSetToNull, 'deductions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deductions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deductions'] = $deductions; + + return $this; + } + + /** + * Gets takeHomePay + * + * @return string|null + */ + public function getTakeHomePay(): ?string + { + return $this->container['takeHomePay']; + } + + /** + * Sets takeHomePay + * + * @param string|null $takeHomePay takeHomePay + * + * @return $this + */ + public function setTakeHomePay(?string $takeHomePay): static + { + if (is_null($takeHomePay)) { + array_push($this->openAPINullablesSetToNull, 'takeHomePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('takeHomePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['takeHomePay'] = $takeHomePay; + + return $this; + } + + /** + * Gets adjustments + * + * @return string|null + */ + public function getAdjustments(): ?string + { + return $this->container['adjustments']; + } + + /** + * Sets adjustments + * + * @param string|null $adjustments adjustments + * + * @return $this + */ + public function setAdjustments(?string $adjustments): static + { + if (is_null($adjustments)) { + array_push($this->openAPINullablesSetToNull, 'adjustments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustments'] = $adjustments; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return string|null + */ + public function getMapsMiles(): ?string + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param string|null $mapsMiles mapsMiles + * + * @return $this + */ + public function setMapsMiles(?string $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets foreignTaxAmount + * + * @return string|null + */ + public function getForeignTaxAmount(): ?string + { + return $this->container['foreignTaxAmount']; + } + + /** + * Sets foreignTaxAmount + * + * @param string|null $foreignTaxAmount foreignTaxAmount + * + * @return $this + */ + public function setForeignTaxAmount(?string $foreignTaxAmount): static + { + if (is_null($foreignTaxAmount)) { + array_push($this->openAPINullablesSetToNull, 'foreignTaxAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignTaxAmount', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['foreignTaxAmount'] = $foreignTaxAmount; + + return $this; + } + + /** + * Gets foreignTaxAmountReclaimed + * + * @return string|null + */ + public function getForeignTaxAmountReclaimed(): ?string + { + return $this->container['foreignTaxAmountReclaimed']; + } + + /** + * Sets foreignTaxAmountReclaimed + * + * @param string|null $foreignTaxAmountReclaimed foreignTaxAmountReclaimed + * + * @return $this + */ + public function setForeignTaxAmountReclaimed(?string $foreignTaxAmountReclaimed): static + { + if (is_null($foreignTaxAmountReclaimed)) { + array_push($this->openAPINullablesSetToNull, 'foreignTaxAmountReclaimed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignTaxAmountReclaimed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['foreignTaxAmountReclaimed'] = $foreignTaxAmountReclaimed; + + return $this; + } + + /** + * Gets pensionableEarnings + * + * @return string|null + */ + public function getPensionableEarnings(): ?string + { + return $this->container['pensionableEarnings']; + } + + /** + * Sets pensionableEarnings + * + * @param string|null $pensionableEarnings pensionableEarnings + * + * @return $this + */ + public function setPensionableEarnings(?string $pensionableEarnings): static + { + if (is_null($pensionableEarnings)) { + array_push($this->openAPINullablesSetToNull, 'pensionableEarnings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionableEarnings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionableEarnings'] = $pensionableEarnings; + + return $this; + } + + /** + * Gets pensionablePay + * + * @return string|null + */ + public function getPensionablePay(): ?string + { + return $this->container['pensionablePay']; + } + + /** + * Sets pensionablePay + * + * @param string|null $pensionablePay pensionablePay + * + * @return $this + */ + public function setPensionablePay(?string $pensionablePay): static + { + if (is_null($pensionablePay)) { + array_push($this->openAPINullablesSetToNull, 'pensionablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionablePay'] = $pensionablePay; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return string|null + */ + public function getEmployerPensionContribution(): ?string + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param string|null $employerPensionContribution employerPensionContribution + * + * @return $this + */ + public function setEmployerPensionContribution(?string $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + array_push($this->openAPINullablesSetToNull, 'employerPensionContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPensionContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + + /** + * Gets employeePensionContribution + * + * @return string|null + */ + public function getEmployeePensionContribution(): ?string + { + return $this->container['employeePensionContribution']; + } + + /** + * Sets employeePensionContribution + * + * @param string|null $employeePensionContribution employeePensionContribution + * + * @return $this + */ + public function setEmployeePensionContribution(?string $employeePensionContribution): static + { + if (is_null($employeePensionContribution)) { + array_push($this->openAPINullablesSetToNull, 'employeePensionContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeePensionContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeePensionContribution'] = $employeePensionContribution; + + return $this; + } + + /** + * Gets employeePensionContributionAvc + * + * @return string|null + */ + public function getEmployeePensionContributionAvc(): ?string + { + return $this->container['employeePensionContributionAvc']; + } + + /** + * Sets employeePensionContributionAvc + * + * @param string|null $employeePensionContributionAvc employeePensionContributionAvc + * + * @return $this + */ + public function setEmployeePensionContributionAvc(?string $employeePensionContributionAvc): static + { + if (is_null($employeePensionContributionAvc)) { + array_push($this->openAPINullablesSetToNull, 'employeePensionContributionAvc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeePensionContributionAvc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeePensionContributionAvc'] = $employeePensionContributionAvc; + + return $this; + } + + /** + * Gets paymentAfterLeaving + * + * @return string|null + */ + public function getPaymentAfterLeaving(): ?string + { + return $this->container['paymentAfterLeaving']; + } + + /** + * Sets paymentAfterLeaving + * + * @param string|null $paymentAfterLeaving paymentAfterLeaving + * + * @return $this + */ + public function setPaymentAfterLeaving(?string $paymentAfterLeaving): static + { + if (is_null($paymentAfterLeaving)) { + array_push($this->openAPINullablesSetToNull, 'paymentAfterLeaving'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentAfterLeaving', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentAfterLeaving'] = $paymentAfterLeaving; + + return $this; + } + + /** + * Gets taxOnPaymentAfterLeaving + * + * @return string|null + */ + public function getTaxOnPaymentAfterLeaving(): ?string + { + return $this->container['taxOnPaymentAfterLeaving']; + } + + /** + * Sets taxOnPaymentAfterLeaving + * + * @param string|null $taxOnPaymentAfterLeaving taxOnPaymentAfterLeaving + * + * @return $this + */ + public function setTaxOnPaymentAfterLeaving(?string $taxOnPaymentAfterLeaving): static + { + if (is_null($taxOnPaymentAfterLeaving)) { + array_push($this->openAPINullablesSetToNull, 'taxOnPaymentAfterLeaving'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxOnPaymentAfterLeaving', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxOnPaymentAfterLeaving'] = $taxOnPaymentAfterLeaving; + + return $this; + } + + /** + * Gets nonTaxOrNICPmt + * + * @return string|null + */ + public function getNonTaxOrNICPmt(): ?string + { + return $this->container['nonTaxOrNICPmt']; + } + + /** + * Sets nonTaxOrNICPmt + * + * @param string|null $nonTaxOrNICPmt nonTaxOrNICPmt + * + * @return $this + */ + public function setNonTaxOrNICPmt(?string $nonTaxOrNICPmt): static + { + if (is_null($nonTaxOrNICPmt)) { + array_push($this->openAPINullablesSetToNull, 'nonTaxOrNICPmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nonTaxOrNICPmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nonTaxOrNICPmt'] = $nonTaxOrNICPmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeFlexibleDrawdown.php b/src/Model/FpsEmployeeFlexibleDrawdown.php new file mode 100644 index 0000000..bc18d29 --- /dev/null +++ b/src/Model/FpsEmployeeFlexibleDrawdown.php @@ -0,0 +1,579 @@ + + */ +class FpsEmployeeFlexibleDrawdown implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeFlexibleDrawdown'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'flexiblyAccessingPensionRights' => 'string', + 'pensionDeathBenefit' => 'string', + 'seriousIllHealthLumpSum' => 'string', + 'taxablePayment' => 'string', + 'nontaxablePayment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'flexiblyAccessingPensionRights' => null, + 'pensionDeathBenefit' => null, + 'seriousIllHealthLumpSum' => null, + 'taxablePayment' => null, + 'nontaxablePayment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'flexiblyAccessingPensionRights' => true, + 'pensionDeathBenefit' => true, + 'seriousIllHealthLumpSum' => true, + 'taxablePayment' => true, + 'nontaxablePayment' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'flexiblyAccessingPensionRights' => 'flexiblyAccessingPensionRights', + 'pensionDeathBenefit' => 'pensionDeathBenefit', + 'seriousIllHealthLumpSum' => 'seriousIllHealthLumpSum', + 'taxablePayment' => 'taxablePayment', + 'nontaxablePayment' => 'nontaxablePayment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'flexiblyAccessingPensionRights' => 'setFlexiblyAccessingPensionRights', + 'pensionDeathBenefit' => 'setPensionDeathBenefit', + 'seriousIllHealthLumpSum' => 'setSeriousIllHealthLumpSum', + 'taxablePayment' => 'setTaxablePayment', + 'nontaxablePayment' => 'setNontaxablePayment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'flexiblyAccessingPensionRights' => 'getFlexiblyAccessingPensionRights', + 'pensionDeathBenefit' => 'getPensionDeathBenefit', + 'seriousIllHealthLumpSum' => 'getSeriousIllHealthLumpSum', + 'taxablePayment' => 'getTaxablePayment', + 'nontaxablePayment' => 'getNontaxablePayment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('flexiblyAccessingPensionRights', $data ?? [], null); + $this->setIfExists('pensionDeathBenefit', $data ?? [], null); + $this->setIfExists('seriousIllHealthLumpSum', $data ?? [], null); + $this->setIfExists('taxablePayment', $data ?? [], null); + $this->setIfExists('nontaxablePayment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets flexiblyAccessingPensionRights + * + * @return string|null + */ + public function getFlexiblyAccessingPensionRights(): ?string + { + return $this->container['flexiblyAccessingPensionRights']; + } + + /** + * Sets flexiblyAccessingPensionRights + * + * @param string|null $flexiblyAccessingPensionRights flexiblyAccessingPensionRights + * + * @return $this + */ + public function setFlexiblyAccessingPensionRights(?string $flexiblyAccessingPensionRights): static + { + if (is_null($flexiblyAccessingPensionRights)) { + array_push($this->openAPINullablesSetToNull, 'flexiblyAccessingPensionRights'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('flexiblyAccessingPensionRights', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['flexiblyAccessingPensionRights'] = $flexiblyAccessingPensionRights; + + return $this; + } + + /** + * Gets pensionDeathBenefit + * + * @return string|null + */ + public function getPensionDeathBenefit(): ?string + { + return $this->container['pensionDeathBenefit']; + } + + /** + * Sets pensionDeathBenefit + * + * @param string|null $pensionDeathBenefit pensionDeathBenefit + * + * @return $this + */ + public function setPensionDeathBenefit(?string $pensionDeathBenefit): static + { + if (is_null($pensionDeathBenefit)) { + array_push($this->openAPINullablesSetToNull, 'pensionDeathBenefit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionDeathBenefit', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionDeathBenefit'] = $pensionDeathBenefit; + + return $this; + } + + /** + * Gets seriousIllHealthLumpSum + * + * @return string|null + */ + public function getSeriousIllHealthLumpSum(): ?string + { + return $this->container['seriousIllHealthLumpSum']; + } + + /** + * Sets seriousIllHealthLumpSum + * + * @param string|null $seriousIllHealthLumpSum seriousIllHealthLumpSum + * + * @return $this + */ + public function setSeriousIllHealthLumpSum(?string $seriousIllHealthLumpSum): static + { + if (is_null($seriousIllHealthLumpSum)) { + array_push($this->openAPINullablesSetToNull, 'seriousIllHealthLumpSum'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('seriousIllHealthLumpSum', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['seriousIllHealthLumpSum'] = $seriousIllHealthLumpSum; + + return $this; + } + + /** + * Gets taxablePayment + * + * @return string|null + */ + public function getTaxablePayment(): ?string + { + return $this->container['taxablePayment']; + } + + /** + * Sets taxablePayment + * + * @param string|null $taxablePayment taxablePayment + * + * @return $this + */ + public function setTaxablePayment(?string $taxablePayment): static + { + if (is_null($taxablePayment)) { + array_push($this->openAPINullablesSetToNull, 'taxablePayment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePayment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePayment'] = $taxablePayment; + + return $this; + } + + /** + * Gets nontaxablePayment + * + * @return string|null + */ + public function getNontaxablePayment(): ?string + { + return $this->container['nontaxablePayment']; + } + + /** + * Sets nontaxablePayment + * + * @param string|null $nontaxablePayment nontaxablePayment + * + * @return $this + */ + public function setNontaxablePayment(?string $nontaxablePayment): static + { + if (is_null($nontaxablePayment)) { + array_push($this->openAPINullablesSetToNull, 'nontaxablePayment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nontaxablePayment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nontaxablePayment'] = $nontaxablePayment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeNIlettersAndValues.php b/src/Model/FpsEmployeeNIlettersAndValues.php new file mode 100644 index 0000000..c322899 --- /dev/null +++ b/src/Model/FpsEmployeeNIlettersAndValues.php @@ -0,0 +1,784 @@ + + */ +class FpsEmployeeNIlettersAndValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeNIlettersAndValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nIletter' => 'string', + 'grossEarningsForNICsInPd' => 'string', + 'grossEarningsForNICsYTD' => 'string', + 'atLELYTD' => 'string', + 'leLtoPTYTD' => 'string', + 'pTtoUELYTD' => 'string', + 'totalEmpNICInPd' => 'string', + 'totalEmpNICYTD' => 'string', + 'empeeContribnsInPd' => 'string', + 'empeeContribnsYTD' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nIletter' => null, + 'grossEarningsForNICsInPd' => null, + 'grossEarningsForNICsYTD' => null, + 'atLELYTD' => null, + 'leLtoPTYTD' => null, + 'pTtoUELYTD' => null, + 'totalEmpNICInPd' => null, + 'totalEmpNICYTD' => null, + 'empeeContribnsInPd' => null, + 'empeeContribnsYTD' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nIletter' => true, + 'grossEarningsForNICsInPd' => true, + 'grossEarningsForNICsYTD' => true, + 'atLELYTD' => true, + 'leLtoPTYTD' => true, + 'pTtoUELYTD' => true, + 'totalEmpNICInPd' => true, + 'totalEmpNICYTD' => true, + 'empeeContribnsInPd' => true, + 'empeeContribnsYTD' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nIletter' => 'nIletter', + 'grossEarningsForNICsInPd' => 'grossEarningsForNICsInPd', + 'grossEarningsForNICsYTD' => 'grossEarningsForNICsYTD', + 'atLELYTD' => 'atLELYTD', + 'leLtoPTYTD' => 'leLtoPTYTD', + 'pTtoUELYTD' => 'pTtoUELYTD', + 'totalEmpNICInPd' => 'totalEmpNICInPd', + 'totalEmpNICYTD' => 'totalEmpNICYTD', + 'empeeContribnsInPd' => 'empeeContribnsInPd', + 'empeeContribnsYTD' => 'empeeContribnsYTD' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nIletter' => 'setNIletter', + 'grossEarningsForNICsInPd' => 'setGrossEarningsForNICsInPd', + 'grossEarningsForNICsYTD' => 'setGrossEarningsForNICsYTD', + 'atLELYTD' => 'setAtLELYTD', + 'leLtoPTYTD' => 'setLeLtoPTYTD', + 'pTtoUELYTD' => 'setPTtoUELYTD', + 'totalEmpNICInPd' => 'setTotalEmpNICInPd', + 'totalEmpNICYTD' => 'setTotalEmpNICYTD', + 'empeeContribnsInPd' => 'setEmpeeContribnsInPd', + 'empeeContribnsYTD' => 'setEmpeeContribnsYTD' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nIletter' => 'getNIletter', + 'grossEarningsForNICsInPd' => 'getGrossEarningsForNICsInPd', + 'grossEarningsForNICsYTD' => 'getGrossEarningsForNICsYTD', + 'atLELYTD' => 'getAtLELYTD', + 'leLtoPTYTD' => 'getLeLtoPTYTD', + 'pTtoUELYTD' => 'getPTtoUELYTD', + 'totalEmpNICInPd' => 'getTotalEmpNICInPd', + 'totalEmpNICYTD' => 'getTotalEmpNICYTD', + 'empeeContribnsInPd' => 'getEmpeeContribnsInPd', + 'empeeContribnsYTD' => 'getEmpeeContribnsYTD' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nIletter', $data ?? [], null); + $this->setIfExists('grossEarningsForNICsInPd', $data ?? [], null); + $this->setIfExists('grossEarningsForNICsYTD', $data ?? [], null); + $this->setIfExists('atLELYTD', $data ?? [], null); + $this->setIfExists('leLtoPTYTD', $data ?? [], null); + $this->setIfExists('pTtoUELYTD', $data ?? [], null); + $this->setIfExists('totalEmpNICInPd', $data ?? [], null); + $this->setIfExists('totalEmpNICYTD', $data ?? [], null); + $this->setIfExists('empeeContribnsInPd', $data ?? [], null); + $this->setIfExists('empeeContribnsYTD', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nIletter + * + * @return string|null + */ + public function getNIletter(): ?string + { + return $this->container['nIletter']; + } + + /** + * Sets nIletter + * + * @param string|null $nIletter nIletter + * + * @return $this + */ + public function setNIletter(?string $nIletter): static + { + if (is_null($nIletter)) { + array_push($this->openAPINullablesSetToNull, 'nIletter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nIletter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nIletter'] = $nIletter; + + return $this; + } + + /** + * Gets grossEarningsForNICsInPd + * + * @return string|null + */ + public function getGrossEarningsForNICsInPd(): ?string + { + return $this->container['grossEarningsForNICsInPd']; + } + + /** + * Sets grossEarningsForNICsInPd + * + * @param string|null $grossEarningsForNICsInPd grossEarningsForNICsInPd + * + * @return $this + */ + public function setGrossEarningsForNICsInPd(?string $grossEarningsForNICsInPd): static + { + if (is_null($grossEarningsForNICsInPd)) { + array_push($this->openAPINullablesSetToNull, 'grossEarningsForNICsInPd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossEarningsForNICsInPd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossEarningsForNICsInPd'] = $grossEarningsForNICsInPd; + + return $this; + } + + /** + * Gets grossEarningsForNICsYTD + * + * @return string|null + */ + public function getGrossEarningsForNICsYTD(): ?string + { + return $this->container['grossEarningsForNICsYTD']; + } + + /** + * Sets grossEarningsForNICsYTD + * + * @param string|null $grossEarningsForNICsYTD grossEarningsForNICsYTD + * + * @return $this + */ + public function setGrossEarningsForNICsYTD(?string $grossEarningsForNICsYTD): static + { + if (is_null($grossEarningsForNICsYTD)) { + array_push($this->openAPINullablesSetToNull, 'grossEarningsForNICsYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossEarningsForNICsYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossEarningsForNICsYTD'] = $grossEarningsForNICsYTD; + + return $this; + } + + /** + * Gets atLELYTD + * + * @return string|null + */ + public function getAtLELYTD(): ?string + { + return $this->container['atLELYTD']; + } + + /** + * Sets atLELYTD + * + * @param string|null $atLELYTD atLELYTD + * + * @return $this + */ + public function setAtLELYTD(?string $atLELYTD): static + { + if (is_null($atLELYTD)) { + array_push($this->openAPINullablesSetToNull, 'atLELYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('atLELYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['atLELYTD'] = $atLELYTD; + + return $this; + } + + /** + * Gets leLtoPTYTD + * + * @return string|null + */ + public function getLeLtoPTYTD(): ?string + { + return $this->container['leLtoPTYTD']; + } + + /** + * Sets leLtoPTYTD + * + * @param string|null $leLtoPTYTD leLtoPTYTD + * + * @return $this + */ + public function setLeLtoPTYTD(?string $leLtoPTYTD): static + { + if (is_null($leLtoPTYTD)) { + array_push($this->openAPINullablesSetToNull, 'leLtoPTYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leLtoPTYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leLtoPTYTD'] = $leLtoPTYTD; + + return $this; + } + + /** + * Gets pTtoUELYTD + * + * @return string|null + */ + public function getPTtoUELYTD(): ?string + { + return $this->container['pTtoUELYTD']; + } + + /** + * Sets pTtoUELYTD + * + * @param string|null $pTtoUELYTD pTtoUELYTD + * + * @return $this + */ + public function setPTtoUELYTD(?string $pTtoUELYTD): static + { + if (is_null($pTtoUELYTD)) { + array_push($this->openAPINullablesSetToNull, 'pTtoUELYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pTtoUELYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pTtoUELYTD'] = $pTtoUELYTD; + + return $this; + } + + /** + * Gets totalEmpNICInPd + * + * @return string|null + */ + public function getTotalEmpNICInPd(): ?string + { + return $this->container['totalEmpNICInPd']; + } + + /** + * Sets totalEmpNICInPd + * + * @param string|null $totalEmpNICInPd totalEmpNICInPd + * + * @return $this + */ + public function setTotalEmpNICInPd(?string $totalEmpNICInPd): static + { + if (is_null($totalEmpNICInPd)) { + array_push($this->openAPINullablesSetToNull, 'totalEmpNICInPd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalEmpNICInPd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalEmpNICInPd'] = $totalEmpNICInPd; + + return $this; + } + + /** + * Gets totalEmpNICYTD + * + * @return string|null + */ + public function getTotalEmpNICYTD(): ?string + { + return $this->container['totalEmpNICYTD']; + } + + /** + * Sets totalEmpNICYTD + * + * @param string|null $totalEmpNICYTD totalEmpNICYTD + * + * @return $this + */ + public function setTotalEmpNICYTD(?string $totalEmpNICYTD): static + { + if (is_null($totalEmpNICYTD)) { + array_push($this->openAPINullablesSetToNull, 'totalEmpNICYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalEmpNICYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalEmpNICYTD'] = $totalEmpNICYTD; + + return $this; + } + + /** + * Gets empeeContribnsInPd + * + * @return string|null + */ + public function getEmpeeContribnsInPd(): ?string + { + return $this->container['empeeContribnsInPd']; + } + + /** + * Sets empeeContribnsInPd + * + * @param string|null $empeeContribnsInPd empeeContribnsInPd + * + * @return $this + */ + public function setEmpeeContribnsInPd(?string $empeeContribnsInPd): static + { + if (is_null($empeeContribnsInPd)) { + array_push($this->openAPINullablesSetToNull, 'empeeContribnsInPd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeeContribnsInPd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeeContribnsInPd'] = $empeeContribnsInPd; + + return $this; + } + + /** + * Gets empeeContribnsYTD + * + * @return string|null + */ + public function getEmpeeContribnsYTD(): ?string + { + return $this->container['empeeContribnsYTD']; + } + + /** + * Sets empeeContribnsYTD + * + * @param string|null $empeeContribnsYTD empeeContribnsYTD + * + * @return $this + */ + public function setEmpeeContribnsYTD(?string $empeeContribnsYTD): static + { + if (is_null($empeeContribnsYTD)) { + array_push($this->openAPINullablesSetToNull, 'empeeContribnsYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeeContribnsYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeeContribnsYTD'] = $empeeContribnsYTD; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeePayment.php b/src/Model/FpsEmployeePayment.php new file mode 100644 index 0000000..2795120 --- /dev/null +++ b/src/Model/FpsEmployeePayment.php @@ -0,0 +1,1692 @@ + + */ +class FpsEmployeePayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeePayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'bacsHashCode' => 'string', + 'payFreq' => 'string', + 'pmtDate' => 'string', + 'lateReason' => 'string', + 'weekNo' => 'string', + 'monthNo' => 'string', + 'periodsCovered' => 'int', + 'aggregatedEarnings' => 'string', + 'pmtAfterLeaving' => 'string', + 'hoursWorked' => 'string', + 'taxCode' => '\SynergiTech\Staffology\Model\FpsEmployeeTaxCode', + 'taxablePay' => 'string', + 'nonTaxOrNICPmt' => 'string', + 'dednsFromNetPay' => 'string', + 'payAfterStatDedns' => 'string', + 'benefitsTaxedViaPayroll' => 'string', + 'class1ANICsYTD' => 'string', + 'benefits' => '\SynergiTech\Staffology\Model\FpsBenefit', + 'empeePenContribnsPaid' => 'string', + 'itemsSubjectToClass1NIC' => 'string', + 'empeePenContribnsNotPaid' => 'string', + 'studentLoanRecovered' => '\SynergiTech\Staffology\Model\StudentLoanRecovered', + 'postgradLoanRecovered' => 'string', + 'taxDeductedOrRefunded' => 'string', + 'onStrike' => 'string', + 'unpaidAbsence' => 'string', + 'smpytd' => 'string', + 'sppytd' => 'string', + 'sapytd' => 'string', + 'shPPYTD' => 'string', + 'spbpytd' => 'string', + 'trivialCommutationPayment' => '\SynergiTech\Staffology\Model\FpsEmployeeTrivialCommutationPayment[]', + 'flexibleDrawdown' => '\SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'bacsHashCode' => null, + 'payFreq' => null, + 'pmtDate' => null, + 'lateReason' => null, + 'weekNo' => null, + 'monthNo' => null, + 'periodsCovered' => 'int32', + 'aggregatedEarnings' => null, + 'pmtAfterLeaving' => null, + 'hoursWorked' => null, + 'taxCode' => null, + 'taxablePay' => null, + 'nonTaxOrNICPmt' => null, + 'dednsFromNetPay' => null, + 'payAfterStatDedns' => null, + 'benefitsTaxedViaPayroll' => null, + 'class1ANICsYTD' => null, + 'benefits' => null, + 'empeePenContribnsPaid' => null, + 'itemsSubjectToClass1NIC' => null, + 'empeePenContribnsNotPaid' => null, + 'studentLoanRecovered' => null, + 'postgradLoanRecovered' => null, + 'taxDeductedOrRefunded' => null, + 'onStrike' => null, + 'unpaidAbsence' => null, + 'smpytd' => null, + 'sppytd' => null, + 'sapytd' => null, + 'shPPYTD' => null, + 'spbpytd' => null, + 'trivialCommutationPayment' => null, + 'flexibleDrawdown' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'bacsHashCode' => true, + 'payFreq' => true, + 'pmtDate' => true, + 'lateReason' => true, + 'weekNo' => true, + 'monthNo' => true, + 'periodsCovered' => false, + 'aggregatedEarnings' => true, + 'pmtAfterLeaving' => true, + 'hoursWorked' => true, + 'taxCode' => false, + 'taxablePay' => true, + 'nonTaxOrNICPmt' => true, + 'dednsFromNetPay' => true, + 'payAfterStatDedns' => true, + 'benefitsTaxedViaPayroll' => true, + 'class1ANICsYTD' => true, + 'benefits' => false, + 'empeePenContribnsPaid' => true, + 'itemsSubjectToClass1NIC' => true, + 'empeePenContribnsNotPaid' => true, + 'studentLoanRecovered' => false, + 'postgradLoanRecovered' => true, + 'taxDeductedOrRefunded' => true, + 'onStrike' => true, + 'unpaidAbsence' => true, + 'smpytd' => true, + 'sppytd' => true, + 'sapytd' => true, + 'shPPYTD' => true, + 'spbpytd' => true, + 'trivialCommutationPayment' => true, + 'flexibleDrawdown' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'bacsHashCode' => 'bacsHashCode', + 'payFreq' => 'payFreq', + 'pmtDate' => 'pmtDate', + 'lateReason' => 'lateReason', + 'weekNo' => 'weekNo', + 'monthNo' => 'monthNo', + 'periodsCovered' => 'periodsCovered', + 'aggregatedEarnings' => 'aggregatedEarnings', + 'pmtAfterLeaving' => 'pmtAfterLeaving', + 'hoursWorked' => 'hoursWorked', + 'taxCode' => 'taxCode', + 'taxablePay' => 'taxablePay', + 'nonTaxOrNICPmt' => 'nonTaxOrNICPmt', + 'dednsFromNetPay' => 'dednsFromNetPay', + 'payAfterStatDedns' => 'payAfterStatDedns', + 'benefitsTaxedViaPayroll' => 'benefitsTaxedViaPayroll', + 'class1ANICsYTD' => 'class1ANICsYTD', + 'benefits' => 'benefits', + 'empeePenContribnsPaid' => 'empeePenContribnsPaid', + 'itemsSubjectToClass1NIC' => 'itemsSubjectToClass1NIC', + 'empeePenContribnsNotPaid' => 'empeePenContribnsNotPaid', + 'studentLoanRecovered' => 'studentLoanRecovered', + 'postgradLoanRecovered' => 'postgradLoanRecovered', + 'taxDeductedOrRefunded' => 'taxDeductedOrRefunded', + 'onStrike' => 'onStrike', + 'unpaidAbsence' => 'unpaidAbsence', + 'smpytd' => 'smpytd', + 'sppytd' => 'sppytd', + 'sapytd' => 'sapytd', + 'shPPYTD' => 'shPPYTD', + 'spbpytd' => 'spbpytd', + 'trivialCommutationPayment' => 'trivialCommutationPayment', + 'flexibleDrawdown' => 'flexibleDrawdown' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'bacsHashCode' => 'setBacsHashCode', + 'payFreq' => 'setPayFreq', + 'pmtDate' => 'setPmtDate', + 'lateReason' => 'setLateReason', + 'weekNo' => 'setWeekNo', + 'monthNo' => 'setMonthNo', + 'periodsCovered' => 'setPeriodsCovered', + 'aggregatedEarnings' => 'setAggregatedEarnings', + 'pmtAfterLeaving' => 'setPmtAfterLeaving', + 'hoursWorked' => 'setHoursWorked', + 'taxCode' => 'setTaxCode', + 'taxablePay' => 'setTaxablePay', + 'nonTaxOrNICPmt' => 'setNonTaxOrNICPmt', + 'dednsFromNetPay' => 'setDednsFromNetPay', + 'payAfterStatDedns' => 'setPayAfterStatDedns', + 'benefitsTaxedViaPayroll' => 'setBenefitsTaxedViaPayroll', + 'class1ANICsYTD' => 'setClass1ANICsYTD', + 'benefits' => 'setBenefits', + 'empeePenContribnsPaid' => 'setEmpeePenContribnsPaid', + 'itemsSubjectToClass1NIC' => 'setItemsSubjectToClass1NIC', + 'empeePenContribnsNotPaid' => 'setEmpeePenContribnsNotPaid', + 'studentLoanRecovered' => 'setStudentLoanRecovered', + 'postgradLoanRecovered' => 'setPostgradLoanRecovered', + 'taxDeductedOrRefunded' => 'setTaxDeductedOrRefunded', + 'onStrike' => 'setOnStrike', + 'unpaidAbsence' => 'setUnpaidAbsence', + 'smpytd' => 'setSmpytd', + 'sppytd' => 'setSppytd', + 'sapytd' => 'setSapytd', + 'shPPYTD' => 'setShPPYTD', + 'spbpytd' => 'setSpbpytd', + 'trivialCommutationPayment' => 'setTrivialCommutationPayment', + 'flexibleDrawdown' => 'setFlexibleDrawdown' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'bacsHashCode' => 'getBacsHashCode', + 'payFreq' => 'getPayFreq', + 'pmtDate' => 'getPmtDate', + 'lateReason' => 'getLateReason', + 'weekNo' => 'getWeekNo', + 'monthNo' => 'getMonthNo', + 'periodsCovered' => 'getPeriodsCovered', + 'aggregatedEarnings' => 'getAggregatedEarnings', + 'pmtAfterLeaving' => 'getPmtAfterLeaving', + 'hoursWorked' => 'getHoursWorked', + 'taxCode' => 'getTaxCode', + 'taxablePay' => 'getTaxablePay', + 'nonTaxOrNICPmt' => 'getNonTaxOrNICPmt', + 'dednsFromNetPay' => 'getDednsFromNetPay', + 'payAfterStatDedns' => 'getPayAfterStatDedns', + 'benefitsTaxedViaPayroll' => 'getBenefitsTaxedViaPayroll', + 'class1ANICsYTD' => 'getClass1ANICsYTD', + 'benefits' => 'getBenefits', + 'empeePenContribnsPaid' => 'getEmpeePenContribnsPaid', + 'itemsSubjectToClass1NIC' => 'getItemsSubjectToClass1NIC', + 'empeePenContribnsNotPaid' => 'getEmpeePenContribnsNotPaid', + 'studentLoanRecovered' => 'getStudentLoanRecovered', + 'postgradLoanRecovered' => 'getPostgradLoanRecovered', + 'taxDeductedOrRefunded' => 'getTaxDeductedOrRefunded', + 'onStrike' => 'getOnStrike', + 'unpaidAbsence' => 'getUnpaidAbsence', + 'smpytd' => 'getSmpytd', + 'sppytd' => 'getSppytd', + 'sapytd' => 'getSapytd', + 'shPPYTD' => 'getShPPYTD', + 'spbpytd' => 'getSpbpytd', + 'trivialCommutationPayment' => 'getTrivialCommutationPayment', + 'flexibleDrawdown' => 'getFlexibleDrawdown' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bacsHashCode', $data ?? [], null); + $this->setIfExists('payFreq', $data ?? [], null); + $this->setIfExists('pmtDate', $data ?? [], null); + $this->setIfExists('lateReason', $data ?? [], null); + $this->setIfExists('weekNo', $data ?? [], null); + $this->setIfExists('monthNo', $data ?? [], null); + $this->setIfExists('periodsCovered', $data ?? [], null); + $this->setIfExists('aggregatedEarnings', $data ?? [], null); + $this->setIfExists('pmtAfterLeaving', $data ?? [], null); + $this->setIfExists('hoursWorked', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('taxablePay', $data ?? [], null); + $this->setIfExists('nonTaxOrNICPmt', $data ?? [], null); + $this->setIfExists('dednsFromNetPay', $data ?? [], null); + $this->setIfExists('payAfterStatDedns', $data ?? [], null); + $this->setIfExists('benefitsTaxedViaPayroll', $data ?? [], null); + $this->setIfExists('class1ANICsYTD', $data ?? [], null); + $this->setIfExists('benefits', $data ?? [], null); + $this->setIfExists('empeePenContribnsPaid', $data ?? [], null); + $this->setIfExists('itemsSubjectToClass1NIC', $data ?? [], null); + $this->setIfExists('empeePenContribnsNotPaid', $data ?? [], null); + $this->setIfExists('studentLoanRecovered', $data ?? [], null); + $this->setIfExists('postgradLoanRecovered', $data ?? [], null); + $this->setIfExists('taxDeductedOrRefunded', $data ?? [], null); + $this->setIfExists('onStrike', $data ?? [], null); + $this->setIfExists('unpaidAbsence', $data ?? [], null); + $this->setIfExists('smpytd', $data ?? [], null); + $this->setIfExists('sppytd', $data ?? [], null); + $this->setIfExists('sapytd', $data ?? [], null); + $this->setIfExists('shPPYTD', $data ?? [], null); + $this->setIfExists('spbpytd', $data ?? [], null); + $this->setIfExists('trivialCommutationPayment', $data ?? [], null); + $this->setIfExists('flexibleDrawdown', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bacsHashCode + * + * @return string|null + */ + public function getBacsHashCode(): ?string + { + return $this->container['bacsHashCode']; + } + + /** + * Sets bacsHashCode + * + * @param string|null $bacsHashCode bacsHashCode + * + * @return $this + */ + public function setBacsHashCode(?string $bacsHashCode): static + { + if (is_null($bacsHashCode)) { + array_push($this->openAPINullablesSetToNull, 'bacsHashCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsHashCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bacsHashCode'] = $bacsHashCode; + + return $this; + } + + /** + * Gets payFreq + * + * @return string|null + */ + public function getPayFreq(): ?string + { + return $this->container['payFreq']; + } + + /** + * Sets payFreq + * + * @param string|null $payFreq payFreq + * + * @return $this + */ + public function setPayFreq(?string $payFreq): static + { + if (is_null($payFreq)) { + array_push($this->openAPINullablesSetToNull, 'payFreq'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payFreq', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payFreq'] = $payFreq; + + return $this; + } + + /** + * Gets pmtDate + * + * @return string|null + */ + public function getPmtDate(): ?string + { + return $this->container['pmtDate']; + } + + /** + * Sets pmtDate + * + * @param string|null $pmtDate pmtDate + * + * @return $this + */ + public function setPmtDate(?string $pmtDate): static + { + if (is_null($pmtDate)) { + array_push($this->openAPINullablesSetToNull, 'pmtDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pmtDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pmtDate'] = $pmtDate; + + return $this; + } + + /** + * Gets lateReason + * + * @return string|null + */ + public function getLateReason(): ?string + { + return $this->container['lateReason']; + } + + /** + * Sets lateReason + * + * @param string|null $lateReason lateReason + * + * @return $this + */ + public function setLateReason(?string $lateReason): static + { + if (is_null($lateReason)) { + array_push($this->openAPINullablesSetToNull, 'lateReason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lateReason', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lateReason'] = $lateReason; + + return $this; + } + + /** + * Gets weekNo + * + * @return string|null + */ + public function getWeekNo(): ?string + { + return $this->container['weekNo']; + } + + /** + * Sets weekNo + * + * @param string|null $weekNo weekNo + * + * @return $this + */ + public function setWeekNo(?string $weekNo): static + { + if (is_null($weekNo)) { + array_push($this->openAPINullablesSetToNull, 'weekNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekNo'] = $weekNo; + + return $this; + } + + /** + * Gets monthNo + * + * @return string|null + */ + public function getMonthNo(): ?string + { + return $this->container['monthNo']; + } + + /** + * Sets monthNo + * + * @param string|null $monthNo monthNo + * + * @return $this + */ + public function setMonthNo(?string $monthNo): static + { + if (is_null($monthNo)) { + array_push($this->openAPINullablesSetToNull, 'monthNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthNo'] = $monthNo; + + return $this; + } + + /** + * Gets periodsCovered + * + * @return int|null + */ + public function getPeriodsCovered(): ?int + { + return $this->container['periodsCovered']; + } + + /** + * Sets periodsCovered + * + * @param int|null $periodsCovered periodsCovered + * + * @return $this + */ + public function setPeriodsCovered(?int $periodsCovered): static + { + if (is_null($periodsCovered)) { + throw new InvalidArgumentException('non-nullable periodsCovered cannot be null'); + } + $this->container['periodsCovered'] = $periodsCovered; + + return $this; + } + + /** + * Gets aggregatedEarnings + * + * @return string|null + */ + public function getAggregatedEarnings(): ?string + { + return $this->container['aggregatedEarnings']; + } + + /** + * Sets aggregatedEarnings + * + * @param string|null $aggregatedEarnings aggregatedEarnings + * + * @return $this + */ + public function setAggregatedEarnings(?string $aggregatedEarnings): static + { + if (is_null($aggregatedEarnings)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedEarnings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedEarnings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedEarnings'] = $aggregatedEarnings; + + return $this; + } + + /** + * Gets pmtAfterLeaving + * + * @return string|null + */ + public function getPmtAfterLeaving(): ?string + { + return $this->container['pmtAfterLeaving']; + } + + /** + * Sets pmtAfterLeaving + * + * @param string|null $pmtAfterLeaving pmtAfterLeaving + * + * @return $this + */ + public function setPmtAfterLeaving(?string $pmtAfterLeaving): static + { + if (is_null($pmtAfterLeaving)) { + array_push($this->openAPINullablesSetToNull, 'pmtAfterLeaving'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pmtAfterLeaving', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pmtAfterLeaving'] = $pmtAfterLeaving; + + return $this; + } + + /** + * Gets hoursWorked + * + * @return string|null + */ + public function getHoursWorked(): ?string + { + return $this->container['hoursWorked']; + } + + /** + * Sets hoursWorked + * + * @param string|null $hoursWorked hoursWorked + * + * @return $this + */ + public function setHoursWorked(?string $hoursWorked): static + { + if (is_null($hoursWorked)) { + array_push($this->openAPINullablesSetToNull, 'hoursWorked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hoursWorked', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hoursWorked'] = $hoursWorked; + + return $this; + } + + /** + * Gets taxCode + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeTaxCode|null + */ + public function getTaxCode(): ?\SynergiTech\Staffology\Model\FpsEmployeeTaxCode + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeTaxCode|null $taxCode taxCode + * + * @return $this + */ + public function setTaxCode(?\SynergiTech\Staffology\Model\FpsEmployeeTaxCode $taxCode): static + { + if (is_null($taxCode)) { + throw new InvalidArgumentException('non-nullable taxCode cannot be null'); + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets taxablePay + * + * @return string|null + */ + public function getTaxablePay(): ?string + { + return $this->container['taxablePay']; + } + + /** + * Sets taxablePay + * + * @param string|null $taxablePay taxablePay + * + * @return $this + */ + public function setTaxablePay(?string $taxablePay): static + { + if (is_null($taxablePay)) { + array_push($this->openAPINullablesSetToNull, 'taxablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePay'] = $taxablePay; + + return $this; + } + + /** + * Gets nonTaxOrNICPmt + * + * @return string|null + */ + public function getNonTaxOrNICPmt(): ?string + { + return $this->container['nonTaxOrNICPmt']; + } + + /** + * Sets nonTaxOrNICPmt + * + * @param string|null $nonTaxOrNICPmt nonTaxOrNICPmt + * + * @return $this + */ + public function setNonTaxOrNICPmt(?string $nonTaxOrNICPmt): static + { + if (is_null($nonTaxOrNICPmt)) { + array_push($this->openAPINullablesSetToNull, 'nonTaxOrNICPmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nonTaxOrNICPmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nonTaxOrNICPmt'] = $nonTaxOrNICPmt; + + return $this; + } + + /** + * Gets dednsFromNetPay + * + * @return string|null + */ + public function getDednsFromNetPay(): ?string + { + return $this->container['dednsFromNetPay']; + } + + /** + * Sets dednsFromNetPay + * + * @param string|null $dednsFromNetPay dednsFromNetPay + * + * @return $this + */ + public function setDednsFromNetPay(?string $dednsFromNetPay): static + { + if (is_null($dednsFromNetPay)) { + array_push($this->openAPINullablesSetToNull, 'dednsFromNetPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dednsFromNetPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dednsFromNetPay'] = $dednsFromNetPay; + + return $this; + } + + /** + * Gets payAfterStatDedns + * + * @return string|null + */ + public function getPayAfterStatDedns(): ?string + { + return $this->container['payAfterStatDedns']; + } + + /** + * Sets payAfterStatDedns + * + * @param string|null $payAfterStatDedns payAfterStatDedns + * + * @return $this + */ + public function setPayAfterStatDedns(?string $payAfterStatDedns): static + { + if (is_null($payAfterStatDedns)) { + array_push($this->openAPINullablesSetToNull, 'payAfterStatDedns'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payAfterStatDedns', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payAfterStatDedns'] = $payAfterStatDedns; + + return $this; + } + + /** + * Gets benefitsTaxedViaPayroll + * + * @return string|null + */ + public function getBenefitsTaxedViaPayroll(): ?string + { + return $this->container['benefitsTaxedViaPayroll']; + } + + /** + * Sets benefitsTaxedViaPayroll + * + * @param string|null $benefitsTaxedViaPayroll benefitsTaxedViaPayroll + * + * @return $this + */ + public function setBenefitsTaxedViaPayroll(?string $benefitsTaxedViaPayroll): static + { + if (is_null($benefitsTaxedViaPayroll)) { + array_push($this->openAPINullablesSetToNull, 'benefitsTaxedViaPayroll'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('benefitsTaxedViaPayroll', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['benefitsTaxedViaPayroll'] = $benefitsTaxedViaPayroll; + + return $this; + } + + /** + * Gets class1ANICsYTD + * + * @return string|null + */ + public function getClass1ANICsYTD(): ?string + { + return $this->container['class1ANICsYTD']; + } + + /** + * Sets class1ANICsYTD + * + * @param string|null $class1ANICsYTD class1ANICsYTD + * + * @return $this + */ + public function setClass1ANICsYTD(?string $class1ANICsYTD): static + { + if (is_null($class1ANICsYTD)) { + array_push($this->openAPINullablesSetToNull, 'class1ANICsYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('class1ANICsYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['class1ANICsYTD'] = $class1ANICsYTD; + + return $this; + } + + /** + * Gets benefits + * + * @return \SynergiTech\Staffology\Model\FpsBenefit|null + */ + public function getBenefits(): ?\SynergiTech\Staffology\Model\FpsBenefit + { + return $this->container['benefits']; + } + + /** + * Sets benefits + * + * @param \SynergiTech\Staffology\Model\FpsBenefit|null $benefits benefits + * + * @return $this + */ + public function setBenefits(?\SynergiTech\Staffology\Model\FpsBenefit $benefits): static + { + if (is_null($benefits)) { + throw new InvalidArgumentException('non-nullable benefits cannot be null'); + } + $this->container['benefits'] = $benefits; + + return $this; + } + + /** + * Gets empeePenContribnsPaid + * + * @return string|null + */ + public function getEmpeePenContribnsPaid(): ?string + { + return $this->container['empeePenContribnsPaid']; + } + + /** + * Sets empeePenContribnsPaid + * + * @param string|null $empeePenContribnsPaid empeePenContribnsPaid + * + * @return $this + */ + public function setEmpeePenContribnsPaid(?string $empeePenContribnsPaid): static + { + if (is_null($empeePenContribnsPaid)) { + array_push($this->openAPINullablesSetToNull, 'empeePenContribnsPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeePenContribnsPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeePenContribnsPaid'] = $empeePenContribnsPaid; + + return $this; + } + + /** + * Gets itemsSubjectToClass1NIC + * + * @return string|null + */ + public function getItemsSubjectToClass1NIC(): ?string + { + return $this->container['itemsSubjectToClass1NIC']; + } + + /** + * Sets itemsSubjectToClass1NIC + * + * @param string|null $itemsSubjectToClass1NIC itemsSubjectToClass1NIC + * + * @return $this + */ + public function setItemsSubjectToClass1NIC(?string $itemsSubjectToClass1NIC): static + { + if (is_null($itemsSubjectToClass1NIC)) { + array_push($this->openAPINullablesSetToNull, 'itemsSubjectToClass1NIC'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('itemsSubjectToClass1NIC', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['itemsSubjectToClass1NIC'] = $itemsSubjectToClass1NIC; + + return $this; + } + + /** + * Gets empeePenContribnsNotPaid + * + * @return string|null + */ + public function getEmpeePenContribnsNotPaid(): ?string + { + return $this->container['empeePenContribnsNotPaid']; + } + + /** + * Sets empeePenContribnsNotPaid + * + * @param string|null $empeePenContribnsNotPaid empeePenContribnsNotPaid + * + * @return $this + */ + public function setEmpeePenContribnsNotPaid(?string $empeePenContribnsNotPaid): static + { + if (is_null($empeePenContribnsNotPaid)) { + array_push($this->openAPINullablesSetToNull, 'empeePenContribnsNotPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('empeePenContribnsNotPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['empeePenContribnsNotPaid'] = $empeePenContribnsNotPaid; + + return $this; + } + + /** + * Gets studentLoanRecovered + * + * @return \SynergiTech\Staffology\Model\StudentLoanRecovered|null + */ + public function getStudentLoanRecovered(): ?\SynergiTech\Staffology\Model\StudentLoanRecovered + { + return $this->container['studentLoanRecovered']; + } + + /** + * Sets studentLoanRecovered + * + * @param \SynergiTech\Staffology\Model\StudentLoanRecovered|null $studentLoanRecovered studentLoanRecovered + * + * @return $this + */ + public function setStudentLoanRecovered(?\SynergiTech\Staffology\Model\StudentLoanRecovered $studentLoanRecovered): static + { + if (is_null($studentLoanRecovered)) { + throw new InvalidArgumentException('non-nullable studentLoanRecovered cannot be null'); + } + $this->container['studentLoanRecovered'] = $studentLoanRecovered; + + return $this; + } + + /** + * Gets postgradLoanRecovered + * + * @return string|null + */ + public function getPostgradLoanRecovered(): ?string + { + return $this->container['postgradLoanRecovered']; + } + + /** + * Sets postgradLoanRecovered + * + * @param string|null $postgradLoanRecovered postgradLoanRecovered + * + * @return $this + */ + public function setPostgradLoanRecovered(?string $postgradLoanRecovered): static + { + if (is_null($postgradLoanRecovered)) { + array_push($this->openAPINullablesSetToNull, 'postgradLoanRecovered'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgradLoanRecovered', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgradLoanRecovered'] = $postgradLoanRecovered; + + return $this; + } + + /** + * Gets taxDeductedOrRefunded + * + * @return string|null + */ + public function getTaxDeductedOrRefunded(): ?string + { + return $this->container['taxDeductedOrRefunded']; + } + + /** + * Sets taxDeductedOrRefunded + * + * @param string|null $taxDeductedOrRefunded taxDeductedOrRefunded + * + * @return $this + */ + public function setTaxDeductedOrRefunded(?string $taxDeductedOrRefunded): static + { + if (is_null($taxDeductedOrRefunded)) { + array_push($this->openAPINullablesSetToNull, 'taxDeductedOrRefunded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxDeductedOrRefunded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxDeductedOrRefunded'] = $taxDeductedOrRefunded; + + return $this; + } + + /** + * Gets onStrike + * + * @return string|null + */ + public function getOnStrike(): ?string + { + return $this->container['onStrike']; + } + + /** + * Sets onStrike + * + * @param string|null $onStrike onStrike + * + * @return $this + */ + public function setOnStrike(?string $onStrike): static + { + if (is_null($onStrike)) { + array_push($this->openAPINullablesSetToNull, 'onStrike'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('onStrike', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['onStrike'] = $onStrike; + + return $this; + } + + /** + * Gets unpaidAbsence + * + * @return string|null + */ + public function getUnpaidAbsence(): ?string + { + return $this->container['unpaidAbsence']; + } + + /** + * Sets unpaidAbsence + * + * @param string|null $unpaidAbsence unpaidAbsence + * + * @return $this + */ + public function setUnpaidAbsence(?string $unpaidAbsence): static + { + if (is_null($unpaidAbsence)) { + array_push($this->openAPINullablesSetToNull, 'unpaidAbsence'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unpaidAbsence', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['unpaidAbsence'] = $unpaidAbsence; + + return $this; + } + + /** + * Gets smpytd + * + * @return string|null + */ + public function getSmpytd(): ?string + { + return $this->container['smpytd']; + } + + /** + * Sets smpytd + * + * @param string|null $smpytd smpytd + * + * @return $this + */ + public function setSmpytd(?string $smpytd): static + { + if (is_null($smpytd)) { + array_push($this->openAPINullablesSetToNull, 'smpytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('smpytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['smpytd'] = $smpytd; + + return $this; + } + + /** + * Gets sppytd + * + * @return string|null + */ + public function getSppytd(): ?string + { + return $this->container['sppytd']; + } + + /** + * Sets sppytd + * + * @param string|null $sppytd sppytd + * + * @return $this + */ + public function setSppytd(?string $sppytd): static + { + if (is_null($sppytd)) { + array_push($this->openAPINullablesSetToNull, 'sppytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sppytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sppytd'] = $sppytd; + + return $this; + } + + /** + * Gets sapytd + * + * @return string|null + */ + public function getSapytd(): ?string + { + return $this->container['sapytd']; + } + + /** + * Sets sapytd + * + * @param string|null $sapytd sapytd + * + * @return $this + */ + public function setSapytd(?string $sapytd): static + { + if (is_null($sapytd)) { + array_push($this->openAPINullablesSetToNull, 'sapytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sapytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sapytd'] = $sapytd; + + return $this; + } + + /** + * Gets shPPYTD + * + * @return string|null + */ + public function getShPPYTD(): ?string + { + return $this->container['shPPYTD']; + } + + /** + * Sets shPPYTD + * + * @param string|null $shPPYTD shPPYTD + * + * @return $this + */ + public function setShPPYTD(?string $shPPYTD): static + { + if (is_null($shPPYTD)) { + array_push($this->openAPINullablesSetToNull, 'shPPYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shPPYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shPPYTD'] = $shPPYTD; + + return $this; + } + + /** + * Gets spbpytd + * + * @return string|null + */ + public function getSpbpytd(): ?string + { + return $this->container['spbpytd']; + } + + /** + * Sets spbpytd + * + * @param string|null $spbpytd spbpytd + * + * @return $this + */ + public function setSpbpytd(?string $spbpytd): static + { + if (is_null($spbpytd)) { + array_push($this->openAPINullablesSetToNull, 'spbpytd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spbpytd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spbpytd'] = $spbpytd; + + return $this; + } + + /** + * Gets trivialCommutationPayment + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeTrivialCommutationPayment[]|null + */ + public function getTrivialCommutationPayment(): ?array + { + return $this->container['trivialCommutationPayment']; + } + + /** + * Sets trivialCommutationPayment + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeTrivialCommutationPayment[]|null $trivialCommutationPayment trivialCommutationPayment + * + * @return $this + */ + public function setTrivialCommutationPayment(?array $trivialCommutationPayment): static + { + if (is_null($trivialCommutationPayment)) { + array_push($this->openAPINullablesSetToNull, 'trivialCommutationPayment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('trivialCommutationPayment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['trivialCommutationPayment'] = $trivialCommutationPayment; + + return $this; + } + + /** + * Gets flexibleDrawdown + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown|null + */ + public function getFlexibleDrawdown(): ?\SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown + { + return $this->container['flexibleDrawdown']; + } + + /** + * Sets flexibleDrawdown + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown|null $flexibleDrawdown flexibleDrawdown + * + * @return $this + */ + public function setFlexibleDrawdown(?\SynergiTech\Staffology\Model\FpsEmployeeFlexibleDrawdown $flexibleDrawdown): static + { + if (is_null($flexibleDrawdown)) { + throw new InvalidArgumentException('non-nullable flexibleDrawdown cannot be null'); + } + $this->container['flexibleDrawdown'] = $flexibleDrawdown; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeSeconded.php b/src/Model/FpsEmployeeSeconded.php new file mode 100644 index 0000000..1d03542 --- /dev/null +++ b/src/Model/FpsEmployeeSeconded.php @@ -0,0 +1,579 @@ + + */ +class FpsEmployeeSeconded implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeSeconded'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'inOutUK' => 'string', + 'stay183DaysOrMore' => 'string', + 'stayLessThan183Days' => 'string', + 'eeaCitizen' => 'string', + 'epM6' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'inOutUK' => null, + 'stay183DaysOrMore' => null, + 'stayLessThan183Days' => null, + 'eeaCitizen' => null, + 'epM6' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'inOutUK' => true, + 'stay183DaysOrMore' => true, + 'stayLessThan183Days' => true, + 'eeaCitizen' => true, + 'epM6' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'inOutUK' => 'inOutUK', + 'stay183DaysOrMore' => 'stay183DaysOrMore', + 'stayLessThan183Days' => 'stayLessThan183Days', + 'eeaCitizen' => 'eeaCitizen', + 'epM6' => 'epM6' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'inOutUK' => 'setInOutUK', + 'stay183DaysOrMore' => 'setStay183DaysOrMore', + 'stayLessThan183Days' => 'setStayLessThan183Days', + 'eeaCitizen' => 'setEeaCitizen', + 'epM6' => 'setEpM6' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'inOutUK' => 'getInOutUK', + 'stay183DaysOrMore' => 'getStay183DaysOrMore', + 'stayLessThan183Days' => 'getStayLessThan183Days', + 'eeaCitizen' => 'getEeaCitizen', + 'epM6' => 'getEpM6' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('inOutUK', $data ?? [], null); + $this->setIfExists('stay183DaysOrMore', $data ?? [], null); + $this->setIfExists('stayLessThan183Days', $data ?? [], null); + $this->setIfExists('eeaCitizen', $data ?? [], null); + $this->setIfExists('epM6', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets inOutUK + * + * @return string|null + */ + public function getInOutUK(): ?string + { + return $this->container['inOutUK']; + } + + /** + * Sets inOutUK + * + * @param string|null $inOutUK inOutUK + * + * @return $this + */ + public function setInOutUK(?string $inOutUK): static + { + if (is_null($inOutUK)) { + array_push($this->openAPINullablesSetToNull, 'inOutUK'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inOutUK', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['inOutUK'] = $inOutUK; + + return $this; + } + + /** + * Gets stay183DaysOrMore + * + * @return string|null + */ + public function getStay183DaysOrMore(): ?string + { + return $this->container['stay183DaysOrMore']; + } + + /** + * Sets stay183DaysOrMore + * + * @param string|null $stay183DaysOrMore stay183DaysOrMore + * + * @return $this + */ + public function setStay183DaysOrMore(?string $stay183DaysOrMore): static + { + if (is_null($stay183DaysOrMore)) { + array_push($this->openAPINullablesSetToNull, 'stay183DaysOrMore'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stay183DaysOrMore', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stay183DaysOrMore'] = $stay183DaysOrMore; + + return $this; + } + + /** + * Gets stayLessThan183Days + * + * @return string|null + */ + public function getStayLessThan183Days(): ?string + { + return $this->container['stayLessThan183Days']; + } + + /** + * Sets stayLessThan183Days + * + * @param string|null $stayLessThan183Days stayLessThan183Days + * + * @return $this + */ + public function setStayLessThan183Days(?string $stayLessThan183Days): static + { + if (is_null($stayLessThan183Days)) { + array_push($this->openAPINullablesSetToNull, 'stayLessThan183Days'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stayLessThan183Days', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stayLessThan183Days'] = $stayLessThan183Days; + + return $this; + } + + /** + * Gets eeaCitizen + * + * @return string|null + */ + public function getEeaCitizen(): ?string + { + return $this->container['eeaCitizen']; + } + + /** + * Sets eeaCitizen + * + * @param string|null $eeaCitizen eeaCitizen + * + * @return $this + */ + public function setEeaCitizen(?string $eeaCitizen): static + { + if (is_null($eeaCitizen)) { + array_push($this->openAPINullablesSetToNull, 'eeaCitizen'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('eeaCitizen', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['eeaCitizen'] = $eeaCitizen; + + return $this; + } + + /** + * Gets epM6 + * + * @return string|null + */ + public function getEpM6(): ?string + { + return $this->container['epM6']; + } + + /** + * Sets epM6 + * + * @param string|null $epM6 epM6 + * + * @return $this + */ + public function setEpM6(?string $epM6): static + { + if (is_null($epM6)) { + array_push($this->openAPINullablesSetToNull, 'epM6'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('epM6', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['epM6'] = $epM6; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeStarter.php b/src/Model/FpsEmployeeStarter.php new file mode 100644 index 0000000..600b273 --- /dev/null +++ b/src/Model/FpsEmployeeStarter.php @@ -0,0 +1,606 @@ + + */ +class FpsEmployeeStarter implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeStarter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'startDate' => 'string', + 'startDec' => 'string', + 'studentLoan' => 'string', + 'postgradLoan' => 'string', + 'occPension' => '\SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension', + 'seconded' => '\SynergiTech\Staffology\Model\FpsEmployeeSeconded' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'startDate' => null, + 'startDec' => null, + 'studentLoan' => null, + 'postgradLoan' => null, + 'occPension' => null, + 'seconded' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'startDate' => true, + 'startDec' => true, + 'studentLoan' => true, + 'postgradLoan' => true, + 'occPension' => false, + 'seconded' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'startDate' => 'startDate', + 'startDec' => 'startDec', + 'studentLoan' => 'studentLoan', + 'postgradLoan' => 'postgradLoan', + 'occPension' => 'occPension', + 'seconded' => 'seconded' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'startDate' => 'setStartDate', + 'startDec' => 'setStartDec', + 'studentLoan' => 'setStudentLoan', + 'postgradLoan' => 'setPostgradLoan', + 'occPension' => 'setOccPension', + 'seconded' => 'setSeconded' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'startDate' => 'getStartDate', + 'startDec' => 'getStartDec', + 'studentLoan' => 'getStudentLoan', + 'postgradLoan' => 'getPostgradLoan', + 'occPension' => 'getOccPension', + 'seconded' => 'getSeconded' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('startDec', $data ?? [], null); + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('postgradLoan', $data ?? [], null); + $this->setIfExists('occPension', $data ?? [], null); + $this->setIfExists('seconded', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets startDate + * + * @return string|null + */ + public function getStartDate(): ?string + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param string|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?string $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets startDec + * + * @return string|null + */ + public function getStartDec(): ?string + { + return $this->container['startDec']; + } + + /** + * Sets startDec + * + * @param string|null $startDec startDec + * + * @return $this + */ + public function setStartDec(?string $startDec): static + { + if (is_null($startDec)) { + array_push($this->openAPINullablesSetToNull, 'startDec'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDec', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDec'] = $startDec; + + return $this; + } + + /** + * Gets studentLoan + * + * @return string|null + */ + public function getStudentLoan(): ?string + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param string|null $studentLoan studentLoan + * + * @return $this + */ + public function setStudentLoan(?string $studentLoan): static + { + if (is_null($studentLoan)) { + array_push($this->openAPINullablesSetToNull, 'studentLoan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoan', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets postgradLoan + * + * @return string|null + */ + public function getPostgradLoan(): ?string + { + return $this->container['postgradLoan']; + } + + /** + * Sets postgradLoan + * + * @param string|null $postgradLoan postgradLoan + * + * @return $this + */ + public function setPostgradLoan(?string $postgradLoan): static + { + if (is_null($postgradLoan)) { + array_push($this->openAPINullablesSetToNull, 'postgradLoan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgradLoan', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgradLoan'] = $postgradLoan; + + return $this; + } + + /** + * Gets occPension + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension|null + */ + public function getOccPension(): ?\SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension + { + return $this->container['occPension']; + } + + /** + * Sets occPension + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension|null $occPension occPension + * + * @return $this + */ + public function setOccPension(?\SynergiTech\Staffology\Model\FpsEmployeeStarterOccPension $occPension): static + { + if (is_null($occPension)) { + throw new InvalidArgumentException('non-nullable occPension cannot be null'); + } + $this->container['occPension'] = $occPension; + + return $this; + } + + /** + * Gets seconded + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeSeconded|null + */ + public function getSeconded(): ?\SynergiTech\Staffology\Model\FpsEmployeeSeconded + { + return $this->container['seconded']; + } + + /** + * Sets seconded + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeSeconded|null $seconded seconded + * + * @return $this + */ + public function setSeconded(?\SynergiTech\Staffology\Model\FpsEmployeeSeconded $seconded): static + { + if (is_null($seconded)) { + throw new InvalidArgumentException('non-nullable seconded cannot be null'); + } + $this->container['seconded'] = $seconded; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeStarterOccPension.php b/src/Model/FpsEmployeeStarterOccPension.php new file mode 100644 index 0000000..552743d --- /dev/null +++ b/src/Model/FpsEmployeeStarterOccPension.php @@ -0,0 +1,456 @@ + + */ +class FpsEmployeeStarterOccPension implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeStarterOccPension'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'bereaved' => 'string', + 'amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'bereaved' => null, + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'bereaved' => true, + 'amount' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'bereaved' => 'bereaved', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'bereaved' => 'setBereaved', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'bereaved' => 'getBereaved', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bereaved', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bereaved + * + * @return string|null + */ + public function getBereaved(): ?string + { + return $this->container['bereaved']; + } + + /** + * Sets bereaved + * + * @param string|null $bereaved bereaved + * + * @return $this + */ + public function setBereaved(?string $bereaved): static + { + if (is_null($bereaved)) { + array_push($this->openAPINullablesSetToNull, 'bereaved'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bereaved', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bereaved'] = $bereaved; + + return $this; + } + + /** + * Gets amount + * + * @return string|null + */ + public function getAmount(): ?string + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string|null $amount amount + * + * @return $this + */ + public function setAmount(?string $amount): static + { + if (is_null($amount)) { + array_push($this->openAPINullablesSetToNull, 'amount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('amount', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeTaxCode.php b/src/Model/FpsEmployeeTaxCode.php new file mode 100644 index 0000000..74bd73a --- /dev/null +++ b/src/Model/FpsEmployeeTaxCode.php @@ -0,0 +1,497 @@ + + */ +class FpsEmployeeTaxCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeTaxCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'basisNonCumulative' => 'string', + 'taxRegime' => 'string', + 'taxCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'basisNonCumulative' => null, + 'taxRegime' => null, + 'taxCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'basisNonCumulative' => true, + 'taxRegime' => true, + 'taxCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'basisNonCumulative' => 'basisNonCumulative', + 'taxRegime' => 'taxRegime', + 'taxCode' => 'taxCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'basisNonCumulative' => 'setBasisNonCumulative', + 'taxRegime' => 'setTaxRegime', + 'taxCode' => 'setTaxCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'basisNonCumulative' => 'getBasisNonCumulative', + 'taxRegime' => 'getTaxRegime', + 'taxCode' => 'getTaxCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('basisNonCumulative', $data ?? [], null); + $this->setIfExists('taxRegime', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets basisNonCumulative + * + * @return string|null + */ + public function getBasisNonCumulative(): ?string + { + return $this->container['basisNonCumulative']; + } + + /** + * Sets basisNonCumulative + * + * @param string|null $basisNonCumulative basisNonCumulative + * + * @return $this + */ + public function setBasisNonCumulative(?string $basisNonCumulative): static + { + if (is_null($basisNonCumulative)) { + array_push($this->openAPINullablesSetToNull, 'basisNonCumulative'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('basisNonCumulative', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['basisNonCumulative'] = $basisNonCumulative; + + return $this; + } + + /** + * Gets taxRegime + * + * @return string|null + */ + public function getTaxRegime(): ?string + { + return $this->container['taxRegime']; + } + + /** + * Sets taxRegime + * + * @param string|null $taxRegime taxRegime + * + * @return $this + */ + public function setTaxRegime(?string $taxRegime): static + { + if (is_null($taxRegime)) { + array_push($this->openAPINullablesSetToNull, 'taxRegime'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxRegime', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxRegime'] = $taxRegime; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode taxCode + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployeeTrivialCommutationPayment.php b/src/Model/FpsEmployeeTrivialCommutationPayment.php new file mode 100644 index 0000000..4cc7f2c --- /dev/null +++ b/src/Model/FpsEmployeeTrivialCommutationPayment.php @@ -0,0 +1,456 @@ + + */ +class FpsEmployeeTrivialCommutationPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployeeTrivialCommutationPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return $this + */ + public function setValue(?string $value): static + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployerPayIdChanged.php b/src/Model/FpsEmployerPayIdChanged.php new file mode 100644 index 0000000..d378f41 --- /dev/null +++ b/src/Model/FpsEmployerPayIdChanged.php @@ -0,0 +1,456 @@ + + */ +class FpsEmployerPayIdChanged implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployerPayIdChanged'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollIdChangedIndicator' => 'string', + 'oldPayrollId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollIdChangedIndicator' => null, + 'oldPayrollId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollIdChangedIndicator' => true, + 'oldPayrollId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollIdChangedIndicator' => 'payrollIdChangedIndicator', + 'oldPayrollId' => 'oldPayrollId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollIdChangedIndicator' => 'setPayrollIdChangedIndicator', + 'oldPayrollId' => 'setOldPayrollId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollIdChangedIndicator' => 'getPayrollIdChangedIndicator', + 'oldPayrollId' => 'getOldPayrollId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollIdChangedIndicator', $data ?? [], null); + $this->setIfExists('oldPayrollId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollIdChangedIndicator + * + * @return string|null + */ + public function getPayrollIdChangedIndicator(): ?string + { + return $this->container['payrollIdChangedIndicator']; + } + + /** + * Sets payrollIdChangedIndicator + * + * @param string|null $payrollIdChangedIndicator payrollIdChangedIndicator + * + * @return $this + */ + public function setPayrollIdChangedIndicator(?string $payrollIdChangedIndicator): static + { + if (is_null($payrollIdChangedIndicator)) { + array_push($this->openAPINullablesSetToNull, 'payrollIdChangedIndicator'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollIdChangedIndicator', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollIdChangedIndicator'] = $payrollIdChangedIndicator; + + return $this; + } + + /** + * Gets oldPayrollId + * + * @return string|null + */ + public function getOldPayrollId(): ?string + { + return $this->container['oldPayrollId']; + } + + /** + * Sets oldPayrollId + * + * @param string|null $oldPayrollId oldPayrollId + * + * @return $this + */ + public function setOldPayrollId(?string $oldPayrollId): static + { + if (is_null($oldPayrollId)) { + array_push($this->openAPINullablesSetToNull, 'oldPayrollId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('oldPayrollId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['oldPayrollId'] = $oldPayrollId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsEmployment.php b/src/Model/FpsEmployment.php new file mode 100644 index 0000000..9da9b13 --- /dev/null +++ b/src/Model/FpsEmployment.php @@ -0,0 +1,920 @@ + + */ +class FpsEmployment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsEmployment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeCurrentNiLetter' => 'string', + 'offPayrollWorker' => 'string', + 'occPenInd' => 'string', + 'directorsNIC' => 'string', + 'taxWkOfApptOfDirector' => 'string', + 'starter' => '\SynergiTech\Staffology\Model\FpsEmployeeStarter', + 'payId' => 'string', + 'payIdChgd' => '\SynergiTech\Staffology\Model\FpsEmployerPayIdChanged', + 'paymentToANonIndividual' => 'string', + 'irrEmp' => 'string', + 'leavingDate' => 'string', + 'figuresToDate' => '\SynergiTech\Staffology\Model\FpsEmployeeFigsToDate', + 'payment' => '\SynergiTech\Staffology\Model\FpsEmployeePayment', + 'nIlettersAndValues' => '\SynergiTech\Staffology\Model\FpsEmployeeNIlettersAndValues[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeCurrentNiLetter' => null, + 'offPayrollWorker' => null, + 'occPenInd' => null, + 'directorsNIC' => null, + 'taxWkOfApptOfDirector' => null, + 'starter' => null, + 'payId' => null, + 'payIdChgd' => null, + 'paymentToANonIndividual' => null, + 'irrEmp' => null, + 'leavingDate' => null, + 'figuresToDate' => null, + 'payment' => null, + 'nIlettersAndValues' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeCurrentNiLetter' => true, + 'offPayrollWorker' => true, + 'occPenInd' => true, + 'directorsNIC' => true, + 'taxWkOfApptOfDirector' => true, + 'starter' => false, + 'payId' => true, + 'payIdChgd' => false, + 'paymentToANonIndividual' => true, + 'irrEmp' => true, + 'leavingDate' => true, + 'figuresToDate' => false, + 'payment' => false, + 'nIlettersAndValues' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeCurrentNiLetter' => 'employeeCurrentNiLetter', + 'offPayrollWorker' => 'offPayrollWorker', + 'occPenInd' => 'occPenInd', + 'directorsNIC' => 'directorsNIC', + 'taxWkOfApptOfDirector' => 'taxWkOfApptOfDirector', + 'starter' => 'starter', + 'payId' => 'payId', + 'payIdChgd' => 'payIdChgd', + 'paymentToANonIndividual' => 'paymentToANonIndividual', + 'irrEmp' => 'irrEmp', + 'leavingDate' => 'leavingDate', + 'figuresToDate' => 'figuresToDate', + 'payment' => 'payment', + 'nIlettersAndValues' => 'nIlettersAndValues' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeCurrentNiLetter' => 'setEmployeeCurrentNiLetter', + 'offPayrollWorker' => 'setOffPayrollWorker', + 'occPenInd' => 'setOccPenInd', + 'directorsNIC' => 'setDirectorsNIC', + 'taxWkOfApptOfDirector' => 'setTaxWkOfApptOfDirector', + 'starter' => 'setStarter', + 'payId' => 'setPayId', + 'payIdChgd' => 'setPayIdChgd', + 'paymentToANonIndividual' => 'setPaymentToANonIndividual', + 'irrEmp' => 'setIrrEmp', + 'leavingDate' => 'setLeavingDate', + 'figuresToDate' => 'setFiguresToDate', + 'payment' => 'setPayment', + 'nIlettersAndValues' => 'setNIlettersAndValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeCurrentNiLetter' => 'getEmployeeCurrentNiLetter', + 'offPayrollWorker' => 'getOffPayrollWorker', + 'occPenInd' => 'getOccPenInd', + 'directorsNIC' => 'getDirectorsNIC', + 'taxWkOfApptOfDirector' => 'getTaxWkOfApptOfDirector', + 'starter' => 'getStarter', + 'payId' => 'getPayId', + 'payIdChgd' => 'getPayIdChgd', + 'paymentToANonIndividual' => 'getPaymentToANonIndividual', + 'irrEmp' => 'getIrrEmp', + 'leavingDate' => 'getLeavingDate', + 'figuresToDate' => 'getFiguresToDate', + 'payment' => 'getPayment', + 'nIlettersAndValues' => 'getNIlettersAndValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeCurrentNiLetter', $data ?? [], null); + $this->setIfExists('offPayrollWorker', $data ?? [], null); + $this->setIfExists('occPenInd', $data ?? [], null); + $this->setIfExists('directorsNIC', $data ?? [], null); + $this->setIfExists('taxWkOfApptOfDirector', $data ?? [], null); + $this->setIfExists('starter', $data ?? [], null); + $this->setIfExists('payId', $data ?? [], null); + $this->setIfExists('payIdChgd', $data ?? [], null); + $this->setIfExists('paymentToANonIndividual', $data ?? [], null); + $this->setIfExists('irrEmp', $data ?? [], null); + $this->setIfExists('leavingDate', $data ?? [], null); + $this->setIfExists('figuresToDate', $data ?? [], null); + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('nIlettersAndValues', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeCurrentNiLetter + * + * @return string|null + */ + public function getEmployeeCurrentNiLetter(): ?string + { + return $this->container['employeeCurrentNiLetter']; + } + + /** + * Sets employeeCurrentNiLetter + * + * @param string|null $employeeCurrentNiLetter employeeCurrentNiLetter + * + * @return $this + */ + public function setEmployeeCurrentNiLetter(?string $employeeCurrentNiLetter): static + { + if (is_null($employeeCurrentNiLetter)) { + array_push($this->openAPINullablesSetToNull, 'employeeCurrentNiLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeCurrentNiLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeCurrentNiLetter'] = $employeeCurrentNiLetter; + + return $this; + } + + /** + * Gets offPayrollWorker + * + * @return string|null + */ + public function getOffPayrollWorker(): ?string + { + return $this->container['offPayrollWorker']; + } + + /** + * Sets offPayrollWorker + * + * @param string|null $offPayrollWorker offPayrollWorker + * + * @return $this + */ + public function setOffPayrollWorker(?string $offPayrollWorker): static + { + if (is_null($offPayrollWorker)) { + array_push($this->openAPINullablesSetToNull, 'offPayrollWorker'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('offPayrollWorker', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['offPayrollWorker'] = $offPayrollWorker; + + return $this; + } + + /** + * Gets occPenInd + * + * @return string|null + */ + public function getOccPenInd(): ?string + { + return $this->container['occPenInd']; + } + + /** + * Sets occPenInd + * + * @param string|null $occPenInd occPenInd + * + * @return $this + */ + public function setOccPenInd(?string $occPenInd): static + { + if (is_null($occPenInd)) { + array_push($this->openAPINullablesSetToNull, 'occPenInd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occPenInd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occPenInd'] = $occPenInd; + + return $this; + } + + /** + * Gets directorsNIC + * + * @return string|null + */ + public function getDirectorsNIC(): ?string + { + return $this->container['directorsNIC']; + } + + /** + * Sets directorsNIC + * + * @param string|null $directorsNIC directorsNIC + * + * @return $this + */ + public function setDirectorsNIC(?string $directorsNIC): static + { + if (is_null($directorsNIC)) { + array_push($this->openAPINullablesSetToNull, 'directorsNIC'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('directorsNIC', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['directorsNIC'] = $directorsNIC; + + return $this; + } + + /** + * Gets taxWkOfApptOfDirector + * + * @return string|null + */ + public function getTaxWkOfApptOfDirector(): ?string + { + return $this->container['taxWkOfApptOfDirector']; + } + + /** + * Sets taxWkOfApptOfDirector + * + * @param string|null $taxWkOfApptOfDirector taxWkOfApptOfDirector + * + * @return $this + */ + public function setTaxWkOfApptOfDirector(?string $taxWkOfApptOfDirector): static + { + if (is_null($taxWkOfApptOfDirector)) { + array_push($this->openAPINullablesSetToNull, 'taxWkOfApptOfDirector'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxWkOfApptOfDirector', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxWkOfApptOfDirector'] = $taxWkOfApptOfDirector; + + return $this; + } + + /** + * Gets starter + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeStarter|null + */ + public function getStarter(): ?\SynergiTech\Staffology\Model\FpsEmployeeStarter + { + return $this->container['starter']; + } + + /** + * Sets starter + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeStarter|null $starter starter + * + * @return $this + */ + public function setStarter(?\SynergiTech\Staffology\Model\FpsEmployeeStarter $starter): static + { + if (is_null($starter)) { + throw new InvalidArgumentException('non-nullable starter cannot be null'); + } + $this->container['starter'] = $starter; + + return $this; + } + + /** + * Gets payId + * + * @return string|null + */ + public function getPayId(): ?string + { + return $this->container['payId']; + } + + /** + * Sets payId + * + * @param string|null $payId payId + * + * @return $this + */ + public function setPayId(?string $payId): static + { + if (is_null($payId)) { + array_push($this->openAPINullablesSetToNull, 'payId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payId'] = $payId; + + return $this; + } + + /** + * Gets payIdChgd + * + * @return \SynergiTech\Staffology\Model\FpsEmployerPayIdChanged|null + */ + public function getPayIdChgd(): ?\SynergiTech\Staffology\Model\FpsEmployerPayIdChanged + { + return $this->container['payIdChgd']; + } + + /** + * Sets payIdChgd + * + * @param \SynergiTech\Staffology\Model\FpsEmployerPayIdChanged|null $payIdChgd payIdChgd + * + * @return $this + */ + public function setPayIdChgd(?\SynergiTech\Staffology\Model\FpsEmployerPayIdChanged $payIdChgd): static + { + if (is_null($payIdChgd)) { + throw new InvalidArgumentException('non-nullable payIdChgd cannot be null'); + } + $this->container['payIdChgd'] = $payIdChgd; + + return $this; + } + + /** + * Gets paymentToANonIndividual + * + * @return string|null + */ + public function getPaymentToANonIndividual(): ?string + { + return $this->container['paymentToANonIndividual']; + } + + /** + * Sets paymentToANonIndividual + * + * @param string|null $paymentToANonIndividual paymentToANonIndividual + * + * @return $this + */ + public function setPaymentToANonIndividual(?string $paymentToANonIndividual): static + { + if (is_null($paymentToANonIndividual)) { + array_push($this->openAPINullablesSetToNull, 'paymentToANonIndividual'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentToANonIndividual', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentToANonIndividual'] = $paymentToANonIndividual; + + return $this; + } + + /** + * Gets irrEmp + * + * @return string|null + */ + public function getIrrEmp(): ?string + { + return $this->container['irrEmp']; + } + + /** + * Sets irrEmp + * + * @param string|null $irrEmp irrEmp + * + * @return $this + */ + public function setIrrEmp(?string $irrEmp): static + { + if (is_null($irrEmp)) { + array_push($this->openAPINullablesSetToNull, 'irrEmp'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('irrEmp', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['irrEmp'] = $irrEmp; + + return $this; + } + + /** + * Gets leavingDate + * + * @return string|null + */ + public function getLeavingDate(): ?string + { + return $this->container['leavingDate']; + } + + /** + * Sets leavingDate + * + * @param string|null $leavingDate leavingDate + * + * @return $this + */ + public function setLeavingDate(?string $leavingDate): static + { + if (is_null($leavingDate)) { + array_push($this->openAPINullablesSetToNull, 'leavingDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leavingDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leavingDate'] = $leavingDate; + + return $this; + } + + /** + * Gets figuresToDate + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeFigsToDate|null + */ + public function getFiguresToDate(): ?\SynergiTech\Staffology\Model\FpsEmployeeFigsToDate + { + return $this->container['figuresToDate']; + } + + /** + * Sets figuresToDate + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeFigsToDate|null $figuresToDate figuresToDate + * + * @return $this + */ + public function setFiguresToDate(?\SynergiTech\Staffology\Model\FpsEmployeeFigsToDate $figuresToDate): static + { + if (is_null($figuresToDate)) { + throw new InvalidArgumentException('non-nullable figuresToDate cannot be null'); + } + $this->container['figuresToDate'] = $figuresToDate; + + return $this; + } + + /** + * Gets payment + * + * @return \SynergiTech\Staffology\Model\FpsEmployeePayment|null + */ + public function getPayment(): ?\SynergiTech\Staffology\Model\FpsEmployeePayment + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \SynergiTech\Staffology\Model\FpsEmployeePayment|null $payment payment + * + * @return $this + */ + public function setPayment(?\SynergiTech\Staffology\Model\FpsEmployeePayment $payment): static + { + if (is_null($payment)) { + throw new InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets nIlettersAndValues + * + * @return \SynergiTech\Staffology\Model\FpsEmployeeNIlettersAndValues[]|null + */ + public function getNIlettersAndValues(): ?array + { + return $this->container['nIlettersAndValues']; + } + + /** + * Sets nIlettersAndValues + * + * @param \SynergiTech\Staffology\Model\FpsEmployeeNIlettersAndValues[]|null $nIlettersAndValues nIlettersAndValues + * + * @return $this + */ + public function setNIlettersAndValues(?array $nIlettersAndValues): static + { + if (is_null($nIlettersAndValues)) { + array_push($this->openAPINullablesSetToNull, 'nIlettersAndValues'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nIlettersAndValues', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nIlettersAndValues'] = $nIlettersAndValues; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsFields.php b/src/Model/FpsFields.php new file mode 100644 index 0000000..670da06 --- /dev/null +++ b/src/Model/FpsFields.php @@ -0,0 +1,544 @@ + + */ +class FpsFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'offPayrollWorker' => 'bool', + 'irregularPaymentPattern' => 'bool', + 'nonIndividual' => 'bool', + 'hoursNormallyWorked' => '\SynergiTech\Staffology\Model\HoursNormallyWorked', + 'excludeFromRtiSubmissions' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'offPayrollWorker' => null, + 'irregularPaymentPattern' => null, + 'nonIndividual' => null, + 'hoursNormallyWorked' => null, + 'excludeFromRtiSubmissions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'offPayrollWorker' => false, + 'irregularPaymentPattern' => false, + 'nonIndividual' => false, + 'hoursNormallyWorked' => false, + 'excludeFromRtiSubmissions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'offPayrollWorker' => 'offPayrollWorker', + 'irregularPaymentPattern' => 'irregularPaymentPattern', + 'nonIndividual' => 'nonIndividual', + 'hoursNormallyWorked' => 'hoursNormallyWorked', + 'excludeFromRtiSubmissions' => 'excludeFromRtiSubmissions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'offPayrollWorker' => 'setOffPayrollWorker', + 'irregularPaymentPattern' => 'setIrregularPaymentPattern', + 'nonIndividual' => 'setNonIndividual', + 'hoursNormallyWorked' => 'setHoursNormallyWorked', + 'excludeFromRtiSubmissions' => 'setExcludeFromRtiSubmissions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'offPayrollWorker' => 'getOffPayrollWorker', + 'irregularPaymentPattern' => 'getIrregularPaymentPattern', + 'nonIndividual' => 'getNonIndividual', + 'hoursNormallyWorked' => 'getHoursNormallyWorked', + 'excludeFromRtiSubmissions' => 'getExcludeFromRtiSubmissions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('offPayrollWorker', $data ?? [], null); + $this->setIfExists('irregularPaymentPattern', $data ?? [], null); + $this->setIfExists('nonIndividual', $data ?? [], null); + $this->setIfExists('hoursNormallyWorked', $data ?? [], null); + $this->setIfExists('excludeFromRtiSubmissions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offPayrollWorker + * + * @return bool|null + */ + public function getOffPayrollWorker(): ?bool + { + return $this->container['offPayrollWorker']; + } + + /** + * Sets offPayrollWorker + * + * @param bool|null $offPayrollWorker offPayrollWorker + * + * @return $this + */ + public function setOffPayrollWorker(?bool $offPayrollWorker): static + { + if (is_null($offPayrollWorker)) { + throw new InvalidArgumentException('non-nullable offPayrollWorker cannot be null'); + } + $this->container['offPayrollWorker'] = $offPayrollWorker; + + return $this; + } + + /** + * Gets irregularPaymentPattern + * + * @return bool|null + */ + public function getIrregularPaymentPattern(): ?bool + { + return $this->container['irregularPaymentPattern']; + } + + /** + * Sets irregularPaymentPattern + * + * @param bool|null $irregularPaymentPattern True if employee is currently on an irregular payment patter + * + * @return $this + */ + public function setIrregularPaymentPattern(?bool $irregularPaymentPattern): static + { + if (is_null($irregularPaymentPattern)) { + throw new InvalidArgumentException('non-nullable irregularPaymentPattern cannot be null'); + } + $this->container['irregularPaymentPattern'] = $irregularPaymentPattern; + + return $this; + } + + /** + * Gets nonIndividual + * + * @return bool|null + */ + public function getNonIndividual(): ?bool + { + return $this->container['nonIndividual']; + } + + /** + * Sets nonIndividual + * + * @param bool|null $nonIndividual True if Employee's payments are being made to a body (eg, trustee, corporate organisation or personal representative) + * + * @return $this + */ + public function setNonIndividual(?bool $nonIndividual): static + { + if (is_null($nonIndividual)) { + throw new InvalidArgumentException('non-nullable nonIndividual cannot be null'); + } + $this->container['nonIndividual'] = $nonIndividual; + + return $this; + } + + /** + * Gets hoursNormallyWorked + * + * @return \SynergiTech\Staffology\Model\HoursNormallyWorked|null + */ + public function getHoursNormallyWorked(): ?\SynergiTech\Staffology\Model\HoursNormallyWorked + { + return $this->container['hoursNormallyWorked']; + } + + /** + * Sets hoursNormallyWorked + * + * @param \SynergiTech\Staffology\Model\HoursNormallyWorked|null $hoursNormallyWorked hoursNormallyWorked + * + * @return $this + */ + public function setHoursNormallyWorked(?\SynergiTech\Staffology\Model\HoursNormallyWorked $hoursNormallyWorked): static + { + if (is_null($hoursNormallyWorked)) { + throw new InvalidArgumentException('non-nullable hoursNormallyWorked cannot be null'); + } + $this->container['hoursNormallyWorked'] = $hoursNormallyWorked; + + return $this; + } + + /** + * Gets excludeFromRtiSubmissions + * + * @return bool|null + */ + public function getExcludeFromRtiSubmissions(): ?bool + { + return $this->container['excludeFromRtiSubmissions']; + } + + /** + * Sets excludeFromRtiSubmissions + * + * @param bool|null $excludeFromRtiSubmissions True if Employee is excluded from RTI submissions + * + * @return $this + */ + public function setExcludeFromRtiSubmissions(?bool $excludeFromRtiSubmissions): static + { + if (is_null($excludeFromRtiSubmissions)) { + throw new InvalidArgumentException('non-nullable excludeFromRtiSubmissions cannot be null'); + } + $this->container['excludeFromRtiSubmissions'] = $excludeFromRtiSubmissions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsLateReason.php b/src/Model/FpsLateReason.php new file mode 100644 index 0000000..14fb2e9 --- /dev/null +++ b/src/Model/FpsLateReason.php @@ -0,0 +1,59 @@ + + */ +class FpsPriorVersion implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsPriorVersion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payRunEntryId' => 'string', + 'fpsId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payRunEntryId' => 'uuid', + 'fpsId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payRunEntryId' => false, + 'fpsId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payRunEntryId' => 'payRunEntryId', + 'fpsId' => 'fpsId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payRunEntryId' => 'setPayRunEntryId', + 'fpsId' => 'setFpsId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payRunEntryId' => 'getPayRunEntryId', + 'fpsId' => 'getFpsId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payRunEntryId', $data ?? [], null); + $this->setIfExists('fpsId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payRunEntryId + * + * @return string|null + */ + public function getPayRunEntryId(): ?string + { + return $this->container['payRunEntryId']; + } + + /** + * Sets payRunEntryId + * + * @param string|null $payRunEntryId payRunEntryId + * + * @return $this + */ + public function setPayRunEntryId(?string $payRunEntryId): static + { + if (is_null($payRunEntryId)) { + throw new InvalidArgumentException('non-nullable payRunEntryId cannot be null'); + } + $this->container['payRunEntryId'] = $payRunEntryId; + + return $this; + } + + /** + * Gets fpsId + * + * @return string|null + */ + public function getFpsId(): ?string + { + return $this->container['fpsId']; + } + + /** + * Sets fpsId + * + * @param string|null $fpsId The Id of the FPS that contains an earlier version of the PayRunEntry + * + * @return $this + */ + public function setFpsId(?string $fpsId): static + { + if (is_null($fpsId)) { + throw new InvalidArgumentException('non-nullable fpsId cannot be null'); + } + $this->container['fpsId'] = $fpsId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FpsReportResponse.php b/src/Model/FpsReportResponse.php new file mode 100644 index 0000000..9e8950d --- /dev/null +++ b/src/Model/FpsReportResponse.php @@ -0,0 +1,532 @@ + + */ +class FpsReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FpsReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\Fps', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\Fps|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\Fps + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\Fps|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\Fps $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FromToDates.php b/src/Model/FromToDates.php new file mode 100644 index 0000000..0fcbcec --- /dev/null +++ b/src/Model/FromToDates.php @@ -0,0 +1,442 @@ + + */ +class FromToDates implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FromToDates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'from' => '\DateTime', + 'to' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'from' => 'date', + 'to' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'from' => false, + 'to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'from' => 'from', + 'to' => 'to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'from' => 'setFrom', + 'to' => 'setTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'from' => 'getFrom', + 'to' => 'getTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from + * + * @return \DateTime|null + */ + public function getFrom(): ?\DateTime + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime|null $from from + * + * @return $this + */ + public function setFrom(?\DateTime $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \DateTime|null + */ + public function getTo(): ?\DateTime + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \DateTime|null $to to + * + * @return $this + */ + public function setTo(?\DateTime $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FullPaymentSubmission.php b/src/Model/FullPaymentSubmission.php new file mode 100644 index 0000000..1686346 --- /dev/null +++ b/src/Model/FullPaymentSubmission.php @@ -0,0 +1,456 @@ + + */ +class FullPaymentSubmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullPaymentSubmission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\FpsEmployee[]', + 'relatedTaxYear' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'relatedTaxYear' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => true, + 'relatedTaxYear' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'relatedTaxYear' => 'relatedTaxYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'relatedTaxYear' => 'setRelatedTaxYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'relatedTaxYear' => 'getRelatedTaxYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('relatedTaxYear', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\FpsEmployee[]|null + */ + public function getEmployee(): ?array + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\FpsEmployee[]|null $employee employee + * + * @return $this + */ + public function setEmployee(?array $employee): static + { + if (is_null($employee)) { + array_push($this->openAPINullablesSetToNull, 'employee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets relatedTaxYear + * + * @return string|null + */ + public function getRelatedTaxYear(): ?string + { + return $this->container['relatedTaxYear']; + } + + /** + * Sets relatedTaxYear + * + * @param string|null $relatedTaxYear relatedTaxYear + * + * @return $this + */ + public function setRelatedTaxYear(?string $relatedTaxYear): static + { + if (is_null($relatedTaxYear)) { + array_push($this->openAPINullablesSetToNull, 'relatedTaxYear'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('relatedTaxYear', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['relatedTaxYear'] = $relatedTaxYear; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FullSummaryOfPayReport.php b/src/Model/FullSummaryOfPayReport.php new file mode 100644 index 0000000..6c3ced5 --- /dev/null +++ b/src/Model/FullSummaryOfPayReport.php @@ -0,0 +1,919 @@ + + */ +class FullSummaryOfPayReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullSummaryOfPayReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]', + 'deductionLines' => '\SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'deductionLines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'deductionLines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'deductionLines' => 'deductionLines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'deductionLines' => 'setDeductionLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'deductionLines' => 'getDeductionLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('deductionLines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets deductionLines + * + * @return \SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]|null + */ + public function getDeductionLines(): ?array + { + return $this->container['deductionLines']; + } + + /** + * Sets deductionLines + * + * @param \SynergiTech\Staffology\Model\FullSummaryOfPayReportLine[]|null $deductionLines deductionLines + * + * @return $this + */ + public function setDeductionLines(?array $deductionLines): static + { + if (is_null($deductionLines)) { + array_push($this->openAPINullablesSetToNull, 'deductionLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deductionLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deductionLines'] = $deductionLines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FullSummaryOfPayReportLine.php b/src/Model/FullSummaryOfPayReportLine.php new file mode 100644 index 0000000..7698e76 --- /dev/null +++ b/src/Model/FullSummaryOfPayReportLine.php @@ -0,0 +1,558 @@ + + */ +class FullSummaryOfPayReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullSummaryOfPayReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payCode' => '\SynergiTech\Staffology\Model\PayCode', + 'value' => 'float', + 'erValue' => 'float', + 'qty' => 'float', + 'headCount' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payCode' => null, + 'value' => 'double', + 'erValue' => 'double', + 'qty' => 'double', + 'headCount' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payCode' => false, + 'value' => false, + 'erValue' => true, + 'qty' => true, + 'headCount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payCode' => 'payCode', + 'value' => 'value', + 'erValue' => 'erValue', + 'qty' => 'qty', + 'headCount' => 'headCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payCode' => 'setPayCode', + 'value' => 'setValue', + 'erValue' => 'setErValue', + 'qty' => 'setQty', + 'headCount' => 'setHeadCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payCode' => 'getPayCode', + 'value' => 'getValue', + 'erValue' => 'getErValue', + 'qty' => 'getQty', + 'headCount' => 'getHeadCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('erValue', $data ?? [], null); + $this->setIfExists('qty', $data ?? [], null); + $this->setIfExists('headCount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payCode + * + * @return \SynergiTech\Staffology\Model\PayCode|null + */ + public function getPayCode(): ?\SynergiTech\Staffology\Model\PayCode + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?\SynergiTech\Staffology\Model\PayCode $payCode): static + { + if (is_null($payCode)) { + throw new InvalidArgumentException('non-nullable payCode cannot be null'); + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets erValue + * + * @return float|null + */ + public function getErValue(): ?float + { + return $this->container['erValue']; + } + + /** + * Sets erValue + * + * @param float|null $erValue erValue + * + * @return $this + */ + public function setErValue(?float $erValue): static + { + if (is_null($erValue)) { + array_push($this->openAPINullablesSetToNull, 'erValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('erValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['erValue'] = $erValue; + + return $this; + } + + /** + * Gets qty + * + * @return float|null + */ + public function getQty(): ?float + { + return $this->container['qty']; + } + + /** + * Sets qty + * + * @param float|null $qty qty + * + * @return $this + */ + public function setQty(?float $qty): static + { + if (is_null($qty)) { + array_push($this->openAPINullablesSetToNull, 'qty'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qty', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qty'] = $qty; + + return $this; + } + + /** + * Gets headCount + * + * @return int|null + */ + public function getHeadCount(): ?int + { + return $this->container['headCount']; + } + + /** + * Sets headCount + * + * @param int|null $headCount headCount + * + * @return $this + */ + public function setHeadCount(?int $headCount): static + { + if (is_null($headCount)) { + throw new InvalidArgumentException('non-nullable headCount cannot be null'); + } + $this->container['headCount'] = $headCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FullSummaryOfPayReportReportResponse.php b/src/Model/FullSummaryOfPayReportReportResponse.php new file mode 100644 index 0000000..3c44327 --- /dev/null +++ b/src/Model/FullSummaryOfPayReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class FullSummaryOfPayReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullSummaryOfPayReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\FullSummaryOfPayReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\FullSummaryOfPayReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\FullSummaryOfPayReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\FullSummaryOfPayReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\FullSummaryOfPayReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FurloughCalculationBasis.php b/src/Model/FurloughCalculationBasis.php new file mode 100644 index 0000000..7410342 --- /dev/null +++ b/src/Model/FurloughCalculationBasis.php @@ -0,0 +1,47 @@ + + */ +class FurloughReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FurloughReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'maxClaimPerEmployee' => 'float', + 'percentageOfNIAndPensionToClaim' => 'float', + 'govtContribRate' => 'float', + 'companyName' => 'string', + 'employerReference' => 'string', + 'companyCrn' => 'string', + 'ctUtr' => 'string', + 'saUtr' => 'string', + 'claimPeriodStartDate' => '\DateTime', + 'claimPeriodEndDate' => '\DateTime', + 'numberOfEmployeesBeingFurloughed' => 'int', + 'totalClaimAmount' => 'float', + 'totalGrossPay' => 'float', + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => 'float', + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => 'float', + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => 'float', + 'lines' => '\SynergiTech\Staffology\Model\FurloughReportLine[]', + 'bankAccountNumber' => 'string', + 'bankSortCode' => 'string', + 'bankAccountHoldersFirstName' => 'string', + 'bankAccountHoldersLastName' => 'string', + 'bankAccountHoldersAddress' => 'string', + 'buildingSocietyRollNumber' => 'string', + 'companyAddress' => 'string', + 'contactName' => 'string', + 'contactNumber' => 'string', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'maxClaimPerEmployee' => 'double', + 'percentageOfNIAndPensionToClaim' => 'double', + 'govtContribRate' => 'double', + 'companyName' => null, + 'employerReference' => null, + 'companyCrn' => null, + 'ctUtr' => null, + 'saUtr' => null, + 'claimPeriodStartDate' => 'date', + 'claimPeriodEndDate' => 'date', + 'numberOfEmployeesBeingFurloughed' => 'int32', + 'totalClaimAmount' => 'double', + 'totalGrossPay' => 'double', + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => 'double', + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => 'double', + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => 'double', + 'lines' => null, + 'bankAccountNumber' => null, + 'bankSortCode' => null, + 'bankAccountHoldersFirstName' => null, + 'bankAccountHoldersLastName' => null, + 'bankAccountHoldersAddress' => null, + 'buildingSocietyRollNumber' => null, + 'companyAddress' => null, + 'contactName' => null, + 'contactNumber' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'maxClaimPerEmployee' => false, + 'percentageOfNIAndPensionToClaim' => false, + 'govtContribRate' => false, + 'companyName' => true, + 'employerReference' => true, + 'companyCrn' => true, + 'ctUtr' => true, + 'saUtr' => true, + 'claimPeriodStartDate' => false, + 'claimPeriodEndDate' => false, + 'numberOfEmployeesBeingFurloughed' => false, + 'totalClaimAmount' => false, + 'totalGrossPay' => false, + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => false, + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => false, + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => false, + 'lines' => true, + 'bankAccountNumber' => true, + 'bankSortCode' => true, + 'bankAccountHoldersFirstName' => true, + 'bankAccountHoldersLastName' => true, + 'bankAccountHoldersAddress' => true, + 'buildingSocietyRollNumber' => true, + 'companyAddress' => true, + 'contactName' => true, + 'contactNumber' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'maxClaimPerEmployee' => 'maxClaimPerEmployee', + 'percentageOfNIAndPensionToClaim' => 'percentageOfNIAndPensionToClaim', + 'govtContribRate' => 'govtContribRate', + 'companyName' => 'companyName', + 'employerReference' => 'employerReference', + 'companyCrn' => 'companyCrn', + 'ctUtr' => 'ctUtr', + 'saUtr' => 'saUtr', + 'claimPeriodStartDate' => 'claimPeriodStartDate', + 'claimPeriodEndDate' => 'claimPeriodEndDate', + 'numberOfEmployeesBeingFurloughed' => 'numberOfEmployeesBeingFurloughed', + 'totalClaimAmount' => 'totalClaimAmount', + 'totalGrossPay' => 'totalGrossPay', + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod', + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees', + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees', + 'lines' => 'lines', + 'bankAccountNumber' => 'bankAccountNumber', + 'bankSortCode' => 'bankSortCode', + 'bankAccountHoldersFirstName' => 'bankAccountHoldersFirstName', + 'bankAccountHoldersLastName' => 'bankAccountHoldersLastName', + 'bankAccountHoldersAddress' => 'bankAccountHoldersAddress', + 'buildingSocietyRollNumber' => 'buildingSocietyRollNumber', + 'companyAddress' => 'companyAddress', + 'contactName' => 'contactName', + 'contactNumber' => 'contactNumber', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'maxClaimPerEmployee' => 'setMaxClaimPerEmployee', + 'percentageOfNIAndPensionToClaim' => 'setPercentageOfNIAndPensionToClaim', + 'govtContribRate' => 'setGovtContribRate', + 'companyName' => 'setCompanyName', + 'employerReference' => 'setEmployerReference', + 'companyCrn' => 'setCompanyCrn', + 'ctUtr' => 'setCtUtr', + 'saUtr' => 'setSaUtr', + 'claimPeriodStartDate' => 'setClaimPeriodStartDate', + 'claimPeriodEndDate' => 'setClaimPeriodEndDate', + 'numberOfEmployeesBeingFurloughed' => 'setNumberOfEmployeesBeingFurloughed', + 'totalClaimAmount' => 'setTotalClaimAmount', + 'totalGrossPay' => 'setTotalGrossPay', + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => 'setAmountClaimedForGrossPayToEmployeesOnFurloughForThePeriod', + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => 'setAmountClaimedForEmployerNICsContributionsForFurloughedEmployees', + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => 'setAmountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees', + 'lines' => 'setLines', + 'bankAccountNumber' => 'setBankAccountNumber', + 'bankSortCode' => 'setBankSortCode', + 'bankAccountHoldersFirstName' => 'setBankAccountHoldersFirstName', + 'bankAccountHoldersLastName' => 'setBankAccountHoldersLastName', + 'bankAccountHoldersAddress' => 'setBankAccountHoldersAddress', + 'buildingSocietyRollNumber' => 'setBuildingSocietyRollNumber', + 'companyAddress' => 'setCompanyAddress', + 'contactName' => 'setContactName', + 'contactNumber' => 'setContactNumber', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'maxClaimPerEmployee' => 'getMaxClaimPerEmployee', + 'percentageOfNIAndPensionToClaim' => 'getPercentageOfNIAndPensionToClaim', + 'govtContribRate' => 'getGovtContribRate', + 'companyName' => 'getCompanyName', + 'employerReference' => 'getEmployerReference', + 'companyCrn' => 'getCompanyCrn', + 'ctUtr' => 'getCtUtr', + 'saUtr' => 'getSaUtr', + 'claimPeriodStartDate' => 'getClaimPeriodStartDate', + 'claimPeriodEndDate' => 'getClaimPeriodEndDate', + 'numberOfEmployeesBeingFurloughed' => 'getNumberOfEmployeesBeingFurloughed', + 'totalClaimAmount' => 'getTotalClaimAmount', + 'totalGrossPay' => 'getTotalGrossPay', + 'amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod' => 'getAmountClaimedForGrossPayToEmployeesOnFurloughForThePeriod', + 'amountClaimedForEmployerNICsContributionsForFurloughedEmployees' => 'getAmountClaimedForEmployerNICsContributionsForFurloughedEmployees', + 'amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees' => 'getAmountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees', + 'lines' => 'getLines', + 'bankAccountNumber' => 'getBankAccountNumber', + 'bankSortCode' => 'getBankSortCode', + 'bankAccountHoldersFirstName' => 'getBankAccountHoldersFirstName', + 'bankAccountHoldersLastName' => 'getBankAccountHoldersLastName', + 'bankAccountHoldersAddress' => 'getBankAccountHoldersAddress', + 'buildingSocietyRollNumber' => 'getBuildingSocietyRollNumber', + 'companyAddress' => 'getCompanyAddress', + 'contactName' => 'getContactName', + 'contactNumber' => 'getContactNumber', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('maxClaimPerEmployee', $data ?? [], null); + $this->setIfExists('percentageOfNIAndPensionToClaim', $data ?? [], null); + $this->setIfExists('govtContribRate', $data ?? [], null); + $this->setIfExists('companyName', $data ?? [], null); + $this->setIfExists('employerReference', $data ?? [], null); + $this->setIfExists('companyCrn', $data ?? [], null); + $this->setIfExists('ctUtr', $data ?? [], null); + $this->setIfExists('saUtr', $data ?? [], null); + $this->setIfExists('claimPeriodStartDate', $data ?? [], null); + $this->setIfExists('claimPeriodEndDate', $data ?? [], null); + $this->setIfExists('numberOfEmployeesBeingFurloughed', $data ?? [], null); + $this->setIfExists('totalClaimAmount', $data ?? [], null); + $this->setIfExists('totalGrossPay', $data ?? [], null); + $this->setIfExists('amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod', $data ?? [], null); + $this->setIfExists('amountClaimedForEmployerNICsContributionsForFurloughedEmployees', $data ?? [], null); + $this->setIfExists('amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('bankAccountNumber', $data ?? [], null); + $this->setIfExists('bankSortCode', $data ?? [], null); + $this->setIfExists('bankAccountHoldersFirstName', $data ?? [], null); + $this->setIfExists('bankAccountHoldersLastName', $data ?? [], null); + $this->setIfExists('bankAccountHoldersAddress', $data ?? [], null); + $this->setIfExists('buildingSocietyRollNumber', $data ?? [], null); + $this->setIfExists('companyAddress', $data ?? [], null); + $this->setIfExists('contactName', $data ?? [], null); + $this->setIfExists('contactNumber', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets maxClaimPerEmployee + * + * @return float|null + */ + public function getMaxClaimPerEmployee(): ?float + { + return $this->container['maxClaimPerEmployee']; + } + + /** + * Sets maxClaimPerEmployee + * + * @param float|null $maxClaimPerEmployee maxClaimPerEmployee + * + * @return $this + */ + public function setMaxClaimPerEmployee(?float $maxClaimPerEmployee): static + { + if (is_null($maxClaimPerEmployee)) { + throw new InvalidArgumentException('non-nullable maxClaimPerEmployee cannot be null'); + } + $this->container['maxClaimPerEmployee'] = $maxClaimPerEmployee; + + return $this; + } + + /** + * Gets percentageOfNIAndPensionToClaim + * + * @return float|null + */ + public function getPercentageOfNIAndPensionToClaim(): ?float + { + return $this->container['percentageOfNIAndPensionToClaim']; + } + + /** + * Sets percentageOfNIAndPensionToClaim + * + * @param float|null $percentageOfNIAndPensionToClaim percentageOfNIAndPensionToClaim + * + * @return $this + */ + public function setPercentageOfNIAndPensionToClaim(?float $percentageOfNIAndPensionToClaim): static + { + if (is_null($percentageOfNIAndPensionToClaim)) { + throw new InvalidArgumentException('non-nullable percentageOfNIAndPensionToClaim cannot be null'); + } + $this->container['percentageOfNIAndPensionToClaim'] = $percentageOfNIAndPensionToClaim; + + return $this; + } + + /** + * Gets govtContribRate + * + * @return float|null + */ + public function getGovtContribRate(): ?float + { + return $this->container['govtContribRate']; + } + + /** + * Sets govtContribRate + * + * @param float|null $govtContribRate govtContribRate + * + * @return $this + */ + public function setGovtContribRate(?float $govtContribRate): static + { + if (is_null($govtContribRate)) { + throw new InvalidArgumentException('non-nullable govtContribRate cannot be null'); + } + $this->container['govtContribRate'] = $govtContribRate; + + return $this; + } + + /** + * Gets companyName + * + * @return string|null + */ + public function getCompanyName(): ?string + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string|null $companyName companyName + * + * @return $this + */ + public function setCompanyName(?string $companyName): static + { + if (is_null($companyName)) { + array_push($this->openAPINullablesSetToNull, 'companyName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets employerReference + * + * @return string|null + */ + public function getEmployerReference(): ?string + { + return $this->container['employerReference']; + } + + /** + * Sets employerReference + * + * @param string|null $employerReference employerReference + * + * @return $this + */ + public function setEmployerReference(?string $employerReference): static + { + if (is_null($employerReference)) { + array_push($this->openAPINullablesSetToNull, 'employerReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerReference'] = $employerReference; + + return $this; + } + + /** + * Gets companyCrn + * + * @return string|null + */ + public function getCompanyCrn(): ?string + { + return $this->container['companyCrn']; + } + + /** + * Sets companyCrn + * + * @param string|null $companyCrn companyCrn + * + * @return $this + */ + public function setCompanyCrn(?string $companyCrn): static + { + if (is_null($companyCrn)) { + array_push($this->openAPINullablesSetToNull, 'companyCrn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyCrn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['companyCrn'] = $companyCrn; + + return $this; + } + + /** + * Gets ctUtr + * + * @return string|null + */ + public function getCtUtr(): ?string + { + return $this->container['ctUtr']; + } + + /** + * Sets ctUtr + * + * @param string|null $ctUtr ctUtr + * + * @return $this + */ + public function setCtUtr(?string $ctUtr): static + { + if (is_null($ctUtr)) { + array_push($this->openAPINullablesSetToNull, 'ctUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ctUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ctUtr'] = $ctUtr; + + return $this; + } + + /** + * Gets saUtr + * + * @return string|null + */ + public function getSaUtr(): ?string + { + return $this->container['saUtr']; + } + + /** + * Sets saUtr + * + * @param string|null $saUtr saUtr + * + * @return $this + */ + public function setSaUtr(?string $saUtr): static + { + if (is_null($saUtr)) { + array_push($this->openAPINullablesSetToNull, 'saUtr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('saUtr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['saUtr'] = $saUtr; + + return $this; + } + + /** + * Gets claimPeriodStartDate + * + * @return \DateTime|null + */ + public function getClaimPeriodStartDate(): ?\DateTime + { + return $this->container['claimPeriodStartDate']; + } + + /** + * Sets claimPeriodStartDate + * + * @param \DateTime|null $claimPeriodStartDate claimPeriodStartDate + * + * @return $this + */ + public function setClaimPeriodStartDate(?\DateTime $claimPeriodStartDate): static + { + if (is_null($claimPeriodStartDate)) { + throw new InvalidArgumentException('non-nullable claimPeriodStartDate cannot be null'); + } + $this->container['claimPeriodStartDate'] = $claimPeriodStartDate; + + return $this; + } + + /** + * Gets claimPeriodEndDate + * + * @return \DateTime|null + */ + public function getClaimPeriodEndDate(): ?\DateTime + { + return $this->container['claimPeriodEndDate']; + } + + /** + * Sets claimPeriodEndDate + * + * @param \DateTime|null $claimPeriodEndDate claimPeriodEndDate + * + * @return $this + */ + public function setClaimPeriodEndDate(?\DateTime $claimPeriodEndDate): static + { + if (is_null($claimPeriodEndDate)) { + throw new InvalidArgumentException('non-nullable claimPeriodEndDate cannot be null'); + } + $this->container['claimPeriodEndDate'] = $claimPeriodEndDate; + + return $this; + } + + /** + * Gets numberOfEmployeesBeingFurloughed + * + * @return int|null + */ + public function getNumberOfEmployeesBeingFurloughed(): ?int + { + return $this->container['numberOfEmployeesBeingFurloughed']; + } + + /** + * Sets numberOfEmployeesBeingFurloughed + * + * @param int|null $numberOfEmployeesBeingFurloughed numberOfEmployeesBeingFurloughed + * + * @return $this + */ + public function setNumberOfEmployeesBeingFurloughed(?int $numberOfEmployeesBeingFurloughed): static + { + if (is_null($numberOfEmployeesBeingFurloughed)) { + throw new InvalidArgumentException('non-nullable numberOfEmployeesBeingFurloughed cannot be null'); + } + $this->container['numberOfEmployeesBeingFurloughed'] = $numberOfEmployeesBeingFurloughed; + + return $this; + } + + /** + * Gets totalClaimAmount + * + * @return float|null + */ + public function getTotalClaimAmount(): ?float + { + return $this->container['totalClaimAmount']; + } + + /** + * Sets totalClaimAmount + * + * @param float|null $totalClaimAmount totalClaimAmount + * + * @return $this + */ + public function setTotalClaimAmount(?float $totalClaimAmount): static + { + if (is_null($totalClaimAmount)) { + throw new InvalidArgumentException('non-nullable totalClaimAmount cannot be null'); + } + $this->container['totalClaimAmount'] = $totalClaimAmount; + + return $this; + } + + /** + * Gets totalGrossPay + * + * @return float|null + */ + public function getTotalGrossPay(): ?float + { + return $this->container['totalGrossPay']; + } + + /** + * Sets totalGrossPay + * + * @param float|null $totalGrossPay totalGrossPay + * + * @return $this + */ + public function setTotalGrossPay(?float $totalGrossPay): static + { + if (is_null($totalGrossPay)) { + throw new InvalidArgumentException('non-nullable totalGrossPay cannot be null'); + } + $this->container['totalGrossPay'] = $totalGrossPay; + + return $this; + } + + /** + * Gets amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod + * + * @return float|null + */ + public function getAmountClaimedForGrossPayToEmployeesOnFurloughForThePeriod(): ?float + { + return $this->container['amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod']; + } + + /** + * Sets amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod + * + * @param float|null $amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod + * + * @return $this + */ + public function setAmountClaimedForGrossPayToEmployeesOnFurloughForThePeriod(?float $amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod): static + { + if (is_null($amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod)) { + throw new InvalidArgumentException('non-nullable amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod cannot be null'); + } + $this->container['amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod'] = $amountClaimedForGrossPayToEmployeesOnFurloughForThePeriod; + + return $this; + } + + /** + * Gets amountClaimedForEmployerNICsContributionsForFurloughedEmployees + * + * @return float|null + */ + public function getAmountClaimedForEmployerNICsContributionsForFurloughedEmployees(): ?float + { + return $this->container['amountClaimedForEmployerNICsContributionsForFurloughedEmployees']; + } + + /** + * Sets amountClaimedForEmployerNICsContributionsForFurloughedEmployees + * + * @param float|null $amountClaimedForEmployerNICsContributionsForFurloughedEmployees amountClaimedForEmployerNICsContributionsForFurloughedEmployees + * + * @return $this + */ + public function setAmountClaimedForEmployerNICsContributionsForFurloughedEmployees(?float $amountClaimedForEmployerNICsContributionsForFurloughedEmployees): static + { + if (is_null($amountClaimedForEmployerNICsContributionsForFurloughedEmployees)) { + throw new InvalidArgumentException('non-nullable amountClaimedForEmployerNICsContributionsForFurloughedEmployees cannot be null'); + } + $this->container['amountClaimedForEmployerNICsContributionsForFurloughedEmployees'] = $amountClaimedForEmployerNICsContributionsForFurloughedEmployees; + + return $this; + } + + /** + * Gets amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees + * + * @return float|null + */ + public function getAmountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees(): ?float + { + return $this->container['amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees']; + } + + /** + * Sets amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees + * + * @param float|null $amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees + * + * @return $this + */ + public function setAmountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees(?float $amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees): static + { + if (is_null($amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees)) { + throw new InvalidArgumentException('non-nullable amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees cannot be null'); + } + $this->container['amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees'] = $amountClaimedForEmployersAutoEnrolmentPensionCostsForFurloughedEmployees; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\FurloughReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\FurloughReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets bankAccountNumber + * + * @return string|null + */ + public function getBankAccountNumber(): ?string + { + return $this->container['bankAccountNumber']; + } + + /** + * Sets bankAccountNumber + * + * @param string|null $bankAccountNumber bankAccountNumber + * + * @return $this + */ + public function setBankAccountNumber(?string $bankAccountNumber): static + { + if (is_null($bankAccountNumber)) { + array_push($this->openAPINullablesSetToNull, 'bankAccountNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankAccountNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankAccountNumber'] = $bankAccountNumber; + + return $this; + } + + /** + * Gets bankSortCode + * + * @return string|null + */ + public function getBankSortCode(): ?string + { + return $this->container['bankSortCode']; + } + + /** + * Sets bankSortCode + * + * @param string|null $bankSortCode bankSortCode + * + * @return $this + */ + public function setBankSortCode(?string $bankSortCode): static + { + if (is_null($bankSortCode)) { + array_push($this->openAPINullablesSetToNull, 'bankSortCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankSortCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankSortCode'] = $bankSortCode; + + return $this; + } + + /** + * Gets bankAccountHoldersFirstName + * + * @return string|null + */ + public function getBankAccountHoldersFirstName(): ?string + { + return $this->container['bankAccountHoldersFirstName']; + } + + /** + * Sets bankAccountHoldersFirstName + * + * @param string|null $bankAccountHoldersFirstName bankAccountHoldersFirstName + * + * @return $this + */ + public function setBankAccountHoldersFirstName(?string $bankAccountHoldersFirstName): static + { + if (is_null($bankAccountHoldersFirstName)) { + array_push($this->openAPINullablesSetToNull, 'bankAccountHoldersFirstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankAccountHoldersFirstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankAccountHoldersFirstName'] = $bankAccountHoldersFirstName; + + return $this; + } + + /** + * Gets bankAccountHoldersLastName + * + * @return string|null + */ + public function getBankAccountHoldersLastName(): ?string + { + return $this->container['bankAccountHoldersLastName']; + } + + /** + * Sets bankAccountHoldersLastName + * + * @param string|null $bankAccountHoldersLastName bankAccountHoldersLastName + * + * @return $this + */ + public function setBankAccountHoldersLastName(?string $bankAccountHoldersLastName): static + { + if (is_null($bankAccountHoldersLastName)) { + array_push($this->openAPINullablesSetToNull, 'bankAccountHoldersLastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankAccountHoldersLastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankAccountHoldersLastName'] = $bankAccountHoldersLastName; + + return $this; + } + + /** + * Gets bankAccountHoldersAddress + * + * @return string|null + */ + public function getBankAccountHoldersAddress(): ?string + { + return $this->container['bankAccountHoldersAddress']; + } + + /** + * Sets bankAccountHoldersAddress + * + * @param string|null $bankAccountHoldersAddress bankAccountHoldersAddress + * + * @return $this + */ + public function setBankAccountHoldersAddress(?string $bankAccountHoldersAddress): static + { + if (is_null($bankAccountHoldersAddress)) { + array_push($this->openAPINullablesSetToNull, 'bankAccountHoldersAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankAccountHoldersAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankAccountHoldersAddress'] = $bankAccountHoldersAddress; + + return $this; + } + + /** + * Gets buildingSocietyRollNumber + * + * @return string|null + */ + public function getBuildingSocietyRollNumber(): ?string + { + return $this->container['buildingSocietyRollNumber']; + } + + /** + * Sets buildingSocietyRollNumber + * + * @param string|null $buildingSocietyRollNumber buildingSocietyRollNumber + * + * @return $this + */ + public function setBuildingSocietyRollNumber(?string $buildingSocietyRollNumber): static + { + if (is_null($buildingSocietyRollNumber)) { + array_push($this->openAPINullablesSetToNull, 'buildingSocietyRollNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buildingSocietyRollNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['buildingSocietyRollNumber'] = $buildingSocietyRollNumber; + + return $this; + } + + /** + * Gets companyAddress + * + * @return string|null + */ + public function getCompanyAddress(): ?string + { + return $this->container['companyAddress']; + } + + /** + * Sets companyAddress + * + * @param string|null $companyAddress companyAddress + * + * @return $this + */ + public function setCompanyAddress(?string $companyAddress): static + { + if (is_null($companyAddress)) { + array_push($this->openAPINullablesSetToNull, 'companyAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('companyAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['companyAddress'] = $companyAddress; + + return $this; + } + + /** + * Gets contactName + * + * @return string|null + */ + public function getContactName(): ?string + { + return $this->container['contactName']; + } + + /** + * Sets contactName + * + * @param string|null $contactName contactName + * + * @return $this + */ + public function setContactName(?string $contactName): static + { + if (is_null($contactName)) { + array_push($this->openAPINullablesSetToNull, 'contactName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contactName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contactName'] = $contactName; + + return $this; + } + + /** + * Gets contactNumber + * + * @return string|null + */ + public function getContactNumber(): ?string + { + return $this->container['contactNumber']; + } + + /** + * Sets contactNumber + * + * @param string|null $contactNumber contactNumber + * + * @return $this + */ + public function setContactNumber(?string $contactNumber): static + { + if (is_null($contactNumber)) { + array_push($this->openAPINullablesSetToNull, 'contactNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contactNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contactNumber'] = $contactNumber; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FurloughReportLine.php b/src/Model/FurloughReportLine.php new file mode 100644 index 0000000..9952a21 --- /dev/null +++ b/src/Model/FurloughReportLine.php @@ -0,0 +1,1008 @@ + + */ +class FurloughReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FurloughReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'employeesFullName' => 'string', + 'employeesNINO' => 'string', + 'employeesPayrollReferenceNumber' => 'string', + 'furloughedDays' => 'int', + 'daysInPeriod' => 'int', + 'hoursNormallyWorked' => 'float', + 'hoursFurloughed' => 'float', + 'percentageOfFurloughedDaysWorked' => 'float', + 'grossPay' => 'float', + 'grossPayClaim' => 'float', + 'niClaim' => 'float', + 'pensionClaim' => 'float', + 'totalClaim' => 'float', + 'furloughStart' => '\DateTime', + 'furloughEnd' => '\DateTime', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'employeesFullName' => null, + 'employeesNINO' => null, + 'employeesPayrollReferenceNumber' => null, + 'furloughedDays' => 'int32', + 'daysInPeriod' => 'int32', + 'hoursNormallyWorked' => 'double', + 'hoursFurloughed' => 'double', + 'percentageOfFurloughedDaysWorked' => 'double', + 'grossPay' => 'double', + 'grossPayClaim' => 'double', + 'niClaim' => 'double', + 'pensionClaim' => 'double', + 'totalClaim' => 'double', + 'furloughStart' => 'date', + 'furloughEnd' => 'date', + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'employeesFullName' => true, + 'employeesNINO' => true, + 'employeesPayrollReferenceNumber' => true, + 'furloughedDays' => false, + 'daysInPeriod' => false, + 'hoursNormallyWorked' => true, + 'hoursFurloughed' => true, + 'percentageOfFurloughedDaysWorked' => false, + 'grossPay' => false, + 'grossPayClaim' => false, + 'niClaim' => false, + 'pensionClaim' => false, + 'totalClaim' => false, + 'furloughStart' => true, + 'furloughEnd' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'employeesFullName' => 'employeesFullName', + 'employeesNINO' => 'employeesNINO', + 'employeesPayrollReferenceNumber' => 'employeesPayrollReferenceNumber', + 'furloughedDays' => 'furloughedDays', + 'daysInPeriod' => 'daysInPeriod', + 'hoursNormallyWorked' => 'hoursNormallyWorked', + 'hoursFurloughed' => 'hoursFurloughed', + 'percentageOfFurloughedDaysWorked' => 'percentageOfFurloughedDaysWorked', + 'grossPay' => 'grossPay', + 'grossPayClaim' => 'grossPayClaim', + 'niClaim' => 'niClaim', + 'pensionClaim' => 'pensionClaim', + 'totalClaim' => 'totalClaim', + 'furloughStart' => 'furloughStart', + 'furloughEnd' => 'furloughEnd', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'employeesFullName' => 'setEmployeesFullName', + 'employeesNINO' => 'setEmployeesNINO', + 'employeesPayrollReferenceNumber' => 'setEmployeesPayrollReferenceNumber', + 'furloughedDays' => 'setFurloughedDays', + 'daysInPeriod' => 'setDaysInPeriod', + 'hoursNormallyWorked' => 'setHoursNormallyWorked', + 'hoursFurloughed' => 'setHoursFurloughed', + 'percentageOfFurloughedDaysWorked' => 'setPercentageOfFurloughedDaysWorked', + 'grossPay' => 'setGrossPay', + 'grossPayClaim' => 'setGrossPayClaim', + 'niClaim' => 'setNiClaim', + 'pensionClaim' => 'setPensionClaim', + 'totalClaim' => 'setTotalClaim', + 'furloughStart' => 'setFurloughStart', + 'furloughEnd' => 'setFurloughEnd', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'employeesFullName' => 'getEmployeesFullName', + 'employeesNINO' => 'getEmployeesNINO', + 'employeesPayrollReferenceNumber' => 'getEmployeesPayrollReferenceNumber', + 'furloughedDays' => 'getFurloughedDays', + 'daysInPeriod' => 'getDaysInPeriod', + 'hoursNormallyWorked' => 'getHoursNormallyWorked', + 'hoursFurloughed' => 'getHoursFurloughed', + 'percentageOfFurloughedDaysWorked' => 'getPercentageOfFurloughedDaysWorked', + 'grossPay' => 'getGrossPay', + 'grossPayClaim' => 'getGrossPayClaim', + 'niClaim' => 'getNiClaim', + 'pensionClaim' => 'getPensionClaim', + 'totalClaim' => 'getTotalClaim', + 'furloughStart' => 'getFurloughStart', + 'furloughEnd' => 'getFurloughEnd', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('employeesFullName', $data ?? [], null); + $this->setIfExists('employeesNINO', $data ?? [], null); + $this->setIfExists('employeesPayrollReferenceNumber', $data ?? [], null); + $this->setIfExists('furloughedDays', $data ?? [], null); + $this->setIfExists('daysInPeriod', $data ?? [], null); + $this->setIfExists('hoursNormallyWorked', $data ?? [], null); + $this->setIfExists('hoursFurloughed', $data ?? [], null); + $this->setIfExists('percentageOfFurloughedDaysWorked', $data ?? [], null); + $this->setIfExists('grossPay', $data ?? [], null); + $this->setIfExists('grossPayClaim', $data ?? [], null); + $this->setIfExists('niClaim', $data ?? [], null); + $this->setIfExists('pensionClaim', $data ?? [], null); + $this->setIfExists('totalClaim', $data ?? [], null); + $this->setIfExists('furloughStart', $data ?? [], null); + $this->setIfExists('furloughEnd', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets employeesFullName + * + * @return string|null + */ + public function getEmployeesFullName(): ?string + { + return $this->container['employeesFullName']; + } + + /** + * Sets employeesFullName + * + * @param string|null $employeesFullName employeesFullName + * + * @return $this + */ + public function setEmployeesFullName(?string $employeesFullName): static + { + if (is_null($employeesFullName)) { + array_push($this->openAPINullablesSetToNull, 'employeesFullName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeesFullName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeesFullName'] = $employeesFullName; + + return $this; + } + + /** + * Gets employeesNINO + * + * @return string|null + */ + public function getEmployeesNINO(): ?string + { + return $this->container['employeesNINO']; + } + + /** + * Sets employeesNINO + * + * @param string|null $employeesNINO employeesNINO + * + * @return $this + */ + public function setEmployeesNINO(?string $employeesNINO): static + { + if (is_null($employeesNINO)) { + array_push($this->openAPINullablesSetToNull, 'employeesNINO'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeesNINO', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeesNINO'] = $employeesNINO; + + return $this; + } + + /** + * Gets employeesPayrollReferenceNumber + * + * @return string|null + */ + public function getEmployeesPayrollReferenceNumber(): ?string + { + return $this->container['employeesPayrollReferenceNumber']; + } + + /** + * Sets employeesPayrollReferenceNumber + * + * @param string|null $employeesPayrollReferenceNumber employeesPayrollReferenceNumber + * + * @return $this + */ + public function setEmployeesPayrollReferenceNumber(?string $employeesPayrollReferenceNumber): static + { + if (is_null($employeesPayrollReferenceNumber)) { + array_push($this->openAPINullablesSetToNull, 'employeesPayrollReferenceNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeesPayrollReferenceNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeesPayrollReferenceNumber'] = $employeesPayrollReferenceNumber; + + return $this; + } + + /** + * Gets furloughedDays + * + * @return int|null + */ + public function getFurloughedDays(): ?int + { + return $this->container['furloughedDays']; + } + + /** + * Sets furloughedDays + * + * @param int|null $furloughedDays furloughedDays + * + * @return $this + */ + public function setFurloughedDays(?int $furloughedDays): static + { + if (is_null($furloughedDays)) { + throw new InvalidArgumentException('non-nullable furloughedDays cannot be null'); + } + $this->container['furloughedDays'] = $furloughedDays; + + return $this; + } + + /** + * Gets daysInPeriod + * + * @return int|null + */ + public function getDaysInPeriod(): ?int + { + return $this->container['daysInPeriod']; + } + + /** + * Sets daysInPeriod + * + * @param int|null $daysInPeriod daysInPeriod + * + * @return $this + */ + public function setDaysInPeriod(?int $daysInPeriod): static + { + if (is_null($daysInPeriod)) { + throw new InvalidArgumentException('non-nullable daysInPeriod cannot be null'); + } + $this->container['daysInPeriod'] = $daysInPeriod; + + return $this; + } + + /** + * Gets hoursNormallyWorked + * + * @return float|null + */ + public function getHoursNormallyWorked(): ?float + { + return $this->container['hoursNormallyWorked']; + } + + /** + * Sets hoursNormallyWorked + * + * @param float|null $hoursNormallyWorked hoursNormallyWorked + * + * @return $this + */ + public function setHoursNormallyWorked(?float $hoursNormallyWorked): static + { + if (is_null($hoursNormallyWorked)) { + array_push($this->openAPINullablesSetToNull, 'hoursNormallyWorked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hoursNormallyWorked', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hoursNormallyWorked'] = $hoursNormallyWorked; + + return $this; + } + + /** + * Gets hoursFurloughed + * + * @return float|null + */ + public function getHoursFurloughed(): ?float + { + return $this->container['hoursFurloughed']; + } + + /** + * Sets hoursFurloughed + * + * @param float|null $hoursFurloughed hoursFurloughed + * + * @return $this + */ + public function setHoursFurloughed(?float $hoursFurloughed): static + { + if (is_null($hoursFurloughed)) { + array_push($this->openAPINullablesSetToNull, 'hoursFurloughed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hoursFurloughed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hoursFurloughed'] = $hoursFurloughed; + + return $this; + } + + /** + * Gets percentageOfFurloughedDaysWorked + * + * @return float|null + */ + public function getPercentageOfFurloughedDaysWorked(): ?float + { + return $this->container['percentageOfFurloughedDaysWorked']; + } + + /** + * Sets percentageOfFurloughedDaysWorked + * + * @param float|null $percentageOfFurloughedDaysWorked percentageOfFurloughedDaysWorked + * + * @return $this + */ + public function setPercentageOfFurloughedDaysWorked(?float $percentageOfFurloughedDaysWorked): static + { + if (is_null($percentageOfFurloughedDaysWorked)) { + throw new InvalidArgumentException('non-nullable percentageOfFurloughedDaysWorked cannot be null'); + } + $this->container['percentageOfFurloughedDaysWorked'] = $percentageOfFurloughedDaysWorked; + + return $this; + } + + /** + * Gets grossPay + * + * @return float|null + */ + public function getGrossPay(): ?float + { + return $this->container['grossPay']; + } + + /** + * Sets grossPay + * + * @param float|null $grossPay grossPay + * + * @return $this + */ + public function setGrossPay(?float $grossPay): static + { + if (is_null($grossPay)) { + throw new InvalidArgumentException('non-nullable grossPay cannot be null'); + } + $this->container['grossPay'] = $grossPay; + + return $this; + } + + /** + * Gets grossPayClaim + * + * @return float|null + */ + public function getGrossPayClaim(): ?float + { + return $this->container['grossPayClaim']; + } + + /** + * Sets grossPayClaim + * + * @param float|null $grossPayClaim grossPayClaim + * + * @return $this + */ + public function setGrossPayClaim(?float $grossPayClaim): static + { + if (is_null($grossPayClaim)) { + throw new InvalidArgumentException('non-nullable grossPayClaim cannot be null'); + } + $this->container['grossPayClaim'] = $grossPayClaim; + + return $this; + } + + /** + * Gets niClaim + * + * @return float|null + */ + public function getNiClaim(): ?float + { + return $this->container['niClaim']; + } + + /** + * Sets niClaim + * + * @param float|null $niClaim niClaim + * + * @return $this + */ + public function setNiClaim(?float $niClaim): static + { + if (is_null($niClaim)) { + throw new InvalidArgumentException('non-nullable niClaim cannot be null'); + } + $this->container['niClaim'] = $niClaim; + + return $this; + } + + /** + * Gets pensionClaim + * + * @return float|null + */ + public function getPensionClaim(): ?float + { + return $this->container['pensionClaim']; + } + + /** + * Sets pensionClaim + * + * @param float|null $pensionClaim pensionClaim + * + * @return $this + */ + public function setPensionClaim(?float $pensionClaim): static + { + if (is_null($pensionClaim)) { + throw new InvalidArgumentException('non-nullable pensionClaim cannot be null'); + } + $this->container['pensionClaim'] = $pensionClaim; + + return $this; + } + + /** + * Gets totalClaim + * + * @return float|null + */ + public function getTotalClaim(): ?float + { + return $this->container['totalClaim']; + } + + /** + * Sets totalClaim + * + * @param float|null $totalClaim totalClaim + * + * @return $this + */ + public function setTotalClaim(?float $totalClaim): static + { + if (is_null($totalClaim)) { + throw new InvalidArgumentException('non-nullable totalClaim cannot be null'); + } + $this->container['totalClaim'] = $totalClaim; + + return $this; + } + + /** + * Gets furloughStart + * + * @return \DateTime|null + */ + public function getFurloughStart(): ?\DateTime + { + return $this->container['furloughStart']; + } + + /** + * Sets furloughStart + * + * @param \DateTime|null $furloughStart furloughStart + * + * @return $this + */ + public function setFurloughStart(?\DateTime $furloughStart): static + { + if (is_null($furloughStart)) { + array_push($this->openAPINullablesSetToNull, 'furloughStart'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughStart', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughStart'] = $furloughStart; + + return $this; + } + + /** + * Gets furloughEnd + * + * @return \DateTime|null + */ + public function getFurloughEnd(): ?\DateTime + { + return $this->container['furloughEnd']; + } + + /** + * Sets furloughEnd + * + * @param \DateTime|null $furloughEnd furloughEnd + * + * @return $this + */ + public function setFurloughEnd(?\DateTime $furloughEnd): static + { + if (is_null($furloughEnd)) { + array_push($this->openAPINullablesSetToNull, 'furloughEnd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('furloughEnd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['furloughEnd'] = $furloughEnd; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/FurloughReportReportResponse.php b/src/Model/FurloughReportReportResponse.php new file mode 100644 index 0000000..8a4089c --- /dev/null +++ b/src/Model/FurloughReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class FurloughReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FurloughReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\FurloughReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\FurloughReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\FurloughReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\FurloughReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\FurloughReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Gender.php b/src/Model/Gender.php new file mode 100644 index 0000000..6897c46 --- /dev/null +++ b/src/Model/Gender.php @@ -0,0 +1,45 @@ + + */ +class GenderPayGapLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GenderPayGapLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'forename' => 'string', + 'surname' => 'string', + 'gender' => '\SynergiTech\Staffology\Model\Gender', + 'fullPay' => 'string', + 'ordinaryPay' => 'float', + 'periodBonus' => 'float', + 'bonusRbp' => 'float', + 'weeklyHours' => 'float', + 'hourlyRate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'forename' => null, + 'surname' => null, + 'gender' => null, + 'fullPay' => null, + 'ordinaryPay' => 'double', + 'periodBonus' => 'double', + 'bonusRbp' => 'double', + 'weeklyHours' => 'double', + 'hourlyRate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'forename' => true, + 'surname' => true, + 'gender' => false, + 'fullPay' => true, + 'ordinaryPay' => false, + 'periodBonus' => false, + 'bonusRbp' => false, + 'weeklyHours' => false, + 'hourlyRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'forename' => 'forename', + 'surname' => 'surname', + 'gender' => 'gender', + 'fullPay' => 'fullPay', + 'ordinaryPay' => 'ordinaryPay', + 'periodBonus' => 'periodBonus', + 'bonusRbp' => 'bonusRbp', + 'weeklyHours' => 'weeklyHours', + 'hourlyRate' => 'hourlyRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'forename' => 'setForename', + 'surname' => 'setSurname', + 'gender' => 'setGender', + 'fullPay' => 'setFullPay', + 'ordinaryPay' => 'setOrdinaryPay', + 'periodBonus' => 'setPeriodBonus', + 'bonusRbp' => 'setBonusRbp', + 'weeklyHours' => 'setWeeklyHours', + 'hourlyRate' => 'setHourlyRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'forename' => 'getForename', + 'surname' => 'getSurname', + 'gender' => 'getGender', + 'fullPay' => 'getFullPay', + 'ordinaryPay' => 'getOrdinaryPay', + 'periodBonus' => 'getPeriodBonus', + 'bonusRbp' => 'getBonusRbp', + 'weeklyHours' => 'getWeeklyHours', + 'hourlyRate' => 'getHourlyRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('forename', $data ?? [], null); + $this->setIfExists('surname', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('fullPay', $data ?? [], null); + $this->setIfExists('ordinaryPay', $data ?? [], null); + $this->setIfExists('periodBonus', $data ?? [], null); + $this->setIfExists('bonusRbp', $data ?? [], null); + $this->setIfExists('weeklyHours', $data ?? [], null); + $this->setIfExists('hourlyRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets forename + * + * @return string|null + */ + public function getForename(): ?string + { + return $this->container['forename']; + } + + /** + * Sets forename + * + * @param string|null $forename forename + * + * @return $this + */ + public function setForename(?string $forename): static + { + if (is_null($forename)) { + array_push($this->openAPINullablesSetToNull, 'forename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forename'] = $forename; + + return $this; + } + + /** + * Gets surname + * + * @return string|null + */ + public function getSurname(): ?string + { + return $this->container['surname']; + } + + /** + * Sets surname + * + * @param string|null $surname surname + * + * @return $this + */ + public function setSurname(?string $surname): static + { + if (is_null($surname)) { + array_push($this->openAPINullablesSetToNull, 'surname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('surname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['surname'] = $surname; + + return $this; + } + + /** + * Gets gender + * + * @return \SynergiTech\Staffology\Model\Gender|null + */ + public function getGender(): ?\SynergiTech\Staffology\Model\Gender + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \SynergiTech\Staffology\Model\Gender|null $gender gender + * + * @return $this + */ + public function setGender(?\SynergiTech\Staffology\Model\Gender $gender): static + { + if (is_null($gender)) { + throw new InvalidArgumentException('non-nullable gender cannot be null'); + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets fullPay + * + * @return string|null + */ + public function getFullPay(): ?string + { + return $this->container['fullPay']; + } + + /** + * Sets fullPay + * + * @param string|null $fullPay fullPay + * + * @return $this + */ + public function setFullPay(?string $fullPay): static + { + if (is_null($fullPay)) { + array_push($this->openAPINullablesSetToNull, 'fullPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullPay'] = $fullPay; + + return $this; + } + + /** + * Gets ordinaryPay + * + * @return float|null + */ + public function getOrdinaryPay(): ?float + { + return $this->container['ordinaryPay']; + } + + /** + * Sets ordinaryPay + * + * @param float|null $ordinaryPay ordinaryPay + * + * @return $this + */ + public function setOrdinaryPay(?float $ordinaryPay): static + { + if (is_null($ordinaryPay)) { + throw new InvalidArgumentException('non-nullable ordinaryPay cannot be null'); + } + $this->container['ordinaryPay'] = $ordinaryPay; + + return $this; + } + + /** + * Gets periodBonus + * + * @return float|null + */ + public function getPeriodBonus(): ?float + { + return $this->container['periodBonus']; + } + + /** + * Sets periodBonus + * + * @param float|null $periodBonus periodBonus + * + * @return $this + */ + public function setPeriodBonus(?float $periodBonus): static + { + if (is_null($periodBonus)) { + throw new InvalidArgumentException('non-nullable periodBonus cannot be null'); + } + $this->container['periodBonus'] = $periodBonus; + + return $this; + } + + /** + * Gets bonusRbp + * + * @return float|null + */ + public function getBonusRbp(): ?float + { + return $this->container['bonusRbp']; + } + + /** + * Sets bonusRbp + * + * @param float|null $bonusRbp bonusRbp + * + * @return $this + */ + public function setBonusRbp(?float $bonusRbp): static + { + if (is_null($bonusRbp)) { + throw new InvalidArgumentException('non-nullable bonusRbp cannot be null'); + } + $this->container['bonusRbp'] = $bonusRbp; + + return $this; + } + + /** + * Gets weeklyHours + * + * @return float|null + */ + public function getWeeklyHours(): ?float + { + return $this->container['weeklyHours']; + } + + /** + * Sets weeklyHours + * + * @param float|null $weeklyHours weeklyHours + * + * @return $this + */ + public function setWeeklyHours(?float $weeklyHours): static + { + if (is_null($weeklyHours)) { + throw new InvalidArgumentException('non-nullable weeklyHours cannot be null'); + } + $this->container['weeklyHours'] = $weeklyHours; + + return $this; + } + + /** + * Gets hourlyRate + * + * @return float|null + */ + public function getHourlyRate(): ?float + { + return $this->container['hourlyRate']; + } + + /** + * Sets hourlyRate + * + * @param float|null $hourlyRate hourlyRate + * + * @return $this + */ + public function setHourlyRate(?float $hourlyRate): static + { + if (is_null($hourlyRate)) { + throw new InvalidArgumentException('non-nullable hourlyRate cannot be null'); + } + $this->container['hourlyRate'] = $hourlyRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GenderPayGapReport.php b/src/Model/GenderPayGapReport.php new file mode 100644 index 0000000..dd32f79 --- /dev/null +++ b/src/Model/GenderPayGapReport.php @@ -0,0 +1,558 @@ + + */ +class GenderPayGapReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GenderPayGapReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'genderPayGapLines' => '\SynergiTech\Staffology\Model\GenderPayGapLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'genderPayGapLines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'genderPayGapLines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'genderPayGapLines' => 'genderPayGapLines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'genderPayGapLines' => 'setGenderPayGapLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'genderPayGapLines' => 'getGenderPayGapLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('genderPayGapLines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets genderPayGapLines + * + * @return \SynergiTech\Staffology\Model\GenderPayGapLine[]|null + */ + public function getGenderPayGapLines(): ?array + { + return $this->container['genderPayGapLines']; + } + + /** + * Sets genderPayGapLines + * + * @param \SynergiTech\Staffology\Model\GenderPayGapLine[]|null $genderPayGapLines genderPayGapLines + * + * @return $this + */ + public function setGenderPayGapLines(?array $genderPayGapLines): static + { + if (is_null($genderPayGapLines)) { + array_push($this->openAPINullablesSetToNull, 'genderPayGapLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('genderPayGapLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['genderPayGapLines'] = $genderPayGapLines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GenderPayGapReportReportResponse.php b/src/Model/GenderPayGapReportReportResponse.php new file mode 100644 index 0000000..035da15 --- /dev/null +++ b/src/Model/GenderPayGapReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class GenderPayGapReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GenderPayGapReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\GenderPayGapReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\GenderPayGapReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\GenderPayGapReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\GenderPayGapReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\GenderPayGapReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GenderPayGapSnapShotDate.php b/src/Model/GenderPayGapSnapShotDate.php new file mode 100644 index 0000000..d135ef1 --- /dev/null +++ b/src/Model/GenderPayGapSnapShotDate.php @@ -0,0 +1,45 @@ + + */ +class GovTalk implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GovTalk'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fullPaymentSubmissionNamespace' => 'string', + 'fullPaymentSubmissionNamespaceVersion' => 'string', + 'employerPaymentSummaryNamespace' => 'string', + 'employerPaymentSummaryNamespaceVersion' => 'string', + 'niNoVerificationRequestNameSpace' => 'string', + 'cisVerificationRequestNameSpace' => 'string', + 'cis300NameSpace' => 'string', + 'expensesAndBenefitsNameSpace' => 'string', + 'expensesAndBenefitsNameSpaceVersion' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fullPaymentSubmissionNamespace' => null, + 'fullPaymentSubmissionNamespaceVersion' => null, + 'employerPaymentSummaryNamespace' => null, + 'employerPaymentSummaryNamespaceVersion' => null, + 'niNoVerificationRequestNameSpace' => null, + 'cisVerificationRequestNameSpace' => null, + 'cis300NameSpace' => null, + 'expensesAndBenefitsNameSpace' => null, + 'expensesAndBenefitsNameSpaceVersion' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fullPaymentSubmissionNamespace' => true, + 'fullPaymentSubmissionNamespaceVersion' => true, + 'employerPaymentSummaryNamespace' => true, + 'employerPaymentSummaryNamespaceVersion' => true, + 'niNoVerificationRequestNameSpace' => true, + 'cisVerificationRequestNameSpace' => true, + 'cis300NameSpace' => true, + 'expensesAndBenefitsNameSpace' => true, + 'expensesAndBenefitsNameSpaceVersion' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fullPaymentSubmissionNamespace' => 'fullPaymentSubmissionNamespace', + 'fullPaymentSubmissionNamespaceVersion' => 'fullPaymentSubmissionNamespaceVersion', + 'employerPaymentSummaryNamespace' => 'employerPaymentSummaryNamespace', + 'employerPaymentSummaryNamespaceVersion' => 'employerPaymentSummaryNamespaceVersion', + 'niNoVerificationRequestNameSpace' => 'niNoVerificationRequestNameSpace', + 'cisVerificationRequestNameSpace' => 'cisVerificationRequestNameSpace', + 'cis300NameSpace' => 'cis300NameSpace', + 'expensesAndBenefitsNameSpace' => 'expensesAndBenefitsNameSpace', + 'expensesAndBenefitsNameSpaceVersion' => 'expensesAndBenefitsNameSpaceVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fullPaymentSubmissionNamespace' => 'setFullPaymentSubmissionNamespace', + 'fullPaymentSubmissionNamespaceVersion' => 'setFullPaymentSubmissionNamespaceVersion', + 'employerPaymentSummaryNamespace' => 'setEmployerPaymentSummaryNamespace', + 'employerPaymentSummaryNamespaceVersion' => 'setEmployerPaymentSummaryNamespaceVersion', + 'niNoVerificationRequestNameSpace' => 'setNiNoVerificationRequestNameSpace', + 'cisVerificationRequestNameSpace' => 'setCisVerificationRequestNameSpace', + 'cis300NameSpace' => 'setCis300NameSpace', + 'expensesAndBenefitsNameSpace' => 'setExpensesAndBenefitsNameSpace', + 'expensesAndBenefitsNameSpaceVersion' => 'setExpensesAndBenefitsNameSpaceVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fullPaymentSubmissionNamespace' => 'getFullPaymentSubmissionNamespace', + 'fullPaymentSubmissionNamespaceVersion' => 'getFullPaymentSubmissionNamespaceVersion', + 'employerPaymentSummaryNamespace' => 'getEmployerPaymentSummaryNamespace', + 'employerPaymentSummaryNamespaceVersion' => 'getEmployerPaymentSummaryNamespaceVersion', + 'niNoVerificationRequestNameSpace' => 'getNiNoVerificationRequestNameSpace', + 'cisVerificationRequestNameSpace' => 'getCisVerificationRequestNameSpace', + 'cis300NameSpace' => 'getCis300NameSpace', + 'expensesAndBenefitsNameSpace' => 'getExpensesAndBenefitsNameSpace', + 'expensesAndBenefitsNameSpaceVersion' => 'getExpensesAndBenefitsNameSpaceVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fullPaymentSubmissionNamespace', $data ?? [], null); + $this->setIfExists('fullPaymentSubmissionNamespaceVersion', $data ?? [], null); + $this->setIfExists('employerPaymentSummaryNamespace', $data ?? [], null); + $this->setIfExists('employerPaymentSummaryNamespaceVersion', $data ?? [], null); + $this->setIfExists('niNoVerificationRequestNameSpace', $data ?? [], null); + $this->setIfExists('cisVerificationRequestNameSpace', $data ?? [], null); + $this->setIfExists('cis300NameSpace', $data ?? [], null); + $this->setIfExists('expensesAndBenefitsNameSpace', $data ?? [], null); + $this->setIfExists('expensesAndBenefitsNameSpaceVersion', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fullPaymentSubmissionNamespace + * + * @return string|null + */ + public function getFullPaymentSubmissionNamespace(): ?string + { + return $this->container['fullPaymentSubmissionNamespace']; + } + + /** + * Sets fullPaymentSubmissionNamespace + * + * @param string|null $fullPaymentSubmissionNamespace [readonly] + * + * @return $this + */ + public function setFullPaymentSubmissionNamespace(?string $fullPaymentSubmissionNamespace): static + { + if (is_null($fullPaymentSubmissionNamespace)) { + array_push($this->openAPINullablesSetToNull, 'fullPaymentSubmissionNamespace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullPaymentSubmissionNamespace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullPaymentSubmissionNamespace'] = $fullPaymentSubmissionNamespace; + + return $this; + } + + /** + * Gets fullPaymentSubmissionNamespaceVersion + * + * @return string|null + */ + public function getFullPaymentSubmissionNamespaceVersion(): ?string + { + return $this->container['fullPaymentSubmissionNamespaceVersion']; + } + + /** + * Sets fullPaymentSubmissionNamespaceVersion + * + * @param string|null $fullPaymentSubmissionNamespaceVersion [readonly] + * + * @return $this + */ + public function setFullPaymentSubmissionNamespaceVersion(?string $fullPaymentSubmissionNamespaceVersion): static + { + if (is_null($fullPaymentSubmissionNamespaceVersion)) { + array_push($this->openAPINullablesSetToNull, 'fullPaymentSubmissionNamespaceVersion'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullPaymentSubmissionNamespaceVersion', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullPaymentSubmissionNamespaceVersion'] = $fullPaymentSubmissionNamespaceVersion; + + return $this; + } + + /** + * Gets employerPaymentSummaryNamespace + * + * @return string|null + */ + public function getEmployerPaymentSummaryNamespace(): ?string + { + return $this->container['employerPaymentSummaryNamespace']; + } + + /** + * Sets employerPaymentSummaryNamespace + * + * @param string|null $employerPaymentSummaryNamespace [readonly] + * + * @return $this + */ + public function setEmployerPaymentSummaryNamespace(?string $employerPaymentSummaryNamespace): static + { + if (is_null($employerPaymentSummaryNamespace)) { + array_push($this->openAPINullablesSetToNull, 'employerPaymentSummaryNamespace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPaymentSummaryNamespace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPaymentSummaryNamespace'] = $employerPaymentSummaryNamespace; + + return $this; + } + + /** + * Gets employerPaymentSummaryNamespaceVersion + * + * @return string|null + */ + public function getEmployerPaymentSummaryNamespaceVersion(): ?string + { + return $this->container['employerPaymentSummaryNamespaceVersion']; + } + + /** + * Sets employerPaymentSummaryNamespaceVersion + * + * @param string|null $employerPaymentSummaryNamespaceVersion [readonly] + * + * @return $this + */ + public function setEmployerPaymentSummaryNamespaceVersion(?string $employerPaymentSummaryNamespaceVersion): static + { + if (is_null($employerPaymentSummaryNamespaceVersion)) { + array_push($this->openAPINullablesSetToNull, 'employerPaymentSummaryNamespaceVersion'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPaymentSummaryNamespaceVersion', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPaymentSummaryNamespaceVersion'] = $employerPaymentSummaryNamespaceVersion; + + return $this; + } + + /** + * Gets niNoVerificationRequestNameSpace + * + * @return string|null + */ + public function getNiNoVerificationRequestNameSpace(): ?string + { + return $this->container['niNoVerificationRequestNameSpace']; + } + + /** + * Sets niNoVerificationRequestNameSpace + * + * @param string|null $niNoVerificationRequestNameSpace [readonly] + * + * @return $this + */ + public function setNiNoVerificationRequestNameSpace(?string $niNoVerificationRequestNameSpace): static + { + if (is_null($niNoVerificationRequestNameSpace)) { + array_push($this->openAPINullablesSetToNull, 'niNoVerificationRequestNameSpace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNoVerificationRequestNameSpace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNoVerificationRequestNameSpace'] = $niNoVerificationRequestNameSpace; + + return $this; + } + + /** + * Gets cisVerificationRequestNameSpace + * + * @return string|null + */ + public function getCisVerificationRequestNameSpace(): ?string + { + return $this->container['cisVerificationRequestNameSpace']; + } + + /** + * Sets cisVerificationRequestNameSpace + * + * @param string|null $cisVerificationRequestNameSpace [readonly] + * + * @return $this + */ + public function setCisVerificationRequestNameSpace(?string $cisVerificationRequestNameSpace): static + { + if (is_null($cisVerificationRequestNameSpace)) { + array_push($this->openAPINullablesSetToNull, 'cisVerificationRequestNameSpace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cisVerificationRequestNameSpace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cisVerificationRequestNameSpace'] = $cisVerificationRequestNameSpace; + + return $this; + } + + /** + * Gets cis300NameSpace + * + * @return string|null + */ + public function getCis300NameSpace(): ?string + { + return $this->container['cis300NameSpace']; + } + + /** + * Sets cis300NameSpace + * + * @param string|null $cis300NameSpace [readonly] + * + * @return $this + */ + public function setCis300NameSpace(?string $cis300NameSpace): static + { + if (is_null($cis300NameSpace)) { + array_push($this->openAPINullablesSetToNull, 'cis300NameSpace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cis300NameSpace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cis300NameSpace'] = $cis300NameSpace; + + return $this; + } + + /** + * Gets expensesAndBenefitsNameSpace + * + * @return string|null + */ + public function getExpensesAndBenefitsNameSpace(): ?string + { + return $this->container['expensesAndBenefitsNameSpace']; + } + + /** + * Sets expensesAndBenefitsNameSpace + * + * @param string|null $expensesAndBenefitsNameSpace [readonly] + * + * @return $this + */ + public function setExpensesAndBenefitsNameSpace(?string $expensesAndBenefitsNameSpace): static + { + if (is_null($expensesAndBenefitsNameSpace)) { + array_push($this->openAPINullablesSetToNull, 'expensesAndBenefitsNameSpace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expensesAndBenefitsNameSpace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expensesAndBenefitsNameSpace'] = $expensesAndBenefitsNameSpace; + + return $this; + } + + /** + * Gets expensesAndBenefitsNameSpaceVersion + * + * @return string|null + */ + public function getExpensesAndBenefitsNameSpaceVersion(): ?string + { + return $this->container['expensesAndBenefitsNameSpaceVersion']; + } + + /** + * Sets expensesAndBenefitsNameSpaceVersion + * + * @param string|null $expensesAndBenefitsNameSpaceVersion [readonly] + * + * @return $this + */ + public function setExpensesAndBenefitsNameSpaceVersion(?string $expensesAndBenefitsNameSpaceVersion): static + { + if (is_null($expensesAndBenefitsNameSpaceVersion)) { + array_push($this->openAPINullablesSetToNull, 'expensesAndBenefitsNameSpaceVersion'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expensesAndBenefitsNameSpaceVersion', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expensesAndBenefitsNameSpaceVersion'] = $expensesAndBenefitsNameSpaceVersion; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GovTalkError.php b/src/Model/GovTalkError.php new file mode 100644 index 0000000..a89bebe --- /dev/null +++ b/src/Model/GovTalkError.php @@ -0,0 +1,579 @@ + + */ +class GovTalkError implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GovTalkError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'raisedBy' => 'string', + 'number' => 'string', + 'type' => 'string', + 'text' => 'string', + 'location' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'raisedBy' => null, + 'number' => null, + 'type' => null, + 'text' => null, + 'location' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'raisedBy' => true, + 'number' => true, + 'type' => true, + 'text' => true, + 'location' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'raisedBy' => 'raisedBy', + 'number' => 'number', + 'type' => 'type', + 'text' => 'text', + 'location' => 'location' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'raisedBy' => 'setRaisedBy', + 'number' => 'setNumber', + 'type' => 'setType', + 'text' => 'setText', + 'location' => 'setLocation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'raisedBy' => 'getRaisedBy', + 'number' => 'getNumber', + 'type' => 'getType', + 'text' => 'getText', + 'location' => 'getLocation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('raisedBy', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('location', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets raisedBy + * + * @return string|null + */ + public function getRaisedBy(): ?string + { + return $this->container['raisedBy']; + } + + /** + * Sets raisedBy + * + * @param string|null $raisedBy raisedBy + * + * @return $this + */ + public function setRaisedBy(?string $raisedBy): static + { + if (is_null($raisedBy)) { + array_push($this->openAPINullablesSetToNull, 'raisedBy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('raisedBy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['raisedBy'] = $raisedBy; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber(): ?string + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number number + * + * @return $this + */ + public function setNumber(?string $number): static + { + if (is_null($number)) { + array_push($this->openAPINullablesSetToNull, 'number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText(): ?string + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text text + * + * @return $this + */ + public function setText(?string $text): static + { + if (is_null($text)) { + array_push($this->openAPINullablesSetToNull, 'text'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation(): ?string + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location location + * + * @return $this + */ + public function setLocation(?string $location): static + { + if (is_null($location)) { + array_push($this->openAPINullablesSetToNull, 'location'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('location', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['location'] = $location; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GovTalkSubmission.php b/src/Model/GovTalkSubmission.php new file mode 100644 index 0000000..418390f --- /dev/null +++ b/src/Model/GovTalkSubmission.php @@ -0,0 +1,902 @@ + + */ +class GovTalkSubmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GovTalkSubmission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'rawResponse' => 'string', + 'messageClass' => 'string', + 'pollInterval' => 'int', + 'lastPoll' => '\DateTime', + 'correlationId' => 'string', + 'url' => 'string', + 'status' => '\SynergiTech\Staffology\Model\SubmissionStatus', + 'message' => 'string', + 'iRmark' => 'string', + 'errorsJson' => 'string', + 'errors' => '\SynergiTech\Staffology\Model\GovTalkError[]', + 'submittedAt' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'rawResponse' => null, + 'messageClass' => null, + 'pollInterval' => 'int32', + 'lastPoll' => 'date-time', + 'correlationId' => null, + 'url' => null, + 'status' => null, + 'message' => null, + 'iRmark' => null, + 'errorsJson' => null, + 'errors' => null, + 'submittedAt' => 'date-time', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'rawResponse' => true, + 'messageClass' => true, + 'pollInterval' => false, + 'lastPoll' => true, + 'correlationId' => true, + 'url' => true, + 'status' => false, + 'message' => true, + 'iRmark' => true, + 'errorsJson' => true, + 'errors' => true, + 'submittedAt' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'rawResponse' => 'rawResponse', + 'messageClass' => 'messageClass', + 'pollInterval' => 'pollInterval', + 'lastPoll' => 'lastPoll', + 'correlationId' => 'correlationId', + 'url' => 'url', + 'status' => 'status', + 'message' => 'message', + 'iRmark' => 'iRmark', + 'errorsJson' => 'errorsJson', + 'errors' => 'errors', + 'submittedAt' => 'submittedAt', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'rawResponse' => 'setRawResponse', + 'messageClass' => 'setMessageClass', + 'pollInterval' => 'setPollInterval', + 'lastPoll' => 'setLastPoll', + 'correlationId' => 'setCorrelationId', + 'url' => 'setUrl', + 'status' => 'setStatus', + 'message' => 'setMessage', + 'iRmark' => 'setIRmark', + 'errorsJson' => 'setErrorsJson', + 'errors' => 'setErrors', + 'submittedAt' => 'setSubmittedAt', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'rawResponse' => 'getRawResponse', + 'messageClass' => 'getMessageClass', + 'pollInterval' => 'getPollInterval', + 'lastPoll' => 'getLastPoll', + 'correlationId' => 'getCorrelationId', + 'url' => 'getUrl', + 'status' => 'getStatus', + 'message' => 'getMessage', + 'iRmark' => 'getIRmark', + 'errorsJson' => 'getErrorsJson', + 'errors' => 'getErrors', + 'submittedAt' => 'getSubmittedAt', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('rawResponse', $data ?? [], null); + $this->setIfExists('messageClass', $data ?? [], null); + $this->setIfExists('pollInterval', $data ?? [], null); + $this->setIfExists('lastPoll', $data ?? [], null); + $this->setIfExists('correlationId', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('errorsJson', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('submittedAt', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['correlationId']) && (mb_strlen($this->container['correlationId']) > 100)) { + $invalidProperties[] = "invalid value for 'correlationId', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) > 100)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rawResponse + * + * @return string|null + */ + public function getRawResponse(): ?string + { + return $this->container['rawResponse']; + } + + /** + * Sets rawResponse + * + * @param string|null $rawResponse rawResponse + * + * @return $this + */ + public function setRawResponse(?string $rawResponse): static + { + if (is_null($rawResponse)) { + array_push($this->openAPINullablesSetToNull, 'rawResponse'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rawResponse', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rawResponse'] = $rawResponse; + + return $this; + } + + /** + * Gets messageClass + * + * @return string|null + */ + public function getMessageClass(): ?string + { + return $this->container['messageClass']; + } + + /** + * Sets messageClass + * + * @param string|null $messageClass messageClass + * + * @return $this + */ + public function setMessageClass(?string $messageClass): static + { + if (is_null($messageClass)) { + array_push($this->openAPINullablesSetToNull, 'messageClass'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('messageClass', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['messageClass'] = $messageClass; + + return $this; + } + + /** + * Gets pollInterval + * + * @return int|null + */ + public function getPollInterval(): ?int + { + return $this->container['pollInterval']; + } + + /** + * Sets pollInterval + * + * @param int|null $pollInterval pollInterval + * + * @return $this + */ + public function setPollInterval(?int $pollInterval): static + { + if (is_null($pollInterval)) { + throw new InvalidArgumentException('non-nullable pollInterval cannot be null'); + } + $this->container['pollInterval'] = $pollInterval; + + return $this; + } + + /** + * Gets lastPoll + * + * @return \DateTime|null + */ + public function getLastPoll(): ?\DateTime + { + return $this->container['lastPoll']; + } + + /** + * Sets lastPoll + * + * @param \DateTime|null $lastPoll lastPoll + * + * @return $this + */ + public function setLastPoll(?\DateTime $lastPoll): static + { + if (is_null($lastPoll)) { + array_push($this->openAPINullablesSetToNull, 'lastPoll'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastPoll', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastPoll'] = $lastPoll; + + return $this; + } + + /** + * Gets correlationId + * + * @return string|null + */ + public function getCorrelationId(): ?string + { + return $this->container['correlationId']; + } + + /** + * Sets correlationId + * + * @param string|null $correlationId correlationId + * + * @return $this + */ + public function setCorrelationId(?string $correlationId): static + { + if (is_null($correlationId)) { + array_push($this->openAPINullablesSetToNull, 'correlationId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('correlationId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($correlationId) && (mb_strlen($correlationId) > 100)) { + throw new InvalidArgumentException('invalid length for $correlationId when calling GovTalkSubmission., must be smaller than or equal to 100.'); + } + + $this->container['correlationId'] = $correlationId; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($url) && (mb_strlen($url) > 100)) { + throw new InvalidArgumentException('invalid length for $url when calling GovTalkSubmission., must be smaller than or equal to 100.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\SubmissionStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\SubmissionStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\SubmissionStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\SubmissionStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return $this + */ + public function setMessage(?string $message): static + { + if (is_null($message)) { + array_push($this->openAPINullablesSetToNull, 'message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets errorsJson + * + * @return string|null + */ + public function getErrorsJson(): ?string + { + return $this->container['errorsJson']; + } + + /** + * Sets errorsJson + * + * @param string|null $errorsJson errorsJson + * + * @return $this + */ + public function setErrorsJson(?string $errorsJson): static + { + if (is_null($errorsJson)) { + array_push($this->openAPINullablesSetToNull, 'errorsJson'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errorsJson', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errorsJson'] = $errorsJson; + + return $this; + } + + /** + * Gets errors + * + * @return \SynergiTech\Staffology\Model\GovTalkError[]|null + */ + public function getErrors(): ?array + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \SynergiTech\Staffology\Model\GovTalkError[]|null $errors errors + * + * @return $this + */ + public function setErrors(?array $errors): static + { + if (is_null($errors)) { + array_push($this->openAPINullablesSetToNull, 'errors'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errors', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets submittedAt + * + * @return \DateTime|null + */ + public function getSubmittedAt(): ?\DateTime + { + return $this->container['submittedAt']; + } + + /** + * Sets submittedAt + * + * @param \DateTime|null $submittedAt submittedAt + * + * @return $this + */ + public function setSubmittedAt(?\DateTime $submittedAt): static + { + if (is_null($submittedAt)) { + array_push($this->openAPINullablesSetToNull, 'submittedAt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('submittedAt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['submittedAt'] = $submittedAt; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GrossToNetReport.php b/src/Model/GrossToNetReport.php new file mode 100644 index 0000000..511cde3 --- /dev/null +++ b/src/Model/GrossToNetReport.php @@ -0,0 +1,953 @@ + + */ +class GrossToNetReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GrossToNetReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'forCis' => 'bool', + 'lines' => '\SynergiTech\Staffology\Model\GrossToNetReportLine[]', + 'cisLines' => '\SynergiTech\Staffology\Model\GrossToNetReportCisLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'forCis' => null, + 'lines' => null, + 'cisLines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'forCis' => false, + 'lines' => true, + 'cisLines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'forCis' => 'forCis', + 'lines' => 'lines', + 'cisLines' => 'cisLines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'forCis' => 'setForCis', + 'lines' => 'setLines', + 'cisLines' => 'setCisLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'forCis' => 'getForCis', + 'lines' => 'getLines', + 'cisLines' => 'getCisLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('forCis', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('cisLines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets forCis + * + * @return bool|null + */ + public function getForCis(): ?bool + { + return $this->container['forCis']; + } + + /** + * Sets forCis + * + * @param bool|null $forCis forCis + * + * @return $this + */ + public function setForCis(?bool $forCis): static + { + if (is_null($forCis)) { + throw new InvalidArgumentException('non-nullable forCis cannot be null'); + } + $this->container['forCis'] = $forCis; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets cisLines + * + * @return \SynergiTech\Staffology\Model\GrossToNetReportCisLine[]|null + */ + public function getCisLines(): ?array + { + return $this->container['cisLines']; + } + + /** + * Sets cisLines + * + * @param \SynergiTech\Staffology\Model\GrossToNetReportCisLine[]|null $cisLines cisLines + * + * @return $this + */ + public function setCisLines(?array $cisLines): static + { + if (is_null($cisLines)) { + array_push($this->openAPINullablesSetToNull, 'cisLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cisLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cisLines'] = $cisLines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GrossToNetReportCisLine.php b/src/Model/GrossToNetReportCisLine.php new file mode 100644 index 0000000..e37632c --- /dev/null +++ b/src/Model/GrossToNetReportCisLine.php @@ -0,0 +1,803 @@ + + */ +class GrossToNetReportCisLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GrossToNetReportCisLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string', + 'totalGross' => 'float', + 'labour' => 'float', + 'materials' => 'float', + 'taxableGross' => 'float', + 'cisDeduction' => 'float', + 'umbrellaFee' => 'float', + 'vat' => 'float', + 'payment' => 'float', + 'lastName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'department' => null, + 'totalGross' => 'double', + 'labour' => 'double', + 'materials' => 'double', + 'taxableGross' => 'double', + 'cisDeduction' => 'double', + 'umbrellaFee' => 'double', + 'vat' => 'double', + 'payment' => 'double', + 'lastName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'department' => true, + 'totalGross' => false, + 'labour' => false, + 'materials' => false, + 'taxableGross' => false, + 'cisDeduction' => false, + 'umbrellaFee' => false, + 'vat' => false, + 'payment' => false, + 'lastName' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department', + 'totalGross' => 'totalGross', + 'labour' => 'labour', + 'materials' => 'materials', + 'taxableGross' => 'taxableGross', + 'cisDeduction' => 'cisDeduction', + 'umbrellaFee' => 'umbrellaFee', + 'vat' => 'vat', + 'payment' => 'payment', + 'lastName' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment', + 'totalGross' => 'setTotalGross', + 'labour' => 'setLabour', + 'materials' => 'setMaterials', + 'taxableGross' => 'setTaxableGross', + 'cisDeduction' => 'setCisDeduction', + 'umbrellaFee' => 'setUmbrellaFee', + 'vat' => 'setVat', + 'payment' => 'setPayment', + 'lastName' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment', + 'totalGross' => 'getTotalGross', + 'labour' => 'getLabour', + 'materials' => 'getMaterials', + 'taxableGross' => 'getTaxableGross', + 'cisDeduction' => 'getCisDeduction', + 'umbrellaFee' => 'getUmbrellaFee', + 'vat' => 'getVat', + 'payment' => 'getPayment', + 'lastName' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('totalGross', $data ?? [], null); + $this->setIfExists('labour', $data ?? [], null); + $this->setIfExists('materials', $data ?? [], null); + $this->setIfExists('taxableGross', $data ?? [], null); + $this->setIfExists('cisDeduction', $data ?? [], null); + $this->setIfExists('umbrellaFee', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets totalGross + * + * @return float|null + */ + public function getTotalGross(): ?float + { + return $this->container['totalGross']; + } + + /** + * Sets totalGross + * + * @param float|null $totalGross totalGross + * + * @return $this + */ + public function setTotalGross(?float $totalGross): static + { + if (is_null($totalGross)) { + throw new InvalidArgumentException('non-nullable totalGross cannot be null'); + } + $this->container['totalGross'] = $totalGross; + + return $this; + } + + /** + * Gets labour + * + * @return float|null + */ + public function getLabour(): ?float + { + return $this->container['labour']; + } + + /** + * Sets labour + * + * @param float|null $labour labour + * + * @return $this + */ + public function setLabour(?float $labour): static + { + if (is_null($labour)) { + throw new InvalidArgumentException('non-nullable labour cannot be null'); + } + $this->container['labour'] = $labour; + + return $this; + } + + /** + * Gets materials + * + * @return float|null + */ + public function getMaterials(): ?float + { + return $this->container['materials']; + } + + /** + * Sets materials + * + * @param float|null $materials materials + * + * @return $this + */ + public function setMaterials(?float $materials): static + { + if (is_null($materials)) { + throw new InvalidArgumentException('non-nullable materials cannot be null'); + } + $this->container['materials'] = $materials; + + return $this; + } + + /** + * Gets taxableGross + * + * @return float|null + */ + public function getTaxableGross(): ?float + { + return $this->container['taxableGross']; + } + + /** + * Sets taxableGross + * + * @param float|null $taxableGross taxableGross + * + * @return $this + */ + public function setTaxableGross(?float $taxableGross): static + { + if (is_null($taxableGross)) { + throw new InvalidArgumentException('non-nullable taxableGross cannot be null'); + } + $this->container['taxableGross'] = $taxableGross; + + return $this; + } + + /** + * Gets cisDeduction + * + * @return float|null + */ + public function getCisDeduction(): ?float + { + return $this->container['cisDeduction']; + } + + /** + * Sets cisDeduction + * + * @param float|null $cisDeduction cisDeduction + * + * @return $this + */ + public function setCisDeduction(?float $cisDeduction): static + { + if (is_null($cisDeduction)) { + throw new InvalidArgumentException('non-nullable cisDeduction cannot be null'); + } + $this->container['cisDeduction'] = $cisDeduction; + + return $this; + } + + /** + * Gets umbrellaFee + * + * @return float|null + */ + public function getUmbrellaFee(): ?float + { + return $this->container['umbrellaFee']; + } + + /** + * Sets umbrellaFee + * + * @param float|null $umbrellaFee umbrellaFee + * + * @return $this + */ + public function setUmbrellaFee(?float $umbrellaFee): static + { + if (is_null($umbrellaFee)) { + throw new InvalidArgumentException('non-nullable umbrellaFee cannot be null'); + } + $this->container['umbrellaFee'] = $umbrellaFee; + + return $this; + } + + /** + * Gets vat + * + * @return float|null + */ + public function getVat(): ?float + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param float|null $vat vat + * + * @return $this + */ + public function setVat(?float $vat): static + { + if (is_null($vat)) { + throw new InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + + /** + * Gets payment + * + * @return float|null + */ + public function getPayment(): ?float + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param float|null $payment payment + * + * @return $this + */ + public function setPayment(?float $payment): static + { + if (is_null($payment)) { + throw new InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GrossToNetReportLine.php b/src/Model/GrossToNetReportLine.php new file mode 100644 index 0000000..a6e26e5 --- /dev/null +++ b/src/Model/GrossToNetReportLine.php @@ -0,0 +1,1048 @@ + + */ +class GrossToNetReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GrossToNetReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'niNumber' => 'string', + 'totalGross' => 'float', + 'taxableGross' => 'float', + 'netPay' => 'float', + 'tax' => 'float', + 'employeeNi' => 'float', + 'employerNi' => 'float', + 'employeePension' => 'float', + 'employerPension' => 'float', + 'studentOrPgLoan' => 'float', + 'statutoryPayments' => 'float', + 'attachments' => 'float', + 'otherDeductions' => 'float', + 'lastName' => 'string', + 'isNewStarter' => 'bool', + 'isLeaver' => 'bool', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'niNumber' => null, + 'totalGross' => 'double', + 'taxableGross' => 'double', + 'netPay' => 'double', + 'tax' => 'double', + 'employeeNi' => 'double', + 'employerNi' => 'double', + 'employeePension' => 'double', + 'employerPension' => 'double', + 'studentOrPgLoan' => 'double', + 'statutoryPayments' => 'double', + 'attachments' => 'double', + 'otherDeductions' => 'double', + 'lastName' => null, + 'isNewStarter' => null, + 'isLeaver' => null, + 'employee' => null, + 'payrollCode' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'niNumber' => true, + 'totalGross' => false, + 'taxableGross' => false, + 'netPay' => false, + 'tax' => false, + 'employeeNi' => false, + 'employerNi' => false, + 'employeePension' => false, + 'employerPension' => false, + 'studentOrPgLoan' => false, + 'statutoryPayments' => false, + 'attachments' => false, + 'otherDeductions' => false, + 'lastName' => true, + 'isNewStarter' => false, + 'isLeaver' => false, + 'employee' => false, + 'payrollCode' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'niNumber' => 'niNumber', + 'totalGross' => 'totalGross', + 'taxableGross' => 'taxableGross', + 'netPay' => 'netPay', + 'tax' => 'tax', + 'employeeNi' => 'employeeNi', + 'employerNi' => 'employerNi', + 'employeePension' => 'employeePension', + 'employerPension' => 'employerPension', + 'studentOrPgLoan' => 'studentOrPgLoan', + 'statutoryPayments' => 'statutoryPayments', + 'attachments' => 'attachments', + 'otherDeductions' => 'otherDeductions', + 'lastName' => 'lastName', + 'isNewStarter' => 'isNewStarter', + 'isLeaver' => 'isLeaver', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'niNumber' => 'setNiNumber', + 'totalGross' => 'setTotalGross', + 'taxableGross' => 'setTaxableGross', + 'netPay' => 'setNetPay', + 'tax' => 'setTax', + 'employeeNi' => 'setEmployeeNi', + 'employerNi' => 'setEmployerNi', + 'employeePension' => 'setEmployeePension', + 'employerPension' => 'setEmployerPension', + 'studentOrPgLoan' => 'setStudentOrPgLoan', + 'statutoryPayments' => 'setStatutoryPayments', + 'attachments' => 'setAttachments', + 'otherDeductions' => 'setOtherDeductions', + 'lastName' => 'setLastName', + 'isNewStarter' => 'setIsNewStarter', + 'isLeaver' => 'setIsLeaver', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'niNumber' => 'getNiNumber', + 'totalGross' => 'getTotalGross', + 'taxableGross' => 'getTaxableGross', + 'netPay' => 'getNetPay', + 'tax' => 'getTax', + 'employeeNi' => 'getEmployeeNi', + 'employerNi' => 'getEmployerNi', + 'employeePension' => 'getEmployeePension', + 'employerPension' => 'getEmployerPension', + 'studentOrPgLoan' => 'getStudentOrPgLoan', + 'statutoryPayments' => 'getStatutoryPayments', + 'attachments' => 'getAttachments', + 'otherDeductions' => 'getOtherDeductions', + 'lastName' => 'getLastName', + 'isNewStarter' => 'getIsNewStarter', + 'isLeaver' => 'getIsLeaver', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('totalGross', $data ?? [], null); + $this->setIfExists('taxableGross', $data ?? [], null); + $this->setIfExists('netPay', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('employeePension', $data ?? [], null); + $this->setIfExists('employerPension', $data ?? [], null); + $this->setIfExists('studentOrPgLoan', $data ?? [], null); + $this->setIfExists('statutoryPayments', $data ?? [], null); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('otherDeductions', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('isNewStarter', $data ?? [], null); + $this->setIfExists('isLeaver', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets totalGross + * + * @return float|null + */ + public function getTotalGross(): ?float + { + return $this->container['totalGross']; + } + + /** + * Sets totalGross + * + * @param float|null $totalGross totalGross + * + * @return $this + */ + public function setTotalGross(?float $totalGross): static + { + if (is_null($totalGross)) { + throw new InvalidArgumentException('non-nullable totalGross cannot be null'); + } + $this->container['totalGross'] = $totalGross; + + return $this; + } + + /** + * Gets taxableGross + * + * @return float|null + */ + public function getTaxableGross(): ?float + { + return $this->container['taxableGross']; + } + + /** + * Sets taxableGross + * + * @param float|null $taxableGross taxableGross + * + * @return $this + */ + public function setTaxableGross(?float $taxableGross): static + { + if (is_null($taxableGross)) { + throw new InvalidArgumentException('non-nullable taxableGross cannot be null'); + } + $this->container['taxableGross'] = $taxableGross; + + return $this; + } + + /** + * Gets netPay + * + * @return float|null + */ + public function getNetPay(): ?float + { + return $this->container['netPay']; + } + + /** + * Sets netPay + * + * @param float|null $netPay netPay + * + * @return $this + */ + public function setNetPay(?float $netPay): static + { + if (is_null($netPay)) { + throw new InvalidArgumentException('non-nullable netPay cannot be null'); + } + $this->container['netPay'] = $netPay; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax tax + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi employeeNi + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi employerNi + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets employeePension + * + * @return float|null + */ + public function getEmployeePension(): ?float + { + return $this->container['employeePension']; + } + + /** + * Sets employeePension + * + * @param float|null $employeePension employeePension + * + * @return $this + */ + public function setEmployeePension(?float $employeePension): static + { + if (is_null($employeePension)) { + throw new InvalidArgumentException('non-nullable employeePension cannot be null'); + } + $this->container['employeePension'] = $employeePension; + + return $this; + } + + /** + * Gets employerPension + * + * @return float|null + */ + public function getEmployerPension(): ?float + { + return $this->container['employerPension']; + } + + /** + * Sets employerPension + * + * @param float|null $employerPension employerPension + * + * @return $this + */ + public function setEmployerPension(?float $employerPension): static + { + if (is_null($employerPension)) { + throw new InvalidArgumentException('non-nullable employerPension cannot be null'); + } + $this->container['employerPension'] = $employerPension; + + return $this; + } + + /** + * Gets studentOrPgLoan + * + * @return float|null + */ + public function getStudentOrPgLoan(): ?float + { + return $this->container['studentOrPgLoan']; + } + + /** + * Sets studentOrPgLoan + * + * @param float|null $studentOrPgLoan studentOrPgLoan + * + * @return $this + */ + public function setStudentOrPgLoan(?float $studentOrPgLoan): static + { + if (is_null($studentOrPgLoan)) { + throw new InvalidArgumentException('non-nullable studentOrPgLoan cannot be null'); + } + $this->container['studentOrPgLoan'] = $studentOrPgLoan; + + return $this; + } + + /** + * Gets statutoryPayments + * + * @return float|null + */ + public function getStatutoryPayments(): ?float + { + return $this->container['statutoryPayments']; + } + + /** + * Sets statutoryPayments + * + * @param float|null $statutoryPayments statutoryPayments + * + * @return $this + */ + public function setStatutoryPayments(?float $statutoryPayments): static + { + if (is_null($statutoryPayments)) { + throw new InvalidArgumentException('non-nullable statutoryPayments cannot be null'); + } + $this->container['statutoryPayments'] = $statutoryPayments; + + return $this; + } + + /** + * Gets attachments + * + * @return float|null + */ + public function getAttachments(): ?float + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param float|null $attachments attachments + * + * @return $this + */ + public function setAttachments(?float $attachments): static + { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } + $this->container['attachments'] = $attachments; + + return $this; + } + + /** + * Gets otherDeductions + * + * @return float|null + */ + public function getOtherDeductions(): ?float + { + return $this->container['otherDeductions']; + } + + /** + * Sets otherDeductions + * + * @param float|null $otherDeductions otherDeductions + * + * @return $this + */ + public function setOtherDeductions(?float $otherDeductions): static + { + if (is_null($otherDeductions)) { + throw new InvalidArgumentException('non-nullable otherDeductions cannot be null'); + } + $this->container['otherDeductions'] = $otherDeductions; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets isNewStarter + * + * @return bool|null + */ + public function getIsNewStarter(): ?bool + { + return $this->container['isNewStarter']; + } + + /** + * Sets isNewStarter + * + * @param bool|null $isNewStarter isNewStarter + * + * @return $this + */ + public function setIsNewStarter(?bool $isNewStarter): static + { + if (is_null($isNewStarter)) { + throw new InvalidArgumentException('non-nullable isNewStarter cannot be null'); + } + $this->container['isNewStarter'] = $isNewStarter; + + return $this; + } + + /** + * Gets isLeaver + * + * @return bool|null + */ + public function getIsLeaver(): ?bool + { + return $this->container['isLeaver']; + } + + /** + * Sets isLeaver + * + * @param bool|null $isLeaver isLeaver + * + * @return $this + */ + public function setIsLeaver(?bool $isLeaver): static + { + if (is_null($isLeaver)) { + throw new InvalidArgumentException('non-nullable isLeaver cannot be null'); + } + $this->container['isLeaver'] = $isLeaver; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GrossToNetReportReportResponse.php b/src/Model/GrossToNetReportReportResponse.php new file mode 100644 index 0000000..4d999e7 --- /dev/null +++ b/src/Model/GrossToNetReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class GrossToNetReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GrossToNetReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\GrossToNetReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\GrossToNetReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\GrossToNetReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\GrossToNetReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\GrossToNetReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HmrcDetails.php b/src/Model/HmrcDetails.php new file mode 100644 index 0000000..a6e05d7 --- /dev/null +++ b/src/Model/HmrcDetails.php @@ -0,0 +1,1049 @@ + + */ +class HmrcDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HmrcDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'officeNumber' => 'string', + 'payeReference' => 'string', + 'accountsOfficeReference' => 'string', + 'econ' => 'string', + 'utr' => 'string', + 'coTax' => 'string', + 'employmentAllowance' => 'bool', + 'employmentAllowanceMaxClaim' => 'float', + 'smallEmployersRelief' => 'bool', + 'apprenticeshipLevy' => 'bool', + 'apprenticeshipLevyAllowance' => 'float', + 'quarterlyPaymentSchedule' => 'bool', + 'includeEmploymentAllowanceOnMonthlyJournal' => 'bool', + 'carryForwardUnpaidLiabilities' => 'bool', + 'paymentDateRule' => '\SynergiTech\Staffology\Model\PaymentDateRule', + 'paymentDateDayOfMonth' => 'int', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'officeNumber' => null, + 'payeReference' => null, + 'accountsOfficeReference' => null, + 'econ' => null, + 'utr' => null, + 'coTax' => null, + 'employmentAllowance' => null, + 'employmentAllowanceMaxClaim' => 'double', + 'smallEmployersRelief' => null, + 'apprenticeshipLevy' => null, + 'apprenticeshipLevyAllowance' => 'double', + 'quarterlyPaymentSchedule' => null, + 'includeEmploymentAllowanceOnMonthlyJournal' => null, + 'carryForwardUnpaidLiabilities' => null, + 'paymentDateRule' => null, + 'paymentDateDayOfMonth' => 'int32', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'officeNumber' => true, + 'payeReference' => true, + 'accountsOfficeReference' => true, + 'econ' => true, + 'utr' => true, + 'coTax' => true, + 'employmentAllowance' => false, + 'employmentAllowanceMaxClaim' => false, + 'smallEmployersRelief' => false, + 'apprenticeshipLevy' => false, + 'apprenticeshipLevyAllowance' => false, + 'quarterlyPaymentSchedule' => false, + 'includeEmploymentAllowanceOnMonthlyJournal' => false, + 'carryForwardUnpaidLiabilities' => false, + 'paymentDateRule' => false, + 'paymentDateDayOfMonth' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'officeNumber' => 'officeNumber', + 'payeReference' => 'payeReference', + 'accountsOfficeReference' => 'accountsOfficeReference', + 'econ' => 'econ', + 'utr' => 'utr', + 'coTax' => 'coTax', + 'employmentAllowance' => 'employmentAllowance', + 'employmentAllowanceMaxClaim' => 'employmentAllowanceMaxClaim', + 'smallEmployersRelief' => 'smallEmployersRelief', + 'apprenticeshipLevy' => 'apprenticeshipLevy', + 'apprenticeshipLevyAllowance' => 'apprenticeshipLevyAllowance', + 'quarterlyPaymentSchedule' => 'quarterlyPaymentSchedule', + 'includeEmploymentAllowanceOnMonthlyJournal' => 'includeEmploymentAllowanceOnMonthlyJournal', + 'carryForwardUnpaidLiabilities' => 'carryForwardUnpaidLiabilities', + 'paymentDateRule' => 'paymentDateRule', + 'paymentDateDayOfMonth' => 'paymentDateDayOfMonth', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'officeNumber' => 'setOfficeNumber', + 'payeReference' => 'setPayeReference', + 'accountsOfficeReference' => 'setAccountsOfficeReference', + 'econ' => 'setEcon', + 'utr' => 'setUtr', + 'coTax' => 'setCoTax', + 'employmentAllowance' => 'setEmploymentAllowance', + 'employmentAllowanceMaxClaim' => 'setEmploymentAllowanceMaxClaim', + 'smallEmployersRelief' => 'setSmallEmployersRelief', + 'apprenticeshipLevy' => 'setApprenticeshipLevy', + 'apprenticeshipLevyAllowance' => 'setApprenticeshipLevyAllowance', + 'quarterlyPaymentSchedule' => 'setQuarterlyPaymentSchedule', + 'includeEmploymentAllowanceOnMonthlyJournal' => 'setIncludeEmploymentAllowanceOnMonthlyJournal', + 'carryForwardUnpaidLiabilities' => 'setCarryForwardUnpaidLiabilities', + 'paymentDateRule' => 'setPaymentDateRule', + 'paymentDateDayOfMonth' => 'setPaymentDateDayOfMonth', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'officeNumber' => 'getOfficeNumber', + 'payeReference' => 'getPayeReference', + 'accountsOfficeReference' => 'getAccountsOfficeReference', + 'econ' => 'getEcon', + 'utr' => 'getUtr', + 'coTax' => 'getCoTax', + 'employmentAllowance' => 'getEmploymentAllowance', + 'employmentAllowanceMaxClaim' => 'getEmploymentAllowanceMaxClaim', + 'smallEmployersRelief' => 'getSmallEmployersRelief', + 'apprenticeshipLevy' => 'getApprenticeshipLevy', + 'apprenticeshipLevyAllowance' => 'getApprenticeshipLevyAllowance', + 'quarterlyPaymentSchedule' => 'getQuarterlyPaymentSchedule', + 'includeEmploymentAllowanceOnMonthlyJournal' => 'getIncludeEmploymentAllowanceOnMonthlyJournal', + 'carryForwardUnpaidLiabilities' => 'getCarryForwardUnpaidLiabilities', + 'paymentDateRule' => 'getPaymentDateRule', + 'paymentDateDayOfMonth' => 'getPaymentDateDayOfMonth', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('officeNumber', $data ?? [], null); + $this->setIfExists('payeReference', $data ?? [], null); + $this->setIfExists('accountsOfficeReference', $data ?? [], null); + $this->setIfExists('econ', $data ?? [], null); + $this->setIfExists('utr', $data ?? [], null); + $this->setIfExists('coTax', $data ?? [], null); + $this->setIfExists('employmentAllowance', $data ?? [], null); + $this->setIfExists('employmentAllowanceMaxClaim', $data ?? [], null); + $this->setIfExists('smallEmployersRelief', $data ?? [], null); + $this->setIfExists('apprenticeshipLevy', $data ?? [], null); + $this->setIfExists('apprenticeshipLevyAllowance', $data ?? [], null); + $this->setIfExists('quarterlyPaymentSchedule', $data ?? [], null); + $this->setIfExists('includeEmploymentAllowanceOnMonthlyJournal', $data ?? [], null); + $this->setIfExists('carryForwardUnpaidLiabilities', $data ?? [], null); + $this->setIfExists('paymentDateRule', $data ?? [], null); + $this->setIfExists('paymentDateDayOfMonth', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['officeNumber']) && (mb_strlen($this->container['officeNumber']) > 3)) { + $invalidProperties[] = "invalid value for 'officeNumber', the character length must be smaller than or equal to 3."; + } + + if (!is_null($this->container['payeReference']) && (mb_strlen($this->container['payeReference']) > 20)) { + $invalidProperties[] = "invalid value for 'payeReference', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['accountsOfficeReference']) && (mb_strlen($this->container['accountsOfficeReference']) > 20)) { + $invalidProperties[] = "invalid value for 'accountsOfficeReference', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['econ']) && (mb_strlen($this->container['econ']) > 20)) { + $invalidProperties[] = "invalid value for 'econ', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['utr']) && (mb_strlen($this->container['utr']) > 20)) { + $invalidProperties[] = "invalid value for 'utr', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['coTax']) && (mb_strlen($this->container['coTax']) > 20)) { + $invalidProperties[] = "invalid value for 'coTax', the character length must be smaller than or equal to 20."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets officeNumber + * + * @return string|null + */ + public function getOfficeNumber(): ?string + { + return $this->container['officeNumber']; + } + + /** + * Sets officeNumber + * + * @param string|null $officeNumber officeNumber + * + * @return $this + */ + public function setOfficeNumber(?string $officeNumber): static + { + if (is_null($officeNumber)) { + array_push($this->openAPINullablesSetToNull, 'officeNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('officeNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($officeNumber) && (mb_strlen($officeNumber) > 3)) { + throw new InvalidArgumentException('invalid length for $officeNumber when calling HmrcDetails., must be smaller than or equal to 3.'); + } + + $this->container['officeNumber'] = $officeNumber; + + return $this; + } + + /** + * Gets payeReference + * + * @return string|null + */ + public function getPayeReference(): ?string + { + return $this->container['payeReference']; + } + + /** + * Sets payeReference + * + * @param string|null $payeReference payeReference + * + * @return $this + */ + public function setPayeReference(?string $payeReference): static + { + if (is_null($payeReference)) { + array_push($this->openAPINullablesSetToNull, 'payeReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payeReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($payeReference) && (mb_strlen($payeReference) > 20)) { + throw new InvalidArgumentException('invalid length for $payeReference when calling HmrcDetails., must be smaller than or equal to 20.'); + } + + $this->container['payeReference'] = $payeReference; + + return $this; + } + + /** + * Gets accountsOfficeReference + * + * @return string|null + */ + public function getAccountsOfficeReference(): ?string + { + return $this->container['accountsOfficeReference']; + } + + /** + * Sets accountsOfficeReference + * + * @param string|null $accountsOfficeReference accountsOfficeReference + * + * @return $this + */ + public function setAccountsOfficeReference(?string $accountsOfficeReference): static + { + if (is_null($accountsOfficeReference)) { + array_push($this->openAPINullablesSetToNull, 'accountsOfficeReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountsOfficeReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountsOfficeReference) && (mb_strlen($accountsOfficeReference) > 20)) { + throw new InvalidArgumentException('invalid length for $accountsOfficeReference when calling HmrcDetails., must be smaller than or equal to 20.'); + } + + $this->container['accountsOfficeReference'] = $accountsOfficeReference; + + return $this; + } + + /** + * Gets econ + * + * @return string|null + */ + public function getEcon(): ?string + { + return $this->container['econ']; + } + + /** + * Sets econ + * + * @param string|null $econ econ + * + * @return $this + */ + public function setEcon(?string $econ): static + { + if (is_null($econ)) { + array_push($this->openAPINullablesSetToNull, 'econ'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('econ', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($econ) && (mb_strlen($econ) > 20)) { + throw new InvalidArgumentException('invalid length for $econ when calling HmrcDetails., must be smaller than or equal to 20.'); + } + + $this->container['econ'] = $econ; + + return $this; + } + + /** + * Gets utr + * + * @return string|null + */ + public function getUtr(): ?string + { + return $this->container['utr']; + } + + /** + * Sets utr + * + * @param string|null $utr utr + * + * @return $this + */ + public function setUtr(?string $utr): static + { + if (is_null($utr)) { + array_push($this->openAPINullablesSetToNull, 'utr'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utr', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($utr) && (mb_strlen($utr) > 20)) { + throw new InvalidArgumentException('invalid length for $utr when calling HmrcDetails., must be smaller than or equal to 20.'); + } + + $this->container['utr'] = $utr; + + return $this; + } + + /** + * Gets coTax + * + * @return string|null + */ + public function getCoTax(): ?string + { + return $this->container['coTax']; + } + + /** + * Sets coTax + * + * @param string|null $coTax coTax + * + * @return $this + */ + public function setCoTax(?string $coTax): static + { + if (is_null($coTax)) { + array_push($this->openAPINullablesSetToNull, 'coTax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('coTax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($coTax) && (mb_strlen($coTax) > 20)) { + throw new InvalidArgumentException('invalid length for $coTax when calling HmrcDetails., must be smaller than or equal to 20.'); + } + + $this->container['coTax'] = $coTax; + + return $this; + } + + /** + * Gets employmentAllowance + * + * @return bool|null + */ + public function getEmploymentAllowance(): ?bool + { + return $this->container['employmentAllowance']; + } + + /** + * Sets employmentAllowance + * + * @param bool|null $employmentAllowance employmentAllowance + * + * @return $this + */ + public function setEmploymentAllowance(?bool $employmentAllowance): static + { + if (is_null($employmentAllowance)) { + throw new InvalidArgumentException('non-nullable employmentAllowance cannot be null'); + } + $this->container['employmentAllowance'] = $employmentAllowance; + + return $this; + } + + /** + * Gets employmentAllowanceMaxClaim + * + * @return float|null + */ + public function getEmploymentAllowanceMaxClaim(): ?float + { + return $this->container['employmentAllowanceMaxClaim']; + } + + /** + * Sets employmentAllowanceMaxClaim + * + * @param float|null $employmentAllowanceMaxClaim You might reduce this from the default if you've made/are making a claim in another system + * + * @return $this + */ + public function setEmploymentAllowanceMaxClaim(?float $employmentAllowanceMaxClaim): static + { + if (is_null($employmentAllowanceMaxClaim)) { + throw new InvalidArgumentException('non-nullable employmentAllowanceMaxClaim cannot be null'); + } + $this->container['employmentAllowanceMaxClaim'] = $employmentAllowanceMaxClaim; + + return $this; + } + + /** + * Gets smallEmployersRelief + * + * @return bool|null + */ + public function getSmallEmployersRelief(): ?bool + { + return $this->container['smallEmployersRelief']; + } + + /** + * Sets smallEmployersRelief + * + * @param bool|null $smallEmployersRelief smallEmployersRelief + * + * @return $this + */ + public function setSmallEmployersRelief(?bool $smallEmployersRelief): static + { + if (is_null($smallEmployersRelief)) { + throw new InvalidArgumentException('non-nullable smallEmployersRelief cannot be null'); + } + $this->container['smallEmployersRelief'] = $smallEmployersRelief; + + return $this; + } + + /** + * Gets apprenticeshipLevy + * + * @return bool|null + */ + public function getApprenticeshipLevy(): ?bool + { + return $this->container['apprenticeshipLevy']; + } + + /** + * Sets apprenticeshipLevy + * + * @param bool|null $apprenticeshipLevy apprenticeshipLevy + * + * @return $this + */ + public function setApprenticeshipLevy(?bool $apprenticeshipLevy): static + { + if (is_null($apprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevy cannot be null'); + } + $this->container['apprenticeshipLevy'] = $apprenticeshipLevy; + + return $this; + } + + /** + * Gets apprenticeshipLevyAllowance + * + * @return float|null + */ + public function getApprenticeshipLevyAllowance(): ?float + { + return $this->container['apprenticeshipLevyAllowance']; + } + + /** + * Sets apprenticeshipLevyAllowance + * + * @param float|null $apprenticeshipLevyAllowance apprenticeshipLevyAllowance + * + * @return $this + */ + public function setApprenticeshipLevyAllowance(?float $apprenticeshipLevyAllowance): static + { + if (is_null($apprenticeshipLevyAllowance)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevyAllowance cannot be null'); + } + $this->container['apprenticeshipLevyAllowance'] = $apprenticeshipLevyAllowance; + + return $this; + } + + /** + * Gets quarterlyPaymentSchedule + * + * @return bool|null + */ + public function getQuarterlyPaymentSchedule(): ?bool + { + return $this->container['quarterlyPaymentSchedule']; + } + + /** + * Sets quarterlyPaymentSchedule + * + * @param bool|null $quarterlyPaymentSchedule Set to true if the employer pays HMRC on a quarterly schedule. A value of false implies a monthly schedule. Warning: Changing this value after starting PayRuns will delete any existing payments or adjustments you may have entered. + * + * @return $this + */ + public function setQuarterlyPaymentSchedule(?bool $quarterlyPaymentSchedule): static + { + if (is_null($quarterlyPaymentSchedule)) { + throw new InvalidArgumentException('non-nullable quarterlyPaymentSchedule cannot be null'); + } + $this->container['quarterlyPaymentSchedule'] = $quarterlyPaymentSchedule; + + return $this; + } + + /** + * Gets includeEmploymentAllowanceOnMonthlyJournal + * + * @return bool|null + */ + public function getIncludeEmploymentAllowanceOnMonthlyJournal(): ?bool + { + return $this->container['includeEmploymentAllowanceOnMonthlyJournal']; + } + + /** + * Sets includeEmploymentAllowanceOnMonthlyJournal + * + * @param bool|null $includeEmploymentAllowanceOnMonthlyJournal If the employer is not on a QuarterlyPaymentSchedule and is claiming EmploymentAllowance, then set this to true to include a line for Employment Allowance on the journal for the monthly schedule. + * + * @return $this + */ + public function setIncludeEmploymentAllowanceOnMonthlyJournal(?bool $includeEmploymentAllowanceOnMonthlyJournal): static + { + if (is_null($includeEmploymentAllowanceOnMonthlyJournal)) { + throw new InvalidArgumentException('non-nullable includeEmploymentAllowanceOnMonthlyJournal cannot be null'); + } + $this->container['includeEmploymentAllowanceOnMonthlyJournal'] = $includeEmploymentAllowanceOnMonthlyJournal; + + return $this; + } + + /** + * Gets carryForwardUnpaidLiabilities + * + * @return bool|null + */ + public function getCarryForwardUnpaidLiabilities(): ?bool + { + return $this->container['carryForwardUnpaidLiabilities']; + } + + /** + * Sets carryForwardUnpaidLiabilities + * + * @param bool|null $carryForwardUnpaidLiabilities If set to true then any unpaid amounts from previous periods will be brought forward to work out the liability for the current period. You'd set this to false if you don't want to track payments. + * + * @return $this + */ + public function setCarryForwardUnpaidLiabilities(?bool $carryForwardUnpaidLiabilities): static + { + if (is_null($carryForwardUnpaidLiabilities)) { + throw new InvalidArgumentException('non-nullable carryForwardUnpaidLiabilities cannot be null'); + } + $this->container['carryForwardUnpaidLiabilities'] = $carryForwardUnpaidLiabilities; + + return $this; + } + + /** + * Gets paymentDateRule + * + * @return \SynergiTech\Staffology\Model\PaymentDateRule|null + */ + public function getPaymentDateRule(): ?\SynergiTech\Staffology\Model\PaymentDateRule + { + return $this->container['paymentDateRule']; + } + + /** + * Sets paymentDateRule + * + * @param \SynergiTech\Staffology\Model\PaymentDateRule|null $paymentDateRule paymentDateRule + * + * @return $this + */ + public function setPaymentDateRule(?\SynergiTech\Staffology\Model\PaymentDateRule $paymentDateRule): static + { + if (is_null($paymentDateRule)) { + throw new InvalidArgumentException('non-nullable paymentDateRule cannot be null'); + } + $this->container['paymentDateRule'] = $paymentDateRule; + + return $this; + } + + /** + * Gets paymentDateDayOfMonth + * + * @return int|null + */ + public function getPaymentDateDayOfMonth(): ?int + { + return $this->container['paymentDateDayOfMonth']; + } + + /** + * Sets paymentDateDayOfMonth + * + * @param int|null $paymentDateDayOfMonth paymentDateDayOfMonth + * + * @return $this + */ + public function setPaymentDateDayOfMonth(?int $paymentDateDayOfMonth): static + { + if (is_null($paymentDateDayOfMonth)) { + array_push($this->openAPINullablesSetToNull, 'paymentDateDayOfMonth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentDateDayOfMonth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentDateDayOfMonth'] = $paymentDateDayOfMonth; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HmrcLiability.php b/src/Model/HmrcLiability.php new file mode 100644 index 0000000..69ccfe8 --- /dev/null +++ b/src/Model/HmrcLiability.php @@ -0,0 +1,1898 @@ + + */ +class HmrcLiability implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HmrcLiability'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'periodEnding' => '\DateTime', + 'periodComplete' => 'bool', + 'recoverableAmountsEpsCreated' => 'bool', + 'apprenticeshipLevyEpsCreated' => 'bool', + 'payRuns' => '\SynergiTech\Staffology\Model\PayRun[]', + 'tax' => 'float', + 'cisDeductions' => 'float', + 'postgradLoanDeductions' => 'float', + 'studentLoanDeductions' => 'float', + 'employeeNic' => 'float', + 'employerNic' => 'float', + 'realTimeClass1ANic' => 'float', + 'smp' => 'float', + 'smpNic' => 'float', + 'spp' => 'float', + 'sppNic' => 'float', + 'sap' => 'float', + 'sapNic' => 'float', + 'shpp' => 'float', + 'shppNic' => 'float', + 'spbp' => 'float', + 'spbpNic' => 'float', + 'eligibleForEmploymentAllowance' => 'bool', + 'employmentAllowanceClaim' => 'float', + 'employmentAllowanceClaimAuto' => 'bool', + 'liableForApprenticeshipLevy' => 'bool', + 'apprenticeshipLevy' => 'float', + 'apprenticeshipLevyAuto' => 'bool', + 'liabilityArisingInPeriod' => 'float', + 'dueInPreviousPeriods' => 'float', + 'paidInPreviousPeriods' => 'float', + 'employmentAllowanceClaimInPreviousPeriods' => 'float', + 'receivedFromHMRCToRefundTax' => 'float', + 'receivedFromHMRCToPayStatutoryPay' => 'float', + 'cisDeductionsSuffered' => 'float', + 'adjustment' => 'float', + 'netLiabilityForPeriod' => 'float', + 'totalPaid' => 'float', + 'payments' => '\SynergiTech\Staffology\Model\HmrcPayment[]', + 'fpsList' => '\SynergiTech\Staffology\Model\Item[]', + 'allowLinkedEps' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'taxYear' => null, + 'periodEnding' => 'date', + 'periodComplete' => null, + 'recoverableAmountsEpsCreated' => null, + 'apprenticeshipLevyEpsCreated' => null, + 'payRuns' => null, + 'tax' => 'double', + 'cisDeductions' => 'double', + 'postgradLoanDeductions' => 'double', + 'studentLoanDeductions' => 'double', + 'employeeNic' => 'double', + 'employerNic' => 'double', + 'realTimeClass1ANic' => 'double', + 'smp' => 'double', + 'smpNic' => 'double', + 'spp' => 'double', + 'sppNic' => 'double', + 'sap' => 'double', + 'sapNic' => 'double', + 'shpp' => 'double', + 'shppNic' => 'double', + 'spbp' => 'double', + 'spbpNic' => 'double', + 'eligibleForEmploymentAllowance' => null, + 'employmentAllowanceClaim' => 'double', + 'employmentAllowanceClaimAuto' => null, + 'liableForApprenticeshipLevy' => null, + 'apprenticeshipLevy' => 'double', + 'apprenticeshipLevyAuto' => null, + 'liabilityArisingInPeriod' => 'double', + 'dueInPreviousPeriods' => 'double', + 'paidInPreviousPeriods' => 'double', + 'employmentAllowanceClaimInPreviousPeriods' => 'double', + 'receivedFromHMRCToRefundTax' => 'double', + 'receivedFromHMRCToPayStatutoryPay' => 'double', + 'cisDeductionsSuffered' => 'double', + 'adjustment' => 'double', + 'netLiabilityForPeriod' => 'double', + 'totalPaid' => 'double', + 'payments' => null, + 'fpsList' => null, + 'allowLinkedEps' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => true, + 'taxYear' => false, + 'periodEnding' => false, + 'periodComplete' => false, + 'recoverableAmountsEpsCreated' => false, + 'apprenticeshipLevyEpsCreated' => false, + 'payRuns' => true, + 'tax' => false, + 'cisDeductions' => false, + 'postgradLoanDeductions' => false, + 'studentLoanDeductions' => false, + 'employeeNic' => false, + 'employerNic' => false, + 'realTimeClass1ANic' => false, + 'smp' => false, + 'smpNic' => false, + 'spp' => false, + 'sppNic' => false, + 'sap' => false, + 'sapNic' => false, + 'shpp' => false, + 'shppNic' => false, + 'spbp' => false, + 'spbpNic' => false, + 'eligibleForEmploymentAllowance' => false, + 'employmentAllowanceClaim' => false, + 'employmentAllowanceClaimAuto' => false, + 'liableForApprenticeshipLevy' => false, + 'apprenticeshipLevy' => false, + 'apprenticeshipLevyAuto' => false, + 'liabilityArisingInPeriod' => false, + 'dueInPreviousPeriods' => false, + 'paidInPreviousPeriods' => false, + 'employmentAllowanceClaimInPreviousPeriods' => false, + 'receivedFromHMRCToRefundTax' => false, + 'receivedFromHMRCToPayStatutoryPay' => false, + 'cisDeductionsSuffered' => false, + 'adjustment' => false, + 'netLiabilityForPeriod' => false, + 'totalPaid' => false, + 'payments' => true, + 'fpsList' => true, + 'allowLinkedEps' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'taxYear' => 'taxYear', + 'periodEnding' => 'periodEnding', + 'periodComplete' => 'periodComplete', + 'recoverableAmountsEpsCreated' => 'recoverableAmountsEpsCreated', + 'apprenticeshipLevyEpsCreated' => 'apprenticeshipLevyEpsCreated', + 'payRuns' => 'payRuns', + 'tax' => 'tax', + 'cisDeductions' => 'cisDeductions', + 'postgradLoanDeductions' => 'postgradLoanDeductions', + 'studentLoanDeductions' => 'studentLoanDeductions', + 'employeeNic' => 'employeeNic', + 'employerNic' => 'employerNic', + 'realTimeClass1ANic' => 'realTimeClass1ANic', + 'smp' => 'smp', + 'smpNic' => 'smpNic', + 'spp' => 'spp', + 'sppNic' => 'sppNic', + 'sap' => 'sap', + 'sapNic' => 'sapNic', + 'shpp' => 'shpp', + 'shppNic' => 'shppNic', + 'spbp' => 'spbp', + 'spbpNic' => 'spbpNic', + 'eligibleForEmploymentAllowance' => 'eligibleForEmploymentAllowance', + 'employmentAllowanceClaim' => 'employmentAllowanceClaim', + 'employmentAllowanceClaimAuto' => 'employmentAllowanceClaimAuto', + 'liableForApprenticeshipLevy' => 'liableForApprenticeshipLevy', + 'apprenticeshipLevy' => 'apprenticeshipLevy', + 'apprenticeshipLevyAuto' => 'apprenticeshipLevyAuto', + 'liabilityArisingInPeriod' => 'liabilityArisingInPeriod', + 'dueInPreviousPeriods' => 'dueInPreviousPeriods', + 'paidInPreviousPeriods' => 'paidInPreviousPeriods', + 'employmentAllowanceClaimInPreviousPeriods' => 'employmentAllowanceClaimInPreviousPeriods', + 'receivedFromHMRCToRefundTax' => 'receivedFromHMRCToRefundTax', + 'receivedFromHMRCToPayStatutoryPay' => 'receivedFromHMRCToPayStatutoryPay', + 'cisDeductionsSuffered' => 'cisDeductionsSuffered', + 'adjustment' => 'adjustment', + 'netLiabilityForPeriod' => 'netLiabilityForPeriod', + 'totalPaid' => 'totalPaid', + 'payments' => 'payments', + 'fpsList' => 'fpsList', + 'allowLinkedEps' => 'allowLinkedEps', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'taxYear' => 'setTaxYear', + 'periodEnding' => 'setPeriodEnding', + 'periodComplete' => 'setPeriodComplete', + 'recoverableAmountsEpsCreated' => 'setRecoverableAmountsEpsCreated', + 'apprenticeshipLevyEpsCreated' => 'setApprenticeshipLevyEpsCreated', + 'payRuns' => 'setPayRuns', + 'tax' => 'setTax', + 'cisDeductions' => 'setCisDeductions', + 'postgradLoanDeductions' => 'setPostgradLoanDeductions', + 'studentLoanDeductions' => 'setStudentLoanDeductions', + 'employeeNic' => 'setEmployeeNic', + 'employerNic' => 'setEmployerNic', + 'realTimeClass1ANic' => 'setRealTimeClass1ANic', + 'smp' => 'setSmp', + 'smpNic' => 'setSmpNic', + 'spp' => 'setSpp', + 'sppNic' => 'setSppNic', + 'sap' => 'setSap', + 'sapNic' => 'setSapNic', + 'shpp' => 'setShpp', + 'shppNic' => 'setShppNic', + 'spbp' => 'setSpbp', + 'spbpNic' => 'setSpbpNic', + 'eligibleForEmploymentAllowance' => 'setEligibleForEmploymentAllowance', + 'employmentAllowanceClaim' => 'setEmploymentAllowanceClaim', + 'employmentAllowanceClaimAuto' => 'setEmploymentAllowanceClaimAuto', + 'liableForApprenticeshipLevy' => 'setLiableForApprenticeshipLevy', + 'apprenticeshipLevy' => 'setApprenticeshipLevy', + 'apprenticeshipLevyAuto' => 'setApprenticeshipLevyAuto', + 'liabilityArisingInPeriod' => 'setLiabilityArisingInPeriod', + 'dueInPreviousPeriods' => 'setDueInPreviousPeriods', + 'paidInPreviousPeriods' => 'setPaidInPreviousPeriods', + 'employmentAllowanceClaimInPreviousPeriods' => 'setEmploymentAllowanceClaimInPreviousPeriods', + 'receivedFromHMRCToRefundTax' => 'setReceivedFromHMRCToRefundTax', + 'receivedFromHMRCToPayStatutoryPay' => 'setReceivedFromHMRCToPayStatutoryPay', + 'cisDeductionsSuffered' => 'setCisDeductionsSuffered', + 'adjustment' => 'setAdjustment', + 'netLiabilityForPeriod' => 'setNetLiabilityForPeriod', + 'totalPaid' => 'setTotalPaid', + 'payments' => 'setPayments', + 'fpsList' => 'setFpsList', + 'allowLinkedEps' => 'setAllowLinkedEps', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'taxYear' => 'getTaxYear', + 'periodEnding' => 'getPeriodEnding', + 'periodComplete' => 'getPeriodComplete', + 'recoverableAmountsEpsCreated' => 'getRecoverableAmountsEpsCreated', + 'apprenticeshipLevyEpsCreated' => 'getApprenticeshipLevyEpsCreated', + 'payRuns' => 'getPayRuns', + 'tax' => 'getTax', + 'cisDeductions' => 'getCisDeductions', + 'postgradLoanDeductions' => 'getPostgradLoanDeductions', + 'studentLoanDeductions' => 'getStudentLoanDeductions', + 'employeeNic' => 'getEmployeeNic', + 'employerNic' => 'getEmployerNic', + 'realTimeClass1ANic' => 'getRealTimeClass1ANic', + 'smp' => 'getSmp', + 'smpNic' => 'getSmpNic', + 'spp' => 'getSpp', + 'sppNic' => 'getSppNic', + 'sap' => 'getSap', + 'sapNic' => 'getSapNic', + 'shpp' => 'getShpp', + 'shppNic' => 'getShppNic', + 'spbp' => 'getSpbp', + 'spbpNic' => 'getSpbpNic', + 'eligibleForEmploymentAllowance' => 'getEligibleForEmploymentAllowance', + 'employmentAllowanceClaim' => 'getEmploymentAllowanceClaim', + 'employmentAllowanceClaimAuto' => 'getEmploymentAllowanceClaimAuto', + 'liableForApprenticeshipLevy' => 'getLiableForApprenticeshipLevy', + 'apprenticeshipLevy' => 'getApprenticeshipLevy', + 'apprenticeshipLevyAuto' => 'getApprenticeshipLevyAuto', + 'liabilityArisingInPeriod' => 'getLiabilityArisingInPeriod', + 'dueInPreviousPeriods' => 'getDueInPreviousPeriods', + 'paidInPreviousPeriods' => 'getPaidInPreviousPeriods', + 'employmentAllowanceClaimInPreviousPeriods' => 'getEmploymentAllowanceClaimInPreviousPeriods', + 'receivedFromHMRCToRefundTax' => 'getReceivedFromHMRCToRefundTax', + 'receivedFromHMRCToPayStatutoryPay' => 'getReceivedFromHMRCToPayStatutoryPay', + 'cisDeductionsSuffered' => 'getCisDeductionsSuffered', + 'adjustment' => 'getAdjustment', + 'netLiabilityForPeriod' => 'getNetLiabilityForPeriod', + 'totalPaid' => 'getTotalPaid', + 'payments' => 'getPayments', + 'fpsList' => 'getFpsList', + 'allowLinkedEps' => 'getAllowLinkedEps', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('periodEnding', $data ?? [], null); + $this->setIfExists('periodComplete', $data ?? [], null); + $this->setIfExists('recoverableAmountsEpsCreated', $data ?? [], null); + $this->setIfExists('apprenticeshipLevyEpsCreated', $data ?? [], null); + $this->setIfExists('payRuns', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('cisDeductions', $data ?? [], null); + $this->setIfExists('postgradLoanDeductions', $data ?? [], null); + $this->setIfExists('studentLoanDeductions', $data ?? [], null); + $this->setIfExists('employeeNic', $data ?? [], null); + $this->setIfExists('employerNic', $data ?? [], null); + $this->setIfExists('realTimeClass1ANic', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('smpNic', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sppNic', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('sapNic', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('shppNic', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('spbpNic', $data ?? [], null); + $this->setIfExists('eligibleForEmploymentAllowance', $data ?? [], null); + $this->setIfExists('employmentAllowanceClaim', $data ?? [], null); + $this->setIfExists('employmentAllowanceClaimAuto', $data ?? [], null); + $this->setIfExists('liableForApprenticeshipLevy', $data ?? [], null); + $this->setIfExists('apprenticeshipLevy', $data ?? [], null); + $this->setIfExists('apprenticeshipLevyAuto', $data ?? [], null); + $this->setIfExists('liabilityArisingInPeriod', $data ?? [], null); + $this->setIfExists('dueInPreviousPeriods', $data ?? [], null); + $this->setIfExists('paidInPreviousPeriods', $data ?? [], null); + $this->setIfExists('employmentAllowanceClaimInPreviousPeriods', $data ?? [], null); + $this->setIfExists('receivedFromHMRCToRefundTax', $data ?? [], null); + $this->setIfExists('receivedFromHMRCToPayStatutoryPay', $data ?? [], null); + $this->setIfExists('cisDeductionsSuffered', $data ?? [], null); + $this->setIfExists('adjustment', $data ?? [], null); + $this->setIfExists('netLiabilityForPeriod', $data ?? [], null); + $this->setIfExists('totalPaid', $data ?? [], null); + $this->setIfExists('payments', $data ?? [], null); + $this->setIfExists('fpsList', $data ?? [], null); + $this->setIfExists('allowLinkedEps', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] A descriptive name for the Period + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets periodEnding + * + * @return \DateTime|null + */ + public function getPeriodEnding(): ?\DateTime + { + return $this->container['periodEnding']; + } + + /** + * Sets periodEnding + * + * @param \DateTime|null $periodEnding [readonly] + * + * @return $this + */ + public function setPeriodEnding(?\DateTime $periodEnding): static + { + if (is_null($periodEnding)) { + throw new InvalidArgumentException('non-nullable periodEnding cannot be null'); + } + $this->container['periodEnding'] = $periodEnding; + + return $this; + } + + /** + * Gets periodComplete + * + * @return bool|null + */ + public function getPeriodComplete(): ?bool + { + return $this->container['periodComplete']; + } + + /** + * Sets periodComplete + * + * @param bool|null $periodComplete [readonly] Indicates whether or not all PayRuns for this period have been completed + * + * @return $this + */ + public function setPeriodComplete(?bool $periodComplete): static + { + if (is_null($periodComplete)) { + throw new InvalidArgumentException('non-nullable periodComplete cannot be null'); + } + $this->container['periodComplete'] = $periodComplete; + + return $this; + } + + /** + * Gets recoverableAmountsEpsCreated + * + * @return bool|null + */ + public function getRecoverableAmountsEpsCreated(): ?bool + { + return $this->container['recoverableAmountsEpsCreated']; + } + + /** + * Sets recoverableAmountsEpsCreated + * + * @param bool|null $recoverableAmountsEpsCreated [readonly] If there are recoverable amount present (ie, SMP) and the Period is complete then this field Indicates whether or not an EPS has been created up to the final tax month of this period to declare the recoverable amounts + * + * @return $this + */ + public function setRecoverableAmountsEpsCreated(?bool $recoverableAmountsEpsCreated): static + { + if (is_null($recoverableAmountsEpsCreated)) { + throw new InvalidArgumentException('non-nullable recoverableAmountsEpsCreated cannot be null'); + } + $this->container['recoverableAmountsEpsCreated'] = $recoverableAmountsEpsCreated; + + return $this; + } + + /** + * Gets apprenticeshipLevyEpsCreated + * + * @return bool|null + */ + public function getApprenticeshipLevyEpsCreated(): ?bool + { + return $this->container['apprenticeshipLevyEpsCreated']; + } + + /** + * Sets apprenticeshipLevyEpsCreated + * + * @param bool|null $apprenticeshipLevyEpsCreated [readonly] If there is an Apprenticeship LEvy amount present and the Period is complete then this field Indicates whether or not an EPS has been created up to the final tax month of this period to declare the amount + * + * @return $this + */ + public function setApprenticeshipLevyEpsCreated(?bool $apprenticeshipLevyEpsCreated): static + { + if (is_null($apprenticeshipLevyEpsCreated)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevyEpsCreated cannot be null'); + } + $this->container['apprenticeshipLevyEpsCreated'] = $apprenticeshipLevyEpsCreated; + + return $this; + } + + /** + * Gets payRuns + * + * @return \SynergiTech\Staffology\Model\PayRun[]|null + */ + public function getPayRuns(): ?array + { + return $this->container['payRuns']; + } + + /** + * Sets payRuns + * + * @param \SynergiTech\Staffology\Model\PayRun[]|null $payRuns payRuns + * + * @return $this + */ + public function setPayRuns(?array $payRuns): static + { + if (is_null($payRuns)) { + array_push($this->openAPINullablesSetToNull, 'payRuns'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payRuns', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payRuns'] = $payRuns; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax [readonly] Amount due to HMRC for PAYE in period + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets cisDeductions + * + * @return float|null + */ + public function getCisDeductions(): ?float + { + return $this->container['cisDeductions']; + } + + /** + * Sets cisDeductions + * + * @param float|null $cisDeductions [readonly] Amount due to HMRC for CIS Deductions made in period + * + * @return $this + */ + public function setCisDeductions(?float $cisDeductions): static + { + if (is_null($cisDeductions)) { + throw new InvalidArgumentException('non-nullable cisDeductions cannot be null'); + } + $this->container['cisDeductions'] = $cisDeductions; + + return $this; + } + + /** + * Gets postgradLoanDeductions + * + * @return float|null + */ + public function getPostgradLoanDeductions(): ?float + { + return $this->container['postgradLoanDeductions']; + } + + /** + * Sets postgradLoanDeductions + * + * @param float|null $postgradLoanDeductions [readonly] Amount due to HMRC for Postgrad Loan Deductions made in period + * + * @return $this + */ + public function setPostgradLoanDeductions(?float $postgradLoanDeductions): static + { + if (is_null($postgradLoanDeductions)) { + throw new InvalidArgumentException('non-nullable postgradLoanDeductions cannot be null'); + } + $this->container['postgradLoanDeductions'] = $postgradLoanDeductions; + + return $this; + } + + /** + * Gets studentLoanDeductions + * + * @return float|null + */ + public function getStudentLoanDeductions(): ?float + { + return $this->container['studentLoanDeductions']; + } + + /** + * Sets studentLoanDeductions + * + * @param float|null $studentLoanDeductions [readonly] Amount due to HMRC for Student Loan Deductions made in period + * + * @return $this + */ + public function setStudentLoanDeductions(?float $studentLoanDeductions): static + { + if (is_null($studentLoanDeductions)) { + throw new InvalidArgumentException('non-nullable studentLoanDeductions cannot be null'); + } + $this->container['studentLoanDeductions'] = $studentLoanDeductions; + + return $this; + } + + /** + * Gets employeeNic + * + * @return float|null + */ + public function getEmployeeNic(): ?float + { + return $this->container['employeeNic']; + } + + /** + * Sets employeeNic + * + * @param float|null $employeeNic [readonly] Amount due to HMRC for Employee NIC Contributions withheld in period + * + * @return $this + */ + public function setEmployeeNic(?float $employeeNic): static + { + if (is_null($employeeNic)) { + throw new InvalidArgumentException('non-nullable employeeNic cannot be null'); + } + $this->container['employeeNic'] = $employeeNic; + + return $this; + } + + /** + * Gets employerNic + * + * @return float|null + */ + public function getEmployerNic(): ?float + { + return $this->container['employerNic']; + } + + /** + * Sets employerNic + * + * @param float|null $employerNic [readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period + * + * @return $this + */ + public function setEmployerNic(?float $employerNic): static + { + if (is_null($employerNic)) { + throw new InvalidArgumentException('non-nullable employerNic cannot be null'); + } + $this->container['employerNic'] = $employerNic; + + return $this; + } + + /** + * Gets realTimeClass1ANic + * + * @return float|null + */ + public function getRealTimeClass1ANic(): ?float + { + return $this->container['realTimeClass1ANic']; + } + + /** + * Sets realTimeClass1ANic + * + * @param float|null $realTimeClass1ANic [readonly] Amount due to HMRC for Employer NIC Contributions due on payments in period + * + * @return $this + */ + public function setRealTimeClass1ANic(?float $realTimeClass1ANic): static + { + if (is_null($realTimeClass1ANic)) { + throw new InvalidArgumentException('non-nullable realTimeClass1ANic cannot be null'); + } + $this->container['realTimeClass1ANic'] = $realTimeClass1ANic; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp [readonly] SMP recovered from payments in period + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets smpNic + * + * @return float|null + */ + public function getSmpNic(): ?float + { + return $this->container['smpNic']; + } + + /** + * Sets smpNic + * + * @param float|null $smpNic [readonly] SMP NIC Compensation for period + * + * @return $this + */ + public function setSmpNic(?float $smpNic): static + { + if (is_null($smpNic)) { + throw new InvalidArgumentException('non-nullable smpNic cannot be null'); + } + $this->container['smpNic'] = $smpNic; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp [readonly] SPP recovered from payments in period + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sppNic + * + * @return float|null + */ + public function getSppNic(): ?float + { + return $this->container['sppNic']; + } + + /** + * Sets sppNic + * + * @param float|null $sppNic [readonly] SPP Nic Compensation for period + * + * @return $this + */ + public function setSppNic(?float $sppNic): static + { + if (is_null($sppNic)) { + throw new InvalidArgumentException('non-nullable sppNic cannot be null'); + } + $this->container['sppNic'] = $sppNic; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap [readonly] SAP recovered from payments in period + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets sapNic + * + * @return float|null + */ + public function getSapNic(): ?float + { + return $this->container['sapNic']; + } + + /** + * Sets sapNic + * + * @param float|null $sapNic [readonly] SAP Nic Compensation for period + * + * @return $this + */ + public function setSapNic(?float $sapNic): static + { + if (is_null($sapNic)) { + throw new InvalidArgumentException('non-nullable sapNic cannot be null'); + } + $this->container['sapNic'] = $sapNic; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp [readonly] ShPP recovered from payments in period + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets shppNic + * + * @return float|null + */ + public function getShppNic(): ?float + { + return $this->container['shppNic']; + } + + /** + * Sets shppNic + * + * @param float|null $shppNic [readonly] ShPP Nic Compensation for period + * + * @return $this + */ + public function setShppNic(?float $shppNic): static + { + if (is_null($shppNic)) { + throw new InvalidArgumentException('non-nullable shppNic cannot be null'); + } + $this->container['shppNic'] = $shppNic; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp [readonly] SPBP recovered from payments in period + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets spbpNic + * + * @return float|null + */ + public function getSpbpNic(): ?float + { + return $this->container['spbpNic']; + } + + /** + * Sets spbpNic + * + * @param float|null $spbpNic [readonly] SPBP Nic Compensation for period + * + * @return $this + */ + public function setSpbpNic(?float $spbpNic): static + { + if (is_null($spbpNic)) { + throw new InvalidArgumentException('non-nullable spbpNic cannot be null'); + } + $this->container['spbpNic'] = $spbpNic; + + return $this; + } + + /** + * Gets eligibleForEmploymentAllowance + * + * @return bool|null + */ + public function getEligibleForEmploymentAllowance(): ?bool + { + return $this->container['eligibleForEmploymentAllowance']; + } + + /** + * Sets eligibleForEmploymentAllowance + * + * @param bool|null $eligibleForEmploymentAllowance [readonly] Indicates whether the Employer settings say the Employer is eligible for Employment Allowance + * + * @return $this + */ + public function setEligibleForEmploymentAllowance(?bool $eligibleForEmploymentAllowance): static + { + if (is_null($eligibleForEmploymentAllowance)) { + throw new InvalidArgumentException('non-nullable eligibleForEmploymentAllowance cannot be null'); + } + $this->container['eligibleForEmploymentAllowance'] = $eligibleForEmploymentAllowance; + + return $this; + } + + /** + * Gets employmentAllowanceClaim + * + * @return float|null + */ + public function getEmploymentAllowanceClaim(): ?float + { + return $this->container['employmentAllowanceClaim']; + } + + /** + * Sets employmentAllowanceClaim + * + * @param float|null $employmentAllowanceClaim Amount to claim with respect to the Employment Allowance + * + * @return $this + */ + public function setEmploymentAllowanceClaim(?float $employmentAllowanceClaim): static + { + if (is_null($employmentAllowanceClaim)) { + throw new InvalidArgumentException('non-nullable employmentAllowanceClaim cannot be null'); + } + $this->container['employmentAllowanceClaim'] = $employmentAllowanceClaim; + + return $this; + } + + /** + * Gets employmentAllowanceClaimAuto + * + * @return bool|null + */ + public function getEmploymentAllowanceClaimAuto(): ?bool + { + return $this->container['employmentAllowanceClaimAuto']; + } + + /** + * Sets employmentAllowanceClaimAuto + * + * @param bool|null $employmentAllowanceClaimAuto If set to true, we'll automatically claim the maximum allowed. If set to false then you can enter your own value. If EligibleForEmploymentAllowance is false then the EmploymentAllowanceClaim will always be overwritten with a zero value regardless of this property + * + * @return $this + */ + public function setEmploymentAllowanceClaimAuto(?bool $employmentAllowanceClaimAuto): static + { + if (is_null($employmentAllowanceClaimAuto)) { + throw new InvalidArgumentException('non-nullable employmentAllowanceClaimAuto cannot be null'); + } + $this->container['employmentAllowanceClaimAuto'] = $employmentAllowanceClaimAuto; + + return $this; + } + + /** + * Gets liableForApprenticeshipLevy + * + * @return bool|null + */ + public function getLiableForApprenticeshipLevy(): ?bool + { + return $this->container['liableForApprenticeshipLevy']; + } + + /** + * Sets liableForApprenticeshipLevy + * + * @param bool|null $liableForApprenticeshipLevy [readonly] Indicates whether the Employer settings say the Employer is liable for the Apprenticeship Levy + * + * @return $this + */ + public function setLiableForApprenticeshipLevy(?bool $liableForApprenticeshipLevy): static + { + if (is_null($liableForApprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable liableForApprenticeshipLevy cannot be null'); + } + $this->container['liableForApprenticeshipLevy'] = $liableForApprenticeshipLevy; + + return $this; + } + + /** + * Gets apprenticeshipLevy + * + * @return float|null + */ + public function getApprenticeshipLevy(): ?float + { + return $this->container['apprenticeshipLevy']; + } + + /** + * Sets apprenticeshipLevy + * + * @param float|null $apprenticeshipLevy Amount due with respect to the Apprenticeship Levy + * + * @return $this + */ + public function setApprenticeshipLevy(?float $apprenticeshipLevy): static + { + if (is_null($apprenticeshipLevy)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevy cannot be null'); + } + $this->container['apprenticeshipLevy'] = $apprenticeshipLevy; + + return $this; + } + + /** + * Gets apprenticeshipLevyAuto + * + * @return bool|null + */ + public function getApprenticeshipLevyAuto(): ?bool + { + return $this->container['apprenticeshipLevyAuto']; + } + + /** + * Sets apprenticeshipLevyAuto + * + * @param bool|null $apprenticeshipLevyAuto If set to true, we'll automatically calculate your liability If set to false then you can enter your own value. If LiableForApprenticeshipLevy is false then the ApprenticeshipLevy will always be overwritten with a zero value regardless of this property + * + * @return $this + */ + public function setApprenticeshipLevyAuto(?bool $apprenticeshipLevyAuto): static + { + if (is_null($apprenticeshipLevyAuto)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevyAuto cannot be null'); + } + $this->container['apprenticeshipLevyAuto'] = $apprenticeshipLevyAuto; + + return $this; + } + + /** + * Gets liabilityArisingInPeriod + * + * @return float|null + */ + public function getLiabilityArisingInPeriod(): ?float + { + return $this->container['liabilityArisingInPeriod']; + } + + /** + * Sets liabilityArisingInPeriod + * + * @param float|null $liabilityArisingInPeriod [readonly] Total Liability (before any deductions) arising in this Period + * + * @return $this + */ + public function setLiabilityArisingInPeriod(?float $liabilityArisingInPeriod): static + { + if (is_null($liabilityArisingInPeriod)) { + throw new InvalidArgumentException('non-nullable liabilityArisingInPeriod cannot be null'); + } + $this->container['liabilityArisingInPeriod'] = $liabilityArisingInPeriod; + + return $this; + } + + /** + * Gets dueInPreviousPeriods + * + * @return float|null + */ + public function getDueInPreviousPeriods(): ?float + { + return $this->container['dueInPreviousPeriods']; + } + + /** + * Sets dueInPreviousPeriods + * + * @param float|null $dueInPreviousPeriods [readonly] Amount due to HMRC in previous periods for this Tax Year + * + * @return $this + */ + public function setDueInPreviousPeriods(?float $dueInPreviousPeriods): static + { + if (is_null($dueInPreviousPeriods)) { + throw new InvalidArgumentException('non-nullable dueInPreviousPeriods cannot be null'); + } + $this->container['dueInPreviousPeriods'] = $dueInPreviousPeriods; + + return $this; + } + + /** + * Gets paidInPreviousPeriods + * + * @return float|null + */ + public function getPaidInPreviousPeriods(): ?float + { + return $this->container['paidInPreviousPeriods']; + } + + /** + * Sets paidInPreviousPeriods + * + * @param float|null $paidInPreviousPeriods [readonly] Amount paid to HMRC in previous periods for this Tax Year + * + * @return $this + */ + public function setPaidInPreviousPeriods(?float $paidInPreviousPeriods): static + { + if (is_null($paidInPreviousPeriods)) { + throw new InvalidArgumentException('non-nullable paidInPreviousPeriods cannot be null'); + } + $this->container['paidInPreviousPeriods'] = $paidInPreviousPeriods; + + return $this; + } + + /** + * Gets employmentAllowanceClaimInPreviousPeriods + * + * @return float|null + */ + public function getEmploymentAllowanceClaimInPreviousPeriods(): ?float + { + return $this->container['employmentAllowanceClaimInPreviousPeriods']; + } + + /** + * Sets employmentAllowanceClaimInPreviousPeriods + * + * @param float|null $employmentAllowanceClaimInPreviousPeriods [readonly] The amount of Employment Allowance claimed in previous periods for this Tax Year + * + * @return $this + */ + public function setEmploymentAllowanceClaimInPreviousPeriods(?float $employmentAllowanceClaimInPreviousPeriods): static + { + if (is_null($employmentAllowanceClaimInPreviousPeriods)) { + throw new InvalidArgumentException('non-nullable employmentAllowanceClaimInPreviousPeriods cannot be null'); + } + $this->container['employmentAllowanceClaimInPreviousPeriods'] = $employmentAllowanceClaimInPreviousPeriods; + + return $this; + } + + /** + * Gets receivedFromHMRCToRefundTax + * + * @return float|null + */ + public function getReceivedFromHMRCToRefundTax(): ?float + { + return $this->container['receivedFromHMRCToRefundTax']; + } + + /** + * Sets receivedFromHMRCToRefundTax + * + * @param float|null $receivedFromHMRCToRefundTax Any amount received from HMRC to refund Tax in Period + * + * @return $this + */ + public function setReceivedFromHMRCToRefundTax(?float $receivedFromHMRCToRefundTax): static + { + if (is_null($receivedFromHMRCToRefundTax)) { + throw new InvalidArgumentException('non-nullable receivedFromHMRCToRefundTax cannot be null'); + } + $this->container['receivedFromHMRCToRefundTax'] = $receivedFromHMRCToRefundTax; + + return $this; + } + + /** + * Gets receivedFromHMRCToPayStatutoryPay + * + * @return float|null + */ + public function getReceivedFromHMRCToPayStatutoryPay(): ?float + { + return $this->container['receivedFromHMRCToPayStatutoryPay']; + } + + /** + * Sets receivedFromHMRCToPayStatutoryPay + * + * @param float|null $receivedFromHMRCToPayStatutoryPay Any amount received from HMRC to pay Statutory Pay Period + * + * @return $this + */ + public function setReceivedFromHMRCToPayStatutoryPay(?float $receivedFromHMRCToPayStatutoryPay): static + { + if (is_null($receivedFromHMRCToPayStatutoryPay)) { + throw new InvalidArgumentException('non-nullable receivedFromHMRCToPayStatutoryPay cannot be null'); + } + $this->container['receivedFromHMRCToPayStatutoryPay'] = $receivedFromHMRCToPayStatutoryPay; + + return $this; + } + + /** + * Gets cisDeductionsSuffered + * + * @return float|null + */ + public function getCisDeductionsSuffered(): ?float + { + return $this->container['cisDeductionsSuffered']; + } + + /** + * Sets cisDeductionsSuffered + * + * @param float|null $cisDeductionsSuffered CIS Deductions Suffered in Period + * + * @return $this + */ + public function setCisDeductionsSuffered(?float $cisDeductionsSuffered): static + { + if (is_null($cisDeductionsSuffered)) { + throw new InvalidArgumentException('non-nullable cisDeductionsSuffered cannot be null'); + } + $this->container['cisDeductionsSuffered'] = $cisDeductionsSuffered; + + return $this; + } + + /** + * Gets adjustment + * + * @return float|null + */ + public function getAdjustment(): ?float + { + return $this->container['adjustment']; + } + + /** + * Sets adjustment + * + * @param float|null $adjustment Any manual adjustment for Period + * + * @return $this + */ + public function setAdjustment(?float $adjustment): static + { + if (is_null($adjustment)) { + throw new InvalidArgumentException('non-nullable adjustment cannot be null'); + } + $this->container['adjustment'] = $adjustment; + + return $this; + } + + /** + * Gets netLiabilityForPeriod + * + * @return float|null + */ + public function getNetLiabilityForPeriod(): ?float + { + return $this->container['netLiabilityForPeriod']; + } + + /** + * Sets netLiabilityForPeriod + * + * @param float|null $netLiabilityForPeriod [readonly] Net Liability (including any deductions/additions) arising in this Period + * + * @return $this + */ + public function setNetLiabilityForPeriod(?float $netLiabilityForPeriod): static + { + if (is_null($netLiabilityForPeriod)) { + throw new InvalidArgumentException('non-nullable netLiabilityForPeriod cannot be null'); + } + $this->container['netLiabilityForPeriod'] = $netLiabilityForPeriod; + + return $this; + } + + /** + * Gets totalPaid + * + * @return float|null + */ + public function getTotalPaid(): ?float + { + return $this->container['totalPaid']; + } + + /** + * Sets totalPaid + * + * @param float|null $totalPaid [readonly] The total value of all payments in this period + * + * @return $this + */ + public function setTotalPaid(?float $totalPaid): static + { + if (is_null($totalPaid)) { + throw new InvalidArgumentException('non-nullable totalPaid cannot be null'); + } + $this->container['totalPaid'] = $totalPaid; + + return $this; + } + + /** + * Gets payments + * + * @return \SynergiTech\Staffology\Model\HmrcPayment[]|null + */ + public function getPayments(): ?array + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param \SynergiTech\Staffology\Model\HmrcPayment[]|null $payments payments + * + * @return $this + */ + public function setPayments(?array $payments): static + { + if (is_null($payments)) { + array_push($this->openAPINullablesSetToNull, 'payments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets fpsList + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getFpsList(): ?array + { + return $this->container['fpsList']; + } + + /** + * Sets fpsList + * + * @param \SynergiTech\Staffology\Model\Item[]|null $fpsList fpsList + * + * @return $this + */ + public function setFpsList(?array $fpsList): static + { + if (is_null($fpsList)) { + array_push($this->openAPINullablesSetToNull, 'fpsList'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fpsList', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fpsList'] = $fpsList; + + return $this; + } + + /** + * Gets allowLinkedEps + * + * @return bool|null + */ + public function getAllowLinkedEps(): ?bool + { + return $this->container['allowLinkedEps']; + } + + /** + * Sets allowLinkedEps + * + * @param bool|null $allowLinkedEps If true this will allow you to submit a combined Employer Payment Summary + * + * @return $this + */ + public function setAllowLinkedEps(?bool $allowLinkedEps): static + { + if (is_null($allowLinkedEps)) { + throw new InvalidArgumentException('non-nullable allowLinkedEps cannot be null'); + } + $this->container['allowLinkedEps'] = $allowLinkedEps; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HmrcPayment.php b/src/Model/HmrcPayment.php new file mode 100644 index 0000000..3b73031 --- /dev/null +++ b/src/Model/HmrcPayment.php @@ -0,0 +1,476 @@ + + */ +class HmrcPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HmrcPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'amount' => 'float', + 'date' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'amount' => 'double', + 'date' => 'date', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'amount' => false, + 'date' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'amount' => 'amount', + 'date' => 'date', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'amount' => 'setAmount', + 'date' => 'setDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'amount' => 'getAmount', + 'date' => 'getDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount amount + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HolidayAccrual.php b/src/Model/HolidayAccrual.php new file mode 100644 index 0000000..3078e09 --- /dev/null +++ b/src/Model/HolidayAccrual.php @@ -0,0 +1,49 @@ + + */ +class HolidayReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HolidayReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'accrualsReport' => 'bool', + 'accrualsHrsReport' => 'bool', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'lines' => '\SynergiTech\Staffology\Model\HolidayReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'accrualsReport' => null, + 'accrualsHrsReport' => null, + 'employer' => null, + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'accrualsReport' => false, + 'accrualsHrsReport' => false, + 'employer' => false, + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'accrualsReport' => 'accrualsReport', + 'accrualsHrsReport' => 'accrualsHrsReport', + 'employer' => 'employer', + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'accrualsReport' => 'setAccrualsReport', + 'accrualsHrsReport' => 'setAccrualsHrsReport', + 'employer' => 'setEmployer', + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'accrualsReport' => 'getAccrualsReport', + 'accrualsHrsReport' => 'getAccrualsHrsReport', + 'employer' => 'getEmployer', + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accrualsReport', $data ?? [], null); + $this->setIfExists('accrualsHrsReport', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets accrualsReport + * + * @return bool|null + */ + public function getAccrualsReport(): ?bool + { + return $this->container['accrualsReport']; + } + + /** + * Sets accrualsReport + * + * @param bool|null $accrualsReport accrualsReport + * + * @return $this + */ + public function setAccrualsReport(?bool $accrualsReport): static + { + if (is_null($accrualsReport)) { + throw new InvalidArgumentException('non-nullable accrualsReport cannot be null'); + } + $this->container['accrualsReport'] = $accrualsReport; + + return $this; + } + + /** + * Gets accrualsHrsReport + * + * @return bool|null + */ + public function getAccrualsHrsReport(): ?bool + { + return $this->container['accrualsHrsReport']; + } + + /** + * Sets accrualsHrsReport + * + * @param bool|null $accrualsHrsReport accrualsHrsReport + * + * @return $this + */ + public function setAccrualsHrsReport(?bool $accrualsHrsReport): static + { + if (is_null($accrualsHrsReport)) { + throw new InvalidArgumentException('non-nullable accrualsHrsReport cannot be null'); + } + $this->container['accrualsHrsReport'] = $accrualsHrsReport; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\HolidayReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\HolidayReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HolidayReportLine.php b/src/Model/HolidayReportLine.php new file mode 100644 index 0000000..e5d6e14 --- /dev/null +++ b/src/Model/HolidayReportLine.php @@ -0,0 +1,565 @@ + + */ +class HolidayReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HolidayReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string', + 'dayRate' => 'float', + 'leaveSettings' => '\SynergiTech\Staffology\Model\LeaveSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'department' => null, + 'dayRate' => 'double', + 'leaveSettings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'department' => true, + 'dayRate' => true, + 'leaveSettings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department', + 'dayRate' => 'dayRate', + 'leaveSettings' => 'leaveSettings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment', + 'dayRate' => 'setDayRate', + 'leaveSettings' => 'setLeaveSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment', + 'dayRate' => 'getDayRate', + 'leaveSettings' => 'getLeaveSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('dayRate', $data ?? [], null); + $this->setIfExists('leaveSettings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets dayRate + * + * @return float|null + */ + public function getDayRate(): ?float + { + return $this->container['dayRate']; + } + + /** + * Sets dayRate + * + * @param float|null $dayRate dayRate + * + * @return $this + */ + public function setDayRate(?float $dayRate): static + { + if (is_null($dayRate)) { + array_push($this->openAPINullablesSetToNull, 'dayRate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dayRate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dayRate'] = $dayRate; + + return $this; + } + + /** + * Gets leaveSettings + * + * @return \SynergiTech\Staffology\Model\LeaveSettings|null + */ + public function getLeaveSettings(): ?\SynergiTech\Staffology\Model\LeaveSettings + { + return $this->container['leaveSettings']; + } + + /** + * Sets leaveSettings + * + * @param \SynergiTech\Staffology\Model\LeaveSettings|null $leaveSettings leaveSettings + * + * @return $this + */ + public function setLeaveSettings(?\SynergiTech\Staffology\Model\LeaveSettings $leaveSettings): static + { + if (is_null($leaveSettings)) { + throw new InvalidArgumentException('non-nullable leaveSettings cannot be null'); + } + $this->container['leaveSettings'] = $leaveSettings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HolidayReportReportResponse.php b/src/Model/HolidayReportReportResponse.php new file mode 100644 index 0000000..8dcce41 --- /dev/null +++ b/src/Model/HolidayReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class HolidayReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HolidayReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\HolidayReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\HolidayReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\HolidayReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\HolidayReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\HolidayReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HolidaySchemeDurationType.php b/src/Model/HolidaySchemeDurationType.php new file mode 100644 index 0000000..864e116 --- /dev/null +++ b/src/Model/HolidaySchemeDurationType.php @@ -0,0 +1,45 @@ + + */ +class HourlyPayReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HourlyPayReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\HourlyPayReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\HourlyPayReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\HourlyPayReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HourlyPayReportLine.php b/src/Model/HourlyPayReportLine.php new file mode 100644 index 0000000..8faee38 --- /dev/null +++ b/src/Model/HourlyPayReportLine.php @@ -0,0 +1,626 @@ + + */ +class HourlyPayReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HourlyPayReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'payCode' => 'string', + 'period' => 'int', + 'hours' => 'float', + 'rate' => 'float', + 'total' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'payCode' => null, + 'period' => 'int32', + 'hours' => 'double', + 'rate' => 'double', + 'total' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'payCode' => true, + 'period' => false, + 'hours' => false, + 'rate' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'payCode' => 'payCode', + 'period' => 'period', + 'hours' => 'hours', + 'rate' => 'rate', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'payCode' => 'setPayCode', + 'period' => 'setPeriod', + 'hours' => 'setHours', + 'rate' => 'setRate', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'payCode' => 'getPayCode', + 'period' => 'getPeriod', + 'hours' => 'getHours', + 'rate' => 'getRate', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours hours + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate rate + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets total + * + * @return float|null + */ + public function getTotal(): ?float + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal(?float $total): static + { + if (is_null($total)) { + throw new InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HourlyPayReportReportResponse.php b/src/Model/HourlyPayReportReportResponse.php new file mode 100644 index 0000000..6af4038 --- /dev/null +++ b/src/Model/HourlyPayReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class HourlyPayReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HourlyPayReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\HourlyPayReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\HourlyPayReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\HourlyPayReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\HourlyPayReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\HourlyPayReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HoursNormallyWorked.php b/src/Model/HoursNormallyWorked.php new file mode 100644 index 0000000..63095ee --- /dev/null +++ b/src/Model/HoursNormallyWorked.php @@ -0,0 +1,51 @@ + + */ +class HtmlEmailSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'HtmlEmailSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'bodyCssStyle' => 'string', + 'fontCssStyle' => 'string', + 'buttonCssStyle' => 'string', + 'headerHtml' => 'string', + 'footerHtml' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'bodyCssStyle' => null, + 'fontCssStyle' => null, + 'buttonCssStyle' => null, + 'headerHtml' => null, + 'footerHtml' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'bodyCssStyle' => true, + 'fontCssStyle' => true, + 'buttonCssStyle' => true, + 'headerHtml' => true, + 'footerHtml' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'bodyCssStyle' => 'bodyCssStyle', + 'fontCssStyle' => 'fontCssStyle', + 'buttonCssStyle' => 'buttonCssStyle', + 'headerHtml' => 'headerHtml', + 'footerHtml' => 'footerHtml' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'bodyCssStyle' => 'setBodyCssStyle', + 'fontCssStyle' => 'setFontCssStyle', + 'buttonCssStyle' => 'setButtonCssStyle', + 'headerHtml' => 'setHeaderHtml', + 'footerHtml' => 'setFooterHtml' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'bodyCssStyle' => 'getBodyCssStyle', + 'fontCssStyle' => 'getFontCssStyle', + 'buttonCssStyle' => 'getButtonCssStyle', + 'headerHtml' => 'getHeaderHtml', + 'footerHtml' => 'getFooterHtml' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bodyCssStyle', $data ?? [], null); + $this->setIfExists('fontCssStyle', $data ?? [], null); + $this->setIfExists('buttonCssStyle', $data ?? [], null); + $this->setIfExists('headerHtml', $data ?? [], null); + $this->setIfExists('footerHtml', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bodyCssStyle + * + * @return string|null + */ + public function getBodyCssStyle(): ?string + { + return $this->container['bodyCssStyle']; + } + + /** + * Sets bodyCssStyle + * + * @param string|null $bodyCssStyle bodyCssStyle + * + * @return $this + */ + public function setBodyCssStyle(?string $bodyCssStyle): static + { + if (is_null($bodyCssStyle)) { + array_push($this->openAPINullablesSetToNull, 'bodyCssStyle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bodyCssStyle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bodyCssStyle'] = $bodyCssStyle; + + return $this; + } + + /** + * Gets fontCssStyle + * + * @return string|null + */ + public function getFontCssStyle(): ?string + { + return $this->container['fontCssStyle']; + } + + /** + * Sets fontCssStyle + * + * @param string|null $fontCssStyle fontCssStyle + * + * @return $this + */ + public function setFontCssStyle(?string $fontCssStyle): static + { + if (is_null($fontCssStyle)) { + array_push($this->openAPINullablesSetToNull, 'fontCssStyle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fontCssStyle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fontCssStyle'] = $fontCssStyle; + + return $this; + } + + /** + * Gets buttonCssStyle + * + * @return string|null + */ + public function getButtonCssStyle(): ?string + { + return $this->container['buttonCssStyle']; + } + + /** + * Sets buttonCssStyle + * + * @param string|null $buttonCssStyle buttonCssStyle + * + * @return $this + */ + public function setButtonCssStyle(?string $buttonCssStyle): static + { + if (is_null($buttonCssStyle)) { + array_push($this->openAPINullablesSetToNull, 'buttonCssStyle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buttonCssStyle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['buttonCssStyle'] = $buttonCssStyle; + + return $this; + } + + /** + * Gets headerHtml + * + * @return string|null + */ + public function getHeaderHtml(): ?string + { + return $this->container['headerHtml']; + } + + /** + * Sets headerHtml + * + * @param string|null $headerHtml headerHtml + * + * @return $this + */ + public function setHeaderHtml(?string $headerHtml): static + { + if (is_null($headerHtml)) { + array_push($this->openAPINullablesSetToNull, 'headerHtml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('headerHtml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['headerHtml'] = $headerHtml; + + return $this; + } + + /** + * Gets footerHtml + * + * @return string|null + */ + public function getFooterHtml(): ?string + { + return $this->container['footerHtml']; + } + + /** + * Sets footerHtml + * + * @param string|null $footerHtml footerHtml + * + * @return $this + */ + public function setFooterHtml(?string $footerHtml): static + { + if (is_null($footerHtml)) { + array_push($this->openAPINullablesSetToNull, 'footerHtml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('footerHtml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['footerHtml'] = $footerHtml; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HtmlInsertionPoint.php b/src/Model/HtmlInsertionPoint.php new file mode 100644 index 0000000..fc0c7df --- /dev/null +++ b/src/Model/HtmlInsertionPoint.php @@ -0,0 +1,45 @@ + + */ +class Invitation implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Invitation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'emailAddress' => 'string', + 'message' => 'string', + 'role' => '\SynergiTech\Staffology\Model\UserRole', + 'emailId' => 'string', + 'emailStatus' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'invitedBy' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employer' => null, + 'emailAddress' => 'email', + 'message' => null, + 'role' => null, + 'emailId' => 'uuid', + 'emailStatus' => null, + 'invitedBy' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employer' => false, + 'emailAddress' => false, + 'message' => true, + 'role' => false, + 'emailId' => true, + 'emailStatus' => false, + 'invitedBy' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employer' => 'employer', + 'emailAddress' => 'emailAddress', + 'message' => 'message', + 'role' => 'role', + 'emailId' => 'emailId', + 'emailStatus' => 'emailStatus', + 'invitedBy' => 'invitedBy', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employer' => 'setEmployer', + 'emailAddress' => 'setEmailAddress', + 'message' => 'setMessage', + 'role' => 'setRole', + 'emailId' => 'setEmailId', + 'emailStatus' => 'setEmailStatus', + 'invitedBy' => 'setInvitedBy', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employer' => 'getEmployer', + 'emailAddress' => 'getEmailAddress', + 'message' => 'getMessage', + 'role' => 'getRole', + 'emailId' => 'getEmailId', + 'emailStatus' => 'getEmailStatus', + 'invitedBy' => 'getInvitedBy', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('emailAddress', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('emailId', $data ?? [], null); + $this->setIfExists('emailStatus', $data ?? [], null); + $this->setIfExists('invitedBy', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['emailAddress'] === null) { + $invalidProperties[] = "'emailAddress' can't be null"; + } + if ((mb_strlen($this->container['emailAddress']) > 150)) { + $invalidProperties[] = "invalid value for 'emailAddress', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['emailAddress']) < 1)) { + $invalidProperties[] = "invalid value for 'emailAddress', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets emailAddress + * + * @return string + */ + public function getEmailAddress(): string + { + return $this->container['emailAddress']; + } + + /** + * Sets emailAddress + * + * @param string $emailAddress The email address of the user that is being invited to access the Employer + * + * @return $this + */ + public function setEmailAddress(string $emailAddress): static + { + if (is_null($emailAddress)) { + throw new InvalidArgumentException('non-nullable emailAddress cannot be null'); + } + if ((mb_strlen($emailAddress) > 150)) { + throw new InvalidArgumentException('invalid length for $emailAddress when calling Invitation., must be smaller than or equal to 150.'); + } + if ((mb_strlen($emailAddress) < 1)) { + throw new InvalidArgumentException('invalid length for $emailAddress when calling Invitation., must be bigger than or equal to 1.'); + } + + $this->container['emailAddress'] = $emailAddress; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message An optional message to include in the email sent to the EmailAddress + * + * @return $this + */ + public function setMessage(?string $message): static + { + if (is_null($message)) { + array_push($this->openAPINullablesSetToNull, 'message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets role + * + * @return \SynergiTech\Staffology\Model\UserRole|null + */ + public function getRole(): ?\SynergiTech\Staffology\Model\UserRole + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param \SynergiTech\Staffology\Model\UserRole|null $role role + * + * @return $this + */ + public function setRole(?\SynergiTech\Staffology\Model\UserRole $role): static + { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets emailId + * + * @return string|null + */ + public function getEmailId(): ?string + { + return $this->container['emailId']; + } + + /** + * Sets emailId + * + * @param string|null $emailId emailId + * + * @return $this + */ + public function setEmailId(?string $emailId): static + { + if (is_null($emailId)) { + array_push($this->openAPINullablesSetToNull, 'emailId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailId'] = $emailId; + + return $this; + } + + /** + * Gets emailStatus + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getEmailStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['emailStatus']; + } + + /** + * Sets emailStatus + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $emailStatus emailStatus + * + * @return $this + */ + public function setEmailStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $emailStatus): static + { + if (is_null($emailStatus)) { + throw new InvalidArgumentException('non-nullable emailStatus cannot be null'); + } + $this->container['emailStatus'] = $emailStatus; + + return $this; + } + + /** + * Gets invitedBy + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getInvitedBy(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['invitedBy']; + } + + /** + * Sets invitedBy + * + * @param \SynergiTech\Staffology\Model\Item|null $invitedBy invitedBy + * + * @return $this + */ + public function setInvitedBy(?\SynergiTech\Staffology\Model\Item $invitedBy): static + { + if (is_null($invitedBy)) { + throw new InvalidArgumentException('non-nullable invitedBy cannot be null'); + } + $this->container['invitedBy'] = $invitedBy; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Item.php b/src/Model/Item.php new file mode 100644 index 0000000..f7d96a9 --- /dev/null +++ b/src/Model/Item.php @@ -0,0 +1,531 @@ + + */ +class Item implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ItemListReportResponse.php b/src/Model/ItemListReportResponse.php new file mode 100644 index 0000000..ff4adb9 --- /dev/null +++ b/src/Model/ItemListReportResponse.php @@ -0,0 +1,539 @@ + + */ +class ItemListReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemListReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\Item[]', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getModel(): ?array + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\Item[]|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(?array $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/JobStatus.php b/src/Model/JobStatus.php new file mode 100644 index 0000000..b69d3b4 --- /dev/null +++ b/src/Model/JobStatus.php @@ -0,0 +1,51 @@ + + */ +class JournalTemplate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'JournalTemplate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'header' => 'string', + 'content' => 'string', + 'useColumnHeaders' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'header' => null, + 'content' => null, + 'useColumnHeaders' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'header' => true, + 'content' => true, + 'useColumnHeaders' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'header' => 'header', + 'content' => 'content', + 'useColumnHeaders' => 'useColumnHeaders', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'header' => 'setHeader', + 'content' => 'setContent', + 'useColumnHeaders' => 'setUseColumnHeaders', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'header' => 'getHeader', + 'content' => 'getContent', + 'useColumnHeaders' => 'getUseColumnHeaders', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('header', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('useColumnHeaders', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets header + * + * @return string|null + */ + public function getHeader(): ?string + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string|null $header Header of Journal Template + * + * @return $this + */ + public function setHeader(?string $header): static + { + if (is_null($header)) { + array_push($this->openAPINullablesSetToNull, 'header'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content Content of Journal Template + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets useColumnHeaders + * + * @return bool|null + */ + public function getUseColumnHeaders(): ?bool + { + return $this->container['useColumnHeaders']; + } + + /** + * Sets useColumnHeaders + * + * @param bool|null $useColumnHeaders Use Column Headers indicates whether to use column headers while parsing the content in CSV format + * + * @return $this + */ + public function setUseColumnHeaders(?bool $useColumnHeaders): static + { + if (is_null($useColumnHeaders)) { + throw new InvalidArgumentException('non-nullable useColumnHeaders cannot be null'); + } + $this->container['useColumnHeaders'] = $useColumnHeaders; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/JournalTokenType.php b/src/Model/JournalTokenType.php new file mode 100644 index 0000000..21c4006 --- /dev/null +++ b/src/Model/JournalTokenType.php @@ -0,0 +1,49 @@ + + */ +class Leave implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Leave'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'providerId' => '\SynergiTech\Staffology\Model\ExternalDataProviderId', + 'externalId' => 'string', + 'type' => '\SynergiTech\Staffology\Model\LeaveType', + 'pay' => '\SynergiTech\Staffology\Model\LeavePayType', + 'payFrequency' => '\SynergiTech\Staffology\Model\StatPayFrequency', + 'payRunExistsWithStatPay' => 'bool', + 'from' => '\DateTime', + 'to' => '\DateTime', + 'notes' => 'string', + 'averageWeeklyEarnings' => 'float', + 'automaticAWECalculation' => 'bool', + 'babyDate' => '\DateTime', + 'secondaryBabyDate' => '\DateTime', + 'tertiaryBabyDate' => '\DateTime', + 'overridePaymentDescription' => 'bool', + 'overridenPaymentDescription' => 'string', + 'workingDays' => 'float', + 'workingDaysOverride' => 'float', + 'totalDays' => 'float', + 'totalDaysOverride' => 'float', + 'useAssumedPensionablePay' => 'bool', + 'assumedPensionablePays' => '\SynergiTech\Staffology\Model\LeaveAssumedPensionablePay[]', + 'offsetPay' => 'bool', + 'sspPayFromDayOne' => 'bool', + 'linkedPiw' => '\SynergiTech\Staffology\Model\LinkedPiw', + 'kitSplitDays' => '\DateTime[]', + 'historicSspRequiresProcessing' => 'bool', + 'historicSxpRequiresProcessing' => 'bool', + 'openingPay' => 'float', + 'useOpeningPay' => 'bool', + 'historicOspRequiresProcessing' => 'bool', + 'historicOmpRequiresProcessing' => 'bool', + 'historicSmpRequiresProcessing' => 'bool', + 'occupationalMaternityPolicyUniqueId' => 'string', + 'openingOmpPay' => 'float', + 'payRunExistsWithOccMaternityPay' => 'bool', + 'calculationType' => '\SynergiTech\Staffology\Model\LeaveCalculationType', + 'strikeHoursToDeduct' => 'float', + 'customPayments' => '\SynergiTech\Staffology\Model\LeaveCustomPayment[]', + 'customProRataRules' => '\SynergiTech\Staffology\Model\LeaveCustomProRataRule[]', + 'lastProcessedFrom' => '\DateTime', + 'isReversed' => 'bool', + 'documentCount' => 'int', + 'documents' => '\SynergiTech\Staffology\Model\Item[]', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'providerId' => null, + 'externalId' => null, + 'type' => null, + 'pay' => null, + 'payFrequency' => null, + 'payRunExistsWithStatPay' => null, + 'from' => 'date-time', + 'to' => 'date-time', + 'notes' => null, + 'averageWeeklyEarnings' => 'double', + 'automaticAWECalculation' => null, + 'babyDate' => 'date', + 'secondaryBabyDate' => 'date', + 'tertiaryBabyDate' => 'date', + 'overridePaymentDescription' => null, + 'overridenPaymentDescription' => null, + 'workingDays' => 'double', + 'workingDaysOverride' => 'double', + 'totalDays' => 'double', + 'totalDaysOverride' => 'double', + 'useAssumedPensionablePay' => null, + 'assumedPensionablePays' => null, + 'offsetPay' => null, + 'sspPayFromDayOne' => null, + 'linkedPiw' => null, + 'kitSplitDays' => 'date-time', + 'historicSspRequiresProcessing' => null, + 'historicSxpRequiresProcessing' => null, + 'openingPay' => 'double', + 'useOpeningPay' => null, + 'historicOspRequiresProcessing' => null, + 'historicOmpRequiresProcessing' => null, + 'historicSmpRequiresProcessing' => null, + 'occupationalMaternityPolicyUniqueId' => 'uuid', + 'openingOmpPay' => 'double', + 'payRunExistsWithOccMaternityPay' => null, + 'calculationType' => null, + 'strikeHoursToDeduct' => 'double', + 'customPayments' => null, + 'customProRataRules' => null, + 'lastProcessedFrom' => 'date', + 'isReversed' => null, + 'documentCount' => 'int32', + 'documents' => null, + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'providerId' => false, + 'externalId' => true, + 'type' => false, + 'pay' => false, + 'payFrequency' => false, + 'payRunExistsWithStatPay' => false, + 'from' => false, + 'to' => false, + 'notes' => true, + 'averageWeeklyEarnings' => false, + 'automaticAWECalculation' => false, + 'babyDate' => true, + 'secondaryBabyDate' => true, + 'tertiaryBabyDate' => true, + 'overridePaymentDescription' => false, + 'overridenPaymentDescription' => true, + 'workingDays' => false, + 'workingDaysOverride' => true, + 'totalDays' => false, + 'totalDaysOverride' => true, + 'useAssumedPensionablePay' => false, + 'assumedPensionablePays' => true, + 'offsetPay' => false, + 'sspPayFromDayOne' => false, + 'linkedPiw' => false, + 'kitSplitDays' => true, + 'historicSspRequiresProcessing' => false, + 'historicSxpRequiresProcessing' => false, + 'openingPay' => true, + 'useOpeningPay' => false, + 'historicOspRequiresProcessing' => false, + 'historicOmpRequiresProcessing' => false, + 'historicSmpRequiresProcessing' => false, + 'occupationalMaternityPolicyUniqueId' => true, + 'openingOmpPay' => true, + 'payRunExistsWithOccMaternityPay' => false, + 'calculationType' => false, + 'strikeHoursToDeduct' => true, + 'customPayments' => true, + 'customProRataRules' => true, + 'lastProcessedFrom' => true, + 'isReversed' => false, + 'documentCount' => false, + 'documents' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'providerId' => 'providerId', + 'externalId' => 'externalId', + 'type' => 'type', + 'pay' => 'pay', + 'payFrequency' => 'payFrequency', + 'payRunExistsWithStatPay' => 'payRunExistsWithStatPay', + 'from' => 'from', + 'to' => 'to', + 'notes' => 'notes', + 'averageWeeklyEarnings' => 'averageWeeklyEarnings', + 'automaticAWECalculation' => 'automaticAWECalculation', + 'babyDate' => 'babyDate', + 'secondaryBabyDate' => 'secondaryBabyDate', + 'tertiaryBabyDate' => 'tertiaryBabyDate', + 'overridePaymentDescription' => 'overridePaymentDescription', + 'overridenPaymentDescription' => 'overridenPaymentDescription', + 'workingDays' => 'workingDays', + 'workingDaysOverride' => 'workingDaysOverride', + 'totalDays' => 'totalDays', + 'totalDaysOverride' => 'totalDaysOverride', + 'useAssumedPensionablePay' => 'useAssumedPensionablePay', + 'assumedPensionablePays' => 'assumedPensionablePays', + 'offsetPay' => 'offsetPay', + 'sspPayFromDayOne' => 'sspPayFromDayOne', + 'linkedPiw' => 'linkedPiw', + 'kitSplitDays' => 'kitSplitDays', + 'historicSspRequiresProcessing' => 'historicSspRequiresProcessing', + 'historicSxpRequiresProcessing' => 'historicSxpRequiresProcessing', + 'openingPay' => 'openingPay', + 'useOpeningPay' => 'useOpeningPay', + 'historicOspRequiresProcessing' => 'historicOspRequiresProcessing', + 'historicOmpRequiresProcessing' => 'historicOmpRequiresProcessing', + 'historicSmpRequiresProcessing' => 'historicSmpRequiresProcessing', + 'occupationalMaternityPolicyUniqueId' => 'occupationalMaternityPolicyUniqueId', + 'openingOmpPay' => 'openingOmpPay', + 'payRunExistsWithOccMaternityPay' => 'payRunExistsWithOccMaternityPay', + 'calculationType' => 'calculationType', + 'strikeHoursToDeduct' => 'strikeHoursToDeduct', + 'customPayments' => 'customPayments', + 'customProRataRules' => 'customProRataRules', + 'lastProcessedFrom' => 'lastProcessedFrom', + 'isReversed' => 'isReversed', + 'documentCount' => 'documentCount', + 'documents' => 'documents', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'providerId' => 'setProviderId', + 'externalId' => 'setExternalId', + 'type' => 'setType', + 'pay' => 'setPay', + 'payFrequency' => 'setPayFrequency', + 'payRunExistsWithStatPay' => 'setPayRunExistsWithStatPay', + 'from' => 'setFrom', + 'to' => 'setTo', + 'notes' => 'setNotes', + 'averageWeeklyEarnings' => 'setAverageWeeklyEarnings', + 'automaticAWECalculation' => 'setAutomaticAWECalculation', + 'babyDate' => 'setBabyDate', + 'secondaryBabyDate' => 'setSecondaryBabyDate', + 'tertiaryBabyDate' => 'setTertiaryBabyDate', + 'overridePaymentDescription' => 'setOverridePaymentDescription', + 'overridenPaymentDescription' => 'setOverridenPaymentDescription', + 'workingDays' => 'setWorkingDays', + 'workingDaysOverride' => 'setWorkingDaysOverride', + 'totalDays' => 'setTotalDays', + 'totalDaysOverride' => 'setTotalDaysOverride', + 'useAssumedPensionablePay' => 'setUseAssumedPensionablePay', + 'assumedPensionablePays' => 'setAssumedPensionablePays', + 'offsetPay' => 'setOffsetPay', + 'sspPayFromDayOne' => 'setSspPayFromDayOne', + 'linkedPiw' => 'setLinkedPiw', + 'kitSplitDays' => 'setKitSplitDays', + 'historicSspRequiresProcessing' => 'setHistoricSspRequiresProcessing', + 'historicSxpRequiresProcessing' => 'setHistoricSxpRequiresProcessing', + 'openingPay' => 'setOpeningPay', + 'useOpeningPay' => 'setUseOpeningPay', + 'historicOspRequiresProcessing' => 'setHistoricOspRequiresProcessing', + 'historicOmpRequiresProcessing' => 'setHistoricOmpRequiresProcessing', + 'historicSmpRequiresProcessing' => 'setHistoricSmpRequiresProcessing', + 'occupationalMaternityPolicyUniqueId' => 'setOccupationalMaternityPolicyUniqueId', + 'openingOmpPay' => 'setOpeningOmpPay', + 'payRunExistsWithOccMaternityPay' => 'setPayRunExistsWithOccMaternityPay', + 'calculationType' => 'setCalculationType', + 'strikeHoursToDeduct' => 'setStrikeHoursToDeduct', + 'customPayments' => 'setCustomPayments', + 'customProRataRules' => 'setCustomProRataRules', + 'lastProcessedFrom' => 'setLastProcessedFrom', + 'isReversed' => 'setIsReversed', + 'documentCount' => 'setDocumentCount', + 'documents' => 'setDocuments', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'providerId' => 'getProviderId', + 'externalId' => 'getExternalId', + 'type' => 'getType', + 'pay' => 'getPay', + 'payFrequency' => 'getPayFrequency', + 'payRunExistsWithStatPay' => 'getPayRunExistsWithStatPay', + 'from' => 'getFrom', + 'to' => 'getTo', + 'notes' => 'getNotes', + 'averageWeeklyEarnings' => 'getAverageWeeklyEarnings', + 'automaticAWECalculation' => 'getAutomaticAWECalculation', + 'babyDate' => 'getBabyDate', + 'secondaryBabyDate' => 'getSecondaryBabyDate', + 'tertiaryBabyDate' => 'getTertiaryBabyDate', + 'overridePaymentDescription' => 'getOverridePaymentDescription', + 'overridenPaymentDescription' => 'getOverridenPaymentDescription', + 'workingDays' => 'getWorkingDays', + 'workingDaysOverride' => 'getWorkingDaysOverride', + 'totalDays' => 'getTotalDays', + 'totalDaysOverride' => 'getTotalDaysOverride', + 'useAssumedPensionablePay' => 'getUseAssumedPensionablePay', + 'assumedPensionablePays' => 'getAssumedPensionablePays', + 'offsetPay' => 'getOffsetPay', + 'sspPayFromDayOne' => 'getSspPayFromDayOne', + 'linkedPiw' => 'getLinkedPiw', + 'kitSplitDays' => 'getKitSplitDays', + 'historicSspRequiresProcessing' => 'getHistoricSspRequiresProcessing', + 'historicSxpRequiresProcessing' => 'getHistoricSxpRequiresProcessing', + 'openingPay' => 'getOpeningPay', + 'useOpeningPay' => 'getUseOpeningPay', + 'historicOspRequiresProcessing' => 'getHistoricOspRequiresProcessing', + 'historicOmpRequiresProcessing' => 'getHistoricOmpRequiresProcessing', + 'historicSmpRequiresProcessing' => 'getHistoricSmpRequiresProcessing', + 'occupationalMaternityPolicyUniqueId' => 'getOccupationalMaternityPolicyUniqueId', + 'openingOmpPay' => 'getOpeningOmpPay', + 'payRunExistsWithOccMaternityPay' => 'getPayRunExistsWithOccMaternityPay', + 'calculationType' => 'getCalculationType', + 'strikeHoursToDeduct' => 'getStrikeHoursToDeduct', + 'customPayments' => 'getCustomPayments', + 'customProRataRules' => 'getCustomProRataRules', + 'lastProcessedFrom' => 'getLastProcessedFrom', + 'isReversed' => 'getIsReversed', + 'documentCount' => 'getDocumentCount', + 'documents' => 'getDocuments', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('providerId', $data ?? [], null); + $this->setIfExists('externalId', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('pay', $data ?? [], null); + $this->setIfExists('payFrequency', $data ?? [], null); + $this->setIfExists('payRunExistsWithStatPay', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('averageWeeklyEarnings', $data ?? [], null); + $this->setIfExists('automaticAWECalculation', $data ?? [], null); + $this->setIfExists('babyDate', $data ?? [], null); + $this->setIfExists('secondaryBabyDate', $data ?? [], null); + $this->setIfExists('tertiaryBabyDate', $data ?? [], null); + $this->setIfExists('overridePaymentDescription', $data ?? [], null); + $this->setIfExists('overridenPaymentDescription', $data ?? [], null); + $this->setIfExists('workingDays', $data ?? [], null); + $this->setIfExists('workingDaysOverride', $data ?? [], null); + $this->setIfExists('totalDays', $data ?? [], null); + $this->setIfExists('totalDaysOverride', $data ?? [], null); + $this->setIfExists('useAssumedPensionablePay', $data ?? [], null); + $this->setIfExists('assumedPensionablePays', $data ?? [], null); + $this->setIfExists('offsetPay', $data ?? [], null); + $this->setIfExists('sspPayFromDayOne', $data ?? [], null); + $this->setIfExists('linkedPiw', $data ?? [], null); + $this->setIfExists('kitSplitDays', $data ?? [], null); + $this->setIfExists('historicSspRequiresProcessing', $data ?? [], null); + $this->setIfExists('historicSxpRequiresProcessing', $data ?? [], null); + $this->setIfExists('openingPay', $data ?? [], null); + $this->setIfExists('useOpeningPay', $data ?? [], null); + $this->setIfExists('historicOspRequiresProcessing', $data ?? [], null); + $this->setIfExists('historicOmpRequiresProcessing', $data ?? [], null); + $this->setIfExists('historicSmpRequiresProcessing', $data ?? [], null); + $this->setIfExists('occupationalMaternityPolicyUniqueId', $data ?? [], null); + $this->setIfExists('openingOmpPay', $data ?? [], null); + $this->setIfExists('payRunExistsWithOccMaternityPay', $data ?? [], null); + $this->setIfExists('calculationType', $data ?? [], null); + $this->setIfExists('strikeHoursToDeduct', $data ?? [], null); + $this->setIfExists('customPayments', $data ?? [], null); + $this->setIfExists('customProRataRules', $data ?? [], null); + $this->setIfExists('lastProcessedFrom', $data ?? [], null); + $this->setIfExists('isReversed', $data ?? [], null); + $this->setIfExists('documentCount', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['externalId']) && (mb_strlen($this->container['externalId']) > 100)) { + $invalidProperties[] = "invalid value for 'externalId', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['notes']) && (mb_strlen($this->container['notes']) > 300)) { + $invalidProperties[] = "invalid value for 'notes', the character length must be smaller than or equal to 300."; + } + + if (!is_null($this->container['overridenPaymentDescription']) && (mb_strlen($this->container['overridenPaymentDescription']) > 150)) { + $invalidProperties[] = "invalid value for 'overridenPaymentDescription', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets providerId + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderId|null + */ + public function getProviderId(): ?\SynergiTech\Staffology\Model\ExternalDataProviderId + { + return $this->container['providerId']; + } + + /** + * Sets providerId + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $providerId providerId + * + * @return $this + */ + public function setProviderId(?\SynergiTech\Staffology\Model\ExternalDataProviderId $providerId): static + { + if (is_null($providerId)) { + throw new InvalidArgumentException('non-nullable providerId cannot be null'); + } + $this->container['providerId'] = $providerId; + + return $this; + } + + /** + * Gets externalId + * + * @return string|null + */ + public function getExternalId(): ?string + { + return $this->container['externalId']; + } + + /** + * Sets externalId + * + * @param string|null $externalId If the Leave comes from an ExternalDataProvider, then this is its Id in the ExternalDataProvider + * + * @return $this + */ + public function setExternalId(?string $externalId): static + { + if (is_null($externalId)) { + array_push($this->openAPINullablesSetToNull, 'externalId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('externalId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($externalId) && (mb_strlen($externalId) > 100)) { + throw new InvalidArgumentException('invalid length for $externalId when calling Leave., must be smaller than or equal to 100.'); + } + + $this->container['externalId'] = $externalId; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LeaveType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LeaveType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LeaveType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LeaveType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets pay + * + * @return \SynergiTech\Staffology\Model\LeavePayType|null + */ + public function getPay(): ?\SynergiTech\Staffology\Model\LeavePayType + { + return $this->container['pay']; + } + + /** + * Sets pay + * + * @param \SynergiTech\Staffology\Model\LeavePayType|null $pay pay + * + * @return $this + */ + public function setPay(?\SynergiTech\Staffology\Model\LeavePayType $pay): static + { + if (is_null($pay)) { + throw new InvalidArgumentException('non-nullable pay cannot be null'); + } + $this->container['pay'] = $pay; + + return $this; + } + + /** + * Gets payFrequency + * + * @return \SynergiTech\Staffology\Model\StatPayFrequency|null + */ + public function getPayFrequency(): ?\SynergiTech\Staffology\Model\StatPayFrequency + { + return $this->container['payFrequency']; + } + + /** + * Sets payFrequency + * + * @param \SynergiTech\Staffology\Model\StatPayFrequency|null $payFrequency payFrequency + * + * @return $this + */ + public function setPayFrequency(?\SynergiTech\Staffology\Model\StatPayFrequency $payFrequency): static + { + if (is_null($payFrequency)) { + throw new InvalidArgumentException('non-nullable payFrequency cannot be null'); + } + $this->container['payFrequency'] = $payFrequency; + + return $this; + } + + /** + * Gets payRunExistsWithStatPay + * + * @return bool|null + */ + public function getPayRunExistsWithStatPay(): ?bool + { + return $this->container['payRunExistsWithStatPay']; + } + + /** + * Sets payRunExistsWithStatPay + * + * @param bool|null $payRunExistsWithStatPay payRunExistsWithStatPay + * + * @return $this + */ + public function setPayRunExistsWithStatPay(?bool $payRunExistsWithStatPay): static + { + if (is_null($payRunExistsWithStatPay)) { + throw new InvalidArgumentException('non-nullable payRunExistsWithStatPay cannot be null'); + } + $this->container['payRunExistsWithStatPay'] = $payRunExistsWithStatPay; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime|null + */ + public function getFrom(): ?\DateTime + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime|null $from The first day of Leave. If it's a half day PM then set the time portion to 12:00:00, otherwise leave it blank or set it to 00:00:00 + * + * @return $this + */ + public function setFrom(?\DateTime $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \DateTime|null + */ + public function getTo(): ?\DateTime + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \DateTime|null $to The last day of Leave. If it's a half day AM then set the time portion to 11:59:59, otherwise set it to 23:59:59 + * + * @return $this + */ + public function setTo(?\DateTime $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes(): ?string + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes A free-form text field to record any comments + * + * @return $this + */ + public function setNotes(?string $notes): static + { + if (is_null($notes)) { + array_push($this->openAPINullablesSetToNull, 'notes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('notes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($notes) && (mb_strlen($notes) > 300)) { + throw new InvalidArgumentException('invalid length for $notes when calling Leave., must be smaller than or equal to 300.'); + } + + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets averageWeeklyEarnings + * + * @return float|null + */ + public function getAverageWeeklyEarnings(): ?float + { + return $this->container['averageWeeklyEarnings']; + } + + /** + * Sets averageWeeklyEarnings + * + * @param float|null $averageWeeklyEarnings The employees average weekly earnings. Only relevant for Statutory Pay It's advised that you don't try to calculate this yourself. + * + * @return $this + */ + public function setAverageWeeklyEarnings(?float $averageWeeklyEarnings): static + { + if (is_null($averageWeeklyEarnings)) { + throw new InvalidArgumentException('non-nullable averageWeeklyEarnings cannot be null'); + } + $this->container['averageWeeklyEarnings'] = $averageWeeklyEarnings; + + return $this; + } + + /** + * Gets automaticAWECalculation + * + * @return bool|null + */ + public function getAutomaticAWECalculation(): ?bool + { + return $this->container['automaticAWECalculation']; + } + + /** + * Sets automaticAWECalculation + * + * @param bool|null $automaticAWECalculation If set to True then we'll automatically calculate the AverageWeeklyEarnings. Set it to false if you want to manually provide a figure that overrides our calculations + * + * @return $this + */ + public function setAutomaticAWECalculation(?bool $automaticAWECalculation): static + { + if (is_null($automaticAWECalculation)) { + throw new InvalidArgumentException('non-nullable automaticAWECalculation cannot be null'); + } + $this->container['automaticAWECalculation'] = $automaticAWECalculation; + + return $this; + } + + /** + * Gets babyDate + * + * @return \DateTime|null + */ + public function getBabyDate(): ?\DateTime + { + return $this->container['babyDate']; + } + + /** + * Sets babyDate + * + * @param \DateTime|null $babyDate Only required for Parental Leave with Statutory Pay If Type is Maternity or Paternity then this is the date the baby is due. For Adoption this is the Matching Date. + * + * @return $this + */ + public function setBabyDate(?\DateTime $babyDate): static + { + if (is_null($babyDate)) { + array_push($this->openAPINullablesSetToNull, 'babyDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('babyDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['babyDate'] = $babyDate; + + return $this; + } + + /** + * Gets secondaryBabyDate + * + * @return \DateTime|null + */ + public function getSecondaryBabyDate(): ?\DateTime + { + return $this->container['secondaryBabyDate']; + } + + /** + * Sets secondaryBabyDate + * + * @param \DateTime|null $secondaryBabyDate Only used for Parental Leave with Statutory Pay If Type is Maternity, Paternity, SharedParental (Birth) then this is the the Baby Born Date. For Adoption or SharedParental (Adoption) this is the Expected Placement Date. + * + * @return $this + */ + public function setSecondaryBabyDate(?\DateTime $secondaryBabyDate): static + { + if (is_null($secondaryBabyDate)) { + array_push($this->openAPINullablesSetToNull, 'secondaryBabyDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryBabyDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryBabyDate'] = $secondaryBabyDate; + + return $this; + } + + /** + * Gets tertiaryBabyDate + * + * @return \DateTime|null + */ + public function getTertiaryBabyDate(): ?\DateTime + { + return $this->container['tertiaryBabyDate']; + } + + /** + * Sets tertiaryBabyDate + * + * @param \DateTime|null $tertiaryBabyDate Only used for Parental Leave with Statutory Pay If Type is Adoption this is the Placement Date. + * + * @return $this + */ + public function setTertiaryBabyDate(?\DateTime $tertiaryBabyDate): static + { + if (is_null($tertiaryBabyDate)) { + array_push($this->openAPINullablesSetToNull, 'tertiaryBabyDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tertiaryBabyDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tertiaryBabyDate'] = $tertiaryBabyDate; + + return $this; + } + + /** + * Gets overridePaymentDescription + * + * @return bool|null + */ + public function getOverridePaymentDescription(): ?bool + { + return $this->container['overridePaymentDescription']; + } + + /** + * Sets overridePaymentDescription + * + * @param bool|null $overridePaymentDescription If Pay is StatutoryPay and you want to override our description that goes with the payment then set this to true + * + * @return $this + */ + public function setOverridePaymentDescription(?bool $overridePaymentDescription): static + { + if (is_null($overridePaymentDescription)) { + throw new InvalidArgumentException('non-nullable overridePaymentDescription cannot be null'); + } + $this->container['overridePaymentDescription'] = $overridePaymentDescription; + + return $this; + } + + /** + * Gets overridenPaymentDescription + * + * @return string|null + */ + public function getOverridenPaymentDescription(): ?string + { + return $this->container['overridenPaymentDescription']; + } + + /** + * Sets overridenPaymentDescription + * + * @param string|null $overridenPaymentDescription If OverridePaymentDescription is true and Pay is set to StatutoryPay then we'll use this as the description for the payment amount. + * + * @return $this + */ + public function setOverridenPaymentDescription(?string $overridenPaymentDescription): static + { + if (is_null($overridenPaymentDescription)) { + array_push($this->openAPINullablesSetToNull, 'overridenPaymentDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overridenPaymentDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($overridenPaymentDescription) && (mb_strlen($overridenPaymentDescription) > 150)) { + throw new InvalidArgumentException('invalid length for $overridenPaymentDescription when calling Leave., must be smaller than or equal to 150.'); + } + + $this->container['overridenPaymentDescription'] = $overridenPaymentDescription; + + return $this; + } + + /** + * Gets workingDays + * + * @return float|null + */ + public function getWorkingDays(): ?float + { + return $this->container['workingDays']; + } + + /** + * Sets workingDays + * + * @param float|null $workingDays [readonly] The number of working days covered by this leave. This is calculated based on the employees Working Pattern. + * + * @return $this + */ + public function setWorkingDays(?float $workingDays): static + { + if (is_null($workingDays)) { + throw new InvalidArgumentException('non-nullable workingDays cannot be null'); + } + $this->container['workingDays'] = $workingDays; + + return $this; + } + + /** + * Gets workingDaysOverride + * + * @return float|null + */ + public function getWorkingDaysOverride(): ?float + { + return $this->container['workingDaysOverride']; + } + + /** + * Sets workingDaysOverride + * + * @param float|null $workingDaysOverride If a value is provided here then this will be used in place of the calculated WorkingDays value + * + * @return $this + */ + public function setWorkingDaysOverride(?float $workingDaysOverride): static + { + if (is_null($workingDaysOverride)) { + array_push($this->openAPINullablesSetToNull, 'workingDaysOverride'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workingDaysOverride', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workingDaysOverride'] = $workingDaysOverride; + + return $this; + } + + /** + * Gets totalDays + * + * @return float|null + */ + public function getTotalDays(): ?float + { + return $this->container['totalDays']; + } + + /** + * Sets totalDays + * + * @param float|null $totalDays [readonly] The number of days covered by this leave, regardless of whether or not they're working days. This is calculated based on the employees Working Pattern. + * + * @return $this + */ + public function setTotalDays(?float $totalDays): static + { + if (is_null($totalDays)) { + throw new InvalidArgumentException('non-nullable totalDays cannot be null'); + } + $this->container['totalDays'] = $totalDays; + + return $this; + } + + /** + * Gets totalDaysOverride + * + * @return float|null + */ + public function getTotalDaysOverride(): ?float + { + return $this->container['totalDaysOverride']; + } + + /** + * Sets totalDaysOverride + * + * @param float|null $totalDaysOverride If a value is provided here then this will be used in place of the calculated TotalDays value + * + * @return $this + */ + public function setTotalDaysOverride(?float $totalDaysOverride): static + { + if (is_null($totalDaysOverride)) { + array_push($this->openAPINullablesSetToNull, 'totalDaysOverride'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalDaysOverride', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalDaysOverride'] = $totalDaysOverride; + + return $this; + } + + /** + * Gets useAssumedPensionablePay + * + * @return bool|null + */ + public function getUseAssumedPensionablePay(): ?bool + { + return $this->container['useAssumedPensionablePay']; + } + + /** + * Sets useAssumedPensionablePay + * + * @param bool|null $useAssumedPensionablePay If this Leave has Statutory Pay then if this is set to True we will use the value set in AssumedPensionablePay to work out the employer pension contributions + * + * @return $this + */ + public function setUseAssumedPensionablePay(?bool $useAssumedPensionablePay): static + { + if (is_null($useAssumedPensionablePay)) { + throw new InvalidArgumentException('non-nullable useAssumedPensionablePay cannot be null'); + } + $this->container['useAssumedPensionablePay'] = $useAssumedPensionablePay; + + return $this; + } + + /** + * Gets assumedPensionablePays + * + * @return \SynergiTech\Staffology\Model\LeaveAssumedPensionablePay[]|null + */ + public function getAssumedPensionablePays(): ?array + { + return $this->container['assumedPensionablePays']; + } + + /** + * Sets assumedPensionablePays + * + * @param \SynergiTech\Staffology\Model\LeaveAssumedPensionablePay[]|null $assumedPensionablePays if UseAssumedPensionablePay is True, then this is the value used to calculate the employer pension contributions + * + * @return $this + */ + public function setAssumedPensionablePays(?array $assumedPensionablePays): static + { + if (is_null($assumedPensionablePays)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePays'] = $assumedPensionablePays; + + return $this; + } + + /** + * Gets offsetPay + * + * @return bool|null + */ + public function getOffsetPay(): ?bool + { + return $this->container['offsetPay']; + } + + /** + * Sets offsetPay + * + * @param bool|null $offsetPay If this Leave has Statutory Pay and this is set to True and the employe eis paid a fixed amoutn per period with Leave Adjustments set to automatic, then we'll reduce their pay for the period by the statutory amount so the employee still gets paid the full amount. + * + * @return $this + */ + public function setOffsetPay(?bool $offsetPay): static + { + if (is_null($offsetPay)) { + throw new InvalidArgumentException('non-nullable offsetPay cannot be null'); + } + $this->container['offsetPay'] = $offsetPay; + + return $this; + } + + /** + * Gets sspPayFromDayOne + * + * @return bool|null + */ + public function getSspPayFromDayOne(): ?bool + { + return $this->container['sspPayFromDayOne']; + } + + /** + * Sets sspPayFromDayOne + * + * @param bool|null $sspPayFromDayOne If this is Sick Leave with Statutory Pay then setting this to true will force SSP to be paid from day one rather than the usual rule of the first Working Day after 3 Qualifying Days + * + * @return $this + */ + public function setSspPayFromDayOne(?bool $sspPayFromDayOne): static + { + if (is_null($sspPayFromDayOne)) { + throw new InvalidArgumentException('non-nullable sspPayFromDayOne cannot be null'); + } + $this->container['sspPayFromDayOne'] = $sspPayFromDayOne; + + return $this; + } + + /** + * Gets linkedPiw + * + * @return \SynergiTech\Staffology\Model\LinkedPiw|null + */ + public function getLinkedPiw(): ?\SynergiTech\Staffology\Model\LinkedPiw + { + return $this->container['linkedPiw']; + } + + /** + * Sets linkedPiw + * + * @param \SynergiTech\Staffology\Model\LinkedPiw|null $linkedPiw linkedPiw + * + * @return $this + */ + public function setLinkedPiw(?\SynergiTech\Staffology\Model\LinkedPiw $linkedPiw): static + { + if (is_null($linkedPiw)) { + throw new InvalidArgumentException('non-nullable linkedPiw cannot be null'); + } + $this->container['linkedPiw'] = $linkedPiw; + + return $this; + } + + /** + * Gets kitSplitDays + * + * @return \DateTime[]|null + */ + public function getKitSplitDays(): ?array + { + return $this->container['kitSplitDays']; + } + + /** + * Sets kitSplitDays + * + * @param \DateTime[]|null $kitSplitDays If the LeaveType supports KIT/SPLIT days then use this property to store the list of dates + * + * @return $this + */ + public function setKitSplitDays(?array $kitSplitDays): static + { + if (is_null($kitSplitDays)) { + array_push($this->openAPINullablesSetToNull, 'kitSplitDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('kitSplitDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['kitSplitDays'] = $kitSplitDays; + + return $this; + } + + /** + * Gets historicSspRequiresProcessing + * + * @return bool|null + */ + public function getHistoricSspRequiresProcessing(): ?bool + { + return $this->container['historicSspRequiresProcessing']; + } + + /** + * Sets historicSspRequiresProcessing + * + * @param bool|null $historicSspRequiresProcessing Only used during the creation of historical SSP. When creating historical SSP, this will determine whether to pay that leave in the next PayRun. + * + * @return $this + */ + public function setHistoricSspRequiresProcessing(?bool $historicSspRequiresProcessing): static + { + if (is_null($historicSspRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicSspRequiresProcessing cannot be null'); + } + $this->container['historicSspRequiresProcessing'] = $historicSspRequiresProcessing; + + return $this; + } + + /** + * Gets historicSxpRequiresProcessing + * + * @return bool|null + */ + public function getHistoricSxpRequiresProcessing(): ?bool + { + return $this->container['historicSxpRequiresProcessing']; + } + + /** + * Sets historicSxpRequiresProcessing + * + * @param bool|null $historicSxpRequiresProcessing Used during to determine whether to back pay before current payrun + * + * @return $this + */ + public function setHistoricSxpRequiresProcessing(?bool $historicSxpRequiresProcessing): static + { + if (is_null($historicSxpRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicSxpRequiresProcessing cannot be null'); + } + $this->container['historicSxpRequiresProcessing'] = $historicSxpRequiresProcessing; + + return $this; + } + + /** + * Gets openingPay + * + * @return float|null + */ + public function getOpeningPay(): ?float + { + return $this->container['openingPay']; + } + + /** + * Sets openingPay + * + * @param float|null $openingPay Opening pay which has already been paid to the employee in another system + * + * @return $this + */ + public function setOpeningPay(?float $openingPay): static + { + if (is_null($openingPay)) { + array_push($this->openAPINullablesSetToNull, 'openingPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('openingPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['openingPay'] = $openingPay; + + return $this; + } + + /** + * Gets useOpeningPay + * + * @return bool|null + */ + public function getUseOpeningPay(): ?bool + { + return $this->container['useOpeningPay']; + } + + /** + * Sets useOpeningPay + * + * @param bool|null $useOpeningPay Use the OpeningPay which has already been paid in another system + * + * @return $this + */ + public function setUseOpeningPay(?bool $useOpeningPay): static + { + if (is_null($useOpeningPay)) { + throw new InvalidArgumentException('non-nullable useOpeningPay cannot be null'); + } + $this->container['useOpeningPay'] = $useOpeningPay; + + return $this; + } + + /** + * Gets historicOspRequiresProcessing + * + * @return bool|null + */ + public function getHistoricOspRequiresProcessing(): ?bool + { + return $this->container['historicOspRequiresProcessing']; + } + + /** + * Sets historicOspRequiresProcessing + * + * @param bool|null $historicOspRequiresProcessing Only used during the creation of sickness Occupational Policy. When creating historical SOP, this will determine whether to pay that leave in the next PayRun. + * + * @return $this + */ + public function setHistoricOspRequiresProcessing(?bool $historicOspRequiresProcessing): static + { + if (is_null($historicOspRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicOspRequiresProcessing cannot be null'); + } + $this->container['historicOspRequiresProcessing'] = $historicOspRequiresProcessing; + + return $this; + } + + /** + * Gets historicOmpRequiresProcessing + * + * @return bool|null + */ + public function getHistoricOmpRequiresProcessing(): ?bool + { + return $this->container['historicOmpRequiresProcessing']; + } + + /** + * Sets historicOmpRequiresProcessing + * + * @param bool|null $historicOmpRequiresProcessing Only used during the creation and update of occupational maternity leaves. When creating or updating historical occupational leaves, this will determine whether to pay the historic payments or correction in the next PayRun. + * + * @return $this + */ + public function setHistoricOmpRequiresProcessing(?bool $historicOmpRequiresProcessing): static + { + if (is_null($historicOmpRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicOmpRequiresProcessing cannot be null'); + } + $this->container['historicOmpRequiresProcessing'] = $historicOmpRequiresProcessing; + + return $this; + } + + /** + * Gets historicSmpRequiresProcessing + * + * @return bool|null + */ + public function getHistoricSmpRequiresProcessing(): ?bool + { + return $this->container['historicSmpRequiresProcessing']; + } + + /** + * Sets historicSmpRequiresProcessing + * + * @param bool|null $historicSmpRequiresProcessing Only used during the creation and update of statutory maternity leaves. When creating or updating historical statutory maternity leaves, this will determine whether to pay the historic payments or correction in the next PayRun. + * + * @return $this + */ + public function setHistoricSmpRequiresProcessing(?bool $historicSmpRequiresProcessing): static + { + if (is_null($historicSmpRequiresProcessing)) { + throw new InvalidArgumentException('non-nullable historicSmpRequiresProcessing cannot be null'); + } + $this->container['historicSmpRequiresProcessing'] = $historicSmpRequiresProcessing; + + return $this; + } + + /** + * Gets occupationalMaternityPolicyUniqueId + * + * @return string|null + */ + public function getOccupationalMaternityPolicyUniqueId(): ?string + { + return $this->container['occupationalMaternityPolicyUniqueId']; + } + + /** + * Sets occupationalMaternityPolicyUniqueId + * + * @param string|null $occupationalMaternityPolicyUniqueId Occupational Maternity Policy Id when leave type is Maternity and payment type is occupational policy + * + * @return $this + */ + public function setOccupationalMaternityPolicyUniqueId(?string $occupationalMaternityPolicyUniqueId): static + { + if (is_null($occupationalMaternityPolicyUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalMaternityPolicyUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalMaternityPolicyUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalMaternityPolicyUniqueId'] = $occupationalMaternityPolicyUniqueId; + + return $this; + } + + /** + * Gets openingOmpPay + * + * @return float|null + */ + public function getOpeningOmpPay(): ?float + { + return $this->container['openingOmpPay']; + } + + /** + * Sets openingOmpPay + * + * @param float|null $openingOmpPay Opening occupational pay which has already been paid to the employee + * + * @return $this + */ + public function setOpeningOmpPay(?float $openingOmpPay): static + { + if (is_null($openingOmpPay)) { + array_push($this->openAPINullablesSetToNull, 'openingOmpPay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('openingOmpPay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['openingOmpPay'] = $openingOmpPay; + + return $this; + } + + /** + * Gets payRunExistsWithOccMaternityPay + * + * @return bool|null + */ + public function getPayRunExistsWithOccMaternityPay(): ?bool + { + return $this->container['payRunExistsWithOccMaternityPay']; + } + + /** + * Sets payRunExistsWithOccMaternityPay + * + * @param bool|null $payRunExistsWithOccMaternityPay Indicates whether there is occupational maternity payment associated with a leave in the current pay run. + * + * @return $this + */ + public function setPayRunExistsWithOccMaternityPay(?bool $payRunExistsWithOccMaternityPay): static + { + if (is_null($payRunExistsWithOccMaternityPay)) { + throw new InvalidArgumentException('non-nullable payRunExistsWithOccMaternityPay cannot be null'); + } + $this->container['payRunExistsWithOccMaternityPay'] = $payRunExistsWithOccMaternityPay; + + return $this; + } + + /** + * Gets calculationType + * + * @return \SynergiTech\Staffology\Model\LeaveCalculationType|null + */ + public function getCalculationType(): ?\SynergiTech\Staffology\Model\LeaveCalculationType + { + return $this->container['calculationType']; + } + + /** + * Sets calculationType + * + * @param \SynergiTech\Staffology\Model\LeaveCalculationType|null $calculationType calculationType + * + * @return $this + */ + public function setCalculationType(?\SynergiTech\Staffology\Model\LeaveCalculationType $calculationType): static + { + if (is_null($calculationType)) { + throw new InvalidArgumentException('non-nullable calculationType cannot be null'); + } + $this->container['calculationType'] = $calculationType; + + return $this; + } + + /** + * Gets strikeHoursToDeduct + * + * @return float|null + */ + public function getStrikeHoursToDeduct(): ?float + { + return $this->container['strikeHoursToDeduct']; + } + + /** + * Sets strikeHoursToDeduct + * + * @param float|null $strikeHoursToDeduct The number of hours to be deducted at the employee's contractual rate This property is valid for strike deducted hours + * + * @return $this + */ + public function setStrikeHoursToDeduct(?float $strikeHoursToDeduct): static + { + if (is_null($strikeHoursToDeduct)) { + array_push($this->openAPINullablesSetToNull, 'strikeHoursToDeduct'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('strikeHoursToDeduct', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['strikeHoursToDeduct'] = $strikeHoursToDeduct; + + return $this; + } + + /** + * Gets customPayments + * + * @return \SynergiTech\Staffology\Model\LeaveCustomPayment[]|null + */ + public function getCustomPayments(): ?array + { + return $this->container['customPayments']; + } + + /** + * Sets customPayments + * + * @param \SynergiTech\Staffology\Model\LeaveCustomPayment[]|null $customPayments If this is Sick Leave with Custom Payment, then this stores the RoleId, PercentOfPay and PaySSPInAddition for each role assigned to an employee that did not end before the start date of the absence. + * + * @return $this + */ + public function setCustomPayments(?array $customPayments): static + { + if (is_null($customPayments)) { + array_push($this->openAPINullablesSetToNull, 'customPayments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customPayments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customPayments'] = $customPayments; + + return $this; + } + + /** + * Gets customProRataRules + * + * @return \SynergiTech\Staffology\Model\LeaveCustomProRataRule[]|null + */ + public function getCustomProRataRules(): ?array + { + return $this->container['customProRataRules']; + } + + /** + * Sets customProRataRules + * + * @param \SynergiTech\Staffology\Model\LeaveCustomProRataRule[]|null $customProRataRules If this is a Leave that supports changing the pro rata at leave level, This stores the RoleId and ProRataMethod for each role assigned to an employee that did not end before the start date of the absence. + * + * @return $this + */ + public function setCustomProRataRules(?array $customProRataRules): static + { + if (is_null($customProRataRules)) { + array_push($this->openAPINullablesSetToNull, 'customProRataRules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customProRataRules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customProRataRules'] = $customProRataRules; + + return $this; + } + + /** + * Gets lastProcessedFrom + * + * @return \DateTime|null + */ + public function getLastProcessedFrom(): ?\DateTime + { + return $this->container['lastProcessedFrom']; + } + + /** + * Sets lastProcessedFrom + * + * @param \DateTime|null $lastProcessedFrom [readonly] Last Processed From Date If this Leave has already been processed, this will be the original leave from date + * + * @return $this + */ + public function setLastProcessedFrom(?\DateTime $lastProcessedFrom): static + { + if (is_null($lastProcessedFrom)) { + array_push($this->openAPINullablesSetToNull, 'lastProcessedFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastProcessedFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastProcessedFrom'] = $lastProcessedFrom; + + return $this; + } + + /** + * Gets isReversed + * + * @return bool|null + */ + public function getIsReversed(): ?bool + { + return $this->container['isReversed']; + } + + /** + * Sets isReversed + * + * @param bool|null $isReversed If the reversal of this Leave has already been processed, this will be set to true + * + * @return $this + */ + public function setIsReversed(?bool $isReversed): static + { + if (is_null($isReversed)) { + throw new InvalidArgumentException('non-nullable isReversed cannot be null'); + } + $this->container['isReversed'] = $isReversed; + + return $this; + } + + /** + * Gets documentCount + * + * @return int|null + */ + public function getDocumentCount(): ?int + { + return $this->container['documentCount']; + } + + /** + * Sets documentCount + * + * @param int|null $documentCount [readonly] The number of attachments associated with this model + * + * @return $this + */ + public function setDocumentCount(?int $documentCount): static + { + if (is_null($documentCount)) { + throw new InvalidArgumentException('non-nullable documentCount cannot be null'); + } + $this->container['documentCount'] = $documentCount; + + return $this; + } + + /** + * Gets documents + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getDocuments(): ?array + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \SynergiTech\Staffology\Model\Item[]|null $documents [readonly] The attachments associated with this model + * + * @return $this + */ + public function setDocuments(?array $documents): static + { + if (is_null($documents)) { + array_push($this->openAPINullablesSetToNull, 'documents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LeaveAssumedPensionablePay.php b/src/Model/LeaveAssumedPensionablePay.php new file mode 100644 index 0000000..21e2043 --- /dev/null +++ b/src/Model/LeaveAssumedPensionablePay.php @@ -0,0 +1,592 @@ + + */ +class LeaveAssumedPensionablePay implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeaveAssumedPensionablePay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'roleReference' => 'string', + 'roleId' => 'string', + 'isPrimary' => 'bool', + 'assumedPensionablePay' => 'float', + 'automaticAPPCalculation' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'roleReference' => null, + 'roleId' => 'uuid', + 'isPrimary' => null, + 'assumedPensionablePay' => 'double', + 'automaticAPPCalculation' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'roleReference' => true, + 'roleId' => false, + 'isPrimary' => false, + 'assumedPensionablePay' => true, + 'automaticAPPCalculation' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'roleReference' => 'roleReference', + 'roleId' => 'roleId', + 'isPrimary' => 'isPrimary', + 'assumedPensionablePay' => 'assumedPensionablePay', + 'automaticAPPCalculation' => 'automaticAPPCalculation', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'roleReference' => 'setRoleReference', + 'roleId' => 'setRoleId', + 'isPrimary' => 'setIsPrimary', + 'assumedPensionablePay' => 'setAssumedPensionablePay', + 'automaticAPPCalculation' => 'setAutomaticAPPCalculation', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'roleReference' => 'getRoleReference', + 'roleId' => 'getRoleId', + 'isPrimary' => 'getIsPrimary', + 'assumedPensionablePay' => 'getAssumedPensionablePay', + 'automaticAPPCalculation' => 'getAutomaticAPPCalculation', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('roleReference', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('isPrimary', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + $this->setIfExists('automaticAPPCalculation', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets roleReference + * + * @return string|null + */ + public function getRoleReference(): ?string + { + return $this->container['roleReference']; + } + + /** + * Sets roleReference + * + * @param string|null $roleReference Employee role reference + * + * @return $this + */ + public function setRoleReference(?string $roleReference): static + { + if (is_null($roleReference)) { + array_push($this->openAPINullablesSetToNull, 'roleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleReference'] = $roleReference; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId Employee role unique Id + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + throw new InvalidArgumentException('non-nullable roleId cannot be null'); + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets isPrimary + * + * @return bool|null + */ + public function getIsPrimary(): ?bool + { + return $this->container['isPrimary']; + } + + /** + * Sets isPrimary + * + * @param bool|null $isPrimary Boolean flag indicates if the role is primary + * + * @return $this + */ + public function setIsPrimary(?bool $isPrimary): static + { + if (is_null($isPrimary)) { + throw new InvalidArgumentException('non-nullable isPrimary cannot be null'); + } + $this->container['isPrimary'] = $isPrimary; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float|null + */ + public function getAssumedPensionablePay(): ?float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float|null $assumedPensionablePay Assumed Pensionable Pay (APP) is an average figure, calculated as the average pay in the 3 months (or 12 weeks if weekly/fortnightly/fourweekly paid) before the absence + * + * @return $this + */ + public function setAssumedPensionablePay(?float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + + /** + * Gets automaticAPPCalculation + * + * @return bool|null + */ + public function getAutomaticAPPCalculation(): ?bool + { + return $this->container['automaticAPPCalculation']; + } + + /** + * Sets automaticAPPCalculation + * + * @param bool|null $automaticAPPCalculation If set to True then we'll automatically calculate the AssumedPensionablePay. Set it to false if you want to manually provide a figure that overrides our calculations + * + * @return $this + */ + public function setAutomaticAPPCalculation(?bool $automaticAPPCalculation): static + { + if (is_null($automaticAPPCalculation)) { + throw new InvalidArgumentException('non-nullable automaticAPPCalculation cannot be null'); + } + $this->container['automaticAPPCalculation'] = $automaticAPPCalculation; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LeaveCalculationType.php b/src/Model/LeaveCalculationType.php new file mode 100644 index 0000000..3a4e601 --- /dev/null +++ b/src/Model/LeaveCalculationType.php @@ -0,0 +1,51 @@ + + */ +class LeaveCustomPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeaveCustomPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'roleId' => 'string', + 'percentOfPay' => 'float', + 'paySSPInAddition' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'roleId' => 'uuid', + 'percentOfPay' => 'double', + 'paySSPInAddition' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'roleId' => false, + 'percentOfPay' => false, + 'paySSPInAddition' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'roleId' => 'roleId', + 'percentOfPay' => 'percentOfPay', + 'paySSPInAddition' => 'paySSPInAddition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'roleId' => 'setRoleId', + 'percentOfPay' => 'setPercentOfPay', + 'paySSPInAddition' => 'setPaySSPInAddition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'roleId' => 'getRoleId', + 'percentOfPay' => 'getPercentOfPay', + 'paySSPInAddition' => 'getPaySSPInAddition' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('percentOfPay', $data ?? [], null); + $this->setIfExists('paySSPInAddition', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId roleId + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + throw new InvalidArgumentException('non-nullable roleId cannot be null'); + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets percentOfPay + * + * @return float|null + */ + public function getPercentOfPay(): ?float + { + return $this->container['percentOfPay']; + } + + /** + * Sets percentOfPay + * + * @param float|null $percentOfPay If this is Sick Leave with Custom Payment, the user will input the desired impact on the employee’s pay, per role. This will be via an amount between 0-100 in 'Pay for Absence'. The employees pay will be fully reduced for the absence, and the % paid will be added back using the OSP pay code. + * + * @return $this + */ + public function setPercentOfPay(?float $percentOfPay): static + { + if (is_null($percentOfPay)) { + throw new InvalidArgumentException('non-nullable percentOfPay cannot be null'); + } + $this->container['percentOfPay'] = $percentOfPay; + + return $this; + } + + /** + * Gets paySSPInAddition + * + * @return bool|null + */ + public function getPaySSPInAddition(): ?bool + { + return $this->container['paySSPInAddition']; + } + + /** + * Sets paySSPInAddition + * + * @param bool|null $paySSPInAddition If this is Sick Leave with Custom Payment, If true, then reduce the OSP by the amount of SSP paid (and apportioned according to role weighting) If false, then do not reduce the OSP at all. + * + * @return $this + */ + public function setPaySSPInAddition(?bool $paySSPInAddition): static + { + if (is_null($paySSPInAddition)) { + throw new InvalidArgumentException('non-nullable paySSPInAddition cannot be null'); + } + $this->container['paySSPInAddition'] = $paySSPInAddition; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LeaveCustomProRataRule.php b/src/Model/LeaveCustomProRataRule.php new file mode 100644 index 0000000..2bb6782 --- /dev/null +++ b/src/Model/LeaveCustomProRataRule.php @@ -0,0 +1,442 @@ + + */ +class LeaveCustomProRataRule implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeaveCustomProRataRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'roleId' => 'string', + 'proRataMethod' => '\SynergiTech\Staffology\Model\LeaveProRataRule' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'roleId' => 'uuid', + 'proRataMethod' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'roleId' => false, + 'proRataMethod' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'roleId' => 'roleId', + 'proRataMethod' => 'proRataMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'roleId' => 'setRoleId', + 'proRataMethod' => 'setProRataMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'roleId' => 'getRoleId', + 'proRataMethod' => 'getProRataMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('proRataMethod', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId roleId + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + throw new InvalidArgumentException('non-nullable roleId cannot be null'); + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets proRataMethod + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getProRataMethod(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['proRataMethod']; + } + + /** + * Sets proRataMethod + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $proRataMethod proRataMethod + * + * @return $this + */ + public function setProRataMethod(?\SynergiTech\Staffology\Model\LeaveProRataRule $proRataMethod): static + { + if (is_null($proRataMethod)) { + throw new InvalidArgumentException('non-nullable proRataMethod cannot be null'); + } + $this->container['proRataMethod'] = $proRataMethod; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LeavePayType.php b/src/Model/LeavePayType.php new file mode 100644 index 0000000..5330362 --- /dev/null +++ b/src/Model/LeavePayType.php @@ -0,0 +1,51 @@ + + */ +class LeaveSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeaveSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'useDefaultHolidayType' => 'bool', + 'useDefaultAllowanceResetDate' => 'bool', + 'useDefaultAllowance' => 'bool', + 'useDefaultAccruePaymentInLieu' => 'bool', + 'useDefaultAccruePaymentInLieuRate' => 'bool', + 'useDefaultHolidayAccrualBasis' => 'bool', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'bool', + 'useDefaultAccrueHoursPerDay' => 'bool', + 'useDefaultMaximumAccruePeriod' => 'bool', + 'allowanceResetDate' => '\DateTime', + 'allowance' => 'float', + 'adjustment' => 'float', + 'allowanceUsed' => 'float', + 'allowanceUsedPreviousPeriod' => 'float', + 'allowanceRemaining' => 'float', + 'holidayType' => '\SynergiTech\Staffology\Model\HolidayType', + 'accrueSetAmount' => 'bool', + 'accrueHoursPerDay' => 'float', + 'showAllowanceOnPayslip' => 'bool', + 'showAhpOnPayslip' => 'bool', + 'accruePaymentInLieuRate' => 'float', + 'accruePaymentInLieuAllGrossPay' => 'bool', + 'accruePaymentInLieuPayAutomatically' => 'bool', + 'accruePayCodeSetUniqueId' => 'string', + 'maximumAccruePeriod' => 'float', + 'holidayAccrualBasis' => '\SynergiTech\Staffology\Model\HolidayAccrual', + 'holidayAccrualDefaultRateType' => '\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType', + 'occupationalSicknessUniqueId' => 'string', + 'accruedPaymentLiability' => 'float', + 'accruedPaymentAdjustment' => 'float', + 'accruedPaymentPaid' => 'float', + 'accruedPaymentBalance' => 'float', + 'accruedHoursAmount' => 'float', + 'accruedHoursAdjustment' => 'float', + 'accruedHoursPaid' => 'float', + 'accruedHoursAmountLastPeriod' => 'float', + 'paidHoursAmountLastPeriod' => 'float', + 'accruedHoursBalance' => 'float', + 'aggregatedServiceDate' => '\DateTime', + 'useAggregatedServiceDate' => 'bool', + 'useDefaultHolidayAccrualDefaultRateType' => 'bool', + 'unauthorisedLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'holidayLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'sickLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'parentalLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule', + 'bereavementLeaveProRataRule' => '\SynergiTech\Staffology\Model\LeaveProRataRule' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'useDefaultHolidayType' => null, + 'useDefaultAllowanceResetDate' => null, + 'useDefaultAllowance' => null, + 'useDefaultAccruePaymentInLieu' => null, + 'useDefaultAccruePaymentInLieuRate' => null, + 'useDefaultHolidayAccrualBasis' => null, + 'useDefaultAccruePaymentInLieuPayAutomatically' => null, + 'useDefaultAccrueHoursPerDay' => null, + 'useDefaultMaximumAccruePeriod' => null, + 'allowanceResetDate' => 'date', + 'allowance' => 'double', + 'adjustment' => 'double', + 'allowanceUsed' => 'double', + 'allowanceUsedPreviousPeriod' => 'double', + 'allowanceRemaining' => 'double', + 'holidayType' => null, + 'accrueSetAmount' => null, + 'accrueHoursPerDay' => 'double', + 'showAllowanceOnPayslip' => null, + 'showAhpOnPayslip' => null, + 'accruePaymentInLieuRate' => 'double', + 'accruePaymentInLieuAllGrossPay' => null, + 'accruePaymentInLieuPayAutomatically' => null, + 'accruePayCodeSetUniqueId' => 'uuid', + 'maximumAccruePeriod' => 'double', + 'holidayAccrualBasis' => null, + 'holidayAccrualDefaultRateType' => null, + 'occupationalSicknessUniqueId' => 'uuid', + 'accruedPaymentLiability' => 'double', + 'accruedPaymentAdjustment' => 'double', + 'accruedPaymentPaid' => 'double', + 'accruedPaymentBalance' => 'double', + 'accruedHoursAmount' => 'double', + 'accruedHoursAdjustment' => 'double', + 'accruedHoursPaid' => 'double', + 'accruedHoursAmountLastPeriod' => 'double', + 'paidHoursAmountLastPeriod' => 'double', + 'accruedHoursBalance' => 'double', + 'aggregatedServiceDate' => 'date', + 'useAggregatedServiceDate' => null, + 'useDefaultHolidayAccrualDefaultRateType' => null, + 'unauthorisedLeaveProRataRule' => null, + 'holidayLeaveProRataRule' => null, + 'sickLeaveProRataRule' => null, + 'parentalLeaveProRataRule' => null, + 'bereavementLeaveProRataRule' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'useDefaultHolidayType' => false, + 'useDefaultAllowanceResetDate' => false, + 'useDefaultAllowance' => false, + 'useDefaultAccruePaymentInLieu' => false, + 'useDefaultAccruePaymentInLieuRate' => false, + 'useDefaultHolidayAccrualBasis' => false, + 'useDefaultAccruePaymentInLieuPayAutomatically' => false, + 'useDefaultAccrueHoursPerDay' => false, + 'useDefaultMaximumAccruePeriod' => false, + 'allowanceResetDate' => false, + 'allowance' => false, + 'adjustment' => true, + 'allowanceUsed' => false, + 'allowanceUsedPreviousPeriod' => false, + 'allowanceRemaining' => false, + 'holidayType' => false, + 'accrueSetAmount' => false, + 'accrueHoursPerDay' => false, + 'showAllowanceOnPayslip' => false, + 'showAhpOnPayslip' => false, + 'accruePaymentInLieuRate' => false, + 'accruePaymentInLieuAllGrossPay' => false, + 'accruePaymentInLieuPayAutomatically' => false, + 'accruePayCodeSetUniqueId' => true, + 'maximumAccruePeriod' => true, + 'holidayAccrualBasis' => false, + 'holidayAccrualDefaultRateType' => false, + 'occupationalSicknessUniqueId' => true, + 'accruedPaymentLiability' => false, + 'accruedPaymentAdjustment' => false, + 'accruedPaymentPaid' => false, + 'accruedPaymentBalance' => false, + 'accruedHoursAmount' => false, + 'accruedHoursAdjustment' => false, + 'accruedHoursPaid' => false, + 'accruedHoursAmountLastPeriod' => false, + 'paidHoursAmountLastPeriod' => false, + 'accruedHoursBalance' => false, + 'aggregatedServiceDate' => true, + 'useAggregatedServiceDate' => false, + 'useDefaultHolidayAccrualDefaultRateType' => false, + 'unauthorisedLeaveProRataRule' => false, + 'holidayLeaveProRataRule' => false, + 'sickLeaveProRataRule' => false, + 'parentalLeaveProRataRule' => false, + 'bereavementLeaveProRataRule' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'useDefaultHolidayType' => 'useDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'useDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'useDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'useDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'useDefaultAccruePaymentInLieuRate', + 'useDefaultHolidayAccrualBasis' => 'useDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'useDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'useDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'useDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'allowanceResetDate', + 'allowance' => 'allowance', + 'adjustment' => 'adjustment', + 'allowanceUsed' => 'allowanceUsed', + 'allowanceUsedPreviousPeriod' => 'allowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'allowanceRemaining', + 'holidayType' => 'holidayType', + 'accrueSetAmount' => 'accrueSetAmount', + 'accrueHoursPerDay' => 'accrueHoursPerDay', + 'showAllowanceOnPayslip' => 'showAllowanceOnPayslip', + 'showAhpOnPayslip' => 'showAhpOnPayslip', + 'accruePaymentInLieuRate' => 'accruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'accruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'accruePaymentInLieuPayAutomatically', + 'accruePayCodeSetUniqueId' => 'accruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'maximumAccruePeriod', + 'holidayAccrualBasis' => 'holidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'holidayAccrualDefaultRateType', + 'occupationalSicknessUniqueId' => 'occupationalSicknessUniqueId', + 'accruedPaymentLiability' => 'accruedPaymentLiability', + 'accruedPaymentAdjustment' => 'accruedPaymentAdjustment', + 'accruedPaymentPaid' => 'accruedPaymentPaid', + 'accruedPaymentBalance' => 'accruedPaymentBalance', + 'accruedHoursAmount' => 'accruedHoursAmount', + 'accruedHoursAdjustment' => 'accruedHoursAdjustment', + 'accruedHoursPaid' => 'accruedHoursPaid', + 'accruedHoursAmountLastPeriod' => 'accruedHoursAmountLastPeriod', + 'paidHoursAmountLastPeriod' => 'paidHoursAmountLastPeriod', + 'accruedHoursBalance' => 'accruedHoursBalance', + 'aggregatedServiceDate' => 'aggregatedServiceDate', + 'useAggregatedServiceDate' => 'useAggregatedServiceDate', + 'useDefaultHolidayAccrualDefaultRateType' => 'useDefaultHolidayAccrualDefaultRateType', + 'unauthorisedLeaveProRataRule' => 'unauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'holidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'sickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'parentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'bereavementLeaveProRataRule' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'useDefaultHolidayType' => 'setUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'setUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'setUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'setUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'setUseDefaultAccruePaymentInLieuRate', + 'useDefaultHolidayAccrualBasis' => 'setUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'setUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'setUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'setUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'setAllowanceResetDate', + 'allowance' => 'setAllowance', + 'adjustment' => 'setAdjustment', + 'allowanceUsed' => 'setAllowanceUsed', + 'allowanceUsedPreviousPeriod' => 'setAllowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'setAllowanceRemaining', + 'holidayType' => 'setHolidayType', + 'accrueSetAmount' => 'setAccrueSetAmount', + 'accrueHoursPerDay' => 'setAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'setShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'setShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'setAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'setAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'setAccruePaymentInLieuPayAutomatically', + 'accruePayCodeSetUniqueId' => 'setAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'setMaximumAccruePeriod', + 'holidayAccrualBasis' => 'setHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'setHolidayAccrualDefaultRateType', + 'occupationalSicknessUniqueId' => 'setOccupationalSicknessUniqueId', + 'accruedPaymentLiability' => 'setAccruedPaymentLiability', + 'accruedPaymentAdjustment' => 'setAccruedPaymentAdjustment', + 'accruedPaymentPaid' => 'setAccruedPaymentPaid', + 'accruedPaymentBalance' => 'setAccruedPaymentBalance', + 'accruedHoursAmount' => 'setAccruedHoursAmount', + 'accruedHoursAdjustment' => 'setAccruedHoursAdjustment', + 'accruedHoursPaid' => 'setAccruedHoursPaid', + 'accruedHoursAmountLastPeriod' => 'setAccruedHoursAmountLastPeriod', + 'paidHoursAmountLastPeriod' => 'setPaidHoursAmountLastPeriod', + 'accruedHoursBalance' => 'setAccruedHoursBalance', + 'aggregatedServiceDate' => 'setAggregatedServiceDate', + 'useAggregatedServiceDate' => 'setUseAggregatedServiceDate', + 'useDefaultHolidayAccrualDefaultRateType' => 'setUseDefaultHolidayAccrualDefaultRateType', + 'unauthorisedLeaveProRataRule' => 'setUnauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'setHolidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'setSickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'setParentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'setBereavementLeaveProRataRule' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'useDefaultHolidayType' => 'getUseDefaultHolidayType', + 'useDefaultAllowanceResetDate' => 'getUseDefaultAllowanceResetDate', + 'useDefaultAllowance' => 'getUseDefaultAllowance', + 'useDefaultAccruePaymentInLieu' => 'getUseDefaultAccruePaymentInLieu', + 'useDefaultAccruePaymentInLieuRate' => 'getUseDefaultAccruePaymentInLieuRate', + 'useDefaultHolidayAccrualBasis' => 'getUseDefaultHolidayAccrualBasis', + 'useDefaultAccruePaymentInLieuPayAutomatically' => 'getUseDefaultAccruePaymentInLieuPayAutomatically', + 'useDefaultAccrueHoursPerDay' => 'getUseDefaultAccrueHoursPerDay', + 'useDefaultMaximumAccruePeriod' => 'getUseDefaultMaximumAccruePeriod', + 'allowanceResetDate' => 'getAllowanceResetDate', + 'allowance' => 'getAllowance', + 'adjustment' => 'getAdjustment', + 'allowanceUsed' => 'getAllowanceUsed', + 'allowanceUsedPreviousPeriod' => 'getAllowanceUsedPreviousPeriod', + 'allowanceRemaining' => 'getAllowanceRemaining', + 'holidayType' => 'getHolidayType', + 'accrueSetAmount' => 'getAccrueSetAmount', + 'accrueHoursPerDay' => 'getAccrueHoursPerDay', + 'showAllowanceOnPayslip' => 'getShowAllowanceOnPayslip', + 'showAhpOnPayslip' => 'getShowAhpOnPayslip', + 'accruePaymentInLieuRate' => 'getAccruePaymentInLieuRate', + 'accruePaymentInLieuAllGrossPay' => 'getAccruePaymentInLieuAllGrossPay', + 'accruePaymentInLieuPayAutomatically' => 'getAccruePaymentInLieuPayAutomatically', + 'accruePayCodeSetUniqueId' => 'getAccruePayCodeSetUniqueId', + 'maximumAccruePeriod' => 'getMaximumAccruePeriod', + 'holidayAccrualBasis' => 'getHolidayAccrualBasis', + 'holidayAccrualDefaultRateType' => 'getHolidayAccrualDefaultRateType', + 'occupationalSicknessUniqueId' => 'getOccupationalSicknessUniqueId', + 'accruedPaymentLiability' => 'getAccruedPaymentLiability', + 'accruedPaymentAdjustment' => 'getAccruedPaymentAdjustment', + 'accruedPaymentPaid' => 'getAccruedPaymentPaid', + 'accruedPaymentBalance' => 'getAccruedPaymentBalance', + 'accruedHoursAmount' => 'getAccruedHoursAmount', + 'accruedHoursAdjustment' => 'getAccruedHoursAdjustment', + 'accruedHoursPaid' => 'getAccruedHoursPaid', + 'accruedHoursAmountLastPeriod' => 'getAccruedHoursAmountLastPeriod', + 'paidHoursAmountLastPeriod' => 'getPaidHoursAmountLastPeriod', + 'accruedHoursBalance' => 'getAccruedHoursBalance', + 'aggregatedServiceDate' => 'getAggregatedServiceDate', + 'useAggregatedServiceDate' => 'getUseAggregatedServiceDate', + 'useDefaultHolidayAccrualDefaultRateType' => 'getUseDefaultHolidayAccrualDefaultRateType', + 'unauthorisedLeaveProRataRule' => 'getUnauthorisedLeaveProRataRule', + 'holidayLeaveProRataRule' => 'getHolidayLeaveProRataRule', + 'sickLeaveProRataRule' => 'getSickLeaveProRataRule', + 'parentalLeaveProRataRule' => 'getParentalLeaveProRataRule', + 'bereavementLeaveProRataRule' => 'getBereavementLeaveProRataRule' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('useDefaultHolidayType', $data ?? [], null); + $this->setIfExists('useDefaultAllowanceResetDate', $data ?? [], null); + $this->setIfExists('useDefaultAllowance', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieu', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualBasis', $data ?? [], null); + $this->setIfExists('useDefaultAccruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('useDefaultAccrueHoursPerDay', $data ?? [], null); + $this->setIfExists('useDefaultMaximumAccruePeriod', $data ?? [], null); + $this->setIfExists('allowanceResetDate', $data ?? [], null); + $this->setIfExists('allowance', $data ?? [], null); + $this->setIfExists('adjustment', $data ?? [], null); + $this->setIfExists('allowanceUsed', $data ?? [], null); + $this->setIfExists('allowanceUsedPreviousPeriod', $data ?? [], null); + $this->setIfExists('allowanceRemaining', $data ?? [], null); + $this->setIfExists('holidayType', $data ?? [], null); + $this->setIfExists('accrueSetAmount', $data ?? [], null); + $this->setIfExists('accrueHoursPerDay', $data ?? [], null); + $this->setIfExists('showAllowanceOnPayslip', $data ?? [], null); + $this->setIfExists('showAhpOnPayslip', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuRate', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuAllGrossPay', $data ?? [], null); + $this->setIfExists('accruePaymentInLieuPayAutomatically', $data ?? [], null); + $this->setIfExists('accruePayCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('maximumAccruePeriod', $data ?? [], null); + $this->setIfExists('holidayAccrualBasis', $data ?? [], null); + $this->setIfExists('holidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('occupationalSicknessUniqueId', $data ?? [], null); + $this->setIfExists('accruedPaymentLiability', $data ?? [], null); + $this->setIfExists('accruedPaymentAdjustment', $data ?? [], null); + $this->setIfExists('accruedPaymentPaid', $data ?? [], null); + $this->setIfExists('accruedPaymentBalance', $data ?? [], null); + $this->setIfExists('accruedHoursAmount', $data ?? [], null); + $this->setIfExists('accruedHoursAdjustment', $data ?? [], null); + $this->setIfExists('accruedHoursPaid', $data ?? [], null); + $this->setIfExists('accruedHoursAmountLastPeriod', $data ?? [], null); + $this->setIfExists('paidHoursAmountLastPeriod', $data ?? [], null); + $this->setIfExists('accruedHoursBalance', $data ?? [], null); + $this->setIfExists('aggregatedServiceDate', $data ?? [], null); + $this->setIfExists('useAggregatedServiceDate', $data ?? [], null); + $this->setIfExists('useDefaultHolidayAccrualDefaultRateType', $data ?? [], null); + $this->setIfExists('unauthorisedLeaveProRataRule', $data ?? [], null); + $this->setIfExists('holidayLeaveProRataRule', $data ?? [], null); + $this->setIfExists('sickLeaveProRataRule', $data ?? [], null); + $this->setIfExists('parentalLeaveProRataRule', $data ?? [], null); + $this->setIfExists('bereavementLeaveProRataRule', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets useDefaultHolidayType + * + * @return bool|null + */ + public function getUseDefaultHolidayType(): ?bool + { + return $this->container['useDefaultHolidayType']; + } + + /** + * Sets useDefaultHolidayType + * + * @param bool|null $useDefaultHolidayType If true then the value for HolidayType comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayType(?bool $useDefaultHolidayType): static + { + if (is_null($useDefaultHolidayType)) { + throw new InvalidArgumentException('non-nullable useDefaultHolidayType cannot be null'); + } + $this->container['useDefaultHolidayType'] = $useDefaultHolidayType; + + return $this; + } + + /** + * Gets useDefaultAllowanceResetDate + * + * @return bool|null + */ + public function getUseDefaultAllowanceResetDate(): ?bool + { + return $this->container['useDefaultAllowanceResetDate']; + } + + /** + * Sets useDefaultAllowanceResetDate + * + * @param bool|null $useDefaultAllowanceResetDate If true then the value for the AllowanceResetDate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowanceResetDate(?bool $useDefaultAllowanceResetDate): static + { + if (is_null($useDefaultAllowanceResetDate)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowanceResetDate cannot be null'); + } + $this->container['useDefaultAllowanceResetDate'] = $useDefaultAllowanceResetDate; + + return $this; + } + + /** + * Gets useDefaultAllowance + * + * @return bool|null + */ + public function getUseDefaultAllowance(): ?bool + { + return $this->container['useDefaultAllowance']; + } + + /** + * Sets useDefaultAllowance + * + * @param bool|null $useDefaultAllowance If true then the value for the Allowance comes from the Employer record. This property only appears if the LeaveSettings if a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAllowance(?bool $useDefaultAllowance): static + { + if (is_null($useDefaultAllowance)) { + throw new InvalidArgumentException('non-nullable useDefaultAllowance cannot be null'); + } + $this->container['useDefaultAllowance'] = $useDefaultAllowance; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieu + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieu(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieu']; + } + + /** + * Sets useDefaultAccruePaymentInLieu + * + * @param bool|null $useDefaultAccruePaymentInLieu If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieu(?bool $useDefaultAccruePaymentInLieu): static + { + if (is_null($useDefaultAccruePaymentInLieu)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieu cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieu'] = $useDefaultAccruePaymentInLieu; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuRate + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuRate(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuRate']; + } + + /** + * Sets useDefaultAccruePaymentInLieuRate + * + * @param bool|null $useDefaultAccruePaymentInLieuRate If true then the value for AccruePaymentInLieuRate comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuRate(?bool $useDefaultAccruePaymentInLieuRate): static + { + if (is_null($useDefaultAccruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuRate cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuRate'] = $useDefaultAccruePaymentInLieuRate; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualBasis + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualBasis(): ?bool + { + return $this->container['useDefaultHolidayAccrualBasis']; + } + + /** + * Sets useDefaultHolidayAccrualBasis + * + * @param bool|null $useDefaultHolidayAccrualBasis If true then the value for HolidayAccrualBasis comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultHolidayAccrualBasis(?bool $useDefaultHolidayAccrualBasis): static + { + if (is_null($useDefaultHolidayAccrualBasis)) { + throw new InvalidArgumentException('non-nullable useDefaultHolidayAccrualBasis cannot be null'); + } + $this->container['useDefaultHolidayAccrualBasis'] = $useDefaultHolidayAccrualBasis; + + return $this; + } + + /** + * Gets useDefaultAccruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getUseDefaultAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['useDefaultAccruePaymentInLieuPayAutomatically']; + } + + /** + * Sets useDefaultAccruePaymentInLieuPayAutomatically + * + * @param bool|null $useDefaultAccruePaymentInLieuPayAutomatically If true then the value for AccruePaymentInLieu comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccruePaymentInLieuPayAutomatically(?bool $useDefaultAccruePaymentInLieuPayAutomatically): static + { + if (is_null($useDefaultAccruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable useDefaultAccruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['useDefaultAccruePaymentInLieuPayAutomatically'] = $useDefaultAccruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets useDefaultAccrueHoursPerDay + * + * @return bool|null + */ + public function getUseDefaultAccrueHoursPerDay(): ?bool + { + return $this->container['useDefaultAccrueHoursPerDay']; + } + + /** + * Sets useDefaultAccrueHoursPerDay + * + * @param bool|null $useDefaultAccrueHoursPerDay If true then the value for AccrueHoursPerDay comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultAccrueHoursPerDay(?bool $useDefaultAccrueHoursPerDay): static + { + if (is_null($useDefaultAccrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable useDefaultAccrueHoursPerDay cannot be null'); + } + $this->container['useDefaultAccrueHoursPerDay'] = $useDefaultAccrueHoursPerDay; + + return $this; + } + + /** + * Gets useDefaultMaximumAccruePeriod + * + * @return bool|null + */ + public function getUseDefaultMaximumAccruePeriod(): ?bool + { + return $this->container['useDefaultMaximumAccruePeriod']; + } + + /** + * Sets useDefaultMaximumAccruePeriod + * + * @param bool|null $useDefaultMaximumAccruePeriod If true then the value for MaximumAccruePeriod comes from the Employer record. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setUseDefaultMaximumAccruePeriod(?bool $useDefaultMaximumAccruePeriod): static + { + if (is_null($useDefaultMaximumAccruePeriod)) { + throw new InvalidArgumentException('non-nullable useDefaultMaximumAccruePeriod cannot be null'); + } + $this->container['useDefaultMaximumAccruePeriod'] = $useDefaultMaximumAccruePeriod; + + return $this; + } + + /** + * Gets allowanceResetDate + * + * @return \DateTime|null + */ + public function getAllowanceResetDate(): ?\DateTime + { + return $this->container['allowanceResetDate']; + } + + /** + * Sets allowanceResetDate + * + * @param \DateTime|null $allowanceResetDate The date that the holiday allowance resets. Only the day/month part of the value is relevant. + * + * @return $this + */ + public function setAllowanceResetDate(?\DateTime $allowanceResetDate): static + { + if (is_null($allowanceResetDate)) { + throw new InvalidArgumentException('non-nullable allowanceResetDate cannot be null'); + } + $this->container['allowanceResetDate'] = $allowanceResetDate; + + return $this; + } + + /** + * Gets allowance + * + * @return float|null + */ + public function getAllowance(): ?float + { + return $this->container['allowance']; + } + + /** + * Sets allowance + * + * @param float|null $allowance The number of days holiday an employee can take per year if HolidayType is Days. Otherwise this is readonly and gives you the number of days accrued since the last reset + * + * @return $this + */ + public function setAllowance(?float $allowance): static + { + if (is_null($allowance)) { + throw new InvalidArgumentException('non-nullable allowance cannot be null'); + } + $this->container['allowance'] = $allowance; + + return $this; + } + + /** + * Gets adjustment + * + * @return float|null + */ + public function getAdjustment(): ?float + { + return $this->container['adjustment']; + } + + /** + * Sets adjustment + * + * @param float|null $adjustment Adjustment to number of hours/days/weeks holiday this employee can take per year. Will reset to 0 when the Allowance resets. This property only appears if the LeaveSettings is a child of an Employee (not of an Employer) + * + * @return $this + */ + public function setAdjustment(?float $adjustment): static + { + if (is_null($adjustment)) { + array_push($this->openAPINullablesSetToNull, 'adjustment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('adjustment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['adjustment'] = $adjustment; + + return $this; + } + + /** + * Gets allowanceUsed + * + * @return float|null + */ + public function getAllowanceUsed(): ?float + { + return $this->container['allowanceUsed']; + } + + /** + * Sets allowanceUsed + * + * @param float|null $allowanceUsed [readonly] The number of days used from the allowance since last reset + * + * @return $this + */ + public function setAllowanceUsed(?float $allowanceUsed): static + { + if (is_null($allowanceUsed)) { + throw new InvalidArgumentException('non-nullable allowanceUsed cannot be null'); + } + $this->container['allowanceUsed'] = $allowanceUsed; + + return $this; + } + + /** + * Gets allowanceUsedPreviousPeriod + * + * @return float|null + */ + public function getAllowanceUsedPreviousPeriod(): ?float + { + return $this->container['allowanceUsedPreviousPeriod']; + } + + /** + * Sets allowanceUsedPreviousPeriod + * + * @param float|null $allowanceUsedPreviousPeriod [readonly] The number of days used in the 12 months prior to the last reset + * + * @return $this + */ + public function setAllowanceUsedPreviousPeriod(?float $allowanceUsedPreviousPeriod): static + { + if (is_null($allowanceUsedPreviousPeriod)) { + throw new InvalidArgumentException('non-nullable allowanceUsedPreviousPeriod cannot be null'); + } + $this->container['allowanceUsedPreviousPeriod'] = $allowanceUsedPreviousPeriod; + + return $this; + } + + /** + * Gets allowanceRemaining + * + * @return float|null + */ + public function getAllowanceRemaining(): ?float + { + return $this->container['allowanceRemaining']; + } + + /** + * Sets allowanceRemaining + * + * @param float|null $allowanceRemaining [readonly] The number of days remaining of the allowance until next reset + * + * @return $this + */ + public function setAllowanceRemaining(?float $allowanceRemaining): static + { + if (is_null($allowanceRemaining)) { + throw new InvalidArgumentException('non-nullable allowanceRemaining cannot be null'); + } + $this->container['allowanceRemaining'] = $allowanceRemaining; + + return $this; + } + + /** + * Gets holidayType + * + * @return \SynergiTech\Staffology\Model\HolidayType|null + */ + public function getHolidayType(): ?\SynergiTech\Staffology\Model\HolidayType + { + return $this->container['holidayType']; + } + + /** + * Sets holidayType + * + * @param \SynergiTech\Staffology\Model\HolidayType|null $holidayType holidayType + * + * @return $this + */ + public function setHolidayType(?\SynergiTech\Staffology\Model\HolidayType $holidayType): static + { + if (is_null($holidayType)) { + throw new InvalidArgumentException('non-nullable holidayType cannot be null'); + } + $this->container['holidayType'] = $holidayType; + + return $this; + } + + /** + * Gets accrueSetAmount + * + * @return bool|null + */ + public function getAccrueSetAmount(): ?bool + { + return $this->container['accrueSetAmount']; + } + + /** + * Sets accrueSetAmount + * + * @param bool|null $accrueSetAmount If true and HolidayType is Accrual_Days then the AccruePaymentInLieuRate will be treated as the set amount to accrue per period worked. + * + * @return $this + */ + public function setAccrueSetAmount(?bool $accrueSetAmount): static + { + if (is_null($accrueSetAmount)) { + throw new InvalidArgumentException('non-nullable accrueSetAmount cannot be null'); + } + $this->container['accrueSetAmount'] = $accrueSetAmount; + + return $this; + } + + /** + * Gets accrueHoursPerDay + * + * @return float|null + */ + public function getAccrueHoursPerDay(): ?float + { + return $this->container['accrueHoursPerDay']; + } + + /** + * Sets accrueHoursPerDay + * + * @param float|null $accrueHoursPerDay If HolidayType is Accrual_Days then this value is used to help convert hours worked into days accrued + * + * @return $this + */ + public function setAccrueHoursPerDay(?float $accrueHoursPerDay): static + { + if (is_null($accrueHoursPerDay)) { + throw new InvalidArgumentException('non-nullable accrueHoursPerDay cannot be null'); + } + $this->container['accrueHoursPerDay'] = $accrueHoursPerDay; + + return $this; + } + + /** + * Gets showAllowanceOnPayslip + * + * @return bool|null + */ + public function getShowAllowanceOnPayslip(): ?bool + { + return $this->container['showAllowanceOnPayslip']; + } + + /** + * Sets showAllowanceOnPayslip + * + * @param bool|null $showAllowanceOnPayslip If true then the remaining Allowance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAllowanceOnPayslip(?bool $showAllowanceOnPayslip): static + { + if (is_null($showAllowanceOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAllowanceOnPayslip cannot be null'); + } + $this->container['showAllowanceOnPayslip'] = $showAllowanceOnPayslip; + + return $this; + } + + /** + * Gets showAhpOnPayslip + * + * @return bool|null + */ + public function getShowAhpOnPayslip(): ?bool + { + return $this->container['showAhpOnPayslip']; + } + + /** + * Sets showAhpOnPayslip + * + * @param bool|null $showAhpOnPayslip If true then the AHP balance will be shown on the employees payslip. + * + * @return $this + */ + public function setShowAhpOnPayslip(?bool $showAhpOnPayslip): static + { + if (is_null($showAhpOnPayslip)) { + throw new InvalidArgumentException('non-nullable showAhpOnPayslip cannot be null'); + } + $this->container['showAhpOnPayslip'] = $showAhpOnPayslip; + + return $this; + } + + /** + * Gets accruePaymentInLieuRate + * + * @return float|null + */ + public function getAccruePaymentInLieuRate(): ?float + { + return $this->container['accruePaymentInLieuRate']; + } + + /** + * Sets accruePaymentInLieuRate + * + * @param float|null $accruePaymentInLieuRate The rate at which Payments in Lieu acrrue. Typically this should be 12.07%. + * + * @return $this + */ + public function setAccruePaymentInLieuRate(?float $accruePaymentInLieuRate): static + { + if (is_null($accruePaymentInLieuRate)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuRate cannot be null'); + } + $this->container['accruePaymentInLieuRate'] = $accruePaymentInLieuRate; + + return $this; + } + + /** + * Gets accruePaymentInLieuAllGrossPay + * + * @return bool|null + */ + public function getAccruePaymentInLieuAllGrossPay(): ?bool + { + return $this->container['accruePaymentInLieuAllGrossPay']; + } + + /** + * Sets accruePaymentInLieuAllGrossPay + * + * @param bool|null $accruePaymentInLieuAllGrossPay Set to true if you want accrued holiday payments to be calculated on the total gross pay for the employee or just on the single regular pay element + * + * @return $this + */ + public function setAccruePaymentInLieuAllGrossPay(?bool $accruePaymentInLieuAllGrossPay): static + { + if (is_null($accruePaymentInLieuAllGrossPay)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuAllGrossPay cannot be null'); + } + $this->container['accruePaymentInLieuAllGrossPay'] = $accruePaymentInLieuAllGrossPay; + + return $this; + } + + /** + * Gets accruePaymentInLieuPayAutomatically + * + * @return bool|null + */ + public function getAccruePaymentInLieuPayAutomatically(): ?bool + { + return $this->container['accruePaymentInLieuPayAutomatically']; + } + + /** + * Sets accruePaymentInLieuPayAutomatically + * + * @param bool|null $accruePaymentInLieuPayAutomatically Set to true if you want employees to be automatically paid any outstanding holiday pay + * + * @return $this + */ + public function setAccruePaymentInLieuPayAutomatically(?bool $accruePaymentInLieuPayAutomatically): static + { + if (is_null($accruePaymentInLieuPayAutomatically)) { + throw new InvalidArgumentException('non-nullable accruePaymentInLieuPayAutomatically cannot be null'); + } + $this->container['accruePaymentInLieuPayAutomatically'] = $accruePaymentInLieuPayAutomatically; + + return $this; + } + + /** + * Gets accruePayCodeSetUniqueId + * + * @return string|null + */ + public function getAccruePayCodeSetUniqueId(): ?string + { + return $this->container['accruePayCodeSetUniqueId']; + } + + /** + * Sets accruePayCodeSetUniqueId + * + * @param string|null $accruePayCodeSetUniqueId accruePayCodeSetUniqueId + * + * @return $this + */ + public function setAccruePayCodeSetUniqueId(?string $accruePayCodeSetUniqueId): static + { + if (is_null($accruePayCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'accruePayCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accruePayCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accruePayCodeSetUniqueId'] = $accruePayCodeSetUniqueId; + + return $this; + } + + /** + * Gets maximumAccruePeriod + * + * @return float|null + */ + public function getMaximumAccruePeriod(): ?float + { + return $this->container['maximumAccruePeriod']; + } + + /** + * Sets maximumAccruePeriod + * + * @param float|null $maximumAccruePeriod The maximum number of hours capable of being accrued in a single period + * + * @return $this + */ + public function setMaximumAccruePeriod(?float $maximumAccruePeriod): static + { + if (is_null($maximumAccruePeriod)) { + array_push($this->openAPINullablesSetToNull, 'maximumAccruePeriod'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('maximumAccruePeriod', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['maximumAccruePeriod'] = $maximumAccruePeriod; + + return $this; + } + + /** + * Gets holidayAccrualBasis + * + * @return \SynergiTech\Staffology\Model\HolidayAccrual|null + */ + public function getHolidayAccrualBasis(): ?\SynergiTech\Staffology\Model\HolidayAccrual + { + return $this->container['holidayAccrualBasis']; + } + + /** + * Sets holidayAccrualBasis + * + * @param \SynergiTech\Staffology\Model\HolidayAccrual|null $holidayAccrualBasis holidayAccrualBasis + * + * @return $this + */ + public function setHolidayAccrualBasis(?\SynergiTech\Staffology\Model\HolidayAccrual $holidayAccrualBasis): static + { + if (is_null($holidayAccrualBasis)) { + throw new InvalidArgumentException('non-nullable holidayAccrualBasis cannot be null'); + } + $this->container['holidayAccrualBasis'] = $holidayAccrualBasis; + + return $this; + } + + /** + * Gets holidayAccrualDefaultRateType + * + * @return \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null + */ + public function getHolidayAccrualDefaultRateType(): ?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType + { + return $this->container['holidayAccrualDefaultRateType']; + } + + /** + * Sets holidayAccrualDefaultRateType + * + * @param \SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType|null $holidayAccrualDefaultRateType holidayAccrualDefaultRateType + * + * @return $this + */ + public function setHolidayAccrualDefaultRateType(?\SynergiTech\Staffology\Model\HolidayAccrualDefaultRateType $holidayAccrualDefaultRateType): static + { + if (is_null($holidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable holidayAccrualDefaultRateType cannot be null'); + } + $this->container['holidayAccrualDefaultRateType'] = $holidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets occupationalSicknessUniqueId + * + * @return string|null + */ + public function getOccupationalSicknessUniqueId(): ?string + { + return $this->container['occupationalSicknessUniqueId']; + } + + /** + * Sets occupationalSicknessUniqueId + * + * @param string|null $occupationalSicknessUniqueId occupationalSicknessUniqueId + * + * @return $this + */ + public function setOccupationalSicknessUniqueId(?string $occupationalSicknessUniqueId): static + { + if (is_null($occupationalSicknessUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'occupationalSicknessUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalSicknessUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalSicknessUniqueId'] = $occupationalSicknessUniqueId; + + return $this; + } + + /** + * Gets accruedPaymentLiability + * + * @return float|null + */ + public function getAccruedPaymentLiability(): ?float + { + return $this->container['accruedPaymentLiability']; + } + + /** + * Sets accruedPaymentLiability + * + * @param float|null $accruedPaymentLiability [readonly] The total accrued payments for this employee over the lifetime of their employment so far + * + * @return $this + */ + public function setAccruedPaymentLiability(?float $accruedPaymentLiability): static + { + if (is_null($accruedPaymentLiability)) { + throw new InvalidArgumentException('non-nullable accruedPaymentLiability cannot be null'); + } + $this->container['accruedPaymentLiability'] = $accruedPaymentLiability; + + return $this; + } + + /** + * Gets accruedPaymentAdjustment + * + * @return float|null + */ + public function getAccruedPaymentAdjustment(): ?float + { + return $this->container['accruedPaymentAdjustment']; + } + + /** + * Sets accruedPaymentAdjustment + * + * @param float|null $accruedPaymentAdjustment Any manual adjustment to the total accrued + * + * @return $this + */ + public function setAccruedPaymentAdjustment(?float $accruedPaymentAdjustment): static + { + if (is_null($accruedPaymentAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedPaymentAdjustment cannot be null'); + } + $this->container['accruedPaymentAdjustment'] = $accruedPaymentAdjustment; + + return $this; + } + + /** + * Gets accruedPaymentPaid + * + * @return float|null + */ + public function getAccruedPaymentPaid(): ?float + { + return $this->container['accruedPaymentPaid']; + } + + /** + * Sets accruedPaymentPaid + * + * @param float|null $accruedPaymentPaid [readonly] The Total amount paid to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedPaymentPaid(?float $accruedPaymentPaid): static + { + if (is_null($accruedPaymentPaid)) { + throw new InvalidArgumentException('non-nullable accruedPaymentPaid cannot be null'); + } + $this->container['accruedPaymentPaid'] = $accruedPaymentPaid; + + return $this; + } + + /** + * Gets accruedPaymentBalance + * + * @return float|null + */ + public function getAccruedPaymentBalance(): ?float + { + return $this->container['accruedPaymentBalance']; + } + + /** + * Sets accruedPaymentBalance + * + * @param float|null $accruedPaymentBalance [readonly] The balance of what is owed to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedPaymentBalance(?float $accruedPaymentBalance): static + { + if (is_null($accruedPaymentBalance)) { + throw new InvalidArgumentException('non-nullable accruedPaymentBalance cannot be null'); + } + $this->container['accruedPaymentBalance'] = $accruedPaymentBalance; + + return $this; + } + + /** + * Gets accruedHoursAmount + * + * @return float|null + */ + public function getAccruedHoursAmount(): ?float + { + return $this->container['accruedHoursAmount']; + } + + /** + * Sets accruedHoursAmount + * + * @param float|null $accruedHoursAmount [readonly] The total accrued hours for this employee over the lifetime of their employment so far + * + * @return $this + */ + public function setAccruedHoursAmount(?float $accruedHoursAmount): static + { + if (is_null($accruedHoursAmount)) { + throw new InvalidArgumentException('non-nullable accruedHoursAmount cannot be null'); + } + $this->container['accruedHoursAmount'] = $accruedHoursAmount; + + return $this; + } + + /** + * Gets accruedHoursAdjustment + * + * @return float|null + */ + public function getAccruedHoursAdjustment(): ?float + { + return $this->container['accruedHoursAdjustment']; + } + + /** + * Sets accruedHoursAdjustment + * + * @param float|null $accruedHoursAdjustment Any manual adjustment to the total hours accrued + * + * @return $this + */ + public function setAccruedHoursAdjustment(?float $accruedHoursAdjustment): static + { + if (is_null($accruedHoursAdjustment)) { + throw new InvalidArgumentException('non-nullable accruedHoursAdjustment cannot be null'); + } + $this->container['accruedHoursAdjustment'] = $accruedHoursAdjustment; + + return $this; + } + + /** + * Gets accruedHoursPaid + * + * @return float|null + */ + public function getAccruedHoursPaid(): ?float + { + return $this->container['accruedHoursPaid']; + } + + /** + * Sets accruedHoursPaid + * + * @param float|null $accruedHoursPaid [readonly] The Total amount of hours paid to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedHoursPaid(?float $accruedHoursPaid): static + { + if (is_null($accruedHoursPaid)) { + throw new InvalidArgumentException('non-nullable accruedHoursPaid cannot be null'); + } + $this->container['accruedHoursPaid'] = $accruedHoursPaid; + + return $this; + } + + /** + * Gets accruedHoursAmountLastPeriod + * + * @return float|null + */ + public function getAccruedHoursAmountLastPeriod(): ?float + { + return $this->container['accruedHoursAmountLastPeriod']; + } + + /** + * Sets accruedHoursAmountLastPeriod + * + * @param float|null $accruedHoursAmountLastPeriod [readonly] The total accrued hours for this employee in the last pay period + * + * @return $this + */ + public function setAccruedHoursAmountLastPeriod(?float $accruedHoursAmountLastPeriod): static + { + if (is_null($accruedHoursAmountLastPeriod)) { + throw new InvalidArgumentException('non-nullable accruedHoursAmountLastPeriod cannot be null'); + } + $this->container['accruedHoursAmountLastPeriod'] = $accruedHoursAmountLastPeriod; + + return $this; + } + + /** + * Gets paidHoursAmountLastPeriod + * + * @return float|null + */ + public function getPaidHoursAmountLastPeriod(): ?float + { + return $this->container['paidHoursAmountLastPeriod']; + } + + /** + * Sets paidHoursAmountLastPeriod + * + * @param float|null $paidHoursAmountLastPeriod [readonly] The number of hours paid against the pay code + * + * @return $this + */ + public function setPaidHoursAmountLastPeriod(?float $paidHoursAmountLastPeriod): static + { + if (is_null($paidHoursAmountLastPeriod)) { + throw new InvalidArgumentException('non-nullable paidHoursAmountLastPeriod cannot be null'); + } + $this->container['paidHoursAmountLastPeriod'] = $paidHoursAmountLastPeriod; + + return $this; + } + + /** + * Gets accruedHoursBalance + * + * @return float|null + */ + public function getAccruedHoursBalance(): ?float + { + return $this->container['accruedHoursBalance']; + } + + /** + * Sets accruedHoursBalance + * + * @param float|null $accruedHoursBalance [readonly] The balance of hours owed to this employee in lieu of holidays + * + * @return $this + */ + public function setAccruedHoursBalance(?float $accruedHoursBalance): static + { + if (is_null($accruedHoursBalance)) { + throw new InvalidArgumentException('non-nullable accruedHoursBalance cannot be null'); + } + $this->container['accruedHoursBalance'] = $accruedHoursBalance; + + return $this; + } + + /** + * Gets aggregatedServiceDate + * + * @return \DateTime|null + */ + public function getAggregatedServiceDate(): ?\DateTime + { + return $this->container['aggregatedServiceDate']; + } + + /** + * Sets aggregatedServiceDate + * + * @param \DateTime|null $aggregatedServiceDate aggregatedServiceDate + * + * @return $this + */ + public function setAggregatedServiceDate(?\DateTime $aggregatedServiceDate): static + { + if (is_null($aggregatedServiceDate)) { + array_push($this->openAPINullablesSetToNull, 'aggregatedServiceDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aggregatedServiceDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aggregatedServiceDate'] = $aggregatedServiceDate; + + return $this; + } + + /** + * Gets useAggregatedServiceDate + * + * @return bool|null + */ + public function getUseAggregatedServiceDate(): ?bool + { + return $this->container['useAggregatedServiceDate']; + } + + /** + * Sets useAggregatedServiceDate + * + * @param bool|null $useAggregatedServiceDate useAggregatedServiceDate + * + * @return $this + */ + public function setUseAggregatedServiceDate(?bool $useAggregatedServiceDate): static + { + if (is_null($useAggregatedServiceDate)) { + throw new InvalidArgumentException('non-nullable useAggregatedServiceDate cannot be null'); + } + $this->container['useAggregatedServiceDate'] = $useAggregatedServiceDate; + + return $this; + } + + /** + * Gets useDefaultHolidayAccrualDefaultRateType + * + * @return bool|null + */ + public function getUseDefaultHolidayAccrualDefaultRateType(): ?bool + { + return $this->container['useDefaultHolidayAccrualDefaultRateType']; + } + + /** + * Sets useDefaultHolidayAccrualDefaultRateType + * + * @param bool|null $useDefaultHolidayAccrualDefaultRateType If true then the value for HolidayAccrualDefaultRateType comes from the Employer record. + * + * @return $this + */ + public function setUseDefaultHolidayAccrualDefaultRateType(?bool $useDefaultHolidayAccrualDefaultRateType): static + { + if (is_null($useDefaultHolidayAccrualDefaultRateType)) { + throw new InvalidArgumentException('non-nullable useDefaultHolidayAccrualDefaultRateType cannot be null'); + } + $this->container['useDefaultHolidayAccrualDefaultRateType'] = $useDefaultHolidayAccrualDefaultRateType; + + return $this; + } + + /** + * Gets unauthorisedLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getUnauthorisedLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['unauthorisedLeaveProRataRule']; + } + + /** + * Sets unauthorisedLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $unauthorisedLeaveProRataRule unauthorisedLeaveProRataRule + * + * @return $this + */ + public function setUnauthorisedLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $unauthorisedLeaveProRataRule): static + { + if (is_null($unauthorisedLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable unauthorisedLeaveProRataRule cannot be null'); + } + $this->container['unauthorisedLeaveProRataRule'] = $unauthorisedLeaveProRataRule; + + return $this; + } + + /** + * Gets holidayLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getHolidayLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['holidayLeaveProRataRule']; + } + + /** + * Sets holidayLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $holidayLeaveProRataRule holidayLeaveProRataRule + * + * @return $this + */ + public function setHolidayLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $holidayLeaveProRataRule): static + { + if (is_null($holidayLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable holidayLeaveProRataRule cannot be null'); + } + $this->container['holidayLeaveProRataRule'] = $holidayLeaveProRataRule; + + return $this; + } + + /** + * Gets sickLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getSickLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['sickLeaveProRataRule']; + } + + /** + * Sets sickLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $sickLeaveProRataRule sickLeaveProRataRule + * + * @return $this + */ + public function setSickLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $sickLeaveProRataRule): static + { + if (is_null($sickLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable sickLeaveProRataRule cannot be null'); + } + $this->container['sickLeaveProRataRule'] = $sickLeaveProRataRule; + + return $this; + } + + /** + * Gets parentalLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getParentalLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['parentalLeaveProRataRule']; + } + + /** + * Sets parentalLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $parentalLeaveProRataRule parentalLeaveProRataRule + * + * @return $this + */ + public function setParentalLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $parentalLeaveProRataRule): static + { + if (is_null($parentalLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable parentalLeaveProRataRule cannot be null'); + } + $this->container['parentalLeaveProRataRule'] = $parentalLeaveProRataRule; + + return $this; + } + + /** + * Gets bereavementLeaveProRataRule + * + * @return \SynergiTech\Staffology\Model\LeaveProRataRule|null + */ + public function getBereavementLeaveProRataRule(): ?\SynergiTech\Staffology\Model\LeaveProRataRule + { + return $this->container['bereavementLeaveProRataRule']; + } + + /** + * Sets bereavementLeaveProRataRule + * + * @param \SynergiTech\Staffology\Model\LeaveProRataRule|null $bereavementLeaveProRataRule bereavementLeaveProRataRule + * + * @return $this + */ + public function setBereavementLeaveProRataRule(?\SynergiTech\Staffology\Model\LeaveProRataRule $bereavementLeaveProRataRule): static + { + if (is_null($bereavementLeaveProRataRule)) { + throw new InvalidArgumentException('non-nullable bereavementLeaveProRataRule cannot be null'); + } + $this->container['bereavementLeaveProRataRule'] = $bereavementLeaveProRataRule; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LeaveType.php b/src/Model/LeaveType.php new file mode 100644 index 0000000..86a914a --- /dev/null +++ b/src/Model/LeaveType.php @@ -0,0 +1,63 @@ + + */ +class LeaverDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeaverDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'hasLeft' => 'bool', + 'leaveDate' => '\DateTime', + 'isDeceased' => 'bool', + 'paymentAfterLeaving' => 'bool', + 'p45Sent' => 'bool', + 'payAccruedBalance' => 'bool', + 'paymentMethodAfterLeaving' => '\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'hasLeft' => null, + 'leaveDate' => 'date', + 'isDeceased' => null, + 'paymentAfterLeaving' => null, + 'p45Sent' => null, + 'payAccruedBalance' => null, + 'paymentMethodAfterLeaving' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'hasLeft' => false, + 'leaveDate' => true, + 'isDeceased' => false, + 'paymentAfterLeaving' => false, + 'p45Sent' => false, + 'payAccruedBalance' => false, + 'paymentMethodAfterLeaving' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'hasLeft' => 'hasLeft', + 'leaveDate' => 'leaveDate', + 'isDeceased' => 'isDeceased', + 'paymentAfterLeaving' => 'paymentAfterLeaving', + 'p45Sent' => 'p45Sent', + 'payAccruedBalance' => 'payAccruedBalance', + 'paymentMethodAfterLeaving' => 'paymentMethodAfterLeaving' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'hasLeft' => 'setHasLeft', + 'leaveDate' => 'setLeaveDate', + 'isDeceased' => 'setIsDeceased', + 'paymentAfterLeaving' => 'setPaymentAfterLeaving', + 'p45Sent' => 'setP45Sent', + 'payAccruedBalance' => 'setPayAccruedBalance', + 'paymentMethodAfterLeaving' => 'setPaymentMethodAfterLeaving' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'hasLeft' => 'getHasLeft', + 'leaveDate' => 'getLeaveDate', + 'isDeceased' => 'getIsDeceased', + 'paymentAfterLeaving' => 'getPaymentAfterLeaving', + 'p45Sent' => 'getP45Sent', + 'payAccruedBalance' => 'getPayAccruedBalance', + 'paymentMethodAfterLeaving' => 'getPaymentMethodAfterLeaving' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('hasLeft', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('isDeceased', $data ?? [], null); + $this->setIfExists('paymentAfterLeaving', $data ?? [], null); + $this->setIfExists('p45Sent', $data ?? [], null); + $this->setIfExists('payAccruedBalance', $data ?? [], null); + $this->setIfExists('paymentMethodAfterLeaving', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasLeft + * + * @return bool|null + */ + public function getHasLeft(): ?bool + { + return $this->container['hasLeft']; + } + + /** + * Sets hasLeft + * + * @param bool|null $hasLeft hasLeft + * + * @return $this + */ + public function setHasLeft(?bool $hasLeft): static + { + if (is_null($hasLeft)) { + throw new InvalidArgumentException('non-nullable hasLeft cannot be null'); + } + $this->container['hasLeft'] = $hasLeft; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets isDeceased + * + * @return bool|null + */ + public function getIsDeceased(): ?bool + { + return $this->container['isDeceased']; + } + + /** + * Sets isDeceased + * + * @param bool|null $isDeceased isDeceased + * + * @return $this + */ + public function setIsDeceased(?bool $isDeceased): static + { + if (is_null($isDeceased)) { + throw new InvalidArgumentException('non-nullable isDeceased cannot be null'); + } + $this->container['isDeceased'] = $isDeceased; + + return $this; + } + + /** + * Gets paymentAfterLeaving + * + * @return bool|null + */ + public function getPaymentAfterLeaving(): ?bool + { + return $this->container['paymentAfterLeaving']; + } + + /** + * Sets paymentAfterLeaving + * + * @param bool|null $paymentAfterLeaving paymentAfterLeaving + * + * @return $this + */ + public function setPaymentAfterLeaving(?bool $paymentAfterLeaving): static + { + if (is_null($paymentAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentAfterLeaving cannot be null'); + } + $this->container['paymentAfterLeaving'] = $paymentAfterLeaving; + + return $this; + } + + /** + * Gets p45Sent + * + * @return bool|null + */ + public function getP45Sent(): ?bool + { + return $this->container['p45Sent']; + } + + /** + * Sets p45Sent + * + * @param bool|null $p45Sent p45Sent + * + * @return $this + */ + public function setP45Sent(?bool $p45Sent): static + { + if (is_null($p45Sent)) { + throw new InvalidArgumentException('non-nullable p45Sent cannot be null'); + } + $this->container['p45Sent'] = $p45Sent; + + return $this; + } + + /** + * Gets payAccruedBalance + * + * @return bool|null + */ + public function getPayAccruedBalance(): ?bool + { + return $this->container['payAccruedBalance']; + } + + /** + * Sets payAccruedBalance + * + * @param bool|null $payAccruedBalance payAccruedBalance + * + * @return $this + */ + public function setPayAccruedBalance(?bool $payAccruedBalance): static + { + if (is_null($payAccruedBalance)) { + throw new InvalidArgumentException('non-nullable payAccruedBalance cannot be null'); + } + $this->container['payAccruedBalance'] = $payAccruedBalance; + + return $this; + } + + /** + * Gets paymentMethodAfterLeaving + * + * @return \SynergiTech\Staffology\Model\PaymentMethodAfterLeaving|null + */ + public function getPaymentMethodAfterLeaving(): ?\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving + { + return $this->container['paymentMethodAfterLeaving']; + } + + /** + * Sets paymentMethodAfterLeaving + * + * @param \SynergiTech\Staffology\Model\PaymentMethodAfterLeaving|null $paymentMethodAfterLeaving paymentMethodAfterLeaving + * + * @return $this + */ + public function setPaymentMethodAfterLeaving(?\SynergiTech\Staffology\Model\PaymentMethodAfterLeaving $paymentMethodAfterLeaving): static + { + if (is_null($paymentMethodAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentMethodAfterLeaving cannot be null'); + } + $this->container['paymentMethodAfterLeaving'] = $paymentMethodAfterLeaving; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LgpsCivicaCasualHours.php b/src/Model/LgpsCivicaCasualHours.php new file mode 100644 index 0000000..54ea8fa --- /dev/null +++ b/src/Model/LgpsCivicaCasualHours.php @@ -0,0 +1,47 @@ + + */ +class LinkedPiw implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LinkedPiw'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'result' => '\SynergiTech\Staffology\Model\LinkedPiwResult', + 'id' => 'string', + 'averageWeeklyEarnings' => 'float', + 'workingDays' => 'float', + 'totalDays' => 'float', + 'sspFirstPayDay' => '\DateTime', + 'sspFirstDay' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'result' => null, + 'id' => 'uuid', + 'averageWeeklyEarnings' => 'double', + 'workingDays' => 'double', + 'totalDays' => 'double', + 'sspFirstPayDay' => 'date', + 'sspFirstDay' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'result' => false, + 'id' => false, + 'averageWeeklyEarnings' => false, + 'workingDays' => false, + 'totalDays' => false, + 'sspFirstPayDay' => true, + 'sspFirstDay' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'result' => 'result', + 'id' => 'id', + 'averageWeeklyEarnings' => 'averageWeeklyEarnings', + 'workingDays' => 'workingDays', + 'totalDays' => 'totalDays', + 'sspFirstPayDay' => 'sspFirstPayDay', + 'sspFirstDay' => 'sspFirstDay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'result' => 'setResult', + 'id' => 'setId', + 'averageWeeklyEarnings' => 'setAverageWeeklyEarnings', + 'workingDays' => 'setWorkingDays', + 'totalDays' => 'setTotalDays', + 'sspFirstPayDay' => 'setSspFirstPayDay', + 'sspFirstDay' => 'setSspFirstDay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'result' => 'getResult', + 'id' => 'getId', + 'averageWeeklyEarnings' => 'getAverageWeeklyEarnings', + 'workingDays' => 'getWorkingDays', + 'totalDays' => 'getTotalDays', + 'sspFirstPayDay' => 'getSspFirstPayDay', + 'sspFirstDay' => 'getSspFirstDay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('averageWeeklyEarnings', $data ?? [], null); + $this->setIfExists('workingDays', $data ?? [], null); + $this->setIfExists('totalDays', $data ?? [], null); + $this->setIfExists('sspFirstPayDay', $data ?? [], null); + $this->setIfExists('sspFirstDay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets result + * + * @return \SynergiTech\Staffology\Model\LinkedPiwResult|null + */ + public function getResult(): ?\SynergiTech\Staffology\Model\LinkedPiwResult + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \SynergiTech\Staffology\Model\LinkedPiwResult|null $result result + * + * @return $this + */ + public function setResult(?\SynergiTech\Staffology\Model\LinkedPiwResult $result): static + { + if (is_null($result)) { + throw new InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The Id of the linked Leave + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets averageWeeklyEarnings + * + * @return float|null + */ + public function getAverageWeeklyEarnings(): ?float + { + return $this->container['averageWeeklyEarnings']; + } + + /** + * Sets averageWeeklyEarnings + * + * @param float|null $averageWeeklyEarnings [readonly] Average weekly earnings from linked Leave + * + * @return $this + */ + public function setAverageWeeklyEarnings(?float $averageWeeklyEarnings): static + { + if (is_null($averageWeeklyEarnings)) { + throw new InvalidArgumentException('non-nullable averageWeeklyEarnings cannot be null'); + } + $this->container['averageWeeklyEarnings'] = $averageWeeklyEarnings; + + return $this; + } + + /** + * Gets workingDays + * + * @return float|null + */ + public function getWorkingDays(): ?float + { + return $this->container['workingDays']; + } + + /** + * Sets workingDays + * + * @param float|null $workingDays [readonly] The number of working days in the linked Leave. + * + * @return $this + */ + public function setWorkingDays(?float $workingDays): static + { + if (is_null($workingDays)) { + throw new InvalidArgumentException('non-nullable workingDays cannot be null'); + } + $this->container['workingDays'] = $workingDays; + + return $this; + } + + /** + * Gets totalDays + * + * @return float|null + */ + public function getTotalDays(): ?float + { + return $this->container['totalDays']; + } + + /** + * Sets totalDays + * + * @param float|null $totalDays [readonly] The number of days covered by the linked Leave. + * + * @return $this + */ + public function setTotalDays(?float $totalDays): static + { + if (is_null($totalDays)) { + throw new InvalidArgumentException('non-nullable totalDays cannot be null'); + } + $this->container['totalDays'] = $totalDays; + + return $this; + } + + /** + * Gets sspFirstPayDay + * + * @return \DateTime|null + */ + public function getSspFirstPayDay(): ?\DateTime + { + return $this->container['sspFirstPayDay']; + } + + /** + * Sets sspFirstPayDay + * + * @param \DateTime|null $sspFirstPayDay [readonly] The SspFirstPayDay from the linked Leave, if set + * + * @return $this + */ + public function setSspFirstPayDay(?\DateTime $sspFirstPayDay): static + { + if (is_null($sspFirstPayDay)) { + array_push($this->openAPINullablesSetToNull, 'sspFirstPayDay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sspFirstPayDay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sspFirstPayDay'] = $sspFirstPayDay; + + return $this; + } + + /** + * Gets sspFirstDay + * + * @return \DateTime|null + */ + public function getSspFirstDay(): ?\DateTime + { + return $this->container['sspFirstDay']; + } + + /** + * Sets sspFirstDay + * + * @param \DateTime|null $sspFirstDay [readonly] The SspFirstDay from the linked Leave, if set + * + * @return $this + */ + public function setSspFirstDay(?\DateTime $sspFirstDay): static + { + if (is_null($sspFirstDay)) { + array_push($this->openAPINullablesSetToNull, 'sspFirstDay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sspFirstDay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sspFirstDay'] = $sspFirstDay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LinkedPiwResult.php b/src/Model/LinkedPiwResult.php new file mode 100644 index 0000000..eaa2aa2 --- /dev/null +++ b/src/Model/LinkedPiwResult.php @@ -0,0 +1,45 @@ + + */ +class Loan implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Loan'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'issueDate' => '\DateTime', + 'reference' => 'string', + 'payCode' => 'string', + 'loanAmount' => 'float', + 'periodAmount' => 'float', + 'amountRepaid' => 'float', + 'previouslyPaid' => 'float', + 'balance' => 'float', + 'isSettled' => 'bool', + 'isPaused' => 'bool', + 'documentCount' => 'int', + 'documents' => '\SynergiTech\Staffology\Model\Item[]', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'issueDate' => 'date', + 'reference' => null, + 'payCode' => null, + 'loanAmount' => 'double', + 'periodAmount' => 'double', + 'amountRepaid' => 'double', + 'previouslyPaid' => 'double', + 'balance' => 'double', + 'isSettled' => null, + 'isPaused' => null, + 'documentCount' => 'int32', + 'documents' => null, + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'issueDate' => false, + 'reference' => true, + 'payCode' => true, + 'loanAmount' => false, + 'periodAmount' => false, + 'amountRepaid' => false, + 'previouslyPaid' => false, + 'balance' => false, + 'isSettled' => false, + 'isPaused' => false, + 'documentCount' => false, + 'documents' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'issueDate' => 'issueDate', + 'reference' => 'reference', + 'payCode' => 'payCode', + 'loanAmount' => 'loanAmount', + 'periodAmount' => 'periodAmount', + 'amountRepaid' => 'amountRepaid', + 'previouslyPaid' => 'previouslyPaid', + 'balance' => 'balance', + 'isSettled' => 'isSettled', + 'isPaused' => 'isPaused', + 'documentCount' => 'documentCount', + 'documents' => 'documents', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'issueDate' => 'setIssueDate', + 'reference' => 'setReference', + 'payCode' => 'setPayCode', + 'loanAmount' => 'setLoanAmount', + 'periodAmount' => 'setPeriodAmount', + 'amountRepaid' => 'setAmountRepaid', + 'previouslyPaid' => 'setPreviouslyPaid', + 'balance' => 'setBalance', + 'isSettled' => 'setIsSettled', + 'isPaused' => 'setIsPaused', + 'documentCount' => 'setDocumentCount', + 'documents' => 'setDocuments', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'issueDate' => 'getIssueDate', + 'reference' => 'getReference', + 'payCode' => 'getPayCode', + 'loanAmount' => 'getLoanAmount', + 'periodAmount' => 'getPeriodAmount', + 'amountRepaid' => 'getAmountRepaid', + 'previouslyPaid' => 'getPreviouslyPaid', + 'balance' => 'getBalance', + 'isSettled' => 'getIsSettled', + 'isPaused' => 'getIsPaused', + 'documentCount' => 'getDocumentCount', + 'documents' => 'getDocuments', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('issueDate', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('loanAmount', $data ?? [], null); + $this->setIfExists('periodAmount', $data ?? [], null); + $this->setIfExists('amountRepaid', $data ?? [], null); + $this->setIfExists('previouslyPaid', $data ?? [], null); + $this->setIfExists('balance', $data ?? [], null); + $this->setIfExists('isSettled', $data ?? [], null); + $this->setIfExists('isPaused', $data ?? [], null); + $this->setIfExists('documentCount', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reference']) && (mb_strlen($this->container['reference']) > 100)) { + $invalidProperties[] = "invalid value for 'reference', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets issueDate + * + * @return \DateTime|null + */ + public function getIssueDate(): ?\DateTime + { + return $this->container['issueDate']; + } + + /** + * Sets issueDate + * + * @param \DateTime|null $issueDate The date the Loan was made + * + * @return $this + */ + public function setIssueDate(?\DateTime $issueDate): static + { + if (is_null($issueDate)) { + throw new InvalidArgumentException('non-nullable issueDate cannot be null'); + } + $this->container['issueDate'] = $issueDate; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference An optional reference for this Loan + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reference) && (mb_strlen($reference) > 100)) { + throw new InvalidArgumentException('invalid length for $reference when calling Loan., must be smaller than or equal to 100.'); + } + + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode The Code of the PayCode used for recording payments. The PayCode must have a CalculationType of FixedAmount and not be a multiplier code + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets loanAmount + * + * @return float|null + */ + public function getLoanAmount(): ?float + { + return $this->container['loanAmount']; + } + + /** + * Sets loanAmount + * + * @param float|null $loanAmount The initial amount that the loan was for + * + * @return $this + */ + public function setLoanAmount(?float $loanAmount): static + { + if (is_null($loanAmount)) { + throw new InvalidArgumentException('non-nullable loanAmount cannot be null'); + } + $this->container['loanAmount'] = $loanAmount; + + return $this; + } + + /** + * Gets periodAmount + * + * @return float|null + */ + public function getPeriodAmount(): ?float + { + return $this->container['periodAmount']; + } + + /** + * Sets periodAmount + * + * @param float|null $periodAmount The amount to deduct per PayPeriod + * + * @return $this + */ + public function setPeriodAmount(?float $periodAmount): static + { + if (is_null($periodAmount)) { + throw new InvalidArgumentException('non-nullable periodAmount cannot be null'); + } + $this->container['periodAmount'] = $periodAmount; + + return $this; + } + + /** + * Gets amountRepaid + * + * @return float|null + */ + public function getAmountRepaid(): ?float + { + return $this->container['amountRepaid']; + } + + /** + * Sets amountRepaid + * + * @param float|null $amountRepaid [readonly] The amount repaid so far due to deductions in Payruns + * + * @return $this + */ + public function setAmountRepaid(?float $amountRepaid): static + { + if (is_null($amountRepaid)) { + throw new InvalidArgumentException('non-nullable amountRepaid cannot be null'); + } + $this->container['amountRepaid'] = $amountRepaid; + + return $this; + } + + /** + * Gets previouslyPaid + * + * @return float|null + */ + public function getPreviouslyPaid(): ?float + { + return $this->container['previouslyPaid']; + } + + /** + * Sets previouslyPaid + * + * @param float|null $previouslyPaid [readonly] Any amount by which to adjust the Balance, perhaps due to repayments made elsewhere + * + * @return $this + */ + public function setPreviouslyPaid(?float $previouslyPaid): static + { + if (is_null($previouslyPaid)) { + throw new InvalidArgumentException('non-nullable previouslyPaid cannot be null'); + } + $this->container['previouslyPaid'] = $previouslyPaid; + + return $this; + } + + /** + * Gets balance + * + * @return float|null + */ + public function getBalance(): ?float + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param float|null $balance [readonly] The Balance of the Loan + * + * @return $this + */ + public function setBalance(?float $balance): static + { + if (is_null($balance)) { + throw new InvalidArgumentException('non-nullable balance cannot be null'); + } + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets isSettled + * + * @return bool|null + */ + public function getIsSettled(): ?bool + { + return $this->container['isSettled']; + } + + /** + * Sets isSettled + * + * @param bool|null $isSettled [readonly] + * + * @return $this + */ + public function setIsSettled(?bool $isSettled): static + { + if (is_null($isSettled)) { + throw new InvalidArgumentException('non-nullable isSettled cannot be null'); + } + $this->container['isSettled'] = $isSettled; + + return $this; + } + + /** + * Gets isPaused + * + * @return bool|null + */ + public function getIsPaused(): ?bool + { + return $this->container['isPaused']; + } + + /** + * Sets isPaused + * + * @param bool|null $isPaused If set to true then deductions will not be made + * + * @return $this + */ + public function setIsPaused(?bool $isPaused): static + { + if (is_null($isPaused)) { + throw new InvalidArgumentException('non-nullable isPaused cannot be null'); + } + $this->container['isPaused'] = $isPaused; + + return $this; + } + + /** + * Gets documentCount + * + * @return int|null + */ + public function getDocumentCount(): ?int + { + return $this->container['documentCount']; + } + + /** + * Sets documentCount + * + * @param int|null $documentCount [readonly] The number of attachments associated with this model + * + * @return $this + */ + public function setDocumentCount(?int $documentCount): static + { + if (is_null($documentCount)) { + throw new InvalidArgumentException('non-nullable documentCount cannot be null'); + } + $this->container['documentCount'] = $documentCount; + + return $this; + } + + /** + * Gets documents + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getDocuments(): ?array + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \SynergiTech\Staffology\Model\Item[]|null $documents [readonly] The attachments associated with this model + * + * @return $this + */ + public function setDocuments(?array $documents): static + { + if (is_null($documents)) { + array_push($this->openAPINullablesSetToNull, 'documents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LoanBalancesReport.php b/src/Model/LoanBalancesReport.php new file mode 100644 index 0000000..083df23 --- /dev/null +++ b/src/Model/LoanBalancesReport.php @@ -0,0 +1,558 @@ + + */ +class LoanBalancesReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LoanBalancesReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\LoanBalancesReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\LoanBalancesReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\LoanBalancesReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LoanBalancesReportLine.php b/src/Model/LoanBalancesReportLine.php new file mode 100644 index 0000000..15b4168 --- /dev/null +++ b/src/Model/LoanBalancesReportLine.php @@ -0,0 +1,674 @@ + + */ +class LoanBalancesReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LoanBalancesReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeName' => 'string', + 'payrollCode' => 'string', + 'issueDate' => '\DateTime', + 'reference' => 'string', + 'payCode' => 'string', + 'loanAmount' => 'float', + 'paidAmount' => 'float', + 'outstandingBalance' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeName' => null, + 'payrollCode' => null, + 'issueDate' => 'date', + 'reference' => null, + 'payCode' => null, + 'loanAmount' => 'double', + 'paidAmount' => 'double', + 'outstandingBalance' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeName' => true, + 'payrollCode' => true, + 'issueDate' => false, + 'reference' => true, + 'payCode' => true, + 'loanAmount' => false, + 'paidAmount' => false, + 'outstandingBalance' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeName' => 'employeeName', + 'payrollCode' => 'payrollCode', + 'issueDate' => 'issueDate', + 'reference' => 'reference', + 'payCode' => 'payCode', + 'loanAmount' => 'loanAmount', + 'paidAmount' => 'paidAmount', + 'outstandingBalance' => 'outstandingBalance' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeName' => 'setEmployeeName', + 'payrollCode' => 'setPayrollCode', + 'issueDate' => 'setIssueDate', + 'reference' => 'setReference', + 'payCode' => 'setPayCode', + 'loanAmount' => 'setLoanAmount', + 'paidAmount' => 'setPaidAmount', + 'outstandingBalance' => 'setOutstandingBalance' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeName' => 'getEmployeeName', + 'payrollCode' => 'getPayrollCode', + 'issueDate' => 'getIssueDate', + 'reference' => 'getReference', + 'payCode' => 'getPayCode', + 'loanAmount' => 'getLoanAmount', + 'paidAmount' => 'getPaidAmount', + 'outstandingBalance' => 'getOutstandingBalance' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeName', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('issueDate', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('loanAmount', $data ?? [], null); + $this->setIfExists('paidAmount', $data ?? [], null); + $this->setIfExists('outstandingBalance', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeName + * + * @return string|null + */ + public function getEmployeeName(): ?string + { + return $this->container['employeeName']; + } + + /** + * Sets employeeName + * + * @param string|null $employeeName employeeName + * + * @return $this + */ + public function setEmployeeName(?string $employeeName): static + { + if (is_null($employeeName)) { + array_push($this->openAPINullablesSetToNull, 'employeeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeName'] = $employeeName; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets issueDate + * + * @return \DateTime|null + */ + public function getIssueDate(): ?\DateTime + { + return $this->container['issueDate']; + } + + /** + * Sets issueDate + * + * @param \DateTime|null $issueDate issueDate + * + * @return $this + */ + public function setIssueDate(?\DateTime $issueDate): static + { + if (is_null($issueDate)) { + throw new InvalidArgumentException('non-nullable issueDate cannot be null'); + } + $this->container['issueDate'] = $issueDate; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference reference + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets loanAmount + * + * @return float|null + */ + public function getLoanAmount(): ?float + { + return $this->container['loanAmount']; + } + + /** + * Sets loanAmount + * + * @param float|null $loanAmount loanAmount + * + * @return $this + */ + public function setLoanAmount(?float $loanAmount): static + { + if (is_null($loanAmount)) { + throw new InvalidArgumentException('non-nullable loanAmount cannot be null'); + } + $this->container['loanAmount'] = $loanAmount; + + return $this; + } + + /** + * Gets paidAmount + * + * @return float|null + */ + public function getPaidAmount(): ?float + { + return $this->container['paidAmount']; + } + + /** + * Sets paidAmount + * + * @param float|null $paidAmount paidAmount + * + * @return $this + */ + public function setPaidAmount(?float $paidAmount): static + { + if (is_null($paidAmount)) { + throw new InvalidArgumentException('non-nullable paidAmount cannot be null'); + } + $this->container['paidAmount'] = $paidAmount; + + return $this; + } + + /** + * Gets outstandingBalance + * + * @return float|null + */ + public function getOutstandingBalance(): ?float + { + return $this->container['outstandingBalance']; + } + + /** + * Sets outstandingBalance + * + * @param float|null $outstandingBalance outstandingBalance + * + * @return $this + */ + public function setOutstandingBalance(?float $outstandingBalance): static + { + if (is_null($outstandingBalance)) { + throw new InvalidArgumentException('non-nullable outstandingBalance cannot be null'); + } + $this->container['outstandingBalance'] = $outstandingBalance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LoanBalancesReportReportResponse.php b/src/Model/LoanBalancesReportReportResponse.php new file mode 100644 index 0000000..e79ce2e --- /dev/null +++ b/src/Model/LoanBalancesReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class LoanBalancesReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LoanBalancesReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\LoanBalancesReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\LoanBalancesReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\LoanBalancesReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\LoanBalancesReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\LoanBalancesReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LoanCharge.php b/src/Model/LoanCharge.php new file mode 100644 index 0000000..366a326 --- /dev/null +++ b/src/Model/LoanCharge.php @@ -0,0 +1,443 @@ + + */ +class LoanCharge implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LoanCharge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'threshhold' => 'float', + 'officialInterestRate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'threshhold' => 'double', + 'officialInterestRate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'threshhold' => false, + 'officialInterestRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'threshhold' => 'threshhold', + 'officialInterestRate' => 'officialInterestRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'threshhold' => 'setThreshhold', + 'officialInterestRate' => 'setOfficialInterestRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'threshhold' => 'getThreshhold', + 'officialInterestRate' => 'getOfficialInterestRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('threshhold', $data ?? [], null); + $this->setIfExists('officialInterestRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets threshhold + * + * @return float|null + */ + public function getThreshhold(): ?float + { + return $this->container['threshhold']; + } + + /** + * Sets threshhold + * + * @param float|null $threshhold threshhold + * + * @return $this + */ + public function setThreshhold(?float $threshhold): static + { + if (is_null($threshhold)) { + throw new InvalidArgumentException('non-nullable threshhold cannot be null'); + } + $this->container['threshhold'] = $threshhold; + + return $this; + } + + /** + * Gets officialInterestRate + * + * @return float|null + */ + public function getOfficialInterestRate(): ?float + { + return $this->container['officialInterestRate']; + } + + /** + * Sets officialInterestRate + * + * @param float|null $officialInterestRate officialInterestRate + * + * @return $this + */ + public function setOfficialInterestRate(?float $officialInterestRate): static + { + if (is_null($officialInterestRate)) { + throw new InvalidArgumentException('non-nullable officialInterestRate cannot be null'); + } + $this->container['officialInterestRate'] = $officialInterestRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LogEntry.php b/src/Model/LogEntry.php new file mode 100644 index 0000000..cd117c6 --- /dev/null +++ b/src/Model/LogEntry.php @@ -0,0 +1,449 @@ + + */ +class LogEntry implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LogEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'date' => '\DateTime', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'date' => 'date', + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'date' => false, + 'message' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'date' => 'date', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'date' => 'setDate', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'date' => 'getDate', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return $this + */ + public function setMessage(?string $message): static + { + if (is_null($message)) { + array_push($this->openAPINullablesSetToNull, 'message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LondonAllowance.php b/src/Model/LondonAllowance.php new file mode 100644 index 0000000..8b6e056 --- /dev/null +++ b/src/Model/LondonAllowance.php @@ -0,0 +1,547 @@ + + */ +class LondonAllowance implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LondonAllowance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\LondonAllowanceType', + 'valueType' => '\SynergiTech\Staffology\Model\LondonAllowanceValueType', + 'value' => 'float', + 'paySpineId' => 'int', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'valueType' => null, + 'value' => 'double', + 'paySpineId' => 'int32', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'valueType' => false, + 'value' => false, + 'paySpineId' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'valueType' => 'valueType', + 'value' => 'value', + 'paySpineId' => 'paySpineId', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'valueType' => 'setValueType', + 'value' => 'setValue', + 'paySpineId' => 'setPaySpineId', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'valueType' => 'getValueType', + 'value' => 'getValue', + 'paySpineId' => 'getPaySpineId', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valueType', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('paySpineId', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['paySpineId'] === null) { + $invalidProperties[] = "'paySpineId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\LondonAllowanceType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\LondonAllowanceType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets valueType + * + * @return \SynergiTech\Staffology\Model\LondonAllowanceValueType|null + */ + public function getValueType(): ?\SynergiTech\Staffology\Model\LondonAllowanceValueType + { + return $this->container['valueType']; + } + + /** + * Sets valueType + * + * @param \SynergiTech\Staffology\Model\LondonAllowanceValueType|null $valueType valueType + * + * @return $this + */ + public function setValueType(?\SynergiTech\Staffology\Model\LondonAllowanceValueType $valueType): static + { + if (is_null($valueType)) { + throw new InvalidArgumentException('non-nullable valueType cannot be null'); + } + $this->container['valueType'] = $valueType; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Value of London Allowance + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets paySpineId + * + * @return int + */ + public function getPaySpineId(): int + { + return $this->container['paySpineId']; + } + + /** + * Sets paySpineId + * + * @param int $paySpineId foreign key with pay spine table + * + * @return $this + */ + public function setPaySpineId(int $paySpineId): static + { + if (is_null($paySpineId)) { + throw new InvalidArgumentException('non-nullable paySpineId cannot be null'); + } + $this->container['paySpineId'] = $paySpineId; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/LondonAllowanceType.php b/src/Model/LondonAllowanceType.php new file mode 100644 index 0000000..942a664 --- /dev/null +++ b/src/Model/LondonAllowanceType.php @@ -0,0 +1,47 @@ + + */ +class MailSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'senderName' => 'string', + 'senderEmail' => 'string', + 'useSystemFromAddress' => 'bool', + 'senderEmailVerified' => 'bool', + 'customiseSmtpSettings' => 'bool', + 'smtpSettings' => '\SynergiTech\Staffology\Model\SmtpSettings', + 'customiseHtmlEmailSettings' => 'bool', + 'htmlEmailSettings' => '\SynergiTech\Staffology\Model\HtmlEmailSettings', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'senderName' => null, + 'senderEmail' => 'email', + 'useSystemFromAddress' => null, + 'senderEmailVerified' => null, + 'customiseSmtpSettings' => null, + 'smtpSettings' => null, + 'customiseHtmlEmailSettings' => null, + 'htmlEmailSettings' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'senderName' => false, + 'senderEmail' => false, + 'useSystemFromAddress' => false, + 'senderEmailVerified' => false, + 'customiseSmtpSettings' => false, + 'smtpSettings' => false, + 'customiseHtmlEmailSettings' => false, + 'htmlEmailSettings' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'senderName' => 'senderName', + 'senderEmail' => 'senderEmail', + 'useSystemFromAddress' => 'useSystemFromAddress', + 'senderEmailVerified' => 'senderEmailVerified', + 'customiseSmtpSettings' => 'customiseSmtpSettings', + 'smtpSettings' => 'smtpSettings', + 'customiseHtmlEmailSettings' => 'customiseHtmlEmailSettings', + 'htmlEmailSettings' => 'htmlEmailSettings', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'senderName' => 'setSenderName', + 'senderEmail' => 'setSenderEmail', + 'useSystemFromAddress' => 'setUseSystemFromAddress', + 'senderEmailVerified' => 'setSenderEmailVerified', + 'customiseSmtpSettings' => 'setCustomiseSmtpSettings', + 'smtpSettings' => 'setSmtpSettings', + 'customiseHtmlEmailSettings' => 'setCustomiseHtmlEmailSettings', + 'htmlEmailSettings' => 'setHtmlEmailSettings', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'senderName' => 'getSenderName', + 'senderEmail' => 'getSenderEmail', + 'useSystemFromAddress' => 'getUseSystemFromAddress', + 'senderEmailVerified' => 'getSenderEmailVerified', + 'customiseSmtpSettings' => 'getCustomiseSmtpSettings', + 'smtpSettings' => 'getSmtpSettings', + 'customiseHtmlEmailSettings' => 'getCustomiseHtmlEmailSettings', + 'htmlEmailSettings' => 'getHtmlEmailSettings', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('senderName', $data ?? [], null); + $this->setIfExists('senderEmail', $data ?? [], null); + $this->setIfExists('useSystemFromAddress', $data ?? [], null); + $this->setIfExists('senderEmailVerified', $data ?? [], null); + $this->setIfExists('customiseSmtpSettings', $data ?? [], null); + $this->setIfExists('smtpSettings', $data ?? [], null); + $this->setIfExists('customiseHtmlEmailSettings', $data ?? [], null); + $this->setIfExists('htmlEmailSettings', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['senderName'] === null) { + $invalidProperties[] = "'senderName' can't be null"; + } + if ((mb_strlen($this->container['senderName']) > 100)) { + $invalidProperties[] = "invalid value for 'senderName', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['senderName']) < 1)) { + $invalidProperties[] = "invalid value for 'senderName', the character length must be bigger than or equal to 1."; + } + + if ($this->container['senderEmail'] === null) { + $invalidProperties[] = "'senderEmail' can't be null"; + } + if ((mb_strlen($this->container['senderEmail']) > 100)) { + $invalidProperties[] = "invalid value for 'senderEmail', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['senderEmail']) < 1)) { + $invalidProperties[] = "invalid value for 'senderEmail', the character length must be bigger than or equal to 1."; + } + + if ($this->container['customiseSmtpSettings'] === null) { + $invalidProperties[] = "'customiseSmtpSettings' can't be null"; + } + if ($this->container['customiseHtmlEmailSettings'] === null) { + $invalidProperties[] = "'customiseHtmlEmailSettings' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets senderName + * + * @return string + */ + public function getSenderName(): string + { + return $this->container['senderName']; + } + + /** + * Sets senderName + * + * @param string $senderName senderName + * + * @return $this + */ + public function setSenderName(string $senderName): static + { + if (is_null($senderName)) { + throw new InvalidArgumentException('non-nullable senderName cannot be null'); + } + if ((mb_strlen($senderName) > 100)) { + throw new InvalidArgumentException('invalid length for $senderName when calling MailSettings., must be smaller than or equal to 100.'); + } + if ((mb_strlen($senderName) < 1)) { + throw new InvalidArgumentException('invalid length for $senderName when calling MailSettings., must be bigger than or equal to 1.'); + } + + $this->container['senderName'] = $senderName; + + return $this; + } + + /** + * Gets senderEmail + * + * @return string + */ + public function getSenderEmail(): string + { + return $this->container['senderEmail']; + } + + /** + * Sets senderEmail + * + * @param string $senderEmail senderEmail + * + * @return $this + */ + public function setSenderEmail(string $senderEmail): static + { + if (is_null($senderEmail)) { + throw new InvalidArgumentException('non-nullable senderEmail cannot be null'); + } + if ((mb_strlen($senderEmail) > 100)) { + throw new InvalidArgumentException('invalid length for $senderEmail when calling MailSettings., must be smaller than or equal to 100.'); + } + if ((mb_strlen($senderEmail) < 1)) { + throw new InvalidArgumentException('invalid length for $senderEmail when calling MailSettings., must be bigger than or equal to 1.'); + } + + $this->container['senderEmail'] = $senderEmail; + + return $this; + } + + /** + * Gets useSystemFromAddress + * + * @return bool|null + */ + public function getUseSystemFromAddress(): ?bool + { + return $this->container['useSystemFromAddress']; + } + + /** + * Sets useSystemFromAddress + * + * @param bool|null $useSystemFromAddress If set to true then the SenderEmail provided will only be used in the ReplyTo fields. The system defaults will be used for the From address. + * + * @return $this + */ + public function setUseSystemFromAddress(?bool $useSystemFromAddress): static + { + if (is_null($useSystemFromAddress)) { + throw new InvalidArgumentException('non-nullable useSystemFromAddress cannot be null'); + } + $this->container['useSystemFromAddress'] = $useSystemFromAddress; + + return $this; + } + + /** + * Gets senderEmailVerified + * + * @return bool|null + */ + public function getSenderEmailVerified(): ?bool + { + return $this->container['senderEmailVerified']; + } + + /** + * Sets senderEmailVerified + * + * @param bool|null $senderEmailVerified [readonly] The SenderEmail must be verified before you can send email using that address + * + * @return $this + */ + public function setSenderEmailVerified(?bool $senderEmailVerified): static + { + if (is_null($senderEmailVerified)) { + throw new InvalidArgumentException('non-nullable senderEmailVerified cannot be null'); + } + $this->container['senderEmailVerified'] = $senderEmailVerified; + + return $this; + } + + /** + * Gets customiseSmtpSettings + * + * @return bool + */ + public function getCustomiseSmtpSettings(): bool + { + return $this->container['customiseSmtpSettings']; + } + + /** + * Sets customiseSmtpSettings + * + * @param bool $customiseSmtpSettings customiseSmtpSettings + * + * @return $this + */ + public function setCustomiseSmtpSettings(bool $customiseSmtpSettings): static + { + if (is_null($customiseSmtpSettings)) { + throw new InvalidArgumentException('non-nullable customiseSmtpSettings cannot be null'); + } + $this->container['customiseSmtpSettings'] = $customiseSmtpSettings; + + return $this; + } + + /** + * Gets smtpSettings + * + * @return \SynergiTech\Staffology\Model\SmtpSettings|null + */ + public function getSmtpSettings(): ?\SynergiTech\Staffology\Model\SmtpSettings + { + return $this->container['smtpSettings']; + } + + /** + * Sets smtpSettings + * + * @param \SynergiTech\Staffology\Model\SmtpSettings|null $smtpSettings smtpSettings + * + * @return $this + */ + public function setSmtpSettings(?\SynergiTech\Staffology\Model\SmtpSettings $smtpSettings): static + { + if (is_null($smtpSettings)) { + throw new InvalidArgumentException('non-nullable smtpSettings cannot be null'); + } + $this->container['smtpSettings'] = $smtpSettings; + + return $this; + } + + /** + * Gets customiseHtmlEmailSettings + * + * @return bool + */ + public function getCustomiseHtmlEmailSettings(): bool + { + return $this->container['customiseHtmlEmailSettings']; + } + + /** + * Sets customiseHtmlEmailSettings + * + * @param bool $customiseHtmlEmailSettings customiseHtmlEmailSettings + * + * @return $this + */ + public function setCustomiseHtmlEmailSettings(bool $customiseHtmlEmailSettings): static + { + if (is_null($customiseHtmlEmailSettings)) { + throw new InvalidArgumentException('non-nullable customiseHtmlEmailSettings cannot be null'); + } + $this->container['customiseHtmlEmailSettings'] = $customiseHtmlEmailSettings; + + return $this; + } + + /** + * Gets htmlEmailSettings + * + * @return \SynergiTech\Staffology\Model\HtmlEmailSettings|null + */ + public function getHtmlEmailSettings(): ?\SynergiTech\Staffology\Model\HtmlEmailSettings + { + return $this->container['htmlEmailSettings']; + } + + /** + * Sets htmlEmailSettings + * + * @param \SynergiTech\Staffology\Model\HtmlEmailSettings|null $htmlEmailSettings htmlEmailSettings + * + * @return $this + */ + public function setHtmlEmailSettings(?\SynergiTech\Staffology\Model\HtmlEmailSettings $htmlEmailSettings): static + { + if (is_null($htmlEmailSettings)) { + throw new InvalidArgumentException('non-nullable htmlEmailSettings cannot be null'); + } + $this->container['htmlEmailSettings'] = $htmlEmailSettings; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/MaritalStatus.php b/src/Model/MaritalStatus.php new file mode 100644 index 0000000..fce3e50 --- /dev/null +++ b/src/Model/MaritalStatus.php @@ -0,0 +1,53 @@ + + */ +class MileageAllowancePaymentsRate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MileageAllowancePaymentsRate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'vehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'rate' => 'float', + 'threshold' => 'int', + 'aboveThresholdRate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'vehicleType' => null, + 'rate' => 'double', + 'threshold' => 'int32', + 'aboveThresholdRate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'vehicleType' => false, + 'rate' => false, + 'threshold' => true, + 'aboveThresholdRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'vehicleType' => 'vehicleType', + 'rate' => 'rate', + 'threshold' => 'threshold', + 'aboveThresholdRate' => 'aboveThresholdRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'vehicleType' => 'setVehicleType', + 'rate' => 'setRate', + 'threshold' => 'setThreshold', + 'aboveThresholdRate' => 'setAboveThresholdRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'vehicleType' => 'getVehicleType', + 'rate' => 'getRate', + 'threshold' => 'getThreshold', + 'aboveThresholdRate' => 'getAboveThresholdRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vehicleType', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('threshold', $data ?? [], null); + $this->setIfExists('aboveThresholdRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['vehicleType']; + } + + /** + * Sets vehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $vehicleType vehicleType + * + * @return $this + */ + public function setVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $vehicleType): static + { + if (is_null($vehicleType)) { + throw new InvalidArgumentException('non-nullable vehicleType cannot be null'); + } + $this->container['vehicleType'] = $vehicleType; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate rate + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets threshold + * + * @return int|null + */ + public function getThreshold(): ?int + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param int|null $threshold threshold + * + * @return $this + */ + public function setThreshold(?int $threshold): static + { + if (is_null($threshold)) { + array_push($this->openAPINullablesSetToNull, 'threshold'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('threshold', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets aboveThresholdRate + * + * @return float|null + */ + public function getAboveThresholdRate(): ?float + { + return $this->container['aboveThresholdRate']; + } + + /** + * Sets aboveThresholdRate + * + * @param float|null $aboveThresholdRate aboveThresholdRate + * + * @return $this + */ + public function setAboveThresholdRate(?float $aboveThresholdRate): static + { + if (is_null($aboveThresholdRate)) { + throw new InvalidArgumentException('non-nullable aboveThresholdRate cannot be null'); + } + $this->container['aboveThresholdRate'] = $aboveThresholdRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/MileageVehicleType.php b/src/Model/MileageVehicleType.php new file mode 100644 index 0000000..b8152c0 --- /dev/null +++ b/src/Model/MileageVehicleType.php @@ -0,0 +1,47 @@ + + */ +class MonthlyMinimum implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MonthlyMinimum'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'enabled' => 'bool', + 'amount' => 'float', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'billPastEndDate' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'enabled' => null, + 'amount' => 'double', + 'startDate' => 'date', + 'endDate' => 'date', + 'billPastEndDate' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'amount' => false, + 'startDate' => true, + 'endDate' => true, + 'billPastEndDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'enabled' => 'enabled', + 'amount' => 'amount', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'billPastEndDate' => 'billPastEndDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'enabled' => 'setEnabled', + 'amount' => 'setAmount', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'billPastEndDate' => 'setBillPastEndDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'enabled' => 'getEnabled', + 'amount' => 'getAmount', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'billPastEndDate' => 'getBillPastEndDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('billPastEndDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled(): ?bool + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled enabled + * + * @return $this + */ + public function setEnabled(?bool $enabled): static + { + if (is_null($enabled)) { + throw new InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount amount + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets billPastEndDate + * + * @return bool|null + */ + public function getBillPastEndDate(): ?bool + { + return $this->container['billPastEndDate']; + } + + /** + * Sets billPastEndDate + * + * @param bool|null $billPastEndDate If set to true then this user should still be billed even after the End Date + * + * @return $this + */ + public function setBillPastEndDate(?bool $billPastEndDate): static + { + if (is_null($billPastEndDate)) { + throw new InvalidArgumentException('non-nullable billPastEndDate cannot be null'); + } + $this->container['billPastEndDate'] = $billPastEndDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NationalInsuranceCalculation.php b/src/Model/NationalInsuranceCalculation.php new file mode 100644 index 0000000..6019309 --- /dev/null +++ b/src/Model/NationalInsuranceCalculation.php @@ -0,0 +1,1042 @@ + + */ +class NationalInsuranceCalculation implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NationalInsuranceCalculation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'breakdown' => '\SynergiTech\Staffology\Model\NationalInsuranceCalculationBase[]', + 'niCategory' => 'string', + 'asDirector' => 'bool', + 'earningsUptoIncludingLEL' => 'float', + 'earningsAboveLELUptoIncludingPT' => 'float', + 'earningsAbovePTUptoIncludingST' => 'float', + 'earningsAbovePTUptoIncludingUEL' => 'float', + 'earningsAboveSTUptoIncludingUEL' => 'float', + 'earningsAboveSTUptoIncludingFUST' => 'float', + 'earningsAboveFUSTUptoIncludingUEL' => 'float', + 'earningsAboveUEL' => 'float', + 'employeeNiGross' => 'float', + 'employeeNiRebate' => 'float', + 'employerNiGross' => 'float', + 'employerNiRebate' => 'float', + 'employeeNi' => 'float', + 'employerNi' => 'float', + 'netNi' => 'float', + 'niablePay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'breakdown' => null, + 'niCategory' => null, + 'asDirector' => null, + 'earningsUptoIncludingLEL' => 'double', + 'earningsAboveLELUptoIncludingPT' => 'double', + 'earningsAbovePTUptoIncludingST' => 'double', + 'earningsAbovePTUptoIncludingUEL' => 'double', + 'earningsAboveSTUptoIncludingUEL' => 'double', + 'earningsAboveSTUptoIncludingFUST' => 'double', + 'earningsAboveFUSTUptoIncludingUEL' => 'double', + 'earningsAboveUEL' => 'double', + 'employeeNiGross' => 'double', + 'employeeNiRebate' => 'double', + 'employerNiGross' => 'double', + 'employerNiRebate' => 'double', + 'employeeNi' => 'double', + 'employerNi' => 'double', + 'netNi' => 'double', + 'niablePay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'breakdown' => true, + 'niCategory' => false, + 'asDirector' => false, + 'earningsUptoIncludingLEL' => false, + 'earningsAboveLELUptoIncludingPT' => false, + 'earningsAbovePTUptoIncludingST' => false, + 'earningsAbovePTUptoIncludingUEL' => false, + 'earningsAboveSTUptoIncludingUEL' => false, + 'earningsAboveSTUptoIncludingFUST' => true, + 'earningsAboveFUSTUptoIncludingUEL' => true, + 'earningsAboveUEL' => false, + 'employeeNiGross' => false, + 'employeeNiRebate' => false, + 'employerNiGross' => false, + 'employerNiRebate' => false, + 'employeeNi' => false, + 'employerNi' => false, + 'netNi' => false, + 'niablePay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'breakdown' => 'breakdown', + 'niCategory' => 'niCategory', + 'asDirector' => 'asDirector', + 'earningsUptoIncludingLEL' => 'earningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'earningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'earningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'earningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'earningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'earningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'earningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'earningsAboveUEL', + 'employeeNiGross' => 'employeeNiGross', + 'employeeNiRebate' => 'employeeNiRebate', + 'employerNiGross' => 'employerNiGross', + 'employerNiRebate' => 'employerNiRebate', + 'employeeNi' => 'employeeNi', + 'employerNi' => 'employerNi', + 'netNi' => 'netNi', + 'niablePay' => 'niablePay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'breakdown' => 'setBreakdown', + 'niCategory' => 'setNiCategory', + 'asDirector' => 'setAsDirector', + 'earningsUptoIncludingLEL' => 'setEarningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'setEarningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'setEarningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'setEarningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'setEarningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'setEarningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'setEarningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'setEarningsAboveUEL', + 'employeeNiGross' => 'setEmployeeNiGross', + 'employeeNiRebate' => 'setEmployeeNiRebate', + 'employerNiGross' => 'setEmployerNiGross', + 'employerNiRebate' => 'setEmployerNiRebate', + 'employeeNi' => 'setEmployeeNi', + 'employerNi' => 'setEmployerNi', + 'netNi' => 'setNetNi', + 'niablePay' => 'setNiablePay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'breakdown' => 'getBreakdown', + 'niCategory' => 'getNiCategory', + 'asDirector' => 'getAsDirector', + 'earningsUptoIncludingLEL' => 'getEarningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'getEarningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'getEarningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'getEarningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'getEarningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'getEarningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'getEarningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'getEarningsAboveUEL', + 'employeeNiGross' => 'getEmployeeNiGross', + 'employeeNiRebate' => 'getEmployeeNiRebate', + 'employerNiGross' => 'getEmployerNiGross', + 'employerNiRebate' => 'getEmployerNiRebate', + 'employeeNi' => 'getEmployeeNi', + 'employerNi' => 'getEmployerNi', + 'netNi' => 'getNetNi', + 'niablePay' => 'getNiablePay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('breakdown', $data ?? [], null); + $this->setIfExists('niCategory', $data ?? [], null); + $this->setIfExists('asDirector', $data ?? [], null); + $this->setIfExists('earningsUptoIncludingLEL', $data ?? [], null); + $this->setIfExists('earningsAboveLELUptoIncludingPT', $data ?? [], null); + $this->setIfExists('earningsAbovePTUptoIncludingST', $data ?? [], null); + $this->setIfExists('earningsAbovePTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveSTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveSTUptoIncludingFUST', $data ?? [], null); + $this->setIfExists('earningsAboveFUSTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveUEL', $data ?? [], null); + $this->setIfExists('employeeNiGross', $data ?? [], null); + $this->setIfExists('employeeNiRebate', $data ?? [], null); + $this->setIfExists('employerNiGross', $data ?? [], null); + $this->setIfExists('employerNiRebate', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('netNi', $data ?? [], null); + $this->setIfExists('niablePay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets breakdown + * + * @return \SynergiTech\Staffology\Model\NationalInsuranceCalculationBase[]|null + */ + public function getBreakdown(): ?array + { + return $this->container['breakdown']; + } + + /** + * Sets breakdown + * + * @param \SynergiTech\Staffology\Model\NationalInsuranceCalculationBase[]|null $breakdown [readonly] List of calculations that make up this calculation + * + * @return $this + */ + public function setBreakdown(?array $breakdown): static + { + if (is_null($breakdown)) { + array_push($this->openAPINullablesSetToNull, 'breakdown'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('breakdown', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['breakdown'] = $breakdown; + + return $this; + } + + /** + * Gets niCategory + * + * @return string|null + */ + public function getNiCategory(): ?string + { + return $this->container['niCategory']; + } + + /** + * Sets niCategory + * + * @param string|null $niCategory Calculated on NI table letter + * + * @return $this + */ + public function setNiCategory(?string $niCategory): static + { + if (is_null($niCategory)) { + throw new InvalidArgumentException('non-nullable niCategory cannot be null'); + } + $this->container['niCategory'] = $niCategory; + + return $this; + } + + /** + * Gets asDirector + * + * @return bool|null + */ + public function getAsDirector(): ?bool + { + return $this->container['asDirector']; + } + + /** + * Sets asDirector + * + * @param bool|null $asDirector Calculated as a Director + * + * @return $this + */ + public function setAsDirector(?bool $asDirector): static + { + if (is_null($asDirector)) { + throw new InvalidArgumentException('non-nullable asDirector cannot be null'); + } + $this->container['asDirector'] = $asDirector; + + return $this; + } + + /** + * Gets earningsUptoIncludingLEL + * + * @return float|null + */ + public function getEarningsUptoIncludingLEL(): ?float + { + return $this->container['earningsUptoIncludingLEL']; + } + + /** + * Sets earningsUptoIncludingLEL + * + * @param float|null $earningsUptoIncludingLEL Earnings up to and including LEL + * + * @return $this + */ + public function setEarningsUptoIncludingLEL(?float $earningsUptoIncludingLEL): static + { + if (is_null($earningsUptoIncludingLEL)) { + throw new InvalidArgumentException('non-nullable earningsUptoIncludingLEL cannot be null'); + } + $this->container['earningsUptoIncludingLEL'] = $earningsUptoIncludingLEL; + + return $this; + } + + /** + * Gets earningsAboveLELUptoIncludingPT + * + * @return float|null + */ + public function getEarningsAboveLELUptoIncludingPT(): ?float + { + return $this->container['earningsAboveLELUptoIncludingPT']; + } + + /** + * Sets earningsAboveLELUptoIncludingPT + * + * @param float|null $earningsAboveLELUptoIncludingPT Earnings above LEL up to PT + * + * @return $this + */ + public function setEarningsAboveLELUptoIncludingPT(?float $earningsAboveLELUptoIncludingPT): static + { + if (is_null($earningsAboveLELUptoIncludingPT)) { + throw new InvalidArgumentException('non-nullable earningsAboveLELUptoIncludingPT cannot be null'); + } + $this->container['earningsAboveLELUptoIncludingPT'] = $earningsAboveLELUptoIncludingPT; + + return $this; + } + + /** + * Gets earningsAbovePTUptoIncludingST + * + * @return float|null + */ + public function getEarningsAbovePTUptoIncludingST(): ?float + { + return $this->container['earningsAbovePTUptoIncludingST']; + } + + /** + * Sets earningsAbovePTUptoIncludingST + * + * @param float|null $earningsAbovePTUptoIncludingST Earnings above PT up to ST + * + * @return $this + */ + public function setEarningsAbovePTUptoIncludingST(?float $earningsAbovePTUptoIncludingST): static + { + if (is_null($earningsAbovePTUptoIncludingST)) { + throw new InvalidArgumentException('non-nullable earningsAbovePTUptoIncludingST cannot be null'); + } + $this->container['earningsAbovePTUptoIncludingST'] = $earningsAbovePTUptoIncludingST; + + return $this; + } + + /** + * Gets earningsAbovePTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAbovePTUptoIncludingUEL(): ?float + { + return $this->container['earningsAbovePTUptoIncludingUEL']; + } + + /** + * Sets earningsAbovePTUptoIncludingUEL + * + * @param float|null $earningsAbovePTUptoIncludingUEL Earnings above PT up to UEL + * + * @return $this + */ + public function setEarningsAbovePTUptoIncludingUEL(?float $earningsAbovePTUptoIncludingUEL): static + { + if (is_null($earningsAbovePTUptoIncludingUEL)) { + throw new InvalidArgumentException('non-nullable earningsAbovePTUptoIncludingUEL cannot be null'); + } + $this->container['earningsAbovePTUptoIncludingUEL'] = $earningsAbovePTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveSTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAboveSTUptoIncludingUEL(): ?float + { + return $this->container['earningsAboveSTUptoIncludingUEL']; + } + + /** + * Sets earningsAboveSTUptoIncludingUEL + * + * @param float|null $earningsAboveSTUptoIncludingUEL Earnings above ST up to UEL + * + * @return $this + */ + public function setEarningsAboveSTUptoIncludingUEL(?float $earningsAboveSTUptoIncludingUEL): static + { + if (is_null($earningsAboveSTUptoIncludingUEL)) { + throw new InvalidArgumentException('non-nullable earningsAboveSTUptoIncludingUEL cannot be null'); + } + $this->container['earningsAboveSTUptoIncludingUEL'] = $earningsAboveSTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveSTUptoIncludingFUST + * + * @return float|null + */ + public function getEarningsAboveSTUptoIncludingFUST(): ?float + { + return $this->container['earningsAboveSTUptoIncludingFUST']; + } + + /** + * Sets earningsAboveSTUptoIncludingFUST + * + * @param float|null $earningsAboveSTUptoIncludingFUST Earnings above ST up to FUST + * + * @return $this + */ + public function setEarningsAboveSTUptoIncludingFUST(?float $earningsAboveSTUptoIncludingFUST): static + { + if (is_null($earningsAboveSTUptoIncludingFUST)) { + array_push($this->openAPINullablesSetToNull, 'earningsAboveSTUptoIncludingFUST'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earningsAboveSTUptoIncludingFUST', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earningsAboveSTUptoIncludingFUST'] = $earningsAboveSTUptoIncludingFUST; + + return $this; + } + + /** + * Gets earningsAboveFUSTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAboveFUSTUptoIncludingUEL(): ?float + { + return $this->container['earningsAboveFUSTUptoIncludingUEL']; + } + + /** + * Sets earningsAboveFUSTUptoIncludingUEL + * + * @param float|null $earningsAboveFUSTUptoIncludingUEL Earnings above FUST up to UEL + * + * @return $this + */ + public function setEarningsAboveFUSTUptoIncludingUEL(?float $earningsAboveFUSTUptoIncludingUEL): static + { + if (is_null($earningsAboveFUSTUptoIncludingUEL)) { + array_push($this->openAPINullablesSetToNull, 'earningsAboveFUSTUptoIncludingUEL'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earningsAboveFUSTUptoIncludingUEL', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earningsAboveFUSTUptoIncludingUEL'] = $earningsAboveFUSTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveUEL + * + * @return float|null + */ + public function getEarningsAboveUEL(): ?float + { + return $this->container['earningsAboveUEL']; + } + + /** + * Sets earningsAboveUEL + * + * @param float|null $earningsAboveUEL Earnings above UEL + * + * @return $this + */ + public function setEarningsAboveUEL(?float $earningsAboveUEL): static + { + if (is_null($earningsAboveUEL)) { + throw new InvalidArgumentException('non-nullable earningsAboveUEL cannot be null'); + } + $this->container['earningsAboveUEL'] = $earningsAboveUEL; + + return $this; + } + + /** + * Gets employeeNiGross + * + * @return float|null + */ + public function getEmployeeNiGross(): ?float + { + return $this->container['employeeNiGross']; + } + + /** + * Sets employeeNiGross + * + * @param float|null $employeeNiGross Employee National Insurance Gross Value + * + * @return $this + */ + public function setEmployeeNiGross(?float $employeeNiGross): static + { + if (is_null($employeeNiGross)) { + throw new InvalidArgumentException('non-nullable employeeNiGross cannot be null'); + } + $this->container['employeeNiGross'] = $employeeNiGross; + + return $this; + } + + /** + * Gets employeeNiRebate + * + * @return float|null + */ + public function getEmployeeNiRebate(): ?float + { + return $this->container['employeeNiRebate']; + } + + /** + * Sets employeeNiRebate + * + * @param float|null $employeeNiRebate Employee National Insurance Rebate Value + * + * @return $this + */ + public function setEmployeeNiRebate(?float $employeeNiRebate): static + { + if (is_null($employeeNiRebate)) { + throw new InvalidArgumentException('non-nullable employeeNiRebate cannot be null'); + } + $this->container['employeeNiRebate'] = $employeeNiRebate; + + return $this; + } + + /** + * Gets employerNiGross + * + * @return float|null + */ + public function getEmployerNiGross(): ?float + { + return $this->container['employerNiGross']; + } + + /** + * Sets employerNiGross + * + * @param float|null $employerNiGross Employer National Insurance Gross Value + * + * @return $this + */ + public function setEmployerNiGross(?float $employerNiGross): static + { + if (is_null($employerNiGross)) { + throw new InvalidArgumentException('non-nullable employerNiGross cannot be null'); + } + $this->container['employerNiGross'] = $employerNiGross; + + return $this; + } + + /** + * Gets employerNiRebate + * + * @return float|null + */ + public function getEmployerNiRebate(): ?float + { + return $this->container['employerNiRebate']; + } + + /** + * Sets employerNiRebate + * + * @param float|null $employerNiRebate Employer National Insurance Rebate Value + * + * @return $this + */ + public function setEmployerNiRebate(?float $employerNiRebate): static + { + if (is_null($employerNiRebate)) { + throw new InvalidArgumentException('non-nullable employerNiRebate cannot be null'); + } + $this->container['employerNiRebate'] = $employerNiRebate; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi [readonly] Net Employee National Insurance + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi [readonly] Net Employer National Insurance + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets netNi + * + * @return float|null + */ + public function getNetNi(): ?float + { + return $this->container['netNi']; + } + + /** + * Sets netNi + * + * @param float|null $netNi [readonly] Net National Insurance (Employer + Employee) + * + * @return $this + */ + public function setNetNi(?float $netNi): static + { + if (is_null($netNi)) { + throw new InvalidArgumentException('non-nullable netNi cannot be null'); + } + $this->container['netNi'] = $netNi; + + return $this; + } + + /** + * Gets niablePay + * + * @return float|null + */ + public function getNiablePay(): ?float + { + return $this->container['niablePay']; + } + + /** + * Sets niablePay + * + * @param float|null $niablePay Niable pay value, required for payrun overrides + * + * @return $this + */ + public function setNiablePay(?float $niablePay): static + { + if (is_null($niablePay)) { + throw new InvalidArgumentException('non-nullable niablePay cannot be null'); + } + $this->container['niablePay'] = $niablePay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NationalInsuranceCalculationBase.php b/src/Model/NationalInsuranceCalculationBase.php new file mode 100644 index 0000000..84312df --- /dev/null +++ b/src/Model/NationalInsuranceCalculationBase.php @@ -0,0 +1,1001 @@ + + */ +class NationalInsuranceCalculationBase implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NationalInsuranceCalculationBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'niCategory' => 'string', + 'asDirector' => 'bool', + 'earningsUptoIncludingLEL' => 'float', + 'earningsAboveLELUptoIncludingPT' => 'float', + 'earningsAbovePTUptoIncludingST' => 'float', + 'earningsAbovePTUptoIncludingUEL' => 'float', + 'earningsAboveSTUptoIncludingUEL' => 'float', + 'earningsAboveSTUptoIncludingFUST' => 'float', + 'earningsAboveFUSTUptoIncludingUEL' => 'float', + 'earningsAboveUEL' => 'float', + 'employeeNiGross' => 'float', + 'employeeNiRebate' => 'float', + 'employerNiGross' => 'float', + 'employerNiRebate' => 'float', + 'employeeNi' => 'float', + 'employerNi' => 'float', + 'netNi' => 'float', + 'niablePay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'niCategory' => null, + 'asDirector' => null, + 'earningsUptoIncludingLEL' => 'double', + 'earningsAboveLELUptoIncludingPT' => 'double', + 'earningsAbovePTUptoIncludingST' => 'double', + 'earningsAbovePTUptoIncludingUEL' => 'double', + 'earningsAboveSTUptoIncludingUEL' => 'double', + 'earningsAboveSTUptoIncludingFUST' => 'double', + 'earningsAboveFUSTUptoIncludingUEL' => 'double', + 'earningsAboveUEL' => 'double', + 'employeeNiGross' => 'double', + 'employeeNiRebate' => 'double', + 'employerNiGross' => 'double', + 'employerNiRebate' => 'double', + 'employeeNi' => 'double', + 'employerNi' => 'double', + 'netNi' => 'double', + 'niablePay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'niCategory' => false, + 'asDirector' => false, + 'earningsUptoIncludingLEL' => false, + 'earningsAboveLELUptoIncludingPT' => false, + 'earningsAbovePTUptoIncludingST' => false, + 'earningsAbovePTUptoIncludingUEL' => false, + 'earningsAboveSTUptoIncludingUEL' => false, + 'earningsAboveSTUptoIncludingFUST' => true, + 'earningsAboveFUSTUptoIncludingUEL' => true, + 'earningsAboveUEL' => false, + 'employeeNiGross' => false, + 'employeeNiRebate' => false, + 'employerNiGross' => false, + 'employerNiRebate' => false, + 'employeeNi' => false, + 'employerNi' => false, + 'netNi' => false, + 'niablePay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'niCategory' => 'niCategory', + 'asDirector' => 'asDirector', + 'earningsUptoIncludingLEL' => 'earningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'earningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'earningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'earningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'earningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'earningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'earningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'earningsAboveUEL', + 'employeeNiGross' => 'employeeNiGross', + 'employeeNiRebate' => 'employeeNiRebate', + 'employerNiGross' => 'employerNiGross', + 'employerNiRebate' => 'employerNiRebate', + 'employeeNi' => 'employeeNi', + 'employerNi' => 'employerNi', + 'netNi' => 'netNi', + 'niablePay' => 'niablePay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'niCategory' => 'setNiCategory', + 'asDirector' => 'setAsDirector', + 'earningsUptoIncludingLEL' => 'setEarningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'setEarningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'setEarningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'setEarningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'setEarningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'setEarningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'setEarningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'setEarningsAboveUEL', + 'employeeNiGross' => 'setEmployeeNiGross', + 'employeeNiRebate' => 'setEmployeeNiRebate', + 'employerNiGross' => 'setEmployerNiGross', + 'employerNiRebate' => 'setEmployerNiRebate', + 'employeeNi' => 'setEmployeeNi', + 'employerNi' => 'setEmployerNi', + 'netNi' => 'setNetNi', + 'niablePay' => 'setNiablePay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'niCategory' => 'getNiCategory', + 'asDirector' => 'getAsDirector', + 'earningsUptoIncludingLEL' => 'getEarningsUptoIncludingLEL', + 'earningsAboveLELUptoIncludingPT' => 'getEarningsAboveLELUptoIncludingPT', + 'earningsAbovePTUptoIncludingST' => 'getEarningsAbovePTUptoIncludingST', + 'earningsAbovePTUptoIncludingUEL' => 'getEarningsAbovePTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingUEL' => 'getEarningsAboveSTUptoIncludingUEL', + 'earningsAboveSTUptoIncludingFUST' => 'getEarningsAboveSTUptoIncludingFUST', + 'earningsAboveFUSTUptoIncludingUEL' => 'getEarningsAboveFUSTUptoIncludingUEL', + 'earningsAboveUEL' => 'getEarningsAboveUEL', + 'employeeNiGross' => 'getEmployeeNiGross', + 'employeeNiRebate' => 'getEmployeeNiRebate', + 'employerNiGross' => 'getEmployerNiGross', + 'employerNiRebate' => 'getEmployerNiRebate', + 'employeeNi' => 'getEmployeeNi', + 'employerNi' => 'getEmployerNi', + 'netNi' => 'getNetNi', + 'niablePay' => 'getNiablePay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('niCategory', $data ?? [], null); + $this->setIfExists('asDirector', $data ?? [], null); + $this->setIfExists('earningsUptoIncludingLEL', $data ?? [], null); + $this->setIfExists('earningsAboveLELUptoIncludingPT', $data ?? [], null); + $this->setIfExists('earningsAbovePTUptoIncludingST', $data ?? [], null); + $this->setIfExists('earningsAbovePTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveSTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveSTUptoIncludingFUST', $data ?? [], null); + $this->setIfExists('earningsAboveFUSTUptoIncludingUEL', $data ?? [], null); + $this->setIfExists('earningsAboveUEL', $data ?? [], null); + $this->setIfExists('employeeNiGross', $data ?? [], null); + $this->setIfExists('employeeNiRebate', $data ?? [], null); + $this->setIfExists('employerNiGross', $data ?? [], null); + $this->setIfExists('employerNiRebate', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('netNi', $data ?? [], null); + $this->setIfExists('niablePay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets niCategory + * + * @return string|null + */ + public function getNiCategory(): ?string + { + return $this->container['niCategory']; + } + + /** + * Sets niCategory + * + * @param string|null $niCategory Calculated on NI table letter + * + * @return $this + */ + public function setNiCategory(?string $niCategory): static + { + if (is_null($niCategory)) { + throw new InvalidArgumentException('non-nullable niCategory cannot be null'); + } + $this->container['niCategory'] = $niCategory; + + return $this; + } + + /** + * Gets asDirector + * + * @return bool|null + */ + public function getAsDirector(): ?bool + { + return $this->container['asDirector']; + } + + /** + * Sets asDirector + * + * @param bool|null $asDirector Calculated as a Director + * + * @return $this + */ + public function setAsDirector(?bool $asDirector): static + { + if (is_null($asDirector)) { + throw new InvalidArgumentException('non-nullable asDirector cannot be null'); + } + $this->container['asDirector'] = $asDirector; + + return $this; + } + + /** + * Gets earningsUptoIncludingLEL + * + * @return float|null + */ + public function getEarningsUptoIncludingLEL(): ?float + { + return $this->container['earningsUptoIncludingLEL']; + } + + /** + * Sets earningsUptoIncludingLEL + * + * @param float|null $earningsUptoIncludingLEL Earnings up to and including LEL + * + * @return $this + */ + public function setEarningsUptoIncludingLEL(?float $earningsUptoIncludingLEL): static + { + if (is_null($earningsUptoIncludingLEL)) { + throw new InvalidArgumentException('non-nullable earningsUptoIncludingLEL cannot be null'); + } + $this->container['earningsUptoIncludingLEL'] = $earningsUptoIncludingLEL; + + return $this; + } + + /** + * Gets earningsAboveLELUptoIncludingPT + * + * @return float|null + */ + public function getEarningsAboveLELUptoIncludingPT(): ?float + { + return $this->container['earningsAboveLELUptoIncludingPT']; + } + + /** + * Sets earningsAboveLELUptoIncludingPT + * + * @param float|null $earningsAboveLELUptoIncludingPT Earnings above LEL up to PT + * + * @return $this + */ + public function setEarningsAboveLELUptoIncludingPT(?float $earningsAboveLELUptoIncludingPT): static + { + if (is_null($earningsAboveLELUptoIncludingPT)) { + throw new InvalidArgumentException('non-nullable earningsAboveLELUptoIncludingPT cannot be null'); + } + $this->container['earningsAboveLELUptoIncludingPT'] = $earningsAboveLELUptoIncludingPT; + + return $this; + } + + /** + * Gets earningsAbovePTUptoIncludingST + * + * @return float|null + */ + public function getEarningsAbovePTUptoIncludingST(): ?float + { + return $this->container['earningsAbovePTUptoIncludingST']; + } + + /** + * Sets earningsAbovePTUptoIncludingST + * + * @param float|null $earningsAbovePTUptoIncludingST Earnings above PT up to ST + * + * @return $this + */ + public function setEarningsAbovePTUptoIncludingST(?float $earningsAbovePTUptoIncludingST): static + { + if (is_null($earningsAbovePTUptoIncludingST)) { + throw new InvalidArgumentException('non-nullable earningsAbovePTUptoIncludingST cannot be null'); + } + $this->container['earningsAbovePTUptoIncludingST'] = $earningsAbovePTUptoIncludingST; + + return $this; + } + + /** + * Gets earningsAbovePTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAbovePTUptoIncludingUEL(): ?float + { + return $this->container['earningsAbovePTUptoIncludingUEL']; + } + + /** + * Sets earningsAbovePTUptoIncludingUEL + * + * @param float|null $earningsAbovePTUptoIncludingUEL Earnings above PT up to UEL + * + * @return $this + */ + public function setEarningsAbovePTUptoIncludingUEL(?float $earningsAbovePTUptoIncludingUEL): static + { + if (is_null($earningsAbovePTUptoIncludingUEL)) { + throw new InvalidArgumentException('non-nullable earningsAbovePTUptoIncludingUEL cannot be null'); + } + $this->container['earningsAbovePTUptoIncludingUEL'] = $earningsAbovePTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveSTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAboveSTUptoIncludingUEL(): ?float + { + return $this->container['earningsAboveSTUptoIncludingUEL']; + } + + /** + * Sets earningsAboveSTUptoIncludingUEL + * + * @param float|null $earningsAboveSTUptoIncludingUEL Earnings above ST up to UEL + * + * @return $this + */ + public function setEarningsAboveSTUptoIncludingUEL(?float $earningsAboveSTUptoIncludingUEL): static + { + if (is_null($earningsAboveSTUptoIncludingUEL)) { + throw new InvalidArgumentException('non-nullable earningsAboveSTUptoIncludingUEL cannot be null'); + } + $this->container['earningsAboveSTUptoIncludingUEL'] = $earningsAboveSTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveSTUptoIncludingFUST + * + * @return float|null + */ + public function getEarningsAboveSTUptoIncludingFUST(): ?float + { + return $this->container['earningsAboveSTUptoIncludingFUST']; + } + + /** + * Sets earningsAboveSTUptoIncludingFUST + * + * @param float|null $earningsAboveSTUptoIncludingFUST Earnings above ST up to FUST + * + * @return $this + */ + public function setEarningsAboveSTUptoIncludingFUST(?float $earningsAboveSTUptoIncludingFUST): static + { + if (is_null($earningsAboveSTUptoIncludingFUST)) { + array_push($this->openAPINullablesSetToNull, 'earningsAboveSTUptoIncludingFUST'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earningsAboveSTUptoIncludingFUST', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earningsAboveSTUptoIncludingFUST'] = $earningsAboveSTUptoIncludingFUST; + + return $this; + } + + /** + * Gets earningsAboveFUSTUptoIncludingUEL + * + * @return float|null + */ + public function getEarningsAboveFUSTUptoIncludingUEL(): ?float + { + return $this->container['earningsAboveFUSTUptoIncludingUEL']; + } + + /** + * Sets earningsAboveFUSTUptoIncludingUEL + * + * @param float|null $earningsAboveFUSTUptoIncludingUEL Earnings above FUST up to UEL + * + * @return $this + */ + public function setEarningsAboveFUSTUptoIncludingUEL(?float $earningsAboveFUSTUptoIncludingUEL): static + { + if (is_null($earningsAboveFUSTUptoIncludingUEL)) { + array_push($this->openAPINullablesSetToNull, 'earningsAboveFUSTUptoIncludingUEL'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earningsAboveFUSTUptoIncludingUEL', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earningsAboveFUSTUptoIncludingUEL'] = $earningsAboveFUSTUptoIncludingUEL; + + return $this; + } + + /** + * Gets earningsAboveUEL + * + * @return float|null + */ + public function getEarningsAboveUEL(): ?float + { + return $this->container['earningsAboveUEL']; + } + + /** + * Sets earningsAboveUEL + * + * @param float|null $earningsAboveUEL Earnings above UEL + * + * @return $this + */ + public function setEarningsAboveUEL(?float $earningsAboveUEL): static + { + if (is_null($earningsAboveUEL)) { + throw new InvalidArgumentException('non-nullable earningsAboveUEL cannot be null'); + } + $this->container['earningsAboveUEL'] = $earningsAboveUEL; + + return $this; + } + + /** + * Gets employeeNiGross + * + * @return float|null + */ + public function getEmployeeNiGross(): ?float + { + return $this->container['employeeNiGross']; + } + + /** + * Sets employeeNiGross + * + * @param float|null $employeeNiGross Employee National Insurance Gross Value + * + * @return $this + */ + public function setEmployeeNiGross(?float $employeeNiGross): static + { + if (is_null($employeeNiGross)) { + throw new InvalidArgumentException('non-nullable employeeNiGross cannot be null'); + } + $this->container['employeeNiGross'] = $employeeNiGross; + + return $this; + } + + /** + * Gets employeeNiRebate + * + * @return float|null + */ + public function getEmployeeNiRebate(): ?float + { + return $this->container['employeeNiRebate']; + } + + /** + * Sets employeeNiRebate + * + * @param float|null $employeeNiRebate Employee National Insurance Rebate Value + * + * @return $this + */ + public function setEmployeeNiRebate(?float $employeeNiRebate): static + { + if (is_null($employeeNiRebate)) { + throw new InvalidArgumentException('non-nullable employeeNiRebate cannot be null'); + } + $this->container['employeeNiRebate'] = $employeeNiRebate; + + return $this; + } + + /** + * Gets employerNiGross + * + * @return float|null + */ + public function getEmployerNiGross(): ?float + { + return $this->container['employerNiGross']; + } + + /** + * Sets employerNiGross + * + * @param float|null $employerNiGross Employer National Insurance Gross Value + * + * @return $this + */ + public function setEmployerNiGross(?float $employerNiGross): static + { + if (is_null($employerNiGross)) { + throw new InvalidArgumentException('non-nullable employerNiGross cannot be null'); + } + $this->container['employerNiGross'] = $employerNiGross; + + return $this; + } + + /** + * Gets employerNiRebate + * + * @return float|null + */ + public function getEmployerNiRebate(): ?float + { + return $this->container['employerNiRebate']; + } + + /** + * Sets employerNiRebate + * + * @param float|null $employerNiRebate Employer National Insurance Rebate Value + * + * @return $this + */ + public function setEmployerNiRebate(?float $employerNiRebate): static + { + if (is_null($employerNiRebate)) { + throw new InvalidArgumentException('non-nullable employerNiRebate cannot be null'); + } + $this->container['employerNiRebate'] = $employerNiRebate; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi [readonly] Net Employee National Insurance + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi [readonly] Net Employer National Insurance + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets netNi + * + * @return float|null + */ + public function getNetNi(): ?float + { + return $this->container['netNi']; + } + + /** + * Sets netNi + * + * @param float|null $netNi [readonly] Net National Insurance (Employer + Employee) + * + * @return $this + */ + public function setNetNi(?float $netNi): static + { + if (is_null($netNi)) { + throw new InvalidArgumentException('non-nullable netNi cannot be null'); + } + $this->container['netNi'] = $netNi; + + return $this; + } + + /** + * Gets niablePay + * + * @return float|null + */ + public function getNiablePay(): ?float + { + return $this->container['niablePay']; + } + + /** + * Sets niablePay + * + * @param float|null $niablePay Niable pay value, required for payrun overrides + * + * @return $this + */ + public function setNiablePay(?float $niablePay): static + { + if (is_null($niablePay)) { + throw new InvalidArgumentException('non-nullable niablePay cannot be null'); + } + $this->container['niablePay'] = $niablePay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NationalInsuranceCalculationPeriodValues.php b/src/Model/NationalInsuranceCalculationPeriodValues.php new file mode 100644 index 0000000..86ce67a --- /dev/null +++ b/src/Model/NationalInsuranceCalculationPeriodValues.php @@ -0,0 +1,681 @@ + + */ +class NationalInsuranceCalculationPeriodValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NationalInsuranceCalculationPeriodValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lel' => 'float', + 'pt' => 'float', + 'st' => 'float', + 'fust' => 'float', + 'uap' => 'float', + 'ust' => 'float', + 'aust' => 'float', + 'uel' => 'float', + 'vust' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lel' => 'double', + 'pt' => 'double', + 'st' => 'double', + 'fust' => 'double', + 'uap' => 'double', + 'ust' => 'double', + 'aust' => 'double', + 'uel' => 'double', + 'vust' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lel' => false, + 'pt' => false, + 'st' => false, + 'fust' => false, + 'uap' => false, + 'ust' => false, + 'aust' => false, + 'uel' => false, + 'vust' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lel' => 'lel', + 'pt' => 'pt', + 'st' => 'st', + 'fust' => 'fust', + 'uap' => 'uap', + 'ust' => 'ust', + 'aust' => 'aust', + 'uel' => 'uel', + 'vust' => 'vust' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lel' => 'setLel', + 'pt' => 'setPt', + 'st' => 'setSt', + 'fust' => 'setFust', + 'uap' => 'setUap', + 'ust' => 'setUst', + 'aust' => 'setAust', + 'uel' => 'setUel', + 'vust' => 'setVust' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lel' => 'getLel', + 'pt' => 'getPt', + 'st' => 'getSt', + 'fust' => 'getFust', + 'uap' => 'getUap', + 'ust' => 'getUst', + 'aust' => 'getAust', + 'uel' => 'getUel', + 'vust' => 'getVust' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lel', $data ?? [], null); + $this->setIfExists('pt', $data ?? [], null); + $this->setIfExists('st', $data ?? [], null); + $this->setIfExists('fust', $data ?? [], null); + $this->setIfExists('uap', $data ?? [], null); + $this->setIfExists('ust', $data ?? [], null); + $this->setIfExists('aust', $data ?? [], null); + $this->setIfExists('uel', $data ?? [], null); + $this->setIfExists('vust', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lel + * + * @return float|null + */ + public function getLel(): ?float + { + return $this->container['lel']; + } + + /** + * Sets lel + * + * @param float|null $lel [readonly] Lower Earnings Limit + * + * @return $this + */ + public function setLel(?float $lel): static + { + if (is_null($lel)) { + throw new InvalidArgumentException('non-nullable lel cannot be null'); + } + $this->container['lel'] = $lel; + + return $this; + } + + /** + * Gets pt + * + * @return float|null + */ + public function getPt(): ?float + { + return $this->container['pt']; + } + + /** + * Sets pt + * + * @param float|null $pt [readonly] Primary Threshold + * + * @return $this + */ + public function setPt(?float $pt): static + { + if (is_null($pt)) { + throw new InvalidArgumentException('non-nullable pt cannot be null'); + } + $this->container['pt'] = $pt; + + return $this; + } + + /** + * Gets st + * + * @return float|null + */ + public function getSt(): ?float + { + return $this->container['st']; + } + + /** + * Sets st + * + * @param float|null $st [readonly] Secondary Threshold + * + * @return $this + */ + public function setSt(?float $st): static + { + if (is_null($st)) { + throw new InvalidArgumentException('non-nullable st cannot be null'); + } + $this->container['st'] = $st; + + return $this; + } + + /** + * Gets fust + * + * @return float|null + */ + public function getFust(): ?float + { + return $this->container['fust']; + } + + /** + * Sets fust + * + * @param float|null $fust [readonly] Freeports Upper Accrual Threshold + * + * @return $this + */ + public function setFust(?float $fust): static + { + if (is_null($fust)) { + throw new InvalidArgumentException('non-nullable fust cannot be null'); + } + $this->container['fust'] = $fust; + + return $this; + } + + /** + * Gets uap + * + * @return float|null + */ + public function getUap(): ?float + { + return $this->container['uap']; + } + + /** + * Sets uap + * + * @param float|null $uap [readonly] Upper Accrual Point + * + * @return $this + */ + public function setUap(?float $uap): static + { + if (is_null($uap)) { + throw new InvalidArgumentException('non-nullable uap cannot be null'); + } + $this->container['uap'] = $uap; + + return $this; + } + + /** + * Gets ust + * + * @return float|null + */ + public function getUst(): ?float + { + return $this->container['ust']; + } + + /** + * Sets ust + * + * @param float|null $ust [readonly] Upper Secondary Threshold (under 21) + * + * @return $this + */ + public function setUst(?float $ust): static + { + if (is_null($ust)) { + throw new InvalidArgumentException('non-nullable ust cannot be null'); + } + $this->container['ust'] = $ust; + + return $this; + } + + /** + * Gets aust + * + * @return float|null + */ + public function getAust(): ?float + { + return $this->container['aust']; + } + + /** + * Sets aust + * + * @param float|null $aust [readonly] Apprentice Upper Secondary Threshold (apprentice under 25) + * + * @return $this + */ + public function setAust(?float $aust): static + { + if (is_null($aust)) { + throw new InvalidArgumentException('non-nullable aust cannot be null'); + } + $this->container['aust'] = $aust; + + return $this; + } + + /** + * Gets uel + * + * @return float|null + */ + public function getUel(): ?float + { + return $this->container['uel']; + } + + /** + * Sets uel + * + * @param float|null $uel [readonly] Upper Earnings Limit + * + * @return $this + */ + public function setUel(?float $uel): static + { + if (is_null($uel)) { + throw new InvalidArgumentException('non-nullable uel cannot be null'); + } + $this->container['uel'] = $uel; + + return $this; + } + + /** + * Gets vust + * + * @return float|null + */ + public function getVust(): ?float + { + return $this->container['vust']; + } + + /** + * Sets vust + * + * @param float|null $vust [readonly] Veterian Upper Secondary Threshold + * + * @return $this + */ + public function setVust(?float $vust): static + { + if (is_null($vust)) { + throw new InvalidArgumentException('non-nullable vust cannot be null'); + } + $this->container['vust'] = $vust; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NationalInsuranceCode.php b/src/Model/NationalInsuranceCode.php new file mode 100644 index 0000000..e2d0785 --- /dev/null +++ b/src/Model/NationalInsuranceCode.php @@ -0,0 +1,872 @@ + + */ +class NationalInsuranceCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NationalInsuranceCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'description' => 'string', + 'eeB' => 'float', + 'eeC' => 'float', + 'eeD' => 'float', + 'eeE' => 'float', + 'eeF' => 'float', + 'erB' => 'float', + 'erC' => 'float', + 'erD' => 'float', + 'erE' => 'float', + 'erF' => 'float', + 'effectiveFrom' => '\DateTime', + 'midYearChanges' => '\SynergiTech\Staffology\Model\NationalInsuranceCode[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'description' => null, + 'eeB' => 'double', + 'eeC' => 'double', + 'eeD' => 'double', + 'eeE' => 'double', + 'eeF' => 'double', + 'erB' => 'double', + 'erC' => 'double', + 'erD' => 'double', + 'erE' => 'double', + 'erF' => 'double', + 'effectiveFrom' => 'date', + 'midYearChanges' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'description' => true, + 'eeB' => false, + 'eeC' => false, + 'eeD' => false, + 'eeE' => false, + 'eeF' => false, + 'erB' => false, + 'erC' => false, + 'erD' => false, + 'erE' => false, + 'erF' => false, + 'effectiveFrom' => true, + 'midYearChanges' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'description' => 'description', + 'eeB' => 'eeB', + 'eeC' => 'eeC', + 'eeD' => 'eeD', + 'eeE' => 'eeE', + 'eeF' => 'eeF', + 'erB' => 'erB', + 'erC' => 'erC', + 'erD' => 'erD', + 'erE' => 'erE', + 'erF' => 'erF', + 'effectiveFrom' => 'effectiveFrom', + 'midYearChanges' => 'midYearChanges' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'description' => 'setDescription', + 'eeB' => 'setEeB', + 'eeC' => 'setEeC', + 'eeD' => 'setEeD', + 'eeE' => 'setEeE', + 'eeF' => 'setEeF', + 'erB' => 'setErB', + 'erC' => 'setErC', + 'erD' => 'setErD', + 'erE' => 'setErE', + 'erF' => 'setErF', + 'effectiveFrom' => 'setEffectiveFrom', + 'midYearChanges' => 'setMidYearChanges' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'description' => 'getDescription', + 'eeB' => 'getEeB', + 'eeC' => 'getEeC', + 'eeD' => 'getEeD', + 'eeE' => 'getEeE', + 'eeF' => 'getEeF', + 'erB' => 'getErB', + 'erC' => 'getErC', + 'erD' => 'getErD', + 'erE' => 'getErE', + 'erF' => 'getErF', + 'effectiveFrom' => 'getEffectiveFrom', + 'midYearChanges' => 'getMidYearChanges' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('eeB', $data ?? [], null); + $this->setIfExists('eeC', $data ?? [], null); + $this->setIfExists('eeD', $data ?? [], null); + $this->setIfExists('eeE', $data ?? [], null); + $this->setIfExists('eeF', $data ?? [], null); + $this->setIfExists('erB', $data ?? [], null); + $this->setIfExists('erC', $data ?? [], null); + $this->setIfExists('erD', $data ?? [], null); + $this->setIfExists('erE', $data ?? [], null); + $this->setIfExists('erF', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('midYearChanges', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code [readonly] NI Table Letter + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description [readonly] Description of Employees that would use this NI Letter + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets eeB + * + * @return float|null + */ + public function getEeB(): ?float + { + return $this->container['eeB']; + } + + /** + * Sets eeB + * + * @param float|null $eeB [readonly] Earnings at or above LEL up to and including PT (Employee Contribution) + * + * @return $this + */ + public function setEeB(?float $eeB): static + { + if (is_null($eeB)) { + throw new InvalidArgumentException('non-nullable eeB cannot be null'); + } + $this->container['eeB'] = $eeB; + + return $this; + } + + /** + * Gets eeC + * + * @return float|null + */ + public function getEeC(): ?float + { + return $this->container['eeC']; + } + + /** + * Sets eeC + * + * @param float|null $eeC [readonly] Earnings above the PT up to and including UEL (Employee Contribution) + * + * @return $this + */ + public function setEeC(?float $eeC): static + { + if (is_null($eeC)) { + throw new InvalidArgumentException('non-nullable eeC cannot be null'); + } + $this->container['eeC'] = $eeC; + + return $this; + } + + /** + * Gets eeD + * + * @return float|null + */ + public function getEeD(): ?float + { + return $this->container['eeD']; + } + + /** + * Sets eeD + * + * @param float|null $eeD [readonly] Balance of earnings above UEL (Employee Contribution) + * + * @return $this + */ + public function setEeD(?float $eeD): static + { + if (is_null($eeD)) { + throw new InvalidArgumentException('non-nullable eeD cannot be null'); + } + $this->container['eeD'] = $eeD; + + return $this; + } + + /** + * Gets eeE + * + * @return float|null + */ + public function getEeE(): ?float + { + return $this->container['eeE']; + } + + /** + * Sets eeE + * + * @param float|null $eeE [readonly] + * + * @return $this + */ + public function setEeE(?float $eeE): static + { + if (is_null($eeE)) { + throw new InvalidArgumentException('non-nullable eeE cannot be null'); + } + $this->container['eeE'] = $eeE; + + return $this; + } + + /** + * Gets eeF + * + * @return float|null + */ + public function getEeF(): ?float + { + return $this->container['eeF']; + } + + /** + * Sets eeF + * + * @param float|null $eeF [readonly] + * + * @return $this + */ + public function setEeF(?float $eeF): static + { + if (is_null($eeF)) { + throw new InvalidArgumentException('non-nullable eeF cannot be null'); + } + $this->container['eeF'] = $eeF; + + return $this; + } + + /** + * Gets erB + * + * @return float|null + */ + public function getErB(): ?float + { + return $this->container['erB']; + } + + /** + * Sets erB + * + * @param float|null $erB [readonly] Earnings at or above LEL up to and including PT (Employer Contribution) + * + * @return $this + */ + public function setErB(?float $erB): static + { + if (is_null($erB)) { + throw new InvalidArgumentException('non-nullable erB cannot be null'); + } + $this->container['erB'] = $erB; + + return $this; + } + + /** + * Gets erC + * + * @return float|null + */ + public function getErC(): ?float + { + return $this->container['erC']; + } + + /** + * Sets erC + * + * @param float|null $erC [readonly] Earnings above the PT up to and including UEL (Employer Contribution) + * + * @return $this + */ + public function setErC(?float $erC): static + { + if (is_null($erC)) { + throw new InvalidArgumentException('non-nullable erC cannot be null'); + } + $this->container['erC'] = $erC; + + return $this; + } + + /** + * Gets erD + * + * @return float|null + */ + public function getErD(): ?float + { + return $this->container['erD']; + } + + /** + * Sets erD + * + * @param float|null $erD [readonly] Balance of earnings above UEL (Employer Contribution) + * + * @return $this + */ + public function setErD(?float $erD): static + { + if (is_null($erD)) { + throw new InvalidArgumentException('non-nullable erD cannot be null'); + } + $this->container['erD'] = $erD; + + return $this; + } + + /** + * Gets erE + * + * @return float|null + */ + public function getErE(): ?float + { + return $this->container['erE']; + } + + /** + * Sets erE + * + * @param float|null $erE [readonly] + * + * @return $this + */ + public function setErE(?float $erE): static + { + if (is_null($erE)) { + throw new InvalidArgumentException('non-nullable erE cannot be null'); + } + $this->container['erE'] = $erE; + + return $this; + } + + /** + * Gets erF + * + * @return float|null + */ + public function getErF(): ?float + { + return $this->container['erF']; + } + + /** + * Sets erF + * + * @param float|null $erF [readonly] + * + * @return $this + */ + public function setErF(?float $erF): static + { + if (is_null($erF)) { + throw new InvalidArgumentException('non-nullable erF cannot be null'); + } + $this->container['erF'] = $erF; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when these period values are effective + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets midYearChanges + * + * @return \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null + */ + public function getMidYearChanges(): ?array + { + return $this->container['midYearChanges']; + } + + /** + * Sets midYearChanges + * + * @param \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null $midYearChanges Any optional changes to the period values that are effective from a specified date in the middle of a tax year + * + * @return $this + */ + public function setMidYearChanges(?array $midYearChanges): static + { + if (is_null($midYearChanges)) { + array_push($this->openAPINullablesSetToNull, 'midYearChanges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('midYearChanges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['midYearChanges'] = $midYearChanges; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NationalMinimumWage.php b/src/Model/NationalMinimumWage.php new file mode 100644 index 0000000..0ef6151 --- /dev/null +++ b/src/Model/NationalMinimumWage.php @@ -0,0 +1,484 @@ + + */ +class NationalMinimumWage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NationalMinimumWage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'apprentice' => 'bool', + 'maxAge' => 'int', + 'hourlyAmount' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'apprentice' => null, + 'maxAge' => 'int32', + 'hourlyAmount' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'apprentice' => true, + 'maxAge' => false, + 'hourlyAmount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'apprentice' => 'apprentice', + 'maxAge' => 'maxAge', + 'hourlyAmount' => 'hourlyAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'apprentice' => 'setApprentice', + 'maxAge' => 'setMaxAge', + 'hourlyAmount' => 'setHourlyAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'apprentice' => 'getApprentice', + 'maxAge' => 'getMaxAge', + 'hourlyAmount' => 'getHourlyAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('apprentice', $data ?? [], null); + $this->setIfExists('maxAge', $data ?? [], null); + $this->setIfExists('hourlyAmount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets apprentice + * + * @return bool|null + */ + public function getApprentice(): ?bool + { + return $this->container['apprentice']; + } + + /** + * Sets apprentice + * + * @param bool|null $apprentice apprentice + * + * @return $this + */ + public function setApprentice(?bool $apprentice): static + { + if (is_null($apprentice)) { + array_push($this->openAPINullablesSetToNull, 'apprentice'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('apprentice', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['apprentice'] = $apprentice; + + return $this; + } + + /** + * Gets maxAge + * + * @return int|null + */ + public function getMaxAge(): ?int + { + return $this->container['maxAge']; + } + + /** + * Sets maxAge + * + * @param int|null $maxAge maxAge + * + * @return $this + */ + public function setMaxAge(?int $maxAge): static + { + if (is_null($maxAge)) { + throw new InvalidArgumentException('non-nullable maxAge cannot be null'); + } + $this->container['maxAge'] = $maxAge; + + return $this; + } + + /** + * Gets hourlyAmount + * + * @return float|null + */ + public function getHourlyAmount(): ?float + { + return $this->container['hourlyAmount']; + } + + /** + * Sets hourlyAmount + * + * @param float|null $hourlyAmount hourlyAmount + * + * @return $this + */ + public function setHourlyAmount(?float $hourlyAmount): static + { + if (is_null($hourlyAmount)) { + throw new InvalidArgumentException('non-nullable hourlyAmount cannot be null'); + } + $this->container['hourlyAmount'] = $hourlyAmount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiLetterError.php b/src/Model/NiLetterError.php new file mode 100644 index 0000000..cce521d --- /dev/null +++ b/src/Model/NiLetterError.php @@ -0,0 +1,89 @@ + + */ +class NiLetterValidationReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiLetterValidationReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'basedOnPayrun' => 'bool', + 'errorLines' => '\SynergiTech\Staffology\Model\NiLetterValidationReportLine[]', + 'paymentDate' => '\DateTime', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'basedOnPayrun' => null, + 'errorLines' => null, + 'paymentDate' => 'date', + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'basedOnPayrun' => false, + 'errorLines' => true, + 'paymentDate' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'basedOnPayrun' => 'basedOnPayrun', + 'errorLines' => 'errorLines', + 'paymentDate' => 'paymentDate', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'basedOnPayrun' => 'setBasedOnPayrun', + 'errorLines' => 'setErrorLines', + 'paymentDate' => 'setPaymentDate', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'basedOnPayrun' => 'getBasedOnPayrun', + 'errorLines' => 'getErrorLines', + 'paymentDate' => 'getPaymentDate', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('basedOnPayrun', $data ?? [], null); + $this->setIfExists('errorLines', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets basedOnPayrun + * + * @return bool|null + */ + public function getBasedOnPayrun(): ?bool + { + return $this->container['basedOnPayrun']; + } + + /** + * Sets basedOnPayrun + * + * @param bool|null $basedOnPayrun If false, then any payrun related information (Tax year, etc) should be ignored. + * + * @return $this + */ + public function setBasedOnPayrun(?bool $basedOnPayrun): static + { + if (is_null($basedOnPayrun)) { + throw new InvalidArgumentException('non-nullable basedOnPayrun cannot be null'); + } + $this->container['basedOnPayrun'] = $basedOnPayrun; + + return $this; + } + + /** + * Gets errorLines + * + * @return \SynergiTech\Staffology\Model\NiLetterValidationReportLine[]|null + */ + public function getErrorLines(): ?array + { + return $this->container['errorLines']; + } + + /** + * Sets errorLines + * + * @param \SynergiTech\Staffology\Model\NiLetterValidationReportLine[]|null $errorLines errorLines + * + * @return $this + */ + public function setErrorLines(?array $errorLines): static + { + if (is_null($errorLines)) { + array_push($this->openAPINullablesSetToNull, 'errorLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errorLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errorLines'] = $errorLines; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate paymentDate + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + array_push($this->openAPINullablesSetToNull, 'paymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiLetterValidationReportLine.php b/src/Model/NiLetterValidationReportLine.php new file mode 100644 index 0000000..08ecbb5 --- /dev/null +++ b/src/Model/NiLetterValidationReportLine.php @@ -0,0 +1,756 @@ + + */ +class NiLetterValidationReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiLetterValidationReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeId' => 'string', + 'payrollCode' => 'string', + 'name' => 'string', + 'niNumber' => 'string', + 'gender' => '\SynergiTech\Staffology\Model\Gender', + 'dateOfBirth' => '\DateTime', + 'niLetterError' => '\SynergiTech\Staffology\Model\NiLetterError', + 'errorDetails' => 'string', + 'niLetter' => 'string', + 'suggestedLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeId' => 'uuid', + 'payrollCode' => null, + 'name' => null, + 'niNumber' => null, + 'gender' => null, + 'dateOfBirth' => 'date', + 'niLetterError' => null, + 'errorDetails' => null, + 'niLetter' => null, + 'suggestedLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeId' => false, + 'payrollCode' => true, + 'name' => true, + 'niNumber' => true, + 'gender' => false, + 'dateOfBirth' => false, + 'niLetterError' => false, + 'errorDetails' => true, + 'niLetter' => true, + 'suggestedLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeId' => 'employeeId', + 'payrollCode' => 'payrollCode', + 'name' => 'name', + 'niNumber' => 'niNumber', + 'gender' => 'gender', + 'dateOfBirth' => 'dateOfBirth', + 'niLetterError' => 'niLetterError', + 'errorDetails' => 'errorDetails', + 'niLetter' => 'niLetter', + 'suggestedLetter' => 'suggestedLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeId' => 'setEmployeeId', + 'payrollCode' => 'setPayrollCode', + 'name' => 'setName', + 'niNumber' => 'setNiNumber', + 'gender' => 'setGender', + 'dateOfBirth' => 'setDateOfBirth', + 'niLetterError' => 'setNiLetterError', + 'errorDetails' => 'setErrorDetails', + 'niLetter' => 'setNiLetter', + 'suggestedLetter' => 'setSuggestedLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeId' => 'getEmployeeId', + 'payrollCode' => 'getPayrollCode', + 'name' => 'getName', + 'niNumber' => 'getNiNumber', + 'gender' => 'getGender', + 'dateOfBirth' => 'getDateOfBirth', + 'niLetterError' => 'getNiLetterError', + 'errorDetails' => 'getErrorDetails', + 'niLetter' => 'getNiLetter', + 'suggestedLetter' => 'getSuggestedLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('niLetterError', $data ?? [], null); + $this->setIfExists('errorDetails', $data ?? [], null); + $this->setIfExists('niLetter', $data ?? [], null); + $this->setIfExists('suggestedLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId employeeId + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets gender + * + * @return \SynergiTech\Staffology\Model\Gender|null + */ + public function getGender(): ?\SynergiTech\Staffology\Model\Gender + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \SynergiTech\Staffology\Model\Gender|null $gender gender + * + * @return $this + */ + public function setGender(?\SynergiTech\Staffology\Model\Gender $gender): static + { + if (is_null($gender)) { + throw new InvalidArgumentException('non-nullable gender cannot be null'); + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime|null + */ + public function getDateOfBirth(): ?\DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime|null $dateOfBirth dateOfBirth + * + * @return $this + */ + public function setDateOfBirth(?\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets niLetterError + * + * @return \SynergiTech\Staffology\Model\NiLetterError|null + */ + public function getNiLetterError(): ?\SynergiTech\Staffology\Model\NiLetterError + { + return $this->container['niLetterError']; + } + + /** + * Sets niLetterError + * + * @param \SynergiTech\Staffology\Model\NiLetterError|null $niLetterError niLetterError + * + * @return $this + */ + public function setNiLetterError(?\SynergiTech\Staffology\Model\NiLetterError $niLetterError): static + { + if (is_null($niLetterError)) { + throw new InvalidArgumentException('non-nullable niLetterError cannot be null'); + } + $this->container['niLetterError'] = $niLetterError; + + return $this; + } + + /** + * Gets errorDetails + * + * @return string|null + */ + public function getErrorDetails(): ?string + { + return $this->container['errorDetails']; + } + + /** + * Sets errorDetails + * + * @param string|null $errorDetails errorDetails + * + * @return $this + */ + public function setErrorDetails(?string $errorDetails): static + { + if (is_null($errorDetails)) { + array_push($this->openAPINullablesSetToNull, 'errorDetails'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('errorDetails', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['errorDetails'] = $errorDetails; + + return $this; + } + + /** + * Gets niLetter + * + * @return string|null + */ + public function getNiLetter(): ?string + { + return $this->container['niLetter']; + } + + /** + * Sets niLetter + * + * @param string|null $niLetter niLetter + * + * @return $this + */ + public function setNiLetter(?string $niLetter): static + { + if (is_null($niLetter)) { + array_push($this->openAPINullablesSetToNull, 'niLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niLetter'] = $niLetter; + + return $this; + } + + /** + * Gets suggestedLetter + * + * @return string|null + */ + public function getSuggestedLetter(): ?string + { + return $this->container['suggestedLetter']; + } + + /** + * Sets suggestedLetter + * + * @param string|null $suggestedLetter suggestedLetter + * + * @return $this + */ + public function setSuggestedLetter(?string $suggestedLetter): static + { + if (is_null($suggestedLetter)) { + array_push($this->openAPINullablesSetToNull, 'suggestedLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('suggestedLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['suggestedLetter'] = $suggestedLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiLetterValidationReportReportResponse.php b/src/Model/NiLetterValidationReportReportResponse.php new file mode 100644 index 0000000..9e59f87 --- /dev/null +++ b/src/Model/NiLetterValidationReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class NiLetterValidationReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiLetterValidationReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\NiLetterValidationReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\NiLetterValidationReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\NiLetterValidationReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\NiLetterValidationReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\NiLetterValidationReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiYtdReport.php b/src/Model/NiYtdReport.php new file mode 100644 index 0000000..73bc54c --- /dev/null +++ b/src/Model/NiYtdReport.php @@ -0,0 +1,592 @@ + + */ +class NiYtdReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiYtdReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrun' => '\SynergiTech\Staffology\Model\PayRun', + 'lines' => '\SynergiTech\Staffology\Model\EmployeeNiYtdValues[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrun' => null, + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrun' => false, + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrun' => 'payrun', + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrun' => 'setPayrun', + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrun' => 'getPayrun', + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrun', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrun + * + * @return \SynergiTech\Staffology\Model\PayRun|null + */ + public function getPayrun(): ?\SynergiTech\Staffology\Model\PayRun + { + return $this->container['payrun']; + } + + /** + * Sets payrun + * + * @param \SynergiTech\Staffology\Model\PayRun|null $payrun payrun + * + * @return $this + */ + public function setPayrun(?\SynergiTech\Staffology\Model\PayRun $payrun): static + { + if (is_null($payrun)) { + throw new InvalidArgumentException('non-nullable payrun cannot be null'); + } + $this->container['payrun'] = $payrun; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\EmployeeNiYtdValues[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\EmployeeNiYtdValues[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiYtdReportReportResponse.php b/src/Model/NiYtdReportReportResponse.php new file mode 100644 index 0000000..b25b6f0 --- /dev/null +++ b/src/Model/NiYtdReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class NiYtdReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiYtdReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\NiYtdReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\NiYtdReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\NiYtdReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\NiYtdReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\NiYtdReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NiYtdValue.php b/src/Model/NiYtdValue.php new file mode 100644 index 0000000..b107507 --- /dev/null +++ b/src/Model/NiYtdValue.php @@ -0,0 +1,517 @@ + + */ +class NiYtdValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NiYtdValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'broughtForward' => 'float', + 'period' => 'float', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'broughtForward' => 'double', + 'period' => 'double', + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'broughtForward' => false, + 'period' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'broughtForward' => 'broughtForward', + 'period' => 'period', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'broughtForward' => 'setBroughtForward', + 'period' => 'setPeriod', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'broughtForward' => 'getBroughtForward', + 'period' => 'getPeriod', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('broughtForward', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets broughtForward + * + * @return float|null + */ + public function getBroughtForward(): ?float + { + return $this->container['broughtForward']; + } + + /** + * Sets broughtForward + * + * @param float|null $broughtForward broughtForward + * + * @return $this + */ + public function setBroughtForward(?float $broughtForward): static + { + if (is_null($broughtForward)) { + throw new InvalidArgumentException('non-nullable broughtForward cannot be null'); + } + $this->container['broughtForward'] = $broughtForward; + + return $this; + } + + /** + * Gets period + * + * @return float|null + */ + public function getPeriod(): ?float + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param float|null $period period + * + * @return $this + */ + public function setPeriod(?float $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NicSummary.php b/src/Model/NicSummary.php new file mode 100644 index 0000000..95b4667 --- /dev/null +++ b/src/Model/NicSummary.php @@ -0,0 +1,1156 @@ + + */ +class NicSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NicSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'paymentDate' => '\DateTime', + 'niTable' => 'string', + 'asDirector' => 'bool', + 'grossEarningsForNics' => 'float', + 'earningsAtLel' => 'float', + 'earningsAboveLelToPt' => 'float', + 'earningsAbovePtToSt' => 'float', + 'earningsAbovePtToUap' => 'float', + 'earningsAboveStToUel' => 'float', + 'earningsAboveStToFust' => 'float', + 'earningsAboveFustToUel' => 'float', + 'earningsAboveUapToUel' => 'float', + 'earningsAboveUel' => 'float', + 'employeeNics' => 'float', + 'employeeNiRebate' => 'float', + 'employerNics' => 'float', + 'employerNiRebate' => 'float', + 'hasValues' => 'bool', + 'id' => 'string', + 'isNiYtdOverride' => 'bool', + 'childId' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'paymentDate' => 'date', + 'niTable' => null, + 'asDirector' => null, + 'grossEarningsForNics' => 'double', + 'earningsAtLel' => 'double', + 'earningsAboveLelToPt' => 'double', + 'earningsAbovePtToSt' => 'double', + 'earningsAbovePtToUap' => 'double', + 'earningsAboveStToUel' => 'double', + 'earningsAboveStToFust' => 'double', + 'earningsAboveFustToUel' => 'double', + 'earningsAboveUapToUel' => 'double', + 'earningsAboveUel' => 'double', + 'employeeNics' => 'double', + 'employeeNiRebate' => 'double', + 'employerNics' => 'double', + 'employerNiRebate' => 'double', + 'hasValues' => null, + 'id' => 'uuid', + 'isNiYtdOverride' => null, + 'childId' => 'uuid', + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'paymentDate' => false, + 'niTable' => false, + 'asDirector' => false, + 'grossEarningsForNics' => false, + 'earningsAtLel' => false, + 'earningsAboveLelToPt' => false, + 'earningsAbovePtToSt' => false, + 'earningsAbovePtToUap' => false, + 'earningsAboveStToUel' => false, + 'earningsAboveStToFust' => false, + 'earningsAboveFustToUel' => false, + 'earningsAboveUapToUel' => false, + 'earningsAboveUel' => false, + 'employeeNics' => false, + 'employeeNiRebate' => false, + 'employerNics' => false, + 'employerNiRebate' => false, + 'hasValues' => false, + 'id' => false, + 'isNiYtdOverride' => false, + 'childId' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'paymentDate' => 'paymentDate', + 'niTable' => 'niTable', + 'asDirector' => 'asDirector', + 'grossEarningsForNics' => 'grossEarningsForNics', + 'earningsAtLel' => 'earningsAtLel', + 'earningsAboveLelToPt' => 'earningsAboveLelToPt', + 'earningsAbovePtToSt' => 'earningsAbovePtToSt', + 'earningsAbovePtToUap' => 'earningsAbovePtToUap', + 'earningsAboveStToUel' => 'earningsAboveStToUel', + 'earningsAboveStToFust' => 'earningsAboveStToFust', + 'earningsAboveFustToUel' => 'earningsAboveFustToUel', + 'earningsAboveUapToUel' => 'earningsAboveUapToUel', + 'earningsAboveUel' => 'earningsAboveUel', + 'employeeNics' => 'employeeNics', + 'employeeNiRebate' => 'employeeNiRebate', + 'employerNics' => 'employerNics', + 'employerNiRebate' => 'employerNiRebate', + 'hasValues' => 'hasValues', + 'id' => 'id', + 'isNiYtdOverride' => 'isNiYtdOverride', + 'childId' => 'childId', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'paymentDate' => 'setPaymentDate', + 'niTable' => 'setNiTable', + 'asDirector' => 'setAsDirector', + 'grossEarningsForNics' => 'setGrossEarningsForNics', + 'earningsAtLel' => 'setEarningsAtLel', + 'earningsAboveLelToPt' => 'setEarningsAboveLelToPt', + 'earningsAbovePtToSt' => 'setEarningsAbovePtToSt', + 'earningsAbovePtToUap' => 'setEarningsAbovePtToUap', + 'earningsAboveStToUel' => 'setEarningsAboveStToUel', + 'earningsAboveStToFust' => 'setEarningsAboveStToFust', + 'earningsAboveFustToUel' => 'setEarningsAboveFustToUel', + 'earningsAboveUapToUel' => 'setEarningsAboveUapToUel', + 'earningsAboveUel' => 'setEarningsAboveUel', + 'employeeNics' => 'setEmployeeNics', + 'employeeNiRebate' => 'setEmployeeNiRebate', + 'employerNics' => 'setEmployerNics', + 'employerNiRebate' => 'setEmployerNiRebate', + 'hasValues' => 'setHasValues', + 'id' => 'setId', + 'isNiYtdOverride' => 'setIsNiYtdOverride', + 'childId' => 'setChildId', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'paymentDate' => 'getPaymentDate', + 'niTable' => 'getNiTable', + 'asDirector' => 'getAsDirector', + 'grossEarningsForNics' => 'getGrossEarningsForNics', + 'earningsAtLel' => 'getEarningsAtLel', + 'earningsAboveLelToPt' => 'getEarningsAboveLelToPt', + 'earningsAbovePtToSt' => 'getEarningsAbovePtToSt', + 'earningsAbovePtToUap' => 'getEarningsAbovePtToUap', + 'earningsAboveStToUel' => 'getEarningsAboveStToUel', + 'earningsAboveStToFust' => 'getEarningsAboveStToFust', + 'earningsAboveFustToUel' => 'getEarningsAboveFustToUel', + 'earningsAboveUapToUel' => 'getEarningsAboveUapToUel', + 'earningsAboveUel' => 'getEarningsAboveUel', + 'employeeNics' => 'getEmployeeNics', + 'employeeNiRebate' => 'getEmployeeNiRebate', + 'employerNics' => 'getEmployerNics', + 'employerNiRebate' => 'getEmployerNiRebate', + 'hasValues' => 'getHasValues', + 'id' => 'getId', + 'isNiYtdOverride' => 'getIsNiYtdOverride', + 'childId' => 'getChildId', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('asDirector', $data ?? [], null); + $this->setIfExists('grossEarningsForNics', $data ?? [], null); + $this->setIfExists('earningsAtLel', $data ?? [], null); + $this->setIfExists('earningsAboveLelToPt', $data ?? [], null); + $this->setIfExists('earningsAbovePtToSt', $data ?? [], null); + $this->setIfExists('earningsAbovePtToUap', $data ?? [], null); + $this->setIfExists('earningsAboveStToUel', $data ?? [], null); + $this->setIfExists('earningsAboveStToFust', $data ?? [], null); + $this->setIfExists('earningsAboveFustToUel', $data ?? [], null); + $this->setIfExists('earningsAboveUapToUel', $data ?? [], null); + $this->setIfExists('earningsAboveUel', $data ?? [], null); + $this->setIfExists('employeeNics', $data ?? [], null); + $this->setIfExists('employeeNiRebate', $data ?? [], null); + $this->setIfExists('employerNics', $data ?? [], null); + $this->setIfExists('employerNiRebate', $data ?? [], null); + $this->setIfExists('hasValues', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('isNiYtdOverride', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate paymentDate + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets asDirector + * + * @return bool|null + */ + public function getAsDirector(): ?bool + { + return $this->container['asDirector']; + } + + /** + * Sets asDirector + * + * @param bool|null $asDirector asDirector + * + * @return $this + */ + public function setAsDirector(?bool $asDirector): static + { + if (is_null($asDirector)) { + throw new InvalidArgumentException('non-nullable asDirector cannot be null'); + } + $this->container['asDirector'] = $asDirector; + + return $this; + } + + /** + * Gets grossEarningsForNics + * + * @return float|null + */ + public function getGrossEarningsForNics(): ?float + { + return $this->container['grossEarningsForNics']; + } + + /** + * Sets grossEarningsForNics + * + * @param float|null $grossEarningsForNics grossEarningsForNics + * + * @return $this + */ + public function setGrossEarningsForNics(?float $grossEarningsForNics): static + { + if (is_null($grossEarningsForNics)) { + throw new InvalidArgumentException('non-nullable grossEarningsForNics cannot be null'); + } + $this->container['grossEarningsForNics'] = $grossEarningsForNics; + + return $this; + } + + /** + * Gets earningsAtLel + * + * @return float|null + */ + public function getEarningsAtLel(): ?float + { + return $this->container['earningsAtLel']; + } + + /** + * Sets earningsAtLel + * + * @param float|null $earningsAtLel earningsAtLel + * + * @return $this + */ + public function setEarningsAtLel(?float $earningsAtLel): static + { + if (is_null($earningsAtLel)) { + throw new InvalidArgumentException('non-nullable earningsAtLel cannot be null'); + } + $this->container['earningsAtLel'] = $earningsAtLel; + + return $this; + } + + /** + * Gets earningsAboveLelToPt + * + * @return float|null + */ + public function getEarningsAboveLelToPt(): ?float + { + return $this->container['earningsAboveLelToPt']; + } + + /** + * Sets earningsAboveLelToPt + * + * @param float|null $earningsAboveLelToPt earningsAboveLelToPt + * + * @return $this + */ + public function setEarningsAboveLelToPt(?float $earningsAboveLelToPt): static + { + if (is_null($earningsAboveLelToPt)) { + throw new InvalidArgumentException('non-nullable earningsAboveLelToPt cannot be null'); + } + $this->container['earningsAboveLelToPt'] = $earningsAboveLelToPt; + + return $this; + } + + /** + * Gets earningsAbovePtToSt + * + * @return float|null + */ + public function getEarningsAbovePtToSt(): ?float + { + return $this->container['earningsAbovePtToSt']; + } + + /** + * Sets earningsAbovePtToSt + * + * @param float|null $earningsAbovePtToSt earningsAbovePtToSt + * + * @return $this + */ + public function setEarningsAbovePtToSt(?float $earningsAbovePtToSt): static + { + if (is_null($earningsAbovePtToSt)) { + throw new InvalidArgumentException('non-nullable earningsAbovePtToSt cannot be null'); + } + $this->container['earningsAbovePtToSt'] = $earningsAbovePtToSt; + + return $this; + } + + /** + * Gets earningsAbovePtToUap + * + * @return float|null + */ + public function getEarningsAbovePtToUap(): ?float + { + return $this->container['earningsAbovePtToUap']; + } + + /** + * Sets earningsAbovePtToUap + * + * @param float|null $earningsAbovePtToUap earningsAbovePtToUap + * + * @return $this + */ + public function setEarningsAbovePtToUap(?float $earningsAbovePtToUap): static + { + if (is_null($earningsAbovePtToUap)) { + throw new InvalidArgumentException('non-nullable earningsAbovePtToUap cannot be null'); + } + $this->container['earningsAbovePtToUap'] = $earningsAbovePtToUap; + + return $this; + } + + /** + * Gets earningsAboveStToUel + * + * @return float|null + */ + public function getEarningsAboveStToUel(): ?float + { + return $this->container['earningsAboveStToUel']; + } + + /** + * Sets earningsAboveStToUel + * + * @param float|null $earningsAboveStToUel earningsAboveStToUel + * + * @return $this + */ + public function setEarningsAboveStToUel(?float $earningsAboveStToUel): static + { + if (is_null($earningsAboveStToUel)) { + throw new InvalidArgumentException('non-nullable earningsAboveStToUel cannot be null'); + } + $this->container['earningsAboveStToUel'] = $earningsAboveStToUel; + + return $this; + } + + /** + * Gets earningsAboveStToFust + * + * @return float|null + */ + public function getEarningsAboveStToFust(): ?float + { + return $this->container['earningsAboveStToFust']; + } + + /** + * Sets earningsAboveStToFust + * + * @param float|null $earningsAboveStToFust earningsAboveStToFust + * + * @return $this + */ + public function setEarningsAboveStToFust(?float $earningsAboveStToFust): static + { + if (is_null($earningsAboveStToFust)) { + throw new InvalidArgumentException('non-nullable earningsAboveStToFust cannot be null'); + } + $this->container['earningsAboveStToFust'] = $earningsAboveStToFust; + + return $this; + } + + /** + * Gets earningsAboveFustToUel + * + * @return float|null + */ + public function getEarningsAboveFustToUel(): ?float + { + return $this->container['earningsAboveFustToUel']; + } + + /** + * Sets earningsAboveFustToUel + * + * @param float|null $earningsAboveFustToUel earningsAboveFustToUel + * + * @return $this + */ + public function setEarningsAboveFustToUel(?float $earningsAboveFustToUel): static + { + if (is_null($earningsAboveFustToUel)) { + throw new InvalidArgumentException('non-nullable earningsAboveFustToUel cannot be null'); + } + $this->container['earningsAboveFustToUel'] = $earningsAboveFustToUel; + + return $this; + } + + /** + * Gets earningsAboveUapToUel + * + * @return float|null + */ + public function getEarningsAboveUapToUel(): ?float + { + return $this->container['earningsAboveUapToUel']; + } + + /** + * Sets earningsAboveUapToUel + * + * @param float|null $earningsAboveUapToUel earningsAboveUapToUel + * + * @return $this + */ + public function setEarningsAboveUapToUel(?float $earningsAboveUapToUel): static + { + if (is_null($earningsAboveUapToUel)) { + throw new InvalidArgumentException('non-nullable earningsAboveUapToUel cannot be null'); + } + $this->container['earningsAboveUapToUel'] = $earningsAboveUapToUel; + + return $this; + } + + /** + * Gets earningsAboveUel + * + * @return float|null + */ + public function getEarningsAboveUel(): ?float + { + return $this->container['earningsAboveUel']; + } + + /** + * Sets earningsAboveUel + * + * @param float|null $earningsAboveUel earningsAboveUel + * + * @return $this + */ + public function setEarningsAboveUel(?float $earningsAboveUel): static + { + if (is_null($earningsAboveUel)) { + throw new InvalidArgumentException('non-nullable earningsAboveUel cannot be null'); + } + $this->container['earningsAboveUel'] = $earningsAboveUel; + + return $this; + } + + /** + * Gets employeeNics + * + * @return float|null + */ + public function getEmployeeNics(): ?float + { + return $this->container['employeeNics']; + } + + /** + * Sets employeeNics + * + * @param float|null $employeeNics employeeNics + * + * @return $this + */ + public function setEmployeeNics(?float $employeeNics): static + { + if (is_null($employeeNics)) { + throw new InvalidArgumentException('non-nullable employeeNics cannot be null'); + } + $this->container['employeeNics'] = $employeeNics; + + return $this; + } + + /** + * Gets employeeNiRebate + * + * @return float|null + */ + public function getEmployeeNiRebate(): ?float + { + return $this->container['employeeNiRebate']; + } + + /** + * Sets employeeNiRebate + * + * @param float|null $employeeNiRebate employeeNiRebate + * + * @return $this + */ + public function setEmployeeNiRebate(?float $employeeNiRebate): static + { + if (is_null($employeeNiRebate)) { + throw new InvalidArgumentException('non-nullable employeeNiRebate cannot be null'); + } + $this->container['employeeNiRebate'] = $employeeNiRebate; + + return $this; + } + + /** + * Gets employerNics + * + * @return float|null + */ + public function getEmployerNics(): ?float + { + return $this->container['employerNics']; + } + + /** + * Sets employerNics + * + * @param float|null $employerNics employerNics + * + * @return $this + */ + public function setEmployerNics(?float $employerNics): static + { + if (is_null($employerNics)) { + throw new InvalidArgumentException('non-nullable employerNics cannot be null'); + } + $this->container['employerNics'] = $employerNics; + + return $this; + } + + /** + * Gets employerNiRebate + * + * @return float|null + */ + public function getEmployerNiRebate(): ?float + { + return $this->container['employerNiRebate']; + } + + /** + * Sets employerNiRebate + * + * @param float|null $employerNiRebate employerNiRebate + * + * @return $this + */ + public function setEmployerNiRebate(?float $employerNiRebate): static + { + if (is_null($employerNiRebate)) { + throw new InvalidArgumentException('non-nullable employerNiRebate cannot be null'); + } + $this->container['employerNiRebate'] = $employerNiRebate; + + return $this; + } + + /** + * Gets hasValues + * + * @return bool|null + */ + public function getHasValues(): ?bool + { + return $this->container['hasValues']; + } + + /** + * Sets hasValues + * + * @param bool|null $hasValues hasValues + * + * @return $this + */ + public function setHasValues(?bool $hasValues): static + { + if (is_null($hasValues)) { + throw new InvalidArgumentException('non-nullable hasValues cannot be null'); + } + $this->container['hasValues'] = $hasValues; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets isNiYtdOverride + * + * @return bool|null + */ + public function getIsNiYtdOverride(): ?bool + { + return $this->container['isNiYtdOverride']; + } + + /** + * Sets isNiYtdOverride + * + * @param bool|null $isNiYtdOverride isNiYtdOverride + * + * @return $this + */ + public function setIsNiYtdOverride(?bool $isNiYtdOverride): static + { + if (is_null($isNiYtdOverride)) { + throw new InvalidArgumentException('non-nullable isNiYtdOverride cannot be null'); + } + $this->container['isNiYtdOverride'] = $isNiYtdOverride; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId This is nothing but the UniqueId of the model. + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + throw new InvalidArgumentException('non-nullable childId cannot be null'); + } + $this->container['childId'] = $childId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NominalCodeMapping.php b/src/Model/NominalCodeMapping.php new file mode 100644 index 0000000..a5d8be0 --- /dev/null +++ b/src/Model/NominalCodeMapping.php @@ -0,0 +1,645 @@ + + */ +class NominalCodeMapping implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NominalCodeMapping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nominalCode' => 'string', + 'nominalName' => 'string', + 'externalId' => 'string', + 'payCode' => 'string', + 'nominalMapping' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nominalCode' => null, + 'nominalName' => null, + 'externalId' => null, + 'payCode' => null, + 'nominalMapping' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nominalCode' => true, + 'nominalName' => true, + 'externalId' => true, + 'payCode' => true, + 'nominalMapping' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nominalCode' => 'nominalCode', + 'nominalName' => 'nominalName', + 'externalId' => 'externalId', + 'payCode' => 'payCode', + 'nominalMapping' => 'nominalMapping', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nominalCode' => 'setNominalCode', + 'nominalName' => 'setNominalName', + 'externalId' => 'setExternalId', + 'payCode' => 'setPayCode', + 'nominalMapping' => 'setNominalMapping', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nominalCode' => 'getNominalCode', + 'nominalName' => 'getNominalName', + 'externalId' => 'getExternalId', + 'payCode' => 'getPayCode', + 'nominalMapping' => 'getNominalMapping', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nominalCode', $data ?? [], null); + $this->setIfExists('nominalName', $data ?? [], null); + $this->setIfExists('externalId', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('nominalMapping', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['nominalCode']) && (mb_strlen($this->container['nominalCode']) > 500)) { + $invalidProperties[] = "invalid value for 'nominalCode', the character length must be smaller than or equal to 500."; + } + + if (!is_null($this->container['nominalName']) && (mb_strlen($this->container['nominalName']) > 100)) { + $invalidProperties[] = "invalid value for 'nominalName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['externalId']) && (mb_strlen($this->container['externalId']) > 100)) { + $invalidProperties[] = "invalid value for 'externalId', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['nominalMapping']) && (mb_strlen($this->container['nominalMapping']) > 500)) { + $invalidProperties[] = "invalid value for 'nominalMapping', the character length must be smaller than or equal to 500."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nominalCode + * + * @return string|null + */ + public function getNominalCode(): ?string + { + return $this->container['nominalCode']; + } + + /** + * Sets nominalCode + * + * @param string|null $nominalCode nominalCode + * + * @return $this + */ + public function setNominalCode(?string $nominalCode): static + { + if (is_null($nominalCode)) { + array_push($this->openAPINullablesSetToNull, 'nominalCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($nominalCode) && (mb_strlen($nominalCode) > 500)) { + throw new InvalidArgumentException('invalid length for $nominalCode when calling NominalCodeMapping., must be smaller than or equal to 500.'); + } + + $this->container['nominalCode'] = $nominalCode; + + return $this; + } + + /** + * Gets nominalName + * + * @return string|null + */ + public function getNominalName(): ?string + { + return $this->container['nominalName']; + } + + /** + * Sets nominalName + * + * @param string|null $nominalName nominalName + * + * @return $this + */ + public function setNominalName(?string $nominalName): static + { + if (is_null($nominalName)) { + array_push($this->openAPINullablesSetToNull, 'nominalName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($nominalName) && (mb_strlen($nominalName) > 100)) { + throw new InvalidArgumentException('invalid length for $nominalName when calling NominalCodeMapping., must be smaller than or equal to 100.'); + } + + $this->container['nominalName'] = $nominalName; + + return $this; + } + + /** + * Gets externalId + * + * @return string|null + */ + public function getExternalId(): ?string + { + return $this->container['externalId']; + } + + /** + * Sets externalId + * + * @param string|null $externalId If you will be using the API to post journals to an ExternalDataProvider, then this is the Id of the nominal code in the external system. If there's no mapping then this will have a value of \"0\" + * + * @return $this + */ + public function setExternalId(?string $externalId): static + { + if (is_null($externalId)) { + array_push($this->openAPINullablesSetToNull, 'externalId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('externalId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($externalId) && (mb_strlen($externalId) > 100)) { + throw new InvalidArgumentException('invalid length for $externalId when calling NominalCodeMapping., must be smaller than or equal to 100.'); + } + + $this->container['externalId'] = $externalId; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets nominalMapping + * + * @return string|null + */ + public function getNominalMapping(): ?string + { + return $this->container['nominalMapping']; + } + + /** + * Sets nominalMapping + * + * @param string|null $nominalMapping nominalMapping + * + * @return $this + */ + public function setNominalMapping(?string $nominalMapping): static + { + if (is_null($nominalMapping)) { + array_push($this->openAPINullablesSetToNull, 'nominalMapping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalMapping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($nominalMapping) && (mb_strlen($nominalMapping) > 500)) { + throw new InvalidArgumentException('invalid length for $nominalMapping when calling NominalCodeMapping., must be smaller than or equal to 500.'); + } + + $this->container['nominalMapping'] = $nominalMapping; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Note.php b/src/Model/Note.php new file mode 100644 index 0000000..8a4c2c4 --- /dev/null +++ b/src/Model/Note.php @@ -0,0 +1,709 @@ + + */ +class Note implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Note'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'noteDate' => '\DateTime', + 'noteText' => 'string', + 'createdBy' => 'string', + 'updatedBy' => 'string', + 'type' => '\SynergiTech\Staffology\Model\NoteType', + 'documentCount' => 'int', + 'documents' => '\SynergiTech\Staffology\Model\Item[]', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'noteDate' => 'date', + 'noteText' => null, + 'createdBy' => null, + 'updatedBy' => null, + 'type' => null, + 'documentCount' => 'int32', + 'documents' => null, + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'noteDate' => false, + 'noteText' => true, + 'createdBy' => true, + 'updatedBy' => true, + 'type' => false, + 'documentCount' => false, + 'documents' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'noteDate' => 'noteDate', + 'noteText' => 'noteText', + 'createdBy' => 'createdBy', + 'updatedBy' => 'updatedBy', + 'type' => 'type', + 'documentCount' => 'documentCount', + 'documents' => 'documents', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'noteDate' => 'setNoteDate', + 'noteText' => 'setNoteText', + 'createdBy' => 'setCreatedBy', + 'updatedBy' => 'setUpdatedBy', + 'type' => 'setType', + 'documentCount' => 'setDocumentCount', + 'documents' => 'setDocuments', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'noteDate' => 'getNoteDate', + 'noteText' => 'getNoteText', + 'createdBy' => 'getCreatedBy', + 'updatedBy' => 'getUpdatedBy', + 'type' => 'getType', + 'documentCount' => 'getDocumentCount', + 'documents' => 'getDocuments', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('noteDate', $data ?? [], null); + $this->setIfExists('noteText', $data ?? [], null); + $this->setIfExists('createdBy', $data ?? [], null); + $this->setIfExists('updatedBy', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('documentCount', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets noteDate + * + * @return \DateTime|null + */ + public function getNoteDate(): ?\DateTime + { + return $this->container['noteDate']; + } + + /** + * Sets noteDate + * + * @param \DateTime|null $noteDate The date of the note + * + * @return $this + */ + public function setNoteDate(?\DateTime $noteDate): static + { + if (is_null($noteDate)) { + throw new InvalidArgumentException('non-nullable noteDate cannot be null'); + } + $this->container['noteDate'] = $noteDate; + + return $this; + } + + /** + * Gets noteText + * + * @return string|null + */ + public function getNoteText(): ?string + { + return $this->container['noteText']; + } + + /** + * Sets noteText + * + * @param string|null $noteText Note text + * + * @return $this + */ + public function setNoteText(?string $noteText): static + { + if (is_null($noteText)) { + array_push($this->openAPINullablesSetToNull, 'noteText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('noteText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['noteText'] = $noteText; + + return $this; + } + + /** + * Gets createdBy + * + * @return string|null + */ + public function getCreatedBy(): ?string + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param string|null $createdBy [readonly] The email address of the user that create the Note + * + * @return $this + */ + public function setCreatedBy(?string $createdBy): static + { + if (is_null($createdBy)) { + array_push($this->openAPINullablesSetToNull, 'createdBy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('createdBy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets updatedBy + * + * @return string|null + */ + public function getUpdatedBy(): ?string + { + return $this->container['updatedBy']; + } + + /** + * Sets updatedBy + * + * @param string|null $updatedBy [readonly] The email address of the user that last updated the Note + * + * @return $this + */ + public function setUpdatedBy(?string $updatedBy): static + { + if (is_null($updatedBy)) { + array_push($this->openAPINullablesSetToNull, 'updatedBy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('updatedBy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['updatedBy'] = $updatedBy; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\NoteType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\NoteType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\NoteType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\NoteType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets documentCount + * + * @return int|null + */ + public function getDocumentCount(): ?int + { + return $this->container['documentCount']; + } + + /** + * Sets documentCount + * + * @param int|null $documentCount [readonly] The number of attachments associated with this model + * + * @return $this + */ + public function setDocumentCount(?int $documentCount): static + { + if (is_null($documentCount)) { + throw new InvalidArgumentException('non-nullable documentCount cannot be null'); + } + $this->container['documentCount'] = $documentCount; + + return $this; + } + + /** + * Gets documents + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getDocuments(): ?array + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \SynergiTech\Staffology\Model\Item[]|null $documents [readonly] The attachments associated with this model + * + * @return $this + */ + public function setDocuments(?array $documents): static + { + if (is_null($documents)) { + array_push($this->openAPINullablesSetToNull, 'documents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NoteType.php b/src/Model/NoteType.php new file mode 100644 index 0000000..45fc1e2 --- /dev/null +++ b/src/Model/NoteType.php @@ -0,0 +1,49 @@ + + */ +class Nvr implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Nvr'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employees' => '\SynergiTech\Staffology\Model\Item[]', + 'employeeCount' => 'int', + 'nvrRequest' => '\SynergiTech\Staffology\Model\NvrRequest', + 'iRmark' => 'string', + 'xml' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'employerReferences' => '\SynergiTech\Staffology\Model\EmpRefs', + 'govTalkSubmission' => '\SynergiTech\Staffology\Model\GovTalkSubmission', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employees' => null, + 'employeeCount' => 'int32', + 'nvrRequest' => null, + 'iRmark' => null, + 'xml' => null, + 'taxYear' => null, + 'employerReferences' => null, + 'govTalkSubmission' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employees' => true, + 'employeeCount' => false, + 'nvrRequest' => false, + 'iRmark' => true, + 'xml' => true, + 'taxYear' => false, + 'employerReferences' => false, + 'govTalkSubmission' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employees' => 'employees', + 'employeeCount' => 'employeeCount', + 'nvrRequest' => 'nvrRequest', + 'iRmark' => 'iRmark', + 'xml' => 'xml', + 'taxYear' => 'taxYear', + 'employerReferences' => 'employerReferences', + 'govTalkSubmission' => 'govTalkSubmission', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employees' => 'setEmployees', + 'employeeCount' => 'setEmployeeCount', + 'nvrRequest' => 'setNvrRequest', + 'iRmark' => 'setIRmark', + 'xml' => 'setXml', + 'taxYear' => 'setTaxYear', + 'employerReferences' => 'setEmployerReferences', + 'govTalkSubmission' => 'setGovTalkSubmission', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employees' => 'getEmployees', + 'employeeCount' => 'getEmployeeCount', + 'nvrRequest' => 'getNvrRequest', + 'iRmark' => 'getIRmark', + 'xml' => 'getXml', + 'taxYear' => 'getTaxYear', + 'employerReferences' => 'getEmployerReferences', + 'govTalkSubmission' => 'getGovTalkSubmission', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employees', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('nvrRequest', $data ?? [], null); + $this->setIfExists('iRmark', $data ?? [], null); + $this->setIfExists('xml', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('employerReferences', $data ?? [], null); + $this->setIfExists('govTalkSubmission', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employees + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getEmployees(): ?array + { + return $this->container['employees']; + } + + /** + * Sets employees + * + * @param \SynergiTech\Staffology\Model\Item[]|null $employees employees + * + * @return $this + */ + public function setEmployees(?array $employees): static + { + if (is_null($employees)) { + array_push($this->openAPINullablesSetToNull, 'employees'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employees', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employees'] = $employees; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount employeeCount + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets nvrRequest + * + * @return \SynergiTech\Staffology\Model\NvrRequest|null + */ + public function getNvrRequest(): ?\SynergiTech\Staffology\Model\NvrRequest + { + return $this->container['nvrRequest']; + } + + /** + * Sets nvrRequest + * + * @param \SynergiTech\Staffology\Model\NvrRequest|null $nvrRequest nvrRequest + * + * @return $this + */ + public function setNvrRequest(?\SynergiTech\Staffology\Model\NvrRequest $nvrRequest): static + { + if (is_null($nvrRequest)) { + throw new InvalidArgumentException('non-nullable nvrRequest cannot be null'); + } + $this->container['nvrRequest'] = $nvrRequest; + + return $this; + } + + /** + * Gets iRmark + * + * @return string|null + */ + public function getIRmark(): ?string + { + return $this->container['iRmark']; + } + + /** + * Sets iRmark + * + * @param string|null $iRmark iRmark + * + * @return $this + */ + public function setIRmark(?string $iRmark): static + { + if (is_null($iRmark)) { + array_push($this->openAPINullablesSetToNull, 'iRmark'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('iRmark', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['iRmark'] = $iRmark; + + return $this; + } + + /** + * Gets xml + * + * @return string|null + */ + public function getXml(): ?string + { + return $this->container['xml']; + } + + /** + * Sets xml + * + * @param string|null $xml This property will soon be removed and should not be used. There is now a dedicated API endpoint for retrieving the XML for a submission. + * + * @return $this + */ + public function setXml(?string $xml): static + { + if (is_null($xml)) { + array_push($this->openAPINullablesSetToNull, 'xml'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('xml', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['xml'] = $xml; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets employerReferences + * + * @return \SynergiTech\Staffology\Model\EmpRefs|null + */ + public function getEmployerReferences(): ?\SynergiTech\Staffology\Model\EmpRefs + { + return $this->container['employerReferences']; + } + + /** + * Sets employerReferences + * + * @param \SynergiTech\Staffology\Model\EmpRefs|null $employerReferences employerReferences + * + * @return $this + */ + public function setEmployerReferences(?\SynergiTech\Staffology\Model\EmpRefs $employerReferences): static + { + if (is_null($employerReferences)) { + throw new InvalidArgumentException('non-nullable employerReferences cannot be null'); + } + $this->container['employerReferences'] = $employerReferences; + + return $this; + } + + /** + * Gets govTalkSubmission + * + * @return \SynergiTech\Staffology\Model\GovTalkSubmission|null + */ + public function getGovTalkSubmission(): ?\SynergiTech\Staffology\Model\GovTalkSubmission + { + return $this->container['govTalkSubmission']; + } + + /** + * Sets govTalkSubmission + * + * @param \SynergiTech\Staffology\Model\GovTalkSubmission|null $govTalkSubmission govTalkSubmission + * + * @return $this + */ + public function setGovTalkSubmission(?\SynergiTech\Staffology\Model\GovTalkSubmission $govTalkSubmission): static + { + if (is_null($govTalkSubmission)) { + throw new InvalidArgumentException('non-nullable govTalkSubmission cannot be null'); + } + $this->container['govTalkSubmission'] = $govTalkSubmission; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NvrEmployee.php b/src/Model/NvrEmployee.php new file mode 100644 index 0000000..ead4bcf --- /dev/null +++ b/src/Model/NvrEmployee.php @@ -0,0 +1,510 @@ + + */ +class NvrEmployee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NvrEmployee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeUniqueId' => 'string', + 'item' => '\SynergiTech\Staffology\Model\Item', + 'employeeDetails' => '\SynergiTech\Staffology\Model\NvrEmployeeDetails', + 'employment' => '\SynergiTech\Staffology\Model\NvrEmployment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeUniqueId' => 'uuid', + 'item' => null, + 'employeeDetails' => null, + 'employment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeUniqueId' => false, + 'item' => false, + 'employeeDetails' => false, + 'employment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeUniqueId' => 'employeeUniqueId', + 'item' => 'item', + 'employeeDetails' => 'employeeDetails', + 'employment' => 'employment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'item' => 'setItem', + 'employeeDetails' => 'setEmployeeDetails', + 'employment' => 'setEmployment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'item' => 'getItem', + 'employeeDetails' => 'getEmployeeDetails', + 'employment' => 'getEmployment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('item', $data ?? [], null); + $this->setIfExists('employeeDetails', $data ?? [], null); + $this->setIfExists('employment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId employeeUniqueId + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeUniqueId cannot be null'); + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets item + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getItem(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \SynergiTech\Staffology\Model\Item|null $item item + * + * @return $this + */ + public function setItem(?\SynergiTech\Staffology\Model\Item $item): static + { + if (is_null($item)) { + throw new InvalidArgumentException('non-nullable item cannot be null'); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets employeeDetails + * + * @return \SynergiTech\Staffology\Model\NvrEmployeeDetails|null + */ + public function getEmployeeDetails(): ?\SynergiTech\Staffology\Model\NvrEmployeeDetails + { + return $this->container['employeeDetails']; + } + + /** + * Sets employeeDetails + * + * @param \SynergiTech\Staffology\Model\NvrEmployeeDetails|null $employeeDetails employeeDetails + * + * @return $this + */ + public function setEmployeeDetails(?\SynergiTech\Staffology\Model\NvrEmployeeDetails $employeeDetails): static + { + if (is_null($employeeDetails)) { + throw new InvalidArgumentException('non-nullable employeeDetails cannot be null'); + } + $this->container['employeeDetails'] = $employeeDetails; + + return $this; + } + + /** + * Gets employment + * + * @return \SynergiTech\Staffology\Model\NvrEmployment|null + */ + public function getEmployment(): ?\SynergiTech\Staffology\Model\NvrEmployment + { + return $this->container['employment']; + } + + /** + * Sets employment + * + * @param \SynergiTech\Staffology\Model\NvrEmployment|null $employment employment + * + * @return $this + */ + public function setEmployment(?\SynergiTech\Staffology\Model\NvrEmployment $employment): static + { + if (is_null($employment)) { + throw new InvalidArgumentException('non-nullable employment cannot be null'); + } + $this->container['employment'] = $employment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NvrEmployeeDetails.php b/src/Model/NvrEmployeeDetails.php new file mode 100644 index 0000000..9091485 --- /dev/null +++ b/src/Model/NvrEmployeeDetails.php @@ -0,0 +1,565 @@ + + */ +class NvrEmployeeDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NvrEmployeeDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nino' => 'string', + 'name' => '\SynergiTech\Staffology\Model\RtiEmployeeName', + 'address' => '\SynergiTech\Staffology\Model\RtiEmployeeAddress', + 'birthDate' => 'string', + 'gender' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nino' => null, + 'name' => null, + 'address' => null, + 'birthDate' => null, + 'gender' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nino' => true, + 'name' => false, + 'address' => false, + 'birthDate' => true, + 'gender' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nino' => 'nino', + 'name' => 'name', + 'address' => 'address', + 'birthDate' => 'birthDate', + 'gender' => 'gender' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nino' => 'setNino', + 'name' => 'setName', + 'address' => 'setAddress', + 'birthDate' => 'setBirthDate', + 'gender' => 'setGender' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nino' => 'getNino', + 'name' => 'getName', + 'address' => 'getAddress', + 'birthDate' => 'getBirthDate', + 'gender' => 'getGender' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nino', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('birthDate', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nino + * + * @return string|null + */ + public function getNino(): ?string + { + return $this->container['nino']; + } + + /** + * Sets nino + * + * @param string|null $nino nino + * + * @return $this + */ + public function setNino(?string $nino): static + { + if (is_null($nino)) { + array_push($this->openAPINullablesSetToNull, 'nino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nino'] = $nino; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\RtiEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\RtiEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\RtiEmployeeAddress|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\RtiEmployeeAddress + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\RtiEmployeeAddress|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\RtiEmployeeAddress $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets birthDate + * + * @return string|null + */ + public function getBirthDate(): ?string + { + return $this->container['birthDate']; + } + + /** + * Sets birthDate + * + * @param string|null $birthDate birthDate + * + * @return $this + */ + public function setBirthDate(?string $birthDate): static + { + if (is_null($birthDate)) { + array_push($this->openAPINullablesSetToNull, 'birthDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('birthDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['birthDate'] = $birthDate; + + return $this; + } + + /** + * Gets gender + * + * @return string|null + */ + public function getGender(): ?string + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param string|null $gender gender + * + * @return $this + */ + public function setGender(?string $gender): static + { + if (is_null($gender)) { + array_push($this->openAPINullablesSetToNull, 'gender'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gender', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['gender'] = $gender; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NvrEmployment.php b/src/Model/NvrEmployment.php new file mode 100644 index 0000000..346e699 --- /dev/null +++ b/src/Model/NvrEmployment.php @@ -0,0 +1,415 @@ + + */ +class NvrEmployment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NvrEmployment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payId' => 'payId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payId' => 'setPayId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payId' => 'getPayId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payId + * + * @return string|null + */ + public function getPayId(): ?string + { + return $this->container['payId']; + } + + /** + * Sets payId + * + * @param string|null $payId payId + * + * @return $this + */ + public function setPayId(?string $payId): static + { + if (is_null($payId)) { + array_push($this->openAPINullablesSetToNull, 'payId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payId'] = $payId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/NvrRequest.php b/src/Model/NvrRequest.php new file mode 100644 index 0000000..3a081e7 --- /dev/null +++ b/src/Model/NvrRequest.php @@ -0,0 +1,456 @@ + + */ +class NvrRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NvrRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\NvrEmployee[]', + 'relatedTaxYear' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'relatedTaxYear' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => true, + 'relatedTaxYear' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'relatedTaxYear' => 'relatedTaxYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'relatedTaxYear' => 'setRelatedTaxYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'relatedTaxYear' => 'getRelatedTaxYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('relatedTaxYear', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\NvrEmployee[]|null + */ + public function getEmployee(): ?array + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\NvrEmployee[]|null $employee employee + * + * @return $this + */ + public function setEmployee(?array $employee): static + { + if (is_null($employee)) { + array_push($this->openAPINullablesSetToNull, 'employee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets relatedTaxYear + * + * @return string|null + */ + public function getRelatedTaxYear(): ?string + { + return $this->container['relatedTaxYear']; + } + + /** + * Sets relatedTaxYear + * + * @param string|null $relatedTaxYear relatedTaxYear + * + * @return $this + */ + public function setRelatedTaxYear(?string $relatedTaxYear): static + { + if (is_null($relatedTaxYear)) { + array_push($this->openAPINullablesSetToNull, 'relatedTaxYear'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('relatedTaxYear', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['relatedTaxYear'] = $relatedTaxYear; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OccupationalPolicy.php b/src/Model/OccupationalPolicy.php new file mode 100644 index 0000000..57bccbf --- /dev/null +++ b/src/Model/OccupationalPolicy.php @@ -0,0 +1,823 @@ + + */ +class OccupationalPolicy implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OccupationalPolicy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'policyName' => 'string', + 'type' => '\SynergiTech\Staffology\Model\OccupationalPolicyType', + 'entitlement' => '\SynergiTech\Staffology\Model\OccupationalPolicyEntitlement', + 'sicknessYear' => '\SynergiTech\Staffology\Model\OccupationalPolicySicknessYear', + 'policyStartMonth' => '\SynergiTech\Staffology\Model\CalendarMonth', + 'serviceBands' => '\SynergiTech\Staffology\Model\ServiceBand[]', + 'payCalculatedOn' => '\SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn', + 'payCodeSetUniqueId' => 'string', + 'useAggregatedServiceDate' => 'bool', + 'daysOrWeeksBeforeRecalculatingEntitlement' => 'int', + 'entitlementRecalculationBasis' => '\SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis', + 'ignorePreviousYearsSickness' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'policyName' => null, + 'type' => null, + 'entitlement' => null, + 'sicknessYear' => null, + 'policyStartMonth' => null, + 'serviceBands' => null, + 'payCalculatedOn' => null, + 'payCodeSetUniqueId' => 'uuid', + 'useAggregatedServiceDate' => null, + 'daysOrWeeksBeforeRecalculatingEntitlement' => 'int32', + 'entitlementRecalculationBasis' => null, + 'ignorePreviousYearsSickness' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'policyName' => false, + 'type' => false, + 'entitlement' => false, + 'sicknessYear' => false, + 'policyStartMonth' => false, + 'serviceBands' => true, + 'payCalculatedOn' => false, + 'payCodeSetUniqueId' => true, + 'useAggregatedServiceDate' => false, + 'daysOrWeeksBeforeRecalculatingEntitlement' => false, + 'entitlementRecalculationBasis' => false, + 'ignorePreviousYearsSickness' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'policyName' => 'policyName', + 'type' => 'type', + 'entitlement' => 'entitlement', + 'sicknessYear' => 'sicknessYear', + 'policyStartMonth' => 'policyStartMonth', + 'serviceBands' => 'serviceBands', + 'payCalculatedOn' => 'payCalculatedOn', + 'payCodeSetUniqueId' => 'payCodeSetUniqueId', + 'useAggregatedServiceDate' => 'useAggregatedServiceDate', + 'daysOrWeeksBeforeRecalculatingEntitlement' => 'daysOrWeeksBeforeRecalculatingEntitlement', + 'entitlementRecalculationBasis' => 'entitlementRecalculationBasis', + 'ignorePreviousYearsSickness' => 'ignorePreviousYearsSickness' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'policyName' => 'setPolicyName', + 'type' => 'setType', + 'entitlement' => 'setEntitlement', + 'sicknessYear' => 'setSicknessYear', + 'policyStartMonth' => 'setPolicyStartMonth', + 'serviceBands' => 'setServiceBands', + 'payCalculatedOn' => 'setPayCalculatedOn', + 'payCodeSetUniqueId' => 'setPayCodeSetUniqueId', + 'useAggregatedServiceDate' => 'setUseAggregatedServiceDate', + 'daysOrWeeksBeforeRecalculatingEntitlement' => 'setDaysOrWeeksBeforeRecalculatingEntitlement', + 'entitlementRecalculationBasis' => 'setEntitlementRecalculationBasis', + 'ignorePreviousYearsSickness' => 'setIgnorePreviousYearsSickness' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'policyName' => 'getPolicyName', + 'type' => 'getType', + 'entitlement' => 'getEntitlement', + 'sicknessYear' => 'getSicknessYear', + 'policyStartMonth' => 'getPolicyStartMonth', + 'serviceBands' => 'getServiceBands', + 'payCalculatedOn' => 'getPayCalculatedOn', + 'payCodeSetUniqueId' => 'getPayCodeSetUniqueId', + 'useAggregatedServiceDate' => 'getUseAggregatedServiceDate', + 'daysOrWeeksBeforeRecalculatingEntitlement' => 'getDaysOrWeeksBeforeRecalculatingEntitlement', + 'entitlementRecalculationBasis' => 'getEntitlementRecalculationBasis', + 'ignorePreviousYearsSickness' => 'getIgnorePreviousYearsSickness' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('policyName', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('entitlement', $data ?? [], null); + $this->setIfExists('sicknessYear', $data ?? [], null); + $this->setIfExists('policyStartMonth', $data ?? [], null); + $this->setIfExists('serviceBands', $data ?? [], null); + $this->setIfExists('payCalculatedOn', $data ?? [], null); + $this->setIfExists('payCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('useAggregatedServiceDate', $data ?? [], null); + $this->setIfExists('daysOrWeeksBeforeRecalculatingEntitlement', $data ?? [], null); + $this->setIfExists('entitlementRecalculationBasis', $data ?? [], null); + $this->setIfExists('ignorePreviousYearsSickness', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['policyName'] === null) { + $invalidProperties[] = "'policyName' can't be null"; + } + if ((mb_strlen($this->container['policyName']) > 50)) { + $invalidProperties[] = "invalid value for 'policyName', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['policyName']) < 1)) { + $invalidProperties[] = "invalid value for 'policyName', the character length must be bigger than or equal to 1."; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['entitlement'] === null) { + $invalidProperties[] = "'entitlement' can't be null"; + } + if ($this->container['sicknessYear'] === null) { + $invalidProperties[] = "'sicknessYear' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets policyName + * + * @return string + */ + public function getPolicyName(): string + { + return $this->container['policyName']; + } + + /** + * Sets policyName + * + * @param string $policyName The unique policy name + * + * @return $this + */ + public function setPolicyName(string $policyName): static + { + if (is_null($policyName)) { + throw new InvalidArgumentException('non-nullable policyName cannot be null'); + } + if ((mb_strlen($policyName) > 50)) { + throw new InvalidArgumentException('invalid length for $policyName when calling OccupationalPolicy., must be smaller than or equal to 50.'); + } + if ((mb_strlen($policyName) < 1)) { + throw new InvalidArgumentException('invalid length for $policyName when calling OccupationalPolicy., must be bigger than or equal to 1.'); + } + + $this->container['policyName'] = $policyName; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\OccupationalPolicyType + */ + public function getType(): \SynergiTech\Staffology\Model\OccupationalPolicyType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\OccupationalPolicyType $type type + * + * @return $this + */ + public function setType(\SynergiTech\Staffology\Model\OccupationalPolicyType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets entitlement + * + * @return \SynergiTech\Staffology\Model\OccupationalPolicyEntitlement + */ + public function getEntitlement(): \SynergiTech\Staffology\Model\OccupationalPolicyEntitlement + { + return $this->container['entitlement']; + } + + /** + * Sets entitlement + * + * @param \SynergiTech\Staffology\Model\OccupationalPolicyEntitlement $entitlement entitlement + * + * @return $this + */ + public function setEntitlement(\SynergiTech\Staffology\Model\OccupationalPolicyEntitlement $entitlement): static + { + if (is_null($entitlement)) { + throw new InvalidArgumentException('non-nullable entitlement cannot be null'); + } + $this->container['entitlement'] = $entitlement; + + return $this; + } + + /** + * Gets sicknessYear + * + * @return \SynergiTech\Staffology\Model\OccupationalPolicySicknessYear + */ + public function getSicknessYear(): \SynergiTech\Staffology\Model\OccupationalPolicySicknessYear + { + return $this->container['sicknessYear']; + } + + /** + * Sets sicknessYear + * + * @param \SynergiTech\Staffology\Model\OccupationalPolicySicknessYear $sicknessYear sicknessYear + * + * @return $this + */ + public function setSicknessYear(\SynergiTech\Staffology\Model\OccupationalPolicySicknessYear $sicknessYear): static + { + if (is_null($sicknessYear)) { + throw new InvalidArgumentException('non-nullable sicknessYear cannot be null'); + } + $this->container['sicknessYear'] = $sicknessYear; + + return $this; + } + + /** + * Gets policyStartMonth + * + * @return \SynergiTech\Staffology\Model\CalendarMonth|null + */ + public function getPolicyStartMonth(): ?\SynergiTech\Staffology\Model\CalendarMonth + { + return $this->container['policyStartMonth']; + } + + /** + * Sets policyStartMonth + * + * @param \SynergiTech\Staffology\Model\CalendarMonth|null $policyStartMonth policyStartMonth + * + * @return $this + */ + public function setPolicyStartMonth(?\SynergiTech\Staffology\Model\CalendarMonth $policyStartMonth): static + { + if (is_null($policyStartMonth)) { + throw new InvalidArgumentException('non-nullable policyStartMonth cannot be null'); + } + $this->container['policyStartMonth'] = $policyStartMonth; + + return $this; + } + + /** + * Gets serviceBands + * + * @return \SynergiTech\Staffology\Model\ServiceBand[]|null + */ + public function getServiceBands(): ?array + { + return $this->container['serviceBands']; + } + + /** + * Sets serviceBands + * + * @param \SynergiTech\Staffology\Model\ServiceBand[]|null $serviceBands Service Bands Json + * + * @return $this + */ + public function setServiceBands(?array $serviceBands): static + { + if (is_null($serviceBands)) { + array_push($this->openAPINullablesSetToNull, 'serviceBands'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('serviceBands', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['serviceBands'] = $serviceBands; + + return $this; + } + + /** + * Gets payCalculatedOn + * + * @return \SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn|null + */ + public function getPayCalculatedOn(): ?\SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn + { + return $this->container['payCalculatedOn']; + } + + /** + * Sets payCalculatedOn + * + * @param \SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn|null $payCalculatedOn payCalculatedOn + * + * @return $this + */ + public function setPayCalculatedOn(?\SynergiTech\Staffology\Model\OccupationalPolicyPayCalculatedOn $payCalculatedOn): static + { + if (is_null($payCalculatedOn)) { + throw new InvalidArgumentException('non-nullable payCalculatedOn cannot be null'); + } + $this->container['payCalculatedOn'] = $payCalculatedOn; + + return $this; + } + + /** + * Gets payCodeSetUniqueId + * + * @return string|null + */ + public function getPayCodeSetUniqueId(): ?string + { + return $this->container['payCodeSetUniqueId']; + } + + /** + * Sets payCodeSetUniqueId + * + * @param string|null $payCodeSetUniqueId payCodeSetUniqueId + * + * @return $this + */ + public function setPayCodeSetUniqueId(?string $payCodeSetUniqueId): static + { + if (is_null($payCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetUniqueId'] = $payCodeSetUniqueId; + + return $this; + } + + /** + * Gets useAggregatedServiceDate + * + * @return bool|null + */ + public function getUseAggregatedServiceDate(): ?bool + { + return $this->container['useAggregatedServiceDate']; + } + + /** + * Sets useAggregatedServiceDate + * + * @param bool|null $useAggregatedServiceDate useAggregatedServiceDate + * + * @return $this + */ + public function setUseAggregatedServiceDate(?bool $useAggregatedServiceDate): static + { + if (is_null($useAggregatedServiceDate)) { + throw new InvalidArgumentException('non-nullable useAggregatedServiceDate cannot be null'); + } + $this->container['useAggregatedServiceDate'] = $useAggregatedServiceDate; + + return $this; + } + + /** + * Gets daysOrWeeksBeforeRecalculatingEntitlement + * + * @return int|null + */ + public function getDaysOrWeeksBeforeRecalculatingEntitlement(): ?int + { + return $this->container['daysOrWeeksBeforeRecalculatingEntitlement']; + } + + /** + * Sets daysOrWeeksBeforeRecalculatingEntitlement + * + * @param int|null $daysOrWeeksBeforeRecalculatingEntitlement How many days or weeks an employee needs to return to work before new entitlements are used in calculations + * + * @return $this + */ + public function setDaysOrWeeksBeforeRecalculatingEntitlement(?int $daysOrWeeksBeforeRecalculatingEntitlement): static + { + if (is_null($daysOrWeeksBeforeRecalculatingEntitlement)) { + throw new InvalidArgumentException('non-nullable daysOrWeeksBeforeRecalculatingEntitlement cannot be null'); + } + $this->container['daysOrWeeksBeforeRecalculatingEntitlement'] = $daysOrWeeksBeforeRecalculatingEntitlement; + + return $this; + } + + /** + * Gets entitlementRecalculationBasis + * + * @return \SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis|null + */ + public function getEntitlementRecalculationBasis(): ?\SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis + { + return $this->container['entitlementRecalculationBasis']; + } + + /** + * Sets entitlementRecalculationBasis + * + * @param \SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis|null $entitlementRecalculationBasis entitlementRecalculationBasis + * + * @return $this + */ + public function setEntitlementRecalculationBasis(?\SynergiTech\Staffology\Model\OccupationalPolicyEntitlementRecalculationBasis $entitlementRecalculationBasis): static + { + if (is_null($entitlementRecalculationBasis)) { + throw new InvalidArgumentException('non-nullable entitlementRecalculationBasis cannot be null'); + } + $this->container['entitlementRecalculationBasis'] = $entitlementRecalculationBasis; + + return $this; + } + + /** + * Gets ignorePreviousYearsSickness + * + * @return bool|null + */ + public function getIgnorePreviousYearsSickness(): ?bool + { + return $this->container['ignorePreviousYearsSickness']; + } + + /** + * Sets ignorePreviousYearsSickness + * + * @param bool|null $ignorePreviousYearsSickness Defines whether any sickness that relates to a previous year's sickness entitlement should be included in the entitlement calculation, or whether only sickness that is relevant to the current year's entitlement is taken into consideration + * + * @return $this + */ + public function setIgnorePreviousYearsSickness(?bool $ignorePreviousYearsSickness): static + { + if (is_null($ignorePreviousYearsSickness)) { + throw new InvalidArgumentException('non-nullable ignorePreviousYearsSickness cannot be null'); + } + $this->container['ignorePreviousYearsSickness'] = $ignorePreviousYearsSickness; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OccupationalPolicyEntitlement.php b/src/Model/OccupationalPolicyEntitlement.php new file mode 100644 index 0000000..981e497 --- /dev/null +++ b/src/Model/OccupationalPolicyEntitlement.php @@ -0,0 +1,45 @@ + + */ +class OccupationalSickLeaveHistory implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OccupationalSickLeaveHistory'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'leaveDate' => '\DateTime', + 'payPercent' => 'float', + 'serviceBandFrom' => 'int', + 'serviceBandTo' => 'int', + 'roleReference' => 'string', + 'occupationalPolicy' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'leaveDate' => 'date', + 'payPercent' => 'double', + 'serviceBandFrom' => 'int32', + 'serviceBandTo' => 'int32', + 'roleReference' => null, + 'occupationalPolicy' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'leaveDate' => false, + 'payPercent' => false, + 'serviceBandFrom' => false, + 'serviceBandTo' => false, + 'roleReference' => true, + 'occupationalPolicy' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'leaveDate' => 'leaveDate', + 'payPercent' => 'payPercent', + 'serviceBandFrom' => 'serviceBandFrom', + 'serviceBandTo' => 'serviceBandTo', + 'roleReference' => 'roleReference', + 'occupationalPolicy' => 'occupationalPolicy', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'leaveDate' => 'setLeaveDate', + 'payPercent' => 'setPayPercent', + 'serviceBandFrom' => 'setServiceBandFrom', + 'serviceBandTo' => 'setServiceBandTo', + 'roleReference' => 'setRoleReference', + 'occupationalPolicy' => 'setOccupationalPolicy', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'leaveDate' => 'getLeaveDate', + 'payPercent' => 'getPayPercent', + 'serviceBandFrom' => 'getServiceBandFrom', + 'serviceBandTo' => 'getServiceBandTo', + 'roleReference' => 'getRoleReference', + 'occupationalPolicy' => 'getOccupationalPolicy', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('payPercent', $data ?? [], null); + $this->setIfExists('serviceBandFrom', $data ?? [], null); + $this->setIfExists('serviceBandTo', $data ?? [], null); + $this->setIfExists('roleReference', $data ?? [], null); + $this->setIfExists('occupationalPolicy', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['leaveDate'] === null) { + $invalidProperties[] = "'leaveDate' can't be null"; + } + if ($this->container['payPercent'] === null) { + $invalidProperties[] = "'payPercent' can't be null"; + } + if ($this->container['serviceBandFrom'] === null) { + $invalidProperties[] = "'serviceBandFrom' can't be null"; + } + if ($this->container['serviceBandTo'] === null) { + $invalidProperties[] = "'serviceBandTo' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime + */ + public function getLeaveDate(): \DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + throw new InvalidArgumentException('non-nullable leaveDate cannot be null'); + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets payPercent + * + * @return float + */ + public function getPayPercent(): float + { + return $this->container['payPercent']; + } + + /** + * Sets payPercent + * + * @param float $payPercent payPercent + * + * @return $this + */ + public function setPayPercent(float $payPercent): static + { + if (is_null($payPercent)) { + throw new InvalidArgumentException('non-nullable payPercent cannot be null'); + } + $this->container['payPercent'] = $payPercent; + + return $this; + } + + /** + * Gets serviceBandFrom + * + * @return int + */ + public function getServiceBandFrom(): int + { + return $this->container['serviceBandFrom']; + } + + /** + * Sets serviceBandFrom + * + * @param int $serviceBandFrom serviceBandFrom + * + * @return $this + */ + public function setServiceBandFrom(int $serviceBandFrom): static + { + if (is_null($serviceBandFrom)) { + throw new InvalidArgumentException('non-nullable serviceBandFrom cannot be null'); + } + $this->container['serviceBandFrom'] = $serviceBandFrom; + + return $this; + } + + /** + * Gets serviceBandTo + * + * @return int + */ + public function getServiceBandTo(): int + { + return $this->container['serviceBandTo']; + } + + /** + * Sets serviceBandTo + * + * @param int $serviceBandTo serviceBandTo + * + * @return $this + */ + public function setServiceBandTo(int $serviceBandTo): static + { + if (is_null($serviceBandTo)) { + throw new InvalidArgumentException('non-nullable serviceBandTo cannot be null'); + } + $this->container['serviceBandTo'] = $serviceBandTo; + + return $this; + } + + /** + * Gets roleReference + * + * @return string|null + */ + public function getRoleReference(): ?string + { + return $this->container['roleReference']; + } + + /** + * Sets roleReference + * + * @param string|null $roleReference roleReference + * + * @return $this + */ + public function setRoleReference(?string $roleReference): static + { + if (is_null($roleReference)) { + array_push($this->openAPINullablesSetToNull, 'roleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleReference'] = $roleReference; + + return $this; + } + + /** + * Gets occupationalPolicy + * + * @return string|null + */ + public function getOccupationalPolicy(): ?string + { + return $this->container['occupationalPolicy']; + } + + /** + * Sets occupationalPolicy + * + * @param string|null $occupationalPolicy occupationalPolicy + * + * @return $this + */ + public function setOccupationalPolicy(?string $occupationalPolicy): static + { + if (is_null($occupationalPolicy)) { + array_push($this->openAPINullablesSetToNull, 'occupationalPolicy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('occupationalPolicy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['occupationalPolicy'] = $occupationalPolicy; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OpeningBalances.php b/src/Model/OpeningBalances.php new file mode 100644 index 0000000..da1620f --- /dev/null +++ b/src/Model/OpeningBalances.php @@ -0,0 +1,1197 @@ + + */ +class OpeningBalances implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OpeningBalances'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'notNewStarter' => 'bool', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'previousEmployerGross' => 'float', + 'previousEmployerTax' => 'float', + 'currentEmployerGross' => 'float', + 'currentEmployerTax' => 'float', + 'currentEmployerNet' => 'float', + 'studentLoanDeductions' => 'float', + 'postgradLoanDeductions' => 'float', + 'empeePenContribnsPaid' => 'float', + 'empeePenContribnsNotPaid' => 'float', + 'smp' => 'float', + 'spp' => 'float', + 'sap' => 'float', + 'shpp' => 'float', + 'spbp' => 'float', + 'realTimeClass1ANi' => 'float', + 'terminationPayments' => 'float', + 'mapsMiles' => 'int', + 'benefitsTaxedViaPayroll' => 'float', + 'nicSummaries' => '\SynergiTech\Staffology\Model\NicSummary[]', + 'foreignTaxCredit' => 'float', + 'foreignTaxCreditReclaimed' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'notNewStarter' => null, + 'taxYear' => null, + 'previousEmployerGross' => 'double', + 'previousEmployerTax' => 'double', + 'currentEmployerGross' => 'double', + 'currentEmployerTax' => 'double', + 'currentEmployerNet' => 'double', + 'studentLoanDeductions' => 'double', + 'postgradLoanDeductions' => 'double', + 'empeePenContribnsPaid' => 'double', + 'empeePenContribnsNotPaid' => 'double', + 'smp' => 'double', + 'spp' => 'double', + 'sap' => 'double', + 'shpp' => 'double', + 'spbp' => 'double', + 'realTimeClass1ANi' => 'double', + 'terminationPayments' => 'double', + 'mapsMiles' => 'int32', + 'benefitsTaxedViaPayroll' => 'double', + 'nicSummaries' => null, + 'foreignTaxCredit' => 'double', + 'foreignTaxCreditReclaimed' => 'double', + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'notNewStarter' => false, + 'taxYear' => false, + 'previousEmployerGross' => false, + 'previousEmployerTax' => false, + 'currentEmployerGross' => false, + 'currentEmployerTax' => false, + 'currentEmployerNet' => false, + 'studentLoanDeductions' => false, + 'postgradLoanDeductions' => false, + 'empeePenContribnsPaid' => false, + 'empeePenContribnsNotPaid' => false, + 'smp' => false, + 'spp' => false, + 'sap' => false, + 'shpp' => false, + 'spbp' => false, + 'realTimeClass1ANi' => false, + 'terminationPayments' => false, + 'mapsMiles' => false, + 'benefitsTaxedViaPayroll' => false, + 'nicSummaries' => true, + 'foreignTaxCredit' => false, + 'foreignTaxCreditReclaimed' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'notNewStarter' => 'notNewStarter', + 'taxYear' => 'taxYear', + 'previousEmployerGross' => 'previousEmployerGross', + 'previousEmployerTax' => 'previousEmployerTax', + 'currentEmployerGross' => 'currentEmployerGross', + 'currentEmployerTax' => 'currentEmployerTax', + 'currentEmployerNet' => 'currentEmployerNet', + 'studentLoanDeductions' => 'studentLoanDeductions', + 'postgradLoanDeductions' => 'postgradLoanDeductions', + 'empeePenContribnsPaid' => 'empeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'empeePenContribnsNotPaid', + 'smp' => 'smp', + 'spp' => 'spp', + 'sap' => 'sap', + 'shpp' => 'shpp', + 'spbp' => 'spbp', + 'realTimeClass1ANi' => 'realTimeClass1ANi', + 'terminationPayments' => 'terminationPayments', + 'mapsMiles' => 'mapsMiles', + 'benefitsTaxedViaPayroll' => 'benefitsTaxedViaPayroll', + 'nicSummaries' => 'nicSummaries', + 'foreignTaxCredit' => 'foreignTaxCredit', + 'foreignTaxCreditReclaimed' => 'foreignTaxCreditReclaimed', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'notNewStarter' => 'setNotNewStarter', + 'taxYear' => 'setTaxYear', + 'previousEmployerGross' => 'setPreviousEmployerGross', + 'previousEmployerTax' => 'setPreviousEmployerTax', + 'currentEmployerGross' => 'setCurrentEmployerGross', + 'currentEmployerTax' => 'setCurrentEmployerTax', + 'currentEmployerNet' => 'setCurrentEmployerNet', + 'studentLoanDeductions' => 'setStudentLoanDeductions', + 'postgradLoanDeductions' => 'setPostgradLoanDeductions', + 'empeePenContribnsPaid' => 'setEmpeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'setEmpeePenContribnsNotPaid', + 'smp' => 'setSmp', + 'spp' => 'setSpp', + 'sap' => 'setSap', + 'shpp' => 'setShpp', + 'spbp' => 'setSpbp', + 'realTimeClass1ANi' => 'setRealTimeClass1ANi', + 'terminationPayments' => 'setTerminationPayments', + 'mapsMiles' => 'setMapsMiles', + 'benefitsTaxedViaPayroll' => 'setBenefitsTaxedViaPayroll', + 'nicSummaries' => 'setNicSummaries', + 'foreignTaxCredit' => 'setForeignTaxCredit', + 'foreignTaxCreditReclaimed' => 'setForeignTaxCreditReclaimed', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'notNewStarter' => 'getNotNewStarter', + 'taxYear' => 'getTaxYear', + 'previousEmployerGross' => 'getPreviousEmployerGross', + 'previousEmployerTax' => 'getPreviousEmployerTax', + 'currentEmployerGross' => 'getCurrentEmployerGross', + 'currentEmployerTax' => 'getCurrentEmployerTax', + 'currentEmployerNet' => 'getCurrentEmployerNet', + 'studentLoanDeductions' => 'getStudentLoanDeductions', + 'postgradLoanDeductions' => 'getPostgradLoanDeductions', + 'empeePenContribnsPaid' => 'getEmpeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'getEmpeePenContribnsNotPaid', + 'smp' => 'getSmp', + 'spp' => 'getSpp', + 'sap' => 'getSap', + 'shpp' => 'getShpp', + 'spbp' => 'getSpbp', + 'realTimeClass1ANi' => 'getRealTimeClass1ANi', + 'terminationPayments' => 'getTerminationPayments', + 'mapsMiles' => 'getMapsMiles', + 'benefitsTaxedViaPayroll' => 'getBenefitsTaxedViaPayroll', + 'nicSummaries' => 'getNicSummaries', + 'foreignTaxCredit' => 'getForeignTaxCredit', + 'foreignTaxCreditReclaimed' => 'getForeignTaxCreditReclaimed', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notNewStarter', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('previousEmployerGross', $data ?? [], null); + $this->setIfExists('previousEmployerTax', $data ?? [], null); + $this->setIfExists('currentEmployerGross', $data ?? [], null); + $this->setIfExists('currentEmployerTax', $data ?? [], null); + $this->setIfExists('currentEmployerNet', $data ?? [], null); + $this->setIfExists('studentLoanDeductions', $data ?? [], null); + $this->setIfExists('postgradLoanDeductions', $data ?? [], null); + $this->setIfExists('empeePenContribnsPaid', $data ?? [], null); + $this->setIfExists('empeePenContribnsNotPaid', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('realTimeClass1ANi', $data ?? [], null); + $this->setIfExists('terminationPayments', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('benefitsTaxedViaPayroll', $data ?? [], null); + $this->setIfExists('nicSummaries', $data ?? [], null); + $this->setIfExists('foreignTaxCredit', $data ?? [], null); + $this->setIfExists('foreignTaxCreditReclaimed', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notNewStarter + * + * @return bool|null + */ + public function getNotNewStarter(): ?bool + { + return $this->container['notNewStarter']; + } + + /** + * Sets notNewStarter + * + * @param bool|null $notNewStarter notNewStarter + * + * @return $this + */ + public function setNotNewStarter(?bool $notNewStarter): static + { + if (is_null($notNewStarter)) { + throw new InvalidArgumentException('non-nullable notNewStarter cannot be null'); + } + $this->container['notNewStarter'] = $notNewStarter; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets previousEmployerGross + * + * @return float|null + */ + public function getPreviousEmployerGross(): ?float + { + return $this->container['previousEmployerGross']; + } + + /** + * Sets previousEmployerGross + * + * @param float|null $previousEmployerGross previousEmployerGross + * + * @return $this + */ + public function setPreviousEmployerGross(?float $previousEmployerGross): static + { + if (is_null($previousEmployerGross)) { + throw new InvalidArgumentException('non-nullable previousEmployerGross cannot be null'); + } + $this->container['previousEmployerGross'] = $previousEmployerGross; + + return $this; + } + + /** + * Gets previousEmployerTax + * + * @return float|null + */ + public function getPreviousEmployerTax(): ?float + { + return $this->container['previousEmployerTax']; + } + + /** + * Sets previousEmployerTax + * + * @param float|null $previousEmployerTax previousEmployerTax + * + * @return $this + */ + public function setPreviousEmployerTax(?float $previousEmployerTax): static + { + if (is_null($previousEmployerTax)) { + throw new InvalidArgumentException('non-nullable previousEmployerTax cannot be null'); + } + $this->container['previousEmployerTax'] = $previousEmployerTax; + + return $this; + } + + /** + * Gets currentEmployerGross + * + * @return float|null + */ + public function getCurrentEmployerGross(): ?float + { + return $this->container['currentEmployerGross']; + } + + /** + * Sets currentEmployerGross + * + * @param float|null $currentEmployerGross currentEmployerGross + * + * @return $this + */ + public function setCurrentEmployerGross(?float $currentEmployerGross): static + { + if (is_null($currentEmployerGross)) { + throw new InvalidArgumentException('non-nullable currentEmployerGross cannot be null'); + } + $this->container['currentEmployerGross'] = $currentEmployerGross; + + return $this; + } + + /** + * Gets currentEmployerTax + * + * @return float|null + */ + public function getCurrentEmployerTax(): ?float + { + return $this->container['currentEmployerTax']; + } + + /** + * Sets currentEmployerTax + * + * @param float|null $currentEmployerTax currentEmployerTax + * + * @return $this + */ + public function setCurrentEmployerTax(?float $currentEmployerTax): static + { + if (is_null($currentEmployerTax)) { + throw new InvalidArgumentException('non-nullable currentEmployerTax cannot be null'); + } + $this->container['currentEmployerTax'] = $currentEmployerTax; + + return $this; + } + + /** + * Gets currentEmployerNet + * + * @return float|null + */ + public function getCurrentEmployerNet(): ?float + { + return $this->container['currentEmployerNet']; + } + + /** + * Sets currentEmployerNet + * + * @param float|null $currentEmployerNet currentEmployerNet + * + * @return $this + */ + public function setCurrentEmployerNet(?float $currentEmployerNet): static + { + if (is_null($currentEmployerNet)) { + throw new InvalidArgumentException('non-nullable currentEmployerNet cannot be null'); + } + $this->container['currentEmployerNet'] = $currentEmployerNet; + + return $this; + } + + /** + * Gets studentLoanDeductions + * + * @return float|null + */ + public function getStudentLoanDeductions(): ?float + { + return $this->container['studentLoanDeductions']; + } + + /** + * Sets studentLoanDeductions + * + * @param float|null $studentLoanDeductions studentLoanDeductions + * + * @return $this + */ + public function setStudentLoanDeductions(?float $studentLoanDeductions): static + { + if (is_null($studentLoanDeductions)) { + throw new InvalidArgumentException('non-nullable studentLoanDeductions cannot be null'); + } + $this->container['studentLoanDeductions'] = $studentLoanDeductions; + + return $this; + } + + /** + * Gets postgradLoanDeductions + * + * @return float|null + */ + public function getPostgradLoanDeductions(): ?float + { + return $this->container['postgradLoanDeductions']; + } + + /** + * Sets postgradLoanDeductions + * + * @param float|null $postgradLoanDeductions postgradLoanDeductions + * + * @return $this + */ + public function setPostgradLoanDeductions(?float $postgradLoanDeductions): static + { + if (is_null($postgradLoanDeductions)) { + throw new InvalidArgumentException('non-nullable postgradLoanDeductions cannot be null'); + } + $this->container['postgradLoanDeductions'] = $postgradLoanDeductions; + + return $this; + } + + /** + * Gets empeePenContribnsPaid + * + * @return float|null + */ + public function getEmpeePenContribnsPaid(): ?float + { + return $this->container['empeePenContribnsPaid']; + } + + /** + * Sets empeePenContribnsPaid + * + * @param float|null $empeePenContribnsPaid empeePenContribnsPaid + * + * @return $this + */ + public function setEmpeePenContribnsPaid(?float $empeePenContribnsPaid): static + { + if (is_null($empeePenContribnsPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsPaid cannot be null'); + } + $this->container['empeePenContribnsPaid'] = $empeePenContribnsPaid; + + return $this; + } + + /** + * Gets empeePenContribnsNotPaid + * + * @return float|null + */ + public function getEmpeePenContribnsNotPaid(): ?float + { + return $this->container['empeePenContribnsNotPaid']; + } + + /** + * Sets empeePenContribnsNotPaid + * + * @param float|null $empeePenContribnsNotPaid empeePenContribnsNotPaid + * + * @return $this + */ + public function setEmpeePenContribnsNotPaid(?float $empeePenContribnsNotPaid): static + { + if (is_null($empeePenContribnsNotPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsNotPaid cannot be null'); + } + $this->container['empeePenContribnsNotPaid'] = $empeePenContribnsNotPaid; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp smp + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp spp + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap sap + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp shpp + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp spbp + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets realTimeClass1ANi + * + * @return float|null + */ + public function getRealTimeClass1ANi(): ?float + { + return $this->container['realTimeClass1ANi']; + } + + /** + * Sets realTimeClass1ANi + * + * @param float|null $realTimeClass1ANi realTimeClass1ANi + * + * @return $this + */ + public function setRealTimeClass1ANi(?float $realTimeClass1ANi): static + { + if (is_null($realTimeClass1ANi)) { + throw new InvalidArgumentException('non-nullable realTimeClass1ANi cannot be null'); + } + $this->container['realTimeClass1ANi'] = $realTimeClass1ANi; + + return $this; + } + + /** + * Gets terminationPayments + * + * @return float|null + */ + public function getTerminationPayments(): ?float + { + return $this->container['terminationPayments']; + } + + /** + * Sets terminationPayments + * + * @param float|null $terminationPayments terminationPayments + * + * @return $this + */ + public function setTerminationPayments(?float $terminationPayments): static + { + if (is_null($terminationPayments)) { + throw new InvalidArgumentException('non-nullable terminationPayments cannot be null'); + } + $this->container['terminationPayments'] = $terminationPayments; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles mapsMiles + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + throw new InvalidArgumentException('non-nullable mapsMiles cannot be null'); + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets benefitsTaxedViaPayroll + * + * @return float|null + */ + public function getBenefitsTaxedViaPayroll(): ?float + { + return $this->container['benefitsTaxedViaPayroll']; + } + + /** + * Sets benefitsTaxedViaPayroll + * + * @param float|null $benefitsTaxedViaPayroll benefitsTaxedViaPayroll + * + * @return $this + */ + public function setBenefitsTaxedViaPayroll(?float $benefitsTaxedViaPayroll): static + { + if (is_null($benefitsTaxedViaPayroll)) { + throw new InvalidArgumentException('non-nullable benefitsTaxedViaPayroll cannot be null'); + } + $this->container['benefitsTaxedViaPayroll'] = $benefitsTaxedViaPayroll; + + return $this; + } + + /** + * Gets nicSummaries + * + * @return \SynergiTech\Staffology\Model\NicSummary[]|null + */ + public function getNicSummaries(): ?array + { + return $this->container['nicSummaries']; + } + + /** + * Sets nicSummaries + * + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummaries nicSummaries + * + * @return $this + */ + public function setNicSummaries(?array $nicSummaries): static + { + if (is_null($nicSummaries)) { + array_push($this->openAPINullablesSetToNull, 'nicSummaries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nicSummaries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nicSummaries'] = $nicSummaries; + + return $this; + } + + /** + * Gets foreignTaxCredit + * + * @return float|null + */ + public function getForeignTaxCredit(): ?float + { + return $this->container['foreignTaxCredit']; + } + + /** + * Sets foreignTaxCredit + * + * @param float|null $foreignTaxCredit foreignTaxCredit + * + * @return $this + */ + public function setForeignTaxCredit(?float $foreignTaxCredit): static + { + if (is_null($foreignTaxCredit)) { + throw new InvalidArgumentException('non-nullable foreignTaxCredit cannot be null'); + } + $this->container['foreignTaxCredit'] = $foreignTaxCredit; + + return $this; + } + + /** + * Gets foreignTaxCreditReclaimed + * + * @return float|null + */ + public function getForeignTaxCreditReclaimed(): ?float + { + return $this->container['foreignTaxCreditReclaimed']; + } + + /** + * Sets foreignTaxCreditReclaimed + * + * @param float|null $foreignTaxCreditReclaimed foreignTaxCreditReclaimed + * + * @return $this + */ + public function setForeignTaxCreditReclaimed(?float $foreignTaxCreditReclaimed): static + { + if (is_null($foreignTaxCreditReclaimed)) { + throw new InvalidArgumentException('non-nullable foreignTaxCreditReclaimed cannot be null'); + } + $this->container['foreignTaxCreditReclaimed'] = $foreignTaxCreditReclaimed; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OpeningBalancesTotals.php b/src/Model/OpeningBalancesTotals.php new file mode 100644 index 0000000..2f369d7 --- /dev/null +++ b/src/Model/OpeningBalancesTotals.php @@ -0,0 +1,1197 @@ + + */ +class OpeningBalancesTotals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OpeningBalancesTotals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeesWithOpeningBalancesCount' => 'int', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'previousEmployerGross' => 'float', + 'previousEmployerTax' => 'float', + 'currentEmployerGross' => 'float', + 'currentEmployerTax' => 'float', + 'currentEmployerNet' => 'float', + 'studentLoanDeductions' => 'float', + 'postgradLoanDeductions' => 'float', + 'empeePenContribnsPaid' => 'float', + 'empeePenContribnsNotPaid' => 'float', + 'smp' => 'float', + 'spp' => 'float', + 'sap' => 'float', + 'shpp' => 'float', + 'spbp' => 'float', + 'realTimeClass1ANi' => 'float', + 'terminationPayments' => 'float', + 'mapsMiles' => 'int', + 'benefitsTaxedViaPayroll' => 'float', + 'nicSummaries' => '\SynergiTech\Staffology\Model\NicSummary[]', + 'foreignTaxCredit' => 'float', + 'foreignTaxCreditReclaimed' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeesWithOpeningBalancesCount' => 'int32', + 'taxYear' => null, + 'previousEmployerGross' => 'double', + 'previousEmployerTax' => 'double', + 'currentEmployerGross' => 'double', + 'currentEmployerTax' => 'double', + 'currentEmployerNet' => 'double', + 'studentLoanDeductions' => 'double', + 'postgradLoanDeductions' => 'double', + 'empeePenContribnsPaid' => 'double', + 'empeePenContribnsNotPaid' => 'double', + 'smp' => 'double', + 'spp' => 'double', + 'sap' => 'double', + 'shpp' => 'double', + 'spbp' => 'double', + 'realTimeClass1ANi' => 'double', + 'terminationPayments' => 'double', + 'mapsMiles' => 'int32', + 'benefitsTaxedViaPayroll' => 'double', + 'nicSummaries' => null, + 'foreignTaxCredit' => 'double', + 'foreignTaxCreditReclaimed' => 'double', + 'employee' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeesWithOpeningBalancesCount' => false, + 'taxYear' => false, + 'previousEmployerGross' => false, + 'previousEmployerTax' => false, + 'currentEmployerGross' => false, + 'currentEmployerTax' => false, + 'currentEmployerNet' => false, + 'studentLoanDeductions' => false, + 'postgradLoanDeductions' => false, + 'empeePenContribnsPaid' => false, + 'empeePenContribnsNotPaid' => false, + 'smp' => false, + 'spp' => false, + 'sap' => false, + 'shpp' => false, + 'spbp' => false, + 'realTimeClass1ANi' => false, + 'terminationPayments' => false, + 'mapsMiles' => false, + 'benefitsTaxedViaPayroll' => false, + 'nicSummaries' => true, + 'foreignTaxCredit' => false, + 'foreignTaxCreditReclaimed' => false, + 'employee' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeesWithOpeningBalancesCount' => 'employeesWithOpeningBalancesCount', + 'taxYear' => 'taxYear', + 'previousEmployerGross' => 'previousEmployerGross', + 'previousEmployerTax' => 'previousEmployerTax', + 'currentEmployerGross' => 'currentEmployerGross', + 'currentEmployerTax' => 'currentEmployerTax', + 'currentEmployerNet' => 'currentEmployerNet', + 'studentLoanDeductions' => 'studentLoanDeductions', + 'postgradLoanDeductions' => 'postgradLoanDeductions', + 'empeePenContribnsPaid' => 'empeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'empeePenContribnsNotPaid', + 'smp' => 'smp', + 'spp' => 'spp', + 'sap' => 'sap', + 'shpp' => 'shpp', + 'spbp' => 'spbp', + 'realTimeClass1ANi' => 'realTimeClass1ANi', + 'terminationPayments' => 'terminationPayments', + 'mapsMiles' => 'mapsMiles', + 'benefitsTaxedViaPayroll' => 'benefitsTaxedViaPayroll', + 'nicSummaries' => 'nicSummaries', + 'foreignTaxCredit' => 'foreignTaxCredit', + 'foreignTaxCreditReclaimed' => 'foreignTaxCreditReclaimed', + 'employee' => 'employee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeesWithOpeningBalancesCount' => 'setEmployeesWithOpeningBalancesCount', + 'taxYear' => 'setTaxYear', + 'previousEmployerGross' => 'setPreviousEmployerGross', + 'previousEmployerTax' => 'setPreviousEmployerTax', + 'currentEmployerGross' => 'setCurrentEmployerGross', + 'currentEmployerTax' => 'setCurrentEmployerTax', + 'currentEmployerNet' => 'setCurrentEmployerNet', + 'studentLoanDeductions' => 'setStudentLoanDeductions', + 'postgradLoanDeductions' => 'setPostgradLoanDeductions', + 'empeePenContribnsPaid' => 'setEmpeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'setEmpeePenContribnsNotPaid', + 'smp' => 'setSmp', + 'spp' => 'setSpp', + 'sap' => 'setSap', + 'shpp' => 'setShpp', + 'spbp' => 'setSpbp', + 'realTimeClass1ANi' => 'setRealTimeClass1ANi', + 'terminationPayments' => 'setTerminationPayments', + 'mapsMiles' => 'setMapsMiles', + 'benefitsTaxedViaPayroll' => 'setBenefitsTaxedViaPayroll', + 'nicSummaries' => 'setNicSummaries', + 'foreignTaxCredit' => 'setForeignTaxCredit', + 'foreignTaxCreditReclaimed' => 'setForeignTaxCreditReclaimed', + 'employee' => 'setEmployee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeesWithOpeningBalancesCount' => 'getEmployeesWithOpeningBalancesCount', + 'taxYear' => 'getTaxYear', + 'previousEmployerGross' => 'getPreviousEmployerGross', + 'previousEmployerTax' => 'getPreviousEmployerTax', + 'currentEmployerGross' => 'getCurrentEmployerGross', + 'currentEmployerTax' => 'getCurrentEmployerTax', + 'currentEmployerNet' => 'getCurrentEmployerNet', + 'studentLoanDeductions' => 'getStudentLoanDeductions', + 'postgradLoanDeductions' => 'getPostgradLoanDeductions', + 'empeePenContribnsPaid' => 'getEmpeePenContribnsPaid', + 'empeePenContribnsNotPaid' => 'getEmpeePenContribnsNotPaid', + 'smp' => 'getSmp', + 'spp' => 'getSpp', + 'sap' => 'getSap', + 'shpp' => 'getShpp', + 'spbp' => 'getSpbp', + 'realTimeClass1ANi' => 'getRealTimeClass1ANi', + 'terminationPayments' => 'getTerminationPayments', + 'mapsMiles' => 'getMapsMiles', + 'benefitsTaxedViaPayroll' => 'getBenefitsTaxedViaPayroll', + 'nicSummaries' => 'getNicSummaries', + 'foreignTaxCredit' => 'getForeignTaxCredit', + 'foreignTaxCreditReclaimed' => 'getForeignTaxCreditReclaimed', + 'employee' => 'getEmployee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeesWithOpeningBalancesCount', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('previousEmployerGross', $data ?? [], null); + $this->setIfExists('previousEmployerTax', $data ?? [], null); + $this->setIfExists('currentEmployerGross', $data ?? [], null); + $this->setIfExists('currentEmployerTax', $data ?? [], null); + $this->setIfExists('currentEmployerNet', $data ?? [], null); + $this->setIfExists('studentLoanDeductions', $data ?? [], null); + $this->setIfExists('postgradLoanDeductions', $data ?? [], null); + $this->setIfExists('empeePenContribnsPaid', $data ?? [], null); + $this->setIfExists('empeePenContribnsNotPaid', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('realTimeClass1ANi', $data ?? [], null); + $this->setIfExists('terminationPayments', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('benefitsTaxedViaPayroll', $data ?? [], null); + $this->setIfExists('nicSummaries', $data ?? [], null); + $this->setIfExists('foreignTaxCredit', $data ?? [], null); + $this->setIfExists('foreignTaxCreditReclaimed', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeesWithOpeningBalancesCount + * + * @return int|null + */ + public function getEmployeesWithOpeningBalancesCount(): ?int + { + return $this->container['employeesWithOpeningBalancesCount']; + } + + /** + * Sets employeesWithOpeningBalancesCount + * + * @param int|null $employeesWithOpeningBalancesCount employeesWithOpeningBalancesCount + * + * @return $this + */ + public function setEmployeesWithOpeningBalancesCount(?int $employeesWithOpeningBalancesCount): static + { + if (is_null($employeesWithOpeningBalancesCount)) { + throw new InvalidArgumentException('non-nullable employeesWithOpeningBalancesCount cannot be null'); + } + $this->container['employeesWithOpeningBalancesCount'] = $employeesWithOpeningBalancesCount; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets previousEmployerGross + * + * @return float|null + */ + public function getPreviousEmployerGross(): ?float + { + return $this->container['previousEmployerGross']; + } + + /** + * Sets previousEmployerGross + * + * @param float|null $previousEmployerGross previousEmployerGross + * + * @return $this + */ + public function setPreviousEmployerGross(?float $previousEmployerGross): static + { + if (is_null($previousEmployerGross)) { + throw new InvalidArgumentException('non-nullable previousEmployerGross cannot be null'); + } + $this->container['previousEmployerGross'] = $previousEmployerGross; + + return $this; + } + + /** + * Gets previousEmployerTax + * + * @return float|null + */ + public function getPreviousEmployerTax(): ?float + { + return $this->container['previousEmployerTax']; + } + + /** + * Sets previousEmployerTax + * + * @param float|null $previousEmployerTax previousEmployerTax + * + * @return $this + */ + public function setPreviousEmployerTax(?float $previousEmployerTax): static + { + if (is_null($previousEmployerTax)) { + throw new InvalidArgumentException('non-nullable previousEmployerTax cannot be null'); + } + $this->container['previousEmployerTax'] = $previousEmployerTax; + + return $this; + } + + /** + * Gets currentEmployerGross + * + * @return float|null + */ + public function getCurrentEmployerGross(): ?float + { + return $this->container['currentEmployerGross']; + } + + /** + * Sets currentEmployerGross + * + * @param float|null $currentEmployerGross currentEmployerGross + * + * @return $this + */ + public function setCurrentEmployerGross(?float $currentEmployerGross): static + { + if (is_null($currentEmployerGross)) { + throw new InvalidArgumentException('non-nullable currentEmployerGross cannot be null'); + } + $this->container['currentEmployerGross'] = $currentEmployerGross; + + return $this; + } + + /** + * Gets currentEmployerTax + * + * @return float|null + */ + public function getCurrentEmployerTax(): ?float + { + return $this->container['currentEmployerTax']; + } + + /** + * Sets currentEmployerTax + * + * @param float|null $currentEmployerTax currentEmployerTax + * + * @return $this + */ + public function setCurrentEmployerTax(?float $currentEmployerTax): static + { + if (is_null($currentEmployerTax)) { + throw new InvalidArgumentException('non-nullable currentEmployerTax cannot be null'); + } + $this->container['currentEmployerTax'] = $currentEmployerTax; + + return $this; + } + + /** + * Gets currentEmployerNet + * + * @return float|null + */ + public function getCurrentEmployerNet(): ?float + { + return $this->container['currentEmployerNet']; + } + + /** + * Sets currentEmployerNet + * + * @param float|null $currentEmployerNet currentEmployerNet + * + * @return $this + */ + public function setCurrentEmployerNet(?float $currentEmployerNet): static + { + if (is_null($currentEmployerNet)) { + throw new InvalidArgumentException('non-nullable currentEmployerNet cannot be null'); + } + $this->container['currentEmployerNet'] = $currentEmployerNet; + + return $this; + } + + /** + * Gets studentLoanDeductions + * + * @return float|null + */ + public function getStudentLoanDeductions(): ?float + { + return $this->container['studentLoanDeductions']; + } + + /** + * Sets studentLoanDeductions + * + * @param float|null $studentLoanDeductions studentLoanDeductions + * + * @return $this + */ + public function setStudentLoanDeductions(?float $studentLoanDeductions): static + { + if (is_null($studentLoanDeductions)) { + throw new InvalidArgumentException('non-nullable studentLoanDeductions cannot be null'); + } + $this->container['studentLoanDeductions'] = $studentLoanDeductions; + + return $this; + } + + /** + * Gets postgradLoanDeductions + * + * @return float|null + */ + public function getPostgradLoanDeductions(): ?float + { + return $this->container['postgradLoanDeductions']; + } + + /** + * Sets postgradLoanDeductions + * + * @param float|null $postgradLoanDeductions postgradLoanDeductions + * + * @return $this + */ + public function setPostgradLoanDeductions(?float $postgradLoanDeductions): static + { + if (is_null($postgradLoanDeductions)) { + throw new InvalidArgumentException('non-nullable postgradLoanDeductions cannot be null'); + } + $this->container['postgradLoanDeductions'] = $postgradLoanDeductions; + + return $this; + } + + /** + * Gets empeePenContribnsPaid + * + * @return float|null + */ + public function getEmpeePenContribnsPaid(): ?float + { + return $this->container['empeePenContribnsPaid']; + } + + /** + * Sets empeePenContribnsPaid + * + * @param float|null $empeePenContribnsPaid empeePenContribnsPaid + * + * @return $this + */ + public function setEmpeePenContribnsPaid(?float $empeePenContribnsPaid): static + { + if (is_null($empeePenContribnsPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsPaid cannot be null'); + } + $this->container['empeePenContribnsPaid'] = $empeePenContribnsPaid; + + return $this; + } + + /** + * Gets empeePenContribnsNotPaid + * + * @return float|null + */ + public function getEmpeePenContribnsNotPaid(): ?float + { + return $this->container['empeePenContribnsNotPaid']; + } + + /** + * Sets empeePenContribnsNotPaid + * + * @param float|null $empeePenContribnsNotPaid empeePenContribnsNotPaid + * + * @return $this + */ + public function setEmpeePenContribnsNotPaid(?float $empeePenContribnsNotPaid): static + { + if (is_null($empeePenContribnsNotPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsNotPaid cannot be null'); + } + $this->container['empeePenContribnsNotPaid'] = $empeePenContribnsNotPaid; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp smp + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp spp + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap sap + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp shpp + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp spbp + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets realTimeClass1ANi + * + * @return float|null + */ + public function getRealTimeClass1ANi(): ?float + { + return $this->container['realTimeClass1ANi']; + } + + /** + * Sets realTimeClass1ANi + * + * @param float|null $realTimeClass1ANi realTimeClass1ANi + * + * @return $this + */ + public function setRealTimeClass1ANi(?float $realTimeClass1ANi): static + { + if (is_null($realTimeClass1ANi)) { + throw new InvalidArgumentException('non-nullable realTimeClass1ANi cannot be null'); + } + $this->container['realTimeClass1ANi'] = $realTimeClass1ANi; + + return $this; + } + + /** + * Gets terminationPayments + * + * @return float|null + */ + public function getTerminationPayments(): ?float + { + return $this->container['terminationPayments']; + } + + /** + * Sets terminationPayments + * + * @param float|null $terminationPayments terminationPayments + * + * @return $this + */ + public function setTerminationPayments(?float $terminationPayments): static + { + if (is_null($terminationPayments)) { + throw new InvalidArgumentException('non-nullable terminationPayments cannot be null'); + } + $this->container['terminationPayments'] = $terminationPayments; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles mapsMiles + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + throw new InvalidArgumentException('non-nullable mapsMiles cannot be null'); + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets benefitsTaxedViaPayroll + * + * @return float|null + */ + public function getBenefitsTaxedViaPayroll(): ?float + { + return $this->container['benefitsTaxedViaPayroll']; + } + + /** + * Sets benefitsTaxedViaPayroll + * + * @param float|null $benefitsTaxedViaPayroll benefitsTaxedViaPayroll + * + * @return $this + */ + public function setBenefitsTaxedViaPayroll(?float $benefitsTaxedViaPayroll): static + { + if (is_null($benefitsTaxedViaPayroll)) { + throw new InvalidArgumentException('non-nullable benefitsTaxedViaPayroll cannot be null'); + } + $this->container['benefitsTaxedViaPayroll'] = $benefitsTaxedViaPayroll; + + return $this; + } + + /** + * Gets nicSummaries + * + * @return \SynergiTech\Staffology\Model\NicSummary[]|null + */ + public function getNicSummaries(): ?array + { + return $this->container['nicSummaries']; + } + + /** + * Sets nicSummaries + * + * @param \SynergiTech\Staffology\Model\NicSummary[]|null $nicSummaries nicSummaries + * + * @return $this + */ + public function setNicSummaries(?array $nicSummaries): static + { + if (is_null($nicSummaries)) { + array_push($this->openAPINullablesSetToNull, 'nicSummaries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nicSummaries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nicSummaries'] = $nicSummaries; + + return $this; + } + + /** + * Gets foreignTaxCredit + * + * @return float|null + */ + public function getForeignTaxCredit(): ?float + { + return $this->container['foreignTaxCredit']; + } + + /** + * Sets foreignTaxCredit + * + * @param float|null $foreignTaxCredit foreignTaxCredit + * + * @return $this + */ + public function setForeignTaxCredit(?float $foreignTaxCredit): static + { + if (is_null($foreignTaxCredit)) { + throw new InvalidArgumentException('non-nullable foreignTaxCredit cannot be null'); + } + $this->container['foreignTaxCredit'] = $foreignTaxCredit; + + return $this; + } + + /** + * Gets foreignTaxCreditReclaimed + * + * @return float|null + */ + public function getForeignTaxCreditReclaimed(): ?float + { + return $this->container['foreignTaxCreditReclaimed']; + } + + /** + * Sets foreignTaxCreditReclaimed + * + * @param float|null $foreignTaxCreditReclaimed foreignTaxCreditReclaimed + * + * @return $this + */ + public function setForeignTaxCreditReclaimed(?float $foreignTaxCreditReclaimed): static + { + if (is_null($foreignTaxCreditReclaimed)) { + throw new InvalidArgumentException('non-nullable foreignTaxCreditReclaimed cannot be null'); + } + $this->container['foreignTaxCreditReclaimed'] = $foreignTaxCreditReclaimed; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OverseasEmployerDetails.php b/src/Model/OverseasEmployerDetails.php new file mode 100644 index 0000000..7bf8d77 --- /dev/null +++ b/src/Model/OverseasEmployerDetails.php @@ -0,0 +1,510 @@ + + */ +class OverseasEmployerDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OverseasEmployerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'overseasEmployer' => 'bool', + 'overseasSecondmentStatus' => '\SynergiTech\Staffology\Model\OverseasSecondmentStatus', + 'eeaCitizen' => 'bool', + 'epm6Scheme' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'overseasEmployer' => null, + 'overseasSecondmentStatus' => null, + 'eeaCitizen' => null, + 'epm6Scheme' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'overseasEmployer' => false, + 'overseasSecondmentStatus' => false, + 'eeaCitizen' => false, + 'epm6Scheme' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'overseasEmployer' => 'overseasEmployer', + 'overseasSecondmentStatus' => 'overseasSecondmentStatus', + 'eeaCitizen' => 'eeaCitizen', + 'epm6Scheme' => 'epm6Scheme' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'overseasEmployer' => 'setOverseasEmployer', + 'overseasSecondmentStatus' => 'setOverseasSecondmentStatus', + 'eeaCitizen' => 'setEeaCitizen', + 'epm6Scheme' => 'setEpm6Scheme' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'overseasEmployer' => 'getOverseasEmployer', + 'overseasSecondmentStatus' => 'getOverseasSecondmentStatus', + 'eeaCitizen' => 'getEeaCitizen', + 'epm6Scheme' => 'getEpm6Scheme' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('overseasEmployer', $data ?? [], null); + $this->setIfExists('overseasSecondmentStatus', $data ?? [], null); + $this->setIfExists('eeaCitizen', $data ?? [], null); + $this->setIfExists('epm6Scheme', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets overseasEmployer + * + * @return bool|null + */ + public function getOverseasEmployer(): ?bool + { + return $this->container['overseasEmployer']; + } + + /** + * Sets overseasEmployer + * + * @param bool|null $overseasEmployer overseasEmployer + * + * @return $this + */ + public function setOverseasEmployer(?bool $overseasEmployer): static + { + if (is_null($overseasEmployer)) { + throw new InvalidArgumentException('non-nullable overseasEmployer cannot be null'); + } + $this->container['overseasEmployer'] = $overseasEmployer; + + return $this; + } + + /** + * Gets overseasSecondmentStatus + * + * @return \SynergiTech\Staffology\Model\OverseasSecondmentStatus|null + */ + public function getOverseasSecondmentStatus(): ?\SynergiTech\Staffology\Model\OverseasSecondmentStatus + { + return $this->container['overseasSecondmentStatus']; + } + + /** + * Sets overseasSecondmentStatus + * + * @param \SynergiTech\Staffology\Model\OverseasSecondmentStatus|null $overseasSecondmentStatus overseasSecondmentStatus + * + * @return $this + */ + public function setOverseasSecondmentStatus(?\SynergiTech\Staffology\Model\OverseasSecondmentStatus $overseasSecondmentStatus): static + { + if (is_null($overseasSecondmentStatus)) { + throw new InvalidArgumentException('non-nullable overseasSecondmentStatus cannot be null'); + } + $this->container['overseasSecondmentStatus'] = $overseasSecondmentStatus; + + return $this; + } + + /** + * Gets eeaCitizen + * + * @return bool|null + */ + public function getEeaCitizen(): ?bool + { + return $this->container['eeaCitizen']; + } + + /** + * Sets eeaCitizen + * + * @param bool|null $eeaCitizen eeaCitizen + * + * @return $this + */ + public function setEeaCitizen(?bool $eeaCitizen): static + { + if (is_null($eeaCitizen)) { + throw new InvalidArgumentException('non-nullable eeaCitizen cannot be null'); + } + $this->container['eeaCitizen'] = $eeaCitizen; + + return $this; + } + + /** + * Gets epm6Scheme + * + * @return bool|null + */ + public function getEpm6Scheme(): ?bool + { + return $this->container['epm6Scheme']; + } + + /** + * Sets epm6Scheme + * + * @param bool|null $epm6Scheme epm6Scheme + * + * @return $this + */ + public function setEpm6Scheme(?bool $epm6Scheme): static + { + if (is_null($epm6Scheme)) { + throw new InvalidArgumentException('non-nullable epm6Scheme cannot be null'); + } + $this->container['epm6Scheme'] = $epm6Scheme; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OverseasSecondmentStatus.php b/src/Model/OverseasSecondmentStatus.php new file mode 100644 index 0000000..f8367e8 --- /dev/null +++ b/src/Model/OverseasSecondmentStatus.php @@ -0,0 +1,49 @@ + + */ +class P11 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employerName' => 'string', + 'payrollCode' => 'string', + 'employerOfficeNo' => 'string', + 'employerPayeRef' => 'string', + 'firstname' => 'string', + 'surname' => 'string', + 'niNumber' => 'string', + 'taxCode' => 'string', + 'dateOfBirth' => '\DateTime', + 'joinDate' => '\DateTime', + 'leaveDate' => '\DateTime', + 'lines' => '\SynergiTech\Staffology\Model\P11Line[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employerName' => null, + 'payrollCode' => null, + 'employerOfficeNo' => null, + 'employerPayeRef' => null, + 'firstname' => null, + 'surname' => null, + 'niNumber' => null, + 'taxCode' => null, + 'dateOfBirth' => 'date', + 'joinDate' => 'date', + 'leaveDate' => 'date', + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employerName' => true, + 'payrollCode' => true, + 'employerOfficeNo' => true, + 'employerPayeRef' => true, + 'firstname' => true, + 'surname' => true, + 'niNumber' => true, + 'taxCode' => true, + 'dateOfBirth' => false, + 'joinDate' => false, + 'leaveDate' => true, + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employerName' => 'employerName', + 'payrollCode' => 'payrollCode', + 'employerOfficeNo' => 'employerOfficeNo', + 'employerPayeRef' => 'employerPayeRef', + 'firstname' => 'firstname', + 'surname' => 'surname', + 'niNumber' => 'niNumber', + 'taxCode' => 'taxCode', + 'dateOfBirth' => 'dateOfBirth', + 'joinDate' => 'joinDate', + 'leaveDate' => 'leaveDate', + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employerName' => 'setEmployerName', + 'payrollCode' => 'setPayrollCode', + 'employerOfficeNo' => 'setEmployerOfficeNo', + 'employerPayeRef' => 'setEmployerPayeRef', + 'firstname' => 'setFirstname', + 'surname' => 'setSurname', + 'niNumber' => 'setNiNumber', + 'taxCode' => 'setTaxCode', + 'dateOfBirth' => 'setDateOfBirth', + 'joinDate' => 'setJoinDate', + 'leaveDate' => 'setLeaveDate', + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employerName' => 'getEmployerName', + 'payrollCode' => 'getPayrollCode', + 'employerOfficeNo' => 'getEmployerOfficeNo', + 'employerPayeRef' => 'getEmployerPayeRef', + 'firstname' => 'getFirstname', + 'surname' => 'getSurname', + 'niNumber' => 'getNiNumber', + 'taxCode' => 'getTaxCode', + 'dateOfBirth' => 'getDateOfBirth', + 'joinDate' => 'getJoinDate', + 'leaveDate' => 'getLeaveDate', + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employerName', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('employerOfficeNo', $data ?? [], null); + $this->setIfExists('employerPayeRef', $data ?? [], null); + $this->setIfExists('firstname', $data ?? [], null); + $this->setIfExists('surname', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('joinDate', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employerName + * + * @return string|null + */ + public function getEmployerName(): ?string + { + return $this->container['employerName']; + } + + /** + * Sets employerName + * + * @param string|null $employerName [readonly] + * + * @return $this + */ + public function setEmployerName(?string $employerName): static + { + if (is_null($employerName)) { + array_push($this->openAPINullablesSetToNull, 'employerName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerName'] = $employerName; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode [readonly] + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets employerOfficeNo + * + * @return string|null + */ + public function getEmployerOfficeNo(): ?string + { + return $this->container['employerOfficeNo']; + } + + /** + * Sets employerOfficeNo + * + * @param string|null $employerOfficeNo [readonly] + * + * @return $this + */ + public function setEmployerOfficeNo(?string $employerOfficeNo): static + { + if (is_null($employerOfficeNo)) { + array_push($this->openAPINullablesSetToNull, 'employerOfficeNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerOfficeNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerOfficeNo'] = $employerOfficeNo; + + return $this; + } + + /** + * Gets employerPayeRef + * + * @return string|null + */ + public function getEmployerPayeRef(): ?string + { + return $this->container['employerPayeRef']; + } + + /** + * Sets employerPayeRef + * + * @param string|null $employerPayeRef [readonly] + * + * @return $this + */ + public function setEmployerPayeRef(?string $employerPayeRef): static + { + if (is_null($employerPayeRef)) { + array_push($this->openAPINullablesSetToNull, 'employerPayeRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPayeRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPayeRef'] = $employerPayeRef; + + return $this; + } + + /** + * Gets firstname + * + * @return string|null + */ + public function getFirstname(): ?string + { + return $this->container['firstname']; + } + + /** + * Sets firstname + * + * @param string|null $firstname [readonly] + * + * @return $this + */ + public function setFirstname(?string $firstname): static + { + if (is_null($firstname)) { + array_push($this->openAPINullablesSetToNull, 'firstname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstname'] = $firstname; + + return $this; + } + + /** + * Gets surname + * + * @return string|null + */ + public function getSurname(): ?string + { + return $this->container['surname']; + } + + /** + * Sets surname + * + * @param string|null $surname [readonly] + * + * @return $this + */ + public function setSurname(?string $surname): static + { + if (is_null($surname)) { + array_push($this->openAPINullablesSetToNull, 'surname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('surname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['surname'] = $surname; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber [readonly] + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode [readonly] + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime|null + */ + public function getDateOfBirth(): ?\DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime|null $dateOfBirth [readonly] + * + * @return $this + */ + public function setDateOfBirth(?\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets joinDate + * + * @return \DateTime|null + */ + public function getJoinDate(): ?\DateTime + { + return $this->container['joinDate']; + } + + /** + * Sets joinDate + * + * @param \DateTime|null $joinDate [readonly] + * + * @return $this + */ + public function setJoinDate(?\DateTime $joinDate): static + { + if (is_null($joinDate)) { + throw new InvalidArgumentException('non-nullable joinDate cannot be null'); + } + $this->container['joinDate'] = $joinDate; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate [readonly] + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\P11Line[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\P11Line[]|null $lines [readonly] + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DAssetAvailable.php b/src/Model/P11DAssetAvailable.php new file mode 100644 index 0000000..672c69d --- /dev/null +++ b/src/Model/P11DAssetAvailable.php @@ -0,0 +1,661 @@ + + */ +class P11DAssetAvailable implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DAssetAvailable'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'desc' => 'string', + 'other' => 'string', + 'annValProRata' => 'string', + 'grossOrAmtForgone' => 'string', + 'costOrAmtForgone' => 'string', + 'madeGood' => 'string', + 'cashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'desc' => null, + 'other' => null, + 'annValProRata' => null, + 'grossOrAmtForgone' => null, + 'costOrAmtForgone' => null, + 'madeGood' => null, + 'cashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'desc' => true, + 'other' => true, + 'annValProRata' => true, + 'grossOrAmtForgone' => true, + 'costOrAmtForgone' => true, + 'madeGood' => true, + 'cashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'desc' => 'desc', + 'other' => 'other', + 'annValProRata' => 'annValProRata', + 'grossOrAmtForgone' => 'grossOrAmtForgone', + 'costOrAmtForgone' => 'costOrAmtForgone', + 'madeGood' => 'madeGood', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'desc' => 'setDesc', + 'other' => 'setOther', + 'annValProRata' => 'setAnnValProRata', + 'grossOrAmtForgone' => 'setGrossOrAmtForgone', + 'costOrAmtForgone' => 'setCostOrAmtForgone', + 'madeGood' => 'setMadeGood', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'desc' => 'getDesc', + 'other' => 'getOther', + 'annValProRata' => 'getAnnValProRata', + 'grossOrAmtForgone' => 'getGrossOrAmtForgone', + 'costOrAmtForgone' => 'getCostOrAmtForgone', + 'madeGood' => 'getMadeGood', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('desc', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('annValProRata', $data ?? [], null); + $this->setIfExists('grossOrAmtForgone', $data ?? [], null); + $this->setIfExists('costOrAmtForgone', $data ?? [], null); + $this->setIfExists('madeGood', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets desc + * + * @return string|null + */ + public function getDesc(): ?string + { + return $this->container['desc']; + } + + /** + * Sets desc + * + * @param string|null $desc desc + * + * @return $this + */ + public function setDesc(?string $desc): static + { + if (is_null($desc)) { + array_push($this->openAPINullablesSetToNull, 'desc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('desc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['desc'] = $desc; + + return $this; + } + + /** + * Gets other + * + * @return string|null + */ + public function getOther(): ?string + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param string|null $other other + * + * @return $this + */ + public function setOther(?string $other): static + { + if (is_null($other)) { + array_push($this->openAPINullablesSetToNull, 'other'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('other', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets annValProRata + * + * @return string|null + */ + public function getAnnValProRata(): ?string + { + return $this->container['annValProRata']; + } + + /** + * Sets annValProRata + * + * @param string|null $annValProRata annValProRata + * + * @return $this + */ + public function setAnnValProRata(?string $annValProRata): static + { + if (is_null($annValProRata)) { + array_push($this->openAPINullablesSetToNull, 'annValProRata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annValProRata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annValProRata'] = $annValProRata; + + return $this; + } + + /** + * Gets grossOrAmtForgone + * + * @return string|null + */ + public function getGrossOrAmtForgone(): ?string + { + return $this->container['grossOrAmtForgone']; + } + + /** + * Sets grossOrAmtForgone + * + * @param string|null $grossOrAmtForgone grossOrAmtForgone + * + * @return $this + */ + public function setGrossOrAmtForgone(?string $grossOrAmtForgone): static + { + if (is_null($grossOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'grossOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossOrAmtForgone'] = $grossOrAmtForgone; + + return $this; + } + + /** + * Gets costOrAmtForgone + * + * @return string|null + */ + public function getCostOrAmtForgone(): ?string + { + return $this->container['costOrAmtForgone']; + } + + /** + * Sets costOrAmtForgone + * + * @param string|null $costOrAmtForgone costOrAmtForgone + * + * @return $this + */ + public function setCostOrAmtForgone(?string $costOrAmtForgone): static + { + if (is_null($costOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'costOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOrAmtForgone'] = $costOrAmtForgone; + + return $this; + } + + /** + * Gets madeGood + * + * @return string|null + */ + public function getMadeGood(): ?string + { + return $this->container['madeGood']; + } + + /** + * Sets madeGood + * + * @param string|null $madeGood madeGood + * + * @return $this + */ + public function setMadeGood(?string $madeGood): static + { + if (is_null($madeGood)) { + array_push($this->openAPINullablesSetToNull, 'madeGood'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('madeGood', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['madeGood'] = $madeGood; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DAssetAvailableCollection.php b/src/Model/P11DAssetAvailableCollection.php new file mode 100644 index 0000000..5cadc3e --- /dev/null +++ b/src/Model/P11DAssetAvailableCollection.php @@ -0,0 +1,456 @@ + + */ +class P11DAssetAvailableCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DAssetAvailableCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'asset' => '\SynergiTech\Staffology\Model\P11DAssetAvailable[]', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'asset' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'asset' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'asset' => 'asset', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'asset' => 'setAsset', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'asset' => 'getAsset', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('asset', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets asset + * + * @return \SynergiTech\Staffology\Model\P11DAssetAvailable[]|null + */ + public function getAsset(): ?array + { + return $this->container['asset']; + } + + /** + * Sets asset + * + * @param \SynergiTech\Staffology\Model\P11DAssetAvailable[]|null $asset asset + * + * @return $this + */ + public function setAsset(?array $asset): static + { + if (is_null($asset)) { + array_push($this->openAPINullablesSetToNull, 'asset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('asset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['asset'] = $asset; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DAssetTransferredCollection.php b/src/Model/P11DAssetTransferredCollection.php new file mode 100644 index 0000000..919f8b0 --- /dev/null +++ b/src/Model/P11DAssetTransferredCollection.php @@ -0,0 +1,456 @@ + + */ +class P11DAssetTransferredCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DAssetTransferredCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'asset' => '\SynergiTech\Staffology\Model\P11DDescOther[]', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'asset' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'asset' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'asset' => 'asset', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'asset' => 'setAsset', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'asset' => 'getAsset', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('asset', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets asset + * + * @return \SynergiTech\Staffology\Model\P11DDescOther[]|null + */ + public function getAsset(): ?array + { + return $this->container['asset']; + } + + /** + * Sets asset + * + * @param \SynergiTech\Staffology\Model\P11DDescOther[]|null $asset asset + * + * @return $this + */ + public function setAsset(?array $asset): static + { + if (is_null($asset)) { + array_push($this->openAPINullablesSetToNull, 'asset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('asset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['asset'] = $asset; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DCar.php b/src/Model/P11DCar.php new file mode 100644 index 0000000..8c33670 --- /dev/null +++ b/src/Model/P11DCar.php @@ -0,0 +1,1023 @@ + + */ +class P11DCar implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DCar'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'make' => 'string', + 'registered' => 'string', + 'availFrom' => 'string', + 'availTo' => 'string', + 'cc' => 'string', + 'fuel' => 'string', + 'cO2' => 'string', + 'zeroEmissionMileage' => 'string', + 'noAppCO2Fig' => 'string', + 'list' => 'string', + 'accs' => 'string', + 'capCont' => 'string', + 'privUsePmt' => 'string', + 'fuelWithdrawn' => '\SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn', + 'cashEquivOrRelevantAmt' => 'string', + 'fuelCashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'make' => null, + 'registered' => null, + 'availFrom' => null, + 'availTo' => null, + 'cc' => null, + 'fuel' => null, + 'cO2' => null, + 'zeroEmissionMileage' => null, + 'noAppCO2Fig' => null, + 'list' => null, + 'accs' => null, + 'capCont' => null, + 'privUsePmt' => null, + 'fuelWithdrawn' => null, + 'cashEquivOrRelevantAmt' => null, + 'fuelCashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'make' => true, + 'registered' => true, + 'availFrom' => true, + 'availTo' => true, + 'cc' => true, + 'fuel' => true, + 'cO2' => true, + 'zeroEmissionMileage' => true, + 'noAppCO2Fig' => true, + 'list' => true, + 'accs' => true, + 'capCont' => true, + 'privUsePmt' => true, + 'fuelWithdrawn' => false, + 'cashEquivOrRelevantAmt' => true, + 'fuelCashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'make' => 'make', + 'registered' => 'registered', + 'availFrom' => 'availFrom', + 'availTo' => 'availTo', + 'cc' => 'cc', + 'fuel' => 'fuel', + 'cO2' => 'cO2', + 'zeroEmissionMileage' => 'zeroEmissionMileage', + 'noAppCO2Fig' => 'noAppCO2Fig', + 'list' => 'list', + 'accs' => 'accs', + 'capCont' => 'capCont', + 'privUsePmt' => 'privUsePmt', + 'fuelWithdrawn' => 'fuelWithdrawn', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt', + 'fuelCashEquivOrRelevantAmt' => 'fuelCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'make' => 'setMake', + 'registered' => 'setRegistered', + 'availFrom' => 'setAvailFrom', + 'availTo' => 'setAvailTo', + 'cc' => 'setCc', + 'fuel' => 'setFuel', + 'cO2' => 'setCO2', + 'zeroEmissionMileage' => 'setZeroEmissionMileage', + 'noAppCO2Fig' => 'setNoAppCO2Fig', + 'list' => 'setList', + 'accs' => 'setAccs', + 'capCont' => 'setCapCont', + 'privUsePmt' => 'setPrivUsePmt', + 'fuelWithdrawn' => 'setFuelWithdrawn', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt', + 'fuelCashEquivOrRelevantAmt' => 'setFuelCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'make' => 'getMake', + 'registered' => 'getRegistered', + 'availFrom' => 'getAvailFrom', + 'availTo' => 'getAvailTo', + 'cc' => 'getCc', + 'fuel' => 'getFuel', + 'cO2' => 'getCO2', + 'zeroEmissionMileage' => 'getZeroEmissionMileage', + 'noAppCO2Fig' => 'getNoAppCO2Fig', + 'list' => 'getList', + 'accs' => 'getAccs', + 'capCont' => 'getCapCont', + 'privUsePmt' => 'getPrivUsePmt', + 'fuelWithdrawn' => 'getFuelWithdrawn', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt', + 'fuelCashEquivOrRelevantAmt' => 'getFuelCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('make', $data ?? [], null); + $this->setIfExists('registered', $data ?? [], null); + $this->setIfExists('availFrom', $data ?? [], null); + $this->setIfExists('availTo', $data ?? [], null); + $this->setIfExists('cc', $data ?? [], null); + $this->setIfExists('fuel', $data ?? [], null); + $this->setIfExists('cO2', $data ?? [], null); + $this->setIfExists('zeroEmissionMileage', $data ?? [], null); + $this->setIfExists('noAppCO2Fig', $data ?? [], null); + $this->setIfExists('list', $data ?? [], null); + $this->setIfExists('accs', $data ?? [], null); + $this->setIfExists('capCont', $data ?? [], null); + $this->setIfExists('privUsePmt', $data ?? [], null); + $this->setIfExists('fuelWithdrawn', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + $this->setIfExists('fuelCashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets make + * + * @return string|null + */ + public function getMake(): ?string + { + return $this->container['make']; + } + + /** + * Sets make + * + * @param string|null $make make + * + * @return $this + */ + public function setMake(?string $make): static + { + if (is_null($make)) { + array_push($this->openAPINullablesSetToNull, 'make'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('make', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['make'] = $make; + + return $this; + } + + /** + * Gets registered + * + * @return string|null + */ + public function getRegistered(): ?string + { + return $this->container['registered']; + } + + /** + * Sets registered + * + * @param string|null $registered registered + * + * @return $this + */ + public function setRegistered(?string $registered): static + { + if (is_null($registered)) { + array_push($this->openAPINullablesSetToNull, 'registered'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('registered', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['registered'] = $registered; + + return $this; + } + + /** + * Gets availFrom + * + * @return string|null + */ + public function getAvailFrom(): ?string + { + return $this->container['availFrom']; + } + + /** + * Sets availFrom + * + * @param string|null $availFrom availFrom + * + * @return $this + */ + public function setAvailFrom(?string $availFrom): static + { + if (is_null($availFrom)) { + array_push($this->openAPINullablesSetToNull, 'availFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availFrom'] = $availFrom; + + return $this; + } + + /** + * Gets availTo + * + * @return string|null + */ + public function getAvailTo(): ?string + { + return $this->container['availTo']; + } + + /** + * Sets availTo + * + * @param string|null $availTo availTo + * + * @return $this + */ + public function setAvailTo(?string $availTo): static + { + if (is_null($availTo)) { + array_push($this->openAPINullablesSetToNull, 'availTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('availTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['availTo'] = $availTo; + + return $this; + } + + /** + * Gets cc + * + * @return string|null + */ + public function getCc(): ?string + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param string|null $cc cc + * + * @return $this + */ + public function setCc(?string $cc): static + { + if (is_null($cc)) { + array_push($this->openAPINullablesSetToNull, 'cc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets fuel + * + * @return string|null + */ + public function getFuel(): ?string + { + return $this->container['fuel']; + } + + /** + * Sets fuel + * + * @param string|null $fuel fuel + * + * @return $this + */ + public function setFuel(?string $fuel): static + { + if (is_null($fuel)) { + array_push($this->openAPINullablesSetToNull, 'fuel'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuel', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuel'] = $fuel; + + return $this; + } + + /** + * Gets cO2 + * + * @return string|null + */ + public function getCO2(): ?string + { + return $this->container['cO2']; + } + + /** + * Sets cO2 + * + * @param string|null $cO2 cO2 + * + * @return $this + */ + public function setCO2(?string $cO2): static + { + if (is_null($cO2)) { + array_push($this->openAPINullablesSetToNull, 'cO2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cO2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cO2'] = $cO2; + + return $this; + } + + /** + * Gets zeroEmissionMileage + * + * @return string|null + */ + public function getZeroEmissionMileage(): ?string + { + return $this->container['zeroEmissionMileage']; + } + + /** + * Sets zeroEmissionMileage + * + * @param string|null $zeroEmissionMileage zeroEmissionMileage + * + * @return $this + */ + public function setZeroEmissionMileage(?string $zeroEmissionMileage): static + { + if (is_null($zeroEmissionMileage)) { + array_push($this->openAPINullablesSetToNull, 'zeroEmissionMileage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('zeroEmissionMileage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['zeroEmissionMileage'] = $zeroEmissionMileage; + + return $this; + } + + /** + * Gets noAppCO2Fig + * + * @return string|null + */ + public function getNoAppCO2Fig(): ?string + { + return $this->container['noAppCO2Fig']; + } + + /** + * Sets noAppCO2Fig + * + * @param string|null $noAppCO2Fig noAppCO2Fig + * + * @return $this + */ + public function setNoAppCO2Fig(?string $noAppCO2Fig): static + { + if (is_null($noAppCO2Fig)) { + array_push($this->openAPINullablesSetToNull, 'noAppCO2Fig'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('noAppCO2Fig', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['noAppCO2Fig'] = $noAppCO2Fig; + + return $this; + } + + /** + * Gets list + * + * @return string|null + */ + public function getList(): ?string + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param string|null $list list + * + * @return $this + */ + public function setList(?string $list): static + { + if (is_null($list)) { + array_push($this->openAPINullablesSetToNull, 'list'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('list', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['list'] = $list; + + return $this; + } + + /** + * Gets accs + * + * @return string|null + */ + public function getAccs(): ?string + { + return $this->container['accs']; + } + + /** + * Sets accs + * + * @param string|null $accs accs + * + * @return $this + */ + public function setAccs(?string $accs): static + { + if (is_null($accs)) { + array_push($this->openAPINullablesSetToNull, 'accs'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accs', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accs'] = $accs; + + return $this; + } + + /** + * Gets capCont + * + * @return string|null + */ + public function getCapCont(): ?string + { + return $this->container['capCont']; + } + + /** + * Sets capCont + * + * @param string|null $capCont capCont + * + * @return $this + */ + public function setCapCont(?string $capCont): static + { + if (is_null($capCont)) { + array_push($this->openAPINullablesSetToNull, 'capCont'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('capCont', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['capCont'] = $capCont; + + return $this; + } + + /** + * Gets privUsePmt + * + * @return string|null + */ + public function getPrivUsePmt(): ?string + { + return $this->container['privUsePmt']; + } + + /** + * Sets privUsePmt + * + * @param string|null $privUsePmt privUsePmt + * + * @return $this + */ + public function setPrivUsePmt(?string $privUsePmt): static + { + if (is_null($privUsePmt)) { + array_push($this->openAPINullablesSetToNull, 'privUsePmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('privUsePmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['privUsePmt'] = $privUsePmt; + + return $this; + } + + /** + * Gets fuelWithdrawn + * + * @return \SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn|null + */ + public function getFuelWithdrawn(): ?\SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn + { + return $this->container['fuelWithdrawn']; + } + + /** + * Sets fuelWithdrawn + * + * @param \SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn|null $fuelWithdrawn fuelWithdrawn + * + * @return $this + */ + public function setFuelWithdrawn(?\SynergiTech\Staffology\Model\P11dCarFreeFuelWithdrawn $fuelWithdrawn): static + { + if (is_null($fuelWithdrawn)) { + throw new InvalidArgumentException('non-nullable fuelWithdrawn cannot be null'); + } + $this->container['fuelWithdrawn'] = $fuelWithdrawn; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + + /** + * Gets fuelCashEquivOrRelevantAmt + * + * @return string|null + */ + public function getFuelCashEquivOrRelevantAmt(): ?string + { + return $this->container['fuelCashEquivOrRelevantAmt']; + } + + /** + * Sets fuelCashEquivOrRelevantAmt + * + * @param string|null $fuelCashEquivOrRelevantAmt fuelCashEquivOrRelevantAmt + * + * @return $this + */ + public function setFuelCashEquivOrRelevantAmt(?string $fuelCashEquivOrRelevantAmt): static + { + if (is_null($fuelCashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'fuelCashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuelCashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuelCashEquivOrRelevantAmt'] = $fuelCashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DCarCollection.php b/src/Model/P11DCarCollection.php new file mode 100644 index 0000000..aca364c --- /dev/null +++ b/src/Model/P11DCarCollection.php @@ -0,0 +1,538 @@ + + */ +class P11DCarCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DCarCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'car' => '\SynergiTech\Staffology\Model\P11DCar[]', + 'totalCarsOrRelevantAmt' => 'string', + 'totalFuelOrRelevantAmt' => 'string', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'car' => null, + 'totalCarsOrRelevantAmt' => null, + 'totalFuelOrRelevantAmt' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'car' => true, + 'totalCarsOrRelevantAmt' => true, + 'totalFuelOrRelevantAmt' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'car' => 'car', + 'totalCarsOrRelevantAmt' => 'totalCarsOrRelevantAmt', + 'totalFuelOrRelevantAmt' => 'totalFuelOrRelevantAmt', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'car' => 'setCar', + 'totalCarsOrRelevantAmt' => 'setTotalCarsOrRelevantAmt', + 'totalFuelOrRelevantAmt' => 'setTotalFuelOrRelevantAmt', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'car' => 'getCar', + 'totalCarsOrRelevantAmt' => 'getTotalCarsOrRelevantAmt', + 'totalFuelOrRelevantAmt' => 'getTotalFuelOrRelevantAmt', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('car', $data ?? [], null); + $this->setIfExists('totalCarsOrRelevantAmt', $data ?? [], null); + $this->setIfExists('totalFuelOrRelevantAmt', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets car + * + * @return \SynergiTech\Staffology\Model\P11DCar[]|null + */ + public function getCar(): ?array + { + return $this->container['car']; + } + + /** + * Sets car + * + * @param \SynergiTech\Staffology\Model\P11DCar[]|null $car car + * + * @return $this + */ + public function setCar(?array $car): static + { + if (is_null($car)) { + array_push($this->openAPINullablesSetToNull, 'car'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('car', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['car'] = $car; + + return $this; + } + + /** + * Gets totalCarsOrRelevantAmt + * + * @return string|null + */ + public function getTotalCarsOrRelevantAmt(): ?string + { + return $this->container['totalCarsOrRelevantAmt']; + } + + /** + * Sets totalCarsOrRelevantAmt + * + * @param string|null $totalCarsOrRelevantAmt totalCarsOrRelevantAmt + * + * @return $this + */ + public function setTotalCarsOrRelevantAmt(?string $totalCarsOrRelevantAmt): static + { + if (is_null($totalCarsOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'totalCarsOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalCarsOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalCarsOrRelevantAmt'] = $totalCarsOrRelevantAmt; + + return $this; + } + + /** + * Gets totalFuelOrRelevantAmt + * + * @return string|null + */ + public function getTotalFuelOrRelevantAmt(): ?string + { + return $this->container['totalFuelOrRelevantAmt']; + } + + /** + * Sets totalFuelOrRelevantAmt + * + * @param string|null $totalFuelOrRelevantAmt totalFuelOrRelevantAmt + * + * @return $this + */ + public function setTotalFuelOrRelevantAmt(?string $totalFuelOrRelevantAmt): static + { + if (is_null($totalFuelOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'totalFuelOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalFuelOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalFuelOrRelevantAmt'] = $totalFuelOrRelevantAmt; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DDescOther.php b/src/Model/P11DDescOther.php new file mode 100644 index 0000000..ed56356 --- /dev/null +++ b/src/Model/P11DDescOther.php @@ -0,0 +1,661 @@ + + */ +class P11DDescOther implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DDescOther'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'desc' => 'string', + 'other' => 'string', + 'annValProRata' => 'string', + 'grossOrAmtForgone' => 'string', + 'costOrAmtForgone' => 'string', + 'madeGood' => 'string', + 'cashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'desc' => null, + 'other' => null, + 'annValProRata' => null, + 'grossOrAmtForgone' => null, + 'costOrAmtForgone' => null, + 'madeGood' => null, + 'cashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'desc' => true, + 'other' => true, + 'annValProRata' => true, + 'grossOrAmtForgone' => true, + 'costOrAmtForgone' => true, + 'madeGood' => true, + 'cashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'desc' => 'desc', + 'other' => 'other', + 'annValProRata' => 'annValProRata', + 'grossOrAmtForgone' => 'grossOrAmtForgone', + 'costOrAmtForgone' => 'costOrAmtForgone', + 'madeGood' => 'madeGood', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'desc' => 'setDesc', + 'other' => 'setOther', + 'annValProRata' => 'setAnnValProRata', + 'grossOrAmtForgone' => 'setGrossOrAmtForgone', + 'costOrAmtForgone' => 'setCostOrAmtForgone', + 'madeGood' => 'setMadeGood', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'desc' => 'getDesc', + 'other' => 'getOther', + 'annValProRata' => 'getAnnValProRata', + 'grossOrAmtForgone' => 'getGrossOrAmtForgone', + 'costOrAmtForgone' => 'getCostOrAmtForgone', + 'madeGood' => 'getMadeGood', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('desc', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('annValProRata', $data ?? [], null); + $this->setIfExists('grossOrAmtForgone', $data ?? [], null); + $this->setIfExists('costOrAmtForgone', $data ?? [], null); + $this->setIfExists('madeGood', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets desc + * + * @return string|null + */ + public function getDesc(): ?string + { + return $this->container['desc']; + } + + /** + * Sets desc + * + * @param string|null $desc desc + * + * @return $this + */ + public function setDesc(?string $desc): static + { + if (is_null($desc)) { + array_push($this->openAPINullablesSetToNull, 'desc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('desc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['desc'] = $desc; + + return $this; + } + + /** + * Gets other + * + * @return string|null + */ + public function getOther(): ?string + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param string|null $other other + * + * @return $this + */ + public function setOther(?string $other): static + { + if (is_null($other)) { + array_push($this->openAPINullablesSetToNull, 'other'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('other', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets annValProRata + * + * @return string|null + */ + public function getAnnValProRata(): ?string + { + return $this->container['annValProRata']; + } + + /** + * Sets annValProRata + * + * @param string|null $annValProRata annValProRata + * + * @return $this + */ + public function setAnnValProRata(?string $annValProRata): static + { + if (is_null($annValProRata)) { + array_push($this->openAPINullablesSetToNull, 'annValProRata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annValProRata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annValProRata'] = $annValProRata; + + return $this; + } + + /** + * Gets grossOrAmtForgone + * + * @return string|null + */ + public function getGrossOrAmtForgone(): ?string + { + return $this->container['grossOrAmtForgone']; + } + + /** + * Sets grossOrAmtForgone + * + * @param string|null $grossOrAmtForgone grossOrAmtForgone + * + * @return $this + */ + public function setGrossOrAmtForgone(?string $grossOrAmtForgone): static + { + if (is_null($grossOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'grossOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossOrAmtForgone'] = $grossOrAmtForgone; + + return $this; + } + + /** + * Gets costOrAmtForgone + * + * @return string|null + */ + public function getCostOrAmtForgone(): ?string + { + return $this->container['costOrAmtForgone']; + } + + /** + * Sets costOrAmtForgone + * + * @param string|null $costOrAmtForgone costOrAmtForgone + * + * @return $this + */ + public function setCostOrAmtForgone(?string $costOrAmtForgone): static + { + if (is_null($costOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'costOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOrAmtForgone'] = $costOrAmtForgone; + + return $this; + } + + /** + * Gets madeGood + * + * @return string|null + */ + public function getMadeGood(): ?string + { + return $this->container['madeGood']; + } + + /** + * Sets madeGood + * + * @param string|null $madeGood madeGood + * + * @return $this + */ + public function setMadeGood(?string $madeGood): static + { + if (is_null($madeGood)) { + array_push($this->openAPINullablesSetToNull, 'madeGood'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('madeGood', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['madeGood'] = $madeGood; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DLoan.php b/src/Model/P11DLoan.php new file mode 100644 index 0000000..6aaa73f --- /dev/null +++ b/src/Model/P11DLoan.php @@ -0,0 +1,702 @@ + + */ +class P11DLoan implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DLoan'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'joint' => 'string', + 'initOS' => 'string', + 'finalOS' => 'string', + 'maxOS' => 'string', + 'intPaid' => 'string', + 'date' => 'string', + 'discharge' => 'string', + 'cashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'joint' => null, + 'initOS' => null, + 'finalOS' => null, + 'maxOS' => null, + 'intPaid' => null, + 'date' => null, + 'discharge' => null, + 'cashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'joint' => true, + 'initOS' => true, + 'finalOS' => true, + 'maxOS' => true, + 'intPaid' => true, + 'date' => true, + 'discharge' => true, + 'cashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'joint' => 'joint', + 'initOS' => 'initOS', + 'finalOS' => 'finalOS', + 'maxOS' => 'maxOS', + 'intPaid' => 'intPaid', + 'date' => 'date', + 'discharge' => 'discharge', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'joint' => 'setJoint', + 'initOS' => 'setInitOS', + 'finalOS' => 'setFinalOS', + 'maxOS' => 'setMaxOS', + 'intPaid' => 'setIntPaid', + 'date' => 'setDate', + 'discharge' => 'setDischarge', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'joint' => 'getJoint', + 'initOS' => 'getInitOS', + 'finalOS' => 'getFinalOS', + 'maxOS' => 'getMaxOS', + 'intPaid' => 'getIntPaid', + 'date' => 'getDate', + 'discharge' => 'getDischarge', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('joint', $data ?? [], null); + $this->setIfExists('initOS', $data ?? [], null); + $this->setIfExists('finalOS', $data ?? [], null); + $this->setIfExists('maxOS', $data ?? [], null); + $this->setIfExists('intPaid', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('discharge', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets joint + * + * @return string|null + */ + public function getJoint(): ?string + { + return $this->container['joint']; + } + + /** + * Sets joint + * + * @param string|null $joint joint + * + * @return $this + */ + public function setJoint(?string $joint): static + { + if (is_null($joint)) { + array_push($this->openAPINullablesSetToNull, 'joint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('joint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['joint'] = $joint; + + return $this; + } + + /** + * Gets initOS + * + * @return string|null + */ + public function getInitOS(): ?string + { + return $this->container['initOS']; + } + + /** + * Sets initOS + * + * @param string|null $initOS initOS + * + * @return $this + */ + public function setInitOS(?string $initOS): static + { + if (is_null($initOS)) { + array_push($this->openAPINullablesSetToNull, 'initOS'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initOS', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initOS'] = $initOS; + + return $this; + } + + /** + * Gets finalOS + * + * @return string|null + */ + public function getFinalOS(): ?string + { + return $this->container['finalOS']; + } + + /** + * Sets finalOS + * + * @param string|null $finalOS finalOS + * + * @return $this + */ + public function setFinalOS(?string $finalOS): static + { + if (is_null($finalOS)) { + array_push($this->openAPINullablesSetToNull, 'finalOS'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('finalOS', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['finalOS'] = $finalOS; + + return $this; + } + + /** + * Gets maxOS + * + * @return string|null + */ + public function getMaxOS(): ?string + { + return $this->container['maxOS']; + } + + /** + * Sets maxOS + * + * @param string|null $maxOS maxOS + * + * @return $this + */ + public function setMaxOS(?string $maxOS): static + { + if (is_null($maxOS)) { + array_push($this->openAPINullablesSetToNull, 'maxOS'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('maxOS', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['maxOS'] = $maxOS; + + return $this; + } + + /** + * Gets intPaid + * + * @return string|null + */ + public function getIntPaid(): ?string + { + return $this->container['intPaid']; + } + + /** + * Sets intPaid + * + * @param string|null $intPaid intPaid + * + * @return $this + */ + public function setIntPaid(?string $intPaid): static + { + if (is_null($intPaid)) { + array_push($this->openAPINullablesSetToNull, 'intPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('intPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['intPaid'] = $intPaid; + + return $this; + } + + /** + * Gets date + * + * @return string|null + */ + public function getDate(): ?string + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string|null $date date + * + * @return $this + */ + public function setDate(?string $date): static + { + if (is_null($date)) { + array_push($this->openAPINullablesSetToNull, 'date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets discharge + * + * @return string|null + */ + public function getDischarge(): ?string + { + return $this->container['discharge']; + } + + /** + * Sets discharge + * + * @param string|null $discharge discharge + * + * @return $this + */ + public function setDischarge(?string $discharge): static + { + if (is_null($discharge)) { + array_push($this->openAPINullablesSetToNull, 'discharge'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('discharge', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['discharge'] = $discharge; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DLoanCollection.php b/src/Model/P11DLoanCollection.php new file mode 100644 index 0000000..988d1b9 --- /dev/null +++ b/src/Model/P11DLoanCollection.php @@ -0,0 +1,456 @@ + + */ +class P11DLoanCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DLoanCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'loan' => '\SynergiTech\Staffology\Model\P11DLoan[]', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'loan' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'loan' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'loan' => 'loan', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'loan' => 'setLoan', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'loan' => 'getLoan', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('loan', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets loan + * + * @return \SynergiTech\Staffology\Model\P11DLoan[]|null + */ + public function getLoan(): ?array + { + return $this->container['loan']; + } + + /** + * Sets loan + * + * @param \SynergiTech\Staffology\Model\P11DLoan[]|null $loan loan + * + * @return $this + */ + public function setLoan(?array $loan): static + { + if (is_null($loan)) { + array_push($this->openAPINullablesSetToNull, 'loan'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loan', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loan'] = $loan; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DOther.php b/src/Model/P11DOther.php new file mode 100644 index 0000000..6efeb6b --- /dev/null +++ b/src/Model/P11DOther.php @@ -0,0 +1,538 @@ + + */ +class P11DOther implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DOther'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'class1A' => '\SynergiTech\Staffology\Model\P11DDescOther[]', + 'nonClass1A' => '\SynergiTech\Staffology\Model\P11DDescOther[]', + 'taxPaid' => 'string', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'class1A' => null, + 'nonClass1A' => null, + 'taxPaid' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'class1A' => true, + 'nonClass1A' => true, + 'taxPaid' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'class1A' => 'class1A', + 'nonClass1A' => 'nonClass1A', + 'taxPaid' => 'taxPaid', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'class1A' => 'setClass1A', + 'nonClass1A' => 'setNonClass1A', + 'taxPaid' => 'setTaxPaid', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'class1A' => 'getClass1A', + 'nonClass1A' => 'getNonClass1A', + 'taxPaid' => 'getTaxPaid', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('class1A', $data ?? [], null); + $this->setIfExists('nonClass1A', $data ?? [], null); + $this->setIfExists('taxPaid', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets class1A + * + * @return \SynergiTech\Staffology\Model\P11DDescOther[]|null + */ + public function getClass1A(): ?array + { + return $this->container['class1A']; + } + + /** + * Sets class1A + * + * @param \SynergiTech\Staffology\Model\P11DDescOther[]|null $class1A class1A + * + * @return $this + */ + public function setClass1A(?array $class1A): static + { + if (is_null($class1A)) { + array_push($this->openAPINullablesSetToNull, 'class1A'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('class1A', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['class1A'] = $class1A; + + return $this; + } + + /** + * Gets nonClass1A + * + * @return \SynergiTech\Staffology\Model\P11DDescOther[]|null + */ + public function getNonClass1A(): ?array + { + return $this->container['nonClass1A']; + } + + /** + * Sets nonClass1A + * + * @param \SynergiTech\Staffology\Model\P11DDescOther[]|null $nonClass1A nonClass1A + * + * @return $this + */ + public function setNonClass1A(?array $nonClass1A): static + { + if (is_null($nonClass1A)) { + array_push($this->openAPINullablesSetToNull, 'nonClass1A'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nonClass1A', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nonClass1A'] = $nonClass1A; + + return $this; + } + + /** + * Gets taxPaid + * + * @return string|null + */ + public function getTaxPaid(): ?string + { + return $this->container['taxPaid']; + } + + /** + * Sets taxPaid + * + * @param string|null $taxPaid taxPaid + * + * @return $this + */ + public function setTaxPaid(?string $taxPaid): static + { + if (is_null($taxPaid)) { + array_push($this->openAPINullablesSetToNull, 'taxPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxPaid'] = $taxPaid; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DPaymentCollection.php b/src/Model/P11DPaymentCollection.php new file mode 100644 index 0000000..1251d31 --- /dev/null +++ b/src/Model/P11DPaymentCollection.php @@ -0,0 +1,497 @@ + + */ +class P11DPaymentCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DPaymentCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payment' => '\SynergiTech\Staffology\Model\P11DDescOther[]', + 'tax' => 'string', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payment' => null, + 'tax' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payment' => true, + 'tax' => true, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payment' => 'payment', + 'tax' => 'tax', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payment' => 'setPayment', + 'tax' => 'setTax', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payment' => 'getPayment', + 'tax' => 'getTax', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment + * + * @return \SynergiTech\Staffology\Model\P11DDescOther[]|null + */ + public function getPayment(): ?array + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \SynergiTech\Staffology\Model\P11DDescOther[]|null $payment payment + * + * @return $this + */ + public function setPayment(?array $payment): static + { + if (is_null($payment)) { + array_push($this->openAPINullablesSetToNull, 'payment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets tax + * + * @return string|null + */ + public function getTax(): ?string + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param string|null $tax tax + * + * @return $this + */ + public function setTax(?string $tax): static + { + if (is_null($tax)) { + array_push($this->openAPINullablesSetToNull, 'tax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DSingleItem.php b/src/Model/P11DSingleItem.php new file mode 100644 index 0000000..96f0c5c --- /dev/null +++ b/src/Model/P11DSingleItem.php @@ -0,0 +1,866 @@ + + */ +class P11DSingleItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DSingleItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'typeLetter' => 'string', + 'taxablePmt' => 'string', + 'excess' => 'string', + 'taxablePmtOrRelevantAmt' => 'string', + 'tradingOrgInd' => 'string', + 'desc' => 'string', + 'other' => 'string', + 'annValProRata' => 'string', + 'grossOrAmtForgone' => 'string', + 'costOrAmtForgone' => 'string', + 'madeGood' => 'string', + 'cashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'typeLetter' => null, + 'taxablePmt' => null, + 'excess' => null, + 'taxablePmtOrRelevantAmt' => null, + 'tradingOrgInd' => null, + 'desc' => null, + 'other' => null, + 'annValProRata' => null, + 'grossOrAmtForgone' => null, + 'costOrAmtForgone' => null, + 'madeGood' => null, + 'cashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'typeLetter' => true, + 'taxablePmt' => true, + 'excess' => true, + 'taxablePmtOrRelevantAmt' => true, + 'tradingOrgInd' => true, + 'desc' => true, + 'other' => true, + 'annValProRata' => true, + 'grossOrAmtForgone' => true, + 'costOrAmtForgone' => true, + 'madeGood' => true, + 'cashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'typeLetter' => 'typeLetter', + 'taxablePmt' => 'taxablePmt', + 'excess' => 'excess', + 'taxablePmtOrRelevantAmt' => 'taxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'tradingOrgInd', + 'desc' => 'desc', + 'other' => 'other', + 'annValProRata' => 'annValProRata', + 'grossOrAmtForgone' => 'grossOrAmtForgone', + 'costOrAmtForgone' => 'costOrAmtForgone', + 'madeGood' => 'madeGood', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'typeLetter' => 'setTypeLetter', + 'taxablePmt' => 'setTaxablePmt', + 'excess' => 'setExcess', + 'taxablePmtOrRelevantAmt' => 'setTaxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'setTradingOrgInd', + 'desc' => 'setDesc', + 'other' => 'setOther', + 'annValProRata' => 'setAnnValProRata', + 'grossOrAmtForgone' => 'setGrossOrAmtForgone', + 'costOrAmtForgone' => 'setCostOrAmtForgone', + 'madeGood' => 'setMadeGood', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'typeLetter' => 'getTypeLetter', + 'taxablePmt' => 'getTaxablePmt', + 'excess' => 'getExcess', + 'taxablePmtOrRelevantAmt' => 'getTaxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'getTradingOrgInd', + 'desc' => 'getDesc', + 'other' => 'getOther', + 'annValProRata' => 'getAnnValProRata', + 'grossOrAmtForgone' => 'getGrossOrAmtForgone', + 'costOrAmtForgone' => 'getCostOrAmtForgone', + 'madeGood' => 'getMadeGood', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('typeLetter', $data ?? [], null); + $this->setIfExists('taxablePmt', $data ?? [], null); + $this->setIfExists('excess', $data ?? [], null); + $this->setIfExists('taxablePmtOrRelevantAmt', $data ?? [], null); + $this->setIfExists('tradingOrgInd', $data ?? [], null); + $this->setIfExists('desc', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('annValProRata', $data ?? [], null); + $this->setIfExists('grossOrAmtForgone', $data ?? [], null); + $this->setIfExists('costOrAmtForgone', $data ?? [], null); + $this->setIfExists('madeGood', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + + /** + * Gets taxablePmt + * + * @return string|null + */ + public function getTaxablePmt(): ?string + { + return $this->container['taxablePmt']; + } + + /** + * Sets taxablePmt + * + * @param string|null $taxablePmt taxablePmt + * + * @return $this + */ + public function setTaxablePmt(?string $taxablePmt): static + { + if (is_null($taxablePmt)) { + array_push($this->openAPINullablesSetToNull, 'taxablePmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePmt'] = $taxablePmt; + + return $this; + } + + /** + * Gets excess + * + * @return string|null + */ + public function getExcess(): ?string + { + return $this->container['excess']; + } + + /** + * Sets excess + * + * @param string|null $excess excess + * + * @return $this + */ + public function setExcess(?string $excess): static + { + if (is_null($excess)) { + array_push($this->openAPINullablesSetToNull, 'excess'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('excess', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['excess'] = $excess; + + return $this; + } + + /** + * Gets taxablePmtOrRelevantAmt + * + * @return string|null + */ + public function getTaxablePmtOrRelevantAmt(): ?string + { + return $this->container['taxablePmtOrRelevantAmt']; + } + + /** + * Sets taxablePmtOrRelevantAmt + * + * @param string|null $taxablePmtOrRelevantAmt taxablePmtOrRelevantAmt + * + * @return $this + */ + public function setTaxablePmtOrRelevantAmt(?string $taxablePmtOrRelevantAmt): static + { + if (is_null($taxablePmtOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'taxablePmtOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePmtOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePmtOrRelevantAmt'] = $taxablePmtOrRelevantAmt; + + return $this; + } + + /** + * Gets tradingOrgInd + * + * @return string|null + */ + public function getTradingOrgInd(): ?string + { + return $this->container['tradingOrgInd']; + } + + /** + * Sets tradingOrgInd + * + * @param string|null $tradingOrgInd tradingOrgInd + * + * @return $this + */ + public function setTradingOrgInd(?string $tradingOrgInd): static + { + if (is_null($tradingOrgInd)) { + array_push($this->openAPINullablesSetToNull, 'tradingOrgInd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingOrgInd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tradingOrgInd'] = $tradingOrgInd; + + return $this; + } + + /** + * Gets desc + * + * @return string|null + */ + public function getDesc(): ?string + { + return $this->container['desc']; + } + + /** + * Sets desc + * + * @param string|null $desc desc + * + * @return $this + */ + public function setDesc(?string $desc): static + { + if (is_null($desc)) { + array_push($this->openAPINullablesSetToNull, 'desc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('desc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['desc'] = $desc; + + return $this; + } + + /** + * Gets other + * + * @return string|null + */ + public function getOther(): ?string + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param string|null $other other + * + * @return $this + */ + public function setOther(?string $other): static + { + if (is_null($other)) { + array_push($this->openAPINullablesSetToNull, 'other'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('other', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets annValProRata + * + * @return string|null + */ + public function getAnnValProRata(): ?string + { + return $this->container['annValProRata']; + } + + /** + * Sets annValProRata + * + * @param string|null $annValProRata annValProRata + * + * @return $this + */ + public function setAnnValProRata(?string $annValProRata): static + { + if (is_null($annValProRata)) { + array_push($this->openAPINullablesSetToNull, 'annValProRata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annValProRata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annValProRata'] = $annValProRata; + + return $this; + } + + /** + * Gets grossOrAmtForgone + * + * @return string|null + */ + public function getGrossOrAmtForgone(): ?string + { + return $this->container['grossOrAmtForgone']; + } + + /** + * Sets grossOrAmtForgone + * + * @param string|null $grossOrAmtForgone grossOrAmtForgone + * + * @return $this + */ + public function setGrossOrAmtForgone(?string $grossOrAmtForgone): static + { + if (is_null($grossOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'grossOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossOrAmtForgone'] = $grossOrAmtForgone; + + return $this; + } + + /** + * Gets costOrAmtForgone + * + * @return string|null + */ + public function getCostOrAmtForgone(): ?string + { + return $this->container['costOrAmtForgone']; + } + + /** + * Sets costOrAmtForgone + * + * @param string|null $costOrAmtForgone costOrAmtForgone + * + * @return $this + */ + public function setCostOrAmtForgone(?string $costOrAmtForgone): static + { + if (is_null($costOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'costOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOrAmtForgone'] = $costOrAmtForgone; + + return $this; + } + + /** + * Gets madeGood + * + * @return string|null + */ + public function getMadeGood(): ?string + { + return $this->container['madeGood']; + } + + /** + * Sets madeGood + * + * @param string|null $madeGood madeGood + * + * @return $this + */ + public function setMadeGood(?string $madeGood): static + { + if (is_null($madeGood)) { + array_push($this->openAPINullablesSetToNull, 'madeGood'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('madeGood', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['madeGood'] = $madeGood; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11Detailed.php b/src/Model/P11Detailed.php new file mode 100644 index 0000000..03177fb --- /dev/null +++ b/src/Model/P11Detailed.php @@ -0,0 +1,1255 @@ + + */ +class P11Detailed implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11Detailed'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employerName' => 'string', + 'payrollCode' => 'string', + 'employerOfficeNo' => 'string', + 'employerPayeRef' => 'string', + 'firstname' => 'string', + 'middlename' => 'string', + 'surname' => 'string', + 'niNumber' => 'string', + 'taxCode' => 'string', + 'dateOfBirth' => '\DateTime', + 'joinDate' => '\DateTime', + 'leaveDate' => '\DateTime', + 'isDirector' => 'bool', + 'niAndStatPaymentsLines' => '\SynergiTech\Staffology\Model\P11NiAndStatPaymentsLine[]', + 'totalsLine' => '\SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine', + 'niSummary' => '\SynergiTech\Staffology\Model\P11DetailedNiValues[]', + 'payeLines' => '\SynergiTech\Staffology\Model\P11PayeLine[]', + 'payeTotalsLine' => '\SynergiTech\Staffology\Model\P11PayeTotalsLine', + 'payeSummary' => '\SynergiTech\Staffology\Model\P11PayeSummary', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employerName' => null, + 'payrollCode' => null, + 'employerOfficeNo' => null, + 'employerPayeRef' => null, + 'firstname' => null, + 'middlename' => null, + 'surname' => null, + 'niNumber' => null, + 'taxCode' => null, + 'dateOfBirth' => 'date', + 'joinDate' => 'date', + 'leaveDate' => 'date', + 'isDirector' => null, + 'niAndStatPaymentsLines' => null, + 'totalsLine' => null, + 'niSummary' => null, + 'payeLines' => null, + 'payeTotalsLine' => null, + 'payeSummary' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employerName' => true, + 'payrollCode' => true, + 'employerOfficeNo' => true, + 'employerPayeRef' => true, + 'firstname' => true, + 'middlename' => true, + 'surname' => true, + 'niNumber' => true, + 'taxCode' => true, + 'dateOfBirth' => false, + 'joinDate' => false, + 'leaveDate' => true, + 'isDirector' => false, + 'niAndStatPaymentsLines' => true, + 'totalsLine' => false, + 'niSummary' => true, + 'payeLines' => true, + 'payeTotalsLine' => false, + 'payeSummary' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employerName' => 'employerName', + 'payrollCode' => 'payrollCode', + 'employerOfficeNo' => 'employerOfficeNo', + 'employerPayeRef' => 'employerPayeRef', + 'firstname' => 'firstname', + 'middlename' => 'middlename', + 'surname' => 'surname', + 'niNumber' => 'niNumber', + 'taxCode' => 'taxCode', + 'dateOfBirth' => 'dateOfBirth', + 'joinDate' => 'joinDate', + 'leaveDate' => 'leaveDate', + 'isDirector' => 'isDirector', + 'niAndStatPaymentsLines' => 'niAndStatPaymentsLines', + 'totalsLine' => 'totalsLine', + 'niSummary' => 'niSummary', + 'payeLines' => 'payeLines', + 'payeTotalsLine' => 'payeTotalsLine', + 'payeSummary' => 'payeSummary', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employerName' => 'setEmployerName', + 'payrollCode' => 'setPayrollCode', + 'employerOfficeNo' => 'setEmployerOfficeNo', + 'employerPayeRef' => 'setEmployerPayeRef', + 'firstname' => 'setFirstname', + 'middlename' => 'setMiddlename', + 'surname' => 'setSurname', + 'niNumber' => 'setNiNumber', + 'taxCode' => 'setTaxCode', + 'dateOfBirth' => 'setDateOfBirth', + 'joinDate' => 'setJoinDate', + 'leaveDate' => 'setLeaveDate', + 'isDirector' => 'setIsDirector', + 'niAndStatPaymentsLines' => 'setNiAndStatPaymentsLines', + 'totalsLine' => 'setTotalsLine', + 'niSummary' => 'setNiSummary', + 'payeLines' => 'setPayeLines', + 'payeTotalsLine' => 'setPayeTotalsLine', + 'payeSummary' => 'setPayeSummary', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employerName' => 'getEmployerName', + 'payrollCode' => 'getPayrollCode', + 'employerOfficeNo' => 'getEmployerOfficeNo', + 'employerPayeRef' => 'getEmployerPayeRef', + 'firstname' => 'getFirstname', + 'middlename' => 'getMiddlename', + 'surname' => 'getSurname', + 'niNumber' => 'getNiNumber', + 'taxCode' => 'getTaxCode', + 'dateOfBirth' => 'getDateOfBirth', + 'joinDate' => 'getJoinDate', + 'leaveDate' => 'getLeaveDate', + 'isDirector' => 'getIsDirector', + 'niAndStatPaymentsLines' => 'getNiAndStatPaymentsLines', + 'totalsLine' => 'getTotalsLine', + 'niSummary' => 'getNiSummary', + 'payeLines' => 'getPayeLines', + 'payeTotalsLine' => 'getPayeTotalsLine', + 'payeSummary' => 'getPayeSummary', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employerName', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('employerOfficeNo', $data ?? [], null); + $this->setIfExists('employerPayeRef', $data ?? [], null); + $this->setIfExists('firstname', $data ?? [], null); + $this->setIfExists('middlename', $data ?? [], null); + $this->setIfExists('surname', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('joinDate', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('isDirector', $data ?? [], null); + $this->setIfExists('niAndStatPaymentsLines', $data ?? [], null); + $this->setIfExists('totalsLine', $data ?? [], null); + $this->setIfExists('niSummary', $data ?? [], null); + $this->setIfExists('payeLines', $data ?? [], null); + $this->setIfExists('payeTotalsLine', $data ?? [], null); + $this->setIfExists('payeSummary', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employerName + * + * @return string|null + */ + public function getEmployerName(): ?string + { + return $this->container['employerName']; + } + + /** + * Sets employerName + * + * @param string|null $employerName [readonly] + * + * @return $this + */ + public function setEmployerName(?string $employerName): static + { + if (is_null($employerName)) { + array_push($this->openAPINullablesSetToNull, 'employerName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerName'] = $employerName; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode [readonly] + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets employerOfficeNo + * + * @return string|null + */ + public function getEmployerOfficeNo(): ?string + { + return $this->container['employerOfficeNo']; + } + + /** + * Sets employerOfficeNo + * + * @param string|null $employerOfficeNo [readonly] + * + * @return $this + */ + public function setEmployerOfficeNo(?string $employerOfficeNo): static + { + if (is_null($employerOfficeNo)) { + array_push($this->openAPINullablesSetToNull, 'employerOfficeNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerOfficeNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerOfficeNo'] = $employerOfficeNo; + + return $this; + } + + /** + * Gets employerPayeRef + * + * @return string|null + */ + public function getEmployerPayeRef(): ?string + { + return $this->container['employerPayeRef']; + } + + /** + * Sets employerPayeRef + * + * @param string|null $employerPayeRef [readonly] + * + * @return $this + */ + public function setEmployerPayeRef(?string $employerPayeRef): static + { + if (is_null($employerPayeRef)) { + array_push($this->openAPINullablesSetToNull, 'employerPayeRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPayeRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPayeRef'] = $employerPayeRef; + + return $this; + } + + /** + * Gets firstname + * + * @return string|null + */ + public function getFirstname(): ?string + { + return $this->container['firstname']; + } + + /** + * Sets firstname + * + * @param string|null $firstname [readonly] + * + * @return $this + */ + public function setFirstname(?string $firstname): static + { + if (is_null($firstname)) { + array_push($this->openAPINullablesSetToNull, 'firstname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstname'] = $firstname; + + return $this; + } + + /** + * Gets middlename + * + * @return string|null + */ + public function getMiddlename(): ?string + { + return $this->container['middlename']; + } + + /** + * Sets middlename + * + * @param string|null $middlename [readonly] + * + * @return $this + */ + public function setMiddlename(?string $middlename): static + { + if (is_null($middlename)) { + array_push($this->openAPINullablesSetToNull, 'middlename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('middlename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['middlename'] = $middlename; + + return $this; + } + + /** + * Gets surname + * + * @return string|null + */ + public function getSurname(): ?string + { + return $this->container['surname']; + } + + /** + * Sets surname + * + * @param string|null $surname [readonly] + * + * @return $this + */ + public function setSurname(?string $surname): static + { + if (is_null($surname)) { + array_push($this->openAPINullablesSetToNull, 'surname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('surname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['surname'] = $surname; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber [readonly] + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode [readonly] + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime|null + */ + public function getDateOfBirth(): ?\DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime|null $dateOfBirth [readonly] + * + * @return $this + */ + public function setDateOfBirth(?\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets joinDate + * + * @return \DateTime|null + */ + public function getJoinDate(): ?\DateTime + { + return $this->container['joinDate']; + } + + /** + * Sets joinDate + * + * @param \DateTime|null $joinDate [readonly] + * + * @return $this + */ + public function setJoinDate(?\DateTime $joinDate): static + { + if (is_null($joinDate)) { + throw new InvalidArgumentException('non-nullable joinDate cannot be null'); + } + $this->container['joinDate'] = $joinDate; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate [readonly] + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets isDirector + * + * @return bool|null + */ + public function getIsDirector(): ?bool + { + return $this->container['isDirector']; + } + + /** + * Sets isDirector + * + * @param bool|null $isDirector [readonly] + * + * @return $this + */ + public function setIsDirector(?bool $isDirector): static + { + if (is_null($isDirector)) { + throw new InvalidArgumentException('non-nullable isDirector cannot be null'); + } + $this->container['isDirector'] = $isDirector; + + return $this; + } + + /** + * Gets niAndStatPaymentsLines + * + * @return \SynergiTech\Staffology\Model\P11NiAndStatPaymentsLine[]|null + */ + public function getNiAndStatPaymentsLines(): ?array + { + return $this->container['niAndStatPaymentsLines']; + } + + /** + * Sets niAndStatPaymentsLines + * + * @param \SynergiTech\Staffology\Model\P11NiAndStatPaymentsLine[]|null $niAndStatPaymentsLines [readonly] + * + * @return $this + */ + public function setNiAndStatPaymentsLines(?array $niAndStatPaymentsLines): static + { + if (is_null($niAndStatPaymentsLines)) { + array_push($this->openAPINullablesSetToNull, 'niAndStatPaymentsLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niAndStatPaymentsLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niAndStatPaymentsLines'] = $niAndStatPaymentsLines; + + return $this; + } + + /** + * Gets totalsLine + * + * @return \SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine|null + */ + public function getTotalsLine(): ?\SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine + { + return $this->container['totalsLine']; + } + + /** + * Sets totalsLine + * + * @param \SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine|null $totalsLine totalsLine + * + * @return $this + */ + public function setTotalsLine(?\SynergiTech\Staffology\Model\P11NiAndStatPaymentsTotalsLine $totalsLine): static + { + if (is_null($totalsLine)) { + throw new InvalidArgumentException('non-nullable totalsLine cannot be null'); + } + $this->container['totalsLine'] = $totalsLine; + + return $this; + } + + /** + * Gets niSummary + * + * @return \SynergiTech\Staffology\Model\P11DetailedNiValues[]|null + */ + public function getNiSummary(): ?array + { + return $this->container['niSummary']; + } + + /** + * Sets niSummary + * + * @param \SynergiTech\Staffology\Model\P11DetailedNiValues[]|null $niSummary [readonly] + * + * @return $this + */ + public function setNiSummary(?array $niSummary): static + { + if (is_null($niSummary)) { + array_push($this->openAPINullablesSetToNull, 'niSummary'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niSummary', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niSummary'] = $niSummary; + + return $this; + } + + /** + * Gets payeLines + * + * @return \SynergiTech\Staffology\Model\P11PayeLine[]|null + */ + public function getPayeLines(): ?array + { + return $this->container['payeLines']; + } + + /** + * Sets payeLines + * + * @param \SynergiTech\Staffology\Model\P11PayeLine[]|null $payeLines [readonly] + * + * @return $this + */ + public function setPayeLines(?array $payeLines): static + { + if (is_null($payeLines)) { + array_push($this->openAPINullablesSetToNull, 'payeLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payeLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payeLines'] = $payeLines; + + return $this; + } + + /** + * Gets payeTotalsLine + * + * @return \SynergiTech\Staffology\Model\P11PayeTotalsLine|null + */ + public function getPayeTotalsLine(): ?\SynergiTech\Staffology\Model\P11PayeTotalsLine + { + return $this->container['payeTotalsLine']; + } + + /** + * Sets payeTotalsLine + * + * @param \SynergiTech\Staffology\Model\P11PayeTotalsLine|null $payeTotalsLine payeTotalsLine + * + * @return $this + */ + public function setPayeTotalsLine(?\SynergiTech\Staffology\Model\P11PayeTotalsLine $payeTotalsLine): static + { + if (is_null($payeTotalsLine)) { + throw new InvalidArgumentException('non-nullable payeTotalsLine cannot be null'); + } + $this->container['payeTotalsLine'] = $payeTotalsLine; + + return $this; + } + + /** + * Gets payeSummary + * + * @return \SynergiTech\Staffology\Model\P11PayeSummary|null + */ + public function getPayeSummary(): ?\SynergiTech\Staffology\Model\P11PayeSummary + { + return $this->container['payeSummary']; + } + + /** + * Sets payeSummary + * + * @param \SynergiTech\Staffology\Model\P11PayeSummary|null $payeSummary payeSummary + * + * @return $this + */ + public function setPayeSummary(?\SynergiTech\Staffology\Model\P11PayeSummary $payeSummary): static + { + if (is_null($payeSummary)) { + throw new InvalidArgumentException('non-nullable payeSummary cannot be null'); + } + $this->container['payeSummary'] = $payeSummary; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DetailedNiValues.php b/src/Model/P11DetailedNiValues.php new file mode 100644 index 0000000..ce4d0f8 --- /dev/null +++ b/src/Model/P11DetailedNiValues.php @@ -0,0 +1,688 @@ + + */ +class P11DetailedNiValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DetailedNiValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'table' => 'string', + 'earningsAtLel' => 'float', + 'earningsAboveLelToPt' => 'float', + 'earningsAbovePtToUap' => 'float', + 'earningsAboveUapToUel' => 'float', + 'earningsAbovePtToUel' => 'float', + 'employeeNics' => 'float', + 'employerNics' => 'float', + 'employeeAndEmployerNics' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'table' => null, + 'earningsAtLel' => 'double', + 'earningsAboveLelToPt' => 'double', + 'earningsAbovePtToUap' => 'double', + 'earningsAboveUapToUel' => 'double', + 'earningsAbovePtToUel' => 'double', + 'employeeNics' => 'double', + 'employerNics' => 'double', + 'employeeAndEmployerNics' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'table' => true, + 'earningsAtLel' => false, + 'earningsAboveLelToPt' => false, + 'earningsAbovePtToUap' => false, + 'earningsAboveUapToUel' => false, + 'earningsAbovePtToUel' => false, + 'employeeNics' => false, + 'employerNics' => false, + 'employeeAndEmployerNics' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'table' => 'table', + 'earningsAtLel' => 'earningsAtLel', + 'earningsAboveLelToPt' => 'earningsAboveLelToPt', + 'earningsAbovePtToUap' => 'earningsAbovePtToUap', + 'earningsAboveUapToUel' => 'earningsAboveUapToUel', + 'earningsAbovePtToUel' => 'earningsAbovePtToUel', + 'employeeNics' => 'employeeNics', + 'employerNics' => 'employerNics', + 'employeeAndEmployerNics' => 'employeeAndEmployerNics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'table' => 'setTable', + 'earningsAtLel' => 'setEarningsAtLel', + 'earningsAboveLelToPt' => 'setEarningsAboveLelToPt', + 'earningsAbovePtToUap' => 'setEarningsAbovePtToUap', + 'earningsAboveUapToUel' => 'setEarningsAboveUapToUel', + 'earningsAbovePtToUel' => 'setEarningsAbovePtToUel', + 'employeeNics' => 'setEmployeeNics', + 'employerNics' => 'setEmployerNics', + 'employeeAndEmployerNics' => 'setEmployeeAndEmployerNics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'table' => 'getTable', + 'earningsAtLel' => 'getEarningsAtLel', + 'earningsAboveLelToPt' => 'getEarningsAboveLelToPt', + 'earningsAbovePtToUap' => 'getEarningsAbovePtToUap', + 'earningsAboveUapToUel' => 'getEarningsAboveUapToUel', + 'earningsAbovePtToUel' => 'getEarningsAbovePtToUel', + 'employeeNics' => 'getEmployeeNics', + 'employerNics' => 'getEmployerNics', + 'employeeAndEmployerNics' => 'getEmployeeAndEmployerNics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('table', $data ?? [], null); + $this->setIfExists('earningsAtLel', $data ?? [], null); + $this->setIfExists('earningsAboveLelToPt', $data ?? [], null); + $this->setIfExists('earningsAbovePtToUap', $data ?? [], null); + $this->setIfExists('earningsAboveUapToUel', $data ?? [], null); + $this->setIfExists('earningsAbovePtToUel', $data ?? [], null); + $this->setIfExists('employeeNics', $data ?? [], null); + $this->setIfExists('employerNics', $data ?? [], null); + $this->setIfExists('employeeAndEmployerNics', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets table + * + * @return string|null + */ + public function getTable(): ?string + { + return $this->container['table']; + } + + /** + * Sets table + * + * @param string|null $table [readonly] + * + * @return $this + */ + public function setTable(?string $table): static + { + if (is_null($table)) { + array_push($this->openAPINullablesSetToNull, 'table'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('table', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['table'] = $table; + + return $this; + } + + /** + * Gets earningsAtLel + * + * @return float|null + */ + public function getEarningsAtLel(): ?float + { + return $this->container['earningsAtLel']; + } + + /** + * Sets earningsAtLel + * + * @param float|null $earningsAtLel [readonly] + * + * @return $this + */ + public function setEarningsAtLel(?float $earningsAtLel): static + { + if (is_null($earningsAtLel)) { + throw new InvalidArgumentException('non-nullable earningsAtLel cannot be null'); + } + $this->container['earningsAtLel'] = $earningsAtLel; + + return $this; + } + + /** + * Gets earningsAboveLelToPt + * + * @return float|null + */ + public function getEarningsAboveLelToPt(): ?float + { + return $this->container['earningsAboveLelToPt']; + } + + /** + * Sets earningsAboveLelToPt + * + * @param float|null $earningsAboveLelToPt [readonly] + * + * @return $this + */ + public function setEarningsAboveLelToPt(?float $earningsAboveLelToPt): static + { + if (is_null($earningsAboveLelToPt)) { + throw new InvalidArgumentException('non-nullable earningsAboveLelToPt cannot be null'); + } + $this->container['earningsAboveLelToPt'] = $earningsAboveLelToPt; + + return $this; + } + + /** + * Gets earningsAbovePtToUap + * + * @return float|null + */ + public function getEarningsAbovePtToUap(): ?float + { + return $this->container['earningsAbovePtToUap']; + } + + /** + * Sets earningsAbovePtToUap + * + * @param float|null $earningsAbovePtToUap [readonly] + * + * @return $this + */ + public function setEarningsAbovePtToUap(?float $earningsAbovePtToUap): static + { + if (is_null($earningsAbovePtToUap)) { + throw new InvalidArgumentException('non-nullable earningsAbovePtToUap cannot be null'); + } + $this->container['earningsAbovePtToUap'] = $earningsAbovePtToUap; + + return $this; + } + + /** + * Gets earningsAboveUapToUel + * + * @return float|null + */ + public function getEarningsAboveUapToUel(): ?float + { + return $this->container['earningsAboveUapToUel']; + } + + /** + * Sets earningsAboveUapToUel + * + * @param float|null $earningsAboveUapToUel [readonly] + * + * @return $this + */ + public function setEarningsAboveUapToUel(?float $earningsAboveUapToUel): static + { + if (is_null($earningsAboveUapToUel)) { + throw new InvalidArgumentException('non-nullable earningsAboveUapToUel cannot be null'); + } + $this->container['earningsAboveUapToUel'] = $earningsAboveUapToUel; + + return $this; + } + + /** + * Gets earningsAbovePtToUel + * + * @return float|null + */ + public function getEarningsAbovePtToUel(): ?float + { + return $this->container['earningsAbovePtToUel']; + } + + /** + * Sets earningsAbovePtToUel + * + * @param float|null $earningsAbovePtToUel [readonly] + * + * @return $this + */ + public function setEarningsAbovePtToUel(?float $earningsAbovePtToUel): static + { + if (is_null($earningsAbovePtToUel)) { + throw new InvalidArgumentException('non-nullable earningsAbovePtToUel cannot be null'); + } + $this->container['earningsAbovePtToUel'] = $earningsAbovePtToUel; + + return $this; + } + + /** + * Gets employeeNics + * + * @return float|null + */ + public function getEmployeeNics(): ?float + { + return $this->container['employeeNics']; + } + + /** + * Sets employeeNics + * + * @param float|null $employeeNics [readonly] + * + * @return $this + */ + public function setEmployeeNics(?float $employeeNics): static + { + if (is_null($employeeNics)) { + throw new InvalidArgumentException('non-nullable employeeNics cannot be null'); + } + $this->container['employeeNics'] = $employeeNics; + + return $this; + } + + /** + * Gets employerNics + * + * @return float|null + */ + public function getEmployerNics(): ?float + { + return $this->container['employerNics']; + } + + /** + * Sets employerNics + * + * @param float|null $employerNics [readonly] + * + * @return $this + */ + public function setEmployerNics(?float $employerNics): static + { + if (is_null($employerNics)) { + throw new InvalidArgumentException('non-nullable employerNics cannot be null'); + } + $this->container['employerNics'] = $employerNics; + + return $this; + } + + /** + * Gets employeeAndEmployerNics + * + * @return float|null + */ + public function getEmployeeAndEmployerNics(): ?float + { + return $this->container['employeeAndEmployerNics']; + } + + /** + * Sets employeeAndEmployerNics + * + * @param float|null $employeeAndEmployerNics [readonly] + * + * @return $this + */ + public function setEmployeeAndEmployerNics(?float $employeeAndEmployerNics): static + { + if (is_null($employeeAndEmployerNics)) { + throw new InvalidArgumentException('non-nullable employeeAndEmployerNics cannot be null'); + } + $this->container['employeeAndEmployerNics'] = $employeeAndEmployerNics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11DetailedReportResponse.php b/src/Model/P11DetailedReportResponse.php new file mode 100644 index 0000000..82ea113 --- /dev/null +++ b/src/Model/P11DetailedReportResponse.php @@ -0,0 +1,532 @@ + + */ +class P11DetailedReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11DetailedReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\P11Detailed', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\P11Detailed|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\P11Detailed + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\P11Detailed|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\P11Detailed $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11Line.php b/src/Model/P11Line.php new file mode 100644 index 0000000..8c7ff63 --- /dev/null +++ b/src/Model/P11Line.php @@ -0,0 +1,865 @@ + + */ +class P11Line implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11Line'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'date' => '\DateTime', + 'period' => 'string', + 'grossTaxablePay' => 'float', + 'grossTaxablePayYTD' => 'float', + 'tax' => 'float', + 'taxYTD' => 'float', + 'smpYTD' => 'float', + 'sppYTD' => 'float', + 'sapYTD' => 'float', + 'shppYTD' => 'float', + 'spbpYTD' => 'float', + 'studentLoanYTD' => 'float', + 'postgradLoanYTD' => 'float', + 'niValues' => '\SynergiTech\Staffology\Model\P11NiValues[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'date' => 'date', + 'period' => null, + 'grossTaxablePay' => 'double', + 'grossTaxablePayYTD' => 'double', + 'tax' => 'double', + 'taxYTD' => 'double', + 'smpYTD' => 'double', + 'sppYTD' => 'double', + 'sapYTD' => 'double', + 'shppYTD' => 'double', + 'spbpYTD' => 'double', + 'studentLoanYTD' => 'double', + 'postgradLoanYTD' => 'double', + 'niValues' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'date' => false, + 'period' => true, + 'grossTaxablePay' => false, + 'grossTaxablePayYTD' => false, + 'tax' => false, + 'taxYTD' => false, + 'smpYTD' => false, + 'sppYTD' => false, + 'sapYTD' => false, + 'shppYTD' => false, + 'spbpYTD' => false, + 'studentLoanYTD' => false, + 'postgradLoanYTD' => false, + 'niValues' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'date' => 'date', + 'period' => 'period', + 'grossTaxablePay' => 'grossTaxablePay', + 'grossTaxablePayYTD' => 'grossTaxablePayYTD', + 'tax' => 'tax', + 'taxYTD' => 'taxYTD', + 'smpYTD' => 'smpYTD', + 'sppYTD' => 'sppYTD', + 'sapYTD' => 'sapYTD', + 'shppYTD' => 'shppYTD', + 'spbpYTD' => 'spbpYTD', + 'studentLoanYTD' => 'studentLoanYTD', + 'postgradLoanYTD' => 'postgradLoanYTD', + 'niValues' => 'niValues' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'date' => 'setDate', + 'period' => 'setPeriod', + 'grossTaxablePay' => 'setGrossTaxablePay', + 'grossTaxablePayYTD' => 'setGrossTaxablePayYTD', + 'tax' => 'setTax', + 'taxYTD' => 'setTaxYTD', + 'smpYTD' => 'setSmpYTD', + 'sppYTD' => 'setSppYTD', + 'sapYTD' => 'setSapYTD', + 'shppYTD' => 'setShppYTD', + 'spbpYTD' => 'setSpbpYTD', + 'studentLoanYTD' => 'setStudentLoanYTD', + 'postgradLoanYTD' => 'setPostgradLoanYTD', + 'niValues' => 'setNiValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'date' => 'getDate', + 'period' => 'getPeriod', + 'grossTaxablePay' => 'getGrossTaxablePay', + 'grossTaxablePayYTD' => 'getGrossTaxablePayYTD', + 'tax' => 'getTax', + 'taxYTD' => 'getTaxYTD', + 'smpYTD' => 'getSmpYTD', + 'sppYTD' => 'getSppYTD', + 'sapYTD' => 'getSapYTD', + 'shppYTD' => 'getShppYTD', + 'spbpYTD' => 'getSpbpYTD', + 'studentLoanYTD' => 'getStudentLoanYTD', + 'postgradLoanYTD' => 'getPostgradLoanYTD', + 'niValues' => 'getNiValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('grossTaxablePay', $data ?? [], null); + $this->setIfExists('grossTaxablePayYTD', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('taxYTD', $data ?? [], null); + $this->setIfExists('smpYTD', $data ?? [], null); + $this->setIfExists('sppYTD', $data ?? [], null); + $this->setIfExists('sapYTD', $data ?? [], null); + $this->setIfExists('shppYTD', $data ?? [], null); + $this->setIfExists('spbpYTD', $data ?? [], null); + $this->setIfExists('studentLoanYTD', $data ?? [], null); + $this->setIfExists('postgradLoanYTD', $data ?? [], null); + $this->setIfExists('niValues', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod(): ?string + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period [readonly] + * + * @return $this + */ + public function setPeriod(?string $period): static + { + if (is_null($period)) { + array_push($this->openAPINullablesSetToNull, 'period'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('period', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets grossTaxablePay + * + * @return float|null + */ + public function getGrossTaxablePay(): ?float + { + return $this->container['grossTaxablePay']; + } + + /** + * Sets grossTaxablePay + * + * @param float|null $grossTaxablePay [readonly] + * + * @return $this + */ + public function setGrossTaxablePay(?float $grossTaxablePay): static + { + if (is_null($grossTaxablePay)) { + throw new InvalidArgumentException('non-nullable grossTaxablePay cannot be null'); + } + $this->container['grossTaxablePay'] = $grossTaxablePay; + + return $this; + } + + /** + * Gets grossTaxablePayYTD + * + * @return float|null + */ + public function getGrossTaxablePayYTD(): ?float + { + return $this->container['grossTaxablePayYTD']; + } + + /** + * Sets grossTaxablePayYTD + * + * @param float|null $grossTaxablePayYTD [readonly] + * + * @return $this + */ + public function setGrossTaxablePayYTD(?float $grossTaxablePayYTD): static + { + if (is_null($grossTaxablePayYTD)) { + throw new InvalidArgumentException('non-nullable grossTaxablePayYTD cannot be null'); + } + $this->container['grossTaxablePayYTD'] = $grossTaxablePayYTD; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax [readonly] + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets taxYTD + * + * @return float|null + */ + public function getTaxYTD(): ?float + { + return $this->container['taxYTD']; + } + + /** + * Sets taxYTD + * + * @param float|null $taxYTD [readonly] + * + * @return $this + */ + public function setTaxYTD(?float $taxYTD): static + { + if (is_null($taxYTD)) { + throw new InvalidArgumentException('non-nullable taxYTD cannot be null'); + } + $this->container['taxYTD'] = $taxYTD; + + return $this; + } + + /** + * Gets smpYTD + * + * @return float|null + */ + public function getSmpYTD(): ?float + { + return $this->container['smpYTD']; + } + + /** + * Sets smpYTD + * + * @param float|null $smpYTD [readonly] + * + * @return $this + */ + public function setSmpYTD(?float $smpYTD): static + { + if (is_null($smpYTD)) { + throw new InvalidArgumentException('non-nullable smpYTD cannot be null'); + } + $this->container['smpYTD'] = $smpYTD; + + return $this; + } + + /** + * Gets sppYTD + * + * @return float|null + */ + public function getSppYTD(): ?float + { + return $this->container['sppYTD']; + } + + /** + * Sets sppYTD + * + * @param float|null $sppYTD [readonly] + * + * @return $this + */ + public function setSppYTD(?float $sppYTD): static + { + if (is_null($sppYTD)) { + throw new InvalidArgumentException('non-nullable sppYTD cannot be null'); + } + $this->container['sppYTD'] = $sppYTD; + + return $this; + } + + /** + * Gets sapYTD + * + * @return float|null + */ + public function getSapYTD(): ?float + { + return $this->container['sapYTD']; + } + + /** + * Sets sapYTD + * + * @param float|null $sapYTD [readonly] + * + * @return $this + */ + public function setSapYTD(?float $sapYTD): static + { + if (is_null($sapYTD)) { + throw new InvalidArgumentException('non-nullable sapYTD cannot be null'); + } + $this->container['sapYTD'] = $sapYTD; + + return $this; + } + + /** + * Gets shppYTD + * + * @return float|null + */ + public function getShppYTD(): ?float + { + return $this->container['shppYTD']; + } + + /** + * Sets shppYTD + * + * @param float|null $shppYTD [readonly] + * + * @return $this + */ + public function setShppYTD(?float $shppYTD): static + { + if (is_null($shppYTD)) { + throw new InvalidArgumentException('non-nullable shppYTD cannot be null'); + } + $this->container['shppYTD'] = $shppYTD; + + return $this; + } + + /** + * Gets spbpYTD + * + * @return float|null + */ + public function getSpbpYTD(): ?float + { + return $this->container['spbpYTD']; + } + + /** + * Sets spbpYTD + * + * @param float|null $spbpYTD [readonly] + * + * @return $this + */ + public function setSpbpYTD(?float $spbpYTD): static + { + if (is_null($spbpYTD)) { + throw new InvalidArgumentException('non-nullable spbpYTD cannot be null'); + } + $this->container['spbpYTD'] = $spbpYTD; + + return $this; + } + + /** + * Gets studentLoanYTD + * + * @return float|null + */ + public function getStudentLoanYTD(): ?float + { + return $this->container['studentLoanYTD']; + } + + /** + * Sets studentLoanYTD + * + * @param float|null $studentLoanYTD [readonly] + * + * @return $this + */ + public function setStudentLoanYTD(?float $studentLoanYTD): static + { + if (is_null($studentLoanYTD)) { + throw new InvalidArgumentException('non-nullable studentLoanYTD cannot be null'); + } + $this->container['studentLoanYTD'] = $studentLoanYTD; + + return $this; + } + + /** + * Gets postgradLoanYTD + * + * @return float|null + */ + public function getPostgradLoanYTD(): ?float + { + return $this->container['postgradLoanYTD']; + } + + /** + * Sets postgradLoanYTD + * + * @param float|null $postgradLoanYTD [readonly] + * + * @return $this + */ + public function setPostgradLoanYTD(?float $postgradLoanYTD): static + { + if (is_null($postgradLoanYTD)) { + throw new InvalidArgumentException('non-nullable postgradLoanYTD cannot be null'); + } + $this->container['postgradLoanYTD'] = $postgradLoanYTD; + + return $this; + } + + /** + * Gets niValues + * + * @return \SynergiTech\Staffology\Model\P11NiValues[]|null + */ + public function getNiValues(): ?array + { + return $this->container['niValues']; + } + + /** + * Sets niValues + * + * @param \SynergiTech\Staffology\Model\P11NiValues[]|null $niValues [readonly] + * + * @return $this + */ + public function setNiValues(?array $niValues): static + { + if (is_null($niValues)) { + array_push($this->openAPINullablesSetToNull, 'niValues'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niValues', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niValues'] = $niValues; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11NiAndStatPaymentsLine.php b/src/Model/P11NiAndStatPaymentsLine.php new file mode 100644 index 0000000..30dc80e --- /dev/null +++ b/src/Model/P11NiAndStatPaymentsLine.php @@ -0,0 +1,845 @@ + + */ +class P11NiAndStatPaymentsLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11NiAndStatPaymentsLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'date' => '\DateTime', + 'period' => 'string', + 'monthNumber' => 'string', + 'weekNumber' => 'string', + 'smp' => 'float', + 'spp' => 'float', + 'sap' => 'float', + 'shpp' => 'float', + 'ssp' => 'float', + 'spbp' => 'float', + 'class1a' => 'float', + 'niValues' => '\SynergiTech\Staffology\Model\P11DetailedNiValues', + 'taxCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'date' => 'date', + 'period' => null, + 'monthNumber' => null, + 'weekNumber' => null, + 'smp' => 'double', + 'spp' => 'double', + 'sap' => 'double', + 'shpp' => 'double', + 'ssp' => 'double', + 'spbp' => 'double', + 'class1a' => 'double', + 'niValues' => null, + 'taxCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'date' => false, + 'period' => true, + 'monthNumber' => true, + 'weekNumber' => true, + 'smp' => false, + 'spp' => false, + 'sap' => false, + 'shpp' => false, + 'ssp' => false, + 'spbp' => false, + 'class1a' => false, + 'niValues' => false, + 'taxCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'date' => 'date', + 'period' => 'period', + 'monthNumber' => 'monthNumber', + 'weekNumber' => 'weekNumber', + 'smp' => 'smp', + 'spp' => 'spp', + 'sap' => 'sap', + 'shpp' => 'shpp', + 'ssp' => 'ssp', + 'spbp' => 'spbp', + 'class1a' => 'class1a', + 'niValues' => 'niValues', + 'taxCode' => 'taxCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'date' => 'setDate', + 'period' => 'setPeriod', + 'monthNumber' => 'setMonthNumber', + 'weekNumber' => 'setWeekNumber', + 'smp' => 'setSmp', + 'spp' => 'setSpp', + 'sap' => 'setSap', + 'shpp' => 'setShpp', + 'ssp' => 'setSsp', + 'spbp' => 'setSpbp', + 'class1a' => 'setClass1a', + 'niValues' => 'setNiValues', + 'taxCode' => 'setTaxCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'date' => 'getDate', + 'period' => 'getPeriod', + 'monthNumber' => 'getMonthNumber', + 'weekNumber' => 'getWeekNumber', + 'smp' => 'getSmp', + 'spp' => 'getSpp', + 'sap' => 'getSap', + 'shpp' => 'getShpp', + 'ssp' => 'getSsp', + 'spbp' => 'getSpbp', + 'class1a' => 'getClass1a', + 'niValues' => 'getNiValues', + 'taxCode' => 'getTaxCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('monthNumber', $data ?? [], null); + $this->setIfExists('weekNumber', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('ssp', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('class1a', $data ?? [], null); + $this->setIfExists('niValues', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod(): ?string + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period [readonly] + * + * @return $this + */ + public function setPeriod(?string $period): static + { + if (is_null($period)) { + array_push($this->openAPINullablesSetToNull, 'period'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('period', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets monthNumber + * + * @return string|null + */ + public function getMonthNumber(): ?string + { + return $this->container['monthNumber']; + } + + /** + * Sets monthNumber + * + * @param string|null $monthNumber [readonly] + * + * @return $this + */ + public function setMonthNumber(?string $monthNumber): static + { + if (is_null($monthNumber)) { + array_push($this->openAPINullablesSetToNull, 'monthNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthNumber'] = $monthNumber; + + return $this; + } + + /** + * Gets weekNumber + * + * @return string|null + */ + public function getWeekNumber(): ?string + { + return $this->container['weekNumber']; + } + + /** + * Sets weekNumber + * + * @param string|null $weekNumber [readonly] + * + * @return $this + */ + public function setWeekNumber(?string $weekNumber): static + { + if (is_null($weekNumber)) { + array_push($this->openAPINullablesSetToNull, 'weekNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekNumber'] = $weekNumber; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp [readonly] + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp [readonly] + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap [readonly] + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp [readonly] + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets ssp + * + * @return float|null + */ + public function getSsp(): ?float + { + return $this->container['ssp']; + } + + /** + * Sets ssp + * + * @param float|null $ssp [readonly] + * + * @return $this + */ + public function setSsp(?float $ssp): static + { + if (is_null($ssp)) { + throw new InvalidArgumentException('non-nullable ssp cannot be null'); + } + $this->container['ssp'] = $ssp; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp [readonly] + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets class1a + * + * @return float|null + */ + public function getClass1a(): ?float + { + return $this->container['class1a']; + } + + /** + * Sets class1a + * + * @param float|null $class1a [readonly] + * + * @return $this + */ + public function setClass1a(?float $class1a): static + { + if (is_null($class1a)) { + throw new InvalidArgumentException('non-nullable class1a cannot be null'); + } + $this->container['class1a'] = $class1a; + + return $this; + } + + /** + * Gets niValues + * + * @return \SynergiTech\Staffology\Model\P11DetailedNiValues|null + */ + public function getNiValues(): ?\SynergiTech\Staffology\Model\P11DetailedNiValues + { + return $this->container['niValues']; + } + + /** + * Sets niValues + * + * @param \SynergiTech\Staffology\Model\P11DetailedNiValues|null $niValues niValues + * + * @return $this + */ + public function setNiValues(?\SynergiTech\Staffology\Model\P11DetailedNiValues $niValues): static + { + if (is_null($niValues)) { + throw new InvalidArgumentException('non-nullable niValues cannot be null'); + } + $this->container['niValues'] = $niValues; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode [readonly] + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11NiAndStatPaymentsTotalsLine.php b/src/Model/P11NiAndStatPaymentsTotalsLine.php new file mode 100644 index 0000000..d312b7d --- /dev/null +++ b/src/Model/P11NiAndStatPaymentsTotalsLine.php @@ -0,0 +1,783 @@ + + */ +class P11NiAndStatPaymentsTotalsLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11NiAndStatPaymentsTotalsLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'toLel' => 'float', + 'lelToPt' => 'float', + 'ptToUel' => 'float', + 'eesAndErs' => 'float', + 'ees' => 'float', + 'class1A' => 'float', + 'ssp' => 'float', + 'smp' => 'float', + 'spp' => 'float', + 'shpp' => 'float', + 'sap' => 'float', + 'spbp' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'toLel' => 'double', + 'lelToPt' => 'double', + 'ptToUel' => 'double', + 'eesAndErs' => 'double', + 'ees' => 'double', + 'class1A' => 'double', + 'ssp' => 'double', + 'smp' => 'double', + 'spp' => 'double', + 'shpp' => 'double', + 'sap' => 'double', + 'spbp' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'toLel' => false, + 'lelToPt' => false, + 'ptToUel' => false, + 'eesAndErs' => false, + 'ees' => false, + 'class1A' => false, + 'ssp' => false, + 'smp' => false, + 'spp' => false, + 'shpp' => false, + 'sap' => false, + 'spbp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'toLel' => 'toLel', + 'lelToPt' => 'lelToPt', + 'ptToUel' => 'ptToUel', + 'eesAndErs' => 'eesAndErs', + 'ees' => 'ees', + 'class1A' => 'class1A', + 'ssp' => 'ssp', + 'smp' => 'smp', + 'spp' => 'spp', + 'shpp' => 'shpp', + 'sap' => 'sap', + 'spbp' => 'spbp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'toLel' => 'setToLel', + 'lelToPt' => 'setLelToPt', + 'ptToUel' => 'setPtToUel', + 'eesAndErs' => 'setEesAndErs', + 'ees' => 'setEes', + 'class1A' => 'setClass1A', + 'ssp' => 'setSsp', + 'smp' => 'setSmp', + 'spp' => 'setSpp', + 'shpp' => 'setShpp', + 'sap' => 'setSap', + 'spbp' => 'setSpbp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'toLel' => 'getToLel', + 'lelToPt' => 'getLelToPt', + 'ptToUel' => 'getPtToUel', + 'eesAndErs' => 'getEesAndErs', + 'ees' => 'getEes', + 'class1A' => 'getClass1A', + 'ssp' => 'getSsp', + 'smp' => 'getSmp', + 'spp' => 'getSpp', + 'shpp' => 'getShpp', + 'sap' => 'getSap', + 'spbp' => 'getSpbp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('toLel', $data ?? [], null); + $this->setIfExists('lelToPt', $data ?? [], null); + $this->setIfExists('ptToUel', $data ?? [], null); + $this->setIfExists('eesAndErs', $data ?? [], null); + $this->setIfExists('ees', $data ?? [], null); + $this->setIfExists('class1A', $data ?? [], null); + $this->setIfExists('ssp', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets toLel + * + * @return float|null + */ + public function getToLel(): ?float + { + return $this->container['toLel']; + } + + /** + * Sets toLel + * + * @param float|null $toLel [readonly] + * + * @return $this + */ + public function setToLel(?float $toLel): static + { + if (is_null($toLel)) { + throw new InvalidArgumentException('non-nullable toLel cannot be null'); + } + $this->container['toLel'] = $toLel; + + return $this; + } + + /** + * Gets lelToPt + * + * @return float|null + */ + public function getLelToPt(): ?float + { + return $this->container['lelToPt']; + } + + /** + * Sets lelToPt + * + * @param float|null $lelToPt [readonly] + * + * @return $this + */ + public function setLelToPt(?float $lelToPt): static + { + if (is_null($lelToPt)) { + throw new InvalidArgumentException('non-nullable lelToPt cannot be null'); + } + $this->container['lelToPt'] = $lelToPt; + + return $this; + } + + /** + * Gets ptToUel + * + * @return float|null + */ + public function getPtToUel(): ?float + { + return $this->container['ptToUel']; + } + + /** + * Sets ptToUel + * + * @param float|null $ptToUel [readonly] + * + * @return $this + */ + public function setPtToUel(?float $ptToUel): static + { + if (is_null($ptToUel)) { + throw new InvalidArgumentException('non-nullable ptToUel cannot be null'); + } + $this->container['ptToUel'] = $ptToUel; + + return $this; + } + + /** + * Gets eesAndErs + * + * @return float|null + */ + public function getEesAndErs(): ?float + { + return $this->container['eesAndErs']; + } + + /** + * Sets eesAndErs + * + * @param float|null $eesAndErs [readonly] + * + * @return $this + */ + public function setEesAndErs(?float $eesAndErs): static + { + if (is_null($eesAndErs)) { + throw new InvalidArgumentException('non-nullable eesAndErs cannot be null'); + } + $this->container['eesAndErs'] = $eesAndErs; + + return $this; + } + + /** + * Gets ees + * + * @return float|null + */ + public function getEes(): ?float + { + return $this->container['ees']; + } + + /** + * Sets ees + * + * @param float|null $ees [readonly] + * + * @return $this + */ + public function setEes(?float $ees): static + { + if (is_null($ees)) { + throw new InvalidArgumentException('non-nullable ees cannot be null'); + } + $this->container['ees'] = $ees; + + return $this; + } + + /** + * Gets class1A + * + * @return float|null + */ + public function getClass1A(): ?float + { + return $this->container['class1A']; + } + + /** + * Sets class1A + * + * @param float|null $class1A [readonly] + * + * @return $this + */ + public function setClass1A(?float $class1A): static + { + if (is_null($class1A)) { + throw new InvalidArgumentException('non-nullable class1A cannot be null'); + } + $this->container['class1A'] = $class1A; + + return $this; + } + + /** + * Gets ssp + * + * @return float|null + */ + public function getSsp(): ?float + { + return $this->container['ssp']; + } + + /** + * Sets ssp + * + * @param float|null $ssp [readonly] + * + * @return $this + */ + public function setSsp(?float $ssp): static + { + if (is_null($ssp)) { + throw new InvalidArgumentException('non-nullable ssp cannot be null'); + } + $this->container['ssp'] = $ssp; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp [readonly] + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp [readonly] + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp [readonly] + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap [readonly] + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp [readonly] + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11NiValues.php b/src/Model/P11NiValues.php new file mode 100644 index 0000000..57af41b --- /dev/null +++ b/src/Model/P11NiValues.php @@ -0,0 +1,484 @@ + + */ +class P11NiValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11NiValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'table' => 'string', + 'period' => 'float', + 'ytd' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'table' => null, + 'period' => 'double', + 'ytd' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'table' => true, + 'period' => false, + 'ytd' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'table' => 'table', + 'period' => 'period', + 'ytd' => 'ytd' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'table' => 'setTable', + 'period' => 'setPeriod', + 'ytd' => 'setYtd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'table' => 'getTable', + 'period' => 'getPeriod', + 'ytd' => 'getYtd' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('table', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('ytd', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets table + * + * @return string|null + */ + public function getTable(): ?string + { + return $this->container['table']; + } + + /** + * Sets table + * + * @param string|null $table [readonly] + * + * @return $this + */ + public function setTable(?string $table): static + { + if (is_null($table)) { + array_push($this->openAPINullablesSetToNull, 'table'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('table', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['table'] = $table; + + return $this; + } + + /** + * Gets period + * + * @return float|null + */ + public function getPeriod(): ?float + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param float|null $period [readonly] + * + * @return $this + */ + public function setPeriod(?float $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets ytd + * + * @return float|null + */ + public function getYtd(): ?float + { + return $this->container['ytd']; + } + + /** + * Sets ytd + * + * @param float|null $ytd [readonly] + * + * @return $this + */ + public function setYtd(?float $ytd): static + { + if (is_null($ytd)) { + throw new InvalidArgumentException('non-nullable ytd cannot be null'); + } + $this->container['ytd'] = $ytd; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11PayeLine.php b/src/Model/P11PayeLine.php new file mode 100644 index 0000000..dfedb5a --- /dev/null +++ b/src/Model/P11PayeLine.php @@ -0,0 +1,777 @@ + + */ +class P11PayeLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11PayeLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'date' => '\DateTime', + 'period' => 'string', + 'monthNumber' => 'string', + 'weekNumber' => 'string', + 'grossTaxablePay' => 'float', + 'grossTaxablePayYTD' => 'float', + 'tax' => 'float', + 'taxYTD' => 'float', + 'studentLoan' => 'float', + 'postgradLoan' => 'float', + 'taxCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'date' => 'date', + 'period' => null, + 'monthNumber' => null, + 'weekNumber' => null, + 'grossTaxablePay' => 'double', + 'grossTaxablePayYTD' => 'double', + 'tax' => 'double', + 'taxYTD' => 'double', + 'studentLoan' => 'double', + 'postgradLoan' => 'double', + 'taxCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'date' => false, + 'period' => true, + 'monthNumber' => true, + 'weekNumber' => true, + 'grossTaxablePay' => false, + 'grossTaxablePayYTD' => false, + 'tax' => false, + 'taxYTD' => false, + 'studentLoan' => false, + 'postgradLoan' => false, + 'taxCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'date' => 'date', + 'period' => 'period', + 'monthNumber' => 'monthNumber', + 'weekNumber' => 'weekNumber', + 'grossTaxablePay' => 'grossTaxablePay', + 'grossTaxablePayYTD' => 'grossTaxablePayYTD', + 'tax' => 'tax', + 'taxYTD' => 'taxYTD', + 'studentLoan' => 'studentLoan', + 'postgradLoan' => 'postgradLoan', + 'taxCode' => 'taxCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'date' => 'setDate', + 'period' => 'setPeriod', + 'monthNumber' => 'setMonthNumber', + 'weekNumber' => 'setWeekNumber', + 'grossTaxablePay' => 'setGrossTaxablePay', + 'grossTaxablePayYTD' => 'setGrossTaxablePayYTD', + 'tax' => 'setTax', + 'taxYTD' => 'setTaxYTD', + 'studentLoan' => 'setStudentLoan', + 'postgradLoan' => 'setPostgradLoan', + 'taxCode' => 'setTaxCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'date' => 'getDate', + 'period' => 'getPeriod', + 'monthNumber' => 'getMonthNumber', + 'weekNumber' => 'getWeekNumber', + 'grossTaxablePay' => 'getGrossTaxablePay', + 'grossTaxablePayYTD' => 'getGrossTaxablePayYTD', + 'tax' => 'getTax', + 'taxYTD' => 'getTaxYTD', + 'studentLoan' => 'getStudentLoan', + 'postgradLoan' => 'getPostgradLoan', + 'taxCode' => 'getTaxCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('monthNumber', $data ?? [], null); + $this->setIfExists('weekNumber', $data ?? [], null); + $this->setIfExists('grossTaxablePay', $data ?? [], null); + $this->setIfExists('grossTaxablePayYTD', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('taxYTD', $data ?? [], null); + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('postgradLoan', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod(): ?string + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period [readonly] + * + * @return $this + */ + public function setPeriod(?string $period): static + { + if (is_null($period)) { + array_push($this->openAPINullablesSetToNull, 'period'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('period', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets monthNumber + * + * @return string|null + */ + public function getMonthNumber(): ?string + { + return $this->container['monthNumber']; + } + + /** + * Sets monthNumber + * + * @param string|null $monthNumber [readonly] + * + * @return $this + */ + public function setMonthNumber(?string $monthNumber): static + { + if (is_null($monthNumber)) { + array_push($this->openAPINullablesSetToNull, 'monthNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthNumber'] = $monthNumber; + + return $this; + } + + /** + * Gets weekNumber + * + * @return string|null + */ + public function getWeekNumber(): ?string + { + return $this->container['weekNumber']; + } + + /** + * Sets weekNumber + * + * @param string|null $weekNumber [readonly] + * + * @return $this + */ + public function setWeekNumber(?string $weekNumber): static + { + if (is_null($weekNumber)) { + array_push($this->openAPINullablesSetToNull, 'weekNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekNumber'] = $weekNumber; + + return $this; + } + + /** + * Gets grossTaxablePay + * + * @return float|null + */ + public function getGrossTaxablePay(): ?float + { + return $this->container['grossTaxablePay']; + } + + /** + * Sets grossTaxablePay + * + * @param float|null $grossTaxablePay [readonly] + * + * @return $this + */ + public function setGrossTaxablePay(?float $grossTaxablePay): static + { + if (is_null($grossTaxablePay)) { + throw new InvalidArgumentException('non-nullable grossTaxablePay cannot be null'); + } + $this->container['grossTaxablePay'] = $grossTaxablePay; + + return $this; + } + + /** + * Gets grossTaxablePayYTD + * + * @return float|null + */ + public function getGrossTaxablePayYTD(): ?float + { + return $this->container['grossTaxablePayYTD']; + } + + /** + * Sets grossTaxablePayYTD + * + * @param float|null $grossTaxablePayYTD [readonly] + * + * @return $this + */ + public function setGrossTaxablePayYTD(?float $grossTaxablePayYTD): static + { + if (is_null($grossTaxablePayYTD)) { + throw new InvalidArgumentException('non-nullable grossTaxablePayYTD cannot be null'); + } + $this->container['grossTaxablePayYTD'] = $grossTaxablePayYTD; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax [readonly] + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets taxYTD + * + * @return float|null + */ + public function getTaxYTD(): ?float + { + return $this->container['taxYTD']; + } + + /** + * Sets taxYTD + * + * @param float|null $taxYTD [readonly] + * + * @return $this + */ + public function setTaxYTD(?float $taxYTD): static + { + if (is_null($taxYTD)) { + throw new InvalidArgumentException('non-nullable taxYTD cannot be null'); + } + $this->container['taxYTD'] = $taxYTD; + + return $this; + } + + /** + * Gets studentLoan + * + * @return float|null + */ + public function getStudentLoan(): ?float + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param float|null $studentLoan [readonly] + * + * @return $this + */ + public function setStudentLoan(?float $studentLoan): static + { + if (is_null($studentLoan)) { + throw new InvalidArgumentException('non-nullable studentLoan cannot be null'); + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets postgradLoan + * + * @return float|null + */ + public function getPostgradLoan(): ?float + { + return $this->container['postgradLoan']; + } + + /** + * Sets postgradLoan + * + * @param float|null $postgradLoan [readonly] + * + * @return $this + */ + public function setPostgradLoan(?float $postgradLoan): static + { + if (is_null($postgradLoan)) { + throw new InvalidArgumentException('non-nullable postgradLoan cannot be null'); + } + $this->container['postgradLoan'] = $postgradLoan; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode [readonly] + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCode'] = $taxCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11PayeSummary.php b/src/Model/P11PayeSummary.php new file mode 100644 index 0000000..fb49b95 --- /dev/null +++ b/src/Model/P11PayeSummary.php @@ -0,0 +1,579 @@ + + */ +class P11PayeSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11PayeSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'previousEmploymentPay' => 'float', + 'previousEmploymentTax' => 'float', + 'thisEmploymentPay' => 'float', + 'thisEmploymentTax' => 'float', + 'totalPayForYear' => 'float', + 'totalTaxForYear' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'previousEmploymentPay' => 'double', + 'previousEmploymentTax' => 'double', + 'thisEmploymentPay' => 'double', + 'thisEmploymentTax' => 'double', + 'totalPayForYear' => 'double', + 'totalTaxForYear' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'previousEmploymentPay' => false, + 'previousEmploymentTax' => false, + 'thisEmploymentPay' => false, + 'thisEmploymentTax' => false, + 'totalPayForYear' => false, + 'totalTaxForYear' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'previousEmploymentPay' => 'previousEmploymentPay', + 'previousEmploymentTax' => 'previousEmploymentTax', + 'thisEmploymentPay' => 'thisEmploymentPay', + 'thisEmploymentTax' => 'thisEmploymentTax', + 'totalPayForYear' => 'totalPayForYear', + 'totalTaxForYear' => 'totalTaxForYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'previousEmploymentPay' => 'setPreviousEmploymentPay', + 'previousEmploymentTax' => 'setPreviousEmploymentTax', + 'thisEmploymentPay' => 'setThisEmploymentPay', + 'thisEmploymentTax' => 'setThisEmploymentTax', + 'totalPayForYear' => 'setTotalPayForYear', + 'totalTaxForYear' => 'setTotalTaxForYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'previousEmploymentPay' => 'getPreviousEmploymentPay', + 'previousEmploymentTax' => 'getPreviousEmploymentTax', + 'thisEmploymentPay' => 'getThisEmploymentPay', + 'thisEmploymentTax' => 'getThisEmploymentTax', + 'totalPayForYear' => 'getTotalPayForYear', + 'totalTaxForYear' => 'getTotalTaxForYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('previousEmploymentPay', $data ?? [], null); + $this->setIfExists('previousEmploymentTax', $data ?? [], null); + $this->setIfExists('thisEmploymentPay', $data ?? [], null); + $this->setIfExists('thisEmploymentTax', $data ?? [], null); + $this->setIfExists('totalPayForYear', $data ?? [], null); + $this->setIfExists('totalTaxForYear', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets previousEmploymentPay + * + * @return float|null + */ + public function getPreviousEmploymentPay(): ?float + { + return $this->container['previousEmploymentPay']; + } + + /** + * Sets previousEmploymentPay + * + * @param float|null $previousEmploymentPay [readonly] + * + * @return $this + */ + public function setPreviousEmploymentPay(?float $previousEmploymentPay): static + { + if (is_null($previousEmploymentPay)) { + throw new InvalidArgumentException('non-nullable previousEmploymentPay cannot be null'); + } + $this->container['previousEmploymentPay'] = $previousEmploymentPay; + + return $this; + } + + /** + * Gets previousEmploymentTax + * + * @return float|null + */ + public function getPreviousEmploymentTax(): ?float + { + return $this->container['previousEmploymentTax']; + } + + /** + * Sets previousEmploymentTax + * + * @param float|null $previousEmploymentTax [readonly] + * + * @return $this + */ + public function setPreviousEmploymentTax(?float $previousEmploymentTax): static + { + if (is_null($previousEmploymentTax)) { + throw new InvalidArgumentException('non-nullable previousEmploymentTax cannot be null'); + } + $this->container['previousEmploymentTax'] = $previousEmploymentTax; + + return $this; + } + + /** + * Gets thisEmploymentPay + * + * @return float|null + */ + public function getThisEmploymentPay(): ?float + { + return $this->container['thisEmploymentPay']; + } + + /** + * Sets thisEmploymentPay + * + * @param float|null $thisEmploymentPay [readonly] + * + * @return $this + */ + public function setThisEmploymentPay(?float $thisEmploymentPay): static + { + if (is_null($thisEmploymentPay)) { + throw new InvalidArgumentException('non-nullable thisEmploymentPay cannot be null'); + } + $this->container['thisEmploymentPay'] = $thisEmploymentPay; + + return $this; + } + + /** + * Gets thisEmploymentTax + * + * @return float|null + */ + public function getThisEmploymentTax(): ?float + { + return $this->container['thisEmploymentTax']; + } + + /** + * Sets thisEmploymentTax + * + * @param float|null $thisEmploymentTax [readonly] + * + * @return $this + */ + public function setThisEmploymentTax(?float $thisEmploymentTax): static + { + if (is_null($thisEmploymentTax)) { + throw new InvalidArgumentException('non-nullable thisEmploymentTax cannot be null'); + } + $this->container['thisEmploymentTax'] = $thisEmploymentTax; + + return $this; + } + + /** + * Gets totalPayForYear + * + * @return float|null + */ + public function getTotalPayForYear(): ?float + { + return $this->container['totalPayForYear']; + } + + /** + * Sets totalPayForYear + * + * @param float|null $totalPayForYear [readonly] + * + * @return $this + */ + public function setTotalPayForYear(?float $totalPayForYear): static + { + if (is_null($totalPayForYear)) { + throw new InvalidArgumentException('non-nullable totalPayForYear cannot be null'); + } + $this->container['totalPayForYear'] = $totalPayForYear; + + return $this; + } + + /** + * Gets totalTaxForYear + * + * @return float|null + */ + public function getTotalTaxForYear(): ?float + { + return $this->container['totalTaxForYear']; + } + + /** + * Sets totalTaxForYear + * + * @param float|null $totalTaxForYear [readonly] + * + * @return $this + */ + public function setTotalTaxForYear(?float $totalTaxForYear): static + { + if (is_null($totalTaxForYear)) { + throw new InvalidArgumentException('non-nullable totalTaxForYear cannot be null'); + } + $this->container['totalTaxForYear'] = $totalTaxForYear; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11PayeTotalsLine.php b/src/Model/P11PayeTotalsLine.php new file mode 100644 index 0000000..1dbb1ec --- /dev/null +++ b/src/Model/P11PayeTotalsLine.php @@ -0,0 +1,579 @@ + + */ +class P11PayeTotalsLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11PayeTotalsLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'studentLoan' => 'float', + 'postgradLoan' => 'float', + 'pay' => 'float', + 'totalPayToDate' => 'float', + 'taxDueToDate' => 'float', + 'taxDue' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'studentLoan' => 'double', + 'postgradLoan' => 'double', + 'pay' => 'double', + 'totalPayToDate' => 'double', + 'taxDueToDate' => 'double', + 'taxDue' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'studentLoan' => false, + 'postgradLoan' => false, + 'pay' => false, + 'totalPayToDate' => false, + 'taxDueToDate' => false, + 'taxDue' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'studentLoan' => 'studentLoan', + 'postgradLoan' => 'postgradLoan', + 'pay' => 'pay', + 'totalPayToDate' => 'totalPayToDate', + 'taxDueToDate' => 'taxDueToDate', + 'taxDue' => 'taxDue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'studentLoan' => 'setStudentLoan', + 'postgradLoan' => 'setPostgradLoan', + 'pay' => 'setPay', + 'totalPayToDate' => 'setTotalPayToDate', + 'taxDueToDate' => 'setTaxDueToDate', + 'taxDue' => 'setTaxDue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'studentLoan' => 'getStudentLoan', + 'postgradLoan' => 'getPostgradLoan', + 'pay' => 'getPay', + 'totalPayToDate' => 'getTotalPayToDate', + 'taxDueToDate' => 'getTaxDueToDate', + 'taxDue' => 'getTaxDue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('postgradLoan', $data ?? [], null); + $this->setIfExists('pay', $data ?? [], null); + $this->setIfExists('totalPayToDate', $data ?? [], null); + $this->setIfExists('taxDueToDate', $data ?? [], null); + $this->setIfExists('taxDue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets studentLoan + * + * @return float|null + */ + public function getStudentLoan(): ?float + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param float|null $studentLoan [readonly] + * + * @return $this + */ + public function setStudentLoan(?float $studentLoan): static + { + if (is_null($studentLoan)) { + throw new InvalidArgumentException('non-nullable studentLoan cannot be null'); + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets postgradLoan + * + * @return float|null + */ + public function getPostgradLoan(): ?float + { + return $this->container['postgradLoan']; + } + + /** + * Sets postgradLoan + * + * @param float|null $postgradLoan [readonly] + * + * @return $this + */ + public function setPostgradLoan(?float $postgradLoan): static + { + if (is_null($postgradLoan)) { + throw new InvalidArgumentException('non-nullable postgradLoan cannot be null'); + } + $this->container['postgradLoan'] = $postgradLoan; + + return $this; + } + + /** + * Gets pay + * + * @return float|null + */ + public function getPay(): ?float + { + return $this->container['pay']; + } + + /** + * Sets pay + * + * @param float|null $pay [readonly] + * + * @return $this + */ + public function setPay(?float $pay): static + { + if (is_null($pay)) { + throw new InvalidArgumentException('non-nullable pay cannot be null'); + } + $this->container['pay'] = $pay; + + return $this; + } + + /** + * Gets totalPayToDate + * + * @return float|null + */ + public function getTotalPayToDate(): ?float + { + return $this->container['totalPayToDate']; + } + + /** + * Sets totalPayToDate + * + * @param float|null $totalPayToDate [readonly] + * + * @return $this + */ + public function setTotalPayToDate(?float $totalPayToDate): static + { + if (is_null($totalPayToDate)) { + throw new InvalidArgumentException('non-nullable totalPayToDate cannot be null'); + } + $this->container['totalPayToDate'] = $totalPayToDate; + + return $this; + } + + /** + * Gets taxDueToDate + * + * @return float|null + */ + public function getTaxDueToDate(): ?float + { + return $this->container['taxDueToDate']; + } + + /** + * Sets taxDueToDate + * + * @param float|null $taxDueToDate [readonly] + * + * @return $this + */ + public function setTaxDueToDate(?float $taxDueToDate): static + { + if (is_null($taxDueToDate)) { + throw new InvalidArgumentException('non-nullable taxDueToDate cannot be null'); + } + $this->container['taxDueToDate'] = $taxDueToDate; + + return $this; + } + + /** + * Gets taxDue + * + * @return float|null + */ + public function getTaxDue(): ?float + { + return $this->container['taxDue']; + } + + /** + * Sets taxDue + * + * @param float|null $taxDue [readonly] + * + * @return $this + */ + public function setTaxDue(?float $taxDue): static + { + if (is_null($taxDue)) { + throw new InvalidArgumentException('non-nullable taxDue cannot be null'); + } + $this->container['taxDue'] = $taxDue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11ReportResponse.php b/src/Model/P11ReportResponse.php new file mode 100644 index 0000000..5a12c3e --- /dev/null +++ b/src/Model/P11ReportResponse.php @@ -0,0 +1,532 @@ + + */ +class P11ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11ReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\P11', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\P11|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\P11 + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\P11|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\P11 $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11dCarFreeFuelWithdrawn.php b/src/Model/P11dCarFreeFuelWithdrawn.php new file mode 100644 index 0000000..0ca997b --- /dev/null +++ b/src/Model/P11dCarFreeFuelWithdrawn.php @@ -0,0 +1,456 @@ + + */ +class P11dCarFreeFuelWithdrawn implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11dCarFreeFuelWithdrawn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'reinstated' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'reinstated' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'reinstated' => true, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'reinstated' => 'reinstated', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'reinstated' => 'setReinstated', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'reinstated' => 'getReinstated', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('reinstated', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets reinstated + * + * @return string|null + */ + public function getReinstated(): ?string + { + return $this->container['reinstated']; + } + + /** + * Sets reinstated + * + * @param string|null $reinstated reinstated + * + * @return $this + */ + public function setReinstated(?string $reinstated): static + { + if (is_null($reinstated)) { + array_push($this->openAPINullablesSetToNull, 'reinstated'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reinstated', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reinstated'] = $reinstated; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return $this + */ + public function setValue(?string $value): static + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11dExpenses.php b/src/Model/P11dExpenses.php new file mode 100644 index 0000000..1c233e6 --- /dev/null +++ b/src/Model/P11dExpenses.php @@ -0,0 +1,585 @@ + + */ +class P11dExpenses implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11dExpenses'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'travAndSub' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'ent' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'homeTel' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'nonQualRel' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'other' => '\SynergiTech\Staffology\Model\P11DSingleItem', + 'typeLetter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'travAndSub' => null, + 'ent' => null, + 'homeTel' => null, + 'nonQualRel' => null, + 'other' => null, + 'typeLetter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'travAndSub' => false, + 'ent' => false, + 'homeTel' => false, + 'nonQualRel' => false, + 'other' => false, + 'typeLetter' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'travAndSub' => 'travAndSub', + 'ent' => 'ent', + 'homeTel' => 'homeTel', + 'nonQualRel' => 'nonQualRel', + 'other' => 'other', + 'typeLetter' => 'typeLetter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'travAndSub' => 'setTravAndSub', + 'ent' => 'setEnt', + 'homeTel' => 'setHomeTel', + 'nonQualRel' => 'setNonQualRel', + 'other' => 'setOther', + 'typeLetter' => 'setTypeLetter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'travAndSub' => 'getTravAndSub', + 'ent' => 'getEnt', + 'homeTel' => 'getHomeTel', + 'nonQualRel' => 'getNonQualRel', + 'other' => 'getOther', + 'typeLetter' => 'getTypeLetter' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('travAndSub', $data ?? [], null); + $this->setIfExists('ent', $data ?? [], null); + $this->setIfExists('homeTel', $data ?? [], null); + $this->setIfExists('nonQualRel', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets travAndSub + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getTravAndSub(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['travAndSub']; + } + + /** + * Sets travAndSub + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $travAndSub travAndSub + * + * @return $this + */ + public function setTravAndSub(?\SynergiTech\Staffology\Model\P11DSingleItem $travAndSub): static + { + if (is_null($travAndSub)) { + throw new InvalidArgumentException('non-nullable travAndSub cannot be null'); + } + $this->container['travAndSub'] = $travAndSub; + + return $this; + } + + /** + * Gets ent + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getEnt(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['ent']; + } + + /** + * Sets ent + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $ent ent + * + * @return $this + */ + public function setEnt(?\SynergiTech\Staffology\Model\P11DSingleItem $ent): static + { + if (is_null($ent)) { + throw new InvalidArgumentException('non-nullable ent cannot be null'); + } + $this->container['ent'] = $ent; + + return $this; + } + + /** + * Gets homeTel + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getHomeTel(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['homeTel']; + } + + /** + * Sets homeTel + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $homeTel homeTel + * + * @return $this + */ + public function setHomeTel(?\SynergiTech\Staffology\Model\P11DSingleItem $homeTel): static + { + if (is_null($homeTel)) { + throw new InvalidArgumentException('non-nullable homeTel cannot be null'); + } + $this->container['homeTel'] = $homeTel; + + return $this; + } + + /** + * Gets nonQualRel + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getNonQualRel(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['nonQualRel']; + } + + /** + * Sets nonQualRel + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $nonQualRel nonQualRel + * + * @return $this + */ + public function setNonQualRel(?\SynergiTech\Staffology\Model\P11DSingleItem $nonQualRel): static + { + if (is_null($nonQualRel)) { + throw new InvalidArgumentException('non-nullable nonQualRel cannot be null'); + } + $this->container['nonQualRel'] = $nonQualRel; + + return $this; + } + + /** + * Gets other + * + * @return \SynergiTech\Staffology\Model\P11DSingleItem|null + */ + public function getOther(): ?\SynergiTech\Staffology\Model\P11DSingleItem + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param \SynergiTech\Staffology\Model\P11DSingleItem|null $other other + * + * @return $this + */ + public function setOther(?\SynergiTech\Staffology\Model\P11DSingleItem $other): static + { + if (is_null($other)) { + throw new InvalidArgumentException('non-nullable other cannot be null'); + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P11dVans.php b/src/Model/P11dVans.php new file mode 100644 index 0000000..c0e73bd --- /dev/null +++ b/src/Model/P11dVans.php @@ -0,0 +1,907 @@ + + */ +class P11dVans implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P11dVans'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fuelCashEquivOrRelevantAmt' => 'string', + 'typeLetter' => 'string', + 'taxablePmt' => 'string', + 'excess' => 'string', + 'taxablePmtOrRelevantAmt' => 'string', + 'tradingOrgInd' => 'string', + 'desc' => 'string', + 'other' => 'string', + 'annValProRata' => 'string', + 'grossOrAmtForgone' => 'string', + 'costOrAmtForgone' => 'string', + 'madeGood' => 'string', + 'cashEquivOrRelevantAmt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fuelCashEquivOrRelevantAmt' => null, + 'typeLetter' => null, + 'taxablePmt' => null, + 'excess' => null, + 'taxablePmtOrRelevantAmt' => null, + 'tradingOrgInd' => null, + 'desc' => null, + 'other' => null, + 'annValProRata' => null, + 'grossOrAmtForgone' => null, + 'costOrAmtForgone' => null, + 'madeGood' => null, + 'cashEquivOrRelevantAmt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fuelCashEquivOrRelevantAmt' => true, + 'typeLetter' => true, + 'taxablePmt' => true, + 'excess' => true, + 'taxablePmtOrRelevantAmt' => true, + 'tradingOrgInd' => true, + 'desc' => true, + 'other' => true, + 'annValProRata' => true, + 'grossOrAmtForgone' => true, + 'costOrAmtForgone' => true, + 'madeGood' => true, + 'cashEquivOrRelevantAmt' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fuelCashEquivOrRelevantAmt' => 'fuelCashEquivOrRelevantAmt', + 'typeLetter' => 'typeLetter', + 'taxablePmt' => 'taxablePmt', + 'excess' => 'excess', + 'taxablePmtOrRelevantAmt' => 'taxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'tradingOrgInd', + 'desc' => 'desc', + 'other' => 'other', + 'annValProRata' => 'annValProRata', + 'grossOrAmtForgone' => 'grossOrAmtForgone', + 'costOrAmtForgone' => 'costOrAmtForgone', + 'madeGood' => 'madeGood', + 'cashEquivOrRelevantAmt' => 'cashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fuelCashEquivOrRelevantAmt' => 'setFuelCashEquivOrRelevantAmt', + 'typeLetter' => 'setTypeLetter', + 'taxablePmt' => 'setTaxablePmt', + 'excess' => 'setExcess', + 'taxablePmtOrRelevantAmt' => 'setTaxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'setTradingOrgInd', + 'desc' => 'setDesc', + 'other' => 'setOther', + 'annValProRata' => 'setAnnValProRata', + 'grossOrAmtForgone' => 'setGrossOrAmtForgone', + 'costOrAmtForgone' => 'setCostOrAmtForgone', + 'madeGood' => 'setMadeGood', + 'cashEquivOrRelevantAmt' => 'setCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fuelCashEquivOrRelevantAmt' => 'getFuelCashEquivOrRelevantAmt', + 'typeLetter' => 'getTypeLetter', + 'taxablePmt' => 'getTaxablePmt', + 'excess' => 'getExcess', + 'taxablePmtOrRelevantAmt' => 'getTaxablePmtOrRelevantAmt', + 'tradingOrgInd' => 'getTradingOrgInd', + 'desc' => 'getDesc', + 'other' => 'getOther', + 'annValProRata' => 'getAnnValProRata', + 'grossOrAmtForgone' => 'getGrossOrAmtForgone', + 'costOrAmtForgone' => 'getCostOrAmtForgone', + 'madeGood' => 'getMadeGood', + 'cashEquivOrRelevantAmt' => 'getCashEquivOrRelevantAmt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fuelCashEquivOrRelevantAmt', $data ?? [], null); + $this->setIfExists('typeLetter', $data ?? [], null); + $this->setIfExists('taxablePmt', $data ?? [], null); + $this->setIfExists('excess', $data ?? [], null); + $this->setIfExists('taxablePmtOrRelevantAmt', $data ?? [], null); + $this->setIfExists('tradingOrgInd', $data ?? [], null); + $this->setIfExists('desc', $data ?? [], null); + $this->setIfExists('other', $data ?? [], null); + $this->setIfExists('annValProRata', $data ?? [], null); + $this->setIfExists('grossOrAmtForgone', $data ?? [], null); + $this->setIfExists('costOrAmtForgone', $data ?? [], null); + $this->setIfExists('madeGood', $data ?? [], null); + $this->setIfExists('cashEquivOrRelevantAmt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fuelCashEquivOrRelevantAmt + * + * @return string|null + */ + public function getFuelCashEquivOrRelevantAmt(): ?string + { + return $this->container['fuelCashEquivOrRelevantAmt']; + } + + /** + * Sets fuelCashEquivOrRelevantAmt + * + * @param string|null $fuelCashEquivOrRelevantAmt fuelCashEquivOrRelevantAmt + * + * @return $this + */ + public function setFuelCashEquivOrRelevantAmt(?string $fuelCashEquivOrRelevantAmt): static + { + if (is_null($fuelCashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'fuelCashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fuelCashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fuelCashEquivOrRelevantAmt'] = $fuelCashEquivOrRelevantAmt; + + return $this; + } + + /** + * Gets typeLetter + * + * @return string|null + */ + public function getTypeLetter(): ?string + { + return $this->container['typeLetter']; + } + + /** + * Sets typeLetter + * + * @param string|null $typeLetter typeLetter + * + * @return $this + */ + public function setTypeLetter(?string $typeLetter): static + { + if (is_null($typeLetter)) { + array_push($this->openAPINullablesSetToNull, 'typeLetter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('typeLetter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['typeLetter'] = $typeLetter; + + return $this; + } + + /** + * Gets taxablePmt + * + * @return string|null + */ + public function getTaxablePmt(): ?string + { + return $this->container['taxablePmt']; + } + + /** + * Sets taxablePmt + * + * @param string|null $taxablePmt taxablePmt + * + * @return $this + */ + public function setTaxablePmt(?string $taxablePmt): static + { + if (is_null($taxablePmt)) { + array_push($this->openAPINullablesSetToNull, 'taxablePmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePmt'] = $taxablePmt; + + return $this; + } + + /** + * Gets excess + * + * @return string|null + */ + public function getExcess(): ?string + { + return $this->container['excess']; + } + + /** + * Sets excess + * + * @param string|null $excess excess + * + * @return $this + */ + public function setExcess(?string $excess): static + { + if (is_null($excess)) { + array_push($this->openAPINullablesSetToNull, 'excess'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('excess', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['excess'] = $excess; + + return $this; + } + + /** + * Gets taxablePmtOrRelevantAmt + * + * @return string|null + */ + public function getTaxablePmtOrRelevantAmt(): ?string + { + return $this->container['taxablePmtOrRelevantAmt']; + } + + /** + * Sets taxablePmtOrRelevantAmt + * + * @param string|null $taxablePmtOrRelevantAmt taxablePmtOrRelevantAmt + * + * @return $this + */ + public function setTaxablePmtOrRelevantAmt(?string $taxablePmtOrRelevantAmt): static + { + if (is_null($taxablePmtOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'taxablePmtOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxablePmtOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxablePmtOrRelevantAmt'] = $taxablePmtOrRelevantAmt; + + return $this; + } + + /** + * Gets tradingOrgInd + * + * @return string|null + */ + public function getTradingOrgInd(): ?string + { + return $this->container['tradingOrgInd']; + } + + /** + * Sets tradingOrgInd + * + * @param string|null $tradingOrgInd tradingOrgInd + * + * @return $this + */ + public function setTradingOrgInd(?string $tradingOrgInd): static + { + if (is_null($tradingOrgInd)) { + array_push($this->openAPINullablesSetToNull, 'tradingOrgInd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tradingOrgInd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tradingOrgInd'] = $tradingOrgInd; + + return $this; + } + + /** + * Gets desc + * + * @return string|null + */ + public function getDesc(): ?string + { + return $this->container['desc']; + } + + /** + * Sets desc + * + * @param string|null $desc desc + * + * @return $this + */ + public function setDesc(?string $desc): static + { + if (is_null($desc)) { + array_push($this->openAPINullablesSetToNull, 'desc'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('desc', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['desc'] = $desc; + + return $this; + } + + /** + * Gets other + * + * @return string|null + */ + public function getOther(): ?string + { + return $this->container['other']; + } + + /** + * Sets other + * + * @param string|null $other other + * + * @return $this + */ + public function setOther(?string $other): static + { + if (is_null($other)) { + array_push($this->openAPINullablesSetToNull, 'other'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('other', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['other'] = $other; + + return $this; + } + + /** + * Gets annValProRata + * + * @return string|null + */ + public function getAnnValProRata(): ?string + { + return $this->container['annValProRata']; + } + + /** + * Sets annValProRata + * + * @param string|null $annValProRata annValProRata + * + * @return $this + */ + public function setAnnValProRata(?string $annValProRata): static + { + if (is_null($annValProRata)) { + array_push($this->openAPINullablesSetToNull, 'annValProRata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annValProRata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annValProRata'] = $annValProRata; + + return $this; + } + + /** + * Gets grossOrAmtForgone + * + * @return string|null + */ + public function getGrossOrAmtForgone(): ?string + { + return $this->container['grossOrAmtForgone']; + } + + /** + * Sets grossOrAmtForgone + * + * @param string|null $grossOrAmtForgone grossOrAmtForgone + * + * @return $this + */ + public function setGrossOrAmtForgone(?string $grossOrAmtForgone): static + { + if (is_null($grossOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'grossOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossOrAmtForgone'] = $grossOrAmtForgone; + + return $this; + } + + /** + * Gets costOrAmtForgone + * + * @return string|null + */ + public function getCostOrAmtForgone(): ?string + { + return $this->container['costOrAmtForgone']; + } + + /** + * Sets costOrAmtForgone + * + * @param string|null $costOrAmtForgone costOrAmtForgone + * + * @return $this + */ + public function setCostOrAmtForgone(?string $costOrAmtForgone): static + { + if (is_null($costOrAmtForgone)) { + array_push($this->openAPINullablesSetToNull, 'costOrAmtForgone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costOrAmtForgone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costOrAmtForgone'] = $costOrAmtForgone; + + return $this; + } + + /** + * Gets madeGood + * + * @return string|null + */ + public function getMadeGood(): ?string + { + return $this->container['madeGood']; + } + + /** + * Sets madeGood + * + * @param string|null $madeGood madeGood + * + * @return $this + */ + public function setMadeGood(?string $madeGood): static + { + if (is_null($madeGood)) { + array_push($this->openAPINullablesSetToNull, 'madeGood'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('madeGood', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['madeGood'] = $madeGood; + + return $this; + } + + /** + * Gets cashEquivOrRelevantAmt + * + * @return string|null + */ + public function getCashEquivOrRelevantAmt(): ?string + { + return $this->container['cashEquivOrRelevantAmt']; + } + + /** + * Sets cashEquivOrRelevantAmt + * + * @param string|null $cashEquivOrRelevantAmt cashEquivOrRelevantAmt + * + * @return $this + */ + public function setCashEquivOrRelevantAmt(?string $cashEquivOrRelevantAmt): static + { + if (is_null($cashEquivOrRelevantAmt)) { + array_push($this->openAPINullablesSetToNull, 'cashEquivOrRelevantAmt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cashEquivOrRelevantAmt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cashEquivOrRelevantAmt'] = $cashEquivOrRelevantAmt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P32.php b/src/Model/P32.php new file mode 100644 index 0000000..78b3822 --- /dev/null +++ b/src/Model/P32.php @@ -0,0 +1,661 @@ + + */ +class P32 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P32'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isQuarterly' => 'bool', + 'hmrcLiabilities' => '\SynergiTech\Staffology\Model\HmrcLiability[]', + 'employerOpeningBalances' => '\SynergiTech\Staffology\Model\EmployerOpeningBalances', + 'openingBalancesTotals' => '\SynergiTech\Staffology\Model\OpeningBalancesTotals', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isQuarterly' => null, + 'hmrcLiabilities' => null, + 'employerOpeningBalances' => null, + 'openingBalancesTotals' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isQuarterly' => false, + 'hmrcLiabilities' => true, + 'employerOpeningBalances' => false, + 'openingBalancesTotals' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isQuarterly' => 'isQuarterly', + 'hmrcLiabilities' => 'hmrcLiabilities', + 'employerOpeningBalances' => 'employerOpeningBalances', + 'openingBalancesTotals' => 'openingBalancesTotals', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isQuarterly' => 'setIsQuarterly', + 'hmrcLiabilities' => 'setHmrcLiabilities', + 'employerOpeningBalances' => 'setEmployerOpeningBalances', + 'openingBalancesTotals' => 'setOpeningBalancesTotals', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isQuarterly' => 'getIsQuarterly', + 'hmrcLiabilities' => 'getHmrcLiabilities', + 'employerOpeningBalances' => 'getEmployerOpeningBalances', + 'openingBalancesTotals' => 'getOpeningBalancesTotals', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isQuarterly', $data ?? [], null); + $this->setIfExists('hmrcLiabilities', $data ?? [], null); + $this->setIfExists('employerOpeningBalances', $data ?? [], null); + $this->setIfExists('openingBalancesTotals', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isQuarterly + * + * @return bool|null + */ + public function getIsQuarterly(): ?bool + { + return $this->container['isQuarterly']; + } + + /** + * Sets isQuarterly + * + * @param bool|null $isQuarterly [readonly] + * + * @return $this + */ + public function setIsQuarterly(?bool $isQuarterly): static + { + if (is_null($isQuarterly)) { + throw new InvalidArgumentException('non-nullable isQuarterly cannot be null'); + } + $this->container['isQuarterly'] = $isQuarterly; + + return $this; + } + + /** + * Gets hmrcLiabilities + * + * @return \SynergiTech\Staffology\Model\HmrcLiability[]|null + */ + public function getHmrcLiabilities(): ?array + { + return $this->container['hmrcLiabilities']; + } + + /** + * Sets hmrcLiabilities + * + * @param \SynergiTech\Staffology\Model\HmrcLiability[]|null $hmrcLiabilities [readonly] + * + * @return $this + */ + public function setHmrcLiabilities(?array $hmrcLiabilities): static + { + if (is_null($hmrcLiabilities)) { + array_push($this->openAPINullablesSetToNull, 'hmrcLiabilities'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hmrcLiabilities', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hmrcLiabilities'] = $hmrcLiabilities; + + return $this; + } + + /** + * Gets employerOpeningBalances + * + * @return \SynergiTech\Staffology\Model\EmployerOpeningBalances|null + */ + public function getEmployerOpeningBalances(): ?\SynergiTech\Staffology\Model\EmployerOpeningBalances + { + return $this->container['employerOpeningBalances']; + } + + /** + * Sets employerOpeningBalances + * + * @param \SynergiTech\Staffology\Model\EmployerOpeningBalances|null $employerOpeningBalances employerOpeningBalances + * + * @return $this + */ + public function setEmployerOpeningBalances(?\SynergiTech\Staffology\Model\EmployerOpeningBalances $employerOpeningBalances): static + { + if (is_null($employerOpeningBalances)) { + throw new InvalidArgumentException('non-nullable employerOpeningBalances cannot be null'); + } + $this->container['employerOpeningBalances'] = $employerOpeningBalances; + + return $this; + } + + /** + * Gets openingBalancesTotals + * + * @return \SynergiTech\Staffology\Model\OpeningBalancesTotals|null + */ + public function getOpeningBalancesTotals(): ?\SynergiTech\Staffology\Model\OpeningBalancesTotals + { + return $this->container['openingBalancesTotals']; + } + + /** + * Sets openingBalancesTotals + * + * @param \SynergiTech\Staffology\Model\OpeningBalancesTotals|null $openingBalancesTotals openingBalancesTotals + * + * @return $this + */ + public function setOpeningBalancesTotals(?\SynergiTech\Staffology\Model\OpeningBalancesTotals $openingBalancesTotals): static + { + if (is_null($openingBalancesTotals)) { + throw new InvalidArgumentException('non-nullable openingBalancesTotals cannot be null'); + } + $this->container['openingBalancesTotals'] = $openingBalancesTotals; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/P32ReportResponse.php b/src/Model/P32ReportResponse.php new file mode 100644 index 0000000..31e3622 --- /dev/null +++ b/src/Model/P32ReportResponse.php @@ -0,0 +1,532 @@ + + */ +class P32ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'P32ReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\P32', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\P32|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\P32 + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\P32|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\P32 $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisDocument.php b/src/Model/PapdisDocument.php new file mode 100644 index 0000000..65bee7a --- /dev/null +++ b/src/Model/PapdisDocument.php @@ -0,0 +1,654 @@ + + */ +class PapdisDocument implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisDocument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'messageFunctionCode' => '\SynergiTech\Staffology\Model\PapdisMessageFunctionCode', + 'version' => '\SynergiTech\Staffology\Model\PapdisVersion', + 'messageFunctionCodeInt' => 'int', + 'pensionProvider' => '\SynergiTech\Staffology\Model\PapdisPensionProvider', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'messageFunctionCode' => null, + 'version' => null, + 'messageFunctionCodeInt' => 'int32', + 'pensionProvider' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'messageFunctionCode' => false, + 'version' => false, + 'messageFunctionCodeInt' => false, + 'pensionProvider' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'messageFunctionCode' => 'messageFunctionCode', + 'version' => 'version', + 'messageFunctionCodeInt' => 'messageFunctionCodeInt', + 'pensionProvider' => 'pensionProvider', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'messageFunctionCode' => 'setMessageFunctionCode', + 'version' => 'setVersion', + 'messageFunctionCodeInt' => 'setMessageFunctionCodeInt', + 'pensionProvider' => 'setPensionProvider', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'messageFunctionCode' => 'getMessageFunctionCode', + 'version' => 'getVersion', + 'messageFunctionCodeInt' => 'getMessageFunctionCodeInt', + 'pensionProvider' => 'getPensionProvider', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('messageFunctionCode', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('messageFunctionCodeInt', $data ?? [], null); + $this->setIfExists('pensionProvider', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets messageFunctionCode + * + * @return \SynergiTech\Staffology\Model\PapdisMessageFunctionCode|null + */ + public function getMessageFunctionCode(): ?\SynergiTech\Staffology\Model\PapdisMessageFunctionCode + { + return $this->container['messageFunctionCode']; + } + + /** + * Sets messageFunctionCode + * + * @param \SynergiTech\Staffology\Model\PapdisMessageFunctionCode|null $messageFunctionCode messageFunctionCode + * + * @return $this + */ + public function setMessageFunctionCode(?\SynergiTech\Staffology\Model\PapdisMessageFunctionCode $messageFunctionCode): static + { + if (is_null($messageFunctionCode)) { + throw new InvalidArgumentException('non-nullable messageFunctionCode cannot be null'); + } + $this->container['messageFunctionCode'] = $messageFunctionCode; + + return $this; + } + + /** + * Gets version + * + * @return \SynergiTech\Staffology\Model\PapdisVersion|null + */ + public function getVersion(): ?\SynergiTech\Staffology\Model\PapdisVersion + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param \SynergiTech\Staffology\Model\PapdisVersion|null $version version + * + * @return $this + */ + public function setVersion(?\SynergiTech\Staffology\Model\PapdisVersion $version): static + { + if (is_null($version)) { + throw new InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets messageFunctionCodeInt + * + * @return int|null + */ + public function getMessageFunctionCodeInt(): ?int + { + return $this->container['messageFunctionCodeInt']; + } + + /** + * Sets messageFunctionCodeInt + * + * @param int|null $messageFunctionCodeInt [readonly] + * + * @return $this + */ + public function setMessageFunctionCodeInt(?int $messageFunctionCodeInt): static + { + if (is_null($messageFunctionCodeInt)) { + throw new InvalidArgumentException('non-nullable messageFunctionCodeInt cannot be null'); + } + $this->container['messageFunctionCodeInt'] = $messageFunctionCodeInt; + + return $this; + } + + /** + * Gets pensionProvider + * + * @return \SynergiTech\Staffology\Model\PapdisPensionProvider|null + */ + public function getPensionProvider(): ?\SynergiTech\Staffology\Model\PapdisPensionProvider + { + return $this->container['pensionProvider']; + } + + /** + * Sets pensionProvider + * + * @param \SynergiTech\Staffology\Model\PapdisPensionProvider|null $pensionProvider pensionProvider + * + * @return $this + */ + public function setPensionProvider(?\SynergiTech\Staffology\Model\PapdisPensionProvider $pensionProvider): static + { + if (is_null($pensionProvider)) { + throw new InvalidArgumentException('non-nullable pensionProvider cannot be null'); + } + $this->container['pensionProvider'] = $pensionProvider; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisDocumentReportResponse.php b/src/Model/PapdisDocumentReportResponse.php new file mode 100644 index 0000000..54c4306 --- /dev/null +++ b/src/Model/PapdisDocumentReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PapdisDocumentReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisDocumentReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PapdisDocument', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PapdisDocument|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PapdisDocument + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PapdisDocument|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PapdisDocument $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployee.php b/src/Model/PapdisEmployee.php new file mode 100644 index 0000000..49415a5 --- /dev/null +++ b/src/Model/PapdisEmployee.php @@ -0,0 +1,1137 @@ + + */ +class PapdisEmployee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'employeeId' => 'string', + 'name' => '\SynergiTech\Staffology\Model\PapdisEmployeeName', + 'identity' => '\SynergiTech\Staffology\Model\PapdisEmployeeIdentity', + 'contact' => '\SynergiTech\Staffology\Model\PapdisEmployeeContact', + 'pay' => '\SynergiTech\Staffology\Model\PapdisEmployeePay', + 'assessment' => '\SynergiTech\Staffology\Model\PapdisEmployeeAssessment', + 'contribution' => '\SynergiTech\Staffology\Model\PapdisEmployeeContribution', + 'exit' => '\SynergiTech\Staffology\Model\PapdisEmployeeExit', + 'payrollCode' => 'string', + 'aeStateDate' => '\DateTime', + 'leaveDate' => '\DateTime', + 'statePensionAge' => 'int', + 'contractualJoinerIndicator' => 'bool', + 'jobTitle' => 'string', + 'pensionMemberReference' => 'string', + 'pensionUniqueId' => 'string', + 'employeeRoleUniqueId' => 'string', + 'lastPaymentDate' => '\DateTime', + 'hasPrevioulyLeftPension' => 'bool', + 'pensionablePayDefinition' => '\SynergiTech\Staffology\Model\PensionablePayDefinition' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'int32', + 'employeeId' => 'uuid', + 'name' => null, + 'identity' => null, + 'contact' => null, + 'pay' => null, + 'assessment' => null, + 'contribution' => null, + 'exit' => null, + 'payrollCode' => null, + 'aeStateDate' => 'date', + 'leaveDate' => 'date', + 'statePensionAge' => 'int32', + 'contractualJoinerIndicator' => null, + 'jobTitle' => null, + 'pensionMemberReference' => null, + 'pensionUniqueId' => null, + 'employeeRoleUniqueId' => 'uuid', + 'lastPaymentDate' => 'date', + 'hasPrevioulyLeftPension' => null, + 'pensionablePayDefinition' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employeeId' => false, + 'name' => false, + 'identity' => false, + 'contact' => false, + 'pay' => false, + 'assessment' => false, + 'contribution' => false, + 'exit' => false, + 'payrollCode' => true, + 'aeStateDate' => true, + 'leaveDate' => true, + 'statePensionAge' => false, + 'contractualJoinerIndicator' => false, + 'jobTitle' => true, + 'pensionMemberReference' => true, + 'pensionUniqueId' => true, + 'employeeRoleUniqueId' => false, + 'lastPaymentDate' => true, + 'hasPrevioulyLeftPension' => false, + 'pensionablePayDefinition' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'employeeId' => 'employeeId', + 'name' => 'name', + 'identity' => 'identity', + 'contact' => 'contact', + 'pay' => 'pay', + 'assessment' => 'assessment', + 'contribution' => 'contribution', + 'exit' => 'exit', + 'payrollCode' => 'payrollCode', + 'aeStateDate' => 'aeStateDate', + 'leaveDate' => 'leaveDate', + 'statePensionAge' => 'statePensionAge', + 'contractualJoinerIndicator' => 'contractualJoinerIndicator', + 'jobTitle' => 'jobTitle', + 'pensionMemberReference' => 'pensionMemberReference', + 'pensionUniqueId' => 'pensionUniqueId', + 'employeeRoleUniqueId' => 'employeeRoleUniqueId', + 'lastPaymentDate' => 'lastPaymentDate', + 'hasPrevioulyLeftPension' => 'hasPrevioulyLeftPension', + 'pensionablePayDefinition' => 'pensionablePayDefinition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'employeeId' => 'setEmployeeId', + 'name' => 'setName', + 'identity' => 'setIdentity', + 'contact' => 'setContact', + 'pay' => 'setPay', + 'assessment' => 'setAssessment', + 'contribution' => 'setContribution', + 'exit' => 'setExit', + 'payrollCode' => 'setPayrollCode', + 'aeStateDate' => 'setAeStateDate', + 'leaveDate' => 'setLeaveDate', + 'statePensionAge' => 'setStatePensionAge', + 'contractualJoinerIndicator' => 'setContractualJoinerIndicator', + 'jobTitle' => 'setJobTitle', + 'pensionMemberReference' => 'setPensionMemberReference', + 'pensionUniqueId' => 'setPensionUniqueId', + 'employeeRoleUniqueId' => 'setEmployeeRoleUniqueId', + 'lastPaymentDate' => 'setLastPaymentDate', + 'hasPrevioulyLeftPension' => 'setHasPrevioulyLeftPension', + 'pensionablePayDefinition' => 'setPensionablePayDefinition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'employeeId' => 'getEmployeeId', + 'name' => 'getName', + 'identity' => 'getIdentity', + 'contact' => 'getContact', + 'pay' => 'getPay', + 'assessment' => 'getAssessment', + 'contribution' => 'getContribution', + 'exit' => 'getExit', + 'payrollCode' => 'getPayrollCode', + 'aeStateDate' => 'getAeStateDate', + 'leaveDate' => 'getLeaveDate', + 'statePensionAge' => 'getStatePensionAge', + 'contractualJoinerIndicator' => 'getContractualJoinerIndicator', + 'jobTitle' => 'getJobTitle', + 'pensionMemberReference' => 'getPensionMemberReference', + 'pensionUniqueId' => 'getPensionUniqueId', + 'employeeRoleUniqueId' => 'getEmployeeRoleUniqueId', + 'lastPaymentDate' => 'getLastPaymentDate', + 'hasPrevioulyLeftPension' => 'getHasPrevioulyLeftPension', + 'pensionablePayDefinition' => 'getPensionablePayDefinition' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('identity', $data ?? [], null); + $this->setIfExists('contact', $data ?? [], null); + $this->setIfExists('pay', $data ?? [], null); + $this->setIfExists('assessment', $data ?? [], null); + $this->setIfExists('contribution', $data ?? [], null); + $this->setIfExists('exit', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('aeStateDate', $data ?? [], null); + $this->setIfExists('leaveDate', $data ?? [], null); + $this->setIfExists('statePensionAge', $data ?? [], null); + $this->setIfExists('contractualJoinerIndicator', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('pensionMemberReference', $data ?? [], null); + $this->setIfExists('pensionUniqueId', $data ?? [], null); + $this->setIfExists('employeeRoleUniqueId', $data ?? [], null); + $this->setIfExists('lastPaymentDate', $data ?? [], null); + $this->setIfExists('hasPrevioulyLeftPension', $data ?? [], null); + $this->setIfExists('pensionablePayDefinition', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId(): ?int + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id [readonly] + * + * @return $this + */ + public function setId(?int $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId [readonly] + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets name + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeName|null + */ + public function getName(): ?\SynergiTech\Staffology\Model\PapdisEmployeeName + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeName|null $name name + * + * @return $this + */ + public function setName(?\SynergiTech\Staffology\Model\PapdisEmployeeName $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets identity + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeIdentity|null + */ + public function getIdentity(): ?\SynergiTech\Staffology\Model\PapdisEmployeeIdentity + { + return $this->container['identity']; + } + + /** + * Sets identity + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeIdentity|null $identity identity + * + * @return $this + */ + public function setIdentity(?\SynergiTech\Staffology\Model\PapdisEmployeeIdentity $identity): static + { + if (is_null($identity)) { + throw new InvalidArgumentException('non-nullable identity cannot be null'); + } + $this->container['identity'] = $identity; + + return $this; + } + + /** + * Gets contact + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeContact|null + */ + public function getContact(): ?\SynergiTech\Staffology\Model\PapdisEmployeeContact + { + return $this->container['contact']; + } + + /** + * Sets contact + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeContact|null $contact contact + * + * @return $this + */ + public function setContact(?\SynergiTech\Staffology\Model\PapdisEmployeeContact $contact): static + { + if (is_null($contact)) { + throw new InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; + + return $this; + } + + /** + * Gets pay + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeePay|null + */ + public function getPay(): ?\SynergiTech\Staffology\Model\PapdisEmployeePay + { + return $this->container['pay']; + } + + /** + * Sets pay + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeePay|null $pay pay + * + * @return $this + */ + public function setPay(?\SynergiTech\Staffology\Model\PapdisEmployeePay $pay): static + { + if (is_null($pay)) { + throw new InvalidArgumentException('non-nullable pay cannot be null'); + } + $this->container['pay'] = $pay; + + return $this; + } + + /** + * Gets assessment + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeAssessment|null + */ + public function getAssessment(): ?\SynergiTech\Staffology\Model\PapdisEmployeeAssessment + { + return $this->container['assessment']; + } + + /** + * Sets assessment + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeAssessment|null $assessment assessment + * + * @return $this + */ + public function setAssessment(?\SynergiTech\Staffology\Model\PapdisEmployeeAssessment $assessment): static + { + if (is_null($assessment)) { + throw new InvalidArgumentException('non-nullable assessment cannot be null'); + } + $this->container['assessment'] = $assessment; + + return $this; + } + + /** + * Gets contribution + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeContribution|null + */ + public function getContribution(): ?\SynergiTech\Staffology\Model\PapdisEmployeeContribution + { + return $this->container['contribution']; + } + + /** + * Sets contribution + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeContribution|null $contribution contribution + * + * @return $this + */ + public function setContribution(?\SynergiTech\Staffology\Model\PapdisEmployeeContribution $contribution): static + { + if (is_null($contribution)) { + throw new InvalidArgumentException('non-nullable contribution cannot be null'); + } + $this->container['contribution'] = $contribution; + + return $this; + } + + /** + * Gets exit + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeExit|null + */ + public function getExit(): ?\SynergiTech\Staffology\Model\PapdisEmployeeExit + { + return $this->container['exit']; + } + + /** + * Sets exit + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeExit|null $exit exit + * + * @return $this + */ + public function setExit(?\SynergiTech\Staffology\Model\PapdisEmployeeExit $exit): static + { + if (is_null($exit)) { + throw new InvalidArgumentException('non-nullable exit cannot be null'); + } + $this->container['exit'] = $exit; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode [readonly] + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets aeStateDate + * + * @return \DateTime|null + */ + public function getAeStateDate(): ?\DateTime + { + return $this->container['aeStateDate']; + } + + /** + * Sets aeStateDate + * + * @param \DateTime|null $aeStateDate aeStateDate + * + * @return $this + */ + public function setAeStateDate(?\DateTime $aeStateDate): static + { + if (is_null($aeStateDate)) { + array_push($this->openAPINullablesSetToNull, 'aeStateDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aeStateDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aeStateDate'] = $aeStateDate; + + return $this; + } + + /** + * Gets leaveDate + * + * @return \DateTime|null + */ + public function getLeaveDate(): ?\DateTime + { + return $this->container['leaveDate']; + } + + /** + * Sets leaveDate + * + * @param \DateTime|null $leaveDate leaveDate + * + * @return $this + */ + public function setLeaveDate(?\DateTime $leaveDate): static + { + if (is_null($leaveDate)) { + array_push($this->openAPINullablesSetToNull, 'leaveDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveDate'] = $leaveDate; + + return $this; + } + + /** + * Gets statePensionAge + * + * @return int|null + */ + public function getStatePensionAge(): ?int + { + return $this->container['statePensionAge']; + } + + /** + * Sets statePensionAge + * + * @param int|null $statePensionAge statePensionAge + * + * @return $this + */ + public function setStatePensionAge(?int $statePensionAge): static + { + if (is_null($statePensionAge)) { + throw new InvalidArgumentException('non-nullable statePensionAge cannot be null'); + } + $this->container['statePensionAge'] = $statePensionAge; + + return $this; + } + + /** + * Gets contractualJoinerIndicator + * + * @return bool|null + */ + public function getContractualJoinerIndicator(): ?bool + { + return $this->container['contractualJoinerIndicator']; + } + + /** + * Sets contractualJoinerIndicator + * + * @param bool|null $contractualJoinerIndicator contractualJoinerIndicator + * + * @return $this + */ + public function setContractualJoinerIndicator(?bool $contractualJoinerIndicator): static + { + if (is_null($contractualJoinerIndicator)) { + throw new InvalidArgumentException('non-nullable contractualJoinerIndicator cannot be null'); + } + $this->container['contractualJoinerIndicator'] = $contractualJoinerIndicator; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle jobTitle + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets pensionMemberReference + * + * @return string|null + */ + public function getPensionMemberReference(): ?string + { + return $this->container['pensionMemberReference']; + } + + /** + * Sets pensionMemberReference + * + * @param string|null $pensionMemberReference pensionMemberReference + * + * @return $this + */ + public function setPensionMemberReference(?string $pensionMemberReference): static + { + if (is_null($pensionMemberReference)) { + array_push($this->openAPINullablesSetToNull, 'pensionMemberReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionMemberReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionMemberReference'] = $pensionMemberReference; + + return $this; + } + + /** + * Gets pensionUniqueId + * + * @return string|null + */ + public function getPensionUniqueId(): ?string + { + return $this->container['pensionUniqueId']; + } + + /** + * Sets pensionUniqueId + * + * @param string|null $pensionUniqueId pensionUniqueId + * + * @return $this + */ + public function setPensionUniqueId(?string $pensionUniqueId): static + { + if (is_null($pensionUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'pensionUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionUniqueId'] = $pensionUniqueId; + + return $this; + } + + /** + * Gets employeeRoleUniqueId + * + * @return string|null + */ + public function getEmployeeRoleUniqueId(): ?string + { + return $this->container['employeeRoleUniqueId']; + } + + /** + * Sets employeeRoleUniqueId + * + * @param string|null $employeeRoleUniqueId employeeRoleUniqueId + * + * @return $this + */ + public function setEmployeeRoleUniqueId(?string $employeeRoleUniqueId): static + { + if (is_null($employeeRoleUniqueId)) { + throw new InvalidArgumentException('non-nullable employeeRoleUniqueId cannot be null'); + } + $this->container['employeeRoleUniqueId'] = $employeeRoleUniqueId; + + return $this; + } + + /** + * Gets lastPaymentDate + * + * @return \DateTime|null + */ + public function getLastPaymentDate(): ?\DateTime + { + return $this->container['lastPaymentDate']; + } + + /** + * Sets lastPaymentDate + * + * @param \DateTime|null $lastPaymentDate The last time the employee was paid + * + * @return $this + */ + public function setLastPaymentDate(?\DateTime $lastPaymentDate): static + { + if (is_null($lastPaymentDate)) { + array_push($this->openAPINullablesSetToNull, 'lastPaymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastPaymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastPaymentDate'] = $lastPaymentDate; + + return $this; + } + + /** + * Gets hasPrevioulyLeftPension + * + * @return bool|null + */ + public function getHasPrevioulyLeftPension(): ?bool + { + return $this->container['hasPrevioulyLeftPension']; + } + + /** + * Sets hasPrevioulyLeftPension + * + * @param bool|null $hasPrevioulyLeftPension Flag indicating the employee has previously left the pension + * + * @return $this + */ + public function setHasPrevioulyLeftPension(?bool $hasPrevioulyLeftPension): static + { + if (is_null($hasPrevioulyLeftPension)) { + throw new InvalidArgumentException('non-nullable hasPrevioulyLeftPension cannot be null'); + } + $this->container['hasPrevioulyLeftPension'] = $hasPrevioulyLeftPension; + + return $this; + } + + /** + * Gets pensionablePayDefinition + * + * @return \SynergiTech\Staffology\Model\PensionablePayDefinition|null + */ + public function getPensionablePayDefinition(): ?\SynergiTech\Staffology\Model\PensionablePayDefinition + { + return $this->container['pensionablePayDefinition']; + } + + /** + * Sets pensionablePayDefinition + * + * @param \SynergiTech\Staffology\Model\PensionablePayDefinition|null $pensionablePayDefinition pensionablePayDefinition + * + * @return $this + */ + public function setPensionablePayDefinition(?\SynergiTech\Staffology\Model\PensionablePayDefinition $pensionablePayDefinition): static + { + if (is_null($pensionablePayDefinition)) { + throw new InvalidArgumentException('non-nullable pensionablePayDefinition cannot be null'); + } + $this->container['pensionablePayDefinition'] = $pensionablePayDefinition; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeAssessment.php b/src/Model/PapdisEmployeeAssessment.php new file mode 100644 index 0000000..f0fafd3 --- /dev/null +++ b/src/Model/PapdisEmployeeAssessment.php @@ -0,0 +1,831 @@ + + */ +class PapdisEmployeeAssessment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeAssessment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'assessmentCode' => 'int', + 'eventCode' => 'int', + 'eventDate' => '\DateTime', + 'statutoryLetterCode' => 'string', + 'isIndividualAlreadyMemberOfQPS' => 'bool', + 'deferralDate' => '\DateTime', + 'enrolmentCommunicationsIssuedDate' => '\DateTime', + 'workerExclusionCode' => 'string', + 'reenrolmentIndicator' => 'bool', + 'optOutWindowEndDate' => '\DateTime', + 'pensionJoinReason' => '\SynergiTech\Staffology\Model\PensionJoinReason', + 'pensionStartDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'assessmentCode' => 'int32', + 'eventCode' => 'int32', + 'eventDate' => 'date', + 'statutoryLetterCode' => null, + 'isIndividualAlreadyMemberOfQPS' => null, + 'deferralDate' => 'date', + 'enrolmentCommunicationsIssuedDate' => 'date', + 'workerExclusionCode' => null, + 'reenrolmentIndicator' => null, + 'optOutWindowEndDate' => 'date', + 'pensionJoinReason' => null, + 'pensionStartDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'assessmentCode' => false, + 'eventCode' => false, + 'eventDate' => true, + 'statutoryLetterCode' => true, + 'isIndividualAlreadyMemberOfQPS' => false, + 'deferralDate' => true, + 'enrolmentCommunicationsIssuedDate' => true, + 'workerExclusionCode' => true, + 'reenrolmentIndicator' => false, + 'optOutWindowEndDate' => true, + 'pensionJoinReason' => false, + 'pensionStartDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'assessmentCode' => 'assessmentCode', + 'eventCode' => 'eventCode', + 'eventDate' => 'eventDate', + 'statutoryLetterCode' => 'statutoryLetterCode', + 'isIndividualAlreadyMemberOfQPS' => 'isIndividualAlreadyMemberOfQPS', + 'deferralDate' => 'deferralDate', + 'enrolmentCommunicationsIssuedDate' => 'enrolmentCommunicationsIssuedDate', + 'workerExclusionCode' => 'workerExclusionCode', + 'reenrolmentIndicator' => 'reenrolmentIndicator', + 'optOutWindowEndDate' => 'optOutWindowEndDate', + 'pensionJoinReason' => 'pensionJoinReason', + 'pensionStartDate' => 'pensionStartDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'assessmentCode' => 'setAssessmentCode', + 'eventCode' => 'setEventCode', + 'eventDate' => 'setEventDate', + 'statutoryLetterCode' => 'setStatutoryLetterCode', + 'isIndividualAlreadyMemberOfQPS' => 'setIsIndividualAlreadyMemberOfQPS', + 'deferralDate' => 'setDeferralDate', + 'enrolmentCommunicationsIssuedDate' => 'setEnrolmentCommunicationsIssuedDate', + 'workerExclusionCode' => 'setWorkerExclusionCode', + 'reenrolmentIndicator' => 'setReenrolmentIndicator', + 'optOutWindowEndDate' => 'setOptOutWindowEndDate', + 'pensionJoinReason' => 'setPensionJoinReason', + 'pensionStartDate' => 'setPensionStartDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'assessmentCode' => 'getAssessmentCode', + 'eventCode' => 'getEventCode', + 'eventDate' => 'getEventDate', + 'statutoryLetterCode' => 'getStatutoryLetterCode', + 'isIndividualAlreadyMemberOfQPS' => 'getIsIndividualAlreadyMemberOfQPS', + 'deferralDate' => 'getDeferralDate', + 'enrolmentCommunicationsIssuedDate' => 'getEnrolmentCommunicationsIssuedDate', + 'workerExclusionCode' => 'getWorkerExclusionCode', + 'reenrolmentIndicator' => 'getReenrolmentIndicator', + 'optOutWindowEndDate' => 'getOptOutWindowEndDate', + 'pensionJoinReason' => 'getPensionJoinReason', + 'pensionStartDate' => 'getPensionStartDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('assessmentCode', $data ?? [], null); + $this->setIfExists('eventCode', $data ?? [], null); + $this->setIfExists('eventDate', $data ?? [], null); + $this->setIfExists('statutoryLetterCode', $data ?? [], null); + $this->setIfExists('isIndividualAlreadyMemberOfQPS', $data ?? [], null); + $this->setIfExists('deferralDate', $data ?? [], null); + $this->setIfExists('enrolmentCommunicationsIssuedDate', $data ?? [], null); + $this->setIfExists('workerExclusionCode', $data ?? [], null); + $this->setIfExists('reenrolmentIndicator', $data ?? [], null); + $this->setIfExists('optOutWindowEndDate', $data ?? [], null); + $this->setIfExists('pensionJoinReason', $data ?? [], null); + $this->setIfExists('pensionStartDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets assessmentCode + * + * @return int|null + */ + public function getAssessmentCode(): ?int + { + return $this->container['assessmentCode']; + } + + /** + * Sets assessmentCode + * + * @param int|null $assessmentCode [readonly] + * + * @return $this + */ + public function setAssessmentCode(?int $assessmentCode): static + { + if (is_null($assessmentCode)) { + throw new InvalidArgumentException('non-nullable assessmentCode cannot be null'); + } + $this->container['assessmentCode'] = $assessmentCode; + + return $this; + } + + /** + * Gets eventCode + * + * @return int|null + */ + public function getEventCode(): ?int + { + return $this->container['eventCode']; + } + + /** + * Sets eventCode + * + * @param int|null $eventCode [readonly] + * + * @return $this + */ + public function setEventCode(?int $eventCode): static + { + if (is_null($eventCode)) { + throw new InvalidArgumentException('non-nullable eventCode cannot be null'); + } + $this->container['eventCode'] = $eventCode; + + return $this; + } + + /** + * Gets eventDate + * + * @return \DateTime|null + */ + public function getEventDate(): ?\DateTime + { + return $this->container['eventDate']; + } + + /** + * Sets eventDate + * + * @param \DateTime|null $eventDate [readonly] + * + * @return $this + */ + public function setEventDate(?\DateTime $eventDate): static + { + if (is_null($eventDate)) { + array_push($this->openAPINullablesSetToNull, 'eventDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('eventDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['eventDate'] = $eventDate; + + return $this; + } + + /** + * Gets statutoryLetterCode + * + * @return string|null + */ + public function getStatutoryLetterCode(): ?string + { + return $this->container['statutoryLetterCode']; + } + + /** + * Sets statutoryLetterCode + * + * @param string|null $statutoryLetterCode [readonly] + * + * @return $this + */ + public function setStatutoryLetterCode(?string $statutoryLetterCode): static + { + if (is_null($statutoryLetterCode)) { + array_push($this->openAPINullablesSetToNull, 'statutoryLetterCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statutoryLetterCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statutoryLetterCode'] = $statutoryLetterCode; + + return $this; + } + + /** + * Gets isIndividualAlreadyMemberOfQPS + * + * @return bool|null + */ + public function getIsIndividualAlreadyMemberOfQPS(): ?bool + { + return $this->container['isIndividualAlreadyMemberOfQPS']; + } + + /** + * Sets isIndividualAlreadyMemberOfQPS + * + * @param bool|null $isIndividualAlreadyMemberOfQPS [readonly] + * + * @return $this + */ + public function setIsIndividualAlreadyMemberOfQPS(?bool $isIndividualAlreadyMemberOfQPS): static + { + if (is_null($isIndividualAlreadyMemberOfQPS)) { + throw new InvalidArgumentException('non-nullable isIndividualAlreadyMemberOfQPS cannot be null'); + } + $this->container['isIndividualAlreadyMemberOfQPS'] = $isIndividualAlreadyMemberOfQPS; + + return $this; + } + + /** + * Gets deferralDate + * + * @return \DateTime|null + */ + public function getDeferralDate(): ?\DateTime + { + return $this->container['deferralDate']; + } + + /** + * Sets deferralDate + * + * @param \DateTime|null $deferralDate [readonly] + * + * @return $this + */ + public function setDeferralDate(?\DateTime $deferralDate): static + { + if (is_null($deferralDate)) { + array_push($this->openAPINullablesSetToNull, 'deferralDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deferralDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deferralDate'] = $deferralDate; + + return $this; + } + + /** + * Gets enrolmentCommunicationsIssuedDate + * + * @return \DateTime|null + */ + public function getEnrolmentCommunicationsIssuedDate(): ?\DateTime + { + return $this->container['enrolmentCommunicationsIssuedDate']; + } + + /** + * Sets enrolmentCommunicationsIssuedDate + * + * @param \DateTime|null $enrolmentCommunicationsIssuedDate [readonly] + * + * @return $this + */ + public function setEnrolmentCommunicationsIssuedDate(?\DateTime $enrolmentCommunicationsIssuedDate): static + { + if (is_null($enrolmentCommunicationsIssuedDate)) { + array_push($this->openAPINullablesSetToNull, 'enrolmentCommunicationsIssuedDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enrolmentCommunicationsIssuedDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enrolmentCommunicationsIssuedDate'] = $enrolmentCommunicationsIssuedDate; + + return $this; + } + + /** + * Gets workerExclusionCode + * + * @return string|null + */ + public function getWorkerExclusionCode(): ?string + { + return $this->container['workerExclusionCode']; + } + + /** + * Sets workerExclusionCode + * + * @param string|null $workerExclusionCode [readonly] + * + * @return $this + */ + public function setWorkerExclusionCode(?string $workerExclusionCode): static + { + if (is_null($workerExclusionCode)) { + array_push($this->openAPINullablesSetToNull, 'workerExclusionCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workerExclusionCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workerExclusionCode'] = $workerExclusionCode; + + return $this; + } + + /** + * Gets reenrolmentIndicator + * + * @return bool|null + */ + public function getReenrolmentIndicator(): ?bool + { + return $this->container['reenrolmentIndicator']; + } + + /** + * Sets reenrolmentIndicator + * + * @param bool|null $reenrolmentIndicator [readonly] + * + * @return $this + */ + public function setReenrolmentIndicator(?bool $reenrolmentIndicator): static + { + if (is_null($reenrolmentIndicator)) { + throw new InvalidArgumentException('non-nullable reenrolmentIndicator cannot be null'); + } + $this->container['reenrolmentIndicator'] = $reenrolmentIndicator; + + return $this; + } + + /** + * Gets optOutWindowEndDate + * + * @return \DateTime|null + */ + public function getOptOutWindowEndDate(): ?\DateTime + { + return $this->container['optOutWindowEndDate']; + } + + /** + * Sets optOutWindowEndDate + * + * @param \DateTime|null $optOutWindowEndDate [readonly] + * + * @return $this + */ + public function setOptOutWindowEndDate(?\DateTime $optOutWindowEndDate): static + { + if (is_null($optOutWindowEndDate)) { + array_push($this->openAPINullablesSetToNull, 'optOutWindowEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('optOutWindowEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['optOutWindowEndDate'] = $optOutWindowEndDate; + + return $this; + } + + /** + * Gets pensionJoinReason + * + * @return \SynergiTech\Staffology\Model\PensionJoinReason|null + */ + public function getPensionJoinReason(): ?\SynergiTech\Staffology\Model\PensionJoinReason + { + return $this->container['pensionJoinReason']; + } + + /** + * Sets pensionJoinReason + * + * @param \SynergiTech\Staffology\Model\PensionJoinReason|null $pensionJoinReason pensionJoinReason + * + * @return $this + */ + public function setPensionJoinReason(?\SynergiTech\Staffology\Model\PensionJoinReason $pensionJoinReason): static + { + if (is_null($pensionJoinReason)) { + throw new InvalidArgumentException('non-nullable pensionJoinReason cannot be null'); + } + $this->container['pensionJoinReason'] = $pensionJoinReason; + + return $this; + } + + /** + * Gets pensionStartDate + * + * @return \DateTime|null + */ + public function getPensionStartDate(): ?\DateTime + { + return $this->container['pensionStartDate']; + } + + /** + * Sets pensionStartDate + * + * @param \DateTime|null $pensionStartDate [readonly] + * + * @return $this + */ + public function setPensionStartDate(?\DateTime $pensionStartDate): static + { + if (is_null($pensionStartDate)) { + array_push($this->openAPINullablesSetToNull, 'pensionStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionStartDate'] = $pensionStartDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeContact.php b/src/Model/PapdisEmployeeContact.php new file mode 100644 index 0000000..6397e7d --- /dev/null +++ b/src/Model/PapdisEmployeeContact.php @@ -0,0 +1,572 @@ + + */ +class PapdisEmployeeContact implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeContact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'postalAddress' => '\SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress', + 'emailAddress' => 'string', + 'secondaryEmailAddress' => 'string', + 'telephone' => 'string', + 'mobile' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'postalAddress' => null, + 'emailAddress' => null, + 'secondaryEmailAddress' => null, + 'telephone' => null, + 'mobile' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'postalAddress' => false, + 'emailAddress' => true, + 'secondaryEmailAddress' => true, + 'telephone' => true, + 'mobile' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'postalAddress' => 'postalAddress', + 'emailAddress' => 'emailAddress', + 'secondaryEmailAddress' => 'secondaryEmailAddress', + 'telephone' => 'telephone', + 'mobile' => 'mobile' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'postalAddress' => 'setPostalAddress', + 'emailAddress' => 'setEmailAddress', + 'secondaryEmailAddress' => 'setSecondaryEmailAddress', + 'telephone' => 'setTelephone', + 'mobile' => 'setMobile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'postalAddress' => 'getPostalAddress', + 'emailAddress' => 'getEmailAddress', + 'secondaryEmailAddress' => 'getSecondaryEmailAddress', + 'telephone' => 'getTelephone', + 'mobile' => 'getMobile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('postalAddress', $data ?? [], null); + $this->setIfExists('emailAddress', $data ?? [], null); + $this->setIfExists('secondaryEmailAddress', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets postalAddress + * + * @return \SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress|null + */ + public function getPostalAddress(): ?\SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress + { + return $this->container['postalAddress']; + } + + /** + * Sets postalAddress + * + * @param \SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress|null $postalAddress postalAddress + * + * @return $this + */ + public function setPostalAddress(?\SynergiTech\Staffology\Model\PapdisEmployeeContactPostalAddress $postalAddress): static + { + if (is_null($postalAddress)) { + throw new InvalidArgumentException('non-nullable postalAddress cannot be null'); + } + $this->container['postalAddress'] = $postalAddress; + + return $this; + } + + /** + * Gets emailAddress + * + * @return string|null + */ + public function getEmailAddress(): ?string + { + return $this->container['emailAddress']; + } + + /** + * Sets emailAddress + * + * @param string|null $emailAddress [readonly] + * + * @return $this + */ + public function setEmailAddress(?string $emailAddress): static + { + if (is_null($emailAddress)) { + array_push($this->openAPINullablesSetToNull, 'emailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailAddress'] = $emailAddress; + + return $this; + } + + /** + * Gets secondaryEmailAddress + * + * @return string|null + */ + public function getSecondaryEmailAddress(): ?string + { + return $this->container['secondaryEmailAddress']; + } + + /** + * Sets secondaryEmailAddress + * + * @param string|null $secondaryEmailAddress [readonly] + * + * @return $this + */ + public function setSecondaryEmailAddress(?string $secondaryEmailAddress): static + { + if (is_null($secondaryEmailAddress)) { + array_push($this->openAPINullablesSetToNull, 'secondaryEmailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryEmailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryEmailAddress'] = $secondaryEmailAddress; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone [readonly] + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile(): ?string + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile [readonly] + * + * @return $this + */ + public function setMobile(?string $mobile): static + { + if (is_null($mobile)) { + array_push($this->openAPINullablesSetToNull, 'mobile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mobile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mobile'] = $mobile; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeContactPostalAddress.php b/src/Model/PapdisEmployeeContactPostalAddress.php new file mode 100644 index 0000000..799239e --- /dev/null +++ b/src/Model/PapdisEmployeeContactPostalAddress.php @@ -0,0 +1,620 @@ + + */ +class PapdisEmployeeContactPostalAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeContactPostalAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'address1' => 'string', + 'address2' => 'string', + 'address3' => 'string', + 'address4' => 'string', + 'postcode' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'address1' => null, + 'address2' => null, + 'address3' => null, + 'address4' => null, + 'postcode' => null, + 'country' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'address1' => true, + 'address2' => true, + 'address3' => true, + 'address4' => true, + 'postcode' => true, + 'country' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'address1' => 'address1', + 'address2' => 'address2', + 'address3' => 'address3', + 'address4' => 'address4', + 'postcode' => 'postcode', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'address1' => 'setAddress1', + 'address2' => 'setAddress2', + 'address3' => 'setAddress3', + 'address4' => 'setAddress4', + 'postcode' => 'setPostcode', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'address1' => 'getAddress1', + 'address2' => 'getAddress2', + 'address3' => 'getAddress3', + 'address4' => 'getAddress4', + 'postcode' => 'getPostcode', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('address3', $data ?? [], null); + $this->setIfExists('address4', $data ?? [], null); + $this->setIfExists('postcode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address1 + * + * @return string|null + */ + public function getAddress1(): ?string + { + return $this->container['address1']; + } + + /** + * Sets address1 + * + * @param string|null $address1 [readonly] + * + * @return $this + */ + public function setAddress1(?string $address1): static + { + if (is_null($address1)) { + array_push($this->openAPINullablesSetToNull, 'address1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address1'] = $address1; + + return $this; + } + + /** + * Gets address2 + * + * @return string|null + */ + public function getAddress2(): ?string + { + return $this->container['address2']; + } + + /** + * Sets address2 + * + * @param string|null $address2 [readonly] + * + * @return $this + */ + public function setAddress2(?string $address2): static + { + if (is_null($address2)) { + array_push($this->openAPINullablesSetToNull, 'address2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address2'] = $address2; + + return $this; + } + + /** + * Gets address3 + * + * @return string|null + */ + public function getAddress3(): ?string + { + return $this->container['address3']; + } + + /** + * Sets address3 + * + * @param string|null $address3 [readonly] + * + * @return $this + */ + public function setAddress3(?string $address3): static + { + if (is_null($address3)) { + array_push($this->openAPINullablesSetToNull, 'address3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address3'] = $address3; + + return $this; + } + + /** + * Gets address4 + * + * @return string|null + */ + public function getAddress4(): ?string + { + return $this->container['address4']; + } + + /** + * Sets address4 + * + * @param string|null $address4 [readonly] + * + * @return $this + */ + public function setAddress4(?string $address4): static + { + if (is_null($address4)) { + array_push($this->openAPINullablesSetToNull, 'address4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address4'] = $address4; + + return $this; + } + + /** + * Gets postcode + * + * @return string|null + */ + public function getPostcode(): ?string + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string|null $postcode [readonly] + * + * @return $this + */ + public function setPostcode(?string $postcode): static + { + if (is_null($postcode)) { + array_push($this->openAPINullablesSetToNull, 'postcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postcode'] = $postcode; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry(): ?string + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country [readonly] + * + * @return $this + */ + public function setCountry(?string $country): static + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeContribution.php b/src/Model/PapdisEmployeeContribution.php new file mode 100644 index 0000000..d3b9037 --- /dev/null +++ b/src/Model/PapdisEmployeeContribution.php @@ -0,0 +1,1129 @@ + + */ +class PapdisEmployeeContribution implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeContribution'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employerContributionsAmount' => 'float', + 'employerContributionsPercent' => 'float', + 'employeeContributionsAmount' => 'float', + 'employeeContributionsPercent' => 'float', + 'additionalVoluntaryContributionsAmount' => 'float', + 'additionalVoluntaryContributionsPercent' => 'float', + 'salarySacrificeIndicator' => 'bool', + 'contributionStartDate' => '\DateTime', + 'employeeContributionIsPercentage' => 'bool', + 'employerContributionIsPercentage' => 'bool', + 'unadjustedEmployeeContributionsAmount' => 'float', + 'unadjustedEmployerContributionsAmount' => 'float', + 'unadjustedAdditionalVoluntaryContributionsAmount' => 'float', + 'employerContributionNiSavings' => 'float', + 'contributionLevelType' => '\SynergiTech\Staffology\Model\PensionContributionLevelType', + 'isAvcOnly' => 'bool', + 'employerContributionIncludesNiSaving' => 'bool', + 'unadjustedAdditionalVoluntaryContributionsPercent' => 'float', + 'isHalfContributionMember' => 'bool', + 'assumedPensionablePay' => 'float', + 'isPensionRefund' => 'bool', + 'lowerLimit' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employerContributionsAmount' => 'double', + 'employerContributionsPercent' => 'double', + 'employeeContributionsAmount' => 'double', + 'employeeContributionsPercent' => 'double', + 'additionalVoluntaryContributionsAmount' => 'double', + 'additionalVoluntaryContributionsPercent' => 'double', + 'salarySacrificeIndicator' => null, + 'contributionStartDate' => 'date', + 'employeeContributionIsPercentage' => null, + 'employerContributionIsPercentage' => null, + 'unadjustedEmployeeContributionsAmount' => 'double', + 'unadjustedEmployerContributionsAmount' => 'double', + 'unadjustedAdditionalVoluntaryContributionsAmount' => 'double', + 'employerContributionNiSavings' => 'double', + 'contributionLevelType' => null, + 'isAvcOnly' => null, + 'employerContributionIncludesNiSaving' => null, + 'unadjustedAdditionalVoluntaryContributionsPercent' => 'double', + 'isHalfContributionMember' => null, + 'assumedPensionablePay' => 'double', + 'isPensionRefund' => null, + 'lowerLimit' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employerContributionsAmount' => false, + 'employerContributionsPercent' => false, + 'employeeContributionsAmount' => false, + 'employeeContributionsPercent' => false, + 'additionalVoluntaryContributionsAmount' => false, + 'additionalVoluntaryContributionsPercent' => false, + 'salarySacrificeIndicator' => false, + 'contributionStartDate' => false, + 'employeeContributionIsPercentage' => false, + 'employerContributionIsPercentage' => false, + 'unadjustedEmployeeContributionsAmount' => false, + 'unadjustedEmployerContributionsAmount' => false, + 'unadjustedAdditionalVoluntaryContributionsAmount' => false, + 'employerContributionNiSavings' => false, + 'contributionLevelType' => false, + 'isAvcOnly' => false, + 'employerContributionIncludesNiSaving' => false, + 'unadjustedAdditionalVoluntaryContributionsPercent' => false, + 'isHalfContributionMember' => false, + 'assumedPensionablePay' => true, + 'isPensionRefund' => false, + 'lowerLimit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employerContributionsAmount' => 'employerContributionsAmount', + 'employerContributionsPercent' => 'employerContributionsPercent', + 'employeeContributionsAmount' => 'employeeContributionsAmount', + 'employeeContributionsPercent' => 'employeeContributionsPercent', + 'additionalVoluntaryContributionsAmount' => 'additionalVoluntaryContributionsAmount', + 'additionalVoluntaryContributionsPercent' => 'additionalVoluntaryContributionsPercent', + 'salarySacrificeIndicator' => 'salarySacrificeIndicator', + 'contributionStartDate' => 'contributionStartDate', + 'employeeContributionIsPercentage' => 'employeeContributionIsPercentage', + 'employerContributionIsPercentage' => 'employerContributionIsPercentage', + 'unadjustedEmployeeContributionsAmount' => 'unadjustedEmployeeContributionsAmount', + 'unadjustedEmployerContributionsAmount' => 'unadjustedEmployerContributionsAmount', + 'unadjustedAdditionalVoluntaryContributionsAmount' => 'unadjustedAdditionalVoluntaryContributionsAmount', + 'employerContributionNiSavings' => 'employerContributionNiSavings', + 'contributionLevelType' => 'contributionLevelType', + 'isAvcOnly' => 'isAvcOnly', + 'employerContributionIncludesNiSaving' => 'employerContributionIncludesNiSaving', + 'unadjustedAdditionalVoluntaryContributionsPercent' => 'unadjustedAdditionalVoluntaryContributionsPercent', + 'isHalfContributionMember' => 'isHalfContributionMember', + 'assumedPensionablePay' => 'assumedPensionablePay', + 'isPensionRefund' => 'isPensionRefund', + 'lowerLimit' => 'lowerLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employerContributionsAmount' => 'setEmployerContributionsAmount', + 'employerContributionsPercent' => 'setEmployerContributionsPercent', + 'employeeContributionsAmount' => 'setEmployeeContributionsAmount', + 'employeeContributionsPercent' => 'setEmployeeContributionsPercent', + 'additionalVoluntaryContributionsAmount' => 'setAdditionalVoluntaryContributionsAmount', + 'additionalVoluntaryContributionsPercent' => 'setAdditionalVoluntaryContributionsPercent', + 'salarySacrificeIndicator' => 'setSalarySacrificeIndicator', + 'contributionStartDate' => 'setContributionStartDate', + 'employeeContributionIsPercentage' => 'setEmployeeContributionIsPercentage', + 'employerContributionIsPercentage' => 'setEmployerContributionIsPercentage', + 'unadjustedEmployeeContributionsAmount' => 'setUnadjustedEmployeeContributionsAmount', + 'unadjustedEmployerContributionsAmount' => 'setUnadjustedEmployerContributionsAmount', + 'unadjustedAdditionalVoluntaryContributionsAmount' => 'setUnadjustedAdditionalVoluntaryContributionsAmount', + 'employerContributionNiSavings' => 'setEmployerContributionNiSavings', + 'contributionLevelType' => 'setContributionLevelType', + 'isAvcOnly' => 'setIsAvcOnly', + 'employerContributionIncludesNiSaving' => 'setEmployerContributionIncludesNiSaving', + 'unadjustedAdditionalVoluntaryContributionsPercent' => 'setUnadjustedAdditionalVoluntaryContributionsPercent', + 'isHalfContributionMember' => 'setIsHalfContributionMember', + 'assumedPensionablePay' => 'setAssumedPensionablePay', + 'isPensionRefund' => 'setIsPensionRefund', + 'lowerLimit' => 'setLowerLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employerContributionsAmount' => 'getEmployerContributionsAmount', + 'employerContributionsPercent' => 'getEmployerContributionsPercent', + 'employeeContributionsAmount' => 'getEmployeeContributionsAmount', + 'employeeContributionsPercent' => 'getEmployeeContributionsPercent', + 'additionalVoluntaryContributionsAmount' => 'getAdditionalVoluntaryContributionsAmount', + 'additionalVoluntaryContributionsPercent' => 'getAdditionalVoluntaryContributionsPercent', + 'salarySacrificeIndicator' => 'getSalarySacrificeIndicator', + 'contributionStartDate' => 'getContributionStartDate', + 'employeeContributionIsPercentage' => 'getEmployeeContributionIsPercentage', + 'employerContributionIsPercentage' => 'getEmployerContributionIsPercentage', + 'unadjustedEmployeeContributionsAmount' => 'getUnadjustedEmployeeContributionsAmount', + 'unadjustedEmployerContributionsAmount' => 'getUnadjustedEmployerContributionsAmount', + 'unadjustedAdditionalVoluntaryContributionsAmount' => 'getUnadjustedAdditionalVoluntaryContributionsAmount', + 'employerContributionNiSavings' => 'getEmployerContributionNiSavings', + 'contributionLevelType' => 'getContributionLevelType', + 'isAvcOnly' => 'getIsAvcOnly', + 'employerContributionIncludesNiSaving' => 'getEmployerContributionIncludesNiSaving', + 'unadjustedAdditionalVoluntaryContributionsPercent' => 'getUnadjustedAdditionalVoluntaryContributionsPercent', + 'isHalfContributionMember' => 'getIsHalfContributionMember', + 'assumedPensionablePay' => 'getAssumedPensionablePay', + 'isPensionRefund' => 'getIsPensionRefund', + 'lowerLimit' => 'getLowerLimit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employerContributionsAmount', $data ?? [], null); + $this->setIfExists('employerContributionsPercent', $data ?? [], null); + $this->setIfExists('employeeContributionsAmount', $data ?? [], null); + $this->setIfExists('employeeContributionsPercent', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContributionsAmount', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContributionsPercent', $data ?? [], null); + $this->setIfExists('salarySacrificeIndicator', $data ?? [], null); + $this->setIfExists('contributionStartDate', $data ?? [], null); + $this->setIfExists('employeeContributionIsPercentage', $data ?? [], null); + $this->setIfExists('employerContributionIsPercentage', $data ?? [], null); + $this->setIfExists('unadjustedEmployeeContributionsAmount', $data ?? [], null); + $this->setIfExists('unadjustedEmployerContributionsAmount', $data ?? [], null); + $this->setIfExists('unadjustedAdditionalVoluntaryContributionsAmount', $data ?? [], null); + $this->setIfExists('employerContributionNiSavings', $data ?? [], null); + $this->setIfExists('contributionLevelType', $data ?? [], null); + $this->setIfExists('isAvcOnly', $data ?? [], null); + $this->setIfExists('employerContributionIncludesNiSaving', $data ?? [], null); + $this->setIfExists('unadjustedAdditionalVoluntaryContributionsPercent', $data ?? [], null); + $this->setIfExists('isHalfContributionMember', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + $this->setIfExists('isPensionRefund', $data ?? [], null); + $this->setIfExists('lowerLimit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employerContributionsAmount + * + * @return float|null + */ + public function getEmployerContributionsAmount(): ?float + { + return $this->container['employerContributionsAmount']; + } + + /** + * Sets employerContributionsAmount + * + * @param float|null $employerContributionsAmount [readonly] + * + * @return $this + */ + public function setEmployerContributionsAmount(?float $employerContributionsAmount): static + { + if (is_null($employerContributionsAmount)) { + throw new InvalidArgumentException('non-nullable employerContributionsAmount cannot be null'); + } + $this->container['employerContributionsAmount'] = $employerContributionsAmount; + + return $this; + } + + /** + * Gets employerContributionsPercent + * + * @return float|null + */ + public function getEmployerContributionsPercent(): ?float + { + return $this->container['employerContributionsPercent']; + } + + /** + * Sets employerContributionsPercent + * + * @param float|null $employerContributionsPercent [readonly] + * + * @return $this + */ + public function setEmployerContributionsPercent(?float $employerContributionsPercent): static + { + if (is_null($employerContributionsPercent)) { + throw new InvalidArgumentException('non-nullable employerContributionsPercent cannot be null'); + } + $this->container['employerContributionsPercent'] = $employerContributionsPercent; + + return $this; + } + + /** + * Gets employeeContributionsAmount + * + * @return float|null + */ + public function getEmployeeContributionsAmount(): ?float + { + return $this->container['employeeContributionsAmount']; + } + + /** + * Sets employeeContributionsAmount + * + * @param float|null $employeeContributionsAmount [readonly] + * + * @return $this + */ + public function setEmployeeContributionsAmount(?float $employeeContributionsAmount): static + { + if (is_null($employeeContributionsAmount)) { + throw new InvalidArgumentException('non-nullable employeeContributionsAmount cannot be null'); + } + $this->container['employeeContributionsAmount'] = $employeeContributionsAmount; + + return $this; + } + + /** + * Gets employeeContributionsPercent + * + * @return float|null + */ + public function getEmployeeContributionsPercent(): ?float + { + return $this->container['employeeContributionsPercent']; + } + + /** + * Sets employeeContributionsPercent + * + * @param float|null $employeeContributionsPercent [readonly] + * + * @return $this + */ + public function setEmployeeContributionsPercent(?float $employeeContributionsPercent): static + { + if (is_null($employeeContributionsPercent)) { + throw new InvalidArgumentException('non-nullable employeeContributionsPercent cannot be null'); + } + $this->container['employeeContributionsPercent'] = $employeeContributionsPercent; + + return $this; + } + + /** + * Gets additionalVoluntaryContributionsAmount + * + * @return float|null + */ + public function getAdditionalVoluntaryContributionsAmount(): ?float + { + return $this->container['additionalVoluntaryContributionsAmount']; + } + + /** + * Sets additionalVoluntaryContributionsAmount + * + * @param float|null $additionalVoluntaryContributionsAmount [readonly] + * + * @return $this + */ + public function setAdditionalVoluntaryContributionsAmount(?float $additionalVoluntaryContributionsAmount): static + { + if (is_null($additionalVoluntaryContributionsAmount)) { + throw new InvalidArgumentException('non-nullable additionalVoluntaryContributionsAmount cannot be null'); + } + $this->container['additionalVoluntaryContributionsAmount'] = $additionalVoluntaryContributionsAmount; + + return $this; + } + + /** + * Gets additionalVoluntaryContributionsPercent + * + * @return float|null + */ + public function getAdditionalVoluntaryContributionsPercent(): ?float + { + return $this->container['additionalVoluntaryContributionsPercent']; + } + + /** + * Sets additionalVoluntaryContributionsPercent + * + * @param float|null $additionalVoluntaryContributionsPercent [readonly] + * + * @return $this + */ + public function setAdditionalVoluntaryContributionsPercent(?float $additionalVoluntaryContributionsPercent): static + { + if (is_null($additionalVoluntaryContributionsPercent)) { + throw new InvalidArgumentException('non-nullable additionalVoluntaryContributionsPercent cannot be null'); + } + $this->container['additionalVoluntaryContributionsPercent'] = $additionalVoluntaryContributionsPercent; + + return $this; + } + + /** + * Gets salarySacrificeIndicator + * + * @return bool|null + */ + public function getSalarySacrificeIndicator(): ?bool + { + return $this->container['salarySacrificeIndicator']; + } + + /** + * Sets salarySacrificeIndicator + * + * @param bool|null $salarySacrificeIndicator [readonly] + * + * @return $this + */ + public function setSalarySacrificeIndicator(?bool $salarySacrificeIndicator): static + { + if (is_null($salarySacrificeIndicator)) { + throw new InvalidArgumentException('non-nullable salarySacrificeIndicator cannot be null'); + } + $this->container['salarySacrificeIndicator'] = $salarySacrificeIndicator; + + return $this; + } + + /** + * Gets contributionStartDate + * + * @return \DateTime|null + */ + public function getContributionStartDate(): ?\DateTime + { + return $this->container['contributionStartDate']; + } + + /** + * Sets contributionStartDate + * + * @param \DateTime|null $contributionStartDate [readonly] + * + * @return $this + */ + public function setContributionStartDate(?\DateTime $contributionStartDate): static + { + if (is_null($contributionStartDate)) { + throw new InvalidArgumentException('non-nullable contributionStartDate cannot be null'); + } + $this->container['contributionStartDate'] = $contributionStartDate; + + return $this; + } + + /** + * Gets employeeContributionIsPercentage + * + * @return bool|null + */ + public function getEmployeeContributionIsPercentage(): ?bool + { + return $this->container['employeeContributionIsPercentage']; + } + + /** + * Sets employeeContributionIsPercentage + * + * @param bool|null $employeeContributionIsPercentage [readonly] + * + * @return $this + */ + public function setEmployeeContributionIsPercentage(?bool $employeeContributionIsPercentage): static + { + if (is_null($employeeContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employeeContributionIsPercentage cannot be null'); + } + $this->container['employeeContributionIsPercentage'] = $employeeContributionIsPercentage; + + return $this; + } + + /** + * Gets employerContributionIsPercentage + * + * @return bool|null + */ + public function getEmployerContributionIsPercentage(): ?bool + { + return $this->container['employerContributionIsPercentage']; + } + + /** + * Sets employerContributionIsPercentage + * + * @param bool|null $employerContributionIsPercentage [readonly] + * + * @return $this + */ + public function setEmployerContributionIsPercentage(?bool $employerContributionIsPercentage): static + { + if (is_null($employerContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionIsPercentage cannot be null'); + } + $this->container['employerContributionIsPercentage'] = $employerContributionIsPercentage; + + return $this; + } + + /** + * Gets unadjustedEmployeeContributionsAmount + * + * @return float|null + */ + public function getUnadjustedEmployeeContributionsAmount(): ?float + { + return $this->container['unadjustedEmployeeContributionsAmount']; + } + + /** + * Sets unadjustedEmployeeContributionsAmount + * + * @param float|null $unadjustedEmployeeContributionsAmount [readonly] + * + * @return $this + */ + public function setUnadjustedEmployeeContributionsAmount(?float $unadjustedEmployeeContributionsAmount): static + { + if (is_null($unadjustedEmployeeContributionsAmount)) { + throw new InvalidArgumentException('non-nullable unadjustedEmployeeContributionsAmount cannot be null'); + } + $this->container['unadjustedEmployeeContributionsAmount'] = $unadjustedEmployeeContributionsAmount; + + return $this; + } + + /** + * Gets unadjustedEmployerContributionsAmount + * + * @return float|null + */ + public function getUnadjustedEmployerContributionsAmount(): ?float + { + return $this->container['unadjustedEmployerContributionsAmount']; + } + + /** + * Sets unadjustedEmployerContributionsAmount + * + * @param float|null $unadjustedEmployerContributionsAmount [readonly] + * + * @return $this + */ + public function setUnadjustedEmployerContributionsAmount(?float $unadjustedEmployerContributionsAmount): static + { + if (is_null($unadjustedEmployerContributionsAmount)) { + throw new InvalidArgumentException('non-nullable unadjustedEmployerContributionsAmount cannot be null'); + } + $this->container['unadjustedEmployerContributionsAmount'] = $unadjustedEmployerContributionsAmount; + + return $this; + } + + /** + * Gets unadjustedAdditionalVoluntaryContributionsAmount + * + * @return float|null + */ + public function getUnadjustedAdditionalVoluntaryContributionsAmount(): ?float + { + return $this->container['unadjustedAdditionalVoluntaryContributionsAmount']; + } + + /** + * Sets unadjustedAdditionalVoluntaryContributionsAmount + * + * @param float|null $unadjustedAdditionalVoluntaryContributionsAmount [readonly] + * + * @return $this + */ + public function setUnadjustedAdditionalVoluntaryContributionsAmount(?float $unadjustedAdditionalVoluntaryContributionsAmount): static + { + if (is_null($unadjustedAdditionalVoluntaryContributionsAmount)) { + throw new InvalidArgumentException('non-nullable unadjustedAdditionalVoluntaryContributionsAmount cannot be null'); + } + $this->container['unadjustedAdditionalVoluntaryContributionsAmount'] = $unadjustedAdditionalVoluntaryContributionsAmount; + + return $this; + } + + /** + * Gets employerContributionNiSavings + * + * @return float|null + */ + public function getEmployerContributionNiSavings(): ?float + { + return $this->container['employerContributionNiSavings']; + } + + /** + * Sets employerContributionNiSavings + * + * @param float|null $employerContributionNiSavings [readonly] + * + * @return $this + */ + public function setEmployerContributionNiSavings(?float $employerContributionNiSavings): static + { + if (is_null($employerContributionNiSavings)) { + throw new InvalidArgumentException('non-nullable employerContributionNiSavings cannot be null'); + } + $this->container['employerContributionNiSavings'] = $employerContributionNiSavings; + + return $this; + } + + /** + * Gets contributionLevelType + * + * @return \SynergiTech\Staffology\Model\PensionContributionLevelType|null + */ + public function getContributionLevelType(): ?\SynergiTech\Staffology\Model\PensionContributionLevelType + { + return $this->container['contributionLevelType']; + } + + /** + * Sets contributionLevelType + * + * @param \SynergiTech\Staffology\Model\PensionContributionLevelType|null $contributionLevelType contributionLevelType + * + * @return $this + */ + public function setContributionLevelType(?\SynergiTech\Staffology\Model\PensionContributionLevelType $contributionLevelType): static + { + if (is_null($contributionLevelType)) { + throw new InvalidArgumentException('non-nullable contributionLevelType cannot be null'); + } + $this->container['contributionLevelType'] = $contributionLevelType; + + return $this; + } + + /** + * Gets isAvcOnly + * + * @return bool|null + */ + public function getIsAvcOnly(): ?bool + { + return $this->container['isAvcOnly']; + } + + /** + * Sets isAvcOnly + * + * @param bool|null $isAvcOnly [readonly] + * + * @return $this + */ + public function setIsAvcOnly(?bool $isAvcOnly): static + { + if (is_null($isAvcOnly)) { + throw new InvalidArgumentException('non-nullable isAvcOnly cannot be null'); + } + $this->container['isAvcOnly'] = $isAvcOnly; + + return $this; + } + + /** + * Gets employerContributionIncludesNiSaving + * + * @return bool|null + */ + public function getEmployerContributionIncludesNiSaving(): ?bool + { + return $this->container['employerContributionIncludesNiSaving']; + } + + /** + * Sets employerContributionIncludesNiSaving + * + * @param bool|null $employerContributionIncludesNiSaving [readonly] + * + * @return $this + */ + public function setEmployerContributionIncludesNiSaving(?bool $employerContributionIncludesNiSaving): static + { + if (is_null($employerContributionIncludesNiSaving)) { + throw new InvalidArgumentException('non-nullable employerContributionIncludesNiSaving cannot be null'); + } + $this->container['employerContributionIncludesNiSaving'] = $employerContributionIncludesNiSaving; + + return $this; + } + + /** + * Gets unadjustedAdditionalVoluntaryContributionsPercent + * + * @return float|null + */ + public function getUnadjustedAdditionalVoluntaryContributionsPercent(): ?float + { + return $this->container['unadjustedAdditionalVoluntaryContributionsPercent']; + } + + /** + * Sets unadjustedAdditionalVoluntaryContributionsPercent + * + * @param float|null $unadjustedAdditionalVoluntaryContributionsPercent [readonly] + * + * @return $this + */ + public function setUnadjustedAdditionalVoluntaryContributionsPercent(?float $unadjustedAdditionalVoluntaryContributionsPercent): static + { + if (is_null($unadjustedAdditionalVoluntaryContributionsPercent)) { + throw new InvalidArgumentException('non-nullable unadjustedAdditionalVoluntaryContributionsPercent cannot be null'); + } + $this->container['unadjustedAdditionalVoluntaryContributionsPercent'] = $unadjustedAdditionalVoluntaryContributionsPercent; + + return $this; + } + + /** + * Gets isHalfContributionMember + * + * @return bool|null + */ + public function getIsHalfContributionMember(): ?bool + { + return $this->container['isHalfContributionMember']; + } + + /** + * Sets isHalfContributionMember + * + * @param bool|null $isHalfContributionMember [readonly] + * + * @return $this + */ + public function setIsHalfContributionMember(?bool $isHalfContributionMember): static + { + if (is_null($isHalfContributionMember)) { + throw new InvalidArgumentException('non-nullable isHalfContributionMember cannot be null'); + } + $this->container['isHalfContributionMember'] = $isHalfContributionMember; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float|null + */ + public function getAssumedPensionablePay(): ?float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float|null $assumedPensionablePay [readonly] + * + * @return $this + */ + public function setAssumedPensionablePay(?float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + + /** + * Gets isPensionRefund + * + * @return bool|null + */ + public function getIsPensionRefund(): ?bool + { + return $this->container['isPensionRefund']; + } + + /** + * Sets isPensionRefund + * + * @param bool|null $isPensionRefund [readonly] + * + * @return $this + */ + public function setIsPensionRefund(?bool $isPensionRefund): static + { + if (is_null($isPensionRefund)) { + throw new InvalidArgumentException('non-nullable isPensionRefund cannot be null'); + } + $this->container['isPensionRefund'] = $isPensionRefund; + + return $this; + } + + /** + * Gets lowerLimit + * + * @return float|null + */ + public function getLowerLimit(): ?float + { + return $this->container['lowerLimit']; + } + + /** + * Sets lowerLimit + * + * @param float|null $lowerLimit [readonly] + * + * @return $this + */ + public function setLowerLimit(?float $lowerLimit): static + { + if (is_null($lowerLimit)) { + throw new InvalidArgumentException('non-nullable lowerLimit cannot be null'); + } + $this->container['lowerLimit'] = $lowerLimit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeExit.php b/src/Model/PapdisEmployeeExit.php new file mode 100644 index 0000000..0b5b495 --- /dev/null +++ b/src/Model/PapdisEmployeeExit.php @@ -0,0 +1,579 @@ + + */ +class PapdisEmployeeExit implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeExit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'exitDate' => '\DateTime', + 'exitReasonCode' => 'int', + 'aeOptOutDate' => '\DateTime', + 'aeOptOutReference' => 'string', + 'reasonForLeaving' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'exitDate' => 'date', + 'exitReasonCode' => 'int32', + 'aeOptOutDate' => 'date', + 'aeOptOutReference' => null, + 'reasonForLeaving' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'exitDate' => true, + 'exitReasonCode' => true, + 'aeOptOutDate' => true, + 'aeOptOutReference' => true, + 'reasonForLeaving' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'exitDate' => 'exitDate', + 'exitReasonCode' => 'exitReasonCode', + 'aeOptOutDate' => 'aeOptOutDate', + 'aeOptOutReference' => 'aeOptOutReference', + 'reasonForLeaving' => 'reasonForLeaving' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'exitDate' => 'setExitDate', + 'exitReasonCode' => 'setExitReasonCode', + 'aeOptOutDate' => 'setAeOptOutDate', + 'aeOptOutReference' => 'setAeOptOutReference', + 'reasonForLeaving' => 'setReasonForLeaving' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'exitDate' => 'getExitDate', + 'exitReasonCode' => 'getExitReasonCode', + 'aeOptOutDate' => 'getAeOptOutDate', + 'aeOptOutReference' => 'getAeOptOutReference', + 'reasonForLeaving' => 'getReasonForLeaving' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('exitDate', $data ?? [], null); + $this->setIfExists('exitReasonCode', $data ?? [], null); + $this->setIfExists('aeOptOutDate', $data ?? [], null); + $this->setIfExists('aeOptOutReference', $data ?? [], null); + $this->setIfExists('reasonForLeaving', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets exitDate + * + * @return \DateTime|null + */ + public function getExitDate(): ?\DateTime + { + return $this->container['exitDate']; + } + + /** + * Sets exitDate + * + * @param \DateTime|null $exitDate [readonly] + * + * @return $this + */ + public function setExitDate(?\DateTime $exitDate): static + { + if (is_null($exitDate)) { + array_push($this->openAPINullablesSetToNull, 'exitDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exitDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['exitDate'] = $exitDate; + + return $this; + } + + /** + * Gets exitReasonCode + * + * @return int|null + */ + public function getExitReasonCode(): ?int + { + return $this->container['exitReasonCode']; + } + + /** + * Sets exitReasonCode + * + * @param int|null $exitReasonCode [readonly] + * + * @return $this + */ + public function setExitReasonCode(?int $exitReasonCode): static + { + if (is_null($exitReasonCode)) { + array_push($this->openAPINullablesSetToNull, 'exitReasonCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exitReasonCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['exitReasonCode'] = $exitReasonCode; + + return $this; + } + + /** + * Gets aeOptOutDate + * + * @return \DateTime|null + */ + public function getAeOptOutDate(): ?\DateTime + { + return $this->container['aeOptOutDate']; + } + + /** + * Sets aeOptOutDate + * + * @param \DateTime|null $aeOptOutDate [readonly] + * + * @return $this + */ + public function setAeOptOutDate(?\DateTime $aeOptOutDate): static + { + if (is_null($aeOptOutDate)) { + array_push($this->openAPINullablesSetToNull, 'aeOptOutDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aeOptOutDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aeOptOutDate'] = $aeOptOutDate; + + return $this; + } + + /** + * Gets aeOptOutReference + * + * @return string|null + */ + public function getAeOptOutReference(): ?string + { + return $this->container['aeOptOutReference']; + } + + /** + * Sets aeOptOutReference + * + * @param string|null $aeOptOutReference [readonly] + * + * @return $this + */ + public function setAeOptOutReference(?string $aeOptOutReference): static + { + if (is_null($aeOptOutReference)) { + array_push($this->openAPINullablesSetToNull, 'aeOptOutReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('aeOptOutReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['aeOptOutReference'] = $aeOptOutReference; + + return $this; + } + + /** + * Gets reasonForLeaving + * + * @return string|null + */ + public function getReasonForLeaving(): ?string + { + return $this->container['reasonForLeaving']; + } + + /** + * Sets reasonForLeaving + * + * @param string|null $reasonForLeaving [readonly] + * + * @return $this + */ + public function setReasonForLeaving(?string $reasonForLeaving): static + { + if (is_null($reasonForLeaving)) { + array_push($this->openAPINullablesSetToNull, 'reasonForLeaving'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reasonForLeaving', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reasonForLeaving'] = $reasonForLeaving; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeIdentity.php b/src/Model/PapdisEmployeeIdentity.php new file mode 100644 index 0000000..8a8e2ef --- /dev/null +++ b/src/Model/PapdisEmployeeIdentity.php @@ -0,0 +1,599 @@ + + */ +class PapdisEmployeeIdentity implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeIdentity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeId' => 'string', + 'birthDate' => '\DateTime', + 'gender' => 'string', + 'nationalInsuranceNumber' => 'string', + 'employmentStartDate' => '\DateTime', + 'maritalStatus' => '\SynergiTech\Staffology\Model\MaritalStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeId' => null, + 'birthDate' => 'date', + 'gender' => null, + 'nationalInsuranceNumber' => null, + 'employmentStartDate' => 'date', + 'maritalStatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeId' => true, + 'birthDate' => false, + 'gender' => true, + 'nationalInsuranceNumber' => true, + 'employmentStartDate' => false, + 'maritalStatus' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeId' => 'employeeId', + 'birthDate' => 'birthDate', + 'gender' => 'gender', + 'nationalInsuranceNumber' => 'nationalInsuranceNumber', + 'employmentStartDate' => 'employmentStartDate', + 'maritalStatus' => 'maritalStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeId' => 'setEmployeeId', + 'birthDate' => 'setBirthDate', + 'gender' => 'setGender', + 'nationalInsuranceNumber' => 'setNationalInsuranceNumber', + 'employmentStartDate' => 'setEmploymentStartDate', + 'maritalStatus' => 'setMaritalStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeId' => 'getEmployeeId', + 'birthDate' => 'getBirthDate', + 'gender' => 'getGender', + 'nationalInsuranceNumber' => 'getNationalInsuranceNumber', + 'employmentStartDate' => 'getEmploymentStartDate', + 'maritalStatus' => 'getMaritalStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('birthDate', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('nationalInsuranceNumber', $data ?? [], null); + $this->setIfExists('employmentStartDate', $data ?? [], null); + $this->setIfExists('maritalStatus', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId [readonly] + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + array_push($this->openAPINullablesSetToNull, 'employeeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets birthDate + * + * @return \DateTime|null + */ + public function getBirthDate(): ?\DateTime + { + return $this->container['birthDate']; + } + + /** + * Sets birthDate + * + * @param \DateTime|null $birthDate [readonly] + * + * @return $this + */ + public function setBirthDate(?\DateTime $birthDate): static + { + if (is_null($birthDate)) { + throw new InvalidArgumentException('non-nullable birthDate cannot be null'); + } + $this->container['birthDate'] = $birthDate; + + return $this; + } + + /** + * Gets gender + * + * @return string|null + */ + public function getGender(): ?string + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param string|null $gender [readonly] + * + * @return $this + */ + public function setGender(?string $gender): static + { + if (is_null($gender)) { + array_push($this->openAPINullablesSetToNull, 'gender'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gender', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets nationalInsuranceNumber + * + * @return string|null + */ + public function getNationalInsuranceNumber(): ?string + { + return $this->container['nationalInsuranceNumber']; + } + + /** + * Sets nationalInsuranceNumber + * + * @param string|null $nationalInsuranceNumber [readonly] + * + * @return $this + */ + public function setNationalInsuranceNumber(?string $nationalInsuranceNumber): static + { + if (is_null($nationalInsuranceNumber)) { + array_push($this->openAPINullablesSetToNull, 'nationalInsuranceNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nationalInsuranceNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nationalInsuranceNumber'] = $nationalInsuranceNumber; + + return $this; + } + + /** + * Gets employmentStartDate + * + * @return \DateTime|null + */ + public function getEmploymentStartDate(): ?\DateTime + { + return $this->container['employmentStartDate']; + } + + /** + * Sets employmentStartDate + * + * @param \DateTime|null $employmentStartDate [readonly] + * + * @return $this + */ + public function setEmploymentStartDate(?\DateTime $employmentStartDate): static + { + if (is_null($employmentStartDate)) { + throw new InvalidArgumentException('non-nullable employmentStartDate cannot be null'); + } + $this->container['employmentStartDate'] = $employmentStartDate; + + return $this; + } + + /** + * Gets maritalStatus + * + * @return \SynergiTech\Staffology\Model\MaritalStatus|null + */ + public function getMaritalStatus(): ?\SynergiTech\Staffology\Model\MaritalStatus + { + return $this->container['maritalStatus']; + } + + /** + * Sets maritalStatus + * + * @param \SynergiTech\Staffology\Model\MaritalStatus|null $maritalStatus maritalStatus + * + * @return $this + */ + public function setMaritalStatus(?\SynergiTech\Staffology\Model\MaritalStatus $maritalStatus): static + { + if (is_null($maritalStatus)) { + throw new InvalidArgumentException('non-nullable maritalStatus cannot be null'); + } + $this->container['maritalStatus'] = $maritalStatus; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeeName.php b/src/Model/PapdisEmployeeName.php new file mode 100644 index 0000000..8baa0c7 --- /dev/null +++ b/src/Model/PapdisEmployeeName.php @@ -0,0 +1,538 @@ + + */ +class PapdisEmployeeName implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeeName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'forename1' => 'string', + 'forename2' => 'string', + 'surname' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'forename1' => null, + 'forename2' => null, + 'surname' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => true, + 'forename1' => true, + 'forename2' => true, + 'surname' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'forename1' => 'forename1', + 'forename2' => 'forename2', + 'surname' => 'surname' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'forename1' => 'setForename1', + 'forename2' => 'setForename2', + 'surname' => 'setSurname' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'forename1' => 'getForename1', + 'forename2' => 'getForename2', + 'surname' => 'getSurname' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('forename1', $data ?? [], null); + $this->setIfExists('forename2', $data ?? [], null); + $this->setIfExists('surname', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets forename1 + * + * @return string|null + */ + public function getForename1(): ?string + { + return $this->container['forename1']; + } + + /** + * Sets forename1 + * + * @param string|null $forename1 [readonly] + * + * @return $this + */ + public function setForename1(?string $forename1): static + { + if (is_null($forename1)) { + array_push($this->openAPINullablesSetToNull, 'forename1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forename1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forename1'] = $forename1; + + return $this; + } + + /** + * Gets forename2 + * + * @return string|null + */ + public function getForename2(): ?string + { + return $this->container['forename2']; + } + + /** + * Sets forename2 + * + * @param string|null $forename2 [readonly] + * + * @return $this + */ + public function setForename2(?string $forename2): static + { + if (is_null($forename2)) { + array_push($this->openAPINullablesSetToNull, 'forename2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forename2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forename2'] = $forename2; + + return $this; + } + + /** + * Gets surname + * + * @return string|null + */ + public function getSurname(): ?string + { + return $this->container['surname']; + } + + /** + * Sets surname + * + * @param string|null $surname [readonly] + * + * @return $this + */ + public function setSurname(?string $surname): static + { + if (is_null($surname)) { + array_push($this->openAPINullablesSetToNull, 'surname'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('surname', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['surname'] = $surname; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployeePay.php b/src/Model/PapdisEmployeePay.php new file mode 100644 index 0000000..bb503cf --- /dev/null +++ b/src/Model/PapdisEmployeePay.php @@ -0,0 +1,585 @@ + + */ +class PapdisEmployeePay implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployeePay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionableEarningsAmount' => 'float', + 'totalGrossQualifyingEarningsAmount' => 'float', + 'annualSalary' => 'float', + 'annualPensionableEarningsAmount' => 'float', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'payAmountMultiplier' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionableEarningsAmount' => 'double', + 'totalGrossQualifyingEarningsAmount' => 'double', + 'annualSalary' => 'double', + 'annualPensionableEarningsAmount' => 'double', + 'basis' => null, + 'payAmountMultiplier' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionableEarningsAmount' => false, + 'totalGrossQualifyingEarningsAmount' => false, + 'annualSalary' => false, + 'annualPensionableEarningsAmount' => false, + 'basis' => false, + 'payAmountMultiplier' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionableEarningsAmount' => 'pensionableEarningsAmount', + 'totalGrossQualifyingEarningsAmount' => 'totalGrossQualifyingEarningsAmount', + 'annualSalary' => 'annualSalary', + 'annualPensionableEarningsAmount' => 'annualPensionableEarningsAmount', + 'basis' => 'basis', + 'payAmountMultiplier' => 'payAmountMultiplier' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionableEarningsAmount' => 'setPensionableEarningsAmount', + 'totalGrossQualifyingEarningsAmount' => 'setTotalGrossQualifyingEarningsAmount', + 'annualSalary' => 'setAnnualSalary', + 'annualPensionableEarningsAmount' => 'setAnnualPensionableEarningsAmount', + 'basis' => 'setBasis', + 'payAmountMultiplier' => 'setPayAmountMultiplier' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionableEarningsAmount' => 'getPensionableEarningsAmount', + 'totalGrossQualifyingEarningsAmount' => 'getTotalGrossQualifyingEarningsAmount', + 'annualSalary' => 'getAnnualSalary', + 'annualPensionableEarningsAmount' => 'getAnnualPensionableEarningsAmount', + 'basis' => 'getBasis', + 'payAmountMultiplier' => 'getPayAmountMultiplier' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionableEarningsAmount', $data ?? [], null); + $this->setIfExists('totalGrossQualifyingEarningsAmount', $data ?? [], null); + $this->setIfExists('annualSalary', $data ?? [], null); + $this->setIfExists('annualPensionableEarningsAmount', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionableEarningsAmount + * + * @return float|null + */ + public function getPensionableEarningsAmount(): ?float + { + return $this->container['pensionableEarningsAmount']; + } + + /** + * Sets pensionableEarningsAmount + * + * @param float|null $pensionableEarningsAmount [readonly] + * + * @return $this + */ + public function setPensionableEarningsAmount(?float $pensionableEarningsAmount): static + { + if (is_null($pensionableEarningsAmount)) { + throw new InvalidArgumentException('non-nullable pensionableEarningsAmount cannot be null'); + } + $this->container['pensionableEarningsAmount'] = $pensionableEarningsAmount; + + return $this; + } + + /** + * Gets totalGrossQualifyingEarningsAmount + * + * @return float|null + */ + public function getTotalGrossQualifyingEarningsAmount(): ?float + { + return $this->container['totalGrossQualifyingEarningsAmount']; + } + + /** + * Sets totalGrossQualifyingEarningsAmount + * + * @param float|null $totalGrossQualifyingEarningsAmount [readonly] + * + * @return $this + */ + public function setTotalGrossQualifyingEarningsAmount(?float $totalGrossQualifyingEarningsAmount): static + { + if (is_null($totalGrossQualifyingEarningsAmount)) { + throw new InvalidArgumentException('non-nullable totalGrossQualifyingEarningsAmount cannot be null'); + } + $this->container['totalGrossQualifyingEarningsAmount'] = $totalGrossQualifyingEarningsAmount; + + return $this; + } + + /** + * Gets annualSalary + * + * @return float|null + */ + public function getAnnualSalary(): ?float + { + return $this->container['annualSalary']; + } + + /** + * Sets annualSalary + * + * @param float|null $annualSalary [readonly] + * + * @return $this + */ + public function setAnnualSalary(?float $annualSalary): static + { + if (is_null($annualSalary)) { + throw new InvalidArgumentException('non-nullable annualSalary cannot be null'); + } + $this->container['annualSalary'] = $annualSalary; + + return $this; + } + + /** + * Gets annualPensionableEarningsAmount + * + * @return float|null + */ + public function getAnnualPensionableEarningsAmount(): ?float + { + return $this->container['annualPensionableEarningsAmount']; + } + + /** + * Sets annualPensionableEarningsAmount + * + * @param float|null $annualPensionableEarningsAmount [readonly] + * + * @return $this + */ + public function setAnnualPensionableEarningsAmount(?float $annualPensionableEarningsAmount): static + { + if (is_null($annualPensionableEarningsAmount)) { + throw new InvalidArgumentException('non-nullable annualPensionableEarningsAmount cannot be null'); + } + $this->container['annualPensionableEarningsAmount'] = $annualPensionableEarningsAmount; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier [readonly] + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + array_push($this->openAPINullablesSetToNull, 'payAmountMultiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payAmountMultiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployer.php b/src/Model/PapdisEmployer.php new file mode 100644 index 0000000..19201d7 --- /dev/null +++ b/src/Model/PapdisEmployer.php @@ -0,0 +1,872 @@ + + */ +class PapdisEmployer implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionRule' => '\SynergiTech\Staffology\Model\PensionRule', + 'employerId' => 'string', + 'group' => 'string', + 'subGroup' => 'string', + 'payrollPeriod' => '\SynergiTech\Staffology\Model\PapdisPayrollPeriod', + 'stagingDate' => '\DateTime', + 'cyclicalReenrolmentDate' => '\DateTime', + 'name' => 'string', + 'postalAddress' => '\SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress', + 'fullTimeContractedHours' => 'float', + 'fullTimeContractedWeeks' => 'float', + 'contractedWeeks' => 'float', + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionRule' => null, + 'employerId' => null, + 'group' => null, + 'subGroup' => null, + 'payrollPeriod' => null, + 'stagingDate' => 'date', + 'cyclicalReenrolmentDate' => 'date', + 'name' => null, + 'postalAddress' => null, + 'fullTimeContractedHours' => 'double', + 'fullTimeContractedWeeks' => 'double', + 'contractedWeeks' => 'double', + 'id' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionRule' => false, + 'employerId' => true, + 'group' => true, + 'subGroup' => true, + 'payrollPeriod' => false, + 'stagingDate' => false, + 'cyclicalReenrolmentDate' => true, + 'name' => true, + 'postalAddress' => false, + 'fullTimeContractedHours' => true, + 'fullTimeContractedWeeks' => true, + 'contractedWeeks' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionRule' => 'pensionRule', + 'employerId' => 'employerId', + 'group' => 'group', + 'subGroup' => 'subGroup', + 'payrollPeriod' => 'payrollPeriod', + 'stagingDate' => 'stagingDate', + 'cyclicalReenrolmentDate' => 'cyclicalReenrolmentDate', + 'name' => 'name', + 'postalAddress' => 'postalAddress', + 'fullTimeContractedHours' => 'fullTimeContractedHours', + 'fullTimeContractedWeeks' => 'fullTimeContractedWeeks', + 'contractedWeeks' => 'contractedWeeks', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionRule' => 'setPensionRule', + 'employerId' => 'setEmployerId', + 'group' => 'setGroup', + 'subGroup' => 'setSubGroup', + 'payrollPeriod' => 'setPayrollPeriod', + 'stagingDate' => 'setStagingDate', + 'cyclicalReenrolmentDate' => 'setCyclicalReenrolmentDate', + 'name' => 'setName', + 'postalAddress' => 'setPostalAddress', + 'fullTimeContractedHours' => 'setFullTimeContractedHours', + 'fullTimeContractedWeeks' => 'setFullTimeContractedWeeks', + 'contractedWeeks' => 'setContractedWeeks', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionRule' => 'getPensionRule', + 'employerId' => 'getEmployerId', + 'group' => 'getGroup', + 'subGroup' => 'getSubGroup', + 'payrollPeriod' => 'getPayrollPeriod', + 'stagingDate' => 'getStagingDate', + 'cyclicalReenrolmentDate' => 'getCyclicalReenrolmentDate', + 'name' => 'getName', + 'postalAddress' => 'getPostalAddress', + 'fullTimeContractedHours' => 'getFullTimeContractedHours', + 'fullTimeContractedWeeks' => 'getFullTimeContractedWeeks', + 'contractedWeeks' => 'getContractedWeeks', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionRule', $data ?? [], null); + $this->setIfExists('employerId', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); + $this->setIfExists('subGroup', $data ?? [], null); + $this->setIfExists('payrollPeriod', $data ?? [], null); + $this->setIfExists('stagingDate', $data ?? [], null); + $this->setIfExists('cyclicalReenrolmentDate', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('postalAddress', $data ?? [], null); + $this->setIfExists('fullTimeContractedHours', $data ?? [], null); + $this->setIfExists('fullTimeContractedWeeks', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionRule + * + * @return \SynergiTech\Staffology\Model\PensionRule|null + */ + public function getPensionRule(): ?\SynergiTech\Staffology\Model\PensionRule + { + return $this->container['pensionRule']; + } + + /** + * Sets pensionRule + * + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule pensionRule + * + * @return $this + */ + public function setPensionRule(?\SynergiTech\Staffology\Model\PensionRule $pensionRule): static + { + if (is_null($pensionRule)) { + throw new InvalidArgumentException('non-nullable pensionRule cannot be null'); + } + $this->container['pensionRule'] = $pensionRule; + + return $this; + } + + /** + * Gets employerId + * + * @return string|null + */ + public function getEmployerId(): ?string + { + return $this->container['employerId']; + } + + /** + * Sets employerId + * + * @param string|null $employerId [readonly] Taken from the papdisEmployerId property of the PensionProvider + * + * @return $this + */ + public function setEmployerId(?string $employerId): static + { + if (is_null($employerId)) { + array_push($this->openAPINullablesSetToNull, 'employerId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerId'] = $employerId; + + return $this; + } + + /** + * Gets group + * + * @return string|null + */ + public function getGroup(): ?string + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param string|null $group [readonly] Taken from the papdisGroup property of the WorkerGroup + * + * @return $this + */ + public function setGroup(?string $group): static + { + if (is_null($group)) { + array_push($this->openAPINullablesSetToNull, 'group'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['group'] = $group; + + return $this; + } + + /** + * Gets subGroup + * + * @return string|null + */ + public function getSubGroup(): ?string + { + return $this->container['subGroup']; + } + + /** + * Sets subGroup + * + * @param string|null $subGroup [readonly] Taken from the papdisSubGroup property of the WorkerGroup + * + * @return $this + */ + public function setSubGroup(?string $subGroup): static + { + if (is_null($subGroup)) { + array_push($this->openAPINullablesSetToNull, 'subGroup'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subGroup', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subGroup'] = $subGroup; + + return $this; + } + + /** + * Gets payrollPeriod + * + * @return \SynergiTech\Staffology\Model\PapdisPayrollPeriod|null + */ + public function getPayrollPeriod(): ?\SynergiTech\Staffology\Model\PapdisPayrollPeriod + { + return $this->container['payrollPeriod']; + } + + /** + * Sets payrollPeriod + * + * @param \SynergiTech\Staffology\Model\PapdisPayrollPeriod|null $payrollPeriod payrollPeriod + * + * @return $this + */ + public function setPayrollPeriod(?\SynergiTech\Staffology\Model\PapdisPayrollPeriod $payrollPeriod): static + { + if (is_null($payrollPeriod)) { + throw new InvalidArgumentException('non-nullable payrollPeriod cannot be null'); + } + $this->container['payrollPeriod'] = $payrollPeriod; + + return $this; + } + + /** + * Gets stagingDate + * + * @return \DateTime|null + */ + public function getStagingDate(): ?\DateTime + { + return $this->container['stagingDate']; + } + + /** + * Sets stagingDate + * + * @param \DateTime|null $stagingDate [readonly] + * + * @return $this + */ + public function setStagingDate(?\DateTime $stagingDate): static + { + if (is_null($stagingDate)) { + throw new InvalidArgumentException('non-nullable stagingDate cannot be null'); + } + $this->container['stagingDate'] = $stagingDate; + + return $this; + } + + /** + * Gets cyclicalReenrolmentDate + * + * @return \DateTime|null + */ + public function getCyclicalReenrolmentDate(): ?\DateTime + { + return $this->container['cyclicalReenrolmentDate']; + } + + /** + * Sets cyclicalReenrolmentDate + * + * @param \DateTime|null $cyclicalReenrolmentDate [readonly] + * + * @return $this + */ + public function setCyclicalReenrolmentDate(?\DateTime $cyclicalReenrolmentDate): static + { + if (is_null($cyclicalReenrolmentDate)) { + array_push($this->openAPINullablesSetToNull, 'cyclicalReenrolmentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cyclicalReenrolmentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cyclicalReenrolmentDate'] = $cyclicalReenrolmentDate; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name [readonly] + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets postalAddress + * + * @return \SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress|null + */ + public function getPostalAddress(): ?\SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress + { + return $this->container['postalAddress']; + } + + /** + * Sets postalAddress + * + * @param \SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress|null $postalAddress postalAddress + * + * @return $this + */ + public function setPostalAddress(?\SynergiTech\Staffology\Model\PapdisEmployerContactPostalAddress $postalAddress): static + { + if (is_null($postalAddress)) { + throw new InvalidArgumentException('non-nullable postalAddress cannot be null'); + } + $this->container['postalAddress'] = $postalAddress; + + return $this; + } + + /** + * Gets fullTimeContractedHours + * + * @return float|null + */ + public function getFullTimeContractedHours(): ?float + { + return $this->container['fullTimeContractedHours']; + } + + /** + * Sets fullTimeContractedHours + * + * @param float|null $fullTimeContractedHours [readonly] + * + * @return $this + */ + public function setFullTimeContractedHours(?float $fullTimeContractedHours): static + { + if (is_null($fullTimeContractedHours)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedHours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedHours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedHours'] = $fullTimeContractedHours; + + return $this; + } + + /** + * Gets fullTimeContractedWeeks + * + * @return float|null + */ + public function getFullTimeContractedWeeks(): ?float + { + return $this->container['fullTimeContractedWeeks']; + } + + /** + * Sets fullTimeContractedWeeks + * + * @param float|null $fullTimeContractedWeeks [readonly] + * + * @return $this + */ + public function setFullTimeContractedWeeks(?float $fullTimeContractedWeeks): static + { + if (is_null($fullTimeContractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedWeeks'] = $fullTimeContractedWeeks; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks [readonly] + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'contractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId(): ?int + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id [readonly] + * + * @return $this + */ + public function setId(?int $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisEmployerContactPostalAddress.php b/src/Model/PapdisEmployerContactPostalAddress.php new file mode 100644 index 0000000..564f4a1 --- /dev/null +++ b/src/Model/PapdisEmployerContactPostalAddress.php @@ -0,0 +1,620 @@ + + */ +class PapdisEmployerContactPostalAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisEmployerContactPostalAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'address1' => 'string', + 'address2' => 'string', + 'address3' => 'string', + 'address4' => 'string', + 'postcode' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'address1' => null, + 'address2' => null, + 'address3' => null, + 'address4' => null, + 'postcode' => null, + 'country' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'address1' => true, + 'address2' => true, + 'address3' => true, + 'address4' => true, + 'postcode' => true, + 'country' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'address1' => 'address1', + 'address2' => 'address2', + 'address3' => 'address3', + 'address4' => 'address4', + 'postcode' => 'postcode', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'address1' => 'setAddress1', + 'address2' => 'setAddress2', + 'address3' => 'setAddress3', + 'address4' => 'setAddress4', + 'postcode' => 'setPostcode', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'address1' => 'getAddress1', + 'address2' => 'getAddress2', + 'address3' => 'getAddress3', + 'address4' => 'getAddress4', + 'postcode' => 'getPostcode', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('address3', $data ?? [], null); + $this->setIfExists('address4', $data ?? [], null); + $this->setIfExists('postcode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address1 + * + * @return string|null + */ + public function getAddress1(): ?string + { + return $this->container['address1']; + } + + /** + * Sets address1 + * + * @param string|null $address1 [readonly] + * + * @return $this + */ + public function setAddress1(?string $address1): static + { + if (is_null($address1)) { + array_push($this->openAPINullablesSetToNull, 'address1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address1'] = $address1; + + return $this; + } + + /** + * Gets address2 + * + * @return string|null + */ + public function getAddress2(): ?string + { + return $this->container['address2']; + } + + /** + * Sets address2 + * + * @param string|null $address2 [readonly] + * + * @return $this + */ + public function setAddress2(?string $address2): static + { + if (is_null($address2)) { + array_push($this->openAPINullablesSetToNull, 'address2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address2'] = $address2; + + return $this; + } + + /** + * Gets address3 + * + * @return string|null + */ + public function getAddress3(): ?string + { + return $this->container['address3']; + } + + /** + * Sets address3 + * + * @param string|null $address3 [readonly] + * + * @return $this + */ + public function setAddress3(?string $address3): static + { + if (is_null($address3)) { + array_push($this->openAPINullablesSetToNull, 'address3'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address3', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address3'] = $address3; + + return $this; + } + + /** + * Gets address4 + * + * @return string|null + */ + public function getAddress4(): ?string + { + return $this->container['address4']; + } + + /** + * Sets address4 + * + * @param string|null $address4 [readonly] + * + * @return $this + */ + public function setAddress4(?string $address4): static + { + if (is_null($address4)) { + array_push($this->openAPINullablesSetToNull, 'address4'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address4', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address4'] = $address4; + + return $this; + } + + /** + * Gets postcode + * + * @return string|null + */ + public function getPostcode(): ?string + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string|null $postcode [readonly] + * + * @return $this + */ + public function setPostcode(?string $postcode): static + { + if (is_null($postcode)) { + array_push($this->openAPINullablesSetToNull, 'postcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postcode'] = $postcode; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry(): ?string + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country [readonly] + * + * @return $this + */ + public function setCountry(?string $country): static + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisMessageFunctionCode.php b/src/Model/PapdisMessageFunctionCode.php new file mode 100644 index 0000000..0314e43 --- /dev/null +++ b/src/Model/PapdisMessageFunctionCode.php @@ -0,0 +1,51 @@ + + */ +class PapdisPayrollPeriod implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisPayrollPeriod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payPeriodStartDate' => '\DateTime', + 'payPeriodEndDate' => '\DateTime', + 'contributionDeductionDate' => '\DateTime', + 'frequencyCode' => 'string', + 'taxPeriod' => 'int', + 'payReferenceStartDate' => '\DateTime', + 'payReferenceEndDate' => '\DateTime', + 'employees' => '\SynergiTech\Staffology\Model\PapdisEmployee[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payPeriodStartDate' => 'date', + 'payPeriodEndDate' => 'date', + 'contributionDeductionDate' => 'date', + 'frequencyCode' => null, + 'taxPeriod' => 'int32', + 'payReferenceStartDate' => 'date', + 'payReferenceEndDate' => 'date', + 'employees' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payPeriodStartDate' => false, + 'payPeriodEndDate' => false, + 'contributionDeductionDate' => false, + 'frequencyCode' => true, + 'taxPeriod' => false, + 'payReferenceStartDate' => false, + 'payReferenceEndDate' => false, + 'employees' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payPeriodStartDate' => 'payPeriodStartDate', + 'payPeriodEndDate' => 'payPeriodEndDate', + 'contributionDeductionDate' => 'contributionDeductionDate', + 'frequencyCode' => 'frequencyCode', + 'taxPeriod' => 'taxPeriod', + 'payReferenceStartDate' => 'payReferenceStartDate', + 'payReferenceEndDate' => 'payReferenceEndDate', + 'employees' => 'employees' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payPeriodStartDate' => 'setPayPeriodStartDate', + 'payPeriodEndDate' => 'setPayPeriodEndDate', + 'contributionDeductionDate' => 'setContributionDeductionDate', + 'frequencyCode' => 'setFrequencyCode', + 'taxPeriod' => 'setTaxPeriod', + 'payReferenceStartDate' => 'setPayReferenceStartDate', + 'payReferenceEndDate' => 'setPayReferenceEndDate', + 'employees' => 'setEmployees' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payPeriodStartDate' => 'getPayPeriodStartDate', + 'payPeriodEndDate' => 'getPayPeriodEndDate', + 'contributionDeductionDate' => 'getContributionDeductionDate', + 'frequencyCode' => 'getFrequencyCode', + 'taxPeriod' => 'getTaxPeriod', + 'payReferenceStartDate' => 'getPayReferenceStartDate', + 'payReferenceEndDate' => 'getPayReferenceEndDate', + 'employees' => 'getEmployees' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payPeriodStartDate', $data ?? [], null); + $this->setIfExists('payPeriodEndDate', $data ?? [], null); + $this->setIfExists('contributionDeductionDate', $data ?? [], null); + $this->setIfExists('frequencyCode', $data ?? [], null); + $this->setIfExists('taxPeriod', $data ?? [], null); + $this->setIfExists('payReferenceStartDate', $data ?? [], null); + $this->setIfExists('payReferenceEndDate', $data ?? [], null); + $this->setIfExists('employees', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payPeriodStartDate + * + * @return \DateTime|null + */ + public function getPayPeriodStartDate(): ?\DateTime + { + return $this->container['payPeriodStartDate']; + } + + /** + * Sets payPeriodStartDate + * + * @param \DateTime|null $payPeriodStartDate [readonly] + * + * @return $this + */ + public function setPayPeriodStartDate(?\DateTime $payPeriodStartDate): static + { + if (is_null($payPeriodStartDate)) { + throw new InvalidArgumentException('non-nullable payPeriodStartDate cannot be null'); + } + $this->container['payPeriodStartDate'] = $payPeriodStartDate; + + return $this; + } + + /** + * Gets payPeriodEndDate + * + * @return \DateTime|null + */ + public function getPayPeriodEndDate(): ?\DateTime + { + return $this->container['payPeriodEndDate']; + } + + /** + * Sets payPeriodEndDate + * + * @param \DateTime|null $payPeriodEndDate [readonly] + * + * @return $this + */ + public function setPayPeriodEndDate(?\DateTime $payPeriodEndDate): static + { + if (is_null($payPeriodEndDate)) { + throw new InvalidArgumentException('non-nullable payPeriodEndDate cannot be null'); + } + $this->container['payPeriodEndDate'] = $payPeriodEndDate; + + return $this; + } + + /** + * Gets contributionDeductionDate + * + * @return \DateTime|null + */ + public function getContributionDeductionDate(): ?\DateTime + { + return $this->container['contributionDeductionDate']; + } + + /** + * Sets contributionDeductionDate + * + * @param \DateTime|null $contributionDeductionDate [readonly] + * + * @return $this + */ + public function setContributionDeductionDate(?\DateTime $contributionDeductionDate): static + { + if (is_null($contributionDeductionDate)) { + throw new InvalidArgumentException('non-nullable contributionDeductionDate cannot be null'); + } + $this->container['contributionDeductionDate'] = $contributionDeductionDate; + + return $this; + } + + /** + * Gets frequencyCode + * + * @return string|null + */ + public function getFrequencyCode(): ?string + { + return $this->container['frequencyCode']; + } + + /** + * Sets frequencyCode + * + * @param string|null $frequencyCode [readonly] + * + * @return $this + */ + public function setFrequencyCode(?string $frequencyCode): static + { + if (is_null($frequencyCode)) { + array_push($this->openAPINullablesSetToNull, 'frequencyCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('frequencyCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['frequencyCode'] = $frequencyCode; + + return $this; + } + + /** + * Gets taxPeriod + * + * @return int|null + */ + public function getTaxPeriod(): ?int + { + return $this->container['taxPeriod']; + } + + /** + * Sets taxPeriod + * + * @param int|null $taxPeriod [readonly] + * + * @return $this + */ + public function setTaxPeriod(?int $taxPeriod): static + { + if (is_null($taxPeriod)) { + throw new InvalidArgumentException('non-nullable taxPeriod cannot be null'); + } + $this->container['taxPeriod'] = $taxPeriod; + + return $this; + } + + /** + * Gets payReferenceStartDate + * + * @return \DateTime|null + */ + public function getPayReferenceStartDate(): ?\DateTime + { + return $this->container['payReferenceStartDate']; + } + + /** + * Sets payReferenceStartDate + * + * @param \DateTime|null $payReferenceStartDate [readonly] + * + * @return $this + */ + public function setPayReferenceStartDate(?\DateTime $payReferenceStartDate): static + { + if (is_null($payReferenceStartDate)) { + throw new InvalidArgumentException('non-nullable payReferenceStartDate cannot be null'); + } + $this->container['payReferenceStartDate'] = $payReferenceStartDate; + + return $this; + } + + /** + * Gets payReferenceEndDate + * + * @return \DateTime|null + */ + public function getPayReferenceEndDate(): ?\DateTime + { + return $this->container['payReferenceEndDate']; + } + + /** + * Sets payReferenceEndDate + * + * @param \DateTime|null $payReferenceEndDate [readonly] + * + * @return $this + */ + public function setPayReferenceEndDate(?\DateTime $payReferenceEndDate): static + { + if (is_null($payReferenceEndDate)) { + throw new InvalidArgumentException('non-nullable payReferenceEndDate cannot be null'); + } + $this->container['payReferenceEndDate'] = $payReferenceEndDate; + + return $this; + } + + /** + * Gets employees + * + * @return \SynergiTech\Staffology\Model\PapdisEmployee[]|null + */ + public function getEmployees(): ?array + { + return $this->container['employees']; + } + + /** + * Sets employees + * + * @param \SynergiTech\Staffology\Model\PapdisEmployee[]|null $employees [readonly] Employees and contributions made in this period + * + * @return $this + */ + public function setEmployees(?array $employees): static + { + if (is_null($employees)) { + array_push($this->openAPINullablesSetToNull, 'employees'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employees', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employees'] = $employees; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisPensionProvider.php b/src/Model/PapdisPensionProvider.php new file mode 100644 index 0000000..6261cbd --- /dev/null +++ b/src/Model/PapdisPensionProvider.php @@ -0,0 +1,497 @@ + + */ +class PapdisPensionProvider implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PapdisPensionProvider'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionProviderId' => 'string', + 'employers' => '\SynergiTech\Staffology\Model\PapdisEmployer[]', + 'accountNo' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionProviderId' => null, + 'employers' => null, + 'accountNo' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionProviderId' => true, + 'employers' => true, + 'accountNo' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionProviderId' => 'pensionProviderId', + 'employers' => 'employers', + 'accountNo' => 'accountNo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionProviderId' => 'setPensionProviderId', + 'employers' => 'setEmployers', + 'accountNo' => 'setAccountNo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionProviderId' => 'getPensionProviderId', + 'employers' => 'getEmployers', + 'accountNo' => 'getAccountNo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionProviderId', $data ?? [], null); + $this->setIfExists('employers', $data ?? [], null); + $this->setIfExists('accountNo', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionProviderId + * + * @return string|null + */ + public function getPensionProviderId(): ?string + { + return $this->container['pensionProviderId']; + } + + /** + * Sets pensionProviderId + * + * @param string|null $pensionProviderId [readonly] Taken from the papdisProviderId property of the PensionProvider + * + * @return $this + */ + public function setPensionProviderId(?string $pensionProviderId): static + { + if (is_null($pensionProviderId)) { + array_push($this->openAPINullablesSetToNull, 'pensionProviderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionProviderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionProviderId'] = $pensionProviderId; + + return $this; + } + + /** + * Gets employers + * + * @return \SynergiTech\Staffology\Model\PapdisEmployer[]|null + */ + public function getEmployers(): ?array + { + return $this->container['employers']; + } + + /** + * Sets employers + * + * @param \SynergiTech\Staffology\Model\PapdisEmployer[]|null $employers employers + * + * @return $this + */ + public function setEmployers(?array $employers): static + { + if (is_null($employers)) { + array_push($this->openAPINullablesSetToNull, 'employers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employers'] = $employers; + + return $this; + } + + /** + * Gets accountNo + * + * @return string|null + */ + public function getAccountNo(): ?string + { + return $this->container['accountNo']; + } + + /** + * Sets accountNo + * + * @param string|null $accountNo [readonly] + * + * @return $this + */ + public function setAccountNo(?string $accountNo): static + { + if (is_null($accountNo)) { + array_push($this->openAPINullablesSetToNull, 'accountNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountNo'] = $accountNo; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PapdisVersion.php b/src/Model/PapdisVersion.php new file mode 100644 index 0000000..12073dc --- /dev/null +++ b/src/Model/PapdisVersion.php @@ -0,0 +1,45 @@ + + */ +class PartnerDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PartnerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'firstName' => 'string', + 'initials' => 'string', + 'lastName' => 'string', + 'niNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'firstName' => null, + 'initials' => null, + 'lastName' => null, + 'niNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'firstName' => true, + 'initials' => true, + 'lastName' => true, + 'niNumber' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'firstName' => 'firstName', + 'initials' => 'initials', + 'lastName' => 'lastName', + 'niNumber' => 'niNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'firstName' => 'setFirstName', + 'initials' => 'setInitials', + 'lastName' => 'setLastName', + 'niNumber' => 'setNiNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'firstName' => 'getFirstName', + 'initials' => 'getInitials', + 'lastName' => 'getLastName', + 'niNumber' => 'getNiNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('initials', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 35)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['initials']) && (mb_strlen($this->container['initials']) > 30)) { + $invalidProperties[] = "invalid value for 'initials', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 35)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['niNumber']) && (mb_strlen($this->container['niNumber']) > 15)) { + $invalidProperties[] = "invalid value for 'niNumber', the character length must be smaller than or equal to 15."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 35)) { + throw new InvalidArgumentException('invalid length for $firstName when calling PartnerDetails., must be smaller than or equal to 35.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets initials + * + * @return string|null + */ + public function getInitials(): ?string + { + return $this->container['initials']; + } + + /** + * Sets initials + * + * @param string|null $initials initials + * + * @return $this + */ + public function setInitials(?string $initials): static + { + if (is_null($initials)) { + array_push($this->openAPINullablesSetToNull, 'initials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($initials) && (mb_strlen($initials) > 30)) { + throw new InvalidArgumentException('invalid length for $initials when calling PartnerDetails., must be smaller than or equal to 30.'); + } + + $this->container['initials'] = $initials; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 35)) { + throw new InvalidArgumentException('invalid length for $lastName when calling PartnerDetails., must be smaller than or equal to 35.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($niNumber) && (mb_strlen($niNumber) > 15)) { + throw new InvalidArgumentException('invalid length for $niNumber when calling PartnerDetails., must be smaller than or equal to 15.'); + } + + $this->container['niNumber'] = $niNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayBasis.php b/src/Model/PayBasis.php new file mode 100644 index 0000000..8dbb952 --- /dev/null +++ b/src/Model/PayBasis.php @@ -0,0 +1,47 @@ + + */ +class PayCode implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayCode'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'code' => 'string', + 'defaultValue' => 'float', + 'isDeduction' => 'bool', + 'isNiable' => 'bool', + 'isTaxable' => 'bool', + 'isPensionable' => 'bool', + 'isAttachable' => 'bool', + 'isRealTimeClass1aNiable' => 'bool', + 'isNotContributingToHolidayPay' => 'bool', + 'isQualifyingEarningsForAe' => 'bool', + 'isNotTierable' => 'bool', + 'isTcpTcls' => 'bool', + 'isTcpPp' => 'bool', + 'isTcpOp' => 'bool', + 'flexibleDrawdown' => '\SynergiTech\Staffology\Model\FlexibleDrawdown', + 'isAutoAdjust' => 'bool', + 'calculationType' => '\SynergiTech\Staffology\Model\PayCodeCalculationType', + 'multiplierType' => '\SynergiTech\Staffology\Model\PayCodeMultiplierType', + 'dailyRateMultiplier' => 'float', + 'hourlyRateMultiplier' => 'float', + 'isSystemCode' => 'bool', + 'isControlCode' => 'bool', + 'isNotional' => 'bool', + 'payee' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'code' => null, + 'defaultValue' => 'double', + 'isDeduction' => null, + 'isNiable' => null, + 'isTaxable' => null, + 'isPensionable' => null, + 'isAttachable' => null, + 'isRealTimeClass1aNiable' => null, + 'isNotContributingToHolidayPay' => null, + 'isQualifyingEarningsForAe' => null, + 'isNotTierable' => null, + 'isTcpTcls' => null, + 'isTcpPp' => null, + 'isTcpOp' => null, + 'flexibleDrawdown' => null, + 'isAutoAdjust' => null, + 'calculationType' => null, + 'multiplierType' => null, + 'dailyRateMultiplier' => 'double', + 'hourlyRateMultiplier' => 'double', + 'isSystemCode' => null, + 'isControlCode' => null, + 'isNotional' => null, + 'payee' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => false, + 'code' => false, + 'defaultValue' => true, + 'isDeduction' => false, + 'isNiable' => false, + 'isTaxable' => false, + 'isPensionable' => false, + 'isAttachable' => false, + 'isRealTimeClass1aNiable' => false, + 'isNotContributingToHolidayPay' => false, + 'isQualifyingEarningsForAe' => true, + 'isNotTierable' => false, + 'isTcpTcls' => false, + 'isTcpPp' => false, + 'isTcpOp' => false, + 'flexibleDrawdown' => false, + 'isAutoAdjust' => false, + 'calculationType' => false, + 'multiplierType' => false, + 'dailyRateMultiplier' => false, + 'hourlyRateMultiplier' => false, + 'isSystemCode' => false, + 'isControlCode' => false, + 'isNotional' => false, + 'payee' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'code' => 'code', + 'defaultValue' => 'defaultValue', + 'isDeduction' => 'isDeduction', + 'isNiable' => 'isNiable', + 'isTaxable' => 'isTaxable', + 'isPensionable' => 'isPensionable', + 'isAttachable' => 'isAttachable', + 'isRealTimeClass1aNiable' => 'isRealTimeClass1aNiable', + 'isNotContributingToHolidayPay' => 'isNotContributingToHolidayPay', + 'isQualifyingEarningsForAe' => 'isQualifyingEarningsForAe', + 'isNotTierable' => 'isNotTierable', + 'isTcpTcls' => 'isTcp_Tcls', + 'isTcpPp' => 'isTcp_Pp', + 'isTcpOp' => 'isTcp_Op', + 'flexibleDrawdown' => 'flexibleDrawdown', + 'isAutoAdjust' => 'isAutoAdjust', + 'calculationType' => 'calculationType', + 'multiplierType' => 'multiplierType', + 'dailyRateMultiplier' => 'dailyRateMultiplier', + 'hourlyRateMultiplier' => 'hourlyRateMultiplier', + 'isSystemCode' => 'isSystemCode', + 'isControlCode' => 'isControlCode', + 'isNotional' => 'isNotional', + 'payee' => 'payee' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'code' => 'setCode', + 'defaultValue' => 'setDefaultValue', + 'isDeduction' => 'setIsDeduction', + 'isNiable' => 'setIsNiable', + 'isTaxable' => 'setIsTaxable', + 'isPensionable' => 'setIsPensionable', + 'isAttachable' => 'setIsAttachable', + 'isRealTimeClass1aNiable' => 'setIsRealTimeClass1aNiable', + 'isNotContributingToHolidayPay' => 'setIsNotContributingToHolidayPay', + 'isQualifyingEarningsForAe' => 'setIsQualifyingEarningsForAe', + 'isNotTierable' => 'setIsNotTierable', + 'isTcpTcls' => 'setIsTcpTcls', + 'isTcpPp' => 'setIsTcpPp', + 'isTcpOp' => 'setIsTcpOp', + 'flexibleDrawdown' => 'setFlexibleDrawdown', + 'isAutoAdjust' => 'setIsAutoAdjust', + 'calculationType' => 'setCalculationType', + 'multiplierType' => 'setMultiplierType', + 'dailyRateMultiplier' => 'setDailyRateMultiplier', + 'hourlyRateMultiplier' => 'setHourlyRateMultiplier', + 'isSystemCode' => 'setIsSystemCode', + 'isControlCode' => 'setIsControlCode', + 'isNotional' => 'setIsNotional', + 'payee' => 'setPayee' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'code' => 'getCode', + 'defaultValue' => 'getDefaultValue', + 'isDeduction' => 'getIsDeduction', + 'isNiable' => 'getIsNiable', + 'isTaxable' => 'getIsTaxable', + 'isPensionable' => 'getIsPensionable', + 'isAttachable' => 'getIsAttachable', + 'isRealTimeClass1aNiable' => 'getIsRealTimeClass1aNiable', + 'isNotContributingToHolidayPay' => 'getIsNotContributingToHolidayPay', + 'isQualifyingEarningsForAe' => 'getIsQualifyingEarningsForAe', + 'isNotTierable' => 'getIsNotTierable', + 'isTcpTcls' => 'getIsTcpTcls', + 'isTcpPp' => 'getIsTcpPp', + 'isTcpOp' => 'getIsTcpOp', + 'flexibleDrawdown' => 'getFlexibleDrawdown', + 'isAutoAdjust' => 'getIsAutoAdjust', + 'calculationType' => 'getCalculationType', + 'multiplierType' => 'getMultiplierType', + 'dailyRateMultiplier' => 'getDailyRateMultiplier', + 'hourlyRateMultiplier' => 'getHourlyRateMultiplier', + 'isSystemCode' => 'getIsSystemCode', + 'isControlCode' => 'getIsControlCode', + 'isNotional' => 'getIsNotional', + 'payee' => 'getPayee' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('defaultValue', $data ?? [], null); + $this->setIfExists('isDeduction', $data ?? [], null); + $this->setIfExists('isNiable', $data ?? [], null); + $this->setIfExists('isTaxable', $data ?? [], null); + $this->setIfExists('isPensionable', $data ?? [], null); + $this->setIfExists('isAttachable', $data ?? [], null); + $this->setIfExists('isRealTimeClass1aNiable', $data ?? [], null); + $this->setIfExists('isNotContributingToHolidayPay', $data ?? [], null); + $this->setIfExists('isQualifyingEarningsForAe', $data ?? [], null); + $this->setIfExists('isNotTierable', $data ?? [], null); + $this->setIfExists('isTcpTcls', $data ?? [], null); + $this->setIfExists('isTcpPp', $data ?? [], null); + $this->setIfExists('isTcpOp', $data ?? [], null); + $this->setIfExists('flexibleDrawdown', $data ?? [], null); + $this->setIfExists('isAutoAdjust', $data ?? [], null); + $this->setIfExists('calculationType', $data ?? [], null); + $this->setIfExists('multiplierType', $data ?? [], null); + $this->setIfExists('dailyRateMultiplier', $data ?? [], null); + $this->setIfExists('hourlyRateMultiplier', $data ?? [], null); + $this->setIfExists('isSystemCode', $data ?? [], null); + $this->setIfExists('isControlCode', $data ?? [], null); + $this->setIfExists('isNotional', $data ?? [], null); + $this->setIfExists('payee', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 100)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 100)) { + throw new InvalidArgumentException('invalid length for $title when calling PayCode., must be smaller than or equal to 100.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling PayCode., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling PayCode., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling PayCode., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets defaultValue + * + * @return float|null + */ + public function getDefaultValue(): ?float + { + return $this->container['defaultValue']; + } + + /** + * Sets defaultValue + * + * @param float|null $defaultValue If a non-zero value is provided then when this code is selected in our UI the value will be automatically filled. + * + * @return $this + */ + public function setDefaultValue(?float $defaultValue): static + { + if (is_null($defaultValue)) { + array_push($this->openAPINullablesSetToNull, 'defaultValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('defaultValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['defaultValue'] = $defaultValue; + + return $this; + } + + /** + * Gets isDeduction + * + * @return bool|null + */ + public function getIsDeduction(): ?bool + { + return $this->container['isDeduction']; + } + + /** + * Sets isDeduction + * + * @param bool|null $isDeduction If set to true then a PayLine using this code will be treated as a deduction as opposed to an addition. + * + * @return $this + */ + public function setIsDeduction(?bool $isDeduction): static + { + if (is_null($isDeduction)) { + throw new InvalidArgumentException('non-nullable isDeduction cannot be null'); + } + $this->container['isDeduction'] = $isDeduction; + + return $this; + } + + /** + * Gets isNiable + * + * @return bool|null + */ + public function getIsNiable(): ?bool + { + return $this->container['isNiable']; + } + + /** + * Sets isNiable + * + * @param bool|null $isNiable Determines whether or not the value of PayLines using this code should be taken into consideration when calculating National Insurance Contributions. + * + * @return $this + */ + public function setIsNiable(?bool $isNiable): static + { + if (is_null($isNiable)) { + throw new InvalidArgumentException('non-nullable isNiable cannot be null'); + } + $this->container['isNiable'] = $isNiable; + + return $this; + } + + /** + * Gets isTaxable + * + * @return bool|null + */ + public function getIsTaxable(): ?bool + { + return $this->container['isTaxable']; + } + + /** + * Sets isTaxable + * + * @param bool|null $isTaxable Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the PAYE liability. + * + * @return $this + */ + public function setIsTaxable(?bool $isTaxable): static + { + if (is_null($isTaxable)) { + throw new InvalidArgumentException('non-nullable isTaxable cannot be null'); + } + $this->container['isTaxable'] = $isTaxable; + + return $this; + } + + /** + * Gets isPensionable + * + * @return bool|null + */ + public function getIsPensionable(): ?bool + { + return $this->container['isPensionable']; + } + + /** + * Sets isPensionable + * + * @param bool|null $isPensionable Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the total pensionable pay. + * + * @return $this + */ + public function setIsPensionable(?bool $isPensionable): static + { + if (is_null($isPensionable)) { + throw new InvalidArgumentException('non-nullable isPensionable cannot be null'); + } + $this->container['isPensionable'] = $isPensionable; + + return $this; + } + + /** + * Gets isAttachable + * + * @return bool|null + */ + public function getIsAttachable(): ?bool + { + return $this->container['isAttachable']; + } + + /** + * Sets isAttachable + * + * @param bool|null $isAttachable Determines whether or not the value of PayLines using this code should be taken into consideration when calculating the attachable pay for AttachmentOrders. + * + * @return $this + */ + public function setIsAttachable(?bool $isAttachable): static + { + if (is_null($isAttachable)) { + throw new InvalidArgumentException('non-nullable isAttachable cannot be null'); + } + $this->container['isAttachable'] = $isAttachable; + + return $this; + } + + /** + * Gets isRealTimeClass1aNiable + * + * @return bool|null + */ + public function getIsRealTimeClass1aNiable(): ?bool + { + return $this->container['isRealTimeClass1aNiable']; + } + + /** + * Sets isRealTimeClass1aNiable + * + * @param bool|null $isRealTimeClass1aNiable Determines whether or not the value of PayLines using this code are subject to real time Class 1A NIC. + * + * @return $this + */ + public function setIsRealTimeClass1aNiable(?bool $isRealTimeClass1aNiable): static + { + if (is_null($isRealTimeClass1aNiable)) { + throw new InvalidArgumentException('non-nullable isRealTimeClass1aNiable cannot be null'); + } + $this->container['isRealTimeClass1aNiable'] = $isRealTimeClass1aNiable; + + return $this; + } + + /** + * Gets isNotContributingToHolidayPay + * + * @return bool|null + */ + public function getIsNotContributingToHolidayPay(): ?bool + { + return $this->container['isNotContributingToHolidayPay']; + } + + /** + * Sets isNotContributingToHolidayPay + * + * @param bool|null $isNotContributingToHolidayPay If true then any payments made using this code will not contribute towards holiday pay calculations. + * + * @return $this + */ + public function setIsNotContributingToHolidayPay(?bool $isNotContributingToHolidayPay): static + { + if (is_null($isNotContributingToHolidayPay)) { + throw new InvalidArgumentException('non-nullable isNotContributingToHolidayPay cannot be null'); + } + $this->container['isNotContributingToHolidayPay'] = $isNotContributingToHolidayPay; + + return $this; + } + + /** + * Gets isQualifyingEarningsForAe + * + * @return bool|null + */ + public function getIsQualifyingEarningsForAe(): ?bool + { + return $this->container['isQualifyingEarningsForAe']; + } + + /** + * Sets isQualifyingEarningsForAe + * + * @param bool|null $isQualifyingEarningsForAe If true then any payments made using this code will be used as the basis for calculating QualifyingEarnings for AutoEnrolment assessments. If it is set to null then when it's next retrieved it'll have the same value as PensionablePay + * + * @return $this + */ + public function setIsQualifyingEarningsForAe(?bool $isQualifyingEarningsForAe): static + { + if (is_null($isQualifyingEarningsForAe)) { + array_push($this->openAPINullablesSetToNull, 'isQualifyingEarningsForAe'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('isQualifyingEarningsForAe', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['isQualifyingEarningsForAe'] = $isQualifyingEarningsForAe; + + return $this; + } + + /** + * Gets isNotTierable + * + * @return bool|null + */ + public function getIsNotTierable(): ?bool + { + return $this->container['isNotTierable']; + } + + /** + * Sets isNotTierable + * + * @param bool|null $isNotTierable If true then any payments made using this code will not be included when calculating the tier an employee should be on for a Tiered Pension. + * + * @return $this + */ + public function setIsNotTierable(?bool $isNotTierable): static + { + if (is_null($isNotTierable)) { + throw new InvalidArgumentException('non-nullable isNotTierable cannot be null'); + } + $this->container['isNotTierable'] = $isNotTierable; + + return $this; + } + + /** + * Gets isTcpTcls + * + * @return bool|null + */ + public function getIsTcpTcls(): ?bool + { + return $this->container['isTcpTcls']; + } + + /** + * Sets isTcpTcls + * + * @param bool|null $isTcpTcls If true then any payments made using this code will be reported as a Trivial Commutation Payment (A - TCLS) + * + * @return $this + */ + public function setIsTcpTcls(?bool $isTcpTcls): static + { + if (is_null($isTcpTcls)) { + throw new InvalidArgumentException('non-nullable isTcpTcls cannot be null'); + } + $this->container['isTcpTcls'] = $isTcpTcls; + + return $this; + } + + /** + * Gets isTcpPp + * + * @return bool|null + */ + public function getIsTcpPp(): ?bool + { + return $this->container['isTcpPp']; + } + + /** + * Sets isTcpPp + * + * @param bool|null $isTcpPp If true then any payments made using this code will be reported as a Trivial Commutation Payment (B - Personal Pension) + * + * @return $this + */ + public function setIsTcpPp(?bool $isTcpPp): static + { + if (is_null($isTcpPp)) { + throw new InvalidArgumentException('non-nullable isTcpPp cannot be null'); + } + $this->container['isTcpPp'] = $isTcpPp; + + return $this; + } + + /** + * Gets isTcpOp + * + * @return bool|null + */ + public function getIsTcpOp(): ?bool + { + return $this->container['isTcpOp']; + } + + /** + * Sets isTcpOp + * + * @param bool|null $isTcpOp If true then any payments made using this code will be reported as a Trivial Commutation Payment (C - Occupational Pension) + * + * @return $this + */ + public function setIsTcpOp(?bool $isTcpOp): static + { + if (is_null($isTcpOp)) { + throw new InvalidArgumentException('non-nullable isTcpOp cannot be null'); + } + $this->container['isTcpOp'] = $isTcpOp; + + return $this; + } + + /** + * Gets flexibleDrawdown + * + * @return \SynergiTech\Staffology\Model\FlexibleDrawdown|null + */ + public function getFlexibleDrawdown(): ?\SynergiTech\Staffology\Model\FlexibleDrawdown + { + return $this->container['flexibleDrawdown']; + } + + /** + * Sets flexibleDrawdown + * + * @param \SynergiTech\Staffology\Model\FlexibleDrawdown|null $flexibleDrawdown flexibleDrawdown + * + * @return $this + */ + public function setFlexibleDrawdown(?\SynergiTech\Staffology\Model\FlexibleDrawdown $flexibleDrawdown): static + { + if (is_null($flexibleDrawdown)) { + throw new InvalidArgumentException('non-nullable flexibleDrawdown cannot be null'); + } + $this->container['flexibleDrawdown'] = $flexibleDrawdown; + + return $this; + } + + /** + * Gets isAutoAdjust + * + * @return bool|null + */ + public function getIsAutoAdjust(): ?bool + { + return $this->container['isAutoAdjust']; + } + + /** + * Sets isAutoAdjust + * + * @param bool|null $isAutoAdjust Can be used to inform a User to what default value to set for PayLine.autoAdjustForLeave for new lines created. + * + * @return $this + */ + public function setIsAutoAdjust(?bool $isAutoAdjust): static + { + if (is_null($isAutoAdjust)) { + throw new InvalidArgumentException('non-nullable isAutoAdjust cannot be null'); + } + $this->container['isAutoAdjust'] = $isAutoAdjust; + + return $this; + } + + /** + * Gets calculationType + * + * @return \SynergiTech\Staffology\Model\PayCodeCalculationType|null + */ + public function getCalculationType(): ?\SynergiTech\Staffology\Model\PayCodeCalculationType + { + return $this->container['calculationType']; + } + + /** + * Sets calculationType + * + * @param \SynergiTech\Staffology\Model\PayCodeCalculationType|null $calculationType calculationType + * + * @return $this + */ + public function setCalculationType(?\SynergiTech\Staffology\Model\PayCodeCalculationType $calculationType): static + { + if (is_null($calculationType)) { + throw new InvalidArgumentException('non-nullable calculationType cannot be null'); + } + $this->container['calculationType'] = $calculationType; + + return $this; + } + + /** + * Gets multiplierType + * + * @return \SynergiTech\Staffology\Model\PayCodeMultiplierType|null + */ + public function getMultiplierType(): ?\SynergiTech\Staffology\Model\PayCodeMultiplierType + { + return $this->container['multiplierType']; + } + + /** + * Sets multiplierType + * + * @param \SynergiTech\Staffology\Model\PayCodeMultiplierType|null $multiplierType multiplierType + * + * @return $this + */ + public function setMultiplierType(?\SynergiTech\Staffology\Model\PayCodeMultiplierType $multiplierType): static + { + if (is_null($multiplierType)) { + throw new InvalidArgumentException('non-nullable multiplierType cannot be null'); + } + $this->container['multiplierType'] = $multiplierType; + + return $this; + } + + /** + * Gets dailyRateMultiplier + * + * @return float|null + */ + public function getDailyRateMultiplier(): ?float + { + return $this->container['dailyRateMultiplier']; + } + + /** + * Sets dailyRateMultiplier + * + * @param float|null $dailyRateMultiplier If the MultiplierType is MultipleOfDailyRate then this sets the multiple to be used, ie 1.5 + * + * @return $this + */ + public function setDailyRateMultiplier(?float $dailyRateMultiplier): static + { + if (is_null($dailyRateMultiplier)) { + throw new InvalidArgumentException('non-nullable dailyRateMultiplier cannot be null'); + } + $this->container['dailyRateMultiplier'] = $dailyRateMultiplier; + + return $this; + } + + /** + * Gets hourlyRateMultiplier + * + * @return float|null + */ + public function getHourlyRateMultiplier(): ?float + { + return $this->container['hourlyRateMultiplier']; + } + + /** + * Sets hourlyRateMultiplier + * + * @param float|null $hourlyRateMultiplier If the MultiplierType is MultipleOfHourlyRate then this sets the multiple to be used, ie 1.5 + * + * @return $this + */ + public function setHourlyRateMultiplier(?float $hourlyRateMultiplier): static + { + if (is_null($hourlyRateMultiplier)) { + throw new InvalidArgumentException('non-nullable hourlyRateMultiplier cannot be null'); + } + $this->container['hourlyRateMultiplier'] = $hourlyRateMultiplier; + + return $this; + } + + /** + * Gets isSystemCode + * + * @return bool|null + */ + public function getIsSystemCode(): ?bool + { + return $this->container['isSystemCode']; + } + + /** + * Sets isSystemCode + * + * @param bool|null $isSystemCode [readonly] System Codes cannot be deleted or edited + * + * @return $this + */ + public function setIsSystemCode(?bool $isSystemCode): static + { + if (is_null($isSystemCode)) { + throw new InvalidArgumentException('non-nullable isSystemCode cannot be null'); + } + $this->container['isSystemCode'] = $isSystemCode; + + return $this; + } + + /** + * Gets isControlCode + * + * @return bool|null + */ + public function getIsControlCode(): ?bool + { + return $this->container['isControlCode']; + } + + /** + * Sets isControlCode + * + * @param bool|null $isControlCode [readonly] Control Codes cannot be deleted or edited nor can PayLines be assigned to them. + * + * @return $this + */ + public function setIsControlCode(?bool $isControlCode): static + { + if (is_null($isControlCode)) { + throw new InvalidArgumentException('non-nullable isControlCode cannot be null'); + } + $this->container['isControlCode'] = $isControlCode; + + return $this; + } + + /** + * Gets isNotional + * + * @return bool|null + */ + public function getIsNotional(): ?bool + { + return $this->container['isNotional']; + } + + /** + * Sets isNotional + * + * @param bool|null $isNotional Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance. + * + * @return $this + */ + public function setIsNotional(?bool $isNotional): static + { + if (is_null($isNotional)) { + throw new InvalidArgumentException('non-nullable isNotional cannot be null'); + } + $this->container['isNotional'] = $isNotional; + + return $this; + } + + /** + * Gets payee + * + * @return string|null + */ + public function getPayee(): ?string + { + return $this->container['payee']; + } + + /** + * Sets payee + * + * @param string|null $payee The Id of the Payee, if any, that deductions are to be paid to. + * + * @return $this + */ + public function setPayee(?string $payee): static + { + if (is_null($payee)) { + array_push($this->openAPINullablesSetToNull, 'payee'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payee', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payee'] = $payee; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayCodeCalculationType.php b/src/Model/PayCodeCalculationType.php new file mode 100644 index 0000000..be440a6 --- /dev/null +++ b/src/Model/PayCodeCalculationType.php @@ -0,0 +1,53 @@ + + */ +class PayCodeSet implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayCodeSet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'payCodes' => 'string[]', + 'useForMcr' => 'bool', + 'mcrPayCategory' => '\SynergiTech\Staffology\Model\McrPayCategory', + 'useForLgps' => 'bool', + 'lgpsPayCategory' => '\SynergiTech\Staffology\Model\LgpsPayCategory', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'payCodes' => null, + 'useForMcr' => null, + 'mcrPayCategory' => null, + 'useForLgps' => null, + 'lgpsPayCategory' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'payCodes' => true, + 'useForMcr' => false, + 'mcrPayCategory' => false, + 'useForLgps' => false, + 'lgpsPayCategory' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'payCodes' => 'payCodes', + 'useForMcr' => 'useForMcr', + 'mcrPayCategory' => 'mcrPayCategory', + 'useForLgps' => 'useForLgps', + 'lgpsPayCategory' => 'lgpsPayCategory', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'payCodes' => 'setPayCodes', + 'useForMcr' => 'setUseForMcr', + 'mcrPayCategory' => 'setMcrPayCategory', + 'useForLgps' => 'setUseForLgps', + 'lgpsPayCategory' => 'setLgpsPayCategory', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'payCodes' => 'getPayCodes', + 'useForMcr' => 'getUseForMcr', + 'mcrPayCategory' => 'getMcrPayCategory', + 'useForLgps' => 'getUseForLgps', + 'lgpsPayCategory' => 'getLgpsPayCategory', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('useForMcr', $data ?? [], null); + $this->setIfExists('mcrPayCategory', $data ?? [], null); + $this->setIfExists('useForLgps', $data ?? [], null); + $this->setIfExists('lgpsPayCategory', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of this PayCodeSet + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 100)) { + throw new InvalidArgumentException('invalid length for $name when calling PayCodeSet., must be smaller than or equal to 100.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling PayCodeSet., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets payCodes + * + * @return string[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param string[]|null $payCodes The Code of any PayCodes included in this PayCodeSet + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets useForMcr + * + * @return bool|null + */ + public function getUseForMcr(): ?bool + { + return $this->container['useForMcr']; + } + + /** + * Sets useForMcr + * + * @param bool|null $useForMcr useForMcr + * + * @return $this + */ + public function setUseForMcr(?bool $useForMcr): static + { + if (is_null($useForMcr)) { + throw new InvalidArgumentException('non-nullable useForMcr cannot be null'); + } + $this->container['useForMcr'] = $useForMcr; + + return $this; + } + + /** + * Gets mcrPayCategory + * + * @return \SynergiTech\Staffology\Model\McrPayCategory|null + */ + public function getMcrPayCategory(): ?\SynergiTech\Staffology\Model\McrPayCategory + { + return $this->container['mcrPayCategory']; + } + + /** + * Sets mcrPayCategory + * + * @param \SynergiTech\Staffology\Model\McrPayCategory|null $mcrPayCategory mcrPayCategory + * + * @return $this + */ + public function setMcrPayCategory(?\SynergiTech\Staffology\Model\McrPayCategory $mcrPayCategory): static + { + if (is_null($mcrPayCategory)) { + throw new InvalidArgumentException('non-nullable mcrPayCategory cannot be null'); + } + $this->container['mcrPayCategory'] = $mcrPayCategory; + + return $this; + } + + /** + * Gets useForLgps + * + * @return bool|null + */ + public function getUseForLgps(): ?bool + { + return $this->container['useForLgps']; + } + + /** + * Sets useForLgps + * + * @param bool|null $useForLgps Flag indicating if this PayCodeSet will be used for LGPS pay categorisation + * + * @return $this + */ + public function setUseForLgps(?bool $useForLgps): static + { + if (is_null($useForLgps)) { + throw new InvalidArgumentException('non-nullable useForLgps cannot be null'); + } + $this->container['useForLgps'] = $useForLgps; + + return $this; + } + + /** + * Gets lgpsPayCategory + * + * @return \SynergiTech\Staffology\Model\LgpsPayCategory|null + */ + public function getLgpsPayCategory(): ?\SynergiTech\Staffology\Model\LgpsPayCategory + { + return $this->container['lgpsPayCategory']; + } + + /** + * Sets lgpsPayCategory + * + * @param \SynergiTech\Staffology\Model\LgpsPayCategory|null $lgpsPayCategory lgpsPayCategory + * + * @return $this + */ + public function setLgpsPayCategory(?\SynergiTech\Staffology\Model\LgpsPayCategory $lgpsPayCategory): static + { + if (is_null($lgpsPayCategory)) { + throw new InvalidArgumentException('non-nullable lgpsPayCategory cannot be null'); + } + $this->container['lgpsPayCategory'] = $lgpsPayCategory; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayCodeVarianceLine.php b/src/Model/PayCodeVarianceLine.php new file mode 100644 index 0000000..062a269 --- /dev/null +++ b/src/Model/PayCodeVarianceLine.php @@ -0,0 +1,497 @@ + + */ +class PayCodeVarianceLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayCodeVarianceLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'primaryValue' => 'float', + 'secondaryValue' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'primaryValue' => 'double', + 'secondaryValue' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => true, + 'primaryValue' => true, + 'secondaryValue' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'primaryValue' => 'primaryValue', + 'secondaryValue' => 'secondaryValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'primaryValue' => 'setPrimaryValue', + 'secondaryValue' => 'setSecondaryValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'primaryValue' => 'getPrimaryValue', + 'secondaryValue' => 'getSecondaryValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('primaryValue', $data ?? [], null); + $this->setIfExists('secondaryValue', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets primaryValue + * + * @return float|null + */ + public function getPrimaryValue(): ?float + { + return $this->container['primaryValue']; + } + + /** + * Sets primaryValue + * + * @param float|null $primaryValue primaryValue + * + * @return $this + */ + public function setPrimaryValue(?float $primaryValue): static + { + if (is_null($primaryValue)) { + array_push($this->openAPINullablesSetToNull, 'primaryValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('primaryValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['primaryValue'] = $primaryValue; + + return $this; + } + + /** + * Gets secondaryValue + * + * @return float|null + */ + public function getSecondaryValue(): ?float + { + return $this->container['secondaryValue']; + } + + /** + * Sets secondaryValue + * + * @param float|null $secondaryValue secondaryValue + * + * @return $this + */ + public function setSecondaryValue(?float $secondaryValue): static + { + if (is_null($secondaryValue)) { + array_push($this->openAPINullablesSetToNull, 'secondaryValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryValue'] = $secondaryValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayElementReport.php b/src/Model/PayElementReport.php new file mode 100644 index 0000000..9511bb2 --- /dev/null +++ b/src/Model/PayElementReport.php @@ -0,0 +1,919 @@ + + */ +class PayElementReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayElementReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PayElementReportLine[]', + 'payCodeTotals' => 'array', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'payCodeTotals' => 'double', + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'payCodeTotals' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'payCodeTotals' => 'payCodeTotals', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'payCodeTotals' => 'setPayCodeTotals', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'payCodeTotals' => 'getPayCodeTotals', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('payCodeTotals', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayElementReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayElementReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets payCodeTotals + * + * @return array|null + */ + public function getPayCodeTotals(): ?array + { + return $this->container['payCodeTotals']; + } + + /** + * Sets payCodeTotals + * + * @param array|null $payCodeTotals payCodeTotals + * + * @return $this + */ + public function setPayCodeTotals(?array $payCodeTotals): static + { + if (is_null($payCodeTotals)) { + array_push($this->openAPINullablesSetToNull, 'payCodeTotals'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeTotals', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeTotals'] = $payCodeTotals; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayElementReportLine.php b/src/Model/PayElementReportLine.php new file mode 100644 index 0000000..a01a147 --- /dev/null +++ b/src/Model/PayElementReportLine.php @@ -0,0 +1,599 @@ + + */ +class PayElementReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayElementReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'niNumber' => 'string', + 'payElements' => 'array', + 'hasPay' => 'bool', + 'totalPay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'niNumber' => null, + 'payElements' => 'double', + 'hasPay' => null, + 'totalPay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'niNumber' => true, + 'payElements' => true, + 'hasPay' => false, + 'totalPay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'niNumber' => 'niNumber', + 'payElements' => 'payElements', + 'hasPay' => 'hasPay', + 'totalPay' => 'totalPay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'niNumber' => 'setNiNumber', + 'payElements' => 'setPayElements', + 'hasPay' => 'setHasPay', + 'totalPay' => 'setTotalPay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'niNumber' => 'getNiNumber', + 'payElements' => 'getPayElements', + 'hasPay' => 'getHasPay', + 'totalPay' => 'getTotalPay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('payElements', $data ?? [], null); + $this->setIfExists('hasPay', $data ?? [], null); + $this->setIfExists('totalPay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets payElements + * + * @return array|null + */ + public function getPayElements(): ?array + { + return $this->container['payElements']; + } + + /** + * Sets payElements + * + * @param array|null $payElements payElements + * + * @return $this + */ + public function setPayElements(?array $payElements): static + { + if (is_null($payElements)) { + array_push($this->openAPINullablesSetToNull, 'payElements'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payElements', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payElements'] = $payElements; + + return $this; + } + + /** + * Gets hasPay + * + * @return bool|null + */ + public function getHasPay(): ?bool + { + return $this->container['hasPay']; + } + + /** + * Sets hasPay + * + * @param bool|null $hasPay hasPay + * + * @return $this + */ + public function setHasPay(?bool $hasPay): static + { + if (is_null($hasPay)) { + throw new InvalidArgumentException('non-nullable hasPay cannot be null'); + } + $this->container['hasPay'] = $hasPay; + + return $this; + } + + /** + * Gets totalPay + * + * @return float|null + */ + public function getTotalPay(): ?float + { + return $this->container['totalPay']; + } + + /** + * Sets totalPay + * + * @param float|null $totalPay totalPay + * + * @return $this + */ + public function setTotalPay(?float $totalPay): static + { + if (is_null($totalPay)) { + throw new InvalidArgumentException('non-nullable totalPay cannot be null'); + } + $this->container['totalPay'] = $totalPay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayElementReportReportResponse.php b/src/Model/PayElementReportReportResponse.php new file mode 100644 index 0000000..9e8292b --- /dev/null +++ b/src/Model/PayElementReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PayElementReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayElementReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayElementReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayElementReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PayElementReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayElementReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PayElementReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayGradesReport.php b/src/Model/PayGradesReport.php new file mode 100644 index 0000000..fb1eda1 --- /dev/null +++ b/src/Model/PayGradesReport.php @@ -0,0 +1,558 @@ + + */ +class PayGradesReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayGradesReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\AveragePayGradesReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\AveragePayGradesReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\AveragePayGradesReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayGradesReportReportResponse.php b/src/Model/PayGradesReportReportResponse.php new file mode 100644 index 0000000..3e3f34b --- /dev/null +++ b/src/Model/PayGradesReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PayGradesReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayGradesReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayGradesReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayGradesReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PayGradesReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayGradesReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PayGradesReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayLine.php b/src/Model/PayLine.php new file mode 100644 index 0000000..baffeb2 --- /dev/null +++ b/src/Model/PayLine.php @@ -0,0 +1,2431 @@ + + */ +class PayLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'value' => 'float', + 'rate' => 'float', + 'multiplier' => 'float', + 'description' => 'string', + 'attachmentOrderId' => 'string', + 'pensionId' => 'string', + 'leaveId' => 'string', + 'loanId' => 'string', + 'leaveStatutoryDaysPaid' => 'float', + 'leaveStatutoryWeeksPaid' => 'float', + 'code' => 'string', + 'tags' => 'string[]', + 'childId' => 'string', + 'isNetToGross' => 'bool', + 'targetNetToGrossValue' => 'float', + 'netToGrossDiscrepancy' => 'float', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'department' => 'string', + 'costCentre' => 'string', + 'departmentId' => 'string', + 'costCentreId' => 'string', + 'isAutoGeneratedBasicPayLine' => 'bool', + 'percentageOfEffectiveDays' => 'float', + 'totalWorkingDays' => 'float', + 'isAutomaticBackPay' => 'bool', + 'ignoreInitialBackPay' => 'bool', + 'initialBackPayPublicPayRunId' => 'string', + 'autoAdjustForLeave' => 'bool', + 'contributesToBasicPay' => 'bool', + 'calculateAsWhenPaid' => 'bool', + 'totalPaidDays' => 'float', + 'roleId' => 'string', + 'employeeRoleReference' => 'string', + 'earnedFrom' => '\DateTime', + 'earnedTo' => '\DateTime', + 'periodFrom' => '\DateTime', + 'periodTo' => '\DateTime', + 'annualValue' => 'float', + 'parentId' => 'string', + 'isAutoCalculatedBackPayLine' => 'bool', + 'isZeroHoursTeachersBackPayLine' => 'bool', + 'analysisCategoriesCodes' => '\SynergiTech\Staffology\Model\AnalysisCategoryCodes[]', + 'analysisCategoryCodeIds' => 'string[]', + 'paySpineId' => 'string', + 'paySpineGradeId' => 'string', + 'spinalPointId' => 'string', + 'londonAllowanceId' => 'int', + 'fullTimeAnnualValue' => 'float', + 'paySpine' => 'string', + 'payGrade' => 'string', + 'spinePoint' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'value' => 'double', + 'rate' => 'double', + 'multiplier' => 'double', + 'description' => null, + 'attachmentOrderId' => 'uuid', + 'pensionId' => 'uuid', + 'leaveId' => 'uuid', + 'loanId' => 'uuid', + 'leaveStatutoryDaysPaid' => 'double', + 'leaveStatutoryWeeksPaid' => 'double', + 'code' => null, + 'tags' => null, + 'childId' => 'uuid', + 'isNetToGross' => null, + 'targetNetToGrossValue' => 'double', + 'netToGrossDiscrepancy' => 'double', + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'department' => null, + 'costCentre' => null, + 'departmentId' => 'uuid', + 'costCentreId' => 'uuid', + 'isAutoGeneratedBasicPayLine' => null, + 'percentageOfEffectiveDays' => 'double', + 'totalWorkingDays' => 'double', + 'isAutomaticBackPay' => null, + 'ignoreInitialBackPay' => null, + 'initialBackPayPublicPayRunId' => 'uuid', + 'autoAdjustForLeave' => null, + 'contributesToBasicPay' => null, + 'calculateAsWhenPaid' => null, + 'totalPaidDays' => 'double', + 'roleId' => 'uuid', + 'employeeRoleReference' => null, + 'earnedFrom' => 'date', + 'earnedTo' => 'date', + 'periodFrom' => 'date', + 'periodTo' => 'date', + 'annualValue' => 'double', + 'parentId' => 'uuid', + 'isAutoCalculatedBackPayLine' => null, + 'isZeroHoursTeachersBackPayLine' => null, + 'analysisCategoriesCodes' => null, + 'analysisCategoryCodeIds' => 'uuid', + 'paySpineId' => 'uuid', + 'paySpineGradeId' => 'uuid', + 'spinalPointId' => 'uuid', + 'londonAllowanceId' => 'int32', + 'fullTimeAnnualValue' => 'double', + 'paySpine' => null, + 'payGrade' => null, + 'spinePoint' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'value' => false, + 'rate' => true, + 'multiplier' => true, + 'description' => true, + 'attachmentOrderId' => true, + 'pensionId' => true, + 'leaveId' => true, + 'loanId' => true, + 'leaveStatutoryDaysPaid' => true, + 'leaveStatutoryWeeksPaid' => true, + 'code' => true, + 'tags' => true, + 'childId' => false, + 'isNetToGross' => false, + 'targetNetToGrossValue' => true, + 'netToGrossDiscrepancy' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'department' => true, + 'costCentre' => true, + 'departmentId' => true, + 'costCentreId' => true, + 'isAutoGeneratedBasicPayLine' => false, + 'percentageOfEffectiveDays' => true, + 'totalWorkingDays' => true, + 'isAutomaticBackPay' => false, + 'ignoreInitialBackPay' => false, + 'initialBackPayPublicPayRunId' => true, + 'autoAdjustForLeave' => false, + 'contributesToBasicPay' => false, + 'calculateAsWhenPaid' => false, + 'totalPaidDays' => true, + 'roleId' => true, + 'employeeRoleReference' => true, + 'earnedFrom' => true, + 'earnedTo' => true, + 'periodFrom' => true, + 'periodTo' => true, + 'annualValue' => true, + 'parentId' => true, + 'isAutoCalculatedBackPayLine' => false, + 'isZeroHoursTeachersBackPayLine' => false, + 'analysisCategoriesCodes' => true, + 'analysisCategoryCodeIds' => true, + 'paySpineId' => true, + 'paySpineGradeId' => true, + 'spinalPointId' => true, + 'londonAllowanceId' => true, + 'fullTimeAnnualValue' => false, + 'paySpine' => true, + 'payGrade' => true, + 'spinePoint' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'value' => 'value', + 'rate' => 'rate', + 'multiplier' => 'multiplier', + 'description' => 'description', + 'attachmentOrderId' => 'attachmentOrderId', + 'pensionId' => 'pensionId', + 'leaveId' => 'leaveId', + 'loanId' => 'loanId', + 'leaveStatutoryDaysPaid' => 'leaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'leaveStatutoryWeeksPaid', + 'code' => 'code', + 'tags' => 'tags', + 'childId' => 'childId', + 'isNetToGross' => 'isNetToGross', + 'targetNetToGrossValue' => 'targetNetToGrossValue', + 'netToGrossDiscrepancy' => 'netToGrossDiscrepancy', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'departmentId' => 'departmentId', + 'costCentreId' => 'costCentreId', + 'isAutoGeneratedBasicPayLine' => 'isAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'percentageOfEffectiveDays', + 'totalWorkingDays' => 'totalWorkingDays', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'initialBackPayPublicPayRunId' => 'initialBackPayPublicPayRunId', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'calculateAsWhenPaid' => 'calculateAsWhenPaid', + 'totalPaidDays' => 'totalPaidDays', + 'roleId' => 'roleId', + 'employeeRoleReference' => 'employeeRoleReference', + 'earnedFrom' => 'earnedFrom', + 'earnedTo' => 'earnedTo', + 'periodFrom' => 'periodFrom', + 'periodTo' => 'periodTo', + 'annualValue' => 'annualValue', + 'parentId' => 'parentId', + 'isAutoCalculatedBackPayLine' => 'isAutoCalculatedBackPayLine', + 'isZeroHoursTeachersBackPayLine' => 'isZeroHoursTeachersBackPayLine', + 'analysisCategoriesCodes' => 'analysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'analysisCategoryCodeIds', + 'paySpineId' => 'paySpineId', + 'paySpineGradeId' => 'paySpineGradeId', + 'spinalPointId' => 'spinalPointId', + 'londonAllowanceId' => 'londonAllowanceId', + 'fullTimeAnnualValue' => 'fullTimeAnnualValue', + 'paySpine' => 'paySpine', + 'payGrade' => 'payGrade', + 'spinePoint' => 'spinePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'value' => 'setValue', + 'rate' => 'setRate', + 'multiplier' => 'setMultiplier', + 'description' => 'setDescription', + 'attachmentOrderId' => 'setAttachmentOrderId', + 'pensionId' => 'setPensionId', + 'leaveId' => 'setLeaveId', + 'loanId' => 'setLoanId', + 'leaveStatutoryDaysPaid' => 'setLeaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'setLeaveStatutoryWeeksPaid', + 'code' => 'setCode', + 'tags' => 'setTags', + 'childId' => 'setChildId', + 'isNetToGross' => 'setIsNetToGross', + 'targetNetToGrossValue' => 'setTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'setNetToGrossDiscrepancy', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'departmentId' => 'setDepartmentId', + 'costCentreId' => 'setCostCentreId', + 'isAutoGeneratedBasicPayLine' => 'setIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'setPercentageOfEffectiveDays', + 'totalWorkingDays' => 'setTotalWorkingDays', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'initialBackPayPublicPayRunId' => 'setInitialBackPayPublicPayRunId', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'calculateAsWhenPaid' => 'setCalculateAsWhenPaid', + 'totalPaidDays' => 'setTotalPaidDays', + 'roleId' => 'setRoleId', + 'employeeRoleReference' => 'setEmployeeRoleReference', + 'earnedFrom' => 'setEarnedFrom', + 'earnedTo' => 'setEarnedTo', + 'periodFrom' => 'setPeriodFrom', + 'periodTo' => 'setPeriodTo', + 'annualValue' => 'setAnnualValue', + 'parentId' => 'setParentId', + 'isAutoCalculatedBackPayLine' => 'setIsAutoCalculatedBackPayLine', + 'isZeroHoursTeachersBackPayLine' => 'setIsZeroHoursTeachersBackPayLine', + 'analysisCategoriesCodes' => 'setAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'setAnalysisCategoryCodeIds', + 'paySpineId' => 'setPaySpineId', + 'paySpineGradeId' => 'setPaySpineGradeId', + 'spinalPointId' => 'setSpinalPointId', + 'londonAllowanceId' => 'setLondonAllowanceId', + 'fullTimeAnnualValue' => 'setFullTimeAnnualValue', + 'paySpine' => 'setPaySpine', + 'payGrade' => 'setPayGrade', + 'spinePoint' => 'setSpinePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'value' => 'getValue', + 'rate' => 'getRate', + 'multiplier' => 'getMultiplier', + 'description' => 'getDescription', + 'attachmentOrderId' => 'getAttachmentOrderId', + 'pensionId' => 'getPensionId', + 'leaveId' => 'getLeaveId', + 'loanId' => 'getLoanId', + 'leaveStatutoryDaysPaid' => 'getLeaveStatutoryDaysPaid', + 'leaveStatutoryWeeksPaid' => 'getLeaveStatutoryWeeksPaid', + 'code' => 'getCode', + 'tags' => 'getTags', + 'childId' => 'getChildId', + 'isNetToGross' => 'getIsNetToGross', + 'targetNetToGrossValue' => 'getTargetNetToGrossValue', + 'netToGrossDiscrepancy' => 'getNetToGrossDiscrepancy', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'departmentId' => 'getDepartmentId', + 'costCentreId' => 'getCostCentreId', + 'isAutoGeneratedBasicPayLine' => 'getIsAutoGeneratedBasicPayLine', + 'percentageOfEffectiveDays' => 'getPercentageOfEffectiveDays', + 'totalWorkingDays' => 'getTotalWorkingDays', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'initialBackPayPublicPayRunId' => 'getInitialBackPayPublicPayRunId', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'calculateAsWhenPaid' => 'getCalculateAsWhenPaid', + 'totalPaidDays' => 'getTotalPaidDays', + 'roleId' => 'getRoleId', + 'employeeRoleReference' => 'getEmployeeRoleReference', + 'earnedFrom' => 'getEarnedFrom', + 'earnedTo' => 'getEarnedTo', + 'periodFrom' => 'getPeriodFrom', + 'periodTo' => 'getPeriodTo', + 'annualValue' => 'getAnnualValue', + 'parentId' => 'getParentId', + 'isAutoCalculatedBackPayLine' => 'getIsAutoCalculatedBackPayLine', + 'isZeroHoursTeachersBackPayLine' => 'getIsZeroHoursTeachersBackPayLine', + 'analysisCategoriesCodes' => 'getAnalysisCategoriesCodes', + 'analysisCategoryCodeIds' => 'getAnalysisCategoryCodeIds', + 'paySpineId' => 'getPaySpineId', + 'paySpineGradeId' => 'getPaySpineGradeId', + 'spinalPointId' => 'getSpinalPointId', + 'londonAllowanceId' => 'getLondonAllowanceId', + 'fullTimeAnnualValue' => 'getFullTimeAnnualValue', + 'paySpine' => 'getPaySpine', + 'payGrade' => 'getPayGrade', + 'spinePoint' => 'getSpinePoint' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('attachmentOrderId', $data ?? [], null); + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('leaveId', $data ?? [], null); + $this->setIfExists('loanId', $data ?? [], null); + $this->setIfExists('leaveStatutoryDaysPaid', $data ?? [], null); + $this->setIfExists('leaveStatutoryWeeksPaid', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('targetNetToGrossValue', $data ?? [], null); + $this->setIfExists('netToGrossDiscrepancy', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('departmentId', $data ?? [], null); + $this->setIfExists('costCentreId', $data ?? [], null); + $this->setIfExists('isAutoGeneratedBasicPayLine', $data ?? [], null); + $this->setIfExists('percentageOfEffectiveDays', $data ?? [], null); + $this->setIfExists('totalWorkingDays', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('initialBackPayPublicPayRunId', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('calculateAsWhenPaid', $data ?? [], null); + $this->setIfExists('totalPaidDays', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('employeeRoleReference', $data ?? [], null); + $this->setIfExists('earnedFrom', $data ?? [], null); + $this->setIfExists('earnedTo', $data ?? [], null); + $this->setIfExists('periodFrom', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('parentId', $data ?? [], null); + $this->setIfExists('isAutoCalculatedBackPayLine', $data ?? [], null); + $this->setIfExists('isZeroHoursTeachersBackPayLine', $data ?? [], null); + $this->setIfExists('analysisCategoriesCodes', $data ?? [], null); + $this->setIfExists('analysisCategoryCodeIds', $data ?? [], null); + $this->setIfExists('paySpineId', $data ?? [], null); + $this->setIfExists('paySpineGradeId', $data ?? [], null); + $this->setIfExists('spinalPointId', $data ?? [], null); + $this->setIfExists('londonAllowanceId', $data ?? [], null); + $this->setIfExists('fullTimeAnnualValue', $data ?? [], null); + $this->setIfExists('paySpine', $data ?? [], null); + $this->setIfExists('payGrade', $data ?? [], null); + $this->setIfExists('spinePoint', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 100)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The amount to add or deduct (whether it is a deduction or addition depends on the PayCode used). If the PayCode has a CalculationType other than FixedAmount then this field will be a percentage. If the PayCode has a MultiplierType other than None then this field will be readonly and automatically calculated. + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate If the related PayCode has a MultiplierType other than None then this field will be used as the rate per day or hour. Otherwise it isn't used + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + array_push($this->openAPINullablesSetToNull, 'rate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier If the related PayCode has a MultiplierType other than None then this field will be used as number of days or hours + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A free form description to accompany this line. It will be displayed on the payslip. + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 100)) { + throw new InvalidArgumentException('invalid length for $description when calling PayLine., must be smaller than or equal to 100.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets attachmentOrderId + * + * @return string|null + */ + public function getAttachmentOrderId(): ?string + { + return $this->container['attachmentOrderId']; + } + + /** + * Sets attachmentOrderId + * + * @param string|null $attachmentOrderId [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO + * + * @return $this + */ + public function setAttachmentOrderId(?string $attachmentOrderId): static + { + if (is_null($attachmentOrderId)) { + array_push($this->openAPINullablesSetToNull, 'attachmentOrderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachmentOrderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachmentOrderId'] = $attachmentOrderId; + + return $this; + } + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + array_push($this->openAPINullablesSetToNull, 'pensionId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets leaveId + * + * @return string|null + */ + public function getLeaveId(): ?string + { + return $this->container['leaveId']; + } + + /** + * Sets leaveId + * + * @param string|null $leaveId [readonly] The Id of the associated Leave. Only included if the PayLine is a result of a Leave with Statutory pay + * + * @return $this + */ + public function setLeaveId(?string $leaveId): static + { + if (is_null($leaveId)) { + array_push($this->openAPINullablesSetToNull, 'leaveId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveId'] = $leaveId; + + return $this; + } + + /** + * Gets loanId + * + * @return string|null + */ + public function getLoanId(): ?string + { + return $this->container['loanId']; + } + + /** + * Sets loanId + * + * @param string|null $loanId [readonly] The Id of the associated Loan, if any. + * + * @return $this + */ + public function setLoanId(?string $loanId): static + { + if (is_null($loanId)) { + array_push($this->openAPINullablesSetToNull, 'loanId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loanId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loanId'] = $loanId; + + return $this; + } + + /** + * Gets leaveStatutoryDaysPaid + * + * @return float|null + */ + public function getLeaveStatutoryDaysPaid(): ?float + { + return $this->container['leaveStatutoryDaysPaid']; + } + + /** + * Sets leaveStatutoryDaysPaid + * + * @param float|null $leaveStatutoryDaysPaid [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many days they've been paid for (based on their Working Pattern). + * + * @return $this + */ + public function setLeaveStatutoryDaysPaid(?float $leaveStatutoryDaysPaid): static + { + if (is_null($leaveStatutoryDaysPaid)) { + array_push($this->openAPINullablesSetToNull, 'leaveStatutoryDaysPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveStatutoryDaysPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveStatutoryDaysPaid'] = $leaveStatutoryDaysPaid; + + return $this; + } + + /** + * Gets leaveStatutoryWeeksPaid + * + * @return float|null + */ + public function getLeaveStatutoryWeeksPaid(): ?float + { + return $this->container['leaveStatutoryWeeksPaid']; + } + + /** + * Sets leaveStatutoryWeeksPaid + * + * @param float|null $leaveStatutoryWeeksPaid [readonly] If the PayLine is a result of a Leave with Statutory Pay then this property tells you how many weeks they've been paid for (based on their Working Pattern). + * + * @return $this + */ + public function setLeaveStatutoryWeeksPaid(?float $leaveStatutoryWeeksPaid): static + { + if (is_null($leaveStatutoryWeeksPaid)) { + array_push($this->openAPINullablesSetToNull, 'leaveStatutoryWeeksPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveStatutoryWeeksPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveStatutoryWeeksPaid'] = $leaveStatutoryWeeksPaid; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The Code of the PayCode this line is assigned to. The PayCode determines the treatment of this line when it comes to NI, Tax and Pensions as well as whether it's a deduction or addition. + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId This is nothing but the UniqueId of the model. + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + throw new InvalidArgumentException('non-nullable childId cannot be null'); + } + $this->container['childId'] = $childId; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross If the PayLine is a fixed amount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets targetNetToGrossValue + * + * @return float|null + */ + public function getTargetNetToGrossValue(): ?float + { + return $this->container['targetNetToGrossValue']; + } + + /** + * Sets targetNetToGrossValue + * + * @param float|null $targetNetToGrossValue The original net fixed addition amount that is considered to be a take home pay target. + * + * @return $this + */ + public function setTargetNetToGrossValue(?float $targetNetToGrossValue): static + { + if (is_null($targetNetToGrossValue)) { + array_push($this->openAPINullablesSetToNull, 'targetNetToGrossValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('targetNetToGrossValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['targetNetToGrossValue'] = $targetNetToGrossValue; + + return $this; + } + + /** + * Gets netToGrossDiscrepancy + * + * @return float|null + */ + public function getNetToGrossDiscrepancy(): ?float + { + return $this->container['netToGrossDiscrepancy']; + } + + /** + * Sets netToGrossDiscrepancy + * + * @param float|null $netToGrossDiscrepancy The discrepancy between the targeted and the calculated grossed up value during a net to gross calculation. + * + * @return $this + */ + public function setNetToGrossDiscrepancy(?float $netToGrossDiscrepancy): static + { + if (is_null($netToGrossDiscrepancy)) { + array_push($this->openAPINullablesSetToNull, 'netToGrossDiscrepancy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netToGrossDiscrepancy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netToGrossDiscrepancy'] = $netToGrossDiscrepancy; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date the pay line starts being calculated in payrun + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo The date the pay line stops being calculated in payrun + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre costCentre + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets departmentId + * + * @return string|null + */ + public function getDepartmentId(): ?string + { + return $this->container['departmentId']; + } + + /** + * Sets departmentId + * + * @param string|null $departmentId departmentId + * + * @return $this + */ + public function setDepartmentId(?string $departmentId): static + { + if (is_null($departmentId)) { + array_push($this->openAPINullablesSetToNull, 'departmentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentId'] = $departmentId; + + return $this; + } + + /** + * Gets costCentreId + * + * @return string|null + */ + public function getCostCentreId(): ?string + { + return $this->container['costCentreId']; + } + + /** + * Sets costCentreId + * + * @param string|null $costCentreId costCentreId + * + * @return $this + */ + public function setCostCentreId(?string $costCentreId): static + { + if (is_null($costCentreId)) { + array_push($this->openAPINullablesSetToNull, 'costCentreId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentreId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentreId'] = $costCentreId; + + return $this; + } + + /** + * Gets isAutoGeneratedBasicPayLine + * + * @return bool|null + */ + public function getIsAutoGeneratedBasicPayLine(): ?bool + { + return $this->container['isAutoGeneratedBasicPayLine']; + } + + /** + * Sets isAutoGeneratedBasicPayLine + * + * @param bool|null $isAutoGeneratedBasicPayLine isAutoGeneratedBasicPayLine + * + * @return $this + */ + public function setIsAutoGeneratedBasicPayLine(?bool $isAutoGeneratedBasicPayLine): static + { + if (is_null($isAutoGeneratedBasicPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoGeneratedBasicPayLine cannot be null'); + } + $this->container['isAutoGeneratedBasicPayLine'] = $isAutoGeneratedBasicPayLine; + + return $this; + } + + /** + * Gets percentageOfEffectiveDays + * + * @return float|null + */ + public function getPercentageOfEffectiveDays(): ?float + { + return $this->container['percentageOfEffectiveDays']; + } + + /** + * Sets percentageOfEffectiveDays + * + * @param float|null $percentageOfEffectiveDays The percentage of working days the effective dates span for pro-rata'ing values, calculated/set during each payrun + * + * @return $this + */ + public function setPercentageOfEffectiveDays(?float $percentageOfEffectiveDays): static + { + if (is_null($percentageOfEffectiveDays)) { + array_push($this->openAPINullablesSetToNull, 'percentageOfEffectiveDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('percentageOfEffectiveDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['percentageOfEffectiveDays'] = $percentageOfEffectiveDays; + + return $this; + } + + /** + * Gets totalWorkingDays + * + * @return float|null + */ + public function getTotalWorkingDays(): ?float + { + return $this->container['totalWorkingDays']; + } + + /** + * Sets totalWorkingDays + * + * @param float|null $totalWorkingDays totalWorkingDays + * + * @return $this + */ + public function setTotalWorkingDays(?float $totalWorkingDays): static + { + if (is_null($totalWorkingDays)) { + array_push($this->openAPINullablesSetToNull, 'totalWorkingDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalWorkingDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalWorkingDays'] = $totalWorkingDays; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay Automatically calculate back pay and add or modify the necessary pay lines for this addition/deduction when a pay run is created. Applicable only to employee level addition/deduction pay lines. If set to false then you must manually handle the calculation and adding of back pay lines. + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay Skip the automatic backpay calculation on the first pay run, if the addition/deduction had been paid outside or Staffology. If set to false, the automatic backpay calculation will be performed on the first pay run. + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets initialBackPayPublicPayRunId + * + * @return string|null + */ + public function getInitialBackPayPublicPayRunId(): ?string + { + return $this->container['initialBackPayPublicPayRunId']; + } + + /** + * Sets initialBackPayPublicPayRunId + * + * @param string|null $initialBackPayPublicPayRunId Used to mark the first payrun where this payline has been payrolled for backpay + * + * @return $this + */ + public function setInitialBackPayPublicPayRunId(?string $initialBackPayPublicPayRunId): static + { + if (is_null($initialBackPayPublicPayRunId)) { + array_push($this->openAPINullablesSetToNull, 'initialBackPayPublicPayRunId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initialBackPayPublicPayRunId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initialBackPayPublicPayRunId'] = $initialBackPayPublicPayRunId; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay Indicates whether this pay line contributes to the basic pay of the employee. Will be set to true by default when IsAutoGeneratedBasicPayLine is true. + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets calculateAsWhenPaid + * + * @return bool|null + */ + public function getCalculateAsWhenPaid(): ?bool + { + return $this->container['calculateAsWhenPaid']; + } + + /** + * Sets calculateAsWhenPaid + * + * @param bool|null $calculateAsWhenPaid Indicates whether this pay line should be treated as When Paid rather than When Earned + * + * @return $this + */ + public function setCalculateAsWhenPaid(?bool $calculateAsWhenPaid): static + { + if (is_null($calculateAsWhenPaid)) { + throw new InvalidArgumentException('non-nullable calculateAsWhenPaid cannot be null'); + } + $this->container['calculateAsWhenPaid'] = $calculateAsWhenPaid; + + return $this; + } + + /** + * Gets totalPaidDays + * + * @return float|null + */ + public function getTotalPaidDays(): ?float + { + return $this->container['totalPaidDays']; + } + + /** + * Sets totalPaidDays + * + * @param float|null $totalPaidDays totalPaidDays + * + * @return $this + */ + public function setTotalPaidDays(?float $totalPaidDays): static + { + if (is_null($totalPaidDays)) { + array_push($this->openAPINullablesSetToNull, 'totalPaidDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalPaidDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalPaidDays'] = $totalPaidDays; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId The employee role which is associated with this pay line. If set to null, the pay line is not related with a role. + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets employeeRoleReference + * + * @return string|null + */ + public function getEmployeeRoleReference(): ?string + { + return $this->container['employeeRoleReference']; + } + + /** + * Sets employeeRoleReference + * + * @param string|null $employeeRoleReference employeeRoleReference + * + * @return $this + */ + public function setEmployeeRoleReference(?string $employeeRoleReference): static + { + if (is_null($employeeRoleReference)) { + array_push($this->openAPINullablesSetToNull, 'employeeRoleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeRoleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeRoleReference'] = $employeeRoleReference; + + return $this; + } + + /** + * Gets earnedFrom + * + * @return \DateTime|null + */ + public function getEarnedFrom(): ?\DateTime + { + return $this->container['earnedFrom']; + } + + /** + * Sets earnedFrom + * + * @param \DateTime|null $earnedFrom Nullable DateTime property \"EarnedFrom\" in the PayLine model to store the start date of the PayLine's 'earned' period in a PayRun. + * + * @return $this + */ + public function setEarnedFrom(?\DateTime $earnedFrom): static + { + if (is_null($earnedFrom)) { + array_push($this->openAPINullablesSetToNull, 'earnedFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedFrom'] = $earnedFrom; + + return $this; + } + + /** + * Gets earnedTo + * + * @return \DateTime|null + */ + public function getEarnedTo(): ?\DateTime + { + return $this->container['earnedTo']; + } + + /** + * Sets earnedTo + * + * @param \DateTime|null $earnedTo Nullable DateTime property \"EarnedTo\" in the PayLine model to store the end date of the PayLine's 'earned' period in a PayRun. + * + * @return $this + */ + public function setEarnedTo(?\DateTime $earnedTo): static + { + if (is_null($earnedTo)) { + array_push($this->openAPINullablesSetToNull, 'earnedTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('earnedTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['earnedTo'] = $earnedTo; + + return $this; + } + + /** + * Gets periodFrom + * + * @return \DateTime|null + */ + public function getPeriodFrom(): ?\DateTime + { + return $this->container['periodFrom']; + } + + /** + * Sets periodFrom + * + * @param \DateTime|null $periodFrom Nullable DateTime property \"PeriodFrom\" in the PayLine model to store the start date of the PayRun period the current PayLine is part of. + * + * @return $this + */ + public function setPeriodFrom(?\DateTime $periodFrom): static + { + if (is_null($periodFrom)) { + array_push($this->openAPINullablesSetToNull, 'periodFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodFrom'] = $periodFrom; + + return $this; + } + + /** + * Gets periodTo + * + * @return \DateTime|null + */ + public function getPeriodTo(): ?\DateTime + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param \DateTime|null $periodTo Nullable DateTime property \"PeriodTo\" in the PayLine model to store the end date of the PayRun period the current PayLine is part of. + * + * @return $this + */ + public function setPeriodTo(?\DateTime $periodTo): static + { + if (is_null($periodTo)) { + array_push($this->openAPINullablesSetToNull, 'periodTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue The original value from the PayLine before we modify it Currently only used when CalculationType is set to FixedAnnualAmount so we can determine whether the pay line value needs calculating or not To recalculate set to null with annual amount recorded in Value + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + array_push($this->openAPINullablesSetToNull, 'annualValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets parentId + * + * @return string|null + */ + public function getParentId(): ?string + { + return $this->container['parentId']; + } + + /** + * Sets parentId + * + * @param string|null $parentId [readonly] The Id of the associated employee level pay line, if the current line is a back pay line. + * + * @return $this + */ + public function setParentId(?string $parentId): static + { + if (is_null($parentId)) { + array_push($this->openAPINullablesSetToNull, 'parentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parentId'] = $parentId; + + return $this; + } + + /** + * Gets isAutoCalculatedBackPayLine + * + * @return bool|null + */ + public function getIsAutoCalculatedBackPayLine(): ?bool + { + return $this->container['isAutoCalculatedBackPayLine']; + } + + /** + * Sets isAutoCalculatedBackPayLine + * + * @param bool|null $isAutoCalculatedBackPayLine isAutoCalculatedBackPayLine + * + * @return $this + */ + public function setIsAutoCalculatedBackPayLine(?bool $isAutoCalculatedBackPayLine): static + { + if (is_null($isAutoCalculatedBackPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoCalculatedBackPayLine cannot be null'); + } + $this->container['isAutoCalculatedBackPayLine'] = $isAutoCalculatedBackPayLine; + + return $this; + } + + /** + * Gets isZeroHoursTeachersBackPayLine + * + * @return bool|null + */ + public function getIsZeroHoursTeachersBackPayLine(): ?bool + { + return $this->container['isZeroHoursTeachersBackPayLine']; + } + + /** + * Sets isZeroHoursTeachersBackPayLine + * + * @param bool|null $isZeroHoursTeachersBackPayLine [readonly] Indicates whether this pay line is a backdated pay claim line belonging to a zero hours contract teacher. + * + * @return $this + */ + public function setIsZeroHoursTeachersBackPayLine(?bool $isZeroHoursTeachersBackPayLine): static + { + if (is_null($isZeroHoursTeachersBackPayLine)) { + throw new InvalidArgumentException('non-nullable isZeroHoursTeachersBackPayLine cannot be null'); + } + $this->container['isZeroHoursTeachersBackPayLine'] = $isZeroHoursTeachersBackPayLine; + + return $this; + } + + /** + * Gets analysisCategoriesCodes + * + * @return \SynergiTech\Staffology\Model\AnalysisCategoryCodes[]|null + */ + public function getAnalysisCategoriesCodes(): ?array + { + return $this->container['analysisCategoriesCodes']; + } + + /** + * Sets analysisCategoriesCodes + * + * @param \SynergiTech\Staffology\Model\AnalysisCategoryCodes[]|null $analysisCategoriesCodes List of analysis Category Codes + * + * @return $this + */ + public function setAnalysisCategoriesCodes(?array $analysisCategoriesCodes): static + { + if (is_null($analysisCategoriesCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoriesCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoriesCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoriesCodes'] = $analysisCategoriesCodes; + + return $this; + } + + /** + * Gets analysisCategoryCodeIds + * + * @return string[]|null + */ + public function getAnalysisCategoryCodeIds(): ?array + { + return $this->container['analysisCategoryCodeIds']; + } + + /** + * Sets analysisCategoryCodeIds + * + * @param string[]|null $analysisCategoryCodeIds List of analysis Category Codes uniqueId + * + * @return $this + */ + public function setAnalysisCategoryCodeIds(?array $analysisCategoryCodeIds): static + { + if (is_null($analysisCategoryCodeIds)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodeIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodeIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodeIds'] = $analysisCategoryCodeIds; + + return $this; + } + + /** + * Gets paySpineId + * + * @return string|null + */ + public function getPaySpineId(): ?string + { + return $this->container['paySpineId']; + } + + /** + * Sets paySpineId + * + * @param string|null $paySpineId [readonly] The Id of the associated pay spine. + * + * @return $this + */ + public function setPaySpineId(?string $paySpineId): static + { + if (is_null($paySpineId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineId'] = $paySpineId; + + return $this; + } + + /** + * Gets paySpineGradeId + * + * @return string|null + */ + public function getPaySpineGradeId(): ?string + { + return $this->container['paySpineGradeId']; + } + + /** + * Sets paySpineGradeId + * + * @param string|null $paySpineGradeId [readonly] The Id of the associated pay spine grade. + * + * @return $this + */ + public function setPaySpineGradeId(?string $paySpineGradeId): static + { + if (is_null($paySpineGradeId)) { + array_push($this->openAPINullablesSetToNull, 'paySpineGradeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpineGradeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpineGradeId'] = $paySpineGradeId; + + return $this; + } + + /** + * Gets spinalPointId + * + * @return string|null + */ + public function getSpinalPointId(): ?string + { + return $this->container['spinalPointId']; + } + + /** + * Sets spinalPointId + * + * @param string|null $spinalPointId [readonly] The Id of the associated spinal point. + * + * @return $this + */ + public function setSpinalPointId(?string $spinalPointId): static + { + if (is_null($spinalPointId)) { + array_push($this->openAPINullablesSetToNull, 'spinalPointId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinalPointId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinalPointId'] = $spinalPointId; + + return $this; + } + + /** + * Gets londonAllowanceId + * + * @return int|null + */ + public function getLondonAllowanceId(): ?int + { + return $this->container['londonAllowanceId']; + } + + /** + * Sets londonAllowanceId + * + * @param int|null $londonAllowanceId Used to set London allowance id for payline + * + * @return $this + */ + public function setLondonAllowanceId(?int $londonAllowanceId): static + { + if (is_null($londonAllowanceId)) { + array_push($this->openAPINullablesSetToNull, 'londonAllowanceId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('londonAllowanceId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['londonAllowanceId'] = $londonAllowanceId; + + return $this; + } + + /** + * Gets fullTimeAnnualValue + * + * @return float|null + */ + public function getFullTimeAnnualValue(): ?float + { + return $this->container['fullTimeAnnualValue']; + } + + /** + * Sets fullTimeAnnualValue + * + * @param float|null $fullTimeAnnualValue Used to set Full Time Annual Value for payline + * + * @return $this + */ + public function setFullTimeAnnualValue(?float $fullTimeAnnualValue): static + { + if (is_null($fullTimeAnnualValue)) { + throw new InvalidArgumentException('non-nullable fullTimeAnnualValue cannot be null'); + } + $this->container['fullTimeAnnualValue'] = $fullTimeAnnualValue; + + return $this; + } + + /** + * Gets paySpine + * + * @return string|null + */ + public function getPaySpine(): ?string + { + return $this->container['paySpine']; + } + + /** + * Sets paySpine + * + * @param string|null $paySpine PaySpine name based on PaySpineId + * + * @return $this + */ + public function setPaySpine(?string $paySpine): static + { + if (is_null($paySpine)) { + array_push($this->openAPINullablesSetToNull, 'paySpine'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpine', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpine'] = $paySpine; + + return $this; + } + + /** + * Gets payGrade + * + * @return string|null + */ + public function getPayGrade(): ?string + { + return $this->container['payGrade']; + } + + /** + * Sets payGrade + * + * @param string|null $payGrade PayGrade name based on PayGradeId + * + * @return $this + */ + public function setPayGrade(?string $payGrade): static + { + if (is_null($payGrade)) { + array_push($this->openAPINullablesSetToNull, 'payGrade'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payGrade', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payGrade'] = $payGrade; + + return $this; + } + + /** + * Gets spinePoint + * + * @return string|null + */ + public function getSpinePoint(): ?string + { + return $this->container['spinePoint']; + } + + /** + * Sets spinePoint + * + * @param string|null $spinePoint SpinePoint name based on SpinePointId + * + * @return $this + */ + public function setSpinePoint(?string $spinePoint): static + { + if (is_null($spinePoint)) { + array_push($this->openAPINullablesSetToNull, 'spinePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinePoint'] = $spinePoint; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayMethod.php b/src/Model/PayMethod.php new file mode 100644 index 0000000..c4d2225 --- /dev/null +++ b/src/Model/PayMethod.php @@ -0,0 +1,49 @@ + + */ +class PayOptions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'period' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'method' => '\SynergiTech\Staffology\Model\PayMethod', + 'withholdTaxRefundIfPayIsZero' => 'bool', + 'taxAndNi' => '\SynergiTech\Staffology\Model\TaxAndNi', + 'fpsFields' => '\SynergiTech\Staffology\Model\FpsFields', + 'tags' => 'string[]', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'nationalMinimumWage' => 'bool', + 'payCode' => 'string', + 'mileageVehicleType' => '\SynergiTech\Staffology\Model\MileageVehicleType', + 'mapsMiles' => 'int', + 'payAmount' => 'float', + 'payAmountMultiplier' => 'float', + 'baseHourlyRate' => 'float', + 'baseDailyRate' => 'float', + 'basicPay' => 'float', + 'autoAdjustForLeave' => 'bool', + 'niTable' => 'string', + 'regularPayLines' => '\SynergiTech\Staffology\Model\PayLine[]', + 'excludedRegularPayLines' => '\SynergiTech\Staffology\Model\PayLine[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'period' => null, + 'ordinal' => 'int32', + 'method' => null, + 'withholdTaxRefundIfPayIsZero' => null, + 'taxAndNi' => null, + 'fpsFields' => null, + 'tags' => null, + 'basis' => null, + 'nationalMinimumWage' => null, + 'payCode' => null, + 'mileageVehicleType' => null, + 'mapsMiles' => 'int32', + 'payAmount' => 'double', + 'payAmountMultiplier' => 'double', + 'baseHourlyRate' => 'double', + 'baseDailyRate' => 'double', + 'basicPay' => 'double', + 'autoAdjustForLeave' => null, + 'niTable' => null, + 'regularPayLines' => null, + 'excludedRegularPayLines' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'period' => false, + 'ordinal' => false, + 'method' => false, + 'withholdTaxRefundIfPayIsZero' => false, + 'taxAndNi' => false, + 'fpsFields' => false, + 'tags' => true, + 'basis' => false, + 'nationalMinimumWage' => false, + 'payCode' => true, + 'mileageVehicleType' => false, + 'mapsMiles' => true, + 'payAmount' => false, + 'payAmountMultiplier' => false, + 'baseHourlyRate' => false, + 'baseDailyRate' => false, + 'basicPay' => false, + 'autoAdjustForLeave' => false, + 'niTable' => false, + 'regularPayLines' => true, + 'excludedRegularPayLines' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'period' => 'period', + 'ordinal' => 'ordinal', + 'method' => 'method', + 'withholdTaxRefundIfPayIsZero' => 'withholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'taxAndNi', + 'fpsFields' => 'fpsFields', + 'tags' => 'tags', + 'basis' => 'basis', + 'nationalMinimumWage' => 'nationalMinimumWage', + 'payCode' => 'payCode', + 'mileageVehicleType' => 'mileageVehicleType', + 'mapsMiles' => 'mapsMiles', + 'payAmount' => 'payAmount', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'baseHourlyRate' => 'baseHourlyRate', + 'baseDailyRate' => 'baseDailyRate', + 'basicPay' => 'basicPay', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'niTable' => 'niTable', + 'regularPayLines' => 'regularPayLines', + 'excludedRegularPayLines' => 'excludedRegularPayLines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'period' => 'setPeriod', + 'ordinal' => 'setOrdinal', + 'method' => 'setMethod', + 'withholdTaxRefundIfPayIsZero' => 'setWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'setTaxAndNi', + 'fpsFields' => 'setFpsFields', + 'tags' => 'setTags', + 'basis' => 'setBasis', + 'nationalMinimumWage' => 'setNationalMinimumWage', + 'payCode' => 'setPayCode', + 'mileageVehicleType' => 'setMileageVehicleType', + 'mapsMiles' => 'setMapsMiles', + 'payAmount' => 'setPayAmount', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'baseHourlyRate' => 'setBaseHourlyRate', + 'baseDailyRate' => 'setBaseDailyRate', + 'basicPay' => 'setBasicPay', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'niTable' => 'setNiTable', + 'regularPayLines' => 'setRegularPayLines', + 'excludedRegularPayLines' => 'setExcludedRegularPayLines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'period' => 'getPeriod', + 'ordinal' => 'getOrdinal', + 'method' => 'getMethod', + 'withholdTaxRefundIfPayIsZero' => 'getWithholdTaxRefundIfPayIsZero', + 'taxAndNi' => 'getTaxAndNi', + 'fpsFields' => 'getFpsFields', + 'tags' => 'getTags', + 'basis' => 'getBasis', + 'nationalMinimumWage' => 'getNationalMinimumWage', + 'payCode' => 'getPayCode', + 'mileageVehicleType' => 'getMileageVehicleType', + 'mapsMiles' => 'getMapsMiles', + 'payAmount' => 'getPayAmount', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'baseHourlyRate' => 'getBaseHourlyRate', + 'baseDailyRate' => 'getBaseDailyRate', + 'basicPay' => 'getBasicPay', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'niTable' => 'getNiTable', + 'regularPayLines' => 'getRegularPayLines', + 'excludedRegularPayLines' => 'getExcludedRegularPayLines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('withholdTaxRefundIfPayIsZero', $data ?? [], null); + $this->setIfExists('taxAndNi', $data ?? [], null); + $this->setIfExists('fpsFields', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('nationalMinimumWage', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('mileageVehicleType', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('baseHourlyRate', $data ?? [], null); + $this->setIfExists('baseDailyRate', $data ?? [], null); + $this->setIfExists('basicPay', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('regularPayLines', $data ?? [], null); + $this->setIfExists('excludedRegularPayLines', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets period + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $period period + * + * @return $this + */ + public function setPeriod(?\SynergiTech\Staffology\Model\PayPeriods $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal Indicates whether to use first, second, third (etc) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets method + * + * @return \SynergiTech\Staffology\Model\PayMethod|null + */ + public function getMethod(): ?\SynergiTech\Staffology\Model\PayMethod + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param \SynergiTech\Staffology\Model\PayMethod|null $method method + * + * @return $this + */ + public function setMethod(?\SynergiTech\Staffology\Model\PayMethod $method): static + { + if (is_null($method)) { + throw new InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets withholdTaxRefundIfPayIsZero + * + * @return bool|null + */ + public function getWithholdTaxRefundIfPayIsZero(): ?bool + { + return $this->container['withholdTaxRefundIfPayIsZero']; + } + + /** + * Sets withholdTaxRefundIfPayIsZero + * + * @param bool|null $withholdTaxRefundIfPayIsZero If you don't want negative PAYE values when the Gross pay is zero, set this to true + * + * @return $this + */ + public function setWithholdTaxRefundIfPayIsZero(?bool $withholdTaxRefundIfPayIsZero): static + { + if (is_null($withholdTaxRefundIfPayIsZero)) { + throw new InvalidArgumentException('non-nullable withholdTaxRefundIfPayIsZero cannot be null'); + } + $this->container['withholdTaxRefundIfPayIsZero'] = $withholdTaxRefundIfPayIsZero; + + return $this; + } + + /** + * Gets taxAndNi + * + * @return \SynergiTech\Staffology\Model\TaxAndNi|null + */ + public function getTaxAndNi(): ?\SynergiTech\Staffology\Model\TaxAndNi + { + return $this->container['taxAndNi']; + } + + /** + * Sets taxAndNi + * + * @param \SynergiTech\Staffology\Model\TaxAndNi|null $taxAndNi taxAndNi + * + * @return $this + */ + public function setTaxAndNi(?\SynergiTech\Staffology\Model\TaxAndNi $taxAndNi): static + { + if (is_null($taxAndNi)) { + throw new InvalidArgumentException('non-nullable taxAndNi cannot be null'); + } + $this->container['taxAndNi'] = $taxAndNi; + + return $this; + } + + /** + * Gets fpsFields + * + * @return \SynergiTech\Staffology\Model\FpsFields|null + */ + public function getFpsFields(): ?\SynergiTech\Staffology\Model\FpsFields + { + return $this->container['fpsFields']; + } + + /** + * Sets fpsFields + * + * @param \SynergiTech\Staffology\Model\FpsFields|null $fpsFields fpsFields + * + * @return $this + */ + public function setFpsFields(?\SynergiTech\Staffology\Model\FpsFields $fpsFields): static + { + if (is_null($fpsFields)) { + throw new InvalidArgumentException('non-nullable fpsFields cannot be null'); + } + $this->container['fpsFields'] = $fpsFields; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets nationalMinimumWage + * + * @return bool|null + */ + public function getNationalMinimumWage(): ?bool + { + return $this->container['nationalMinimumWage']; + } + + /** + * Sets nationalMinimumWage + * + * @param bool|null $nationalMinimumWage nationalMinimumWage + * + * @return $this + */ + public function setNationalMinimumWage(?bool $nationalMinimumWage): static + { + if (is_null($nationalMinimumWage)) { + throw new InvalidArgumentException('non-nullable nationalMinimumWage cannot be null'); + } + $this->container['nationalMinimumWage'] = $nationalMinimumWage; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want the Employees pay to be allocated to a code other than BASIC, specify it here + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets mileageVehicleType + * + * @return \SynergiTech\Staffology\Model\MileageVehicleType|null + */ + public function getMileageVehicleType(): ?\SynergiTech\Staffology\Model\MileageVehicleType + { + return $this->container['mileageVehicleType']; + } + + /** + * Sets mileageVehicleType + * + * @param \SynergiTech\Staffology\Model\MileageVehicleType|null $mileageVehicleType mileageVehicleType + * + * @return $this + */ + public function setMileageVehicleType(?\SynergiTech\Staffology\Model\MileageVehicleType $mileageVehicleType): static + { + if (is_null($mileageVehicleType)) { + throw new InvalidArgumentException('non-nullable mileageVehicleType cannot be null'); + } + $this->container['mileageVehicleType'] = $mileageVehicleType; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles The number of miles to pay for as Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + array_push($this->openAPINullablesSetToNull, 'mapsMiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mapsMiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets baseHourlyRate + * + * @return float|null + */ + public function getBaseHourlyRate(): ?float + { + return $this->container['baseHourlyRate']; + } + + /** + * Sets baseHourlyRate + * + * @param float|null $baseHourlyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base hourly rate. Eg Overtime. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseHourlyRate(?float $baseHourlyRate): static + { + if (is_null($baseHourlyRate)) { + throw new InvalidArgumentException('non-nullable baseHourlyRate cannot be null'); + } + $this->container['baseHourlyRate'] = $baseHourlyRate; + + return $this; + } + + /** + * Gets baseDailyRate + * + * @return float|null + */ + public function getBaseDailyRate(): ?float + { + return $this->container['baseDailyRate']; + } + + /** + * Sets baseDailyRate + * + * @param float|null $baseDailyRate This property is used to calculate values for PayCodes that are set as multiples of the employees base daily rate. Eg sick. If this is set as zero then we'll attempt to calculate a value based on the other fields + * + * @return $this + */ + public function setBaseDailyRate(?float $baseDailyRate): static + { + if (is_null($baseDailyRate)) { + throw new InvalidArgumentException('non-nullable baseDailyRate cannot be null'); + } + $this->container['baseDailyRate'] = $baseDailyRate; + + return $this; + } + + /** + * Gets basicPay + * + * @return float|null + */ + public function getBasicPay(): ?float + { + return $this->container['basicPay']; + } + + /** + * Sets basicPay + * + * @param float|null $basicPay The amount of basic pay the Employee is regularly paid each period This amount is the combined total of all pay elements that contribute to basic pay + * + * @return $this + */ + public function setBasicPay(?float $basicPay): static + { + if (is_null($basicPay)) { + throw new InvalidArgumentException('non-nullable basicPay cannot be null'); + } + $this->container['basicPay'] = $basicPay; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave This sets whether the PayLine should be automatically adjusted or not for: Leave Entries; Starters/Leavers; PayLine effectiveFrom and effectiveTo values falling mid-way through a PayRun + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets niTable + * + * @return string|null + */ + public function getNiTable(): ?string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string|null $niTable niTable + * + * @return $this + */ + public function setNiTable(?string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets regularPayLines + * + * @return \SynergiTech\Staffology\Model\PayLine[]|null + */ + public function getRegularPayLines(): ?array + { + return $this->container['regularPayLines']; + } + + /** + * Sets regularPayLines + * + * @param \SynergiTech\Staffology\Model\PayLine[]|null $regularPayLines These are used to make additions/deductions to the pay for this Employee. You do not need to include Pension, Tax, NI, Loan Repayments, etc as these will all be automatically created. + * + * @return $this + */ + public function setRegularPayLines(?array $regularPayLines): static + { + if (is_null($regularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'regularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('regularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['regularPayLines'] = $regularPayLines; + + return $this; + } + + /** + * Gets excludedRegularPayLines + * + * @return \SynergiTech\Staffology\Model\PayLine[]|null + */ + public function getExcludedRegularPayLines(): ?array + { + return $this->container['excludedRegularPayLines']; + } + + /** + * Sets excludedRegularPayLines + * + * @param \SynergiTech\Staffology\Model\PayLine[]|null $excludedRegularPayLines These used to store the PayLines that have been excluded from RegularPaylines. + * + * @return $this + */ + public function setExcludedRegularPayLines(?array $excludedRegularPayLines): static + { + if (is_null($excludedRegularPayLines)) { + array_push($this->openAPINullablesSetToNull, 'excludedRegularPayLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('excludedRegularPayLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['excludedRegularPayLines'] = $excludedRegularPayLines; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayOptionsImport.php b/src/Model/PayOptionsImport.php new file mode 100644 index 0000000..a5d9199 --- /dev/null +++ b/src/Model/PayOptionsImport.php @@ -0,0 +1,1262 @@ + + */ +class PayOptionsImport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayOptionsImport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employerIdentifier' => 'string', + 'payrollCode' => 'string', + 'payAmount' => 'float', + 'basis' => '\SynergiTech\Staffology\Model\PayBasis', + 'payCode' => 'string', + 'roleReference' => 'string', + 'payAmountMultiplier' => 'float', + 'note' => 'string', + 'tags' => 'string[]', + 'isNetToGross' => 'bool', + 'department' => 'string', + 'costCentre' => 'string', + 'analysisCategoryCodes' => '\SynergiTech\Staffology\Model\AnalysisCategoryCodes[]', + 'lines' => '\SynergiTech\Staffology\Model\PayLine[]', + 'effectiveFrom' => '\DateTime', + 'effectiveTo' => '\DateTime', + 'isAutomaticBackPay' => 'bool', + 'ignoreInitialBackPay' => 'bool', + 'contributesToBasicPay' => 'bool', + 'autoAdjustForLeave' => 'bool', + 'paySpine' => 'string', + 'payGrade' => 'string', + 'spinePoint' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employerIdentifier' => null, + 'payrollCode' => null, + 'payAmount' => 'double', + 'basis' => null, + 'payCode' => null, + 'roleReference' => null, + 'payAmountMultiplier' => 'double', + 'note' => null, + 'tags' => null, + 'isNetToGross' => null, + 'department' => null, + 'costCentre' => null, + 'analysisCategoryCodes' => null, + 'lines' => null, + 'effectiveFrom' => 'date', + 'effectiveTo' => 'date', + 'isAutomaticBackPay' => null, + 'ignoreInitialBackPay' => null, + 'contributesToBasicPay' => null, + 'autoAdjustForLeave' => null, + 'paySpine' => null, + 'payGrade' => null, + 'spinePoint' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employerIdentifier' => true, + 'payrollCode' => true, + 'payAmount' => false, + 'basis' => false, + 'payCode' => true, + 'roleReference' => true, + 'payAmountMultiplier' => false, + 'note' => true, + 'tags' => true, + 'isNetToGross' => false, + 'department' => true, + 'costCentre' => true, + 'analysisCategoryCodes' => true, + 'lines' => true, + 'effectiveFrom' => true, + 'effectiveTo' => true, + 'isAutomaticBackPay' => false, + 'ignoreInitialBackPay' => false, + 'contributesToBasicPay' => false, + 'autoAdjustForLeave' => false, + 'paySpine' => true, + 'payGrade' => true, + 'spinePoint' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employerIdentifier' => 'employerIdentifier', + 'payrollCode' => 'payrollCode', + 'payAmount' => 'payAmount', + 'basis' => 'basis', + 'payCode' => 'payCode', + 'roleReference' => 'roleReference', + 'payAmountMultiplier' => 'payAmountMultiplier', + 'note' => 'note', + 'tags' => 'tags', + 'isNetToGross' => 'isNetToGross', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'analysisCategoryCodes' => 'analysisCategoryCodes', + 'lines' => 'lines', + 'effectiveFrom' => 'effectiveFrom', + 'effectiveTo' => 'effectiveTo', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'ignoreInitialBackPay' => 'ignoreInitialBackPay', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'autoAdjustForLeave' => 'autoAdjustForLeave', + 'paySpine' => 'paySpine', + 'payGrade' => 'payGrade', + 'spinePoint' => 'spinePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employerIdentifier' => 'setEmployerIdentifier', + 'payrollCode' => 'setPayrollCode', + 'payAmount' => 'setPayAmount', + 'basis' => 'setBasis', + 'payCode' => 'setPayCode', + 'roleReference' => 'setRoleReference', + 'payAmountMultiplier' => 'setPayAmountMultiplier', + 'note' => 'setNote', + 'tags' => 'setTags', + 'isNetToGross' => 'setIsNetToGross', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'analysisCategoryCodes' => 'setAnalysisCategoryCodes', + 'lines' => 'setLines', + 'effectiveFrom' => 'setEffectiveFrom', + 'effectiveTo' => 'setEffectiveTo', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'setIgnoreInitialBackPay', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'autoAdjustForLeave' => 'setAutoAdjustForLeave', + 'paySpine' => 'setPaySpine', + 'payGrade' => 'setPayGrade', + 'spinePoint' => 'setSpinePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employerIdentifier' => 'getEmployerIdentifier', + 'payrollCode' => 'getPayrollCode', + 'payAmount' => 'getPayAmount', + 'basis' => 'getBasis', + 'payCode' => 'getPayCode', + 'roleReference' => 'getRoleReference', + 'payAmountMultiplier' => 'getPayAmountMultiplier', + 'note' => 'getNote', + 'tags' => 'getTags', + 'isNetToGross' => 'getIsNetToGross', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'analysisCategoryCodes' => 'getAnalysisCategoryCodes', + 'lines' => 'getLines', + 'effectiveFrom' => 'getEffectiveFrom', + 'effectiveTo' => 'getEffectiveTo', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'ignoreInitialBackPay' => 'getIgnoreInitialBackPay', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'autoAdjustForLeave' => 'getAutoAdjustForLeave', + 'paySpine' => 'getPaySpine', + 'payGrade' => 'getPayGrade', + 'spinePoint' => 'getSpinePoint' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employerIdentifier', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('payAmount', $data ?? [], null); + $this->setIfExists('basis', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('roleReference', $data ?? [], null); + $this->setIfExists('payAmountMultiplier', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('analysisCategoryCodes', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('effectiveTo', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPay', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('autoAdjustForLeave', $data ?? [], null); + $this->setIfExists('paySpine', $data ?? [], null); + $this->setIfExists('payGrade', $data ?? [], null); + $this->setIfExists('spinePoint', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employerIdentifier + * + * @return string|null + */ + public function getEmployerIdentifier(): ?string + { + return $this->container['employerIdentifier']; + } + + /** + * Sets employerIdentifier + * + * @param string|null $employerIdentifier Optional. But if one entry has it then all must. Allows you to import to multiple employers by specifying the Employers AlternativeIdentifier + * + * @return $this + */ + public function setEmployerIdentifier(?string $employerIdentifier): static + { + if (is_null($employerIdentifier)) { + array_push($this->openAPINullablesSetToNull, 'employerIdentifier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerIdentifier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerIdentifier'] = $employerIdentifier; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode The payroll code of the employee to update + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets payAmount + * + * @return float|null + */ + public function getPayAmount(): ?float + { + return $this->container['payAmount']; + } + + /** + * Sets payAmount + * + * @param float|null $payAmount The amount the Employee is regularly paid each period + * + * @return $this + */ + public function setPayAmount(?float $payAmount): static + { + if (is_null($payAmount)) { + throw new InvalidArgumentException('non-nullable payAmount cannot be null'); + } + $this->container['payAmount'] = $payAmount; + + return $this; + } + + /** + * Gets basis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['basis']; + } + + /** + * Sets basis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $basis basis + * + * @return $this + */ + public function setBasis(?\SynergiTech\Staffology\Model\PayBasis $basis): static + { + if (is_null($basis)) { + throw new InvalidArgumentException('non-nullable basis cannot be null'); + } + $this->container['basis'] = $basis; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode If you want to override the PayCode used for the Basic Pay then set the code here, otherwise leave this blank and the default will be used. + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets roleReference + * + * @return string|null + */ + public function getRoleReference(): ?string + { + return $this->container['roleReference']; + } + + /** + * Sets roleReference + * + * @param string|null $roleReference This is the unique reference of the Role that the employee is assigned to. + * + * @return $this + */ + public function setRoleReference(?string $roleReference): static + { + if (is_null($roleReference)) { + array_push($this->openAPINullablesSetToNull, 'roleReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleReference'] = $roleReference; + + return $this; + } + + /** + * Gets payAmountMultiplier + * + * @return float|null + */ + public function getPayAmountMultiplier(): ?float + { + return $this->container['payAmountMultiplier']; + } + + /** + * Sets payAmountMultiplier + * + * @param float|null $payAmountMultiplier This property is irrelevant if the basis is Monthly. But if the basis is Daily or Hourly then this property sets how many days/hours the employee should be paid for in the period. + * + * @return $this + */ + public function setPayAmountMultiplier(?float $payAmountMultiplier): static + { + if (is_null($payAmountMultiplier)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplier cannot be null'); + } + $this->container['payAmountMultiplier'] = $payAmountMultiplier; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note Any note that you'd like to appear on the payslip + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return $this + */ + public function setTags(?array $tags): static + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross isNetToGross + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department Any Department that you'd like to appear on the payslip + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return string|null + */ + public function getCostCentre(): ?string + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param string|null $costCentre Any CostCentre that you'd like to appear on the payslip + * + * @return $this + */ + public function setCostCentre(?string $costCentre): static + { + if (is_null($costCentre)) { + array_push($this->openAPINullablesSetToNull, 'costCentre'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentre', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets analysisCategoryCodes + * + * @return \SynergiTech\Staffology\Model\AnalysisCategoryCodes[]|null + */ + public function getAnalysisCategoryCodes(): ?array + { + return $this->container['analysisCategoryCodes']; + } + + /** + * Sets analysisCategoryCodes + * + * @param \SynergiTech\Staffology\Model\AnalysisCategoryCodes[]|null $analysisCategoryCodes List of Analysis Category Codes associated with this item on the payslip. + * + * @return $this + */ + public function setAnalysisCategoryCodes(?array $analysisCategoryCodes): static + { + if (is_null($analysisCategoryCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodes'] = $analysisCategoryCodes; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom EffectiveFrom date for imported pay lines + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets effectiveTo + * + * @return \DateTime|null + */ + public function getEffectiveTo(): ?\DateTime + { + return $this->container['effectiveTo']; + } + + /** + * Sets effectiveTo + * + * @param \DateTime|null $effectiveTo EffectiveTo date for imported pay lines + * + * @return $this + */ + public function setEffectiveTo(?\DateTime $effectiveTo): static + { + if (is_null($effectiveTo)) { + array_push($this->openAPINullablesSetToNull, 'effectiveTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveTo'] = $effectiveTo; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay IsAutomaticBackPay for imported pay lines + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets ignoreInitialBackPay + * + * @return bool|null + */ + public function getIgnoreInitialBackPay(): ?bool + { + return $this->container['ignoreInitialBackPay']; + } + + /** + * Sets ignoreInitialBackPay + * + * @param bool|null $ignoreInitialBackPay IgnoreInitialBackPay for imported pay lines + * + * @return $this + */ + public function setIgnoreInitialBackPay(?bool $ignoreInitialBackPay): static + { + if (is_null($ignoreInitialBackPay)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPay cannot be null'); + } + $this->container['ignoreInitialBackPay'] = $ignoreInitialBackPay; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay ContributesToBasicPay for imported pay lines + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets autoAdjustForLeave + * + * @return bool|null + */ + public function getAutoAdjustForLeave(): ?bool + { + return $this->container['autoAdjustForLeave']; + } + + /** + * Sets autoAdjustForLeave + * + * @param bool|null $autoAdjustForLeave AutoAdjustForLeave for imported pay lines + * + * @return $this + */ + public function setAutoAdjustForLeave(?bool $autoAdjustForLeave): static + { + if (is_null($autoAdjustForLeave)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeave cannot be null'); + } + $this->container['autoAdjustForLeave'] = $autoAdjustForLeave; + + return $this; + } + + /** + * Gets paySpine + * + * @return string|null + */ + public function getPaySpine(): ?string + { + return $this->container['paySpine']; + } + + /** + * Sets paySpine + * + * @param string|null $paySpine PaySpine for imported pay lines + * + * @return $this + */ + public function setPaySpine(?string $paySpine): static + { + if (is_null($paySpine)) { + array_push($this->openAPINullablesSetToNull, 'paySpine'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySpine', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySpine'] = $paySpine; + + return $this; + } + + /** + * Gets payGrade + * + * @return string|null + */ + public function getPayGrade(): ?string + { + return $this->container['payGrade']; + } + + /** + * Sets payGrade + * + * @param string|null $payGrade PayGrade for imported pay lines + * + * @return $this + */ + public function setPayGrade(?string $payGrade): static + { + if (is_null($payGrade)) { + array_push($this->openAPINullablesSetToNull, 'payGrade'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payGrade', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payGrade'] = $payGrade; + + return $this; + } + + /** + * Gets spinePoint + * + * @return string|null + */ + public function getSpinePoint(): ?string + { + return $this->container['spinePoint']; + } + + /** + * Sets spinePoint + * + * @param string|null $spinePoint SpinePoint for imported pay lines + * + * @return $this + */ + public function setSpinePoint(?string $spinePoint): static + { + if (is_null($spinePoint)) { + array_push($this->openAPINullablesSetToNull, 'spinePoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinePoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinePoint'] = $spinePoint; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayPeriodEventType.php b/src/Model/PayPeriodEventType.php new file mode 100644 index 0000000..47514ea --- /dev/null +++ b/src/Model/PayPeriodEventType.php @@ -0,0 +1,54 @@ + + */ +class PayRun implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRun'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'taxMonth' => 'int', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'paymentDate' => '\DateTime', + 'employeeCount' => 'int', + 'subContractorCount' => 'int', + 'nonRtiEmployeeCount' => 'int', + 'totals' => '\SynergiTech\Staffology\Model\PayRunTotals', + 'payslipScheduledDateTime' => '\DateTime', + 'state' => '\SynergiTech\Staffology\Model\PayRunState', + 'isClosed' => 'bool', + 'isRolledBack' => 'bool', + 'dateClosed' => '\DateTime', + 'autoPilotCloseDate' => '\DateTime', + 'entries' => '\SynergiTech\Staffology\Model\Item[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'taxMonth' => 'int32', + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'startDate' => 'date', + 'endDate' => 'date', + 'paymentDate' => 'date', + 'employeeCount' => 'int32', + 'subContractorCount' => 'int32', + 'nonRtiEmployeeCount' => 'int32', + 'totals' => null, + 'payslipScheduledDateTime' => 'date', + 'state' => null, + 'isClosed' => null, + 'isRolledBack' => null, + 'dateClosed' => 'date-time', + 'autoPilotCloseDate' => 'date', + 'entries' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'taxMonth' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'startDate' => false, + 'endDate' => false, + 'paymentDate' => false, + 'employeeCount' => false, + 'subContractorCount' => false, + 'nonRtiEmployeeCount' => false, + 'totals' => false, + 'payslipScheduledDateTime' => true, + 'state' => false, + 'isClosed' => false, + 'isRolledBack' => false, + 'dateClosed' => true, + 'autoPilotCloseDate' => true, + 'entries' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'taxMonth' => 'taxMonth', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'paymentDate' => 'paymentDate', + 'employeeCount' => 'employeeCount', + 'subContractorCount' => 'subContractorCount', + 'nonRtiEmployeeCount' => 'nonRtiEmployeeCount', + 'totals' => 'totals', + 'payslipScheduledDateTime' => 'payslipScheduledDateTime', + 'state' => 'state', + 'isClosed' => 'isClosed', + 'isRolledBack' => 'isRolledBack', + 'dateClosed' => 'dateClosed', + 'autoPilotCloseDate' => 'autoPilotCloseDate', + 'entries' => 'entries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'taxMonth' => 'setTaxMonth', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'paymentDate' => 'setPaymentDate', + 'employeeCount' => 'setEmployeeCount', + 'subContractorCount' => 'setSubContractorCount', + 'nonRtiEmployeeCount' => 'setNonRtiEmployeeCount', + 'totals' => 'setTotals', + 'payslipScheduledDateTime' => 'setPayslipScheduledDateTime', + 'state' => 'setState', + 'isClosed' => 'setIsClosed', + 'isRolledBack' => 'setIsRolledBack', + 'dateClosed' => 'setDateClosed', + 'autoPilotCloseDate' => 'setAutoPilotCloseDate', + 'entries' => 'setEntries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'taxMonth' => 'getTaxMonth', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'paymentDate' => 'getPaymentDate', + 'employeeCount' => 'getEmployeeCount', + 'subContractorCount' => 'getSubContractorCount', + 'nonRtiEmployeeCount' => 'getNonRtiEmployeeCount', + 'totals' => 'getTotals', + 'payslipScheduledDateTime' => 'getPayslipScheduledDateTime', + 'state' => 'getState', + 'isClosed' => 'getIsClosed', + 'isRolledBack' => 'getIsRolledBack', + 'dateClosed' => 'getDateClosed', + 'autoPilotCloseDate' => 'getAutoPilotCloseDate', + 'entries' => 'getEntries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('subContractorCount', $data ?? [], null); + $this->setIfExists('nonRtiEmployeeCount', $data ?? [], null); + $this->setIfExists('totals', $data ?? [], null); + $this->setIfExists('payslipScheduledDateTime', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('isClosed', $data ?? [], null); + $this->setIfExists('isRolledBack', $data ?? [], null); + $this->setIfExists('dateClosed', $data ?? [], null); + $this->setIfExists('autoPilotCloseDate', $data ?? [], null); + $this->setIfExists('entries', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth [readonly] The Tax Month that the Payment Date falls in + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal [readonly] Indicates whether this uses first, second, third (etc.) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period [readonly] The period (i.e, Tax Week or Tax Month) that this PayRun is for. + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate [readonly] The start date of the period this PayRun covers + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate [readonly] The end date of the period this PayRun covers + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate [readonly] The intended date that Employees will be paid, although this can be changed on a per PayRunEntry basis + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of Employees included in this PayRun (including any CIS Subcontractors) + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets subContractorCount + * + * @return int|null + */ + public function getSubContractorCount(): ?int + { + return $this->container['subContractorCount']; + } + + /** + * Sets subContractorCount + * + * @param int|null $subContractorCount [readonly] The number of CIS Subcontractors included in this PayRun + * + * @return $this + */ + public function setSubContractorCount(?int $subContractorCount): static + { + if (is_null($subContractorCount)) { + throw new InvalidArgumentException('non-nullable subContractorCount cannot be null'); + } + $this->container['subContractorCount'] = $subContractorCount; + + return $this; + } + + /** + * Gets nonRtiEmployeeCount + * + * @return int|null + */ + public function getNonRtiEmployeeCount(): ?int + { + return $this->container['nonRtiEmployeeCount']; + } + + /** + * Sets nonRtiEmployeeCount + * + * @param int|null $nonRtiEmployeeCount [readonly] The number of employees excluded from the RTI submission in this PayRun + * + * @return $this + */ + public function setNonRtiEmployeeCount(?int $nonRtiEmployeeCount): static + { + if (is_null($nonRtiEmployeeCount)) { + throw new InvalidArgumentException('non-nullable nonRtiEmployeeCount cannot be null'); + } + $this->container['nonRtiEmployeeCount'] = $nonRtiEmployeeCount; + + return $this; + } + + /** + * Gets totals + * + * @return \SynergiTech\Staffology\Model\PayRunTotals|null + */ + public function getTotals(): ?\SynergiTech\Staffology\Model\PayRunTotals + { + return $this->container['totals']; + } + + /** + * Sets totals + * + * @param \SynergiTech\Staffology\Model\PayRunTotals|null $totals totals + * + * @return $this + */ + public function setTotals(?\SynergiTech\Staffology\Model\PayRunTotals $totals): static + { + if (is_null($totals)) { + throw new InvalidArgumentException('non-nullable totals cannot be null'); + } + $this->container['totals'] = $totals; + + return $this; + } + + /** + * Gets payslipScheduledDateTime + * + * @return \DateTime|null + */ + public function getPayslipScheduledDateTime(): ?\DateTime + { + return $this->container['payslipScheduledDateTime']; + } + + /** + * Sets payslipScheduledDateTime + * + * @param \DateTime|null $payslipScheduledDateTime The scheduled date time for sending payslips by email. + * + * @return $this + */ + public function setPayslipScheduledDateTime(?\DateTime $payslipScheduledDateTime): static + { + if (is_null($payslipScheduledDateTime)) { + array_push($this->openAPINullablesSetToNull, 'payslipScheduledDateTime'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payslipScheduledDateTime', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payslipScheduledDateTime'] = $payslipScheduledDateTime; + + return $this; + } + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\PayRunState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\PayRunState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\PayRunState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\PayRunState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets isClosed + * + * @return bool|null + */ + public function getIsClosed(): ?bool + { + return $this->container['isClosed']; + } + + /** + * Sets isClosed + * + * @param bool|null $isClosed [readonly] Set to True if the PayRun is Finalised and changes can no longer be made + * + * @return $this + */ + public function setIsClosed(?bool $isClosed): static + { + if (is_null($isClosed)) { + throw new InvalidArgumentException('non-nullable isClosed cannot be null'); + } + $this->container['isClosed'] = $isClosed; + + return $this; + } + + /** + * Gets isRolledBack + * + * @return bool|null + */ + public function getIsRolledBack(): ?bool + { + return $this->container['isRolledBack']; + } + + /** + * Sets isRolledBack + * + * @param bool|null $isRolledBack [readonly] Set to True if the PayRun is currently rolled back + * + * @return $this + */ + public function setIsRolledBack(?bool $isRolledBack): static + { + if (is_null($isRolledBack)) { + throw new InvalidArgumentException('non-nullable isRolledBack cannot be null'); + } + $this->container['isRolledBack'] = $isRolledBack; + + return $this; + } + + /** + * Gets dateClosed + * + * @return \DateTime|null + */ + public function getDateClosed(): ?\DateTime + { + return $this->container['dateClosed']; + } + + /** + * Sets dateClosed + * + * @param \DateTime|null $dateClosed dateClosed + * + * @return $this + */ + public function setDateClosed(?\DateTime $dateClosed): static + { + if (is_null($dateClosed)) { + array_push($this->openAPINullablesSetToNull, 'dateClosed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dateClosed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dateClosed'] = $dateClosed; + + return $this; + } + + /** + * Gets autoPilotCloseDate + * + * @return \DateTime|null + */ + public function getAutoPilotCloseDate(): ?\DateTime + { + return $this->container['autoPilotCloseDate']; + } + + /** + * Sets autoPilotCloseDate + * + * @param \DateTime|null $autoPilotCloseDate [readonly] If AutoPilot is enabled in the AutomationSettings for the Employer then this property will tell you when the payrun will be automatically closed + * + * @return $this + */ + public function setAutoPilotCloseDate(?\DateTime $autoPilotCloseDate): static + { + if (is_null($autoPilotCloseDate)) { + array_push($this->openAPINullablesSetToNull, 'autoPilotCloseDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('autoPilotCloseDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['autoPilotCloseDate'] = $autoPilotCloseDate; + + return $this; + } + + /** + * Gets entries + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getEntries(): ?array + { + return $this->container['entries']; + } + + /** + * Sets entries + * + * @param \SynergiTech\Staffology\Model\Item[]|null $entries [readonly] The PayRunEntries that make up this PayRun. This is populate automatically when you start a PayRun. + * + * @return $this + */ + public function setEntries(?array $entries): static + { + if (is_null($entries)) { + array_push($this->openAPINullablesSetToNull, 'entries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entries'] = $entries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunChanges.php b/src/Model/PayRunChanges.php new file mode 100644 index 0000000..5217ced --- /dev/null +++ b/src/Model/PayRunChanges.php @@ -0,0 +1,415 @@ + + */ +class PayRunChanges implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunChanges'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payRunEntries' => '\SynergiTech\Staffology\Model\Item[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payRunEntries' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payRunEntries' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payRunEntries' => 'payRunEntries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payRunEntries' => 'setPayRunEntries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payRunEntries' => 'getPayRunEntries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payRunEntries', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payRunEntries + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getPayRunEntries(): ?array + { + return $this->container['payRunEntries']; + } + + /** + * Sets payRunEntries + * + * @param \SynergiTech\Staffology\Model\Item[]|null $payRunEntries A list of PayRunEntries where the PayRunEntry itself has been modified and.or the related Employee record was changed + * + * @return $this + */ + public function setPayRunEntries(?array $payRunEntries): static + { + if (is_null($payRunEntries)) { + array_push($this->openAPINullablesSetToNull, 'payRunEntries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payRunEntries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payRunEntries'] = $payRunEntries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunCsvType.php b/src/Model/PayRunCsvType.php new file mode 100644 index 0000000..4b3e1ac --- /dev/null +++ b/src/Model/PayRunCsvType.php @@ -0,0 +1,49 @@ + + */ +class PayRunEntry implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'taxMonth' => 'int', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'note' => 'string', + 'bacsSubReference' => 'string', + 'bacsHashCode' => 'string', + 'percentageOfWorkingDaysPaidAsNormal' => 'float', + 'workingDaysNotPaidAsNormal' => 'float', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'isNewStarter' => 'bool', + 'unpaidAbsence' => 'bool', + 'hasAttachmentOrders' => 'bool', + 'paymentDate' => '\DateTime', + 'priorPayrollCode' => 'string', + 'pensionSummary' => '\SynergiTech\Staffology\Model\PensionSummary', + 'pensionSummaries' => '\SynergiTech\Staffology\Model\PensionSummary[]', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'totals' => '\SynergiTech\Staffology\Model\PayRunTotals', + 'periodOverrides' => '\SynergiTech\Staffology\Model\ValueOverride[]', + 'totalsYtd' => '\SynergiTech\Staffology\Model\PayRunTotals', + 'totalsYtdOverrides' => '\SynergiTech\Staffology\Model\ValueOverride[]', + 'forcedCisVatAmount' => 'float', + 'holidayAccrued' => 'float', + 'state' => '\SynergiTech\Staffology\Model\PayRunState', + 'isClosed' => 'bool', + 'manualNi' => 'bool', + 'niSplit' => 'bool', + 'nationalInsuranceCalculation' => '\SynergiTech\Staffology\Model\NationalInsuranceCalculation', + 'payrollCodeChanged' => 'bool', + 'aeNotEnroledWarning' => 'bool', + 'fps' => '\SynergiTech\Staffology\Model\Item', + 'emailId' => 'string', + 'recievingOffsetPay' => 'bool', + 'paymentAfterLeaving' => 'bool', + 'umbrellaPayment' => '\SynergiTech\Staffology\Model\UmbrellaPayment', + 'isRemoved' => 'bool', + 'isRolledBack' => 'bool', + 'periodsCovered' => 'int', + 'employeeRolePayItems' => '\SynergiTech\Staffology\Model\EmployeeRolePayItem[]', + 'warnings' => '\SynergiTech\Staffology\Model\PayRunEntryWarningType', + 'niLetterError' => '\SynergiTech\Staffology\Model\NiLetterError', + 'teachersPensionAgeWarning' => '\SynergiTech\Staffology\Model\TeachersPensionAgeWarning', + 'id' => 'string', + 'personalDetails' => '\SynergiTech\Staffology\Model\PersonalDetails', + 'employmentDetails' => '\SynergiTech\Staffology\Model\EmploymentDetails', + 'payOptions' => '\SynergiTech\Staffology\Model\PayOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => null, + 'taxMonth' => 'int32', + 'startDate' => 'date', + 'endDate' => 'date', + 'note' => null, + 'bacsSubReference' => null, + 'bacsHashCode' => null, + 'percentageOfWorkingDaysPaidAsNormal' => 'double', + 'workingDaysNotPaidAsNormal' => 'double', + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'isNewStarter' => null, + 'unpaidAbsence' => null, + 'hasAttachmentOrders' => null, + 'paymentDate' => 'date', + 'priorPayrollCode' => null, + 'pensionSummary' => null, + 'pensionSummaries' => null, + 'employee' => null, + 'totals' => null, + 'periodOverrides' => null, + 'totalsYtd' => null, + 'totalsYtdOverrides' => null, + 'forcedCisVatAmount' => 'double', + 'holidayAccrued' => 'double', + 'state' => null, + 'isClosed' => null, + 'manualNi' => null, + 'niSplit' => null, + 'nationalInsuranceCalculation' => null, + 'payrollCodeChanged' => null, + 'aeNotEnroledWarning' => null, + 'fps' => null, + 'emailId' => 'uuid', + 'recievingOffsetPay' => null, + 'paymentAfterLeaving' => null, + 'umbrellaPayment' => null, + 'isRemoved' => null, + 'isRolledBack' => null, + 'periodsCovered' => 'int32', + 'employeeRolePayItems' => null, + 'warnings' => null, + 'niLetterError' => null, + 'teachersPensionAgeWarning' => null, + 'id' => 'uuid', + 'personalDetails' => null, + 'employmentDetails' => null, + 'payOptions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'taxMonth' => false, + 'startDate' => false, + 'endDate' => false, + 'note' => true, + 'bacsSubReference' => true, + 'bacsHashCode' => true, + 'percentageOfWorkingDaysPaidAsNormal' => false, + 'workingDaysNotPaidAsNormal' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'isNewStarter' => false, + 'unpaidAbsence' => false, + 'hasAttachmentOrders' => false, + 'paymentDate' => false, + 'priorPayrollCode' => true, + 'pensionSummary' => false, + 'pensionSummaries' => true, + 'employee' => false, + 'totals' => false, + 'periodOverrides' => true, + 'totalsYtd' => false, + 'totalsYtdOverrides' => true, + 'forcedCisVatAmount' => true, + 'holidayAccrued' => false, + 'state' => false, + 'isClosed' => false, + 'manualNi' => false, + 'niSplit' => false, + 'nationalInsuranceCalculation' => false, + 'payrollCodeChanged' => false, + 'aeNotEnroledWarning' => false, + 'fps' => false, + 'emailId' => true, + 'recievingOffsetPay' => false, + 'paymentAfterLeaving' => false, + 'umbrellaPayment' => false, + 'isRemoved' => false, + 'isRolledBack' => false, + 'periodsCovered' => false, + 'employeeRolePayItems' => true, + 'warnings' => false, + 'niLetterError' => false, + 'teachersPensionAgeWarning' => false, + 'id' => false, + 'personalDetails' => false, + 'employmentDetails' => false, + 'payOptions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'taxMonth' => 'taxMonth', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'note' => 'note', + 'bacsSubReference' => 'bacsSubReference', + 'bacsHashCode' => 'bacsHashCode', + 'percentageOfWorkingDaysPaidAsNormal' => 'percentageOfWorkingDaysPaidAsNormal', + 'workingDaysNotPaidAsNormal' => 'workingDaysNotPaidAsNormal', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'isNewStarter' => 'isNewStarter', + 'unpaidAbsence' => 'unpaidAbsence', + 'hasAttachmentOrders' => 'hasAttachmentOrders', + 'paymentDate' => 'paymentDate', + 'priorPayrollCode' => 'priorPayrollCode', + 'pensionSummary' => 'pensionSummary', + 'pensionSummaries' => 'pensionSummaries', + 'employee' => 'employee', + 'totals' => 'totals', + 'periodOverrides' => 'periodOverrides', + 'totalsYtd' => 'totalsYtd', + 'totalsYtdOverrides' => 'totalsYtdOverrides', + 'forcedCisVatAmount' => 'forcedCisVatAmount', + 'holidayAccrued' => 'holidayAccrued', + 'state' => 'state', + 'isClosed' => 'isClosed', + 'manualNi' => 'manualNi', + 'niSplit' => 'niSplit', + 'nationalInsuranceCalculation' => 'nationalInsuranceCalculation', + 'payrollCodeChanged' => 'payrollCodeChanged', + 'aeNotEnroledWarning' => 'aeNotEnroledWarning', + 'fps' => 'fps', + 'emailId' => 'emailId', + 'recievingOffsetPay' => 'recievingOffsetPay', + 'paymentAfterLeaving' => 'paymentAfterLeaving', + 'umbrellaPayment' => 'umbrellaPayment', + 'isRemoved' => 'isRemoved', + 'isRolledBack' => 'isRolledBack', + 'periodsCovered' => 'periodsCovered', + 'employeeRolePayItems' => 'employeeRolePayItems', + 'warnings' => 'warnings', + 'niLetterError' => 'niLetterError', + 'teachersPensionAgeWarning' => 'teachersPensionAgeWarning', + 'id' => 'id', + 'personalDetails' => 'personalDetails', + 'employmentDetails' => 'employmentDetails', + 'payOptions' => 'payOptions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'taxMonth' => 'setTaxMonth', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'note' => 'setNote', + 'bacsSubReference' => 'setBacsSubReference', + 'bacsHashCode' => 'setBacsHashCode', + 'percentageOfWorkingDaysPaidAsNormal' => 'setPercentageOfWorkingDaysPaidAsNormal', + 'workingDaysNotPaidAsNormal' => 'setWorkingDaysNotPaidAsNormal', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'isNewStarter' => 'setIsNewStarter', + 'unpaidAbsence' => 'setUnpaidAbsence', + 'hasAttachmentOrders' => 'setHasAttachmentOrders', + 'paymentDate' => 'setPaymentDate', + 'priorPayrollCode' => 'setPriorPayrollCode', + 'pensionSummary' => 'setPensionSummary', + 'pensionSummaries' => 'setPensionSummaries', + 'employee' => 'setEmployee', + 'totals' => 'setTotals', + 'periodOverrides' => 'setPeriodOverrides', + 'totalsYtd' => 'setTotalsYtd', + 'totalsYtdOverrides' => 'setTotalsYtdOverrides', + 'forcedCisVatAmount' => 'setForcedCisVatAmount', + 'holidayAccrued' => 'setHolidayAccrued', + 'state' => 'setState', + 'isClosed' => 'setIsClosed', + 'manualNi' => 'setManualNi', + 'niSplit' => 'setNiSplit', + 'nationalInsuranceCalculation' => 'setNationalInsuranceCalculation', + 'payrollCodeChanged' => 'setPayrollCodeChanged', + 'aeNotEnroledWarning' => 'setAeNotEnroledWarning', + 'fps' => 'setFps', + 'emailId' => 'setEmailId', + 'recievingOffsetPay' => 'setRecievingOffsetPay', + 'paymentAfterLeaving' => 'setPaymentAfterLeaving', + 'umbrellaPayment' => 'setUmbrellaPayment', + 'isRemoved' => 'setIsRemoved', + 'isRolledBack' => 'setIsRolledBack', + 'periodsCovered' => 'setPeriodsCovered', + 'employeeRolePayItems' => 'setEmployeeRolePayItems', + 'warnings' => 'setWarnings', + 'niLetterError' => 'setNiLetterError', + 'teachersPensionAgeWarning' => 'setTeachersPensionAgeWarning', + 'id' => 'setId', + 'personalDetails' => 'setPersonalDetails', + 'employmentDetails' => 'setEmploymentDetails', + 'payOptions' => 'setPayOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'taxMonth' => 'getTaxMonth', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'note' => 'getNote', + 'bacsSubReference' => 'getBacsSubReference', + 'bacsHashCode' => 'getBacsHashCode', + 'percentageOfWorkingDaysPaidAsNormal' => 'getPercentageOfWorkingDaysPaidAsNormal', + 'workingDaysNotPaidAsNormal' => 'getWorkingDaysNotPaidAsNormal', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'isNewStarter' => 'getIsNewStarter', + 'unpaidAbsence' => 'getUnpaidAbsence', + 'hasAttachmentOrders' => 'getHasAttachmentOrders', + 'paymentDate' => 'getPaymentDate', + 'priorPayrollCode' => 'getPriorPayrollCode', + 'pensionSummary' => 'getPensionSummary', + 'pensionSummaries' => 'getPensionSummaries', + 'employee' => 'getEmployee', + 'totals' => 'getTotals', + 'periodOverrides' => 'getPeriodOverrides', + 'totalsYtd' => 'getTotalsYtd', + 'totalsYtdOverrides' => 'getTotalsYtdOverrides', + 'forcedCisVatAmount' => 'getForcedCisVatAmount', + 'holidayAccrued' => 'getHolidayAccrued', + 'state' => 'getState', + 'isClosed' => 'getIsClosed', + 'manualNi' => 'getManualNi', + 'niSplit' => 'getNiSplit', + 'nationalInsuranceCalculation' => 'getNationalInsuranceCalculation', + 'payrollCodeChanged' => 'getPayrollCodeChanged', + 'aeNotEnroledWarning' => 'getAeNotEnroledWarning', + 'fps' => 'getFps', + 'emailId' => 'getEmailId', + 'recievingOffsetPay' => 'getRecievingOffsetPay', + 'paymentAfterLeaving' => 'getPaymentAfterLeaving', + 'umbrellaPayment' => 'getUmbrellaPayment', + 'isRemoved' => 'getIsRemoved', + 'isRolledBack' => 'getIsRolledBack', + 'periodsCovered' => 'getPeriodsCovered', + 'employeeRolePayItems' => 'getEmployeeRolePayItems', + 'warnings' => 'getWarnings', + 'niLetterError' => 'getNiLetterError', + 'teachersPensionAgeWarning' => 'getTeachersPensionAgeWarning', + 'id' => 'getId', + 'personalDetails' => 'getPersonalDetails', + 'employmentDetails' => 'getEmploymentDetails', + 'payOptions' => 'getPayOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('bacsSubReference', $data ?? [], null); + $this->setIfExists('bacsHashCode', $data ?? [], null); + $this->setIfExists('percentageOfWorkingDaysPaidAsNormal', $data ?? [], null); + $this->setIfExists('workingDaysNotPaidAsNormal', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('isNewStarter', $data ?? [], null); + $this->setIfExists('unpaidAbsence', $data ?? [], null); + $this->setIfExists('hasAttachmentOrders', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('priorPayrollCode', $data ?? [], null); + $this->setIfExists('pensionSummary', $data ?? [], null); + $this->setIfExists('pensionSummaries', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('totals', $data ?? [], null); + $this->setIfExists('periodOverrides', $data ?? [], null); + $this->setIfExists('totalsYtd', $data ?? [], null); + $this->setIfExists('totalsYtdOverrides', $data ?? [], null); + $this->setIfExists('forcedCisVatAmount', $data ?? [], null); + $this->setIfExists('holidayAccrued', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('isClosed', $data ?? [], null); + $this->setIfExists('manualNi', $data ?? [], null); + $this->setIfExists('niSplit', $data ?? [], null); + $this->setIfExists('nationalInsuranceCalculation', $data ?? [], null); + $this->setIfExists('payrollCodeChanged', $data ?? [], null); + $this->setIfExists('aeNotEnroledWarning', $data ?? [], null); + $this->setIfExists('fps', $data ?? [], null); + $this->setIfExists('emailId', $data ?? [], null); + $this->setIfExists('recievingOffsetPay', $data ?? [], null); + $this->setIfExists('paymentAfterLeaving', $data ?? [], null); + $this->setIfExists('umbrellaPayment', $data ?? [], null); + $this->setIfExists('isRemoved', $data ?? [], null); + $this->setIfExists('isRolledBack', $data ?? [], null); + $this->setIfExists('periodsCovered', $data ?? [], null); + $this->setIfExists('employeeRolePayItems', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + $this->setIfExists('niLetterError', $data ?? [], null); + $this->setIfExists('teachersPensionAgeWarning', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 500)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 500."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth [readonly] The Tax Month that the Payment Date falls in + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate [readonly] + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate [readonly] + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note Any note that you'd like to appear on the payslip + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 500)) { + throw new InvalidArgumentException('invalid length for $note when calling PayRunEntry., must be smaller than or equal to 500.'); + } + + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets bacsSubReference + * + * @return string|null + */ + public function getBacsSubReference(): ?string + { + return $this->container['bacsSubReference']; + } + + /** + * Sets bacsSubReference + * + * @param string|null $bacsSubReference [readonly] A randomly generated string for use with the RTI Hash Cross Reference + * + * @return $this + */ + public function setBacsSubReference(?string $bacsSubReference): static + { + if (is_null($bacsSubReference)) { + array_push($this->openAPINullablesSetToNull, 'bacsSubReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsSubReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bacsSubReference'] = $bacsSubReference; + + return $this; + } + + /** + * Gets bacsHashCode + * + * @return string|null + */ + public function getBacsHashCode(): ?string + { + return $this->container['bacsHashCode']; + } + + /** + * Sets bacsHashCode + * + * @param string|null $bacsHashCode [readonly] A Hash Code used for RTI BACS Hash Cross Reference + * + * @return $this + */ + public function setBacsHashCode(?string $bacsHashCode): static + { + if (is_null($bacsHashCode)) { + array_push($this->openAPINullablesSetToNull, 'bacsHashCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsHashCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bacsHashCode'] = $bacsHashCode; + + return $this; + } + + /** + * Gets percentageOfWorkingDaysPaidAsNormal + * + * @return float|null + */ + public function getPercentageOfWorkingDaysPaidAsNormal(): ?float + { + return $this->container['percentageOfWorkingDaysPaidAsNormal']; + } + + /** + * Sets percentageOfWorkingDaysPaidAsNormal + * + * @param float|null $percentageOfWorkingDaysPaidAsNormal [readonly] If the employee is paid a set amount per period (ie, not an hourly or daily rate) and there is any Leave that is either Not Paid or Statutory Pay then this value will give the percentage of working days (based on the Working Pattern) that should be paid as normal. If there is no Leave in the period or PayOptions.AutoAdjustForLeave is false, then this will be 1. + * + * @return $this + */ + public function setPercentageOfWorkingDaysPaidAsNormal(?float $percentageOfWorkingDaysPaidAsNormal): static + { + if (is_null($percentageOfWorkingDaysPaidAsNormal)) { + throw new InvalidArgumentException('non-nullable percentageOfWorkingDaysPaidAsNormal cannot be null'); + } + $this->container['percentageOfWorkingDaysPaidAsNormal'] = $percentageOfWorkingDaysPaidAsNormal; + + return $this; + } + + /** + * Gets workingDaysNotPaidAsNormal + * + * @return float|null + */ + public function getWorkingDaysNotPaidAsNormal(): ?float + { + return $this->container['workingDaysNotPaidAsNormal']; + } + + /** + * Sets workingDaysNotPaidAsNormal + * + * @param float|null $workingDaysNotPaidAsNormal [readonly] If PercentageOfWorkingDaysPaidAsNormal has a value other than 1 then this property will tell you how many working days have been deducted from the basic pay due to either being Not Paid or Statutory Pay + * + * @return $this + */ + public function setWorkingDaysNotPaidAsNormal(?float $workingDaysNotPaidAsNormal): static + { + if (is_null($workingDaysNotPaidAsNormal)) { + throw new InvalidArgumentException('non-nullable workingDaysNotPaidAsNormal cannot be null'); + } + $this->container['workingDaysNotPaidAsNormal'] = $workingDaysNotPaidAsNormal; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal [readonly] Indicates whether this uses the first, second, third (etc) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period [readonly] The Tax Week or Tax Month number this PayRunEntry relates to + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets isNewStarter + * + * @return bool|null + */ + public function getIsNewStarter(): ?bool + { + return $this->container['isNewStarter']; + } + + /** + * Sets isNewStarter + * + * @param bool|null $isNewStarter Determines whether or not this Employee will be declared as a new starter on the resulting FPS + * + * @return $this + */ + public function setIsNewStarter(?bool $isNewStarter): static + { + if (is_null($isNewStarter)) { + throw new InvalidArgumentException('non-nullable isNewStarter cannot be null'); + } + $this->container['isNewStarter'] = $isNewStarter; + + return $this; + } + + /** + * Gets unpaidAbsence + * + * @return bool|null + */ + public function getUnpaidAbsence(): ?bool + { + return $this->container['unpaidAbsence']; + } + + /** + * Sets unpaidAbsence + * + * @param bool|null $unpaidAbsence [readonly] Indicates that there was unpaid absence in the pay period + * + * @return $this + */ + public function setUnpaidAbsence(?bool $unpaidAbsence): static + { + if (is_null($unpaidAbsence)) { + throw new InvalidArgumentException('non-nullable unpaidAbsence cannot be null'); + } + $this->container['unpaidAbsence'] = $unpaidAbsence; + + return $this; + } + + /** + * Gets hasAttachmentOrders + * + * @return bool|null + */ + public function getHasAttachmentOrders(): ?bool + { + return $this->container['hasAttachmentOrders']; + } + + /** + * Sets hasAttachmentOrders + * + * @param bool|null $hasAttachmentOrders [readonly] Indicates that there are AttachmentOrders for this Employee in this entry + * + * @return $this + */ + public function setHasAttachmentOrders(?bool $hasAttachmentOrders): static + { + if (is_null($hasAttachmentOrders)) { + throw new InvalidArgumentException('non-nullable hasAttachmentOrders cannot be null'); + } + $this->container['hasAttachmentOrders'] = $hasAttachmentOrders; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate The date this payment was or will be made + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets priorPayrollCode + * + * @return string|null + */ + public function getPriorPayrollCode(): ?string + { + return $this->container['priorPayrollCode']; + } + + /** + * Sets priorPayrollCode + * + * @param string|null $priorPayrollCode [readonly] If the FPS needs to declare a change of PayId then this will contain the previous code It's worked out automatically but can also be set from the Employees EmploymentDetails property. + * + * @return $this + */ + public function setPriorPayrollCode(?string $priorPayrollCode): static + { + if (is_null($priorPayrollCode)) { + array_push($this->openAPINullablesSetToNull, 'priorPayrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('priorPayrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['priorPayrollCode'] = $priorPayrollCode; + + return $this; + } + + /** + * Gets pensionSummary + * + * @return \SynergiTech\Staffology\Model\PensionSummary|null + */ + public function getPensionSummary(): ?\SynergiTech\Staffology\Model\PensionSummary + { + return $this->container['pensionSummary']; + } + + /** + * Sets pensionSummary + * + * @param \SynergiTech\Staffology\Model\PensionSummary|null $pensionSummary pensionSummary + * + * @return $this + */ + public function setPensionSummary(?\SynergiTech\Staffology\Model\PensionSummary $pensionSummary): static + { + if (is_null($pensionSummary)) { + throw new InvalidArgumentException('non-nullable pensionSummary cannot be null'); + } + $this->container['pensionSummary'] = $pensionSummary; + + return $this; + } + + /** + * Gets pensionSummaries + * + * @return \SynergiTech\Staffology\Model\PensionSummary[]|null + */ + public function getPensionSummaries(): ?array + { + return $this->container['pensionSummaries']; + } + + /** + * Sets pensionSummaries + * + * @param \SynergiTech\Staffology\Model\PensionSummary[]|null $pensionSummaries [readonly] A summary of the details for the Pensions (if any) that the Employee is assigned to. + * + * @return $this + */ + public function setPensionSummaries(?array $pensionSummaries): static + { + if (is_null($pensionSummaries)) { + array_push($this->openAPINullablesSetToNull, 'pensionSummaries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionSummaries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionSummaries'] = $pensionSummaries; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets totals + * + * @return \SynergiTech\Staffology\Model\PayRunTotals|null + */ + public function getTotals(): ?\SynergiTech\Staffology\Model\PayRunTotals + { + return $this->container['totals']; + } + + /** + * Sets totals + * + * @param \SynergiTech\Staffology\Model\PayRunTotals|null $totals totals + * + * @return $this + */ + public function setTotals(?\SynergiTech\Staffology\Model\PayRunTotals $totals): static + { + if (is_null($totals)) { + throw new InvalidArgumentException('non-nullable totals cannot be null'); + } + $this->container['totals'] = $totals; + + return $this; + } + + /** + * Gets periodOverrides + * + * @return \SynergiTech\Staffology\Model\ValueOverride[]|null + */ + public function getPeriodOverrides(): ?array + { + return $this->container['periodOverrides']; + } + + /** + * Sets periodOverrides + * + * @param \SynergiTech\Staffology\Model\ValueOverride[]|null $periodOverrides Any calculated values for this period that should be overridden with a different value + * + * @return $this + */ + public function setPeriodOverrides(?array $periodOverrides): static + { + if (is_null($periodOverrides)) { + array_push($this->openAPINullablesSetToNull, 'periodOverrides'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodOverrides', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodOverrides'] = $periodOverrides; + + return $this; + } + + /** + * Gets totalsYtd + * + * @return \SynergiTech\Staffology\Model\PayRunTotals|null + */ + public function getTotalsYtd(): ?\SynergiTech\Staffology\Model\PayRunTotals + { + return $this->container['totalsYtd']; + } + + /** + * Sets totalsYtd + * + * @param \SynergiTech\Staffology\Model\PayRunTotals|null $totalsYtd totalsYtd + * + * @return $this + */ + public function setTotalsYtd(?\SynergiTech\Staffology\Model\PayRunTotals $totalsYtd): static + { + if (is_null($totalsYtd)) { + throw new InvalidArgumentException('non-nullable totalsYtd cannot be null'); + } + $this->container['totalsYtd'] = $totalsYtd; + + return $this; + } + + /** + * Gets totalsYtdOverrides + * + * @return \SynergiTech\Staffology\Model\ValueOverride[]|null + */ + public function getTotalsYtdOverrides(): ?array + { + return $this->container['totalsYtdOverrides']; + } + + /** + * Sets totalsYtdOverrides + * + * @param \SynergiTech\Staffology\Model\ValueOverride[]|null $totalsYtdOverrides Any values of TotalsYtd that should be overridden with a different value + * + * @return $this + */ + public function setTotalsYtdOverrides(?array $totalsYtdOverrides): static + { + if (is_null($totalsYtdOverrides)) { + array_push($this->openAPINullablesSetToNull, 'totalsYtdOverrides'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('totalsYtdOverrides', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['totalsYtdOverrides'] = $totalsYtdOverrides; + + return $this; + } + + /** + * Gets forcedCisVatAmount + * + * @return float|null + */ + public function getForcedCisVatAmount(): ?float + { + return $this->container['forcedCisVatAmount']; + } + + /** + * Sets forcedCisVatAmount + * + * @param float|null $forcedCisVatAmount If this employee is a CIS Subcontractor registered for VAT, we'll automatically work out VAT at the set rate. If you want to override this calculations then set this property to anything other than null. + * + * @return $this + */ + public function setForcedCisVatAmount(?float $forcedCisVatAmount): static + { + if (is_null($forcedCisVatAmount)) { + array_push($this->openAPINullablesSetToNull, 'forcedCisVatAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcedCisVatAmount', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forcedCisVatAmount'] = $forcedCisVatAmount; + + return $this; + } + + /** + * Gets holidayAccrued + * + * @return float|null + */ + public function getHolidayAccrued(): ?float + { + return $this->container['holidayAccrued']; + } + + /** + * Sets holidayAccrued + * + * @param float|null $holidayAccrued The amount of holiday days or hours accrued in the period. + * + * @return $this + */ + public function setHolidayAccrued(?float $holidayAccrued): static + { + if (is_null($holidayAccrued)) { + throw new InvalidArgumentException('non-nullable holidayAccrued cannot be null'); + } + $this->container['holidayAccrued'] = $holidayAccrued; + + return $this; + } + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\PayRunState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\PayRunState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\PayRunState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\PayRunState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets isClosed + * + * @return bool|null + */ + public function getIsClosed(): ?bool + { + return $this->container['isClosed']; + } + + /** + * Sets isClosed + * + * @param bool|null $isClosed [readonly] Set to True if the PayRun is Finalised and changes can no longer be made to the PayRunEntries + * + * @return $this + */ + public function setIsClosed(?bool $isClosed): static + { + if (is_null($isClosed)) { + throw new InvalidArgumentException('non-nullable isClosed cannot be null'); + } + $this->container['isClosed'] = $isClosed; + + return $this; + } + + /** + * Gets manualNi + * + * @return bool|null + */ + public function getManualNi(): ?bool + { + return $this->container['manualNi']; + } + + /** + * Sets manualNi + * + * @param bool|null $manualNi If set to true then you must provide your own value for NationalInsuranceCalculation. You'd normally leave this set to false and let us automatically calculate NI amounts. + * + * @return $this + */ + public function setManualNi(?bool $manualNi): static + { + if (is_null($manualNi)) { + throw new InvalidArgumentException('non-nullable manualNi cannot be null'); + } + $this->container['manualNi'] = $manualNi; + + return $this; + } + + /** + * Gets niSplit + * + * @return bool|null + */ + public function getNiSplit(): ?bool + { + return $this->container['niSplit']; + } + + /** + * Sets niSplit + * + * @param bool|null $niSplit If set to true Ni calculations are done for backdated pay for each pay period separately and then summed up + * + * @return $this + */ + public function setNiSplit(?bool $niSplit): static + { + if (is_null($niSplit)) { + throw new InvalidArgumentException('non-nullable niSplit cannot be null'); + } + $this->container['niSplit'] = $niSplit; + + return $this; + } + + /** + * Gets nationalInsuranceCalculation + * + * @return \SynergiTech\Staffology\Model\NationalInsuranceCalculation|null + */ + public function getNationalInsuranceCalculation(): ?\SynergiTech\Staffology\Model\NationalInsuranceCalculation + { + return $this->container['nationalInsuranceCalculation']; + } + + /** + * Sets nationalInsuranceCalculation + * + * @param \SynergiTech\Staffology\Model\NationalInsuranceCalculation|null $nationalInsuranceCalculation nationalInsuranceCalculation + * + * @return $this + */ + public function setNationalInsuranceCalculation(?\SynergiTech\Staffology\Model\NationalInsuranceCalculation $nationalInsuranceCalculation): static + { + if (is_null($nationalInsuranceCalculation)) { + throw new InvalidArgumentException('non-nullable nationalInsuranceCalculation cannot be null'); + } + $this->container['nationalInsuranceCalculation'] = $nationalInsuranceCalculation; + + return $this; + } + + /** + * Gets payrollCodeChanged + * + * @return bool|null + */ + public function getPayrollCodeChanged(): ?bool + { + return $this->container['payrollCodeChanged']; + } + + /** + * Sets payrollCodeChanged + * + * @param bool|null $payrollCodeChanged [readonly] Indicates whether or not the Payroll Code for this Employee has changed since the last FPS + * + * @return $this + */ + public function setPayrollCodeChanged(?bool $payrollCodeChanged): static + { + if (is_null($payrollCodeChanged)) { + throw new InvalidArgumentException('non-nullable payrollCodeChanged cannot be null'); + } + $this->container['payrollCodeChanged'] = $payrollCodeChanged; + + return $this; + } + + /** + * Gets aeNotEnroledWarning + * + * @return bool|null + */ + public function getAeNotEnroledWarning(): ?bool + { + return $this->container['aeNotEnroledWarning']; + } + + /** + * Sets aeNotEnroledWarning + * + * @param bool|null $aeNotEnroledWarning [readonly] If true then this Employee needs to be on an Auto Enrolment pension but isn't yet. + * + * @return $this + */ + public function setAeNotEnroledWarning(?bool $aeNotEnroledWarning): static + { + if (is_null($aeNotEnroledWarning)) { + throw new InvalidArgumentException('non-nullable aeNotEnroledWarning cannot be null'); + } + $this->container['aeNotEnroledWarning'] = $aeNotEnroledWarning; + + return $this; + } + + /** + * Gets fps + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getFps(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['fps']; + } + + /** + * Sets fps + * + * @param \SynergiTech\Staffology\Model\Item|null $fps fps + * + * @return $this + */ + public function setFps(?\SynergiTech\Staffology\Model\Item $fps): static + { + if (is_null($fps)) { + throw new InvalidArgumentException('non-nullable fps cannot be null'); + } + $this->container['fps'] = $fps; + + return $this; + } + + /** + * Gets emailId + * + * @return string|null + */ + public function getEmailId(): ?string + { + return $this->container['emailId']; + } + + /** + * Sets emailId + * + * @param string|null $emailId If the Payslip for this PayRunEntry has been emailed to the employee then the Id for an EmployerEmail will be provided here. if the value is all zeroes then the email is in the process of being created. + * + * @return $this + */ + public function setEmailId(?string $emailId): static + { + if (is_null($emailId)) { + array_push($this->openAPINullablesSetToNull, 'emailId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailId'] = $emailId; + + return $this; + } + + /** + * Gets recievingOffsetPay + * + * @return bool|null + */ + public function getRecievingOffsetPay(): ?bool + { + return $this->container['recievingOffsetPay']; + } + + /** + * Sets recievingOffsetPay + * + * @param bool|null $recievingOffsetPay If the pay is being topped up due to an applied Leave having the offset value set to true then this will be set to true + * + * @return $this + */ + public function setRecievingOffsetPay(?bool $recievingOffsetPay): static + { + if (is_null($recievingOffsetPay)) { + throw new InvalidArgumentException('non-nullable recievingOffsetPay cannot be null'); + } + $this->container['recievingOffsetPay'] = $recievingOffsetPay; + + return $this; + } + + /** + * Gets paymentAfterLeaving + * + * @return bool|null + */ + public function getPaymentAfterLeaving(): ?bool + { + return $this->container['paymentAfterLeaving']; + } + + /** + * Sets paymentAfterLeaving + * + * @param bool|null $paymentAfterLeaving [readonly] If this payment is for an employee that has left then this is set to true. + * + * @return $this + */ + public function setPaymentAfterLeaving(?bool $paymentAfterLeaving): static + { + if (is_null($paymentAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentAfterLeaving cannot be null'); + } + $this->container['paymentAfterLeaving'] = $paymentAfterLeaving; + + return $this; + } + + /** + * Gets umbrellaPayment + * + * @return \SynergiTech\Staffology\Model\UmbrellaPayment|null + */ + public function getUmbrellaPayment(): ?\SynergiTech\Staffology\Model\UmbrellaPayment + { + return $this->container['umbrellaPayment']; + } + + /** + * Sets umbrellaPayment + * + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment umbrellaPayment + * + * @return $this + */ + public function setUmbrellaPayment(?\SynergiTech\Staffology\Model\UmbrellaPayment $umbrellaPayment): static + { + if (is_null($umbrellaPayment)) { + throw new InvalidArgumentException('non-nullable umbrellaPayment cannot be null'); + } + $this->container['umbrellaPayment'] = $umbrellaPayment; + + return $this; + } + + /** + * Gets isRemoved + * + * @return bool|null + */ + public function getIsRemoved(): ?bool + { + return $this->container['isRemoved']; + } + + /** + * Sets isRemoved + * + * @param bool|null $isRemoved Has the entry been removed from the payrun + * + * @return $this + */ + public function setIsRemoved(?bool $isRemoved): static + { + if (is_null($isRemoved)) { + throw new InvalidArgumentException('non-nullable isRemoved cannot be null'); + } + $this->container['isRemoved'] = $isRemoved; + + return $this; + } + + /** + * Gets isRolledBack + * + * @return bool|null + */ + public function getIsRolledBack(): ?bool + { + return $this->container['isRolledBack']; + } + + /** + * Sets isRolledBack + * + * @param bool|null $isRolledBack [readonly] Set to True if the Pay Run Entry is currently rolled back + * + * @return $this + */ + public function setIsRolledBack(?bool $isRolledBack): static + { + if (is_null($isRolledBack)) { + throw new InvalidArgumentException('non-nullable isRolledBack cannot be null'); + } + $this->container['isRolledBack'] = $isRolledBack; + + return $this; + } + + /** + * Gets periodsCovered + * + * @return int|null + */ + public function getPeriodsCovered(): ?int + { + return $this->container['periodsCovered']; + } + + /** + * Sets periodsCovered + * + * @param int|null $periodsCovered [readonly] The amount of periods that the Pay Run Entry covers. This can be > 1 when back pay for previous periods is paid in the current period + * + * @return $this + */ + public function setPeriodsCovered(?int $periodsCovered): static + { + if (is_null($periodsCovered)) { + throw new InvalidArgumentException('non-nullable periodsCovered cannot be null'); + } + $this->container['periodsCovered'] = $periodsCovered; + + return $this; + } + + /** + * Gets employeeRolePayItems + * + * @return \SynergiTech\Staffology\Model\EmployeeRolePayItem[]|null + */ + public function getEmployeeRolePayItems(): ?array + { + return $this->container['employeeRolePayItems']; + } + + /** + * Sets employeeRolePayItems + * + * @param \SynergiTech\Staffology\Model\EmployeeRolePayItem[]|null $employeeRolePayItems [readonly] Automatically populated. Array of base hourly and daily rates for the employee roles + * + * @return $this + */ + public function setEmployeeRolePayItems(?array $employeeRolePayItems): static + { + if (is_null($employeeRolePayItems)) { + array_push($this->openAPINullablesSetToNull, 'employeeRolePayItems'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeRolePayItems', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeRolePayItems'] = $employeeRolePayItems; + + return $this; + } + + /** + * Gets warnings + * + * @return \SynergiTech\Staffology\Model\PayRunEntryWarningType|null + */ + public function getWarnings(): ?\SynergiTech\Staffology\Model\PayRunEntryWarningType + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \SynergiTech\Staffology\Model\PayRunEntryWarningType|null $warnings warnings + * + * @return $this + */ + public function setWarnings(?\SynergiTech\Staffology\Model\PayRunEntryWarningType $warnings): static + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Gets niLetterError + * + * @return \SynergiTech\Staffology\Model\NiLetterError|null + */ + public function getNiLetterError(): ?\SynergiTech\Staffology\Model\NiLetterError + { + return $this->container['niLetterError']; + } + + /** + * Sets niLetterError + * + * @param \SynergiTech\Staffology\Model\NiLetterError|null $niLetterError niLetterError + * + * @return $this + */ + public function setNiLetterError(?\SynergiTech\Staffology\Model\NiLetterError $niLetterError): static + { + if (is_null($niLetterError)) { + throw new InvalidArgumentException('non-nullable niLetterError cannot be null'); + } + $this->container['niLetterError'] = $niLetterError; + + return $this; + } + + /** + * Gets teachersPensionAgeWarning + * + * @return \SynergiTech\Staffology\Model\TeachersPensionAgeWarning|null + */ + public function getTeachersPensionAgeWarning(): ?\SynergiTech\Staffology\Model\TeachersPensionAgeWarning + { + return $this->container['teachersPensionAgeWarning']; + } + + /** + * Sets teachersPensionAgeWarning + * + * @param \SynergiTech\Staffology\Model\TeachersPensionAgeWarning|null $teachersPensionAgeWarning teachersPensionAgeWarning + * + * @return $this + */ + public function setTeachersPensionAgeWarning(?\SynergiTech\Staffology\Model\TeachersPensionAgeWarning $teachersPensionAgeWarning): static + { + if (is_null($teachersPensionAgeWarning)) { + throw new InvalidArgumentException('non-nullable teachersPensionAgeWarning cannot be null'); + } + $this->container['teachersPensionAgeWarning'] = $teachersPensionAgeWarning; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\PersonalDetails|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\PersonalDetails + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\PersonalDetails|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\PersonalDetails $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\EmploymentDetails|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\EmploymentDetails + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\EmploymentDetails|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\EmploymentDetails $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\PayOptions|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\PayOptions + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\PayOptions $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunEntrySortBy.php b/src/Model/PayRunEntrySortBy.php new file mode 100644 index 0000000..6589da3 --- /dev/null +++ b/src/Model/PayRunEntrySortBy.php @@ -0,0 +1,63 @@ + + */ +class PayRunJournal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunJournal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PayRunSummaryLine[]', + 'date' => '\DateTime', + 'title' => 'string', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusMessage' => 'string', + 'link' => 'string', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'mergeMatchingNominals' => 'bool', + 'csvFormat' => '\SynergiTech\Staffology\Model\JournalCsvFormat' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'date' => 'date', + 'title' => null, + 'status' => null, + 'statusMessage' => null, + 'link' => null, + 'taxYear' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'mergeMatchingNominals' => null, + 'csvFormat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'date' => false, + 'title' => true, + 'status' => false, + 'statusMessage' => true, + 'link' => true, + 'taxYear' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'mergeMatchingNominals' => false, + 'csvFormat' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'date' => 'date', + 'title' => 'title', + 'status' => 'status', + 'statusMessage' => 'statusMessage', + 'link' => 'link', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'mergeMatchingNominals' => 'mergeMatchingNominals', + 'csvFormat' => 'csvFormat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'date' => 'setDate', + 'title' => 'setTitle', + 'status' => 'setStatus', + 'statusMessage' => 'setStatusMessage', + 'link' => 'setLink', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'mergeMatchingNominals' => 'setMergeMatchingNominals', + 'csvFormat' => 'setCsvFormat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'date' => 'getDate', + 'title' => 'getTitle', + 'status' => 'getStatus', + 'statusMessage' => 'getStatusMessage', + 'link' => 'getLink', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'mergeMatchingNominals' => 'getMergeMatchingNominals', + 'csvFormat' => 'getCsvFormat' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('mergeMatchingNominals', $data ?? [], null); + $this->setIfExists('csvFormat', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayRunSummaryLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayRunSummaryLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] The PaymentDate from the PayRun + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title [readonly] The status of the task for posting this journal to an ExternalDataProvider + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage [readonly] A message to elaborate on the Status + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink(): ?string + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link [readonly] If available, a link to the journal in the ExternalDataProvider + * + * @return $this + */ + public function setLink(?string $link): static + { + if (is_null($link)) { + array_push($this->openAPINullablesSetToNull, 'link'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('link', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal [readonly] + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period [readonly] + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets mergeMatchingNominals + * + * @return bool|null + */ + public function getMergeMatchingNominals(): ?bool + { + return $this->container['mergeMatchingNominals']; + } + + /** + * Sets mergeMatchingNominals + * + * @param bool|null $mergeMatchingNominals [readonly] + * + * @return $this + */ + public function setMergeMatchingNominals(?bool $mergeMatchingNominals): static + { + if (is_null($mergeMatchingNominals)) { + throw new InvalidArgumentException('non-nullable mergeMatchingNominals cannot be null'); + } + $this->container['mergeMatchingNominals'] = $mergeMatchingNominals; + + return $this; + } + + /** + * Gets csvFormat + * + * @return \SynergiTech\Staffology\Model\JournalCsvFormat|null + */ + public function getCsvFormat(): ?\SynergiTech\Staffology\Model\JournalCsvFormat + { + return $this->container['csvFormat']; + } + + /** + * Sets csvFormat + * + * @param \SynergiTech\Staffology\Model\JournalCsvFormat|null $csvFormat csvFormat + * + * @return $this + */ + public function setCsvFormat(?\SynergiTech\Staffology\Model\JournalCsvFormat $csvFormat): static + { + if (is_null($csvFormat)) { + throw new InvalidArgumentException('non-nullable csvFormat cannot be null'); + } + $this->container['csvFormat'] = $csvFormat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunPayment.php b/src/Model/PayRunPayment.php new file mode 100644 index 0000000..625eec6 --- /dev/null +++ b/src/Model/PayRunPayment.php @@ -0,0 +1,776 @@ + + */ +class PayRunPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\PayeeType', + 'payee' => '\SynergiTech\Staffology\Model\Item', + 'date' => '\DateTime', + 'method' => '\SynergiTech\Staffology\Model\PayMethod', + 'amount' => 'float', + 'reference' => 'string', + 'employerPaymentReference' => 'string', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'bacsHash' => 'string', + 'bacsSubReference' => 'string', + 'isBankDetailValid' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'payee' => null, + 'date' => 'date', + 'method' => null, + 'amount' => 'double', + 'reference' => null, + 'employerPaymentReference' => null, + 'bankDetails' => null, + 'bacsHash' => null, + 'bacsSubReference' => null, + 'isBankDetailValid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'payee' => false, + 'date' => false, + 'method' => false, + 'amount' => false, + 'reference' => true, + 'employerPaymentReference' => true, + 'bankDetails' => false, + 'bacsHash' => true, + 'bacsSubReference' => true, + 'isBankDetailValid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'payee' => 'payee', + 'date' => 'date', + 'method' => 'method', + 'amount' => 'amount', + 'reference' => 'reference', + 'employerPaymentReference' => 'employerPaymentReference', + 'bankDetails' => 'bankDetails', + 'bacsHash' => 'bacsHash', + 'bacsSubReference' => 'bacsSubReference', + 'isBankDetailValid' => 'isBankDetailValid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'payee' => 'setPayee', + 'date' => 'setDate', + 'method' => 'setMethod', + 'amount' => 'setAmount', + 'reference' => 'setReference', + 'employerPaymentReference' => 'setEmployerPaymentReference', + 'bankDetails' => 'setBankDetails', + 'bacsHash' => 'setBacsHash', + 'bacsSubReference' => 'setBacsSubReference', + 'isBankDetailValid' => 'setIsBankDetailValid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'payee' => 'getPayee', + 'date' => 'getDate', + 'method' => 'getMethod', + 'amount' => 'getAmount', + 'reference' => 'getReference', + 'employerPaymentReference' => 'getEmployerPaymentReference', + 'bankDetails' => 'getBankDetails', + 'bacsHash' => 'getBacsHash', + 'bacsSubReference' => 'getBacsSubReference', + 'isBankDetailValid' => 'getIsBankDetailValid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('payee', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('employerPaymentReference', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('bacsHash', $data ?? [], null); + $this->setIfExists('bacsSubReference', $data ?? [], null); + $this->setIfExists('isBankDetailValid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PayeeType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PayeeType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PayeeType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PayeeType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets payee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getPayee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['payee']; + } + + /** + * Sets payee + * + * @param \SynergiTech\Staffology\Model\Item|null $payee payee + * + * @return $this + */ + public function setPayee(?\SynergiTech\Staffology\Model\Item $payee): static + { + if (is_null($payee)) { + throw new InvalidArgumentException('non-nullable payee cannot be null'); + } + $this->container['payee'] = $payee; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date [readonly] The date the payment is to be made + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets method + * + * @return \SynergiTech\Staffology\Model\PayMethod|null + */ + public function getMethod(): ?\SynergiTech\Staffology\Model\PayMethod + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param \SynergiTech\Staffology\Model\PayMethod|null $method method + * + * @return $this + */ + public function setMethod(?\SynergiTech\Staffology\Model\PayMethod $method): static + { + if (is_null($method)) { + throw new InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount [readonly] The amount to pay + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference(): ?string + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference [readonly] The period the payment is for + * + * @return $this + */ + public function setReference(?string $reference): static + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets employerPaymentReference + * + * @return string|null + */ + public function getEmployerPaymentReference(): ?string + { + return $this->container['employerPaymentReference']; + } + + /** + * Sets employerPaymentReference + * + * @param string|null $employerPaymentReference The employer's payment reference, formatted as per the employer settings + * + * @return $this + */ + public function setEmployerPaymentReference(?string $employerPaymentReference): static + { + if (is_null($employerPaymentReference)) { + array_push($this->openAPINullablesSetToNull, 'employerPaymentReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPaymentReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPaymentReference'] = $employerPaymentReference; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets bacsHash + * + * @return string|null + */ + public function getBacsHash(): ?string + { + return $this->container['bacsHash']; + } + + /** + * Sets bacsHash + * + * @param string|null $bacsHash [readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsHash included on the FPS + * + * @return $this + */ + public function setBacsHash(?string $bacsHash): static + { + if (is_null($bacsHash)) { + array_push($this->openAPINullablesSetToNull, 'bacsHash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsHash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bacsHash'] = $bacsHash; + + return $this; + } + + /** + * Gets bacsSubReference + * + * @return string|null + */ + public function getBacsSubReference(): ?string + { + return $this->container['bacsSubReference']; + } + + /** + * Sets bacsSubReference + * + * @param string|null $bacsSubReference [readonly] if paying by Credit and you've enabled BacsHash then this will contain the BacsSubReference included on the FPS + * + * @return $this + */ + public function setBacsSubReference(?string $bacsSubReference): static + { + if (is_null($bacsSubReference)) { + array_push($this->openAPINullablesSetToNull, 'bacsSubReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bacsSubReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bacsSubReference'] = $bacsSubReference; + + return $this; + } + + /** + * Gets isBankDetailValid + * + * @return bool|null + */ + public function getIsBankDetailValid(): ?bool + { + return $this->container['isBankDetailValid']; + } + + /** + * Sets isBankDetailValid + * + * @param bool|null $isBankDetailValid [readonly] for checking if bank details are valid + * + * @return $this + */ + public function setIsBankDetailValid(?bool $isBankDetailValid): static + { + if (is_null($isBankDetailValid)) { + throw new InvalidArgumentException('non-nullable isBankDetailValid cannot be null'); + } + $this->container['isBankDetailValid'] = $isBankDetailValid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunState.php b/src/Model/PayRunState.php new file mode 100644 index 0000000..2b0a4ed --- /dev/null +++ b/src/Model/PayRunState.php @@ -0,0 +1,65 @@ + + */ +class PayRunStateChange implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunStateChange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'state' => '\SynergiTech\Staffology\Model\PayRunState', + 'reason' => '\SynergiTech\Staffology\Model\PayRunStateChangeReason', + 'reasonText' => 'string', + 'employeeUniqueIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'state' => null, + 'reason' => null, + 'reasonText' => null, + 'employeeUniqueIds' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'state' => false, + 'reason' => false, + 'reasonText' => true, + 'employeeUniqueIds' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'state' => 'state', + 'reason' => 'reason', + 'reasonText' => 'reasonText', + 'employeeUniqueIds' => 'employeeUniqueIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'state' => 'setState', + 'reason' => 'setReason', + 'reasonText' => 'setReasonText', + 'employeeUniqueIds' => 'setEmployeeUniqueIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'state' => 'getState', + 'reason' => 'getReason', + 'reasonText' => 'getReasonText', + 'employeeUniqueIds' => 'getEmployeeUniqueIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reasonText', $data ?? [], null); + $this->setIfExists('employeeUniqueIds', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reasonText']) && (mb_strlen($this->container['reasonText']) > 300)) { + $invalidProperties[] = "invalid value for 'reasonText', the character length must be smaller than or equal to 300."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets state + * + * @return \SynergiTech\Staffology\Model\PayRunState|null + */ + public function getState(): ?\SynergiTech\Staffology\Model\PayRunState + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \SynergiTech\Staffology\Model\PayRunState|null $state state + * + * @return $this + */ + public function setState(?\SynergiTech\Staffology\Model\PayRunState $state): static + { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets reason + * + * @return \SynergiTech\Staffology\Model\PayRunStateChangeReason|null + */ + public function getReason(): ?\SynergiTech\Staffology\Model\PayRunStateChangeReason + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param \SynergiTech\Staffology\Model\PayRunStateChangeReason|null $reason reason + * + * @return $this + */ + public function setReason(?\SynergiTech\Staffology\Model\PayRunStateChangeReason $reason): static + { + if (is_null($reason)) { + throw new InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets reasonText + * + * @return string|null + */ + public function getReasonText(): ?string + { + return $this->container['reasonText']; + } + + /** + * Sets reasonText + * + * @param string|null $reasonText A free-form text field for a reason for the change of state. + * + * @return $this + */ + public function setReasonText(?string $reasonText): static + { + if (is_null($reasonText)) { + array_push($this->openAPINullablesSetToNull, 'reasonText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reasonText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reasonText) && (mb_strlen($reasonText) > 300)) { + throw new InvalidArgumentException('invalid length for $reasonText when calling PayRunStateChange., must be smaller than or equal to 300.'); + } + + $this->container['reasonText'] = $reasonText; + + return $this; + } + + /** + * Gets employeeUniqueIds + * + * @return string[]|null + */ + public function getEmployeeUniqueIds(): ?array + { + return $this->container['employeeUniqueIds']; + } + + /** + * Sets employeeUniqueIds + * + * @param string[]|null $employeeUniqueIds List of employee unique ids, whose PayRunEntries to be re-opened during a Payrun rollback operation. Will be used only during a transition to a rolled back pay run state + * + * @return $this + */ + public function setEmployeeUniqueIds(?array $employeeUniqueIds): static + { + if (is_null($employeeUniqueIds)) { + array_push($this->openAPINullablesSetToNull, 'employeeUniqueIds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeUniqueIds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeUniqueIds'] = $employeeUniqueIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunStateChangeReason.php b/src/Model/PayRunStateChangeReason.php new file mode 100644 index 0000000..92f75b4 --- /dev/null +++ b/src/Model/PayRunStateChangeReason.php @@ -0,0 +1,49 @@ + + */ +class PayRunSummaryLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunSummaryLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nominalCode' => 'string', + 'departmentCode' => 'string', + 'nominalName' => 'string', + 'description' => 'string', + 'qty' => 'float', + 'value' => 'float', + 'payCode' => '\SynergiTech\Staffology\Model\PayCode', + 'costCentreCode' => 'string', + 'analysisCategories' => '\SynergiTech\Staffology\Model\AnalysisCategory[]', + 'analysisCategoryCodes' => '\SynergiTech\Staffology\Model\AnalysisCategoryCode[]', + 'employeeUniqueId' => 'string', + 'journalNarrative' => 'string', + 'pensionId' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Employee', + 'unMappedNominalCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nominalCode' => null, + 'departmentCode' => null, + 'nominalName' => null, + 'description' => null, + 'qty' => 'double', + 'value' => 'double', + 'payCode' => null, + 'costCentreCode' => null, + 'analysisCategories' => null, + 'analysisCategoryCodes' => null, + 'employeeUniqueId' => 'uuid', + 'journalNarrative' => null, + 'pensionId' => 'uuid', + 'employee' => null, + 'unMappedNominalCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nominalCode' => true, + 'departmentCode' => true, + 'nominalName' => true, + 'description' => true, + 'qty' => true, + 'value' => false, + 'payCode' => false, + 'costCentreCode' => true, + 'analysisCategories' => true, + 'analysisCategoryCodes' => true, + 'employeeUniqueId' => true, + 'journalNarrative' => true, + 'pensionId' => true, + 'employee' => false, + 'unMappedNominalCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nominalCode' => 'nominalCode', + 'departmentCode' => 'departmentCode', + 'nominalName' => 'nominalName', + 'description' => 'description', + 'qty' => 'qty', + 'value' => 'value', + 'payCode' => 'payCode', + 'costCentreCode' => 'costCentreCode', + 'analysisCategories' => 'analysisCategories', + 'analysisCategoryCodes' => 'analysisCategoryCodes', + 'employeeUniqueId' => 'employeeUniqueId', + 'journalNarrative' => 'journalNarrative', + 'pensionId' => 'pensionId', + 'employee' => 'employee', + 'unMappedNominalCode' => 'unMappedNominalCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nominalCode' => 'setNominalCode', + 'departmentCode' => 'setDepartmentCode', + 'nominalName' => 'setNominalName', + 'description' => 'setDescription', + 'qty' => 'setQty', + 'value' => 'setValue', + 'payCode' => 'setPayCode', + 'costCentreCode' => 'setCostCentreCode', + 'analysisCategories' => 'setAnalysisCategories', + 'analysisCategoryCodes' => 'setAnalysisCategoryCodes', + 'employeeUniqueId' => 'setEmployeeUniqueId', + 'journalNarrative' => 'setJournalNarrative', + 'pensionId' => 'setPensionId', + 'employee' => 'setEmployee', + 'unMappedNominalCode' => 'setUnMappedNominalCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nominalCode' => 'getNominalCode', + 'departmentCode' => 'getDepartmentCode', + 'nominalName' => 'getNominalName', + 'description' => 'getDescription', + 'qty' => 'getQty', + 'value' => 'getValue', + 'payCode' => 'getPayCode', + 'costCentreCode' => 'getCostCentreCode', + 'analysisCategories' => 'getAnalysisCategories', + 'analysisCategoryCodes' => 'getAnalysisCategoryCodes', + 'employeeUniqueId' => 'getEmployeeUniqueId', + 'journalNarrative' => 'getJournalNarrative', + 'pensionId' => 'getPensionId', + 'employee' => 'getEmployee', + 'unMappedNominalCode' => 'getUnMappedNominalCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nominalCode', $data ?? [], null); + $this->setIfExists('departmentCode', $data ?? [], null); + $this->setIfExists('nominalName', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('qty', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + $this->setIfExists('costCentreCode', $data ?? [], null); + $this->setIfExists('analysisCategories', $data ?? [], null); + $this->setIfExists('analysisCategoryCodes', $data ?? [], null); + $this->setIfExists('employeeUniqueId', $data ?? [], null); + $this->setIfExists('journalNarrative', $data ?? [], null); + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('unMappedNominalCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nominalCode + * + * @return string|null + */ + public function getNominalCode(): ?string + { + return $this->container['nominalCode']; + } + + /** + * Sets nominalCode + * + * @param string|null $nominalCode [readonly] If you've set up NominalCodeMapping then the relevant Nominal code for the PayCode will be shown here. + * + * @return $this + */ + public function setNominalCode(?string $nominalCode): static + { + if (is_null($nominalCode)) { + array_push($this->openAPINullablesSetToNull, 'nominalCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nominalCode'] = $nominalCode; + + return $this; + } + + /** + * Gets departmentCode + * + * @return string|null + */ + public function getDepartmentCode(): ?string + { + return $this->container['departmentCode']; + } + + /** + * Sets departmentCode + * + * @param string|null $departmentCode [readonly] If the journal is split by department then the relevant department code is shown here. + * + * @return $this + */ + public function setDepartmentCode(?string $departmentCode): static + { + if (is_null($departmentCode)) { + array_push($this->openAPINullablesSetToNull, 'departmentCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentCode'] = $departmentCode; + + return $this; + } + + /** + * Gets nominalName + * + * @return string|null + */ + public function getNominalName(): ?string + { + return $this->container['nominalName']; + } + + /** + * Sets nominalName + * + * @param string|null $nominalName [readonly] As above + * + * @return $this + */ + public function setNominalName(?string $nominalName): static + { + if (is_null($nominalName)) { + array_push($this->openAPINullablesSetToNull, 'nominalName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nominalName'] = $nominalName; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description [readonly] A description of what this line summarises. + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets qty + * + * @return float|null + */ + public function getQty(): ?float + { + return $this->container['qty']; + } + + /** + * Sets qty + * + * @param float|null $qty [readonly] If the PayCode is a Multiplier code then this will contain the number of days/hours + * + * @return $this + */ + public function setQty(?float $qty): static + { + if (is_null($qty)) { + array_push($this->openAPINullablesSetToNull, 'qty'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qty', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qty'] = $qty; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value [readonly] The total value for this line. + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets payCode + * + * @return \SynergiTech\Staffology\Model\PayCode|null + */ + public function getPayCode(): ?\SynergiTech\Staffology\Model\PayCode + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param \SynergiTech\Staffology\Model\PayCode|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?\SynergiTech\Staffology\Model\PayCode $payCode): static + { + if (is_null($payCode)) { + throw new InvalidArgumentException('non-nullable payCode cannot be null'); + } + $this->container['payCode'] = $payCode; + + return $this; + } + + /** + * Gets costCentreCode + * + * @return string|null + */ + public function getCostCentreCode(): ?string + { + return $this->container['costCentreCode']; + } + + /** + * Sets costCentreCode + * + * @param string|null $costCentreCode [readonly] If the journal is split by cost centre then the relevant cost centre code is shown here. + * + * @return $this + */ + public function setCostCentreCode(?string $costCentreCode): static + { + if (is_null($costCentreCode)) { + array_push($this->openAPINullablesSetToNull, 'costCentreCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentreCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentreCode'] = $costCentreCode; + + return $this; + } + + /** + * Gets analysisCategories + * + * @return \SynergiTech\Staffology\Model\AnalysisCategory[]|null + */ + public function getAnalysisCategories(): ?array + { + return $this->container['analysisCategories']; + } + + /** + * Sets analysisCategories + * + * @param \SynergiTech\Staffology\Model\AnalysisCategory[]|null $analysisCategories [readonly] If the journal is split by analysis categories + * + * @return $this + */ + public function setAnalysisCategories(?array $analysisCategories): static + { + if (is_null($analysisCategories)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategories'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategories', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategories'] = $analysisCategories; + + return $this; + } + + /** + * Gets analysisCategoryCodes + * + * @return \SynergiTech\Staffology\Model\AnalysisCategoryCode[]|null + */ + public function getAnalysisCategoryCodes(): ?array + { + return $this->container['analysisCategoryCodes']; + } + + /** + * Sets analysisCategoryCodes + * + * @param \SynergiTech\Staffology\Model\AnalysisCategoryCode[]|null $analysisCategoryCodes [readonly] If the journal is split by analysis categories then the relevant analysis categories code is shown here. + * + * @return $this + */ + public function setAnalysisCategoryCodes(?array $analysisCategoryCodes): static + { + if (is_null($analysisCategoryCodes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryCodes'] = $analysisCategoryCodes; + + return $this; + } + + /** + * Gets employeeUniqueId + * + * @return string|null + */ + public function getEmployeeUniqueId(): ?string + { + return $this->container['employeeUniqueId']; + } + + /** + * Sets employeeUniqueId + * + * @param string|null $employeeUniqueId [readonly] The EmployeeId this summary line relates to. + * + * @return $this + */ + public function setEmployeeUniqueId(?string $employeeUniqueId): static + { + if (is_null($employeeUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'employeeUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeUniqueId'] = $employeeUniqueId; + + return $this; + } + + /** + * Gets journalNarrative + * + * @return string|null + */ + public function getJournalNarrative(): ?string + { + return $this->container['journalNarrative']; + } + + /** + * Sets journalNarrative + * + * @param string|null $journalNarrative [readonly] Gets the journal narrative for the pension, if defined. + * + * @return $this + */ + public function setJournalNarrative(?string $journalNarrative): static + { + if (is_null($journalNarrative)) { + array_push($this->openAPINullablesSetToNull, 'journalNarrative'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('journalNarrative', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['journalNarrative'] = $journalNarrative; + + return $this; + } + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId [readonly] The PensionId of the pension associated with this summary line, only present for pension summary lines. + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + array_push($this->openAPINullablesSetToNull, 'pensionId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Employee|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Employee + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Employee|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Employee $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets unMappedNominalCode + * + * @return string|null + */ + public function getUnMappedNominalCode(): ?string + { + return $this->container['unMappedNominalCode']; + } + + /** + * Sets unMappedNominalCode + * + * @param string|null $unMappedNominalCode [readonly] Unmapped Nominal Code is the Nominal Code without the Nominal Mapping. + * + * @return $this + */ + public function setUnMappedNominalCode(?string $unMappedNominalCode): static + { + if (is_null($unMappedNominalCode)) { + array_push($this->openAPINullablesSetToNull, 'unMappedNominalCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unMappedNominalCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['unMappedNominalCode'] = $unMappedNominalCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunSummaryLineIEnumerableReportResponse.php b/src/Model/PayRunSummaryLineIEnumerableReportResponse.php new file mode 100644 index 0000000..3d69eb5 --- /dev/null +++ b/src/Model/PayRunSummaryLineIEnumerableReportResponse.php @@ -0,0 +1,539 @@ + + */ +class PayRunSummaryLineIEnumerableReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunSummaryLineIEnumerableReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayRunSummaryLine[]', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayRunSummaryLine[]|null + */ + public function getModel(): ?array + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayRunSummaryLine[]|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(?array $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayRunTotals.php b/src/Model/PayRunTotals.php new file mode 100644 index 0000000..2d29699 --- /dev/null +++ b/src/Model/PayRunTotals.php @@ -0,0 +1,3041 @@ + + */ +class PayRunTotals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayRunTotals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'basicPay' => 'float', + 'gross' => 'float', + 'grossForNi' => 'float', + 'grossForNiNonRti' => 'float', + 'grossNotSubjectToEmployersNi' => 'float', + 'grossNotSubjectToEmployersNiNonRti' => 'float', + 'grossForTax' => 'float', + 'employerNi' => 'float', + 'employerNiNonRti' => 'float', + 'employeeNi' => 'float', + 'employeeNiNonRti' => 'float', + 'employerNiOffPayroll' => 'float', + 'realTimeClass1ANi' => 'float', + 'realTimeClass1ANiNonRti' => 'float', + 'tax' => 'float', + 'taxNonRti' => 'float', + 'netPay' => 'float', + 'adjustments' => 'float', + 'notionalPay' => 'float', + 'additions' => 'float', + 'deductions' => 'float', + 'takeHomePay' => 'float', + 'nonTaxOrNICPmt' => 'float', + 'itemsSubjectToClass1NIC' => 'float', + 'dednsFromNetPay' => 'float', + 'tcpTcls' => 'float', + 'tcpPp' => 'float', + 'tcpOp' => 'float', + 'flexiDdDeath' => 'float', + 'flexiDdDeathNonTax' => 'float', + 'flexiDdPension' => 'float', + 'flexiDdPensionNonTax' => 'float', + 'flexiDdSeriousIllHealth' => 'float', + 'flexiDdSeriousIllHealthNonTax' => 'float', + 'smp' => 'float', + 'smpNonRti' => 'float', + 'spp' => 'float', + 'sppNonRti' => 'float', + 'sap' => 'float', + 'sapNonRti' => 'float', + 'shpp' => 'float', + 'shppNonRti' => 'float', + 'spbp' => 'float', + 'spbpNonRti' => 'float', + 'ssp' => 'float', + 'sspNonRti' => 'float', + 'studentLoanRecovered' => 'float', + 'studentLoanRecoveredNonRti' => 'float', + 'postgradLoanRecovered' => 'float', + 'postgradLoanRecoveredNonRti' => 'float', + 'pensionableEarnings' => 'float', + 'pensionablePay' => 'float', + 'nonTierablePay' => 'float', + 'employeePensionContribution' => 'float', + 'employeePensionContributionAvc' => 'float', + 'employerPensionContribution' => 'float', + 'empeePenContribnsNotPaid' => 'float', + 'empeePenContribnsPaid' => 'float', + 'attachmentOrderDeductions' => 'float', + 'cisDeduction' => 'float', + 'cisVat' => 'float', + 'cisUmbrellaFee' => 'float', + 'cisUmbrellaFeePostTax' => 'float', + 'pbik' => 'float', + 'mapsMiles' => 'int', + 'foreignTaxAmount' => 'float', + 'foreignTaxAmountReclaimed' => 'float', + 'umbrellaFee' => 'float', + 'appLevyDeduction' => 'float', + 'paymentAfterLeaving' => 'float', + 'taxOnPaymentAfterLeaving' => 'float', + 'nilPaid' => 'int', + 'leavers' => 'int', + 'starters' => 'int', + 'p45Gross' => 'float', + 'p45Tax' => 'float', + 'totalCost' => 'float', + 'recoverableAmounts' => '\SynergiTech\Staffology\Model\RecoverableAmounts' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'basicPay' => 'double', + 'gross' => 'double', + 'grossForNi' => 'double', + 'grossForNiNonRti' => 'double', + 'grossNotSubjectToEmployersNi' => 'double', + 'grossNotSubjectToEmployersNiNonRti' => 'double', + 'grossForTax' => 'double', + 'employerNi' => 'double', + 'employerNiNonRti' => 'double', + 'employeeNi' => 'double', + 'employeeNiNonRti' => 'double', + 'employerNiOffPayroll' => 'double', + 'realTimeClass1ANi' => 'double', + 'realTimeClass1ANiNonRti' => 'double', + 'tax' => 'double', + 'taxNonRti' => 'double', + 'netPay' => 'double', + 'adjustments' => 'double', + 'notionalPay' => 'double', + 'additions' => 'double', + 'deductions' => 'double', + 'takeHomePay' => 'double', + 'nonTaxOrNICPmt' => 'double', + 'itemsSubjectToClass1NIC' => 'double', + 'dednsFromNetPay' => 'double', + 'tcpTcls' => 'double', + 'tcpPp' => 'double', + 'tcpOp' => 'double', + 'flexiDdDeath' => 'double', + 'flexiDdDeathNonTax' => 'double', + 'flexiDdPension' => 'double', + 'flexiDdPensionNonTax' => 'double', + 'flexiDdSeriousIllHealth' => 'double', + 'flexiDdSeriousIllHealthNonTax' => 'double', + 'smp' => 'double', + 'smpNonRti' => 'double', + 'spp' => 'double', + 'sppNonRti' => 'double', + 'sap' => 'double', + 'sapNonRti' => 'double', + 'shpp' => 'double', + 'shppNonRti' => 'double', + 'spbp' => 'double', + 'spbpNonRti' => 'double', + 'ssp' => 'double', + 'sspNonRti' => 'double', + 'studentLoanRecovered' => 'double', + 'studentLoanRecoveredNonRti' => 'double', + 'postgradLoanRecovered' => 'double', + 'postgradLoanRecoveredNonRti' => 'double', + 'pensionableEarnings' => 'double', + 'pensionablePay' => 'double', + 'nonTierablePay' => 'double', + 'employeePensionContribution' => 'double', + 'employeePensionContributionAvc' => 'double', + 'employerPensionContribution' => 'double', + 'empeePenContribnsNotPaid' => 'double', + 'empeePenContribnsPaid' => 'double', + 'attachmentOrderDeductions' => 'double', + 'cisDeduction' => 'double', + 'cisVat' => 'double', + 'cisUmbrellaFee' => 'double', + 'cisUmbrellaFeePostTax' => 'double', + 'pbik' => 'double', + 'mapsMiles' => 'int32', + 'foreignTaxAmount' => 'double', + 'foreignTaxAmountReclaimed' => 'double', + 'umbrellaFee' => 'double', + 'appLevyDeduction' => 'double', + 'paymentAfterLeaving' => 'double', + 'taxOnPaymentAfterLeaving' => 'double', + 'nilPaid' => 'int32', + 'leavers' => 'int32', + 'starters' => 'int32', + 'p45Gross' => 'double', + 'p45Tax' => 'double', + 'totalCost' => 'double', + 'recoverableAmounts' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'basicPay' => false, + 'gross' => false, + 'grossForNi' => false, + 'grossForNiNonRti' => false, + 'grossNotSubjectToEmployersNi' => false, + 'grossNotSubjectToEmployersNiNonRti' => false, + 'grossForTax' => false, + 'employerNi' => false, + 'employerNiNonRti' => false, + 'employeeNi' => false, + 'employeeNiNonRti' => false, + 'employerNiOffPayroll' => false, + 'realTimeClass1ANi' => false, + 'realTimeClass1ANiNonRti' => false, + 'tax' => false, + 'taxNonRti' => false, + 'netPay' => false, + 'adjustments' => false, + 'notionalPay' => false, + 'additions' => false, + 'deductions' => false, + 'takeHomePay' => false, + 'nonTaxOrNICPmt' => false, + 'itemsSubjectToClass1NIC' => false, + 'dednsFromNetPay' => false, + 'tcpTcls' => false, + 'tcpPp' => false, + 'tcpOp' => false, + 'flexiDdDeath' => false, + 'flexiDdDeathNonTax' => false, + 'flexiDdPension' => false, + 'flexiDdPensionNonTax' => false, + 'flexiDdSeriousIllHealth' => false, + 'flexiDdSeriousIllHealthNonTax' => false, + 'smp' => false, + 'smpNonRti' => false, + 'spp' => false, + 'sppNonRti' => false, + 'sap' => false, + 'sapNonRti' => false, + 'shpp' => false, + 'shppNonRti' => false, + 'spbp' => false, + 'spbpNonRti' => false, + 'ssp' => false, + 'sspNonRti' => false, + 'studentLoanRecovered' => false, + 'studentLoanRecoveredNonRti' => false, + 'postgradLoanRecovered' => false, + 'postgradLoanRecoveredNonRti' => false, + 'pensionableEarnings' => false, + 'pensionablePay' => false, + 'nonTierablePay' => false, + 'employeePensionContribution' => false, + 'employeePensionContributionAvc' => false, + 'employerPensionContribution' => false, + 'empeePenContribnsNotPaid' => false, + 'empeePenContribnsPaid' => false, + 'attachmentOrderDeductions' => false, + 'cisDeduction' => false, + 'cisVat' => false, + 'cisUmbrellaFee' => false, + 'cisUmbrellaFeePostTax' => false, + 'pbik' => false, + 'mapsMiles' => false, + 'foreignTaxAmount' => false, + 'foreignTaxAmountReclaimed' => false, + 'umbrellaFee' => false, + 'appLevyDeduction' => false, + 'paymentAfterLeaving' => false, + 'taxOnPaymentAfterLeaving' => false, + 'nilPaid' => false, + 'leavers' => false, + 'starters' => false, + 'p45Gross' => true, + 'p45Tax' => true, + 'totalCost' => false, + 'recoverableAmounts' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'basicPay' => 'basicPay', + 'gross' => 'gross', + 'grossForNi' => 'grossForNi', + 'grossForNiNonRti' => 'grossForNiNonRti', + 'grossNotSubjectToEmployersNi' => 'grossNotSubjectToEmployersNi', + 'grossNotSubjectToEmployersNiNonRti' => 'grossNotSubjectToEmployersNiNonRti', + 'grossForTax' => 'grossForTax', + 'employerNi' => 'employerNi', + 'employerNiNonRti' => 'employerNiNonRti', + 'employeeNi' => 'employeeNi', + 'employeeNiNonRti' => 'employeeNiNonRti', + 'employerNiOffPayroll' => 'employerNiOffPayroll', + 'realTimeClass1ANi' => 'realTimeClass1ANi', + 'realTimeClass1ANiNonRti' => 'realTimeClass1ANiNonRti', + 'tax' => 'tax', + 'taxNonRti' => 'taxNonRti', + 'netPay' => 'netPay', + 'adjustments' => 'adjustments', + 'notionalPay' => 'notionalPay', + 'additions' => 'additions', + 'deductions' => 'deductions', + 'takeHomePay' => 'takeHomePay', + 'nonTaxOrNICPmt' => 'nonTaxOrNICPmt', + 'itemsSubjectToClass1NIC' => 'itemsSubjectToClass1NIC', + 'dednsFromNetPay' => 'dednsFromNetPay', + 'tcpTcls' => 'tcp_Tcls', + 'tcpPp' => 'tcp_Pp', + 'tcpOp' => 'tcp_Op', + 'flexiDdDeath' => 'flexiDd_Death', + 'flexiDdDeathNonTax' => 'flexiDd_Death_NonTax', + 'flexiDdPension' => 'flexiDd_Pension', + 'flexiDdPensionNonTax' => 'flexiDd_Pension_NonTax', + 'flexiDdSeriousIllHealth' => 'flexiDd_SeriousIllHealth', + 'flexiDdSeriousIllHealthNonTax' => 'flexiDd_SeriousIllHealth_NonTax', + 'smp' => 'smp', + 'smpNonRti' => 'smpNonRti', + 'spp' => 'spp', + 'sppNonRti' => 'sppNonRti', + 'sap' => 'sap', + 'sapNonRti' => 'sapNonRti', + 'shpp' => 'shpp', + 'shppNonRti' => 'shppNonRti', + 'spbp' => 'spbp', + 'spbpNonRti' => 'spbpNonRti', + 'ssp' => 'ssp', + 'sspNonRti' => 'sspNonRti', + 'studentLoanRecovered' => 'studentLoanRecovered', + 'studentLoanRecoveredNonRti' => 'studentLoanRecoveredNonRti', + 'postgradLoanRecovered' => 'postgradLoanRecovered', + 'postgradLoanRecoveredNonRti' => 'postgradLoanRecoveredNonRti', + 'pensionableEarnings' => 'pensionableEarnings', + 'pensionablePay' => 'pensionablePay', + 'nonTierablePay' => 'nonTierablePay', + 'employeePensionContribution' => 'employeePensionContribution', + 'employeePensionContributionAvc' => 'employeePensionContributionAvc', + 'employerPensionContribution' => 'employerPensionContribution', + 'empeePenContribnsNotPaid' => 'empeePenContribnsNotPaid', + 'empeePenContribnsPaid' => 'empeePenContribnsPaid', + 'attachmentOrderDeductions' => 'attachmentOrderDeductions', + 'cisDeduction' => 'cisDeduction', + 'cisVat' => 'cisVat', + 'cisUmbrellaFee' => 'cisUmbrellaFee', + 'cisUmbrellaFeePostTax' => 'cisUmbrellaFeePostTax', + 'pbik' => 'pbik', + 'mapsMiles' => 'mapsMiles', + 'foreignTaxAmount' => 'foreignTaxAmount', + 'foreignTaxAmountReclaimed' => 'foreignTaxAmountReclaimed', + 'umbrellaFee' => 'umbrellaFee', + 'appLevyDeduction' => 'appLevyDeduction', + 'paymentAfterLeaving' => 'paymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'taxOnPaymentAfterLeaving', + 'nilPaid' => 'nilPaid', + 'leavers' => 'leavers', + 'starters' => 'starters', + 'p45Gross' => 'p45Gross', + 'p45Tax' => 'p45Tax', + 'totalCost' => 'totalCost', + 'recoverableAmounts' => 'recoverableAmounts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'basicPay' => 'setBasicPay', + 'gross' => 'setGross', + 'grossForNi' => 'setGrossForNi', + 'grossForNiNonRti' => 'setGrossForNiNonRti', + 'grossNotSubjectToEmployersNi' => 'setGrossNotSubjectToEmployersNi', + 'grossNotSubjectToEmployersNiNonRti' => 'setGrossNotSubjectToEmployersNiNonRti', + 'grossForTax' => 'setGrossForTax', + 'employerNi' => 'setEmployerNi', + 'employerNiNonRti' => 'setEmployerNiNonRti', + 'employeeNi' => 'setEmployeeNi', + 'employeeNiNonRti' => 'setEmployeeNiNonRti', + 'employerNiOffPayroll' => 'setEmployerNiOffPayroll', + 'realTimeClass1ANi' => 'setRealTimeClass1ANi', + 'realTimeClass1ANiNonRti' => 'setRealTimeClass1ANiNonRti', + 'tax' => 'setTax', + 'taxNonRti' => 'setTaxNonRti', + 'netPay' => 'setNetPay', + 'adjustments' => 'setAdjustments', + 'notionalPay' => 'setNotionalPay', + 'additions' => 'setAdditions', + 'deductions' => 'setDeductions', + 'takeHomePay' => 'setTakeHomePay', + 'nonTaxOrNICPmt' => 'setNonTaxOrNICPmt', + 'itemsSubjectToClass1NIC' => 'setItemsSubjectToClass1NIC', + 'dednsFromNetPay' => 'setDednsFromNetPay', + 'tcpTcls' => 'setTcpTcls', + 'tcpPp' => 'setTcpPp', + 'tcpOp' => 'setTcpOp', + 'flexiDdDeath' => 'setFlexiDdDeath', + 'flexiDdDeathNonTax' => 'setFlexiDdDeathNonTax', + 'flexiDdPension' => 'setFlexiDdPension', + 'flexiDdPensionNonTax' => 'setFlexiDdPensionNonTax', + 'flexiDdSeriousIllHealth' => 'setFlexiDdSeriousIllHealth', + 'flexiDdSeriousIllHealthNonTax' => 'setFlexiDdSeriousIllHealthNonTax', + 'smp' => 'setSmp', + 'smpNonRti' => 'setSmpNonRti', + 'spp' => 'setSpp', + 'sppNonRti' => 'setSppNonRti', + 'sap' => 'setSap', + 'sapNonRti' => 'setSapNonRti', + 'shpp' => 'setShpp', + 'shppNonRti' => 'setShppNonRti', + 'spbp' => 'setSpbp', + 'spbpNonRti' => 'setSpbpNonRti', + 'ssp' => 'setSsp', + 'sspNonRti' => 'setSspNonRti', + 'studentLoanRecovered' => 'setStudentLoanRecovered', + 'studentLoanRecoveredNonRti' => 'setStudentLoanRecoveredNonRti', + 'postgradLoanRecovered' => 'setPostgradLoanRecovered', + 'postgradLoanRecoveredNonRti' => 'setPostgradLoanRecoveredNonRti', + 'pensionableEarnings' => 'setPensionableEarnings', + 'pensionablePay' => 'setPensionablePay', + 'nonTierablePay' => 'setNonTierablePay', + 'employeePensionContribution' => 'setEmployeePensionContribution', + 'employeePensionContributionAvc' => 'setEmployeePensionContributionAvc', + 'employerPensionContribution' => 'setEmployerPensionContribution', + 'empeePenContribnsNotPaid' => 'setEmpeePenContribnsNotPaid', + 'empeePenContribnsPaid' => 'setEmpeePenContribnsPaid', + 'attachmentOrderDeductions' => 'setAttachmentOrderDeductions', + 'cisDeduction' => 'setCisDeduction', + 'cisVat' => 'setCisVat', + 'cisUmbrellaFee' => 'setCisUmbrellaFee', + 'cisUmbrellaFeePostTax' => 'setCisUmbrellaFeePostTax', + 'pbik' => 'setPbik', + 'mapsMiles' => 'setMapsMiles', + 'foreignTaxAmount' => 'setForeignTaxAmount', + 'foreignTaxAmountReclaimed' => 'setForeignTaxAmountReclaimed', + 'umbrellaFee' => 'setUmbrellaFee', + 'appLevyDeduction' => 'setAppLevyDeduction', + 'paymentAfterLeaving' => 'setPaymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'setTaxOnPaymentAfterLeaving', + 'nilPaid' => 'setNilPaid', + 'leavers' => 'setLeavers', + 'starters' => 'setStarters', + 'p45Gross' => 'setP45Gross', + 'p45Tax' => 'setP45Tax', + 'totalCost' => 'setTotalCost', + 'recoverableAmounts' => 'setRecoverableAmounts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'basicPay' => 'getBasicPay', + 'gross' => 'getGross', + 'grossForNi' => 'getGrossForNi', + 'grossForNiNonRti' => 'getGrossForNiNonRti', + 'grossNotSubjectToEmployersNi' => 'getGrossNotSubjectToEmployersNi', + 'grossNotSubjectToEmployersNiNonRti' => 'getGrossNotSubjectToEmployersNiNonRti', + 'grossForTax' => 'getGrossForTax', + 'employerNi' => 'getEmployerNi', + 'employerNiNonRti' => 'getEmployerNiNonRti', + 'employeeNi' => 'getEmployeeNi', + 'employeeNiNonRti' => 'getEmployeeNiNonRti', + 'employerNiOffPayroll' => 'getEmployerNiOffPayroll', + 'realTimeClass1ANi' => 'getRealTimeClass1ANi', + 'realTimeClass1ANiNonRti' => 'getRealTimeClass1ANiNonRti', + 'tax' => 'getTax', + 'taxNonRti' => 'getTaxNonRti', + 'netPay' => 'getNetPay', + 'adjustments' => 'getAdjustments', + 'notionalPay' => 'getNotionalPay', + 'additions' => 'getAdditions', + 'deductions' => 'getDeductions', + 'takeHomePay' => 'getTakeHomePay', + 'nonTaxOrNICPmt' => 'getNonTaxOrNICPmt', + 'itemsSubjectToClass1NIC' => 'getItemsSubjectToClass1NIC', + 'dednsFromNetPay' => 'getDednsFromNetPay', + 'tcpTcls' => 'getTcpTcls', + 'tcpPp' => 'getTcpPp', + 'tcpOp' => 'getTcpOp', + 'flexiDdDeath' => 'getFlexiDdDeath', + 'flexiDdDeathNonTax' => 'getFlexiDdDeathNonTax', + 'flexiDdPension' => 'getFlexiDdPension', + 'flexiDdPensionNonTax' => 'getFlexiDdPensionNonTax', + 'flexiDdSeriousIllHealth' => 'getFlexiDdSeriousIllHealth', + 'flexiDdSeriousIllHealthNonTax' => 'getFlexiDdSeriousIllHealthNonTax', + 'smp' => 'getSmp', + 'smpNonRti' => 'getSmpNonRti', + 'spp' => 'getSpp', + 'sppNonRti' => 'getSppNonRti', + 'sap' => 'getSap', + 'sapNonRti' => 'getSapNonRti', + 'shpp' => 'getShpp', + 'shppNonRti' => 'getShppNonRti', + 'spbp' => 'getSpbp', + 'spbpNonRti' => 'getSpbpNonRti', + 'ssp' => 'getSsp', + 'sspNonRti' => 'getSspNonRti', + 'studentLoanRecovered' => 'getStudentLoanRecovered', + 'studentLoanRecoveredNonRti' => 'getStudentLoanRecoveredNonRti', + 'postgradLoanRecovered' => 'getPostgradLoanRecovered', + 'postgradLoanRecoveredNonRti' => 'getPostgradLoanRecoveredNonRti', + 'pensionableEarnings' => 'getPensionableEarnings', + 'pensionablePay' => 'getPensionablePay', + 'nonTierablePay' => 'getNonTierablePay', + 'employeePensionContribution' => 'getEmployeePensionContribution', + 'employeePensionContributionAvc' => 'getEmployeePensionContributionAvc', + 'employerPensionContribution' => 'getEmployerPensionContribution', + 'empeePenContribnsNotPaid' => 'getEmpeePenContribnsNotPaid', + 'empeePenContribnsPaid' => 'getEmpeePenContribnsPaid', + 'attachmentOrderDeductions' => 'getAttachmentOrderDeductions', + 'cisDeduction' => 'getCisDeduction', + 'cisVat' => 'getCisVat', + 'cisUmbrellaFee' => 'getCisUmbrellaFee', + 'cisUmbrellaFeePostTax' => 'getCisUmbrellaFeePostTax', + 'pbik' => 'getPbik', + 'mapsMiles' => 'getMapsMiles', + 'foreignTaxAmount' => 'getForeignTaxAmount', + 'foreignTaxAmountReclaimed' => 'getForeignTaxAmountReclaimed', + 'umbrellaFee' => 'getUmbrellaFee', + 'appLevyDeduction' => 'getAppLevyDeduction', + 'paymentAfterLeaving' => 'getPaymentAfterLeaving', + 'taxOnPaymentAfterLeaving' => 'getTaxOnPaymentAfterLeaving', + 'nilPaid' => 'getNilPaid', + 'leavers' => 'getLeavers', + 'starters' => 'getStarters', + 'p45Gross' => 'getP45Gross', + 'p45Tax' => 'getP45Tax', + 'totalCost' => 'getTotalCost', + 'recoverableAmounts' => 'getRecoverableAmounts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('basicPay', $data ?? [], null); + $this->setIfExists('gross', $data ?? [], null); + $this->setIfExists('grossForNi', $data ?? [], null); + $this->setIfExists('grossForNiNonRti', $data ?? [], null); + $this->setIfExists('grossNotSubjectToEmployersNi', $data ?? [], null); + $this->setIfExists('grossNotSubjectToEmployersNiNonRti', $data ?? [], null); + $this->setIfExists('grossForTax', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('employerNiNonRti', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('employeeNiNonRti', $data ?? [], null); + $this->setIfExists('employerNiOffPayroll', $data ?? [], null); + $this->setIfExists('realTimeClass1ANi', $data ?? [], null); + $this->setIfExists('realTimeClass1ANiNonRti', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('taxNonRti', $data ?? [], null); + $this->setIfExists('netPay', $data ?? [], null); + $this->setIfExists('adjustments', $data ?? [], null); + $this->setIfExists('notionalPay', $data ?? [], null); + $this->setIfExists('additions', $data ?? [], null); + $this->setIfExists('deductions', $data ?? [], null); + $this->setIfExists('takeHomePay', $data ?? [], null); + $this->setIfExists('nonTaxOrNICPmt', $data ?? [], null); + $this->setIfExists('itemsSubjectToClass1NIC', $data ?? [], null); + $this->setIfExists('dednsFromNetPay', $data ?? [], null); + $this->setIfExists('tcpTcls', $data ?? [], null); + $this->setIfExists('tcpPp', $data ?? [], null); + $this->setIfExists('tcpOp', $data ?? [], null); + $this->setIfExists('flexiDdDeath', $data ?? [], null); + $this->setIfExists('flexiDdDeathNonTax', $data ?? [], null); + $this->setIfExists('flexiDdPension', $data ?? [], null); + $this->setIfExists('flexiDdPensionNonTax', $data ?? [], null); + $this->setIfExists('flexiDdSeriousIllHealth', $data ?? [], null); + $this->setIfExists('flexiDdSeriousIllHealthNonTax', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('smpNonRti', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sppNonRti', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('sapNonRti', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('shppNonRti', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('spbpNonRti', $data ?? [], null); + $this->setIfExists('ssp', $data ?? [], null); + $this->setIfExists('sspNonRti', $data ?? [], null); + $this->setIfExists('studentLoanRecovered', $data ?? [], null); + $this->setIfExists('studentLoanRecoveredNonRti', $data ?? [], null); + $this->setIfExists('postgradLoanRecovered', $data ?? [], null); + $this->setIfExists('postgradLoanRecoveredNonRti', $data ?? [], null); + $this->setIfExists('pensionableEarnings', $data ?? [], null); + $this->setIfExists('pensionablePay', $data ?? [], null); + $this->setIfExists('nonTierablePay', $data ?? [], null); + $this->setIfExists('employeePensionContribution', $data ?? [], null); + $this->setIfExists('employeePensionContributionAvc', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + $this->setIfExists('empeePenContribnsNotPaid', $data ?? [], null); + $this->setIfExists('empeePenContribnsPaid', $data ?? [], null); + $this->setIfExists('attachmentOrderDeductions', $data ?? [], null); + $this->setIfExists('cisDeduction', $data ?? [], null); + $this->setIfExists('cisVat', $data ?? [], null); + $this->setIfExists('cisUmbrellaFee', $data ?? [], null); + $this->setIfExists('cisUmbrellaFeePostTax', $data ?? [], null); + $this->setIfExists('pbik', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('foreignTaxAmount', $data ?? [], null); + $this->setIfExists('foreignTaxAmountReclaimed', $data ?? [], null); + $this->setIfExists('umbrellaFee', $data ?? [], null); + $this->setIfExists('appLevyDeduction', $data ?? [], null); + $this->setIfExists('paymentAfterLeaving', $data ?? [], null); + $this->setIfExists('taxOnPaymentAfterLeaving', $data ?? [], null); + $this->setIfExists('nilPaid', $data ?? [], null); + $this->setIfExists('leavers', $data ?? [], null); + $this->setIfExists('starters', $data ?? [], null); + $this->setIfExists('p45Gross', $data ?? [], null); + $this->setIfExists('p45Tax', $data ?? [], null); + $this->setIfExists('totalCost', $data ?? [], null); + $this->setIfExists('recoverableAmounts', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets basicPay + * + * @return float|null + */ + public function getBasicPay(): ?float + { + return $this->container['basicPay']; + } + + /** + * Sets basicPay + * + * @param float|null $basicPay [readonly] The amount to be paid to this Employee as a result of the PayOptions that have been set + * + * @return $this + */ + public function setBasicPay(?float $basicPay): static + { + if (is_null($basicPay)) { + throw new InvalidArgumentException('non-nullable basicPay cannot be null'); + } + $this->container['basicPay'] = $basicPay; + + return $this; + } + + /** + * Gets gross + * + * @return float|null + */ + public function getGross(): ?float + { + return $this->container['gross']; + } + + /** + * Sets gross + * + * @param float|null $gross [readonly] Gross pay + * + * @return $this + */ + public function setGross(?float $gross): static + { + if (is_null($gross)) { + throw new InvalidArgumentException('non-nullable gross cannot be null'); + } + $this->container['gross'] = $gross; + + return $this; + } + + /** + * Gets grossForNi + * + * @return float|null + */ + public function getGrossForNi(): ?float + { + return $this->container['grossForNi']; + } + + /** + * Sets grossForNi + * + * @param float|null $grossForNi [readonly] The amount of the Gross that is subject to NI + * + * @return $this + */ + public function setGrossForNi(?float $grossForNi): static + { + if (is_null($grossForNi)) { + throw new InvalidArgumentException('non-nullable grossForNi cannot be null'); + } + $this->container['grossForNi'] = $grossForNi; + + return $this; + } + + /** + * Gets grossForNiNonRti + * + * @return float|null + */ + public function getGrossForNiNonRti(): ?float + { + return $this->container['grossForNiNonRti']; + } + + /** + * Sets grossForNiNonRti + * + * @param float|null $grossForNiNonRti [readonly] The amount of the Gross that is subject to NI but excluded from RTI + * + * @return $this + */ + public function setGrossForNiNonRti(?float $grossForNiNonRti): static + { + if (is_null($grossForNiNonRti)) { + throw new InvalidArgumentException('non-nullable grossForNiNonRti cannot be null'); + } + $this->container['grossForNiNonRti'] = $grossForNiNonRti; + + return $this; + } + + /** + * Gets grossNotSubjectToEmployersNi + * + * @return float|null + */ + public function getGrossNotSubjectToEmployersNi(): ?float + { + return $this->container['grossNotSubjectToEmployersNi']; + } + + /** + * Sets grossNotSubjectToEmployersNi + * + * @param float|null $grossNotSubjectToEmployersNi [readonly] The amount of the Gross that is not subject to Employers NI. This is the same as GrossForNI where the employees NI Table has an Er contribution + * + * @return $this + */ + public function setGrossNotSubjectToEmployersNi(?float $grossNotSubjectToEmployersNi): static + { + if (is_null($grossNotSubjectToEmployersNi)) { + throw new InvalidArgumentException('non-nullable grossNotSubjectToEmployersNi cannot be null'); + } + $this->container['grossNotSubjectToEmployersNi'] = $grossNotSubjectToEmployersNi; + + return $this; + } + + /** + * Gets grossNotSubjectToEmployersNiNonRti + * + * @return float|null + */ + public function getGrossNotSubjectToEmployersNiNonRti(): ?float + { + return $this->container['grossNotSubjectToEmployersNiNonRti']; + } + + /** + * Sets grossNotSubjectToEmployersNiNonRti + * + * @param float|null $grossNotSubjectToEmployersNiNonRti [readonly] The amount of the Gross that is not subject to Employers NI. This is the same as GrossForNI where the employees NI Table has an Er contribution This is the amount that is excluded from RTI + * + * @return $this + */ + public function setGrossNotSubjectToEmployersNiNonRti(?float $grossNotSubjectToEmployersNiNonRti): static + { + if (is_null($grossNotSubjectToEmployersNiNonRti)) { + throw new InvalidArgumentException('non-nullable grossNotSubjectToEmployersNiNonRti cannot be null'); + } + $this->container['grossNotSubjectToEmployersNiNonRti'] = $grossNotSubjectToEmployersNiNonRti; + + return $this; + } + + /** + * Gets grossForTax + * + * @return float|null + */ + public function getGrossForTax(): ?float + { + return $this->container['grossForTax']; + } + + /** + * Sets grossForTax + * + * @param float|null $grossForTax [readonly] The amount of the Gross that is subject to PAYE + * + * @return $this + */ + public function setGrossForTax(?float $grossForTax): static + { + if (is_null($grossForTax)) { + throw new InvalidArgumentException('non-nullable grossForTax cannot be null'); + } + $this->container['grossForTax'] = $grossForTax; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi [readonly] + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets employerNiNonRti + * + * @return float|null + */ + public function getEmployerNiNonRti(): ?float + { + return $this->container['employerNiNonRti']; + } + + /** + * Sets employerNiNonRti + * + * @param float|null $employerNiNonRti [readonly] Employer NI excluded from RTI + * + * @return $this + */ + public function setEmployerNiNonRti(?float $employerNiNonRti): static + { + if (is_null($employerNiNonRti)) { + throw new InvalidArgumentException('non-nullable employerNiNonRti cannot be null'); + } + $this->container['employerNiNonRti'] = $employerNiNonRti; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi [readonly] + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets employeeNiNonRti + * + * @return float|null + */ + public function getEmployeeNiNonRti(): ?float + { + return $this->container['employeeNiNonRti']; + } + + /** + * Sets employeeNiNonRti + * + * @param float|null $employeeNiNonRti [readonly] Employee NI excluded from RTI + * + * @return $this + */ + public function setEmployeeNiNonRti(?float $employeeNiNonRti): static + { + if (is_null($employeeNiNonRti)) { + throw new InvalidArgumentException('non-nullable employeeNiNonRti cannot be null'); + } + $this->container['employeeNiNonRti'] = $employeeNiNonRti; + + return $this; + } + + /** + * Gets employerNiOffPayroll + * + * @return float|null + */ + public function getEmployerNiOffPayroll(): ?float + { + return $this->container['employerNiOffPayroll']; + } + + /** + * Sets employerNiOffPayroll + * + * @param float|null $employerNiOffPayroll [readonly] The amount included in EmployerNi that is in relation to Off-Payroll Workers + * + * @return $this + */ + public function setEmployerNiOffPayroll(?float $employerNiOffPayroll): static + { + if (is_null($employerNiOffPayroll)) { + throw new InvalidArgumentException('non-nullable employerNiOffPayroll cannot be null'); + } + $this->container['employerNiOffPayroll'] = $employerNiOffPayroll; + + return $this; + } + + /** + * Gets realTimeClass1ANi + * + * @return float|null + */ + public function getRealTimeClass1ANi(): ?float + { + return $this->container['realTimeClass1ANi']; + } + + /** + * Sets realTimeClass1ANi + * + * @param float|null $realTimeClass1ANi [readonly] + * + * @return $this + */ + public function setRealTimeClass1ANi(?float $realTimeClass1ANi): static + { + if (is_null($realTimeClass1ANi)) { + throw new InvalidArgumentException('non-nullable realTimeClass1ANi cannot be null'); + } + $this->container['realTimeClass1ANi'] = $realTimeClass1ANi; + + return $this; + } + + /** + * Gets realTimeClass1ANiNonRti + * + * @return float|null + */ + public function getRealTimeClass1ANiNonRti(): ?float + { + return $this->container['realTimeClass1ANiNonRti']; + } + + /** + * Sets realTimeClass1ANiNonRti + * + * @param float|null $realTimeClass1ANiNonRti [readonly] Real Time Class 1A NI excluded from RTI + * + * @return $this + */ + public function setRealTimeClass1ANiNonRti(?float $realTimeClass1ANiNonRti): static + { + if (is_null($realTimeClass1ANiNonRti)) { + throw new InvalidArgumentException('non-nullable realTimeClass1ANiNonRti cannot be null'); + } + $this->container['realTimeClass1ANiNonRti'] = $realTimeClass1ANiNonRti; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax [readonly] + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets taxNonRti + * + * @return float|null + */ + public function getTaxNonRti(): ?float + { + return $this->container['taxNonRti']; + } + + /** + * Sets taxNonRti + * + * @param float|null $taxNonRti [readonly] Tax excluded from RTI + * + * @return $this + */ + public function setTaxNonRti(?float $taxNonRti): static + { + if (is_null($taxNonRti)) { + throw new InvalidArgumentException('non-nullable taxNonRti cannot be null'); + } + $this->container['taxNonRti'] = $taxNonRti; + + return $this; + } + + /** + * Gets netPay + * + * @return float|null + */ + public function getNetPay(): ?float + { + return $this->container['netPay']; + } + + /** + * Sets netPay + * + * @param float|null $netPay [readonly] The Net Pay for this Employee + * + * @return $this + */ + public function setNetPay(?float $netPay): static + { + if (is_null($netPay)) { + throw new InvalidArgumentException('non-nullable netPay cannot be null'); + } + $this->container['netPay'] = $netPay; + + return $this; + } + + /** + * Gets adjustments + * + * @return float|null + */ + public function getAdjustments(): ?float + { + return $this->container['adjustments']; + } + + /** + * Sets adjustments + * + * @param float|null $adjustments [readonly] The value of adjustments made to the Net Pay (Non taxable/NIable additions/deductions) + * + * @return $this + */ + public function setAdjustments(?float $adjustments): static + { + if (is_null($adjustments)) { + throw new InvalidArgumentException('non-nullable adjustments cannot be null'); + } + $this->container['adjustments'] = $adjustments; + + return $this; + } + + /** + * Gets notionalPay + * + * @return float|null + */ + public function getNotionalPay(): ?float + { + return $this->container['notionalPay']; + } + + /** + * Sets notionalPay + * + * @param float|null $notionalPay [readonly] The value of adjustments that are of type notional. + * + * @return $this + */ + public function setNotionalPay(?float $notionalPay): static + { + if (is_null($notionalPay)) { + throw new InvalidArgumentException('non-nullable notionalPay cannot be null'); + } + $this->container['notionalPay'] = $notionalPay; + + return $this; + } + + /** + * Gets additions + * + * @return float|null + */ + public function getAdditions(): ?float + { + return $this->container['additions']; + } + + /** + * Sets additions + * + * @param float|null $additions The value of all additions. This minus Deductions should equal TakeHomePay + * + * @return $this + */ + public function setAdditions(?float $additions): static + { + if (is_null($additions)) { + throw new InvalidArgumentException('non-nullable additions cannot be null'); + } + $this->container['additions'] = $additions; + + return $this; + } + + /** + * Gets deductions + * + * @return float|null + */ + public function getDeductions(): ?float + { + return $this->container['deductions']; + } + + /** + * Sets deductions + * + * @param float|null $deductions The value of all deductions. Additions minus This value should equal TakeHomePay + * + * @return $this + */ + public function setDeductions(?float $deductions): static + { + if (is_null($deductions)) { + throw new InvalidArgumentException('non-nullable deductions cannot be null'); + } + $this->container['deductions'] = $deductions; + + return $this; + } + + /** + * Gets takeHomePay + * + * @return float|null + */ + public function getTakeHomePay(): ?float + { + return $this->container['takeHomePay']; + } + + /** + * Sets takeHomePay + * + * @param float|null $takeHomePay [readonly] The amount this Employee takes home + * + * @return $this + */ + public function setTakeHomePay(?float $takeHomePay): static + { + if (is_null($takeHomePay)) { + throw new InvalidArgumentException('non-nullable takeHomePay cannot be null'); + } + $this->container['takeHomePay'] = $takeHomePay; + + return $this; + } + + /** + * Gets nonTaxOrNICPmt + * + * @return float|null + */ + public function getNonTaxOrNICPmt(): ?float + { + return $this->container['nonTaxOrNICPmt']; + } + + /** + * Sets nonTaxOrNICPmt + * + * @param float|null $nonTaxOrNICPmt [readonly] The value of any payments being made to this Employee that aren't being subjected to PAYE or NI + * + * @return $this + */ + public function setNonTaxOrNICPmt(?float $nonTaxOrNICPmt): static + { + if (is_null($nonTaxOrNICPmt)) { + throw new InvalidArgumentException('non-nullable nonTaxOrNICPmt cannot be null'); + } + $this->container['nonTaxOrNICPmt'] = $nonTaxOrNICPmt; + + return $this; + } + + /** + * Gets itemsSubjectToClass1NIC + * + * @return float|null + */ + public function getItemsSubjectToClass1NIC(): ?float + { + return $this->container['itemsSubjectToClass1NIC']; + } + + /** + * Sets itemsSubjectToClass1NIC + * + * @param float|null $itemsSubjectToClass1NIC [readonly] Items subject to Class 1 NIC but not taxed under PAYE regulations excluding pension contributions + * + * @return $this + */ + public function setItemsSubjectToClass1NIC(?float $itemsSubjectToClass1NIC): static + { + if (is_null($itemsSubjectToClass1NIC)) { + throw new InvalidArgumentException('non-nullable itemsSubjectToClass1NIC cannot be null'); + } + $this->container['itemsSubjectToClass1NIC'] = $itemsSubjectToClass1NIC; + + return $this; + } + + /** + * Gets dednsFromNetPay + * + * @return float|null + */ + public function getDednsFromNetPay(): ?float + { + return $this->container['dednsFromNetPay']; + } + + /** + * Sets dednsFromNetPay + * + * @param float|null $dednsFromNetPay [readonly] The value of any deductions being made to the Net Pay for this Employee + * + * @return $this + */ + public function setDednsFromNetPay(?float $dednsFromNetPay): static + { + if (is_null($dednsFromNetPay)) { + throw new InvalidArgumentException('non-nullable dednsFromNetPay cannot be null'); + } + $this->container['dednsFromNetPay'] = $dednsFromNetPay; + + return $this; + } + + /** + * Gets tcpTcls + * + * @return float|null + */ + public function getTcpTcls(): ?float + { + return $this->container['tcpTcls']; + } + + /** + * Sets tcpTcls + * + * @param float|null $tcpTcls [readonly] Value of payments marked as Trivial Commutation Payment (A - TCLS) + * + * @return $this + */ + public function setTcpTcls(?float $tcpTcls): static + { + if (is_null($tcpTcls)) { + throw new InvalidArgumentException('non-nullable tcpTcls cannot be null'); + } + $this->container['tcpTcls'] = $tcpTcls; + + return $this; + } + + /** + * Gets tcpPp + * + * @return float|null + */ + public function getTcpPp(): ?float + { + return $this->container['tcpPp']; + } + + /** + * Sets tcpPp + * + * @param float|null $tcpPp [readonly] Value of payments marked as Trivial Commutation Payment (B - Personal Pension) + * + * @return $this + */ + public function setTcpPp(?float $tcpPp): static + { + if (is_null($tcpPp)) { + throw new InvalidArgumentException('non-nullable tcpPp cannot be null'); + } + $this->container['tcpPp'] = $tcpPp; + + return $this; + } + + /** + * Gets tcpOp + * + * @return float|null + */ + public function getTcpOp(): ?float + { + return $this->container['tcpOp']; + } + + /** + * Sets tcpOp + * + * @param float|null $tcpOp [readonly] Value of payments marked as Trivial Commutation Payment (C - Occupational Pension) + * + * @return $this + */ + public function setTcpOp(?float $tcpOp): static + { + if (is_null($tcpOp)) { + throw new InvalidArgumentException('non-nullable tcpOp cannot be null'); + } + $this->container['tcpOp'] = $tcpOp; + + return $this; + } + + /** + * Gets flexiDdDeath + * + * @return float|null + */ + public function getFlexiDdDeath(): ?float + { + return $this->container['flexiDdDeath']; + } + + /** + * Sets flexiDdDeath + * + * @param float|null $flexiDdDeath [readonly] Value of payments marked as flexibly accessing death benefit (taxable) + * + * @return $this + */ + public function setFlexiDdDeath(?float $flexiDdDeath): static + { + if (is_null($flexiDdDeath)) { + throw new InvalidArgumentException('non-nullable flexiDdDeath cannot be null'); + } + $this->container['flexiDdDeath'] = $flexiDdDeath; + + return $this; + } + + /** + * Gets flexiDdDeathNonTax + * + * @return float|null + */ + public function getFlexiDdDeathNonTax(): ?float + { + return $this->container['flexiDdDeathNonTax']; + } + + /** + * Sets flexiDdDeathNonTax + * + * @param float|null $flexiDdDeathNonTax [readonly] Value of payments marked as flexibly accessing death benefit (non taxable) + * + * @return $this + */ + public function setFlexiDdDeathNonTax(?float $flexiDdDeathNonTax): static + { + if (is_null($flexiDdDeathNonTax)) { + throw new InvalidArgumentException('non-nullable flexiDdDeathNonTax cannot be null'); + } + $this->container['flexiDdDeathNonTax'] = $flexiDdDeathNonTax; + + return $this; + } + + /** + * Gets flexiDdPension + * + * @return float|null + */ + public function getFlexiDdPension(): ?float + { + return $this->container['flexiDdPension']; + } + + /** + * Sets flexiDdPension + * + * @param float|null $flexiDdPension [readonly] Value of payments marked as flexibly accessing pension (taxable) + * + * @return $this + */ + public function setFlexiDdPension(?float $flexiDdPension): static + { + if (is_null($flexiDdPension)) { + throw new InvalidArgumentException('non-nullable flexiDdPension cannot be null'); + } + $this->container['flexiDdPension'] = $flexiDdPension; + + return $this; + } + + /** + * Gets flexiDdPensionNonTax + * + * @return float|null + */ + public function getFlexiDdPensionNonTax(): ?float + { + return $this->container['flexiDdPensionNonTax']; + } + + /** + * Sets flexiDdPensionNonTax + * + * @param float|null $flexiDdPensionNonTax [readonly] Value of payments marked as flexibly accessing pension (non taxable) + * + * @return $this + */ + public function setFlexiDdPensionNonTax(?float $flexiDdPensionNonTax): static + { + if (is_null($flexiDdPensionNonTax)) { + throw new InvalidArgumentException('non-nullable flexiDdPensionNonTax cannot be null'); + } + $this->container['flexiDdPensionNonTax'] = $flexiDdPensionNonTax; + + return $this; + } + + /** + * Gets flexiDdSeriousIllHealth + * + * @return float|null + */ + public function getFlexiDdSeriousIllHealth(): ?float + { + return $this->container['flexiDdSeriousIllHealth']; + } + + /** + * Sets flexiDdSeriousIllHealth + * + * @param float|null $flexiDdSeriousIllHealth [readonly] Value of payments marked as flexibly accessing serious ill health lump sum (taxable) + * + * @return $this + */ + public function setFlexiDdSeriousIllHealth(?float $flexiDdSeriousIllHealth): static + { + if (is_null($flexiDdSeriousIllHealth)) { + throw new InvalidArgumentException('non-nullable flexiDdSeriousIllHealth cannot be null'); + } + $this->container['flexiDdSeriousIllHealth'] = $flexiDdSeriousIllHealth; + + return $this; + } + + /** + * Gets flexiDdSeriousIllHealthNonTax + * + * @return float|null + */ + public function getFlexiDdSeriousIllHealthNonTax(): ?float + { + return $this->container['flexiDdSeriousIllHealthNonTax']; + } + + /** + * Sets flexiDdSeriousIllHealthNonTax + * + * @param float|null $flexiDdSeriousIllHealthNonTax [readonly] Value of payments marked as flexibly accessing serious ill health lump sum (non taxable) + * + * @return $this + */ + public function setFlexiDdSeriousIllHealthNonTax(?float $flexiDdSeriousIllHealthNonTax): static + { + if (is_null($flexiDdSeriousIllHealthNonTax)) { + throw new InvalidArgumentException('non-nullable flexiDdSeriousIllHealthNonTax cannot be null'); + } + $this->container['flexiDdSeriousIllHealthNonTax'] = $flexiDdSeriousIllHealthNonTax; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp [readonly] Statutory Maternity Pay + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets smpNonRti + * + * @return float|null + */ + public function getSmpNonRti(): ?float + { + return $this->container['smpNonRti']; + } + + /** + * Sets smpNonRti + * + * @param float|null $smpNonRti [readonly] Statutory Maternity Pay excluded from RTI + * + * @return $this + */ + public function setSmpNonRti(?float $smpNonRti): static + { + if (is_null($smpNonRti)) { + throw new InvalidArgumentException('non-nullable smpNonRti cannot be null'); + } + $this->container['smpNonRti'] = $smpNonRti; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp [readonly] Statutory Paternity Pay + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sppNonRti + * + * @return float|null + */ + public function getSppNonRti(): ?float + { + return $this->container['sppNonRti']; + } + + /** + * Sets sppNonRti + * + * @param float|null $sppNonRti [readonly] Statutory Paternity Pay excluded from RTI + * + * @return $this + */ + public function setSppNonRti(?float $sppNonRti): static + { + if (is_null($sppNonRti)) { + throw new InvalidArgumentException('non-nullable sppNonRti cannot be null'); + } + $this->container['sppNonRti'] = $sppNonRti; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap [readonly] Statutory Adoption Pay + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets sapNonRti + * + * @return float|null + */ + public function getSapNonRti(): ?float + { + return $this->container['sapNonRti']; + } + + /** + * Sets sapNonRti + * + * @param float|null $sapNonRti [readonly] Statutory Adoption Pay excluded from RTI + * + * @return $this + */ + public function setSapNonRti(?float $sapNonRti): static + { + if (is_null($sapNonRti)) { + throw new InvalidArgumentException('non-nullable sapNonRti cannot be null'); + } + $this->container['sapNonRti'] = $sapNonRti; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp [readonly] Statutory Shared Parental Pay + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets shppNonRti + * + * @return float|null + */ + public function getShppNonRti(): ?float + { + return $this->container['shppNonRti']; + } + + /** + * Sets shppNonRti + * + * @param float|null $shppNonRti [readonly] Statutory Shared Parental Pay excluded from RTI + * + * @return $this + */ + public function setShppNonRti(?float $shppNonRti): static + { + if (is_null($shppNonRti)) { + throw new InvalidArgumentException('non-nullable shppNonRti cannot be null'); + } + $this->container['shppNonRti'] = $shppNonRti; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp [readonly] Statutory Parental Bereavement Pay + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets spbpNonRti + * + * @return float|null + */ + public function getSpbpNonRti(): ?float + { + return $this->container['spbpNonRti']; + } + + /** + * Sets spbpNonRti + * + * @param float|null $spbpNonRti [readonly] Statutory Parental Bereavement Pay excluded from RTI + * + * @return $this + */ + public function setSpbpNonRti(?float $spbpNonRti): static + { + if (is_null($spbpNonRti)) { + throw new InvalidArgumentException('non-nullable spbpNonRti cannot be null'); + } + $this->container['spbpNonRti'] = $spbpNonRti; + + return $this; + } + + /** + * Gets ssp + * + * @return float|null + */ + public function getSsp(): ?float + { + return $this->container['ssp']; + } + + /** + * Sets ssp + * + * @param float|null $ssp [readonly] Statutory Sick Pay + * + * @return $this + */ + public function setSsp(?float $ssp): static + { + if (is_null($ssp)) { + throw new InvalidArgumentException('non-nullable ssp cannot be null'); + } + $this->container['ssp'] = $ssp; + + return $this; + } + + /** + * Gets sspNonRti + * + * @return float|null + */ + public function getSspNonRti(): ?float + { + return $this->container['sspNonRti']; + } + + /** + * Sets sspNonRti + * + * @param float|null $sspNonRti [readonly] Statutory Sick Pay excluded from RTI + * + * @return $this + */ + public function setSspNonRti(?float $sspNonRti): static + { + if (is_null($sspNonRti)) { + throw new InvalidArgumentException('non-nullable sspNonRti cannot be null'); + } + $this->container['sspNonRti'] = $sspNonRti; + + return $this; + } + + /** + * Gets studentLoanRecovered + * + * @return float|null + */ + public function getStudentLoanRecovered(): ?float + { + return $this->container['studentLoanRecovered']; + } + + /** + * Sets studentLoanRecovered + * + * @param float|null $studentLoanRecovered [readonly] + * + * @return $this + */ + public function setStudentLoanRecovered(?float $studentLoanRecovered): static + { + if (is_null($studentLoanRecovered)) { + throw new InvalidArgumentException('non-nullable studentLoanRecovered cannot be null'); + } + $this->container['studentLoanRecovered'] = $studentLoanRecovered; + + return $this; + } + + /** + * Gets studentLoanRecoveredNonRti + * + * @return float|null + */ + public function getStudentLoanRecoveredNonRti(): ?float + { + return $this->container['studentLoanRecoveredNonRti']; + } + + /** + * Sets studentLoanRecoveredNonRti + * + * @param float|null $studentLoanRecoveredNonRti [readonly] Student Loan recovered excluded from RTI + * + * @return $this + */ + public function setStudentLoanRecoveredNonRti(?float $studentLoanRecoveredNonRti): static + { + if (is_null($studentLoanRecoveredNonRti)) { + throw new InvalidArgumentException('non-nullable studentLoanRecoveredNonRti cannot be null'); + } + $this->container['studentLoanRecoveredNonRti'] = $studentLoanRecoveredNonRti; + + return $this; + } + + /** + * Gets postgradLoanRecovered + * + * @return float|null + */ + public function getPostgradLoanRecovered(): ?float + { + return $this->container['postgradLoanRecovered']; + } + + /** + * Sets postgradLoanRecovered + * + * @param float|null $postgradLoanRecovered [readonly] + * + * @return $this + */ + public function setPostgradLoanRecovered(?float $postgradLoanRecovered): static + { + if (is_null($postgradLoanRecovered)) { + throw new InvalidArgumentException('non-nullable postgradLoanRecovered cannot be null'); + } + $this->container['postgradLoanRecovered'] = $postgradLoanRecovered; + + return $this; + } + + /** + * Gets postgradLoanRecoveredNonRti + * + * @return float|null + */ + public function getPostgradLoanRecoveredNonRti(): ?float + { + return $this->container['postgradLoanRecoveredNonRti']; + } + + /** + * Sets postgradLoanRecoveredNonRti + * + * @param float|null $postgradLoanRecoveredNonRti [readonly] Postgrad Loan recovered excluded from RTI + * + * @return $this + */ + public function setPostgradLoanRecoveredNonRti(?float $postgradLoanRecoveredNonRti): static + { + if (is_null($postgradLoanRecoveredNonRti)) { + throw new InvalidArgumentException('non-nullable postgradLoanRecoveredNonRti cannot be null'); + } + $this->container['postgradLoanRecoveredNonRti'] = $postgradLoanRecoveredNonRti; + + return $this; + } + + /** + * Gets pensionableEarnings + * + * @return float|null + */ + public function getPensionableEarnings(): ?float + { + return $this->container['pensionableEarnings']; + } + + /** + * Sets pensionableEarnings + * + * @param float|null $pensionableEarnings [readonly] The amount of the Gross that is subject to Pension Deductions. If the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied + * + * @return $this + */ + public function setPensionableEarnings(?float $pensionableEarnings): static + { + if (is_null($pensionableEarnings)) { + throw new InvalidArgumentException('non-nullable pensionableEarnings cannot be null'); + } + $this->container['pensionableEarnings'] = $pensionableEarnings; + + return $this; + } + + /** + * Gets pensionablePay + * + * @return float|null + */ + public function getPensionablePay(): ?float + { + return $this->container['pensionablePay']; + } + + /** + * Sets pensionablePay + * + * @param float|null $pensionablePay [readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. + * + * @return $this + */ + public function setPensionablePay(?float $pensionablePay): static + { + if (is_null($pensionablePay)) { + throw new InvalidArgumentException('non-nullable pensionablePay cannot be null'); + } + $this->container['pensionablePay'] = $pensionablePay; + + return $this; + } + + /** + * Gets nonTierablePay + * + * @return float|null + */ + public function getNonTierablePay(): ?float + { + return $this->container['nonTierablePay']; + } + + /** + * Sets nonTierablePay + * + * @param float|null $nonTierablePay [readonly] The value of any pay that shouldn't count towards determining a pension tier. + * + * @return $this + */ + public function setNonTierablePay(?float $nonTierablePay): static + { + if (is_null($nonTierablePay)) { + throw new InvalidArgumentException('non-nullable nonTierablePay cannot be null'); + } + $this->container['nonTierablePay'] = $nonTierablePay; + + return $this; + } + + /** + * Gets employeePensionContribution + * + * @return float|null + */ + public function getEmployeePensionContribution(): ?float + { + return $this->container['employeePensionContribution']; + } + + /** + * Sets employeePensionContribution + * + * @param float|null $employeePensionContribution [readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions + * + * @return $this + */ + public function setEmployeePensionContribution(?float $employeePensionContribution): static + { + if (is_null($employeePensionContribution)) { + throw new InvalidArgumentException('non-nullable employeePensionContribution cannot be null'); + } + $this->container['employeePensionContribution'] = $employeePensionContribution; + + return $this; + } + + /** + * Gets employeePensionContributionAvc + * + * @return float|null + */ + public function getEmployeePensionContributionAvc(): ?float + { + return $this->container['employeePensionContributionAvc']; + } + + /** + * Sets employeePensionContributionAvc + * + * @param float|null $employeePensionContributionAvc [readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution + * + * @return $this + */ + public function setEmployeePensionContributionAvc(?float $employeePensionContributionAvc): static + { + if (is_null($employeePensionContributionAvc)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionAvc cannot be null'); + } + $this->container['employeePensionContributionAvc'] = $employeePensionContributionAvc; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return float|null + */ + public function getEmployerPensionContribution(): ?float + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param float|null $employerPensionContribution [readonly] The value of the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setEmployerPensionContribution(?float $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + throw new InvalidArgumentException('non-nullable employerPensionContribution cannot be null'); + } + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + + /** + * Gets empeePenContribnsNotPaid + * + * @return float|null + */ + public function getEmpeePenContribnsNotPaid(): ?float + { + return $this->container['empeePenContribnsNotPaid']; + } + + /** + * Sets empeePenContribnsNotPaid + * + * @param float|null $empeePenContribnsNotPaid [readonly] Value of employee pension contributions that are not paid under 'net pay arrangements', including any AVC + * + * @return $this + */ + public function setEmpeePenContribnsNotPaid(?float $empeePenContribnsNotPaid): static + { + if (is_null($empeePenContribnsNotPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsNotPaid cannot be null'); + } + $this->container['empeePenContribnsNotPaid'] = $empeePenContribnsNotPaid; + + return $this; + } + + /** + * Gets empeePenContribnsPaid + * + * @return float|null + */ + public function getEmpeePenContribnsPaid(): ?float + { + return $this->container['empeePenContribnsPaid']; + } + + /** + * Sets empeePenContribnsPaid + * + * @param float|null $empeePenContribnsPaid [readonly] Value of employee pension contributions paid under 'net pay arrangements', including any AVC + * + * @return $this + */ + public function setEmpeePenContribnsPaid(?float $empeePenContribnsPaid): static + { + if (is_null($empeePenContribnsPaid)) { + throw new InvalidArgumentException('non-nullable empeePenContribnsPaid cannot be null'); + } + $this->container['empeePenContribnsPaid'] = $empeePenContribnsPaid; + + return $this; + } + + /** + * Gets attachmentOrderDeductions + * + * @return float|null + */ + public function getAttachmentOrderDeductions(): ?float + { + return $this->container['attachmentOrderDeductions']; + } + + /** + * Sets attachmentOrderDeductions + * + * @param float|null $attachmentOrderDeductions [readonly] Value of deductions made due to AttachmentOrders + * + * @return $this + */ + public function setAttachmentOrderDeductions(?float $attachmentOrderDeductions): static + { + if (is_null($attachmentOrderDeductions)) { + throw new InvalidArgumentException('non-nullable attachmentOrderDeductions cannot be null'); + } + $this->container['attachmentOrderDeductions'] = $attachmentOrderDeductions; + + return $this; + } + + /** + * Gets cisDeduction + * + * @return float|null + */ + public function getCisDeduction(): ?float + { + return $this->container['cisDeduction']; + } + + /** + * Sets cisDeduction + * + * @param float|null $cisDeduction [readonly] Value of any CIS Deduction made + * + * @return $this + */ + public function setCisDeduction(?float $cisDeduction): static + { + if (is_null($cisDeduction)) { + throw new InvalidArgumentException('non-nullable cisDeduction cannot be null'); + } + $this->container['cisDeduction'] = $cisDeduction; + + return $this; + } + + /** + * Gets cisVat + * + * @return float|null + */ + public function getCisVat(): ?float + { + return $this->container['cisVat']; + } + + /** + * Sets cisVat + * + * @param float|null $cisVat [readonly] Value of any VAT paid to CIS Subcontractor + * + * @return $this + */ + public function setCisVat(?float $cisVat): static + { + if (is_null($cisVat)) { + throw new InvalidArgumentException('non-nullable cisVat cannot be null'); + } + $this->container['cisVat'] = $cisVat; + + return $this; + } + + /** + * Gets cisUmbrellaFee + * + * @return float|null + */ + public function getCisUmbrellaFee(): ?float + { + return $this->container['cisUmbrellaFee']; + } + + /** + * Sets cisUmbrellaFee + * + * @param float|null $cisUmbrellaFee [readonly] Value of any pre-tax fee charged to the CIS Subcontractor for processing the payment + * + * @return $this + */ + public function setCisUmbrellaFee(?float $cisUmbrellaFee): static + { + if (is_null($cisUmbrellaFee)) { + throw new InvalidArgumentException('non-nullable cisUmbrellaFee cannot be null'); + } + $this->container['cisUmbrellaFee'] = $cisUmbrellaFee; + + return $this; + } + + /** + * Gets cisUmbrellaFeePostTax + * + * @return float|null + */ + public function getCisUmbrellaFeePostTax(): ?float + { + return $this->container['cisUmbrellaFeePostTax']; + } + + /** + * Sets cisUmbrellaFeePostTax + * + * @param float|null $cisUmbrellaFeePostTax [readonly] Value of any post-tax fee charged to the CIS Subcontractor for processing the payment + * + * @return $this + */ + public function setCisUmbrellaFeePostTax(?float $cisUmbrellaFeePostTax): static + { + if (is_null($cisUmbrellaFeePostTax)) { + throw new InvalidArgumentException('non-nullable cisUmbrellaFeePostTax cannot be null'); + } + $this->container['cisUmbrellaFeePostTax'] = $cisUmbrellaFeePostTax; + + return $this; + } + + /** + * Gets pbik + * + * @return float|null + */ + public function getPbik(): ?float + { + return $this->container['pbik']; + } + + /** + * Sets pbik + * + * @param float|null $pbik [readonly] Value of any Payrolled Benefits In Kind + * + * @return $this + */ + public function setPbik(?float $pbik): static + { + if (is_null($pbik)) { + throw new InvalidArgumentException('non-nullable pbik cannot be null'); + } + $this->container['pbik'] = $pbik; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles [readonly] The number of miles paid for Mileage Allowance Payments + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + throw new InvalidArgumentException('non-nullable mapsMiles cannot be null'); + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets foreignTaxAmount + * + * @return float|null + */ + public function getForeignTaxAmount(): ?float + { + return $this->container['foreignTaxAmount']; + } + + /** + * Sets foreignTaxAmount + * + * @param float|null $foreignTaxAmount [readonly] The amount paid for Foreign Tax Credits in this period + * + * @return $this + */ + public function setForeignTaxAmount(?float $foreignTaxAmount): static + { + if (is_null($foreignTaxAmount)) { + throw new InvalidArgumentException('non-nullable foreignTaxAmount cannot be null'); + } + $this->container['foreignTaxAmount'] = $foreignTaxAmount; + + return $this; + } + + /** + * Gets foreignTaxAmountReclaimed + * + * @return float|null + */ + public function getForeignTaxAmountReclaimed(): ?float + { + return $this->container['foreignTaxAmountReclaimed']; + } + + /** + * Sets foreignTaxAmountReclaimed + * + * @param float|null $foreignTaxAmountReclaimed [readonly] The amount of Foreign Tax Credits that you actually reclaimed + * + * @return $this + */ + public function setForeignTaxAmountReclaimed(?float $foreignTaxAmountReclaimed): static + { + if (is_null($foreignTaxAmountReclaimed)) { + throw new InvalidArgumentException('non-nullable foreignTaxAmountReclaimed cannot be null'); + } + $this->container['foreignTaxAmountReclaimed'] = $foreignTaxAmountReclaimed; + + return $this; + } + + /** + * Gets umbrellaFee + * + * @return float|null + */ + public function getUmbrellaFee(): ?float + { + return $this->container['umbrellaFee']; + } + + /** + * Sets umbrellaFee + * + * @param float|null $umbrellaFee [readonly] Value of any Umbrella fee charged for processing the payment + * + * @return $this + */ + public function setUmbrellaFee(?float $umbrellaFee): static + { + if (is_null($umbrellaFee)) { + throw new InvalidArgumentException('non-nullable umbrellaFee cannot be null'); + } + $this->container['umbrellaFee'] = $umbrellaFee; + + return $this; + } + + /** + * Gets appLevyDeduction + * + * @return float|null + */ + public function getAppLevyDeduction(): ?float + { + return $this->container['appLevyDeduction']; + } + + /** + * Sets appLevyDeduction + * + * @param float|null $appLevyDeduction [readonly] Value of any Apprenticeship Levy fee deducted for processing the umbrella payment + * + * @return $this + */ + public function setAppLevyDeduction(?float $appLevyDeduction): static + { + if (is_null($appLevyDeduction)) { + throw new InvalidArgumentException('non-nullable appLevyDeduction cannot be null'); + } + $this->container['appLevyDeduction'] = $appLevyDeduction; + + return $this; + } + + /** + * Gets paymentAfterLeaving + * + * @return float|null + */ + public function getPaymentAfterLeaving(): ?float + { + return $this->container['paymentAfterLeaving']; + } + + /** + * Sets paymentAfterLeaving + * + * @param float|null $paymentAfterLeaving [readonly] Payment After Leaving + * + * @return $this + */ + public function setPaymentAfterLeaving(?float $paymentAfterLeaving): static + { + if (is_null($paymentAfterLeaving)) { + throw new InvalidArgumentException('non-nullable paymentAfterLeaving cannot be null'); + } + $this->container['paymentAfterLeaving'] = $paymentAfterLeaving; + + return $this; + } + + /** + * Gets taxOnPaymentAfterLeaving + * + * @return float|null + */ + public function getTaxOnPaymentAfterLeaving(): ?float + { + return $this->container['taxOnPaymentAfterLeaving']; + } + + /** + * Sets taxOnPaymentAfterLeaving + * + * @param float|null $taxOnPaymentAfterLeaving [readonly] Tax On Payment After Leaving + * + * @return $this + */ + public function setTaxOnPaymentAfterLeaving(?float $taxOnPaymentAfterLeaving): static + { + if (is_null($taxOnPaymentAfterLeaving)) { + throw new InvalidArgumentException('non-nullable taxOnPaymentAfterLeaving cannot be null'); + } + $this->container['taxOnPaymentAfterLeaving'] = $taxOnPaymentAfterLeaving; + + return $this; + } + + /** + * Gets nilPaid + * + * @return int|null + */ + public function getNilPaid(): ?int + { + return $this->container['nilPaid']; + } + + /** + * Sets nilPaid + * + * @param int|null $nilPaid [readonly] The number of employees with NilPaid on the PayRun + * + * @return $this + */ + public function setNilPaid(?int $nilPaid): static + { + if (is_null($nilPaid)) { + throw new InvalidArgumentException('non-nullable nilPaid cannot be null'); + } + $this->container['nilPaid'] = $nilPaid; + + return $this; + } + + /** + * Gets leavers + * + * @return int|null + */ + public function getLeavers(): ?int + { + return $this->container['leavers']; + } + + /** + * Sets leavers + * + * @param int|null $leavers [readonly] The number of Leavers on ths PayRun + * + * @return $this + */ + public function setLeavers(?int $leavers): static + { + if (is_null($leavers)) { + throw new InvalidArgumentException('non-nullable leavers cannot be null'); + } + $this->container['leavers'] = $leavers; + + return $this; + } + + /** + * Gets starters + * + * @return int|null + */ + public function getStarters(): ?int + { + return $this->container['starters']; + } + + /** + * Sets starters + * + * @param int|null $starters [readonly] The number of Starters on this PayRun + * + * @return $this + */ + public function setStarters(?int $starters): static + { + if (is_null($starters)) { + throw new InvalidArgumentException('non-nullable starters cannot be null'); + } + $this->container['starters'] = $starters; + + return $this; + } + + /** + * Gets p45Gross + * + * @return float|null + */ + public function getP45Gross(): ?float + { + return $this->container['p45Gross']; + } + + /** + * Sets p45Gross + * + * @param float|null $p45Gross [readonly] The value P45 Gross which is held on the Employees Opening Balance + * + * @return $this + */ + public function setP45Gross(?float $p45Gross): static + { + if (is_null($p45Gross)) { + array_push($this->openAPINullablesSetToNull, 'p45Gross'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('p45Gross', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['p45Gross'] = $p45Gross; + + return $this; + } + + /** + * Gets p45Tax + * + * @return float|null + */ + public function getP45Tax(): ?float + { + return $this->container['p45Tax']; + } + + /** + * Sets p45Tax + * + * @param float|null $p45Tax [readonly] The value of P45 Tax which is held on the Employees Opening Balance + * + * @return $this + */ + public function setP45Tax(?float $p45Tax): static + { + if (is_null($p45Tax)) { + array_push($this->openAPINullablesSetToNull, 'p45Tax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('p45Tax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['p45Tax'] = $p45Tax; + + return $this; + } + + /** + * Gets totalCost + * + * @return float|null + */ + public function getTotalCost(): ?float + { + return $this->container['totalCost']; + } + + /** + * Sets totalCost + * + * @param float|null $totalCost totalCost + * + * @return $this + */ + public function setTotalCost(?float $totalCost): static + { + if (is_null($totalCost)) { + throw new InvalidArgumentException('non-nullable totalCost cannot be null'); + } + $this->container['totalCost'] = $totalCost; + + return $this; + } + + /** + * Gets recoverableAmounts + * + * @return \SynergiTech\Staffology\Model\RecoverableAmounts|null + */ + public function getRecoverableAmounts(): ?\SynergiTech\Staffology\Model\RecoverableAmounts + { + return $this->container['recoverableAmounts']; + } + + /** + * Sets recoverableAmounts + * + * @param \SynergiTech\Staffology\Model\RecoverableAmounts|null $recoverableAmounts recoverableAmounts + * + * @return $this + */ + public function setRecoverableAmounts(?\SynergiTech\Staffology\Model\RecoverableAmounts $recoverableAmounts): static + { + if (is_null($recoverableAmounts)) { + throw new InvalidArgumentException('non-nullable recoverableAmounts cannot be null'); + } + $this->container['recoverableAmounts'] = $recoverableAmounts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySchedule.php b/src/Model/PaySchedule.php new file mode 100644 index 0000000..9eed1b4 --- /dev/null +++ b/src/Model/PaySchedule.php @@ -0,0 +1,1247 @@ + + */ +class PaySchedule implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'ordinal' => 'int', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'firstPeriodEndDate' => '\DateTime', + 'firstPaymentDate' => '\DateTime', + 'paymentDateType' => '\SynergiTech\Staffology\Model\PaymentDateType', + 'periodEndDateType' => '\SynergiTech\Staffology\Model\PaymentDateType', + 'periodLengths' => 'int[]', + 'highGrossPay' => 'float', + 'highNetPay' => 'float', + 'periodEventsConfig' => '\SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig', + 'hasOpenPayRunPeriod' => 'bool', + 'lastPeriodEndDate' => '\DateTime', + 'lastPeriodNumber' => 'int', + 'employeeCount' => 'int', + 'isRequired' => 'bool', + 'isConfigured' => 'bool', + 'isYearCompleted' => 'bool', + 'yearEndTasks' => 'string[]', + 'payRuns' => '\SynergiTech\Staffology\Model\Item[]', + 'currentPayRun' => '\SynergiTech\Staffology\Model\Item', + 'nextPayRun' => '\SynergiTech\Staffology\Model\PayRun', + 'publicCreatedDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'ordinal' => 'int32', + 'taxYear' => null, + 'payPeriod' => null, + 'firstPeriodEndDate' => 'date', + 'firstPaymentDate' => 'date', + 'paymentDateType' => null, + 'periodEndDateType' => null, + 'periodLengths' => 'int32', + 'highGrossPay' => 'double', + 'highNetPay' => 'double', + 'periodEventsConfig' => null, + 'hasOpenPayRunPeriod' => null, + 'lastPeriodEndDate' => 'date', + 'lastPeriodNumber' => 'int32', + 'employeeCount' => 'int32', + 'isRequired' => null, + 'isConfigured' => null, + 'isYearCompleted' => null, + 'yearEndTasks' => null, + 'payRuns' => null, + 'currentPayRun' => null, + 'nextPayRun' => null, + 'publicCreatedDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'ordinal' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'firstPeriodEndDate' => false, + 'firstPaymentDate' => false, + 'paymentDateType' => false, + 'periodEndDateType' => false, + 'periodLengths' => true, + 'highGrossPay' => false, + 'highNetPay' => false, + 'periodEventsConfig' => true, + 'hasOpenPayRunPeriod' => false, + 'lastPeriodEndDate' => true, + 'lastPeriodNumber' => true, + 'employeeCount' => false, + 'isRequired' => false, + 'isConfigured' => false, + 'isYearCompleted' => false, + 'yearEndTasks' => true, + 'payRuns' => true, + 'currentPayRun' => false, + 'nextPayRun' => false, + 'publicCreatedDate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'ordinal' => 'ordinal', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'firstPeriodEndDate' => 'firstPeriodEndDate', + 'firstPaymentDate' => 'firstPaymentDate', + 'paymentDateType' => 'paymentDateType', + 'periodEndDateType' => 'periodEndDateType', + 'periodLengths' => 'periodLengths', + 'highGrossPay' => 'highGrossPay', + 'highNetPay' => 'highNetPay', + 'periodEventsConfig' => 'periodEventsConfig', + 'hasOpenPayRunPeriod' => 'hasOpenPayRunPeriod', + 'lastPeriodEndDate' => 'lastPeriodEndDate', + 'lastPeriodNumber' => 'lastPeriodNumber', + 'employeeCount' => 'employeeCount', + 'isRequired' => 'isRequired', + 'isConfigured' => 'isConfigured', + 'isYearCompleted' => 'isYearCompleted', + 'yearEndTasks' => 'yearEndTasks', + 'payRuns' => 'payRuns', + 'currentPayRun' => 'currentPayRun', + 'nextPayRun' => 'nextPayRun', + 'publicCreatedDate' => 'publicCreatedDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'ordinal' => 'setOrdinal', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'firstPeriodEndDate' => 'setFirstPeriodEndDate', + 'firstPaymentDate' => 'setFirstPaymentDate', + 'paymentDateType' => 'setPaymentDateType', + 'periodEndDateType' => 'setPeriodEndDateType', + 'periodLengths' => 'setPeriodLengths', + 'highGrossPay' => 'setHighGrossPay', + 'highNetPay' => 'setHighNetPay', + 'periodEventsConfig' => 'setPeriodEventsConfig', + 'hasOpenPayRunPeriod' => 'setHasOpenPayRunPeriod', + 'lastPeriodEndDate' => 'setLastPeriodEndDate', + 'lastPeriodNumber' => 'setLastPeriodNumber', + 'employeeCount' => 'setEmployeeCount', + 'isRequired' => 'setIsRequired', + 'isConfigured' => 'setIsConfigured', + 'isYearCompleted' => 'setIsYearCompleted', + 'yearEndTasks' => 'setYearEndTasks', + 'payRuns' => 'setPayRuns', + 'currentPayRun' => 'setCurrentPayRun', + 'nextPayRun' => 'setNextPayRun', + 'publicCreatedDate' => 'setPublicCreatedDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'ordinal' => 'getOrdinal', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'firstPeriodEndDate' => 'getFirstPeriodEndDate', + 'firstPaymentDate' => 'getFirstPaymentDate', + 'paymentDateType' => 'getPaymentDateType', + 'periodEndDateType' => 'getPeriodEndDateType', + 'periodLengths' => 'getPeriodLengths', + 'highGrossPay' => 'getHighGrossPay', + 'highNetPay' => 'getHighNetPay', + 'periodEventsConfig' => 'getPeriodEventsConfig', + 'hasOpenPayRunPeriod' => 'getHasOpenPayRunPeriod', + 'lastPeriodEndDate' => 'getLastPeriodEndDate', + 'lastPeriodNumber' => 'getLastPeriodNumber', + 'employeeCount' => 'getEmployeeCount', + 'isRequired' => 'getIsRequired', + 'isConfigured' => 'getIsConfigured', + 'isYearCompleted' => 'getIsYearCompleted', + 'yearEndTasks' => 'getYearEndTasks', + 'payRuns' => 'getPayRuns', + 'currentPayRun' => 'getCurrentPayRun', + 'nextPayRun' => 'getNextPayRun', + 'publicCreatedDate' => 'getPublicCreatedDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('firstPeriodEndDate', $data ?? [], null); + $this->setIfExists('firstPaymentDate', $data ?? [], null); + $this->setIfExists('paymentDateType', $data ?? [], null); + $this->setIfExists('periodEndDateType', $data ?? [], null); + $this->setIfExists('periodLengths', $data ?? [], null); + $this->setIfExists('highGrossPay', $data ?? [], null); + $this->setIfExists('highNetPay', $data ?? [], null); + $this->setIfExists('periodEventsConfig', $data ?? [], null); + $this->setIfExists('hasOpenPayRunPeriod', $data ?? [], null); + $this->setIfExists('lastPeriodEndDate', $data ?? [], null); + $this->setIfExists('lastPeriodNumber', $data ?? [], null); + $this->setIfExists('employeeCount', $data ?? [], null); + $this->setIfExists('isRequired', $data ?? [], null); + $this->setIfExists('isConfigured', $data ?? [], null); + $this->setIfExists('isYearCompleted', $data ?? [], null); + $this->setIfExists('yearEndTasks', $data ?? [], null); + $this->setIfExists('payRuns', $data ?? [], null); + $this->setIfExists('currentPayRun', $data ?? [], null); + $this->setIfExists('nextPayRun', $data ?? [], null); + $this->setIfExists('publicCreatedDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A descriptive name for this PaySchedule + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($name) && (mb_strlen($name) > 100)) { + throw new InvalidArgumentException('invalid length for $name when calling PaySchedule., must be smaller than or equal to 100.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal [readonly] Indicates whether this is first, second, third (etc) PaySchedule for this PayPeriod. + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets firstPeriodEndDate + * + * @return \DateTime|null + */ + public function getFirstPeriodEndDate(): ?\DateTime + { + return $this->container['firstPeriodEndDate']; + } + + /** + * Sets firstPeriodEndDate + * + * @param \DateTime|null $firstPeriodEndDate The last day of the first pay period + * + * @return $this + */ + public function setFirstPeriodEndDate(?\DateTime $firstPeriodEndDate): static + { + if (is_null($firstPeriodEndDate)) { + throw new InvalidArgumentException('non-nullable firstPeriodEndDate cannot be null'); + } + $this->container['firstPeriodEndDate'] = $firstPeriodEndDate; + + return $this; + } + + /** + * Gets firstPaymentDate + * + * @return \DateTime|null + */ + public function getFirstPaymentDate(): ?\DateTime + { + return $this->container['firstPaymentDate']; + } + + /** + * Sets firstPaymentDate + * + * @param \DateTime|null $firstPaymentDate The first payment date + * + * @return $this + */ + public function setFirstPaymentDate(?\DateTime $firstPaymentDate): static + { + if (is_null($firstPaymentDate)) { + throw new InvalidArgumentException('non-nullable firstPaymentDate cannot be null'); + } + $this->container['firstPaymentDate'] = $firstPaymentDate; + + return $this; + } + + /** + * Gets paymentDateType + * + * @return \SynergiTech\Staffology\Model\PaymentDateType|null + */ + public function getPaymentDateType(): ?\SynergiTech\Staffology\Model\PaymentDateType + { + return $this->container['paymentDateType']; + } + + /** + * Sets paymentDateType + * + * @param \SynergiTech\Staffology\Model\PaymentDateType|null $paymentDateType paymentDateType + * + * @return $this + */ + public function setPaymentDateType(?\SynergiTech\Staffology\Model\PaymentDateType $paymentDateType): static + { + if (is_null($paymentDateType)) { + throw new InvalidArgumentException('non-nullable paymentDateType cannot be null'); + } + $this->container['paymentDateType'] = $paymentDateType; + + return $this; + } + + /** + * Gets periodEndDateType + * + * @return \SynergiTech\Staffology\Model\PaymentDateType|null + */ + public function getPeriodEndDateType(): ?\SynergiTech\Staffology\Model\PaymentDateType + { + return $this->container['periodEndDateType']; + } + + /** + * Sets periodEndDateType + * + * @param \SynergiTech\Staffology\Model\PaymentDateType|null $periodEndDateType periodEndDateType + * + * @return $this + */ + public function setPeriodEndDateType(?\SynergiTech\Staffology\Model\PaymentDateType $periodEndDateType): static + { + if (is_null($periodEndDateType)) { + throw new InvalidArgumentException('non-nullable periodEndDateType cannot be null'); + } + $this->container['periodEndDateType'] = $periodEndDateType; + + return $this; + } + + /** + * Gets periodLengths + * + * @return int[]|null + */ + public function getPeriodLengths(): ?array + { + return $this->container['periodLengths']; + } + + /** + * Sets periodLengths + * + * @param int[]|null $periodLengths Only applicable for PayPeriod of Custom. Defines the length of each period + * + * @return $this + */ + public function setPeriodLengths(?array $periodLengths): static + { + if (is_null($periodLengths)) { + array_push($this->openAPINullablesSetToNull, 'periodLengths'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodLengths', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodLengths'] = $periodLengths; + + return $this; + } + + /** + * Gets highGrossPay + * + * @return float|null + */ + public function getHighGrossPay(): ?float + { + return $this->container['highGrossPay']; + } + + /** + * Sets highGrossPay + * + * @param float|null $highGrossPay A gross pay amount considered high for this PaySchedule + * + * @return $this + */ + public function setHighGrossPay(?float $highGrossPay): static + { + if (is_null($highGrossPay)) { + throw new InvalidArgumentException('non-nullable highGrossPay cannot be null'); + } + $this->container['highGrossPay'] = $highGrossPay; + + return $this; + } + + /** + * Gets highNetPay + * + * @return float|null + */ + public function getHighNetPay(): ?float + { + return $this->container['highNetPay']; + } + + /** + * Sets highNetPay + * + * @param float|null $highNetPay A net pay amount considered high for this PaySchedule + * + * @return $this + */ + public function setHighNetPay(?float $highNetPay): static + { + if (is_null($highNetPay)) { + throw new InvalidArgumentException('non-nullable highNetPay cannot be null'); + } + $this->container['highNetPay'] = $highNetPay; + + return $this; + } + + /** + * Gets periodEventsConfig + * + * @return \SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig|null + */ + public function getPeriodEventsConfig(): ?\SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig + { + return $this->container['periodEventsConfig']; + } + + /** + * Sets periodEventsConfig + * + * @param \SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig|null $periodEventsConfig periodEventsConfig + * + * @return $this + */ + public function setPeriodEventsConfig(?\SynergiTech\Staffology\Model\PaySchedulePeriodEventsConfig $periodEventsConfig): static + { + if (is_null($periodEventsConfig)) { + array_push($this->openAPINullablesSetToNull, 'periodEventsConfig'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodEventsConfig', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodEventsConfig'] = $periodEventsConfig; + + return $this; + } + + /** + * Gets hasOpenPayRunPeriod + * + * @return bool|null + */ + public function getHasOpenPayRunPeriod(): ?bool + { + return $this->container['hasOpenPayRunPeriod']; + } + + /** + * Sets hasOpenPayRunPeriod + * + * @param bool|null $hasOpenPayRunPeriod [readonly] Will be true if the employer currently has an open PayRun for this PayPeriod + * + * @return $this + */ + public function setHasOpenPayRunPeriod(?bool $hasOpenPayRunPeriod): static + { + if (is_null($hasOpenPayRunPeriod)) { + throw new InvalidArgumentException('non-nullable hasOpenPayRunPeriod cannot be null'); + } + $this->container['hasOpenPayRunPeriod'] = $hasOpenPayRunPeriod; + + return $this; + } + + /** + * Gets lastPeriodEndDate + * + * @return \DateTime|null + */ + public function getLastPeriodEndDate(): ?\DateTime + { + return $this->container['lastPeriodEndDate']; + } + + /** + * Sets lastPeriodEndDate + * + * @param \DateTime|null $lastPeriodEndDate [readonly] The end date of the most recent PayRun on this schedule + * + * @return $this + */ + public function setLastPeriodEndDate(?\DateTime $lastPeriodEndDate): static + { + if (is_null($lastPeriodEndDate)) { + array_push($this->openAPINullablesSetToNull, 'lastPeriodEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastPeriodEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastPeriodEndDate'] = $lastPeriodEndDate; + + return $this; + } + + /** + * Gets lastPeriodNumber + * + * @return int|null + */ + public function getLastPeriodNumber(): ?int + { + return $this->container['lastPeriodNumber']; + } + + /** + * Sets lastPeriodNumber + * + * @param int|null $lastPeriodNumber [readonly] The period number of the most recent PayRun on this schedule + * + * @return $this + */ + public function setLastPeriodNumber(?int $lastPeriodNumber): static + { + if (is_null($lastPeriodNumber)) { + array_push($this->openAPINullablesSetToNull, 'lastPeriodNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastPeriodNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastPeriodNumber'] = $lastPeriodNumber; + + return $this; + } + + /** + * Gets employeeCount + * + * @return int|null + */ + public function getEmployeeCount(): ?int + { + return $this->container['employeeCount']; + } + + /** + * Sets employeeCount + * + * @param int|null $employeeCount [readonly] The number of employees paid with this PaySchedule + * + * @return $this + */ + public function setEmployeeCount(?int $employeeCount): static + { + if (is_null($employeeCount)) { + throw new InvalidArgumentException('non-nullable employeeCount cannot be null'); + } + $this->container['employeeCount'] = $employeeCount; + + return $this; + } + + /** + * Gets isRequired + * + * @return bool|null + */ + public function getIsRequired(): ?bool + { + return $this->container['isRequired']; + } + + /** + * Sets isRequired + * + * @param bool|null $isRequired [readonly] Whether or not this PaySchedule is required for the employer, ie: they have employees to be paid on this PaySchedule + * + * @return $this + */ + public function setIsRequired(?bool $isRequired): static + { + if (is_null($isRequired)) { + throw new InvalidArgumentException('non-nullable isRequired cannot be null'); + } + $this->container['isRequired'] = $isRequired; + + return $this; + } + + /** + * Gets isConfigured + * + * @return bool|null + */ + public function getIsConfigured(): ?bool + { + return $this->container['isConfigured']; + } + + /** + * Sets isConfigured + * + * @param bool|null $isConfigured [readonly] Whether or not this PaySchedule has been configured and is ready for use + * + * @return $this + */ + public function setIsConfigured(?bool $isConfigured): static + { + if (is_null($isConfigured)) { + throw new InvalidArgumentException('non-nullable isConfigured cannot be null'); + } + $this->container['isConfigured'] = $isConfigured; + + return $this; + } + + /** + * Gets isYearCompleted + * + * @return bool|null + */ + public function getIsYearCompleted(): ?bool + { + return $this->container['isYearCompleted']; + } + + /** + * Sets isYearCompleted + * + * @param bool|null $isYearCompleted [readonly] Returns true if all PayRuns for this PaySchedule in the TaxYear have been completed + * + * @return $this + */ + public function setIsYearCompleted(?bool $isYearCompleted): static + { + if (is_null($isYearCompleted)) { + throw new InvalidArgumentException('non-nullable isYearCompleted cannot be null'); + } + $this->container['isYearCompleted'] = $isYearCompleted; + + return $this; + } + + /** + * Gets yearEndTasks + * + * @return string[]|null + */ + public function getYearEndTasks(): ?array + { + return $this->container['yearEndTasks']; + } + + /** + * Sets yearEndTasks + * + * @param string[]|null $yearEndTasks [readonly] A list of actions that need to be completed for this PaySchedule before this TaxYear can be finalised + * + * @return $this + */ + public function setYearEndTasks(?array $yearEndTasks): static + { + if (is_null($yearEndTasks)) { + array_push($this->openAPINullablesSetToNull, 'yearEndTasks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('yearEndTasks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['yearEndTasks'] = $yearEndTasks; + + return $this; + } + + /** + * Gets payRuns + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getPayRuns(): ?array + { + return $this->container['payRuns']; + } + + /** + * Sets payRuns + * + * @param \SynergiTech\Staffology\Model\Item[]|null $payRuns [readonly] Details of PayRuns for this PaySchedule + * + * @return $this + */ + public function setPayRuns(?array $payRuns): static + { + if (is_null($payRuns)) { + array_push($this->openAPINullablesSetToNull, 'payRuns'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payRuns', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payRuns'] = $payRuns; + + return $this; + } + + /** + * Gets currentPayRun + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getCurrentPayRun(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['currentPayRun']; + } + + /** + * Sets currentPayRun + * + * @param \SynergiTech\Staffology\Model\Item|null $currentPayRun currentPayRun + * + * @return $this + */ + public function setCurrentPayRun(?\SynergiTech\Staffology\Model\Item $currentPayRun): static + { + if (is_null($currentPayRun)) { + throw new InvalidArgumentException('non-nullable currentPayRun cannot be null'); + } + $this->container['currentPayRun'] = $currentPayRun; + + return $this; + } + + /** + * Gets nextPayRun + * + * @return \SynergiTech\Staffology\Model\PayRun|null + */ + public function getNextPayRun(): ?\SynergiTech\Staffology\Model\PayRun + { + return $this->container['nextPayRun']; + } + + /** + * Sets nextPayRun + * + * @param \SynergiTech\Staffology\Model\PayRun|null $nextPayRun nextPayRun + * + * @return $this + */ + public function setNextPayRun(?\SynergiTech\Staffology\Model\PayRun $nextPayRun): static + { + if (is_null($nextPayRun)) { + throw new InvalidArgumentException('non-nullable nextPayRun cannot be null'); + } + $this->container['nextPayRun'] = $nextPayRun; + + return $this; + } + + /** + * Gets publicCreatedDate + * + * @return \DateTime|null + */ + public function getPublicCreatedDate(): ?\DateTime + { + return $this->container['publicCreatedDate']; + } + + /** + * Sets publicCreatedDate + * + * @param \DateTime|null $publicCreatedDate publicCreatedDate + * + * @return $this + */ + public function setPublicCreatedDate(?\DateTime $publicCreatedDate): static + { + if (is_null($publicCreatedDate)) { + throw new InvalidArgumentException('non-nullable publicCreatedDate cannot be null'); + } + $this->container['publicCreatedDate'] = $publicCreatedDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySchedulePeriod.php b/src/Model/PaySchedulePeriod.php new file mode 100644 index 0000000..cd3f0b1 --- /dev/null +++ b/src/Model/PaySchedulePeriod.php @@ -0,0 +1,619 @@ + + */ +class PaySchedulePeriod implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySchedulePeriod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'paySchedulePeriodEvents' => '\SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]', + 'period' => 'int', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'paymentDate' => '\DateTime', + 'unadjustedPaymentDate' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'paySchedulePeriodEvents' => null, + 'period' => 'int32', + 'startDate' => 'date', + 'endDate' => 'date', + 'paymentDate' => 'date', + 'unadjustedPaymentDate' => 'date', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'paySchedulePeriodEvents' => true, + 'period' => false, + 'startDate' => false, + 'endDate' => false, + 'paymentDate' => false, + 'unadjustedPaymentDate' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'paySchedulePeriodEvents' => 'paySchedulePeriodEvents', + 'period' => 'period', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'paymentDate' => 'paymentDate', + 'unadjustedPaymentDate' => 'unadjustedPaymentDate', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'paySchedulePeriodEvents' => 'setPaySchedulePeriodEvents', + 'period' => 'setPeriod', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'paymentDate' => 'setPaymentDate', + 'unadjustedPaymentDate' => 'setUnadjustedPaymentDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'paySchedulePeriodEvents' => 'getPaySchedulePeriodEvents', + 'period' => 'getPeriod', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'paymentDate' => 'getPaymentDate', + 'unadjustedPaymentDate' => 'getUnadjustedPaymentDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('paySchedulePeriodEvents', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('unadjustedPaymentDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets paySchedulePeriodEvents + * + * @return \SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]|null + */ + public function getPaySchedulePeriodEvents(): ?array + { + return $this->container['paySchedulePeriodEvents']; + } + + /** + * Sets paySchedulePeriodEvents + * + * @param \SynergiTech\Staffology\Model\PaySchedulePeriodEvent[]|null $paySchedulePeriodEvents [readonly] List of all the events in this PaySchedulePeriod + * + * @return $this + */ + public function setPaySchedulePeriodEvents(?array $paySchedulePeriodEvents): static + { + if (is_null($paySchedulePeriodEvents)) { + array_push($this->openAPINullablesSetToNull, 'paySchedulePeriodEvents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paySchedulePeriodEvents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paySchedulePeriodEvents'] = $paySchedulePeriodEvents; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period [readonly] The Period number of the PaySchedulePeriod. + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate [readonly] The start date of the PaySchedulePeriod + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate [readonly] The end date of the PaySchedulePeriod + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate The payment date of the PaySchedulePeriod. + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets unadjustedPaymentDate + * + * @return \DateTime|null + */ + public function getUnadjustedPaymentDate(): ?\DateTime + { + return $this->container['unadjustedPaymentDate']; + } + + /** + * Sets unadjustedPaymentDate + * + * @param \DateTime|null $unadjustedPaymentDate The payment date of the PaySchedulePeriod when not accounting for weekends, bank hols or ad-hoc alterations to the pay schedule + * + * @return $this + */ + public function setUnadjustedPaymentDate(?\DateTime $unadjustedPaymentDate): static + { + if (is_null($unadjustedPaymentDate)) { + throw new InvalidArgumentException('non-nullable unadjustedPaymentDate cannot be null'); + } + $this->container['unadjustedPaymentDate'] = $unadjustedPaymentDate; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySchedulePeriodEvent.php b/src/Model/PaySchedulePeriodEvent.php new file mode 100644 index 0000000..ec54123 --- /dev/null +++ b/src/Model/PaySchedulePeriodEvent.php @@ -0,0 +1,552 @@ + + */ +class PaySchedulePeriodEvent implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySchedulePeriodEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payPeriodEventType' => '\SynergiTech\Staffology\Model\PayPeriodEventType', + 'eventDate' => '\DateTime', + 'actualEventDate' => '\DateTime', + 'isOverDue' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payPeriodEventType' => null, + 'eventDate' => 'date', + 'actualEventDate' => 'date', + 'isOverDue' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payPeriodEventType' => false, + 'eventDate' => false, + 'actualEventDate' => true, + 'isOverDue' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payPeriodEventType' => 'payPeriodEventType', + 'eventDate' => 'eventDate', + 'actualEventDate' => 'actualEventDate', + 'isOverDue' => 'isOverDue', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payPeriodEventType' => 'setPayPeriodEventType', + 'eventDate' => 'setEventDate', + 'actualEventDate' => 'setActualEventDate', + 'isOverDue' => 'setIsOverDue', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payPeriodEventType' => 'getPayPeriodEventType', + 'eventDate' => 'getEventDate', + 'actualEventDate' => 'getActualEventDate', + 'isOverDue' => 'getIsOverDue', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payPeriodEventType', $data ?? [], null); + $this->setIfExists('eventDate', $data ?? [], null); + $this->setIfExists('actualEventDate', $data ?? [], null); + $this->setIfExists('isOverDue', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payPeriodEventType + * + * @return \SynergiTech\Staffology\Model\PayPeriodEventType|null + */ + public function getPayPeriodEventType(): ?\SynergiTech\Staffology\Model\PayPeriodEventType + { + return $this->container['payPeriodEventType']; + } + + /** + * Sets payPeriodEventType + * + * @param \SynergiTech\Staffology\Model\PayPeriodEventType|null $payPeriodEventType payPeriodEventType + * + * @return $this + */ + public function setPayPeriodEventType(?\SynergiTech\Staffology\Model\PayPeriodEventType $payPeriodEventType): static + { + if (is_null($payPeriodEventType)) { + throw new InvalidArgumentException('non-nullable payPeriodEventType cannot be null'); + } + $this->container['payPeriodEventType'] = $payPeriodEventType; + + return $this; + } + + /** + * Gets eventDate + * + * @return \DateTime|null + */ + public function getEventDate(): ?\DateTime + { + return $this->container['eventDate']; + } + + /** + * Sets eventDate + * + * @param \DateTime|null $eventDate The expected date and time of the event. + * + * @return $this + */ + public function setEventDate(?\DateTime $eventDate): static + { + if (is_null($eventDate)) { + throw new InvalidArgumentException('non-nullable eventDate cannot be null'); + } + $this->container['eventDate'] = $eventDate; + + return $this; + } + + /** + * Gets actualEventDate + * + * @return \DateTime|null + */ + public function getActualEventDate(): ?\DateTime + { + return $this->container['actualEventDate']; + } + + /** + * Sets actualEventDate + * + * @param \DateTime|null $actualEventDate The actual date and time when the event was completed. + * + * @return $this + */ + public function setActualEventDate(?\DateTime $actualEventDate): static + { + if (is_null($actualEventDate)) { + array_push($this->openAPINullablesSetToNull, 'actualEventDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actualEventDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actualEventDate'] = $actualEventDate; + + return $this; + } + + /** + * Gets isOverDue + * + * @return bool|null + */ + public function getIsOverDue(): ?bool + { + return $this->container['isOverDue']; + } + + /** + * Sets isOverDue + * + * @param bool|null $isOverDue Returns true if its past the event date. + * + * @return $this + */ + public function setIsOverDue(?bool $isOverDue): static + { + if (is_null($isOverDue)) { + throw new InvalidArgumentException('non-nullable isOverDue cannot be null'); + } + $this->container['isOverDue'] = $isOverDue; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySchedulePeriodEventsConfig.php b/src/Model/PaySchedulePeriodEventsConfig.php new file mode 100644 index 0000000..3ef24fe --- /dev/null +++ b/src/Model/PaySchedulePeriodEventsConfig.php @@ -0,0 +1,579 @@ + + */ +class PaySchedulePeriodEventsConfig implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySchedule_periodEventsConfig'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'submitForProcessing' => 'int', + 'sendForApproval' => 'int', + 'approval' => 'int', + 'finalise' => 'int', + 'sendPaySlip' => 'int', + 'submitRti' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'submitForProcessing' => 'int32', + 'sendForApproval' => 'int32', + 'approval' => 'int32', + 'finalise' => 'int32', + 'sendPaySlip' => 'int32', + 'submitRti' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'submitForProcessing' => false, + 'sendForApproval' => false, + 'approval' => false, + 'finalise' => false, + 'sendPaySlip' => false, + 'submitRti' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'submitForProcessing' => 'SubmitForProcessing', + 'sendForApproval' => 'SendForApproval', + 'approval' => 'Approval', + 'finalise' => 'Finalise', + 'sendPaySlip' => 'SendPaySlip', + 'submitRti' => 'SubmitRti' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'submitForProcessing' => 'setSubmitForProcessing', + 'sendForApproval' => 'setSendForApproval', + 'approval' => 'setApproval', + 'finalise' => 'setFinalise', + 'sendPaySlip' => 'setSendPaySlip', + 'submitRti' => 'setSubmitRti' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'submitForProcessing' => 'getSubmitForProcessing', + 'sendForApproval' => 'getSendForApproval', + 'approval' => 'getApproval', + 'finalise' => 'getFinalise', + 'sendPaySlip' => 'getSendPaySlip', + 'submitRti' => 'getSubmitRti' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('submitForProcessing', $data ?? [], null); + $this->setIfExists('sendForApproval', $data ?? [], null); + $this->setIfExists('approval', $data ?? [], null); + $this->setIfExists('finalise', $data ?? [], null); + $this->setIfExists('sendPaySlip', $data ?? [], null); + $this->setIfExists('submitRti', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets submitForProcessing + * + * @return int|null + */ + public function getSubmitForProcessing(): ?int + { + return $this->container['submitForProcessing']; + } + + /** + * Sets submitForProcessing + * + * @param int|null $submitForProcessing submitForProcessing + * + * @return $this + */ + public function setSubmitForProcessing(?int $submitForProcessing): static + { + if (is_null($submitForProcessing)) { + throw new InvalidArgumentException('non-nullable submitForProcessing cannot be null'); + } + $this->container['submitForProcessing'] = $submitForProcessing; + + return $this; + } + + /** + * Gets sendForApproval + * + * @return int|null + */ + public function getSendForApproval(): ?int + { + return $this->container['sendForApproval']; + } + + /** + * Sets sendForApproval + * + * @param int|null $sendForApproval sendForApproval + * + * @return $this + */ + public function setSendForApproval(?int $sendForApproval): static + { + if (is_null($sendForApproval)) { + throw new InvalidArgumentException('non-nullable sendForApproval cannot be null'); + } + $this->container['sendForApproval'] = $sendForApproval; + + return $this; + } + + /** + * Gets approval + * + * @return int|null + */ + public function getApproval(): ?int + { + return $this->container['approval']; + } + + /** + * Sets approval + * + * @param int|null $approval approval + * + * @return $this + */ + public function setApproval(?int $approval): static + { + if (is_null($approval)) { + throw new InvalidArgumentException('non-nullable approval cannot be null'); + } + $this->container['approval'] = $approval; + + return $this; + } + + /** + * Gets finalise + * + * @return int|null + */ + public function getFinalise(): ?int + { + return $this->container['finalise']; + } + + /** + * Sets finalise + * + * @param int|null $finalise finalise + * + * @return $this + */ + public function setFinalise(?int $finalise): static + { + if (is_null($finalise)) { + throw new InvalidArgumentException('non-nullable finalise cannot be null'); + } + $this->container['finalise'] = $finalise; + + return $this; + } + + /** + * Gets sendPaySlip + * + * @return int|null + */ + public function getSendPaySlip(): ?int + { + return $this->container['sendPaySlip']; + } + + /** + * Sets sendPaySlip + * + * @param int|null $sendPaySlip sendPaySlip + * + * @return $this + */ + public function setSendPaySlip(?int $sendPaySlip): static + { + if (is_null($sendPaySlip)) { + throw new InvalidArgumentException('non-nullable sendPaySlip cannot be null'); + } + $this->container['sendPaySlip'] = $sendPaySlip; + + return $this; + } + + /** + * Gets submitRti + * + * @return int|null + */ + public function getSubmitRti(): ?int + { + return $this->container['submitRti']; + } + + /** + * Sets submitRti + * + * @param int|null $submitRti submitRti + * + * @return $this + */ + public function setSubmitRti(?int $submitRti): static + { + if (is_null($submitRti)) { + throw new InvalidArgumentException('non-nullable submitRti cannot be null'); + } + $this->container['submitRti'] = $submitRti; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySpineReport.php b/src/Model/PaySpineReport.php new file mode 100644 index 0000000..96a1d7a --- /dev/null +++ b/src/Model/PaySpineReport.php @@ -0,0 +1,558 @@ + + */ +class PaySpineReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySpineReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PaySpineReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PaySpineReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PaySpineReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySpineReportLine.php b/src/Model/PaySpineReportLine.php new file mode 100644 index 0000000..3225c39 --- /dev/null +++ b/src/Model/PaySpineReportLine.php @@ -0,0 +1,980 @@ + + */ +class PaySpineReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySpineReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'spineName' => 'string', + 'fullTimeHours' => 'float', + 'fullTimeWeeks' => 'float', + 'salaryFormula' => 'string', + 'hourlyDivisor' => 'float', + 'hourlyDecimals' => 'int', + 'dailyDivisor' => 'float', + 'dailyDecimals' => 'int', + 'annualDecimals' => 'int', + 'annualRoundingRule' => '\SynergiTech\Staffology\Model\AnnualRoundingRule', + 'incrementRule' => '\SynergiTech\Staffology\Model\IncrementRule', + 'requiresLondonAllowance' => 'bool', + 'gradeEffectiveDate' => '\DateTime', + 'pointEffectiveDate' => '\DateTime', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'spineName' => null, + 'fullTimeHours' => 'double', + 'fullTimeWeeks' => 'double', + 'salaryFormula' => null, + 'hourlyDivisor' => 'double', + 'hourlyDecimals' => 'int32', + 'dailyDivisor' => 'double', + 'dailyDecimals' => 'int32', + 'annualDecimals' => 'int32', + 'annualRoundingRule' => null, + 'incrementRule' => null, + 'requiresLondonAllowance' => null, + 'gradeEffectiveDate' => 'date', + 'pointEffectiveDate' => 'date', + 'employee' => null, + 'payrollCode' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'spineName' => true, + 'fullTimeHours' => false, + 'fullTimeWeeks' => false, + 'salaryFormula' => true, + 'hourlyDivisor' => false, + 'hourlyDecimals' => false, + 'dailyDivisor' => false, + 'dailyDecimals' => false, + 'annualDecimals' => false, + 'annualRoundingRule' => false, + 'incrementRule' => false, + 'requiresLondonAllowance' => false, + 'gradeEffectiveDate' => false, + 'pointEffectiveDate' => false, + 'employee' => false, + 'payrollCode' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'spineName' => 'spineName', + 'fullTimeHours' => 'fullTimeHours', + 'fullTimeWeeks' => 'fullTimeWeeks', + 'salaryFormula' => 'salaryFormula', + 'hourlyDivisor' => 'hourlyDivisor', + 'hourlyDecimals' => 'hourlyDecimals', + 'dailyDivisor' => 'dailyDivisor', + 'dailyDecimals' => 'dailyDecimals', + 'annualDecimals' => 'annualDecimals', + 'annualRoundingRule' => 'annualRoundingRule', + 'incrementRule' => 'incrementRule', + 'requiresLondonAllowance' => 'requiresLondonAllowance', + 'gradeEffectiveDate' => 'gradeEffectiveDate', + 'pointEffectiveDate' => 'pointEffectiveDate', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'spineName' => 'setSpineName', + 'fullTimeHours' => 'setFullTimeHours', + 'fullTimeWeeks' => 'setFullTimeWeeks', + 'salaryFormula' => 'setSalaryFormula', + 'hourlyDivisor' => 'setHourlyDivisor', + 'hourlyDecimals' => 'setHourlyDecimals', + 'dailyDivisor' => 'setDailyDivisor', + 'dailyDecimals' => 'setDailyDecimals', + 'annualDecimals' => 'setAnnualDecimals', + 'annualRoundingRule' => 'setAnnualRoundingRule', + 'incrementRule' => 'setIncrementRule', + 'requiresLondonAllowance' => 'setRequiresLondonAllowance', + 'gradeEffectiveDate' => 'setGradeEffectiveDate', + 'pointEffectiveDate' => 'setPointEffectiveDate', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'spineName' => 'getSpineName', + 'fullTimeHours' => 'getFullTimeHours', + 'fullTimeWeeks' => 'getFullTimeWeeks', + 'salaryFormula' => 'getSalaryFormula', + 'hourlyDivisor' => 'getHourlyDivisor', + 'hourlyDecimals' => 'getHourlyDecimals', + 'dailyDivisor' => 'getDailyDivisor', + 'dailyDecimals' => 'getDailyDecimals', + 'annualDecimals' => 'getAnnualDecimals', + 'annualRoundingRule' => 'getAnnualRoundingRule', + 'incrementRule' => 'getIncrementRule', + 'requiresLondonAllowance' => 'getRequiresLondonAllowance', + 'gradeEffectiveDate' => 'getGradeEffectiveDate', + 'pointEffectiveDate' => 'getPointEffectiveDate', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('spineName', $data ?? [], null); + $this->setIfExists('fullTimeHours', $data ?? [], null); + $this->setIfExists('fullTimeWeeks', $data ?? [], null); + $this->setIfExists('salaryFormula', $data ?? [], null); + $this->setIfExists('hourlyDivisor', $data ?? [], null); + $this->setIfExists('hourlyDecimals', $data ?? [], null); + $this->setIfExists('dailyDivisor', $data ?? [], null); + $this->setIfExists('dailyDecimals', $data ?? [], null); + $this->setIfExists('annualDecimals', $data ?? [], null); + $this->setIfExists('annualRoundingRule', $data ?? [], null); + $this->setIfExists('incrementRule', $data ?? [], null); + $this->setIfExists('requiresLondonAllowance', $data ?? [], null); + $this->setIfExists('gradeEffectiveDate', $data ?? [], null); + $this->setIfExists('pointEffectiveDate', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spineName + * + * @return string|null + */ + public function getSpineName(): ?string + { + return $this->container['spineName']; + } + + /** + * Sets spineName + * + * @param string|null $spineName Name of the Pay Spine + * + * @return $this + */ + public function setSpineName(?string $spineName): static + { + if (is_null($spineName)) { + array_push($this->openAPINullablesSetToNull, 'spineName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spineName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spineName'] = $spineName; + + return $this; + } + + /** + * Gets fullTimeHours + * + * @return float|null + */ + public function getFullTimeHours(): ?float + { + return $this->container['fullTimeHours']; + } + + /** + * Sets fullTimeHours + * + * @param float|null $fullTimeHours Maximum Full Time Hours on this Pay Spine + * + * @return $this + */ + public function setFullTimeHours(?float $fullTimeHours): static + { + if (is_null($fullTimeHours)) { + throw new InvalidArgumentException('non-nullable fullTimeHours cannot be null'); + } + $this->container['fullTimeHours'] = $fullTimeHours; + + return $this; + } + + /** + * Gets fullTimeWeeks + * + * @return float|null + */ + public function getFullTimeWeeks(): ?float + { + return $this->container['fullTimeWeeks']; + } + + /** + * Sets fullTimeWeeks + * + * @param float|null $fullTimeWeeks Maximum Full Time Weeks on this Pay Spine + * + * @return $this + */ + public function setFullTimeWeeks(?float $fullTimeWeeks): static + { + if (is_null($fullTimeWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeWeeks cannot be null'); + } + $this->container['fullTimeWeeks'] = $fullTimeWeeks; + + return $this; + } + + /** + * Gets salaryFormula + * + * @return string|null + */ + public function getSalaryFormula(): ?string + { + return $this->container['salaryFormula']; + } + + /** + * Sets salaryFormula + * + * @param string|null $salaryFormula Formula used to derive annual salary + * + * @return $this + */ + public function setSalaryFormula(?string $salaryFormula): static + { + if (is_null($salaryFormula)) { + array_push($this->openAPINullablesSetToNull, 'salaryFormula'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('salaryFormula', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['salaryFormula'] = $salaryFormula; + + return $this; + } + + /** + * Gets hourlyDivisor + * + * @return float|null + */ + public function getHourlyDivisor(): ?float + { + return $this->container['hourlyDivisor']; + } + + /** + * Sets hourlyDivisor + * + * @param float|null $hourlyDivisor Hours used to determine Hourly Rate + * + * @return $this + */ + public function setHourlyDivisor(?float $hourlyDivisor): static + { + if (is_null($hourlyDivisor)) { + throw new InvalidArgumentException('non-nullable hourlyDivisor cannot be null'); + } + $this->container['hourlyDivisor'] = $hourlyDivisor; + + return $this; + } + + /** + * Gets hourlyDecimals + * + * @return int|null + */ + public function getHourlyDecimals(): ?int + { + return $this->container['hourlyDecimals']; + } + + /** + * Sets hourlyDecimals + * + * @param int|null $hourlyDecimals Number of decimal places to calculate Hourly Rates + * + * @return $this + */ + public function setHourlyDecimals(?int $hourlyDecimals): static + { + if (is_null($hourlyDecimals)) { + throw new InvalidArgumentException('non-nullable hourlyDecimals cannot be null'); + } + $this->container['hourlyDecimals'] = $hourlyDecimals; + + return $this; + } + + /** + * Gets dailyDivisor + * + * @return float|null + */ + public function getDailyDivisor(): ?float + { + return $this->container['dailyDivisor']; + } + + /** + * Sets dailyDivisor + * + * @param float|null $dailyDivisor Days used to determine Full time Daily Rate + * + * @return $this + */ + public function setDailyDivisor(?float $dailyDivisor): static + { + if (is_null($dailyDivisor)) { + throw new InvalidArgumentException('non-nullable dailyDivisor cannot be null'); + } + $this->container['dailyDivisor'] = $dailyDivisor; + + return $this; + } + + /** + * Gets dailyDecimals + * + * @return int|null + */ + public function getDailyDecimals(): ?int + { + return $this->container['dailyDecimals']; + } + + /** + * Sets dailyDecimals + * + * @param int|null $dailyDecimals Number of decimal places to calculate Daily Rates + * + * @return $this + */ + public function setDailyDecimals(?int $dailyDecimals): static + { + if (is_null($dailyDecimals)) { + throw new InvalidArgumentException('non-nullable dailyDecimals cannot be null'); + } + $this->container['dailyDecimals'] = $dailyDecimals; + + return $this; + } + + /** + * Gets annualDecimals + * + * @return int|null + */ + public function getAnnualDecimals(): ?int + { + return $this->container['annualDecimals']; + } + + /** + * Sets annualDecimals + * + * @param int|null $annualDecimals Number of decimal places to calculate Annual Salaries + * + * @return $this + */ + public function setAnnualDecimals(?int $annualDecimals): static + { + if (is_null($annualDecimals)) { + throw new InvalidArgumentException('non-nullable annualDecimals cannot be null'); + } + $this->container['annualDecimals'] = $annualDecimals; + + return $this; + } + + /** + * Gets annualRoundingRule + * + * @return \SynergiTech\Staffology\Model\AnnualRoundingRule|null + */ + public function getAnnualRoundingRule(): ?\SynergiTech\Staffology\Model\AnnualRoundingRule + { + return $this->container['annualRoundingRule']; + } + + /** + * Sets annualRoundingRule + * + * @param \SynergiTech\Staffology\Model\AnnualRoundingRule|null $annualRoundingRule annualRoundingRule + * + * @return $this + */ + public function setAnnualRoundingRule(?\SynergiTech\Staffology\Model\AnnualRoundingRule $annualRoundingRule): static + { + if (is_null($annualRoundingRule)) { + throw new InvalidArgumentException('non-nullable annualRoundingRule cannot be null'); + } + $this->container['annualRoundingRule'] = $annualRoundingRule; + + return $this; + } + + /** + * Gets incrementRule + * + * @return \SynergiTech\Staffology\Model\IncrementRule|null + */ + public function getIncrementRule(): ?\SynergiTech\Staffology\Model\IncrementRule + { + return $this->container['incrementRule']; + } + + /** + * Sets incrementRule + * + * @param \SynergiTech\Staffology\Model\IncrementRule|null $incrementRule incrementRule + * + * @return $this + */ + public function setIncrementRule(?\SynergiTech\Staffology\Model\IncrementRule $incrementRule): static + { + if (is_null($incrementRule)) { + throw new InvalidArgumentException('non-nullable incrementRule cannot be null'); + } + $this->container['incrementRule'] = $incrementRule; + + return $this; + } + + /** + * Gets requiresLondonAllowance + * + * @return bool|null + */ + public function getRequiresLondonAllowance(): ?bool + { + return $this->container['requiresLondonAllowance']; + } + + /** + * Sets requiresLondonAllowance + * + * @param bool|null $requiresLondonAllowance Requires LA column to be completed on the spine + * + * @return $this + */ + public function setRequiresLondonAllowance(?bool $requiresLondonAllowance): static + { + if (is_null($requiresLondonAllowance)) { + throw new InvalidArgumentException('non-nullable requiresLondonAllowance cannot be null'); + } + $this->container['requiresLondonAllowance'] = $requiresLondonAllowance; + + return $this; + } + + /** + * Gets gradeEffectiveDate + * + * @return \DateTime|null + */ + public function getGradeEffectiveDate(): ?\DateTime + { + return $this->container['gradeEffectiveDate']; + } + + /** + * Sets gradeEffectiveDate + * + * @param \DateTime|null $gradeEffectiveDate Effective date for applicable grades + * + * @return $this + */ + public function setGradeEffectiveDate(?\DateTime $gradeEffectiveDate): static + { + if (is_null($gradeEffectiveDate)) { + throw new InvalidArgumentException('non-nullable gradeEffectiveDate cannot be null'); + } + $this->container['gradeEffectiveDate'] = $gradeEffectiveDate; + + return $this; + } + + /** + * Gets pointEffectiveDate + * + * @return \DateTime|null + */ + public function getPointEffectiveDate(): ?\DateTime + { + return $this->container['pointEffectiveDate']; + } + + /** + * Sets pointEffectiveDate + * + * @param \DateTime|null $pointEffectiveDate Effective date for applicable spinal points + * + * @return $this + */ + public function setPointEffectiveDate(?\DateTime $pointEffectiveDate): static + { + if (is_null($pointEffectiveDate)) { + throw new InvalidArgumentException('non-nullable pointEffectiveDate cannot be null'); + } + $this->container['pointEffectiveDate'] = $pointEffectiveDate; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySpineReportReportResponse.php b/src/Model/PaySpineReportReportResponse.php new file mode 100644 index 0000000..b802cf4 --- /dev/null +++ b/src/Model/PaySpineReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PaySpineReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaySpineReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PaySpineReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PaySpineReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PaySpineReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PaySpineReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PaySpineReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaySpineYearsServiceEntitlementBasis.php b/src/Model/PaySpineYearsServiceEntitlementBasis.php new file mode 100644 index 0000000..78d76ad --- /dev/null +++ b/src/Model/PaySpineYearsServiceEntitlementBasis.php @@ -0,0 +1,49 @@ + + */ +class Payee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Payee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'paymentDateRule' => '\SynergiTech\Staffology\Model\PaymentDateRule', + 'paymentDateDayOfWeek' => '\SynergiTech\Staffology\Model\DayOfWeek', + 'paymentDateDayOfMonth' => 'int', + 'hasMinimumBankDetails' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'bankDetails' => null, + 'paymentDateRule' => null, + 'paymentDateDayOfWeek' => null, + 'paymentDateDayOfMonth' => 'int32', + 'hasMinimumBankDetails' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => false, + 'bankDetails' => false, + 'paymentDateRule' => false, + 'paymentDateDayOfWeek' => false, + 'paymentDateDayOfMonth' => true, + 'hasMinimumBankDetails' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'bankDetails' => 'bankDetails', + 'paymentDateRule' => 'paymentDateRule', + 'paymentDateDayOfWeek' => 'paymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'paymentDateDayOfMonth', + 'hasMinimumBankDetails' => 'hasMinimumBankDetails', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'bankDetails' => 'setBankDetails', + 'paymentDateRule' => 'setPaymentDateRule', + 'paymentDateDayOfWeek' => 'setPaymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'setPaymentDateDayOfMonth', + 'hasMinimumBankDetails' => 'setHasMinimumBankDetails', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'bankDetails' => 'getBankDetails', + 'paymentDateRule' => 'getPaymentDateRule', + 'paymentDateDayOfWeek' => 'getPaymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'getPaymentDateDayOfMonth', + 'hasMinimumBankDetails' => 'getHasMinimumBankDetails', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('paymentDateRule', $data ?? [], null); + $this->setIfExists('paymentDateDayOfWeek', $data ?? [], null); + $this->setIfExists('paymentDateDayOfMonth', $data ?? [], null); + $this->setIfExists('hasMinimumBankDetails', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this Payee + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling Payee., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling Payee., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets paymentDateRule + * + * @return \SynergiTech\Staffology\Model\PaymentDateRule|null + */ + public function getPaymentDateRule(): ?\SynergiTech\Staffology\Model\PaymentDateRule + { + return $this->container['paymentDateRule']; + } + + /** + * Sets paymentDateRule + * + * @param \SynergiTech\Staffology\Model\PaymentDateRule|null $paymentDateRule paymentDateRule + * + * @return $this + */ + public function setPaymentDateRule(?\SynergiTech\Staffology\Model\PaymentDateRule $paymentDateRule): static + { + if (is_null($paymentDateRule)) { + throw new InvalidArgumentException('non-nullable paymentDateRule cannot be null'); + } + $this->container['paymentDateRule'] = $paymentDateRule; + + return $this; + } + + /** + * Gets paymentDateDayOfWeek + * + * @return \SynergiTech\Staffology\Model\DayOfWeek|null + */ + public function getPaymentDateDayOfWeek(): ?\SynergiTech\Staffology\Model\DayOfWeek + { + return $this->container['paymentDateDayOfWeek']; + } + + /** + * Sets paymentDateDayOfWeek + * + * @param \SynergiTech\Staffology\Model\DayOfWeek|null $paymentDateDayOfWeek paymentDateDayOfWeek + * + * @return $this + */ + public function setPaymentDateDayOfWeek(?\SynergiTech\Staffology\Model\DayOfWeek $paymentDateDayOfWeek): static + { + if (is_null($paymentDateDayOfWeek)) { + throw new InvalidArgumentException('non-nullable paymentDateDayOfWeek cannot be null'); + } + $this->container['paymentDateDayOfWeek'] = $paymentDateDayOfWeek; + + return $this; + } + + /** + * Gets paymentDateDayOfMonth + * + * @return int|null + */ + public function getPaymentDateDayOfMonth(): ?int + { + return $this->container['paymentDateDayOfMonth']; + } + + /** + * Sets paymentDateDayOfMonth + * + * @param int|null $paymentDateDayOfMonth paymentDateDayOfMonth + * + * @return $this + */ + public function setPaymentDateDayOfMonth(?int $paymentDateDayOfMonth): static + { + if (is_null($paymentDateDayOfMonth)) { + array_push($this->openAPINullablesSetToNull, 'paymentDateDayOfMonth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentDateDayOfMonth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentDateDayOfMonth'] = $paymentDateDayOfMonth; + + return $this; + } + + /** + * Gets hasMinimumBankDetails + * + * @return bool|null + */ + public function getHasMinimumBankDetails(): ?bool + { + return $this->container['hasMinimumBankDetails']; + } + + /** + * Sets hasMinimumBankDetails + * + * @param bool|null $hasMinimumBankDetails Denotes whether the payee has the minimum bank details to receive a payment + * + * @return $this + */ + public function setHasMinimumBankDetails(?bool $hasMinimumBankDetails): static + { + if (is_null($hasMinimumBankDetails)) { + throw new InvalidArgumentException('non-nullable hasMinimumBankDetails cannot be null'); + } + $this->container['hasMinimumBankDetails'] = $hasMinimumBankDetails; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayeeType.php b/src/Model/PayeeType.php new file mode 100644 index 0000000..b759ad6 --- /dev/null +++ b/src/Model/PayeeType.php @@ -0,0 +1,51 @@ + + */ +class PaylineCalculationData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaylineCalculationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fixedAnnualValue' => 'float', + 'contractedHours' => 'float', + 'contractedWeeks' => 'float', + 'fullTimeEquivalent' => 'float', + 'fullTimeHours' => 'float', + 'fullTimeWeeks' => 'float', + 'fullTimeSalary' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fixedAnnualValue' => 'double', + 'contractedHours' => 'double', + 'contractedWeeks' => 'double', + 'fullTimeEquivalent' => 'double', + 'fullTimeHours' => 'double', + 'fullTimeWeeks' => 'double', + 'fullTimeSalary' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fixedAnnualValue' => false, + 'contractedHours' => false, + 'contractedWeeks' => false, + 'fullTimeEquivalent' => false, + 'fullTimeHours' => false, + 'fullTimeWeeks' => false, + 'fullTimeSalary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fixedAnnualValue' => 'fixedAnnualValue', + 'contractedHours' => 'contractedHours', + 'contractedWeeks' => 'contractedWeeks', + 'fullTimeEquivalent' => 'fullTimeEquivalent', + 'fullTimeHours' => 'fullTimeHours', + 'fullTimeWeeks' => 'fullTimeWeeks', + 'fullTimeSalary' => 'fullTimeSalary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fixedAnnualValue' => 'setFixedAnnualValue', + 'contractedHours' => 'setContractedHours', + 'contractedWeeks' => 'setContractedWeeks', + 'fullTimeEquivalent' => 'setFullTimeEquivalent', + 'fullTimeHours' => 'setFullTimeHours', + 'fullTimeWeeks' => 'setFullTimeWeeks', + 'fullTimeSalary' => 'setFullTimeSalary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fixedAnnualValue' => 'getFixedAnnualValue', + 'contractedHours' => 'getContractedHours', + 'contractedWeeks' => 'getContractedWeeks', + 'fullTimeEquivalent' => 'getFullTimeEquivalent', + 'fullTimeHours' => 'getFullTimeHours', + 'fullTimeWeeks' => 'getFullTimeWeeks', + 'fullTimeSalary' => 'getFullTimeSalary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fixedAnnualValue', $data ?? [], null); + $this->setIfExists('contractedHours', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeEquivalent', $data ?? [], null); + $this->setIfExists('fullTimeHours', $data ?? [], null); + $this->setIfExists('fullTimeWeeks', $data ?? [], null); + $this->setIfExists('fullTimeSalary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fixedAnnualValue + * + * @return float|null + */ + public function getFixedAnnualValue(): ?float + { + return $this->container['fixedAnnualValue']; + } + + /** + * Sets fixedAnnualValue + * + * @param float|null $fixedAnnualValue PaySpine full time annual value + * + * @return $this + */ + public function setFixedAnnualValue(?float $fixedAnnualValue): static + { + if (is_null($fixedAnnualValue)) { + throw new InvalidArgumentException('non-nullable fixedAnnualValue cannot be null'); + } + $this->container['fixedAnnualValue'] = $fixedAnnualValue; + + return $this; + } + + /** + * Gets contractedHours + * + * @return float|null + */ + public function getContractedHours(): ?float + { + return $this->container['contractedHours']; + } + + /** + * Sets contractedHours + * + * @param float|null $contractedHours PaySpine contracted hours + * + * @return $this + */ + public function setContractedHours(?float $contractedHours): static + { + if (is_null($contractedHours)) { + throw new InvalidArgumentException('non-nullable contractedHours cannot be null'); + } + $this->container['contractedHours'] = $contractedHours; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks PaySpine contracted weeks + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + throw new InvalidArgumentException('non-nullable contractedWeeks cannot be null'); + } + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets fullTimeEquivalent + * + * @return float|null + */ + public function getFullTimeEquivalent(): ?float + { + return $this->container['fullTimeEquivalent']; + } + + /** + * Sets fullTimeEquivalent + * + * @param float|null $fullTimeEquivalent PaySpine full time equivalent value + * + * @return $this + */ + public function setFullTimeEquivalent(?float $fullTimeEquivalent): static + { + if (is_null($fullTimeEquivalent)) { + throw new InvalidArgumentException('non-nullable fullTimeEquivalent cannot be null'); + } + $this->container['fullTimeEquivalent'] = $fullTimeEquivalent; + + return $this; + } + + /** + * Gets fullTimeHours + * + * @return float|null + */ + public function getFullTimeHours(): ?float + { + return $this->container['fullTimeHours']; + } + + /** + * Sets fullTimeHours + * + * @param float|null $fullTimeHours PaySpine full time hours + * + * @return $this + */ + public function setFullTimeHours(?float $fullTimeHours): static + { + if (is_null($fullTimeHours)) { + throw new InvalidArgumentException('non-nullable fullTimeHours cannot be null'); + } + $this->container['fullTimeHours'] = $fullTimeHours; + + return $this; + } + + /** + * Gets fullTimeWeeks + * + * @return float|null + */ + public function getFullTimeWeeks(): ?float + { + return $this->container['fullTimeWeeks']; + } + + /** + * Sets fullTimeWeeks + * + * @param float|null $fullTimeWeeks PaySpine full time weeks + * + * @return $this + */ + public function setFullTimeWeeks(?float $fullTimeWeeks): static + { + if (is_null($fullTimeWeeks)) { + throw new InvalidArgumentException('non-nullable fullTimeWeeks cannot be null'); + } + $this->container['fullTimeWeeks'] = $fullTimeWeeks; + + return $this; + } + + /** + * Gets fullTimeSalary + * + * @return float|null + */ + public function getFullTimeSalary(): ?float + { + return $this->container['fullTimeSalary']; + } + + /** + * Sets fullTimeSalary + * + * @param float|null $fullTimeSalary PaySpine full time salary + * + * @return $this + */ + public function setFullTimeSalary(?float $fullTimeSalary): static + { + if (is_null($fullTimeSalary)) { + throw new InvalidArgumentException('non-nullable fullTimeSalary cannot be null'); + } + $this->container['fullTimeSalary'] = $fullTimeSalary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaymentDateRule.php b/src/Model/PaymentDateRule.php new file mode 100644 index 0000000..fb6ebcf --- /dev/null +++ b/src/Model/PaymentDateRule.php @@ -0,0 +1,47 @@ + + */ +class PaymentsCsvMapping implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaymentsCsvMapping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'type' => '\SynergiTech\Staffology\Model\PaymentsCsvMappingType', + 'importBehaviour' => 'int', + 'payBasis' => '\SynergiTech\Staffology\Model\PayBasis', + 'hasHeader' => 'bool', + 'payrollCodeIndex' => 'int', + 'employerIdIndex' => 'int', + 'roleReferenceIndex' => 'int', + 'payAmountIndex' => 'int', + 'payAmountMultiplierIndex' => 'int', + 'noteIndex' => 'int', + 'payCodeIndex' => 'int', + 'hasPaylineCosting' => 'bool', + 'departmentIndex' => 'int', + 'costCentreIndex' => 'int', + 'effectiveFromIndex' => 'int', + 'effectiveToIndex' => 'int', + 'isAutomaticBackPayIndex' => 'int', + 'ignoreInitialBackPayIndex' => 'int', + 'contributesToBasicPayIndex' => 'int', + 'autoAdjustForLeaveIndex' => 'int', + 'analysisCategoryIndexesJson' => 'string', + 'paySpineIndex' => 'int', + 'payGradeIndex' => 'int', + 'spinePointIndex' => 'int', + 'analysisCategoryIndexes' => '\SynergiTech\Staffology\Model\AnalysisCategoryIndex[]', + 'columns' => '\SynergiTech\Staffology\Model\PaymentsCsvMappingColumn[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'type' => null, + 'importBehaviour' => 'int32', + 'payBasis' => null, + 'hasHeader' => null, + 'payrollCodeIndex' => 'int32', + 'employerIdIndex' => 'int32', + 'roleReferenceIndex' => 'int32', + 'payAmountIndex' => 'int32', + 'payAmountMultiplierIndex' => 'int32', + 'noteIndex' => 'int32', + 'payCodeIndex' => 'int32', + 'hasPaylineCosting' => null, + 'departmentIndex' => 'int32', + 'costCentreIndex' => 'int32', + 'effectiveFromIndex' => 'int32', + 'effectiveToIndex' => 'int32', + 'isAutomaticBackPayIndex' => 'int32', + 'ignoreInitialBackPayIndex' => 'int32', + 'contributesToBasicPayIndex' => 'int32', + 'autoAdjustForLeaveIndex' => 'int32', + 'analysisCategoryIndexesJson' => null, + 'paySpineIndex' => 'int32', + 'payGradeIndex' => 'int32', + 'spinePointIndex' => 'int32', + 'analysisCategoryIndexes' => null, + 'columns' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'type' => false, + 'importBehaviour' => false, + 'payBasis' => false, + 'hasHeader' => false, + 'payrollCodeIndex' => false, + 'employerIdIndex' => false, + 'roleReferenceIndex' => false, + 'payAmountIndex' => false, + 'payAmountMultiplierIndex' => false, + 'noteIndex' => false, + 'payCodeIndex' => false, + 'hasPaylineCosting' => false, + 'departmentIndex' => false, + 'costCentreIndex' => false, + 'effectiveFromIndex' => false, + 'effectiveToIndex' => false, + 'isAutomaticBackPayIndex' => false, + 'ignoreInitialBackPayIndex' => false, + 'contributesToBasicPayIndex' => false, + 'autoAdjustForLeaveIndex' => false, + 'analysisCategoryIndexesJson' => true, + 'paySpineIndex' => false, + 'payGradeIndex' => false, + 'spinePointIndex' => false, + 'analysisCategoryIndexes' => true, + 'columns' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'type' => 'type', + 'importBehaviour' => 'importBehaviour', + 'payBasis' => 'payBasis', + 'hasHeader' => 'hasHeader', + 'payrollCodeIndex' => 'payrollCodeIndex', + 'employerIdIndex' => 'employerIdIndex', + 'roleReferenceIndex' => 'roleReferenceIndex', + 'payAmountIndex' => 'payAmountIndex', + 'payAmountMultiplierIndex' => 'payAmountMultiplierIndex', + 'noteIndex' => 'noteIndex', + 'payCodeIndex' => 'payCodeIndex', + 'hasPaylineCosting' => 'hasPaylineCosting', + 'departmentIndex' => 'departmentIndex', + 'costCentreIndex' => 'costCentreIndex', + 'effectiveFromIndex' => 'effectiveFromIndex', + 'effectiveToIndex' => 'effectiveToIndex', + 'isAutomaticBackPayIndex' => 'isAutomaticBackPayIndex', + 'ignoreInitialBackPayIndex' => 'ignoreInitialBackPayIndex', + 'contributesToBasicPayIndex' => 'contributesToBasicPayIndex', + 'autoAdjustForLeaveIndex' => 'autoAdjustForLeaveIndex', + 'analysisCategoryIndexesJson' => 'analysisCategoryIndexesJson', + 'paySpineIndex' => 'paySpineIndex', + 'payGradeIndex' => 'payGradeIndex', + 'spinePointIndex' => 'spinePointIndex', + 'analysisCategoryIndexes' => 'analysisCategoryIndexes', + 'columns' => 'columns', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'type' => 'setType', + 'importBehaviour' => 'setImportBehaviour', + 'payBasis' => 'setPayBasis', + 'hasHeader' => 'setHasHeader', + 'payrollCodeIndex' => 'setPayrollCodeIndex', + 'employerIdIndex' => 'setEmployerIdIndex', + 'roleReferenceIndex' => 'setRoleReferenceIndex', + 'payAmountIndex' => 'setPayAmountIndex', + 'payAmountMultiplierIndex' => 'setPayAmountMultiplierIndex', + 'noteIndex' => 'setNoteIndex', + 'payCodeIndex' => 'setPayCodeIndex', + 'hasPaylineCosting' => 'setHasPaylineCosting', + 'departmentIndex' => 'setDepartmentIndex', + 'costCentreIndex' => 'setCostCentreIndex', + 'effectiveFromIndex' => 'setEffectiveFromIndex', + 'effectiveToIndex' => 'setEffectiveToIndex', + 'isAutomaticBackPayIndex' => 'setIsAutomaticBackPayIndex', + 'ignoreInitialBackPayIndex' => 'setIgnoreInitialBackPayIndex', + 'contributesToBasicPayIndex' => 'setContributesToBasicPayIndex', + 'autoAdjustForLeaveIndex' => 'setAutoAdjustForLeaveIndex', + 'analysisCategoryIndexesJson' => 'setAnalysisCategoryIndexesJson', + 'paySpineIndex' => 'setPaySpineIndex', + 'payGradeIndex' => 'setPayGradeIndex', + 'spinePointIndex' => 'setSpinePointIndex', + 'analysisCategoryIndexes' => 'setAnalysisCategoryIndexes', + 'columns' => 'setColumns', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'type' => 'getType', + 'importBehaviour' => 'getImportBehaviour', + 'payBasis' => 'getPayBasis', + 'hasHeader' => 'getHasHeader', + 'payrollCodeIndex' => 'getPayrollCodeIndex', + 'employerIdIndex' => 'getEmployerIdIndex', + 'roleReferenceIndex' => 'getRoleReferenceIndex', + 'payAmountIndex' => 'getPayAmountIndex', + 'payAmountMultiplierIndex' => 'getPayAmountMultiplierIndex', + 'noteIndex' => 'getNoteIndex', + 'payCodeIndex' => 'getPayCodeIndex', + 'hasPaylineCosting' => 'getHasPaylineCosting', + 'departmentIndex' => 'getDepartmentIndex', + 'costCentreIndex' => 'getCostCentreIndex', + 'effectiveFromIndex' => 'getEffectiveFromIndex', + 'effectiveToIndex' => 'getEffectiveToIndex', + 'isAutomaticBackPayIndex' => 'getIsAutomaticBackPayIndex', + 'ignoreInitialBackPayIndex' => 'getIgnoreInitialBackPayIndex', + 'contributesToBasicPayIndex' => 'getContributesToBasicPayIndex', + 'autoAdjustForLeaveIndex' => 'getAutoAdjustForLeaveIndex', + 'analysisCategoryIndexesJson' => 'getAnalysisCategoryIndexesJson', + 'paySpineIndex' => 'getPaySpineIndex', + 'payGradeIndex' => 'getPayGradeIndex', + 'spinePointIndex' => 'getSpinePointIndex', + 'analysisCategoryIndexes' => 'getAnalysisCategoryIndexes', + 'columns' => 'getColumns', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('importBehaviour', $data ?? [], null); + $this->setIfExists('payBasis', $data ?? [], null); + $this->setIfExists('hasHeader', $data ?? [], null); + $this->setIfExists('payrollCodeIndex', $data ?? [], null); + $this->setIfExists('employerIdIndex', $data ?? [], null); + $this->setIfExists('roleReferenceIndex', $data ?? [], null); + $this->setIfExists('payAmountIndex', $data ?? [], null); + $this->setIfExists('payAmountMultiplierIndex', $data ?? [], null); + $this->setIfExists('noteIndex', $data ?? [], null); + $this->setIfExists('payCodeIndex', $data ?? [], null); + $this->setIfExists('hasPaylineCosting', $data ?? [], null); + $this->setIfExists('departmentIndex', $data ?? [], null); + $this->setIfExists('costCentreIndex', $data ?? [], null); + $this->setIfExists('effectiveFromIndex', $data ?? [], null); + $this->setIfExists('effectiveToIndex', $data ?? [], null); + $this->setIfExists('isAutomaticBackPayIndex', $data ?? [], null); + $this->setIfExists('ignoreInitialBackPayIndex', $data ?? [], null); + $this->setIfExists('contributesToBasicPayIndex', $data ?? [], null); + $this->setIfExists('autoAdjustForLeaveIndex', $data ?? [], null); + $this->setIfExists('analysisCategoryIndexesJson', $data ?? [], null); + $this->setIfExists('paySpineIndex', $data ?? [], null); + $this->setIfExists('payGradeIndex', $data ?? [], null); + $this->setIfExists('spinePointIndex', $data ?? [], null); + $this->setIfExists('analysisCategoryIndexes', $data ?? [], null); + $this->setIfExists('columns', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 50)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 50)) { + throw new InvalidArgumentException('invalid length for $name when calling PaymentsCsvMapping., must be smaller than or equal to 50.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling PaymentsCsvMapping., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PaymentsCsvMappingType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PaymentsCsvMappingType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PaymentsCsvMappingType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PaymentsCsvMappingType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets importBehaviour + * + * @return int|null + */ + public function getImportBehaviour(): ?int + { + return $this->container['importBehaviour']; + } + + /** + * Sets importBehaviour + * + * @param int|null $importBehaviour importBehaviour + * + * @return $this + */ + public function setImportBehaviour(?int $importBehaviour): static + { + if (is_null($importBehaviour)) { + throw new InvalidArgumentException('non-nullable importBehaviour cannot be null'); + } + $this->container['importBehaviour'] = $importBehaviour; + + return $this; + } + + /** + * Gets payBasis + * + * @return \SynergiTech\Staffology\Model\PayBasis|null + */ + public function getPayBasis(): ?\SynergiTech\Staffology\Model\PayBasis + { + return $this->container['payBasis']; + } + + /** + * Sets payBasis + * + * @param \SynergiTech\Staffology\Model\PayBasis|null $payBasis payBasis + * + * @return $this + */ + public function setPayBasis(?\SynergiTech\Staffology\Model\PayBasis $payBasis): static + { + if (is_null($payBasis)) { + throw new InvalidArgumentException('non-nullable payBasis cannot be null'); + } + $this->container['payBasis'] = $payBasis; + + return $this; + } + + /** + * Gets hasHeader + * + * @return bool|null + */ + public function getHasHeader(): ?bool + { + return $this->container['hasHeader']; + } + + /** + * Sets hasHeader + * + * @param bool|null $hasHeader hasHeader + * + * @return $this + */ + public function setHasHeader(?bool $hasHeader): static + { + if (is_null($hasHeader)) { + throw new InvalidArgumentException('non-nullable hasHeader cannot be null'); + } + $this->container['hasHeader'] = $hasHeader; + + return $this; + } + + /** + * Gets payrollCodeIndex + * + * @return int|null + */ + public function getPayrollCodeIndex(): ?int + { + return $this->container['payrollCodeIndex']; + } + + /** + * Sets payrollCodeIndex + * + * @param int|null $payrollCodeIndex payrollCodeIndex + * + * @return $this + */ + public function setPayrollCodeIndex(?int $payrollCodeIndex): static + { + if (is_null($payrollCodeIndex)) { + throw new InvalidArgumentException('non-nullable payrollCodeIndex cannot be null'); + } + $this->container['payrollCodeIndex'] = $payrollCodeIndex; + + return $this; + } + + /** + * Gets employerIdIndex + * + * @return int|null + */ + public function getEmployerIdIndex(): ?int + { + return $this->container['employerIdIndex']; + } + + /** + * Sets employerIdIndex + * + * @param int|null $employerIdIndex employerIdIndex + * + * @return $this + */ + public function setEmployerIdIndex(?int $employerIdIndex): static + { + if (is_null($employerIdIndex)) { + throw new InvalidArgumentException('non-nullable employerIdIndex cannot be null'); + } + $this->container['employerIdIndex'] = $employerIdIndex; + + return $this; + } + + /** + * Gets roleReferenceIndex + * + * @return int|null + */ + public function getRoleReferenceIndex(): ?int + { + return $this->container['roleReferenceIndex']; + } + + /** + * Sets roleReferenceIndex + * + * @param int|null $roleReferenceIndex roleReferenceIndex + * + * @return $this + */ + public function setRoleReferenceIndex(?int $roleReferenceIndex): static + { + if (is_null($roleReferenceIndex)) { + throw new InvalidArgumentException('non-nullable roleReferenceIndex cannot be null'); + } + $this->container['roleReferenceIndex'] = $roleReferenceIndex; + + return $this; + } + + /** + * Gets payAmountIndex + * + * @return int|null + */ + public function getPayAmountIndex(): ?int + { + return $this->container['payAmountIndex']; + } + + /** + * Sets payAmountIndex + * + * @param int|null $payAmountIndex payAmountIndex + * + * @return $this + */ + public function setPayAmountIndex(?int $payAmountIndex): static + { + if (is_null($payAmountIndex)) { + throw new InvalidArgumentException('non-nullable payAmountIndex cannot be null'); + } + $this->container['payAmountIndex'] = $payAmountIndex; + + return $this; + } + + /** + * Gets payAmountMultiplierIndex + * + * @return int|null + */ + public function getPayAmountMultiplierIndex(): ?int + { + return $this->container['payAmountMultiplierIndex']; + } + + /** + * Sets payAmountMultiplierIndex + * + * @param int|null $payAmountMultiplierIndex payAmountMultiplierIndex + * + * @return $this + */ + public function setPayAmountMultiplierIndex(?int $payAmountMultiplierIndex): static + { + if (is_null($payAmountMultiplierIndex)) { + throw new InvalidArgumentException('non-nullable payAmountMultiplierIndex cannot be null'); + } + $this->container['payAmountMultiplierIndex'] = $payAmountMultiplierIndex; + + return $this; + } + + /** + * Gets noteIndex + * + * @return int|null + */ + public function getNoteIndex(): ?int + { + return $this->container['noteIndex']; + } + + /** + * Sets noteIndex + * + * @param int|null $noteIndex noteIndex + * + * @return $this + */ + public function setNoteIndex(?int $noteIndex): static + { + if (is_null($noteIndex)) { + throw new InvalidArgumentException('non-nullable noteIndex cannot be null'); + } + $this->container['noteIndex'] = $noteIndex; + + return $this; + } + + /** + * Gets payCodeIndex + * + * @return int|null + */ + public function getPayCodeIndex(): ?int + { + return $this->container['payCodeIndex']; + } + + /** + * Sets payCodeIndex + * + * @param int|null $payCodeIndex payCodeIndex + * + * @return $this + */ + public function setPayCodeIndex(?int $payCodeIndex): static + { + if (is_null($payCodeIndex)) { + throw new InvalidArgumentException('non-nullable payCodeIndex cannot be null'); + } + $this->container['payCodeIndex'] = $payCodeIndex; + + return $this; + } + + /** + * Gets hasPaylineCosting + * + * @return bool|null + */ + public function getHasPaylineCosting(): ?bool + { + return $this->container['hasPaylineCosting']; + } + + /** + * Sets hasPaylineCosting + * + * @param bool|null $hasPaylineCosting hasPaylineCosting + * + * @return $this + */ + public function setHasPaylineCosting(?bool $hasPaylineCosting): static + { + if (is_null($hasPaylineCosting)) { + throw new InvalidArgumentException('non-nullable hasPaylineCosting cannot be null'); + } + $this->container['hasPaylineCosting'] = $hasPaylineCosting; + + return $this; + } + + /** + * Gets departmentIndex + * + * @return int|null + */ + public function getDepartmentIndex(): ?int + { + return $this->container['departmentIndex']; + } + + /** + * Sets departmentIndex + * + * @param int|null $departmentIndex departmentIndex + * + * @return $this + */ + public function setDepartmentIndex(?int $departmentIndex): static + { + if (is_null($departmentIndex)) { + throw new InvalidArgumentException('non-nullable departmentIndex cannot be null'); + } + $this->container['departmentIndex'] = $departmentIndex; + + return $this; + } + + /** + * Gets costCentreIndex + * + * @return int|null + */ + public function getCostCentreIndex(): ?int + { + return $this->container['costCentreIndex']; + } + + /** + * Sets costCentreIndex + * + * @param int|null $costCentreIndex costCentreIndex + * + * @return $this + */ + public function setCostCentreIndex(?int $costCentreIndex): static + { + if (is_null($costCentreIndex)) { + throw new InvalidArgumentException('non-nullable costCentreIndex cannot be null'); + } + $this->container['costCentreIndex'] = $costCentreIndex; + + return $this; + } + + /** + * Gets effectiveFromIndex + * + * @return int|null + */ + public function getEffectiveFromIndex(): ?int + { + return $this->container['effectiveFromIndex']; + } + + /** + * Sets effectiveFromIndex + * + * @param int|null $effectiveFromIndex effectiveFromIndex + * + * @return $this + */ + public function setEffectiveFromIndex(?int $effectiveFromIndex): static + { + if (is_null($effectiveFromIndex)) { + throw new InvalidArgumentException('non-nullable effectiveFromIndex cannot be null'); + } + $this->container['effectiveFromIndex'] = $effectiveFromIndex; + + return $this; + } + + /** + * Gets effectiveToIndex + * + * @return int|null + */ + public function getEffectiveToIndex(): ?int + { + return $this->container['effectiveToIndex']; + } + + /** + * Sets effectiveToIndex + * + * @param int|null $effectiveToIndex effectiveToIndex + * + * @return $this + */ + public function setEffectiveToIndex(?int $effectiveToIndex): static + { + if (is_null($effectiveToIndex)) { + throw new InvalidArgumentException('non-nullable effectiveToIndex cannot be null'); + } + $this->container['effectiveToIndex'] = $effectiveToIndex; + + return $this; + } + + /** + * Gets isAutomaticBackPayIndex + * + * @return int|null + */ + public function getIsAutomaticBackPayIndex(): ?int + { + return $this->container['isAutomaticBackPayIndex']; + } + + /** + * Sets isAutomaticBackPayIndex + * + * @param int|null $isAutomaticBackPayIndex isAutomaticBackPayIndex + * + * @return $this + */ + public function setIsAutomaticBackPayIndex(?int $isAutomaticBackPayIndex): static + { + if (is_null($isAutomaticBackPayIndex)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPayIndex cannot be null'); + } + $this->container['isAutomaticBackPayIndex'] = $isAutomaticBackPayIndex; + + return $this; + } + + /** + * Gets ignoreInitialBackPayIndex + * + * @return int|null + */ + public function getIgnoreInitialBackPayIndex(): ?int + { + return $this->container['ignoreInitialBackPayIndex']; + } + + /** + * Sets ignoreInitialBackPayIndex + * + * @param int|null $ignoreInitialBackPayIndex ignoreInitialBackPayIndex + * + * @return $this + */ + public function setIgnoreInitialBackPayIndex(?int $ignoreInitialBackPayIndex): static + { + if (is_null($ignoreInitialBackPayIndex)) { + throw new InvalidArgumentException('non-nullable ignoreInitialBackPayIndex cannot be null'); + } + $this->container['ignoreInitialBackPayIndex'] = $ignoreInitialBackPayIndex; + + return $this; + } + + /** + * Gets contributesToBasicPayIndex + * + * @return int|null + */ + public function getContributesToBasicPayIndex(): ?int + { + return $this->container['contributesToBasicPayIndex']; + } + + /** + * Sets contributesToBasicPayIndex + * + * @param int|null $contributesToBasicPayIndex contributesToBasicPayIndex + * + * @return $this + */ + public function setContributesToBasicPayIndex(?int $contributesToBasicPayIndex): static + { + if (is_null($contributesToBasicPayIndex)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPayIndex cannot be null'); + } + $this->container['contributesToBasicPayIndex'] = $contributesToBasicPayIndex; + + return $this; + } + + /** + * Gets autoAdjustForLeaveIndex + * + * @return int|null + */ + public function getAutoAdjustForLeaveIndex(): ?int + { + return $this->container['autoAdjustForLeaveIndex']; + } + + /** + * Sets autoAdjustForLeaveIndex + * + * @param int|null $autoAdjustForLeaveIndex autoAdjustForLeaveIndex + * + * @return $this + */ + public function setAutoAdjustForLeaveIndex(?int $autoAdjustForLeaveIndex): static + { + if (is_null($autoAdjustForLeaveIndex)) { + throw new InvalidArgumentException('non-nullable autoAdjustForLeaveIndex cannot be null'); + } + $this->container['autoAdjustForLeaveIndex'] = $autoAdjustForLeaveIndex; + + return $this; + } + + /** + * Gets analysisCategoryIndexesJson + * + * @return string|null + */ + public function getAnalysisCategoryIndexesJson(): ?string + { + return $this->container['analysisCategoryIndexesJson']; + } + + /** + * Sets analysisCategoryIndexesJson + * + * @param string|null $analysisCategoryIndexesJson analysisCategoryIndexesJson + * + * @return $this + */ + public function setAnalysisCategoryIndexesJson(?string $analysisCategoryIndexesJson): static + { + if (is_null($analysisCategoryIndexesJson)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryIndexesJson'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryIndexesJson', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryIndexesJson'] = $analysisCategoryIndexesJson; + + return $this; + } + + /** + * Gets paySpineIndex + * + * @return int|null + */ + public function getPaySpineIndex(): ?int + { + return $this->container['paySpineIndex']; + } + + /** + * Sets paySpineIndex + * + * @param int|null $paySpineIndex paySpineIndex + * + * @return $this + */ + public function setPaySpineIndex(?int $paySpineIndex): static + { + if (is_null($paySpineIndex)) { + throw new InvalidArgumentException('non-nullable paySpineIndex cannot be null'); + } + $this->container['paySpineIndex'] = $paySpineIndex; + + return $this; + } + + /** + * Gets payGradeIndex + * + * @return int|null + */ + public function getPayGradeIndex(): ?int + { + return $this->container['payGradeIndex']; + } + + /** + * Sets payGradeIndex + * + * @param int|null $payGradeIndex payGradeIndex + * + * @return $this + */ + public function setPayGradeIndex(?int $payGradeIndex): static + { + if (is_null($payGradeIndex)) { + throw new InvalidArgumentException('non-nullable payGradeIndex cannot be null'); + } + $this->container['payGradeIndex'] = $payGradeIndex; + + return $this; + } + + /** + * Gets spinePointIndex + * + * @return int|null + */ + public function getSpinePointIndex(): ?int + { + return $this->container['spinePointIndex']; + } + + /** + * Sets spinePointIndex + * + * @param int|null $spinePointIndex spinePointIndex + * + * @return $this + */ + public function setSpinePointIndex(?int $spinePointIndex): static + { + if (is_null($spinePointIndex)) { + throw new InvalidArgumentException('non-nullable spinePointIndex cannot be null'); + } + $this->container['spinePointIndex'] = $spinePointIndex; + + return $this; + } + + /** + * Gets analysisCategoryIndexes + * + * @return \SynergiTech\Staffology\Model\AnalysisCategoryIndex[]|null + */ + public function getAnalysisCategoryIndexes(): ?array + { + return $this->container['analysisCategoryIndexes']; + } + + /** + * Sets analysisCategoryIndexes + * + * @param \SynergiTech\Staffology\Model\AnalysisCategoryIndex[]|null $analysisCategoryIndexes analysisCategoryIndexes + * + * @return $this + */ + public function setAnalysisCategoryIndexes(?array $analysisCategoryIndexes): static + { + if (is_null($analysisCategoryIndexes)) { + array_push($this->openAPINullablesSetToNull, 'analysisCategoryIndexes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('analysisCategoryIndexes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['analysisCategoryIndexes'] = $analysisCategoryIndexes; + + return $this; + } + + /** + * Gets columns + * + * @return \SynergiTech\Staffology\Model\PaymentsCsvMappingColumn[]|null + */ + public function getColumns(): ?array + { + return $this->container['columns']; + } + + /** + * Sets columns + * + * @param \SynergiTech\Staffology\Model\PaymentsCsvMappingColumn[]|null $columns columns + * + * @return $this + */ + public function setColumns(?array $columns): static + { + if (is_null($columns)) { + array_push($this->openAPINullablesSetToNull, 'columns'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('columns', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['columns'] = $columns; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaymentsCsvMappingColumn.php b/src/Model/PaymentsCsvMappingColumn.php new file mode 100644 index 0000000..8dc0160 --- /dev/null +++ b/src/Model/PaymentsCsvMappingColumn.php @@ -0,0 +1,678 @@ + + */ +class PaymentsCsvMappingColumn implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaymentsCsvMappingColumn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'code' => 'string', + 'isReferenceOnly' => 'bool', + 'colIndex' => 'int', + 'isMultiplier' => 'bool', + 'isNetToGross' => 'bool', + 'rateColIndex' => 'int', + 'shouldSerializeRateColIndex' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'code' => null, + 'isReferenceOnly' => null, + 'colIndex' => 'int32', + 'isMultiplier' => null, + 'isNetToGross' => null, + 'rateColIndex' => 'int32', + 'shouldSerializeRateColIndex' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => false, + 'code' => true, + 'isReferenceOnly' => false, + 'colIndex' => false, + 'isMultiplier' => false, + 'isNetToGross' => false, + 'rateColIndex' => true, + 'shouldSerializeRateColIndex' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'code' => 'code', + 'isReferenceOnly' => 'isReferenceOnly', + 'colIndex' => 'colIndex', + 'isMultiplier' => 'isMultiplier', + 'isNetToGross' => 'isNetToGross', + 'rateColIndex' => 'rateColIndex', + 'shouldSerializeRateColIndex' => 'shouldSerializeRateColIndex' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'code' => 'setCode', + 'isReferenceOnly' => 'setIsReferenceOnly', + 'colIndex' => 'setColIndex', + 'isMultiplier' => 'setIsMultiplier', + 'isNetToGross' => 'setIsNetToGross', + 'rateColIndex' => 'setRateColIndex', + 'shouldSerializeRateColIndex' => 'setShouldSerializeRateColIndex' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'code' => 'getCode', + 'isReferenceOnly' => 'getIsReferenceOnly', + 'colIndex' => 'getColIndex', + 'isMultiplier' => 'getIsMultiplier', + 'isNetToGross' => 'getIsNetToGross', + 'rateColIndex' => 'getRateColIndex', + 'shouldSerializeRateColIndex' => 'getShouldSerializeRateColIndex' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('isReferenceOnly', $data ?? [], null); + $this->setIfExists('colIndex', $data ?? [], null); + $this->setIfExists('isMultiplier', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('rateColIndex', $data ?? [], null); + $this->setIfExists('shouldSerializeRateColIndex', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 25)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 25."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 25)) { + throw new InvalidArgumentException('invalid length for $title when calling PaymentsCsvMappingColumn., must be smaller than or equal to 25.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling PaymentsCsvMappingColumn., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets isReferenceOnly + * + * @return bool|null + */ + public function getIsReferenceOnly(): ?bool + { + return $this->container['isReferenceOnly']; + } + + /** + * Sets isReferenceOnly + * + * @param bool|null $isReferenceOnly If set to true then no PayCode is mapped and this column is just for on-screen refernece only + * + * @return $this + */ + public function setIsReferenceOnly(?bool $isReferenceOnly): static + { + if (is_null($isReferenceOnly)) { + throw new InvalidArgumentException('non-nullable isReferenceOnly cannot be null'); + } + $this->container['isReferenceOnly'] = $isReferenceOnly; + + return $this; + } + + /** + * Gets colIndex + * + * @return int|null + */ + public function getColIndex(): ?int + { + return $this->container['colIndex']; + } + + /** + * Sets colIndex + * + * @param int|null $colIndex colIndex + * + * @return $this + */ + public function setColIndex(?int $colIndex): static + { + if (is_null($colIndex)) { + throw new InvalidArgumentException('non-nullable colIndex cannot be null'); + } + $this->container['colIndex'] = $colIndex; + + return $this; + } + + /** + * Gets isMultiplier + * + * @return bool|null + */ + public function getIsMultiplier(): ?bool + { + return $this->container['isMultiplier']; + } + + /** + * Sets isMultiplier + * + * @param bool|null $isMultiplier isMultiplier + * + * @return $this + */ + public function setIsMultiplier(?bool $isMultiplier): static + { + if (is_null($isMultiplier)) { + throw new InvalidArgumentException('non-nullable isMultiplier cannot be null'); + } + $this->container['isMultiplier'] = $isMultiplier; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross isNetToGross + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets rateColIndex + * + * @return int|null + */ + public function getRateColIndex(): ?int + { + return $this->container['rateColIndex']; + } + + /** + * Sets rateColIndex + * + * @param int|null $rateColIndex If the mapping IsMultiplier, then this optionally specifies another column from which to get the value + * + * @return $this + */ + public function setRateColIndex(?int $rateColIndex): static + { + if (is_null($rateColIndex)) { + array_push($this->openAPINullablesSetToNull, 'rateColIndex'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rateColIndex', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rateColIndex'] = $rateColIndex; + + return $this; + } + + /** + * Gets shouldSerializeRateColIndex + * + * @return bool|null + */ + public function getShouldSerializeRateColIndex(): ?bool + { + return $this->container['shouldSerializeRateColIndex']; + } + + /** + * Sets shouldSerializeRateColIndex + * + * @param bool|null $shouldSerializeRateColIndex shouldSerializeRateColIndex + * + * @return $this + */ + public function setShouldSerializeRateColIndex(?bool $shouldSerializeRateColIndex): static + { + if (is_null($shouldSerializeRateColIndex)) { + throw new InvalidArgumentException('non-nullable shouldSerializeRateColIndex cannot be null'); + } + $this->container['shouldSerializeRateColIndex'] = $shouldSerializeRateColIndex; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PaymentsCsvMappingType.php b/src/Model/PaymentsCsvMappingType.php new file mode 100644 index 0000000..789e443 --- /dev/null +++ b/src/Model/PaymentsCsvMappingType.php @@ -0,0 +1,45 @@ + + */ +class PayrollAnalysisCostBreakdownReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisCostBreakdownReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportLine[]', + 'payCodes' => '\SynergiTech\Staffology\Model\PayCode[]', + 'employeesPayRunTotals' => '\SynergiTech\Staffology\Model\EmployeePayRunTotal[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'payCodes' => null, + 'employeesPayRunTotals' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'payCodes' => true, + 'employeesPayRunTotals' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'payCodes' => 'payCodes', + 'employeesPayRunTotals' => 'employeesPayRunTotals', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'payCodes' => 'setPayCodes', + 'employeesPayRunTotals' => 'setEmployeesPayRunTotals', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'payCodes' => 'getPayCodes', + 'employeesPayRunTotals' => 'getEmployeesPayRunTotals', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('employeesPayRunTotals', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets payCodes + * + * @return \SynergiTech\Staffology\Model\PayCode[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param \SynergiTech\Staffology\Model\PayCode[]|null $payCodes payCodes + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets employeesPayRunTotals + * + * @return \SynergiTech\Staffology\Model\EmployeePayRunTotal[]|null + */ + public function getEmployeesPayRunTotals(): ?array + { + return $this->container['employeesPayRunTotals']; + } + + /** + * Sets employeesPayRunTotals + * + * @param \SynergiTech\Staffology\Model\EmployeePayRunTotal[]|null $employeesPayRunTotals employeesPayRunTotals + * + * @return $this + */ + public function setEmployeesPayRunTotals(?array $employeesPayRunTotals): static + { + if (is_null($employeesPayRunTotals)) { + array_push($this->openAPINullablesSetToNull, 'employeesPayRunTotals'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeesPayRunTotals', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeesPayRunTotals'] = $employeesPayRunTotals; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisCostBreakdownReportLine.php b/src/Model/PayrollAnalysisCostBreakdownReportLine.php new file mode 100644 index 0000000..d67c530 --- /dev/null +++ b/src/Model/PayrollAnalysisCostBreakdownReportLine.php @@ -0,0 +1,1232 @@ + + */ +class PayrollAnalysisCostBreakdownReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisCostBreakdownReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'lastName' => 'string', + 'department' => '\SynergiTech\Staffology\Model\StringDecimalKeyValuePair', + 'costCentre' => '\SynergiTech\Staffology\Model\StringDecimalKeyValuePair', + 'employeeRoleAnalysisCategory' => 'array', + 'lines' => '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportValue[]', + 'totalPay' => 'float', + 'niablePay' => 'float', + 'pensionPay' => 'float', + 'niPercent' => 'float', + 'ersNi' => 'float', + 'pensionPercent' => 'float', + 'ersPension' => 'float', + 'taxablePay' => 'float', + 'taxablePercent' => 'float', + 'employeeNi' => 'float', + 'taxPaid' => 'float', + 'studentLoan' => 'float', + 'employeePension' => 'float', + 'employeePensionContributionSalarySacrifice' => 'float', + 'employeePensionContributionReliefAtSource' => 'float', + 'pensionSummaryCostBreakdowns' => '\SynergiTech\Staffology\Model\PensionSummaryCostBreakdown[]', + 'roleId' => 'string', + 'roleWeightage' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'lastName' => null, + 'department' => null, + 'costCentre' => null, + 'employeeRoleAnalysisCategory' => null, + 'lines' => null, + 'totalPay' => 'double', + 'niablePay' => 'double', + 'pensionPay' => 'double', + 'niPercent' => 'double', + 'ersNi' => 'double', + 'pensionPercent' => 'double', + 'ersPension' => 'double', + 'taxablePay' => 'double', + 'taxablePercent' => 'double', + 'employeeNi' => 'double', + 'taxPaid' => 'double', + 'studentLoan' => 'double', + 'employeePension' => 'double', + 'employeePensionContributionSalarySacrifice' => 'double', + 'employeePensionContributionReliefAtSource' => 'double', + 'pensionSummaryCostBreakdowns' => null, + 'roleId' => 'uuid', + 'roleWeightage' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'lastName' => true, + 'department' => false, + 'costCentre' => false, + 'employeeRoleAnalysisCategory' => true, + 'lines' => true, + 'totalPay' => false, + 'niablePay' => false, + 'pensionPay' => false, + 'niPercent' => false, + 'ersNi' => false, + 'pensionPercent' => false, + 'ersPension' => false, + 'taxablePay' => false, + 'taxablePercent' => false, + 'employeeNi' => false, + 'taxPaid' => false, + 'studentLoan' => false, + 'employeePension' => false, + 'employeePensionContributionSalarySacrifice' => false, + 'employeePensionContributionReliefAtSource' => false, + 'pensionSummaryCostBreakdowns' => true, + 'roleId' => true, + 'roleWeightage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'lastName' => 'lastName', + 'department' => 'department', + 'costCentre' => 'costCentre', + 'employeeRoleAnalysisCategory' => 'employeeRoleAnalysisCategory', + 'lines' => 'lines', + 'totalPay' => 'totalPay', + 'niablePay' => 'niablePay', + 'pensionPay' => 'pensionPay', + 'niPercent' => 'niPercent', + 'ersNi' => 'ersNi', + 'pensionPercent' => 'pensionPercent', + 'ersPension' => 'ersPension', + 'taxablePay' => 'taxablePay', + 'taxablePercent' => 'taxablePercent', + 'employeeNi' => 'employeeNi', + 'taxPaid' => 'taxPaid', + 'studentLoan' => 'studentLoan', + 'employeePension' => 'employeePension', + 'employeePensionContributionSalarySacrifice' => 'employeePensionContributionSalarySacrifice', + 'employeePensionContributionReliefAtSource' => 'employeePensionContributionReliefAtSource', + 'pensionSummaryCostBreakdowns' => 'pensionSummaryCostBreakdowns', + 'roleId' => 'roleId', + 'roleWeightage' => 'roleWeightage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'lastName' => 'setLastName', + 'department' => 'setDepartment', + 'costCentre' => 'setCostCentre', + 'employeeRoleAnalysisCategory' => 'setEmployeeRoleAnalysisCategory', + 'lines' => 'setLines', + 'totalPay' => 'setTotalPay', + 'niablePay' => 'setNiablePay', + 'pensionPay' => 'setPensionPay', + 'niPercent' => 'setNiPercent', + 'ersNi' => 'setErsNi', + 'pensionPercent' => 'setPensionPercent', + 'ersPension' => 'setErsPension', + 'taxablePay' => 'setTaxablePay', + 'taxablePercent' => 'setTaxablePercent', + 'employeeNi' => 'setEmployeeNi', + 'taxPaid' => 'setTaxPaid', + 'studentLoan' => 'setStudentLoan', + 'employeePension' => 'setEmployeePension', + 'employeePensionContributionSalarySacrifice' => 'setEmployeePensionContributionSalarySacrifice', + 'employeePensionContributionReliefAtSource' => 'setEmployeePensionContributionReliefAtSource', + 'pensionSummaryCostBreakdowns' => 'setPensionSummaryCostBreakdowns', + 'roleId' => 'setRoleId', + 'roleWeightage' => 'setRoleWeightage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'lastName' => 'getLastName', + 'department' => 'getDepartment', + 'costCentre' => 'getCostCentre', + 'employeeRoleAnalysisCategory' => 'getEmployeeRoleAnalysisCategory', + 'lines' => 'getLines', + 'totalPay' => 'getTotalPay', + 'niablePay' => 'getNiablePay', + 'pensionPay' => 'getPensionPay', + 'niPercent' => 'getNiPercent', + 'ersNi' => 'getErsNi', + 'pensionPercent' => 'getPensionPercent', + 'ersPension' => 'getErsPension', + 'taxablePay' => 'getTaxablePay', + 'taxablePercent' => 'getTaxablePercent', + 'employeeNi' => 'getEmployeeNi', + 'taxPaid' => 'getTaxPaid', + 'studentLoan' => 'getStudentLoan', + 'employeePension' => 'getEmployeePension', + 'employeePensionContributionSalarySacrifice' => 'getEmployeePensionContributionSalarySacrifice', + 'employeePensionContributionReliefAtSource' => 'getEmployeePensionContributionReliefAtSource', + 'pensionSummaryCostBreakdowns' => 'getPensionSummaryCostBreakdowns', + 'roleId' => 'getRoleId', + 'roleWeightage' => 'getRoleWeightage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('costCentre', $data ?? [], null); + $this->setIfExists('employeeRoleAnalysisCategory', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('totalPay', $data ?? [], null); + $this->setIfExists('niablePay', $data ?? [], null); + $this->setIfExists('pensionPay', $data ?? [], null); + $this->setIfExists('niPercent', $data ?? [], null); + $this->setIfExists('ersNi', $data ?? [], null); + $this->setIfExists('pensionPercent', $data ?? [], null); + $this->setIfExists('ersPension', $data ?? [], null); + $this->setIfExists('taxablePay', $data ?? [], null); + $this->setIfExists('taxablePercent', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('taxPaid', $data ?? [], null); + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('employeePension', $data ?? [], null); + $this->setIfExists('employeePensionContributionSalarySacrifice', $data ?? [], null); + $this->setIfExists('employeePensionContributionReliefAtSource', $data ?? [], null); + $this->setIfExists('pensionSummaryCostBreakdowns', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('roleWeightage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets department + * + * @return \SynergiTech\Staffology\Model\StringDecimalKeyValuePair|null + */ + public function getDepartment(): ?\SynergiTech\Staffology\Model\StringDecimalKeyValuePair + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param \SynergiTech\Staffology\Model\StringDecimalKeyValuePair|null $department department + * + * @return $this + */ + public function setDepartment(?\SynergiTech\Staffology\Model\StringDecimalKeyValuePair $department): static + { + if (is_null($department)) { + throw new InvalidArgumentException('non-nullable department cannot be null'); + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets costCentre + * + * @return \SynergiTech\Staffology\Model\StringDecimalKeyValuePair|null + */ + public function getCostCentre(): ?\SynergiTech\Staffology\Model\StringDecimalKeyValuePair + { + return $this->container['costCentre']; + } + + /** + * Sets costCentre + * + * @param \SynergiTech\Staffology\Model\StringDecimalKeyValuePair|null $costCentre costCentre + * + * @return $this + */ + public function setCostCentre(?\SynergiTech\Staffology\Model\StringDecimalKeyValuePair $costCentre): static + { + if (is_null($costCentre)) { + throw new InvalidArgumentException('non-nullable costCentre cannot be null'); + } + $this->container['costCentre'] = $costCentre; + + return $this; + } + + /** + * Gets employeeRoleAnalysisCategory + * + * @return array|null + */ + public function getEmployeeRoleAnalysisCategory(): ?array + { + return $this->container['employeeRoleAnalysisCategory']; + } + + /** + * Sets employeeRoleAnalysisCategory + * + * @param array|null $employeeRoleAnalysisCategory employeeRoleAnalysisCategory + * + * @return $this + */ + public function setEmployeeRoleAnalysisCategory(?array $employeeRoleAnalysisCategory): static + { + if (is_null($employeeRoleAnalysisCategory)) { + array_push($this->openAPINullablesSetToNull, 'employeeRoleAnalysisCategory'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeRoleAnalysisCategory', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeRoleAnalysisCategory'] = $employeeRoleAnalysisCategory; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportValue[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReportValue[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets totalPay + * + * @return float|null + */ + public function getTotalPay(): ?float + { + return $this->container['totalPay']; + } + + /** + * Sets totalPay + * + * @param float|null $totalPay totalPay + * + * @return $this + */ + public function setTotalPay(?float $totalPay): static + { + if (is_null($totalPay)) { + throw new InvalidArgumentException('non-nullable totalPay cannot be null'); + } + $this->container['totalPay'] = $totalPay; + + return $this; + } + + /** + * Gets niablePay + * + * @return float|null + */ + public function getNiablePay(): ?float + { + return $this->container['niablePay']; + } + + /** + * Sets niablePay + * + * @param float|null $niablePay niablePay + * + * @return $this + */ + public function setNiablePay(?float $niablePay): static + { + if (is_null($niablePay)) { + throw new InvalidArgumentException('non-nullable niablePay cannot be null'); + } + $this->container['niablePay'] = $niablePay; + + return $this; + } + + /** + * Gets pensionPay + * + * @return float|null + */ + public function getPensionPay(): ?float + { + return $this->container['pensionPay']; + } + + /** + * Sets pensionPay + * + * @param float|null $pensionPay pensionPay + * + * @return $this + */ + public function setPensionPay(?float $pensionPay): static + { + if (is_null($pensionPay)) { + throw new InvalidArgumentException('non-nullable pensionPay cannot be null'); + } + $this->container['pensionPay'] = $pensionPay; + + return $this; + } + + /** + * Gets niPercent + * + * @return float|null + */ + public function getNiPercent(): ?float + { + return $this->container['niPercent']; + } + + /** + * Sets niPercent + * + * @param float|null $niPercent niPercent + * + * @return $this + */ + public function setNiPercent(?float $niPercent): static + { + if (is_null($niPercent)) { + throw new InvalidArgumentException('non-nullable niPercent cannot be null'); + } + $this->container['niPercent'] = $niPercent; + + return $this; + } + + /** + * Gets ersNi + * + * @return float|null + */ + public function getErsNi(): ?float + { + return $this->container['ersNi']; + } + + /** + * Sets ersNi + * + * @param float|null $ersNi ersNi + * + * @return $this + */ + public function setErsNi(?float $ersNi): static + { + if (is_null($ersNi)) { + throw new InvalidArgumentException('non-nullable ersNi cannot be null'); + } + $this->container['ersNi'] = $ersNi; + + return $this; + } + + /** + * Gets pensionPercent + * + * @return float|null + */ + public function getPensionPercent(): ?float + { + return $this->container['pensionPercent']; + } + + /** + * Sets pensionPercent + * + * @param float|null $pensionPercent pensionPercent + * + * @return $this + */ + public function setPensionPercent(?float $pensionPercent): static + { + if (is_null($pensionPercent)) { + throw new InvalidArgumentException('non-nullable pensionPercent cannot be null'); + } + $this->container['pensionPercent'] = $pensionPercent; + + return $this; + } + + /** + * Gets ersPension + * + * @return float|null + */ + public function getErsPension(): ?float + { + return $this->container['ersPension']; + } + + /** + * Sets ersPension + * + * @param float|null $ersPension ersPension + * + * @return $this + */ + public function setErsPension(?float $ersPension): static + { + if (is_null($ersPension)) { + throw new InvalidArgumentException('non-nullable ersPension cannot be null'); + } + $this->container['ersPension'] = $ersPension; + + return $this; + } + + /** + * Gets taxablePay + * + * @return float|null + */ + public function getTaxablePay(): ?float + { + return $this->container['taxablePay']; + } + + /** + * Sets taxablePay + * + * @param float|null $taxablePay taxablePay + * + * @return $this + */ + public function setTaxablePay(?float $taxablePay): static + { + if (is_null($taxablePay)) { + throw new InvalidArgumentException('non-nullable taxablePay cannot be null'); + } + $this->container['taxablePay'] = $taxablePay; + + return $this; + } + + /** + * Gets taxablePercent + * + * @return float|null + */ + public function getTaxablePercent(): ?float + { + return $this->container['taxablePercent']; + } + + /** + * Sets taxablePercent + * + * @param float|null $taxablePercent taxablePercent + * + * @return $this + */ + public function setTaxablePercent(?float $taxablePercent): static + { + if (is_null($taxablePercent)) { + throw new InvalidArgumentException('non-nullable taxablePercent cannot be null'); + } + $this->container['taxablePercent'] = $taxablePercent; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi employeeNi + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets taxPaid + * + * @return float|null + */ + public function getTaxPaid(): ?float + { + return $this->container['taxPaid']; + } + + /** + * Sets taxPaid + * + * @param float|null $taxPaid taxPaid + * + * @return $this + */ + public function setTaxPaid(?float $taxPaid): static + { + if (is_null($taxPaid)) { + throw new InvalidArgumentException('non-nullable taxPaid cannot be null'); + } + $this->container['taxPaid'] = $taxPaid; + + return $this; + } + + /** + * Gets studentLoan + * + * @return float|null + */ + public function getStudentLoan(): ?float + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param float|null $studentLoan studentLoan + * + * @return $this + */ + public function setStudentLoan(?float $studentLoan): static + { + if (is_null($studentLoan)) { + throw new InvalidArgumentException('non-nullable studentLoan cannot be null'); + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets employeePension + * + * @return float|null + */ + public function getEmployeePension(): ?float + { + return $this->container['employeePension']; + } + + /** + * Sets employeePension + * + * @param float|null $employeePension The value of the Pension Contribution(PENSION) being made by the Employee + * + * @return $this + */ + public function setEmployeePension(?float $employeePension): static + { + if (is_null($employeePension)) { + throw new InvalidArgumentException('non-nullable employeePension cannot be null'); + } + $this->container['employeePension'] = $employeePension; + + return $this; + } + + /** + * Gets employeePensionContributionSalarySacrifice + * + * @return float|null + */ + public function getEmployeePensionContributionSalarySacrifice(): ?float + { + return $this->container['employeePensionContributionSalarySacrifice']; + } + + /** + * Sets employeePensionContributionSalarySacrifice + * + * @param float|null $employeePensionContributionSalarySacrifice The value of the Pension Contribution Salary Sacrifice(PENSIONSS) being made by the Employee + * + * @return $this + */ + public function setEmployeePensionContributionSalarySacrifice(?float $employeePensionContributionSalarySacrifice): static + { + if (is_null($employeePensionContributionSalarySacrifice)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionSalarySacrifice cannot be null'); + } + $this->container['employeePensionContributionSalarySacrifice'] = $employeePensionContributionSalarySacrifice; + + return $this; + } + + /** + * Gets employeePensionContributionReliefAtSource + * + * @return float|null + */ + public function getEmployeePensionContributionReliefAtSource(): ?float + { + return $this->container['employeePensionContributionReliefAtSource']; + } + + /** + * Sets employeePensionContributionReliefAtSource + * + * @param float|null $employeePensionContributionReliefAtSource The value of the Pension Contribution Relief At Source(PENSIONRAS) being made by the Employee + * + * @return $this + */ + public function setEmployeePensionContributionReliefAtSource(?float $employeePensionContributionReliefAtSource): static + { + if (is_null($employeePensionContributionReliefAtSource)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionReliefAtSource cannot be null'); + } + $this->container['employeePensionContributionReliefAtSource'] = $employeePensionContributionReliefAtSource; + + return $this; + } + + /** + * Gets pensionSummaryCostBreakdowns + * + * @return \SynergiTech\Staffology\Model\PensionSummaryCostBreakdown[]|null + */ + public function getPensionSummaryCostBreakdowns(): ?array + { + return $this->container['pensionSummaryCostBreakdowns']; + } + + /** + * Sets pensionSummaryCostBreakdowns + * + * @param \SynergiTech\Staffology\Model\PensionSummaryCostBreakdown[]|null $pensionSummaryCostBreakdowns List of pension summaries, each representing a breakdown of various pension components + * + * @return $this + */ + public function setPensionSummaryCostBreakdowns(?array $pensionSummaryCostBreakdowns): static + { + if (is_null($pensionSummaryCostBreakdowns)) { + array_push($this->openAPINullablesSetToNull, 'pensionSummaryCostBreakdowns'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionSummaryCostBreakdowns', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionSummaryCostBreakdowns'] = $pensionSummaryCostBreakdowns; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId RoleId of that particular line entry + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets roleWeightage + * + * @return float|null + */ + public function getRoleWeightage(): ?float + { + return $this->container['roleWeightage']; + } + + /** + * Sets roleWeightage + * + * @param float|null $roleWeightage Weightage value of the given employee role + * + * @return $this + */ + public function setRoleWeightage(?float $roleWeightage): static + { + if (is_null($roleWeightage)) { + throw new InvalidArgumentException('non-nullable roleWeightage cannot be null'); + } + $this->container['roleWeightage'] = $roleWeightage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisCostBreakdownReportReportResponse.php b/src/Model/PayrollAnalysisCostBreakdownReportReportResponse.php new file mode 100644 index 0000000..a5826b1 --- /dev/null +++ b/src/Model/PayrollAnalysisCostBreakdownReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PayrollAnalysisCostBreakdownReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisCostBreakdownReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PayrollAnalysisCostBreakdownReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisCostBreakdownReportValue.php b/src/Model/PayrollAnalysisCostBreakdownReportValue.php new file mode 100644 index 0000000..62df598 --- /dev/null +++ b/src/Model/PayrollAnalysisCostBreakdownReportValue.php @@ -0,0 +1,490 @@ + + */ +class PayrollAnalysisCostBreakdownReportValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisCostBreakdownReportValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'qty' => 'float', + 'code' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'qty' => 'double', + 'code' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'qty' => true, + 'code' => true, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'qty' => 'qty', + 'code' => 'code', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'qty' => 'setQty', + 'code' => 'setCode', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'qty' => 'getQty', + 'code' => 'getCode', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('qty', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets qty + * + * @return float|null + */ + public function getQty(): ?float + { + return $this->container['qty']; + } + + /** + * Sets qty + * + * @param float|null $qty qty + * + * @return $this + */ + public function setQty(?float $qty): static + { + if (is_null($qty)) { + array_push($this->openAPINullablesSetToNull, 'qty'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qty', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qty'] = $qty; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisEmployeeRoleBreakdownReport.php b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReport.php new file mode 100644 index 0000000..c530a04 --- /dev/null +++ b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReport.php @@ -0,0 +1,919 @@ + + */ +class PayrollAnalysisEmployeeRoleBreakdownReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisEmployeeRoleBreakdownReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLine[]', + 'payCodes' => '\SynergiTech\Staffology\Model\PayCode[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'payCodes' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'payCodes' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'payCodes' => 'payCodes', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'payCodes' => 'setPayCodes', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'payCodes' => 'getPayCodes', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets payCodes + * + * @return \SynergiTech\Staffology\Model\PayCode[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param \SynergiTech\Staffology\Model\PayCode[]|null $payCodes payCodes + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.php b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.php new file mode 100644 index 0000000..5f3d90a --- /dev/null +++ b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLine.php @@ -0,0 +1,789 @@ + + */ +class PayrollAnalysisEmployeeRoleBreakdownReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisEmployeeRoleBreakdownReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'fullEmployee' => '\SynergiTech\Staffology\Model\Employee', + 'employeeRole' => '\SynergiTech\Staffology\Model\Item', + 'department' => '\SynergiTech\Staffology\Model\DepartmentMembership', + 'gross' => 'float', + 'niableGross' => 'float', + 'net' => 'float', + 'takeHome' => 'float', + 'employerNic' => 'float', + 'showQtyColumn' => 'bool', + 'lines' => '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLineValue[]', + 'ersPension' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'fullEmployee' => null, + 'employeeRole' => null, + 'department' => null, + 'gross' => 'double', + 'niableGross' => 'double', + 'net' => 'double', + 'takeHome' => 'double', + 'employerNic' => 'double', + 'showQtyColumn' => null, + 'lines' => null, + 'ersPension' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'fullEmployee' => false, + 'employeeRole' => false, + 'department' => false, + 'gross' => false, + 'niableGross' => false, + 'net' => false, + 'takeHome' => false, + 'employerNic' => false, + 'showQtyColumn' => false, + 'lines' => true, + 'ersPension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'fullEmployee' => 'fullEmployee', + 'employeeRole' => 'employeeRole', + 'department' => 'department', + 'gross' => 'gross', + 'niableGross' => 'niableGross', + 'net' => 'net', + 'takeHome' => 'takeHome', + 'employerNic' => 'employerNic', + 'showQtyColumn' => 'showQtyColumn', + 'lines' => 'lines', + 'ersPension' => 'ersPension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'fullEmployee' => 'setFullEmployee', + 'employeeRole' => 'setEmployeeRole', + 'department' => 'setDepartment', + 'gross' => 'setGross', + 'niableGross' => 'setNiableGross', + 'net' => 'setNet', + 'takeHome' => 'setTakeHome', + 'employerNic' => 'setEmployerNic', + 'showQtyColumn' => 'setShowQtyColumn', + 'lines' => 'setLines', + 'ersPension' => 'setErsPension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'fullEmployee' => 'getFullEmployee', + 'employeeRole' => 'getEmployeeRole', + 'department' => 'getDepartment', + 'gross' => 'getGross', + 'niableGross' => 'getNiableGross', + 'net' => 'getNet', + 'takeHome' => 'getTakeHome', + 'employerNic' => 'getEmployerNic', + 'showQtyColumn' => 'getShowQtyColumn', + 'lines' => 'getLines', + 'ersPension' => 'getErsPension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('fullEmployee', $data ?? [], null); + $this->setIfExists('employeeRole', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('gross', $data ?? [], null); + $this->setIfExists('niableGross', $data ?? [], null); + $this->setIfExists('net', $data ?? [], null); + $this->setIfExists('takeHome', $data ?? [], null); + $this->setIfExists('employerNic', $data ?? [], null); + $this->setIfExists('showQtyColumn', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('ersPension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets fullEmployee + * + * @return \SynergiTech\Staffology\Model\Employee|null + */ + public function getFullEmployee(): ?\SynergiTech\Staffology\Model\Employee + { + return $this->container['fullEmployee']; + } + + /** + * Sets fullEmployee + * + * @param \SynergiTech\Staffology\Model\Employee|null $fullEmployee fullEmployee + * + * @return $this + */ + public function setFullEmployee(?\SynergiTech\Staffology\Model\Employee $fullEmployee): static + { + if (is_null($fullEmployee)) { + throw new InvalidArgumentException('non-nullable fullEmployee cannot be null'); + } + $this->container['fullEmployee'] = $fullEmployee; + + return $this; + } + + /** + * Gets employeeRole + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployeeRole(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employeeRole']; + } + + /** + * Sets employeeRole + * + * @param \SynergiTech\Staffology\Model\Item|null $employeeRole employeeRole + * + * @return $this + */ + public function setEmployeeRole(?\SynergiTech\Staffology\Model\Item $employeeRole): static + { + if (is_null($employeeRole)) { + throw new InvalidArgumentException('non-nullable employeeRole cannot be null'); + } + $this->container['employeeRole'] = $employeeRole; + + return $this; + } + + /** + * Gets department + * + * @return \SynergiTech\Staffology\Model\DepartmentMembership|null + */ + public function getDepartment(): ?\SynergiTech\Staffology\Model\DepartmentMembership + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param \SynergiTech\Staffology\Model\DepartmentMembership|null $department department + * + * @return $this + */ + public function setDepartment(?\SynergiTech\Staffology\Model\DepartmentMembership $department): static + { + if (is_null($department)) { + throw new InvalidArgumentException('non-nullable department cannot be null'); + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets gross + * + * @return float|null + */ + public function getGross(): ?float + { + return $this->container['gross']; + } + + /** + * Sets gross + * + * @param float|null $gross gross + * + * @return $this + */ + public function setGross(?float $gross): static + { + if (is_null($gross)) { + throw new InvalidArgumentException('non-nullable gross cannot be null'); + } + $this->container['gross'] = $gross; + + return $this; + } + + /** + * Gets niableGross + * + * @return float|null + */ + public function getNiableGross(): ?float + { + return $this->container['niableGross']; + } + + /** + * Sets niableGross + * + * @param float|null $niableGross niableGross + * + * @return $this + */ + public function setNiableGross(?float $niableGross): static + { + if (is_null($niableGross)) { + throw new InvalidArgumentException('non-nullable niableGross cannot be null'); + } + $this->container['niableGross'] = $niableGross; + + return $this; + } + + /** + * Gets net + * + * @return float|null + */ + public function getNet(): ?float + { + return $this->container['net']; + } + + /** + * Sets net + * + * @param float|null $net net + * + * @return $this + */ + public function setNet(?float $net): static + { + if (is_null($net)) { + throw new InvalidArgumentException('non-nullable net cannot be null'); + } + $this->container['net'] = $net; + + return $this; + } + + /** + * Gets takeHome + * + * @return float|null + */ + public function getTakeHome(): ?float + { + return $this->container['takeHome']; + } + + /** + * Sets takeHome + * + * @param float|null $takeHome takeHome + * + * @return $this + */ + public function setTakeHome(?float $takeHome): static + { + if (is_null($takeHome)) { + throw new InvalidArgumentException('non-nullable takeHome cannot be null'); + } + $this->container['takeHome'] = $takeHome; + + return $this; + } + + /** + * Gets employerNic + * + * @return float|null + */ + public function getEmployerNic(): ?float + { + return $this->container['employerNic']; + } + + /** + * Sets employerNic + * + * @param float|null $employerNic employerNic + * + * @return $this + */ + public function setEmployerNic(?float $employerNic): static + { + if (is_null($employerNic)) { + throw new InvalidArgumentException('non-nullable employerNic cannot be null'); + } + $this->container['employerNic'] = $employerNic; + + return $this; + } + + /** + * Gets showQtyColumn + * + * @return bool|null + */ + public function getShowQtyColumn(): ?bool + { + return $this->container['showQtyColumn']; + } + + /** + * Sets showQtyColumn + * + * @param bool|null $showQtyColumn showQtyColumn + * + * @return $this + */ + public function setShowQtyColumn(?bool $showQtyColumn): static + { + if (is_null($showQtyColumn)) { + throw new InvalidArgumentException('non-nullable showQtyColumn cannot be null'); + } + $this->container['showQtyColumn'] = $showQtyColumn; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLineValue[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReportLineValue[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets ersPension + * + * @return float|null + */ + public function getErsPension(): ?float + { + return $this->container['ersPension']; + } + + /** + * Sets ersPension + * + * @param float|null $ersPension ersPension + * + * @return $this + */ + public function setErsPension(?float $ersPension): static + { + if (is_null($ersPension)) { + throw new InvalidArgumentException('non-nullable ersPension cannot be null'); + } + $this->container['ersPension'] = $ersPension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.php b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.php new file mode 100644 index 0000000..901e0fe --- /dev/null +++ b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportLineValue.php @@ -0,0 +1,490 @@ + + */ +class PayrollAnalysisEmployeeRoleBreakdownReportLineValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisEmployeeRoleBreakdownReportLineValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'qty' => 'float', + 'code' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'qty' => 'double', + 'code' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'qty' => true, + 'code' => true, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'qty' => 'qty', + 'code' => 'code', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'qty' => 'setQty', + 'code' => 'setCode', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'qty' => 'getQty', + 'code' => 'getCode', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('qty', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets qty + * + * @return float|null + */ + public function getQty(): ?float + { + return $this->container['qty']; + } + + /** + * Sets qty + * + * @param float|null $qty qty + * + * @return $this + */ + public function setQty(?float $qty): static + { + if (is_null($qty)) { + array_push($this->openAPINullablesSetToNull, 'qty'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qty', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qty'] = $qty; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.php b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.php new file mode 100644 index 0000000..88c53b7 --- /dev/null +++ b/src/Model/PayrollAnalysisEmployeeRoleBreakdownReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PayrollAnalysisEmployeeRoleBreakdownReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrollAnalysisEmployeeRoleBreakdownReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PayrollAnalysisEmployeeRoleBreakdownReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrollValueType.php b/src/Model/PayrollValueType.php new file mode 100644 index 0000000..603fdab --- /dev/null +++ b/src/Model/PayrollValueType.php @@ -0,0 +1,167 @@ + + */ +class PayrunEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrunEmail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isActive' => 'bool', + 'name' => 'string', + 'templateType' => '\SynergiTech\Staffology\Model\EmployerTemplateType', + 'recipientAddress' => 'string', + 'pdfPassword' => 'string', + 'attachPayslips' => 'bool', + 'payslipsUnemailed' => 'bool', + 'payslipsSingleFile' => 'bool', + 'attachPaymentSummary' => 'bool', + 'attachP32' => 'bool', + 'attachP30' => 'bool', + 'attachGrossToNet' => 'bool', + 'attachPensionContributions' => 'bool', + 'attachCostAnalysis' => 'bool', + 'attachCostOfEmployment' => 'bool', + 'attachFullSummaryOfPay' => 'bool', + 'attachBankPayments' => 'bool', + 'customSubject' => 'string', + 'customBody' => 'string', + 'customBodyIsHtml' => 'bool', + 'childId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isActive' => null, + 'name' => null, + 'templateType' => null, + 'recipientAddress' => 'email', + 'pdfPassword' => null, + 'attachPayslips' => null, + 'payslipsUnemailed' => null, + 'payslipsSingleFile' => null, + 'attachPaymentSummary' => null, + 'attachP32' => null, + 'attachP30' => null, + 'attachGrossToNet' => null, + 'attachPensionContributions' => null, + 'attachCostAnalysis' => null, + 'attachCostOfEmployment' => null, + 'attachFullSummaryOfPay' => null, + 'attachBankPayments' => null, + 'customSubject' => null, + 'customBody' => null, + 'customBodyIsHtml' => null, + 'childId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isActive' => false, + 'name' => false, + 'templateType' => false, + 'recipientAddress' => false, + 'pdfPassword' => true, + 'attachPayslips' => false, + 'payslipsUnemailed' => false, + 'payslipsSingleFile' => false, + 'attachPaymentSummary' => false, + 'attachP32' => false, + 'attachP30' => false, + 'attachGrossToNet' => false, + 'attachPensionContributions' => false, + 'attachCostAnalysis' => false, + 'attachCostOfEmployment' => false, + 'attachFullSummaryOfPay' => false, + 'attachBankPayments' => false, + 'customSubject' => true, + 'customBody' => true, + 'customBodyIsHtml' => false, + 'childId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isActive' => 'isActive', + 'name' => 'name', + 'templateType' => 'templateType', + 'recipientAddress' => 'recipientAddress', + 'pdfPassword' => 'pdfPassword', + 'attachPayslips' => 'attachPayslips', + 'payslipsUnemailed' => 'payslips_Unemailed', + 'payslipsSingleFile' => 'payslips_SingleFile', + 'attachPaymentSummary' => 'attachPaymentSummary', + 'attachP32' => 'attachP32', + 'attachP30' => 'attachP30', + 'attachGrossToNet' => 'attachGrossToNet', + 'attachPensionContributions' => 'attachPensionContributions', + 'attachCostAnalysis' => 'attachCostAnalysis', + 'attachCostOfEmployment' => 'attachCostOfEmployment', + 'attachFullSummaryOfPay' => 'attachFullSummaryOfPay', + 'attachBankPayments' => 'attachBankPayments', + 'customSubject' => 'customSubject', + 'customBody' => 'customBody', + 'customBodyIsHtml' => 'customBody_IsHtml', + 'childId' => 'childId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isActive' => 'setIsActive', + 'name' => 'setName', + 'templateType' => 'setTemplateType', + 'recipientAddress' => 'setRecipientAddress', + 'pdfPassword' => 'setPdfPassword', + 'attachPayslips' => 'setAttachPayslips', + 'payslipsUnemailed' => 'setPayslipsUnemailed', + 'payslipsSingleFile' => 'setPayslipsSingleFile', + 'attachPaymentSummary' => 'setAttachPaymentSummary', + 'attachP32' => 'setAttachP32', + 'attachP30' => 'setAttachP30', + 'attachGrossToNet' => 'setAttachGrossToNet', + 'attachPensionContributions' => 'setAttachPensionContributions', + 'attachCostAnalysis' => 'setAttachCostAnalysis', + 'attachCostOfEmployment' => 'setAttachCostOfEmployment', + 'attachFullSummaryOfPay' => 'setAttachFullSummaryOfPay', + 'attachBankPayments' => 'setAttachBankPayments', + 'customSubject' => 'setCustomSubject', + 'customBody' => 'setCustomBody', + 'customBodyIsHtml' => 'setCustomBodyIsHtml', + 'childId' => 'setChildId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isActive' => 'getIsActive', + 'name' => 'getName', + 'templateType' => 'getTemplateType', + 'recipientAddress' => 'getRecipientAddress', + 'pdfPassword' => 'getPdfPassword', + 'attachPayslips' => 'getAttachPayslips', + 'payslipsUnemailed' => 'getPayslipsUnemailed', + 'payslipsSingleFile' => 'getPayslipsSingleFile', + 'attachPaymentSummary' => 'getAttachPaymentSummary', + 'attachP32' => 'getAttachP32', + 'attachP30' => 'getAttachP30', + 'attachGrossToNet' => 'getAttachGrossToNet', + 'attachPensionContributions' => 'getAttachPensionContributions', + 'attachCostAnalysis' => 'getAttachCostAnalysis', + 'attachCostOfEmployment' => 'getAttachCostOfEmployment', + 'attachFullSummaryOfPay' => 'getAttachFullSummaryOfPay', + 'attachBankPayments' => 'getAttachBankPayments', + 'customSubject' => 'getCustomSubject', + 'customBody' => 'getCustomBody', + 'customBodyIsHtml' => 'getCustomBodyIsHtml', + 'childId' => 'getChildId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isActive', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('templateType', $data ?? [], null); + $this->setIfExists('recipientAddress', $data ?? [], null); + $this->setIfExists('pdfPassword', $data ?? [], null); + $this->setIfExists('attachPayslips', $data ?? [], null); + $this->setIfExists('payslipsUnemailed', $data ?? [], null); + $this->setIfExists('payslipsSingleFile', $data ?? [], null); + $this->setIfExists('attachPaymentSummary', $data ?? [], null); + $this->setIfExists('attachP32', $data ?? [], null); + $this->setIfExists('attachP30', $data ?? [], null); + $this->setIfExists('attachGrossToNet', $data ?? [], null); + $this->setIfExists('attachPensionContributions', $data ?? [], null); + $this->setIfExists('attachCostAnalysis', $data ?? [], null); + $this->setIfExists('attachCostOfEmployment', $data ?? [], null); + $this->setIfExists('attachFullSummaryOfPay', $data ?? [], null); + $this->setIfExists('attachBankPayments', $data ?? [], null); + $this->setIfExists('customSubject', $data ?? [], null); + $this->setIfExists('customBody', $data ?? [], null); + $this->setIfExists('customBodyIsHtml', $data ?? [], null); + $this->setIfExists('childId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 75)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 75."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if ($this->container['recipientAddress'] === null) { + $invalidProperties[] = "'recipientAddress' can't be null"; + } + if ((mb_strlen($this->container['recipientAddress']) > 150)) { + $invalidProperties[] = "invalid value for 'recipientAddress', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['recipientAddress']) < 1)) { + $invalidProperties[] = "invalid value for 'recipientAddress', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['pdfPassword']) && (mb_strlen($this->container['pdfPassword']) > 50)) { + $invalidProperties[] = "invalid value for 'pdfPassword', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['customSubject']) && (mb_strlen($this->container['customSubject']) > 200)) { + $invalidProperties[] = "invalid value for 'customSubject', the character length must be smaller than or equal to 200."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isActive + * + * @return bool|null + */ + public function getIsActive(): ?bool + { + return $this->container['isActive']; + } + + /** + * Sets isActive + * + * @param bool|null $isActive If false then this email won't be sent + * + * @return $this + */ + public function setIsActive(?bool $isActive): static + { + if (is_null($isActive)) { + throw new InvalidArgumentException('non-nullable isActive cannot be null'); + } + $this->container['isActive'] = $isActive; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Only used for reference, not included in the email + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 75)) { + throw new InvalidArgumentException('invalid length for $name when calling PayrunEmail., must be smaller than or equal to 75.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling PayrunEmail., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets templateType + * + * @return \SynergiTech\Staffology\Model\EmployerTemplateType|null + */ + public function getTemplateType(): ?\SynergiTech\Staffology\Model\EmployerTemplateType + { + return $this->container['templateType']; + } + + /** + * Sets templateType + * + * @param \SynergiTech\Staffology\Model\EmployerTemplateType|null $templateType templateType + * + * @return $this + */ + public function setTemplateType(?\SynergiTech\Staffology\Model\EmployerTemplateType $templateType): static + { + if (is_null($templateType)) { + throw new InvalidArgumentException('non-nullable templateType cannot be null'); + } + $this->container['templateType'] = $templateType; + + return $this; + } + + /** + * Gets recipientAddress + * + * @return string + */ + public function getRecipientAddress(): string + { + return $this->container['recipientAddress']; + } + + /** + * Sets recipientAddress + * + * @param string $recipientAddress The address to which the email should be sent + * + * @return $this + */ + public function setRecipientAddress(string $recipientAddress): static + { + if (is_null($recipientAddress)) { + throw new InvalidArgumentException('non-nullable recipientAddress cannot be null'); + } + if ((mb_strlen($recipientAddress) > 150)) { + throw new InvalidArgumentException('invalid length for $recipientAddress when calling PayrunEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($recipientAddress) < 1)) { + throw new InvalidArgumentException('invalid length for $recipientAddress when calling PayrunEmail., must be bigger than or equal to 1.'); + } + + $this->container['recipientAddress'] = $recipientAddress; + + return $this; + } + + /** + * Gets pdfPassword + * + * @return string|null + */ + public function getPdfPassword(): ?string + { + return $this->container['pdfPassword']; + } + + /** + * Sets pdfPassword + * + * @param string|null $pdfPassword If a value is provided, then all PDFs attached to the email will be encrypted using this password + * + * @return $this + */ + public function setPdfPassword(?string $pdfPassword): static + { + if (is_null($pdfPassword)) { + array_push($this->openAPINullablesSetToNull, 'pdfPassword'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdfPassword', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($pdfPassword) && (mb_strlen($pdfPassword) > 50)) { + throw new InvalidArgumentException('invalid length for $pdfPassword when calling PayrunEmail., must be smaller than or equal to 50.'); + } + + $this->container['pdfPassword'] = $pdfPassword; + + return $this; + } + + /** + * Gets attachPayslips + * + * @return bool|null + */ + public function getAttachPayslips(): ?bool + { + return $this->container['attachPayslips']; + } + + /** + * Sets attachPayslips + * + * @param bool|null $attachPayslips If set to true then Payslips will be attached to the email + * + * @return $this + */ + public function setAttachPayslips(?bool $attachPayslips): static + { + if (is_null($attachPayslips)) { + throw new InvalidArgumentException('non-nullable attachPayslips cannot be null'); + } + $this->container['attachPayslips'] = $attachPayslips; + + return $this; + } + + /** + * Gets payslipsUnemailed + * + * @return bool|null + */ + public function getPayslipsUnemailed(): ?bool + { + return $this->container['payslipsUnemailed']; + } + + /** + * Sets payslipsUnemailed + * + * @param bool|null $payslipsUnemailed If AttachPayslips is true and this property is also true then only payslips that haven't already been sent directly to employees will be attached. + * + * @return $this + */ + public function setPayslipsUnemailed(?bool $payslipsUnemailed): static + { + if (is_null($payslipsUnemailed)) { + throw new InvalidArgumentException('non-nullable payslipsUnemailed cannot be null'); + } + $this->container['payslipsUnemailed'] = $payslipsUnemailed; + + return $this; + } + + /** + * Gets payslipsSingleFile + * + * @return bool|null + */ + public function getPayslipsSingleFile(): ?bool + { + return $this->container['payslipsSingleFile']; + } + + /** + * Sets payslipsSingleFile + * + * @param bool|null $payslipsSingleFile If AttachPayslips is true and this property is also true then the payslips will be attached as a single file rather than as separate PDFs, + * + * @return $this + */ + public function setPayslipsSingleFile(?bool $payslipsSingleFile): static + { + if (is_null($payslipsSingleFile)) { + throw new InvalidArgumentException('non-nullable payslipsSingleFile cannot be null'); + } + $this->container['payslipsSingleFile'] = $payslipsSingleFile; + + return $this; + } + + /** + * Gets attachPaymentSummary + * + * @return bool|null + */ + public function getAttachPaymentSummary(): ?bool + { + return $this->container['attachPaymentSummary']; + } + + /** + * Sets attachPaymentSummary + * + * @param bool|null $attachPaymentSummary If set to True then the PaymentSummary report will be attached to the Email + * + * @return $this + */ + public function setAttachPaymentSummary(?bool $attachPaymentSummary): static + { + if (is_null($attachPaymentSummary)) { + throw new InvalidArgumentException('non-nullable attachPaymentSummary cannot be null'); + } + $this->container['attachPaymentSummary'] = $attachPaymentSummary; + + return $this; + } + + /** + * Gets attachP32 + * + * @return bool|null + */ + public function getAttachP32(): ?bool + { + return $this->container['attachP32']; + } + + /** + * Sets attachP32 + * + * @param bool|null $attachP32 If set to True then the P32 report will be attached to the email + * + * @return $this + */ + public function setAttachP32(?bool $attachP32): static + { + if (is_null($attachP32)) { + throw new InvalidArgumentException('non-nullable attachP32 cannot be null'); + } + $this->container['attachP32'] = $attachP32; + + return $this; + } + + /** + * Gets attachP30 + * + * @return bool|null + */ + public function getAttachP30(): ?bool + { + return $this->container['attachP30']; + } + + /** + * Sets attachP30 + * + * @param bool|null $attachP30 If set to True then the P30 report will be attached to the email + * + * @return $this + */ + public function setAttachP30(?bool $attachP30): static + { + if (is_null($attachP30)) { + throw new InvalidArgumentException('non-nullable attachP30 cannot be null'); + } + $this->container['attachP30'] = $attachP30; + + return $this; + } + + /** + * Gets attachGrossToNet + * + * @return bool|null + */ + public function getAttachGrossToNet(): ?bool + { + return $this->container['attachGrossToNet']; + } + + /** + * Sets attachGrossToNet + * + * @param bool|null $attachGrossToNet If set to True then the GrossToNet report will be attached to the email + * + * @return $this + */ + public function setAttachGrossToNet(?bool $attachGrossToNet): static + { + if (is_null($attachGrossToNet)) { + throw new InvalidArgumentException('non-nullable attachGrossToNet cannot be null'); + } + $this->container['attachGrossToNet'] = $attachGrossToNet; + + return $this; + } + + /** + * Gets attachPensionContributions + * + * @return bool|null + */ + public function getAttachPensionContributions(): ?bool + { + return $this->container['attachPensionContributions']; + } + + /** + * Sets attachPensionContributions + * + * @param bool|null $attachPensionContributions If set to True then the Pensions Contributions report will be attached to the email + * + * @return $this + */ + public function setAttachPensionContributions(?bool $attachPensionContributions): static + { + if (is_null($attachPensionContributions)) { + throw new InvalidArgumentException('non-nullable attachPensionContributions cannot be null'); + } + $this->container['attachPensionContributions'] = $attachPensionContributions; + + return $this; + } + + /** + * Gets attachCostAnalysis + * + * @return bool|null + */ + public function getAttachCostAnalysis(): ?bool + { + return $this->container['attachCostAnalysis']; + } + + /** + * Sets attachCostAnalysis + * + * @param bool|null $attachCostAnalysis If set to True then the Cost Analysis report will be attached to the email + * + * @return $this + */ + public function setAttachCostAnalysis(?bool $attachCostAnalysis): static + { + if (is_null($attachCostAnalysis)) { + throw new InvalidArgumentException('non-nullable attachCostAnalysis cannot be null'); + } + $this->container['attachCostAnalysis'] = $attachCostAnalysis; + + return $this; + } + + /** + * Gets attachCostOfEmployment + * + * @return bool|null + */ + public function getAttachCostOfEmployment(): ?bool + { + return $this->container['attachCostOfEmployment']; + } + + /** + * Sets attachCostOfEmployment + * + * @param bool|null $attachCostOfEmployment If set to True then the Cost of Employment report will be attached to the email + * + * @return $this + */ + public function setAttachCostOfEmployment(?bool $attachCostOfEmployment): static + { + if (is_null($attachCostOfEmployment)) { + throw new InvalidArgumentException('non-nullable attachCostOfEmployment cannot be null'); + } + $this->container['attachCostOfEmployment'] = $attachCostOfEmployment; + + return $this; + } + + /** + * Gets attachFullSummaryOfPay + * + * @return bool|null + */ + public function getAttachFullSummaryOfPay(): ?bool + { + return $this->container['attachFullSummaryOfPay']; + } + + /** + * Sets attachFullSummaryOfPay + * + * @param bool|null $attachFullSummaryOfPay If set to True then the Full Summary Of Payment report will be attached to the email + * + * @return $this + */ + public function setAttachFullSummaryOfPay(?bool $attachFullSummaryOfPay): static + { + if (is_null($attachFullSummaryOfPay)) { + throw new InvalidArgumentException('non-nullable attachFullSummaryOfPay cannot be null'); + } + $this->container['attachFullSummaryOfPay'] = $attachFullSummaryOfPay; + + return $this; + } + + /** + * Gets attachBankPayments + * + * @return bool|null + */ + public function getAttachBankPayments(): ?bool + { + return $this->container['attachBankPayments']; + } + + /** + * Sets attachBankPayments + * + * @param bool|null $attachBankPayments If set to True then the Bank Payments CSV file will be attached to the email + * + * @return $this + */ + public function setAttachBankPayments(?bool $attachBankPayments): static + { + if (is_null($attachBankPayments)) { + throw new InvalidArgumentException('non-nullable attachBankPayments cannot be null'); + } + $this->container['attachBankPayments'] = $attachBankPayments; + + return $this; + } + + /** + * Gets customSubject + * + * @return string|null + */ + public function getCustomSubject(): ?string + { + return $this->container['customSubject']; + } + + /** + * Sets customSubject + * + * @param string|null $customSubject If TemplateType is null then you can provide a subject line here to be used for the email + * + * @return $this + */ + public function setCustomSubject(?string $customSubject): static + { + if (is_null($customSubject)) { + array_push($this->openAPINullablesSetToNull, 'customSubject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customSubject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($customSubject) && (mb_strlen($customSubject) > 200)) { + throw new InvalidArgumentException('invalid length for $customSubject when calling PayrunEmail., must be smaller than or equal to 200.'); + } + + $this->container['customSubject'] = $customSubject; + + return $this; + } + + /** + * Gets customBody + * + * @return string|null + */ + public function getCustomBody(): ?string + { + return $this->container['customBody']; + } + + /** + * Sets customBody + * + * @param string|null $customBody If TemplateType is null then you can provide the body text here to be used for the email + * + * @return $this + */ + public function setCustomBody(?string $customBody): static + { + if (is_null($customBody)) { + array_push($this->openAPINullablesSetToNull, 'customBody'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customBody', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customBody'] = $customBody; + + return $this; + } + + /** + * Gets customBodyIsHtml + * + * @return bool|null + */ + public function getCustomBodyIsHtml(): ?bool + { + return $this->container['customBodyIsHtml']; + } + + /** + * Sets customBodyIsHtml + * + * @param bool|null $customBodyIsHtml If the CustomBody is in HTML format, set this to true. + * + * @return $this + */ + public function setCustomBodyIsHtml(?bool $customBodyIsHtml): static + { + if (is_null($customBodyIsHtml)) { + throw new InvalidArgumentException('non-nullable customBodyIsHtml cannot be null'); + } + $this->container['customBodyIsHtml'] = $customBodyIsHtml; + + return $this; + } + + /** + * Gets childId + * + * @return string|null + */ + public function getChildId(): ?string + { + return $this->container['childId']; + } + + /** + * Sets childId + * + * @param string|null $childId This is nothing but the UniqueId of the model. + * + * @return $this + */ + public function setChildId(?string $childId): static + { + if (is_null($childId)) { + throw new InvalidArgumentException('non-nullable childId cannot be null'); + } + $this->container['childId'] = $childId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrunPaymentsReport.php b/src/Model/PayrunPaymentsReport.php new file mode 100644 index 0000000..eed38a1 --- /dev/null +++ b/src/Model/PayrunPaymentsReport.php @@ -0,0 +1,1029 @@ + + */ +class PayrunPaymentsReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrunPaymentsReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payments' => '\SynergiTech\Staffology\Model\PayRunPayment[]', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusMessage' => 'string', + 'link' => 'string', + 'connectedExternalDataProvider' => '\SynergiTech\Staffology\Model\ExternalDataProvider', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payments' => null, + 'status' => null, + 'statusMessage' => null, + 'link' => null, + 'connectedExternalDataProvider' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payments' => true, + 'status' => false, + 'statusMessage' => true, + 'link' => true, + 'connectedExternalDataProvider' => false, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payments' => 'payments', + 'status' => 'status', + 'statusMessage' => 'statusMessage', + 'link' => 'link', + 'connectedExternalDataProvider' => 'connectedExternalDataProvider', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payments' => 'setPayments', + 'status' => 'setStatus', + 'statusMessage' => 'setStatusMessage', + 'link' => 'setLink', + 'connectedExternalDataProvider' => 'setConnectedExternalDataProvider', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payments' => 'getPayments', + 'status' => 'getStatus', + 'statusMessage' => 'getStatusMessage', + 'link' => 'getLink', + 'connectedExternalDataProvider' => 'getConnectedExternalDataProvider', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payments', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('connectedExternalDataProvider', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payments + * + * @return \SynergiTech\Staffology\Model\PayRunPayment[]|null + */ + public function getPayments(): ?array + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param \SynergiTech\Staffology\Model\PayRunPayment[]|null $payments payments + * + * @return $this + */ + public function setPayments(?array $payments): static + { + if (is_null($payments)) { + array_push($this->openAPINullablesSetToNull, 'payments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage [readonly] A message to elaborate on the Status + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink(): ?string + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link [readonly] If available, a link to the payments in an ExternalDataProvider + * + * @return $this + */ + public function setLink(?string $link): static + { + if (is_null($link)) { + array_push($this->openAPINullablesSetToNull, 'link'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('link', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets connectedExternalDataProvider + * + * @return \SynergiTech\Staffology\Model\ExternalDataProvider|null + */ + public function getConnectedExternalDataProvider(): ?\SynergiTech\Staffology\Model\ExternalDataProvider + { + return $this->container['connectedExternalDataProvider']; + } + + /** + * Sets connectedExternalDataProvider + * + * @param \SynergiTech\Staffology\Model\ExternalDataProvider|null $connectedExternalDataProvider connectedExternalDataProvider + * + * @return $this + */ + public function setConnectedExternalDataProvider(?\SynergiTech\Staffology\Model\ExternalDataProvider $connectedExternalDataProvider): static + { + if (is_null($connectedExternalDataProvider)) { + throw new InvalidArgumentException('non-nullable connectedExternalDataProvider cannot be null'); + } + $this->container['connectedExternalDataProvider'] = $connectedExternalDataProvider; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayrunPaymentsReportReportResponse.php b/src/Model/PayrunPaymentsReportReportResponse.php new file mode 100644 index 0000000..ebca3ee --- /dev/null +++ b/src/Model/PayrunPaymentsReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PayrunPaymentsReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayrunPaymentsReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PayrunPaymentsReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PayrunPaymentsReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PayrunPaymentsReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PayrunPaymentsReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PayrunPaymentsReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Payslip.php b/src/Model/Payslip.php new file mode 100644 index 0000000..ff5c187 --- /dev/null +++ b/src/Model/Payslip.php @@ -0,0 +1,1513 @@ + + */ +class Payslip implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Payslip'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isClosed' => 'bool', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'periodNumber' => 'int', + 'period' => 'string', + 'from' => '\DateTime', + 'to' => '\DateTime', + 'paymentDate' => '\DateTime', + 'note' => 'string', + 'allowanceNote' => 'string', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'logoUrl' => 'string', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'employerAddress' => '\SynergiTech\Staffology\Model\Address', + 'hmrcDetails' => '\SynergiTech\Staffology\Model\HmrcDetails', + 'payOptions' => '\SynergiTech\Staffology\Model\PayOptions', + 'employmentDetails' => '\SynergiTech\Staffology\Model\EmploymentDetails', + 'personalDetails' => '\SynergiTech\Staffology\Model\PersonalDetails', + 'totals' => '\SynergiTech\Staffology\Model\PayRunTotals', + 'totalsYtd' => '\SynergiTech\Staffology\Model\PayRunTotals', + 'lines' => '\SynergiTech\Staffology\Model\PayslipLine[]', + 'employerNi' => 'float', + 'employerPensionContribs' => 'float', + 'depts' => '\SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]', + 'umbrellaPayment' => '\SynergiTech\Staffology\Model\UmbrellaPayment', + 'costCentres' => '\SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]', + 'employeeRoleAnalysisCategoryCodes' => '\SynergiTech\Staffology\Model\EmployeeRoleAnalysisCategoryCode[]', + 'employeeCostCentres' => '\SynergiTech\Staffology\Model\EmployeeCostCentre[]', + 'departmentMemberships' => '\SynergiTech\Staffology\Model\DepartmentMembership[]', + 'pensionContributionsByRole' => '\SynergiTech\Staffology\Model\Item[]', + 'employerPensionContributions' => '\SynergiTech\Staffology\Model\EmployerPensionContribution[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isClosed' => null, + 'taxYear' => null, + 'payPeriod' => null, + 'periodNumber' => 'int32', + 'period' => null, + 'from' => 'date', + 'to' => 'date', + 'paymentDate' => 'date', + 'note' => null, + 'allowanceNote' => null, + 'employee' => null, + 'logoUrl' => null, + 'employer' => null, + 'employerAddress' => null, + 'hmrcDetails' => null, + 'payOptions' => null, + 'employmentDetails' => null, + 'personalDetails' => null, + 'totals' => null, + 'totalsYtd' => null, + 'lines' => null, + 'employerNi' => 'double', + 'employerPensionContribs' => 'double', + 'depts' => null, + 'umbrellaPayment' => null, + 'costCentres' => null, + 'employeeRoleAnalysisCategoryCodes' => null, + 'employeeCostCentres' => null, + 'departmentMemberships' => null, + 'pensionContributionsByRole' => null, + 'employerPensionContributions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isClosed' => false, + 'taxYear' => false, + 'payPeriod' => false, + 'periodNumber' => false, + 'period' => true, + 'from' => false, + 'to' => false, + 'paymentDate' => false, + 'note' => true, + 'allowanceNote' => true, + 'employee' => false, + 'logoUrl' => true, + 'employer' => false, + 'employerAddress' => false, + 'hmrcDetails' => false, + 'payOptions' => false, + 'employmentDetails' => false, + 'personalDetails' => false, + 'totals' => false, + 'totalsYtd' => false, + 'lines' => true, + 'employerNi' => false, + 'employerPensionContribs' => false, + 'depts' => true, + 'umbrellaPayment' => false, + 'costCentres' => true, + 'employeeRoleAnalysisCategoryCodes' => true, + 'employeeCostCentres' => true, + 'departmentMemberships' => true, + 'pensionContributionsByRole' => true, + 'employerPensionContributions' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isClosed' => 'isClosed', + 'taxYear' => 'taxYear', + 'payPeriod' => 'payPeriod', + 'periodNumber' => 'periodNumber', + 'period' => 'period', + 'from' => 'from', + 'to' => 'to', + 'paymentDate' => 'paymentDate', + 'note' => 'note', + 'allowanceNote' => 'allowanceNote', + 'employee' => 'employee', + 'logoUrl' => 'logoUrl', + 'employer' => 'employer', + 'employerAddress' => 'employerAddress', + 'hmrcDetails' => 'hmrcDetails', + 'payOptions' => 'payOptions', + 'employmentDetails' => 'employmentDetails', + 'personalDetails' => 'personalDetails', + 'totals' => 'totals', + 'totalsYtd' => 'totalsYtd', + 'lines' => 'lines', + 'employerNi' => 'employerNi', + 'employerPensionContribs' => 'employerPensionContribs', + 'depts' => 'depts', + 'umbrellaPayment' => 'umbrellaPayment', + 'costCentres' => 'costCentres', + 'employeeRoleAnalysisCategoryCodes' => 'employeeRoleAnalysisCategoryCodes', + 'employeeCostCentres' => 'employeeCostCentres', + 'departmentMemberships' => 'departmentMemberships', + 'pensionContributionsByRole' => 'pensionContributionsByRole', + 'employerPensionContributions' => 'employerPensionContributions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isClosed' => 'setIsClosed', + 'taxYear' => 'setTaxYear', + 'payPeriod' => 'setPayPeriod', + 'periodNumber' => 'setPeriodNumber', + 'period' => 'setPeriod', + 'from' => 'setFrom', + 'to' => 'setTo', + 'paymentDate' => 'setPaymentDate', + 'note' => 'setNote', + 'allowanceNote' => 'setAllowanceNote', + 'employee' => 'setEmployee', + 'logoUrl' => 'setLogoUrl', + 'employer' => 'setEmployer', + 'employerAddress' => 'setEmployerAddress', + 'hmrcDetails' => 'setHmrcDetails', + 'payOptions' => 'setPayOptions', + 'employmentDetails' => 'setEmploymentDetails', + 'personalDetails' => 'setPersonalDetails', + 'totals' => 'setTotals', + 'totalsYtd' => 'setTotalsYtd', + 'lines' => 'setLines', + 'employerNi' => 'setEmployerNi', + 'employerPensionContribs' => 'setEmployerPensionContribs', + 'depts' => 'setDepts', + 'umbrellaPayment' => 'setUmbrellaPayment', + 'costCentres' => 'setCostCentres', + 'employeeRoleAnalysisCategoryCodes' => 'setEmployeeRoleAnalysisCategoryCodes', + 'employeeCostCentres' => 'setEmployeeCostCentres', + 'departmentMemberships' => 'setDepartmentMemberships', + 'pensionContributionsByRole' => 'setPensionContributionsByRole', + 'employerPensionContributions' => 'setEmployerPensionContributions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isClosed' => 'getIsClosed', + 'taxYear' => 'getTaxYear', + 'payPeriod' => 'getPayPeriod', + 'periodNumber' => 'getPeriodNumber', + 'period' => 'getPeriod', + 'from' => 'getFrom', + 'to' => 'getTo', + 'paymentDate' => 'getPaymentDate', + 'note' => 'getNote', + 'allowanceNote' => 'getAllowanceNote', + 'employee' => 'getEmployee', + 'logoUrl' => 'getLogoUrl', + 'employer' => 'getEmployer', + 'employerAddress' => 'getEmployerAddress', + 'hmrcDetails' => 'getHmrcDetails', + 'payOptions' => 'getPayOptions', + 'employmentDetails' => 'getEmploymentDetails', + 'personalDetails' => 'getPersonalDetails', + 'totals' => 'getTotals', + 'totalsYtd' => 'getTotalsYtd', + 'lines' => 'getLines', + 'employerNi' => 'getEmployerNi', + 'employerPensionContribs' => 'getEmployerPensionContribs', + 'depts' => 'getDepts', + 'umbrellaPayment' => 'getUmbrellaPayment', + 'costCentres' => 'getCostCentres', + 'employeeRoleAnalysisCategoryCodes' => 'getEmployeeRoleAnalysisCategoryCodes', + 'employeeCostCentres' => 'getEmployeeCostCentres', + 'departmentMemberships' => 'getDepartmentMemberships', + 'pensionContributionsByRole' => 'getPensionContributionsByRole', + 'employerPensionContributions' => 'getEmployerPensionContributions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isClosed', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('periodNumber', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('paymentDate', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('allowanceNote', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('logoUrl', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('employerAddress', $data ?? [], null); + $this->setIfExists('hmrcDetails', $data ?? [], null); + $this->setIfExists('payOptions', $data ?? [], null); + $this->setIfExists('employmentDetails', $data ?? [], null); + $this->setIfExists('personalDetails', $data ?? [], null); + $this->setIfExists('totals', $data ?? [], null); + $this->setIfExists('totalsYtd', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('employerPensionContribs', $data ?? [], null); + $this->setIfExists('depts', $data ?? [], null); + $this->setIfExists('umbrellaPayment', $data ?? [], null); + $this->setIfExists('costCentres', $data ?? [], null); + $this->setIfExists('employeeRoleAnalysisCategoryCodes', $data ?? [], null); + $this->setIfExists('employeeCostCentres', $data ?? [], null); + $this->setIfExists('departmentMemberships', $data ?? [], null); + $this->setIfExists('pensionContributionsByRole', $data ?? [], null); + $this->setIfExists('employerPensionContributions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isClosed + * + * @return bool|null + */ + public function getIsClosed(): ?bool + { + return $this->container['isClosed']; + } + + /** + * Sets isClosed + * + * @param bool|null $isClosed [readonly] Indicates if the Payrun has been finalised + * + * @return $this + */ + public function setIsClosed(?bool $isClosed): static + { + if (is_null($isClosed)) { + throw new InvalidArgumentException('non-nullable isClosed cannot be null'); + } + $this->container['isClosed'] = $isClosed; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets periodNumber + * + * @return int|null + */ + public function getPeriodNumber(): ?int + { + return $this->container['periodNumber']; + } + + /** + * Sets periodNumber + * + * @param int|null $periodNumber periodNumber + * + * @return $this + */ + public function setPeriodNumber(?int $periodNumber): static + { + if (is_null($periodNumber)) { + throw new InvalidArgumentException('non-nullable periodNumber cannot be null'); + } + $this->container['periodNumber'] = $periodNumber; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod(): ?string + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period [readonly] A description of the period that Payslip relates to. + * + * @return $this + */ + public function setPeriod(?string $period): static + { + if (is_null($period)) { + array_push($this->openAPINullablesSetToNull, 'period'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('period', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets from + * + * @return \DateTime|null + */ + public function getFrom(): ?\DateTime + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \DateTime|null $from [readonly] The start date of the period this Payslip covers. + * + * @return $this + */ + public function setFrom(?\DateTime $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \DateTime|null + */ + public function getTo(): ?\DateTime + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \DateTime|null $to [readonly] The end date of the period this Payslip covers. + * + * @return $this + */ + public function setTo(?\DateTime $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets paymentDate + * + * @return \DateTime|null + */ + public function getPaymentDate(): ?\DateTime + { + return $this->container['paymentDate']; + } + + /** + * Sets paymentDate + * + * @param \DateTime|null $paymentDate [readonly] The date the Employee will be paid on + * + * @return $this + */ + public function setPaymentDate(?\DateTime $paymentDate): static + { + if (is_null($paymentDate)) { + throw new InvalidArgumentException('non-nullable paymentDate cannot be null'); + } + $this->container['paymentDate'] = $paymentDate; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note [readonly] Any note that should appear on the payslip + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets allowanceNote + * + * @return string|null + */ + public function getAllowanceNote(): ?string + { + return $this->container['allowanceNote']; + } + + /** + * Sets allowanceNote + * + * @param string|null $allowanceNote [readonly] Details of remaining allowance to show on payslip + * + * @return $this + */ + public function setAllowanceNote(?string $allowanceNote): static + { + if (is_null($allowanceNote)) { + array_push($this->openAPINullablesSetToNull, 'allowanceNote'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowanceNote', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowanceNote'] = $allowanceNote; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets logoUrl + * + * @return string|null + */ + public function getLogoUrl(): ?string + { + return $this->container['logoUrl']; + } + + /** + * Sets logoUrl + * + * @param string|null $logoUrl [readonly] The Logo to include on the payslip + * + * @return $this + */ + public function setLogoUrl(?string $logoUrl): static + { + if (is_null($logoUrl)) { + array_push($this->openAPINullablesSetToNull, 'logoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['logoUrl'] = $logoUrl; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets employerAddress + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getEmployerAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['employerAddress']; + } + + /** + * Sets employerAddress + * + * @param \SynergiTech\Staffology\Model\Address|null $employerAddress employerAddress + * + * @return $this + */ + public function setEmployerAddress(?\SynergiTech\Staffology\Model\Address $employerAddress): static + { + if (is_null($employerAddress)) { + throw new InvalidArgumentException('non-nullable employerAddress cannot be null'); + } + $this->container['employerAddress'] = $employerAddress; + + return $this; + } + + /** + * Gets hmrcDetails + * + * @return \SynergiTech\Staffology\Model\HmrcDetails|null + */ + public function getHmrcDetails(): ?\SynergiTech\Staffology\Model\HmrcDetails + { + return $this->container['hmrcDetails']; + } + + /** + * Sets hmrcDetails + * + * @param \SynergiTech\Staffology\Model\HmrcDetails|null $hmrcDetails hmrcDetails + * + * @return $this + */ + public function setHmrcDetails(?\SynergiTech\Staffology\Model\HmrcDetails $hmrcDetails): static + { + if (is_null($hmrcDetails)) { + throw new InvalidArgumentException('non-nullable hmrcDetails cannot be null'); + } + $this->container['hmrcDetails'] = $hmrcDetails; + + return $this; + } + + /** + * Gets payOptions + * + * @return \SynergiTech\Staffology\Model\PayOptions|null + */ + public function getPayOptions(): ?\SynergiTech\Staffology\Model\PayOptions + { + return $this->container['payOptions']; + } + + /** + * Sets payOptions + * + * @param \SynergiTech\Staffology\Model\PayOptions|null $payOptions payOptions + * + * @return $this + */ + public function setPayOptions(?\SynergiTech\Staffology\Model\PayOptions $payOptions): static + { + if (is_null($payOptions)) { + throw new InvalidArgumentException('non-nullable payOptions cannot be null'); + } + $this->container['payOptions'] = $payOptions; + + return $this; + } + + /** + * Gets employmentDetails + * + * @return \SynergiTech\Staffology\Model\EmploymentDetails|null + */ + public function getEmploymentDetails(): ?\SynergiTech\Staffology\Model\EmploymentDetails + { + return $this->container['employmentDetails']; + } + + /** + * Sets employmentDetails + * + * @param \SynergiTech\Staffology\Model\EmploymentDetails|null $employmentDetails employmentDetails + * + * @return $this + */ + public function setEmploymentDetails(?\SynergiTech\Staffology\Model\EmploymentDetails $employmentDetails): static + { + if (is_null($employmentDetails)) { + throw new InvalidArgumentException('non-nullable employmentDetails cannot be null'); + } + $this->container['employmentDetails'] = $employmentDetails; + + return $this; + } + + /** + * Gets personalDetails + * + * @return \SynergiTech\Staffology\Model\PersonalDetails|null + */ + public function getPersonalDetails(): ?\SynergiTech\Staffology\Model\PersonalDetails + { + return $this->container['personalDetails']; + } + + /** + * Sets personalDetails + * + * @param \SynergiTech\Staffology\Model\PersonalDetails|null $personalDetails personalDetails + * + * @return $this + */ + public function setPersonalDetails(?\SynergiTech\Staffology\Model\PersonalDetails $personalDetails): static + { + if (is_null($personalDetails)) { + throw new InvalidArgumentException('non-nullable personalDetails cannot be null'); + } + $this->container['personalDetails'] = $personalDetails; + + return $this; + } + + /** + * Gets totals + * + * @return \SynergiTech\Staffology\Model\PayRunTotals|null + */ + public function getTotals(): ?\SynergiTech\Staffology\Model\PayRunTotals + { + return $this->container['totals']; + } + + /** + * Sets totals + * + * @param \SynergiTech\Staffology\Model\PayRunTotals|null $totals totals + * + * @return $this + */ + public function setTotals(?\SynergiTech\Staffology\Model\PayRunTotals $totals): static + { + if (is_null($totals)) { + throw new InvalidArgumentException('non-nullable totals cannot be null'); + } + $this->container['totals'] = $totals; + + return $this; + } + + /** + * Gets totalsYtd + * + * @return \SynergiTech\Staffology\Model\PayRunTotals|null + */ + public function getTotalsYtd(): ?\SynergiTech\Staffology\Model\PayRunTotals + { + return $this->container['totalsYtd']; + } + + /** + * Sets totalsYtd + * + * @param \SynergiTech\Staffology\Model\PayRunTotals|null $totalsYtd totalsYtd + * + * @return $this + */ + public function setTotalsYtd(?\SynergiTech\Staffology\Model\PayRunTotals $totalsYtd): static + { + if (is_null($totalsYtd)) { + throw new InvalidArgumentException('non-nullable totalsYtd cannot be null'); + } + $this->container['totalsYtd'] = $totalsYtd; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PayslipLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PayslipLine[]|null $lines [readonly] The lines to display on the Payslip + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi [readonly] The Employer NI Contribution amount + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets employerPensionContribs + * + * @return float|null + */ + public function getEmployerPensionContribs(): ?float + { + return $this->container['employerPensionContribs']; + } + + /** + * Sets employerPensionContribs + * + * @param float|null $employerPensionContribs [readonly] The Employer Pension Contribution Amount + * + * @return $this + */ + public function setEmployerPensionContribs(?float $employerPensionContribs): static + { + if (is_null($employerPensionContribs)) { + throw new InvalidArgumentException('non-nullable employerPensionContribs cannot be null'); + } + $this->container['employerPensionContribs'] = $employerPensionContribs; + + return $this; + } + + /** + * Gets depts + * + * @return \SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]|null + */ + public function getDepts(): ?array + { + return $this->container['depts']; + } + + /** + * Sets depts + * + * @param \SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]|null $depts The employees Department Membership(s) at the time the payrun was finalised + * + * @return $this + */ + public function setDepts(?array $depts): static + { + if (is_null($depts)) { + array_push($this->openAPINullablesSetToNull, 'depts'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('depts', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['depts'] = $depts; + + return $this; + } + + /** + * Gets umbrellaPayment + * + * @return \SynergiTech\Staffology\Model\UmbrellaPayment|null + */ + public function getUmbrellaPayment(): ?\SynergiTech\Staffology\Model\UmbrellaPayment + { + return $this->container['umbrellaPayment']; + } + + /** + * Sets umbrellaPayment + * + * @param \SynergiTech\Staffology\Model\UmbrellaPayment|null $umbrellaPayment umbrellaPayment + * + * @return $this + */ + public function setUmbrellaPayment(?\SynergiTech\Staffology\Model\UmbrellaPayment $umbrellaPayment): static + { + if (is_null($umbrellaPayment)) { + throw new InvalidArgumentException('non-nullable umbrellaPayment cannot be null'); + } + $this->container['umbrellaPayment'] = $umbrellaPayment; + + return $this; + } + + /** + * Gets costCentres + * + * @return \SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]|null + */ + public function getCostCentres(): ?array + { + return $this->container['costCentres']; + } + + /** + * Sets costCentres + * + * @param \SynergiTech\Staffology\Model\StringDecimalKeyValuePair[]|null $costCentres The employees Cost Centre Membership(s) only populated when creating journals + * + * @return $this + */ + public function setCostCentres(?array $costCentres): static + { + if (is_null($costCentres)) { + array_push($this->openAPINullablesSetToNull, 'costCentres'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('costCentres', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['costCentres'] = $costCentres; + + return $this; + } + + /** + * Gets employeeRoleAnalysisCategoryCodes + * + * @return \SynergiTech\Staffology\Model\EmployeeRoleAnalysisCategoryCode[]|null + */ + public function getEmployeeRoleAnalysisCategoryCodes(): ?array + { + return $this->container['employeeRoleAnalysisCategoryCodes']; + } + + /** + * Sets employeeRoleAnalysisCategoryCodes + * + * @param \SynergiTech\Staffology\Model\EmployeeRoleAnalysisCategoryCode[]|null $employeeRoleAnalysisCategoryCodes The EmployeeRoleAnalysisCategoryCodes only populated when creating journals + * + * @return $this + */ + public function setEmployeeRoleAnalysisCategoryCodes(?array $employeeRoleAnalysisCategoryCodes): static + { + if (is_null($employeeRoleAnalysisCategoryCodes)) { + array_push($this->openAPINullablesSetToNull, 'employeeRoleAnalysisCategoryCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeRoleAnalysisCategoryCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeRoleAnalysisCategoryCodes'] = $employeeRoleAnalysisCategoryCodes; + + return $this; + } + + /** + * Gets employeeCostCentres + * + * @return \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null + */ + public function getEmployeeCostCentres(): ?array + { + return $this->container['employeeCostCentres']; + } + + /** + * Sets employeeCostCentres + * + * @param \SynergiTech\Staffology\Model\EmployeeCostCentre[]|null $employeeCostCentres The Employee Cost Centre Membership(s) by role only populated when creating journals + * + * @return $this + */ + public function setEmployeeCostCentres(?array $employeeCostCentres): static + { + if (is_null($employeeCostCentres)) { + array_push($this->openAPINullablesSetToNull, 'employeeCostCentres'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeCostCentres', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeCostCentres'] = $employeeCostCentres; + + return $this; + } + + /** + * Gets departmentMemberships + * + * @return \SynergiTech\Staffology\Model\DepartmentMembership[]|null + */ + public function getDepartmentMemberships(): ?array + { + return $this->container['departmentMemberships']; + } + + /** + * Sets departmentMemberships + * + * @param \SynergiTech\Staffology\Model\DepartmentMembership[]|null $departmentMemberships The Employee Department Membership(s) by role only populated when creating journals + * + * @return $this + */ + public function setDepartmentMemberships(?array $departmentMemberships): static + { + if (is_null($departmentMemberships)) { + array_push($this->openAPINullablesSetToNull, 'departmentMemberships'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('departmentMemberships', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['departmentMemberships'] = $departmentMemberships; + + return $this; + } + + /** + * Gets pensionContributionsByRole + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getPensionContributionsByRole(): ?array + { + return $this->container['pensionContributionsByRole']; + } + + /** + * Sets pensionContributionsByRole + * + * @param \SynergiTech\Staffology\Model\Item[]|null $pensionContributionsByRole The Pension Employer contribution by role only populated when creating journals + * + * @return $this + */ + public function setPensionContributionsByRole(?array $pensionContributionsByRole): static + { + if (is_null($pensionContributionsByRole)) { + array_push($this->openAPINullablesSetToNull, 'pensionContributionsByRole'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionContributionsByRole', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionContributionsByRole'] = $pensionContributionsByRole; + + return $this; + } + + /** + * Gets employerPensionContributions + * + * @return \SynergiTech\Staffology\Model\EmployerPensionContribution[]|null + */ + public function getEmployerPensionContributions(): ?array + { + return $this->container['employerPensionContributions']; + } + + /** + * Sets employerPensionContributions + * + * @param \SynergiTech\Staffology\Model\EmployerPensionContribution[]|null $employerPensionContributions [readonly] The list of Employer Pension Contribution(s) + * + * @return $this + */ + public function setEmployerPensionContributions(?array $employerPensionContributions): static + { + if (is_null($employerPensionContributions)) { + array_push($this->openAPINullablesSetToNull, 'employerPensionContributions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPensionContributions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPensionContributions'] = $employerPensionContributions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayslipCustomisation.php b/src/Model/PayslipCustomisation.php new file mode 100644 index 0000000..c6a5957 --- /dev/null +++ b/src/Model/PayslipCustomisation.php @@ -0,0 +1,915 @@ + + */ +class PayslipCustomisation implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayslipCustomisation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'custom' => 'bool', + 'includeLogo' => 'bool', + 'customCssOption' => '\SynergiTech\Staffology\Model\ReportCustomCssOption', + 'customCss' => 'string', + 'removeYtd' => 'bool', + 'includeEmployerAddress' => 'bool', + 'useUmbrellaFormat' => 'bool', + 'filename' => 'string', + 'includeDepartment' => 'bool', + 'includeHealthAndSocialCareMessage' => 'bool', + 'includeBenefits' => 'bool', + 'paperSize' => '\SynergiTech\Staffology\Model\PdfPaperSize', + 'orientation' => '\SynergiTech\Staffology\Model\PdfPaperOrientation', + 'margins' => '\SynergiTech\Staffology\Model\PdfPaperMargins', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'custom' => null, + 'includeLogo' => null, + 'customCssOption' => null, + 'customCss' => null, + 'removeYtd' => null, + 'includeEmployerAddress' => null, + 'useUmbrellaFormat' => null, + 'filename' => null, + 'includeDepartment' => null, + 'includeHealthAndSocialCareMessage' => null, + 'includeBenefits' => null, + 'paperSize' => null, + 'orientation' => null, + 'margins' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'custom' => false, + 'includeLogo' => false, + 'customCssOption' => false, + 'customCss' => true, + 'removeYtd' => false, + 'includeEmployerAddress' => false, + 'useUmbrellaFormat' => false, + 'filename' => true, + 'includeDepartment' => false, + 'includeHealthAndSocialCareMessage' => false, + 'includeBenefits' => false, + 'paperSize' => false, + 'orientation' => false, + 'margins' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'custom' => 'custom', + 'includeLogo' => 'includeLogo', + 'customCssOption' => 'customCssOption', + 'customCss' => 'customCss', + 'removeYtd' => 'removeYtd', + 'includeEmployerAddress' => 'includeEmployerAddress', + 'useUmbrellaFormat' => 'useUmbrellaFormat', + 'filename' => 'filename', + 'includeDepartment' => 'includeDepartment', + 'includeHealthAndSocialCareMessage' => 'includeHealthAndSocialCareMessage', + 'includeBenefits' => 'includeBenefits', + 'paperSize' => 'paperSize', + 'orientation' => 'orientation', + 'margins' => 'margins', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'custom' => 'setCustom', + 'includeLogo' => 'setIncludeLogo', + 'customCssOption' => 'setCustomCssOption', + 'customCss' => 'setCustomCss', + 'removeYtd' => 'setRemoveYtd', + 'includeEmployerAddress' => 'setIncludeEmployerAddress', + 'useUmbrellaFormat' => 'setUseUmbrellaFormat', + 'filename' => 'setFilename', + 'includeDepartment' => 'setIncludeDepartment', + 'includeHealthAndSocialCareMessage' => 'setIncludeHealthAndSocialCareMessage', + 'includeBenefits' => 'setIncludeBenefits', + 'paperSize' => 'setPaperSize', + 'orientation' => 'setOrientation', + 'margins' => 'setMargins', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'custom' => 'getCustom', + 'includeLogo' => 'getIncludeLogo', + 'customCssOption' => 'getCustomCssOption', + 'customCss' => 'getCustomCss', + 'removeYtd' => 'getRemoveYtd', + 'includeEmployerAddress' => 'getIncludeEmployerAddress', + 'useUmbrellaFormat' => 'getUseUmbrellaFormat', + 'filename' => 'getFilename', + 'includeDepartment' => 'getIncludeDepartment', + 'includeHealthAndSocialCareMessage' => 'getIncludeHealthAndSocialCareMessage', + 'includeBenefits' => 'getIncludeBenefits', + 'paperSize' => 'getPaperSize', + 'orientation' => 'getOrientation', + 'margins' => 'getMargins', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('custom', $data ?? [], null); + $this->setIfExists('includeLogo', $data ?? [], null); + $this->setIfExists('customCssOption', $data ?? [], null); + $this->setIfExists('customCss', $data ?? [], null); + $this->setIfExists('removeYtd', $data ?? [], null); + $this->setIfExists('includeEmployerAddress', $data ?? [], null); + $this->setIfExists('useUmbrellaFormat', $data ?? [], null); + $this->setIfExists('filename', $data ?? [], null); + $this->setIfExists('includeDepartment', $data ?? [], null); + $this->setIfExists('includeHealthAndSocialCareMessage', $data ?? [], null); + $this->setIfExists('includeBenefits', $data ?? [], null); + $this->setIfExists('paperSize', $data ?? [], null); + $this->setIfExists('orientation', $data ?? [], null); + $this->setIfExists('margins', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['customCss']) && (mb_strlen($this->container['customCss']) > 2500)) { + $invalidProperties[] = "invalid value for 'customCss', the character length must be smaller than or equal to 2500."; + } + + if (!is_null($this->container['filename']) && (mb_strlen($this->container['filename']) > 200)) { + $invalidProperties[] = "invalid value for 'filename', the character length must be smaller than or equal to 200."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets custom + * + * @return bool|null + */ + public function getCustom(): ?bool + { + return $this->container['custom']; + } + + /** + * Sets custom + * + * @param bool|null $custom Whether or not you are customising the Payslip. This should always be true if you are providing any other values. + * + * @return $this + */ + public function setCustom(?bool $custom): static + { + if (is_null($custom)) { + throw new InvalidArgumentException('non-nullable custom cannot be null'); + } + $this->container['custom'] = $custom; + + return $this; + } + + /** + * Gets includeLogo + * + * @return bool|null + */ + public function getIncludeLogo(): ?bool + { + return $this->container['includeLogo']; + } + + /** + * Sets includeLogo + * + * @param bool|null $includeLogo Whether or not to include the employer logo on the payslip. + * + * @return $this + */ + public function setIncludeLogo(?bool $includeLogo): static + { + if (is_null($includeLogo)) { + throw new InvalidArgumentException('non-nullable includeLogo cannot be null'); + } + $this->container['includeLogo'] = $includeLogo; + + return $this; + } + + /** + * Gets customCssOption + * + * @return \SynergiTech\Staffology\Model\ReportCustomCssOption|null + */ + public function getCustomCssOption(): ?\SynergiTech\Staffology\Model\ReportCustomCssOption + { + return $this->container['customCssOption']; + } + + /** + * Sets customCssOption + * + * @param \SynergiTech\Staffology\Model\ReportCustomCssOption|null $customCssOption customCssOption + * + * @return $this + */ + public function setCustomCssOption(?\SynergiTech\Staffology\Model\ReportCustomCssOption $customCssOption): static + { + if (is_null($customCssOption)) { + throw new InvalidArgumentException('non-nullable customCssOption cannot be null'); + } + $this->container['customCssOption'] = $customCssOption; + + return $this; + } + + /** + * Gets customCss + * + * @return string|null + */ + public function getCustomCss(): ?string + { + return $this->container['customCss']; + } + + /** + * Sets customCss + * + * @param string|null $customCss customCss + * + * @return $this + */ + public function setCustomCss(?string $customCss): static + { + if (is_null($customCss)) { + array_push($this->openAPINullablesSetToNull, 'customCss'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customCss', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($customCss) && (mb_strlen($customCss) > 2500)) { + throw new InvalidArgumentException('invalid length for $customCss when calling PayslipCustomisation., must be smaller than or equal to 2500.'); + } + + $this->container['customCss'] = $customCss; + + return $this; + } + + /** + * Gets removeYtd + * + * @return bool|null + */ + public function getRemoveYtd(): ?bool + { + return $this->container['removeYtd']; + } + + /** + * Sets removeYtd + * + * @param bool|null $removeYtd Whether or not to remove the YTD column + * + * @return $this + */ + public function setRemoveYtd(?bool $removeYtd): static + { + if (is_null($removeYtd)) { + throw new InvalidArgumentException('non-nullable removeYtd cannot be null'); + } + $this->container['removeYtd'] = $removeYtd; + + return $this; + } + + /** + * Gets includeEmployerAddress + * + * @return bool|null + */ + public function getIncludeEmployerAddress(): ?bool + { + return $this->container['includeEmployerAddress']; + } + + /** + * Sets includeEmployerAddress + * + * @param bool|null $includeEmployerAddress Whether or not to include the employer address + * + * @return $this + */ + public function setIncludeEmployerAddress(?bool $includeEmployerAddress): static + { + if (is_null($includeEmployerAddress)) { + throw new InvalidArgumentException('non-nullable includeEmployerAddress cannot be null'); + } + $this->container['includeEmployerAddress'] = $includeEmployerAddress; + + return $this; + } + + /** + * Gets useUmbrellaFormat + * + * @return bool|null + */ + public function getUseUmbrellaFormat(): ?bool + { + return $this->container['useUmbrellaFormat']; + } + + /** + * Sets useUmbrellaFormat + * + * @param bool|null $useUmbrellaFormat If true then the format the payslip will include details of the Umbrella Payment as well as employer costs + * + * @return $this + */ + public function setUseUmbrellaFormat(?bool $useUmbrellaFormat): static + { + if (is_null($useUmbrellaFormat)) { + throw new InvalidArgumentException('non-nullable useUmbrellaFormat cannot be null'); + } + $this->container['useUmbrellaFormat'] = $useUmbrellaFormat; + + return $this; + } + + /** + * Gets filename + * + * @return string|null + */ + public function getFilename(): ?string + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string|null $filename filename + * + * @return $this + */ + public function setFilename(?string $filename): static + { + if (is_null($filename)) { + array_push($this->openAPINullablesSetToNull, 'filename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($filename) && (mb_strlen($filename) > 200)) { + throw new InvalidArgumentException('invalid length for $filename when calling PayslipCustomisation., must be smaller than or equal to 200.'); + } + + $this->container['filename'] = $filename; + + return $this; + } + + /** + * Gets includeDepartment + * + * @return bool|null + */ + public function getIncludeDepartment(): ?bool + { + return $this->container['includeDepartment']; + } + + /** + * Sets includeDepartment + * + * @param bool|null $includeDepartment Whether or not to include the primary department of the employee on the payslip + * + * @return $this + */ + public function setIncludeDepartment(?bool $includeDepartment): static + { + if (is_null($includeDepartment)) { + throw new InvalidArgumentException('non-nullable includeDepartment cannot be null'); + } + $this->container['includeDepartment'] = $includeDepartment; + + return $this; + } + + /** + * Gets includeHealthAndSocialCareMessage + * + * @return bool|null + */ + public function getIncludeHealthAndSocialCareMessage(): ?bool + { + return $this->container['includeHealthAndSocialCareMessage']; + } + + /** + * Sets includeHealthAndSocialCareMessage + * + * @param bool|null $includeHealthAndSocialCareMessage Whether or not to include health and social car message + * + * @return $this + */ + public function setIncludeHealthAndSocialCareMessage(?bool $includeHealthAndSocialCareMessage): static + { + if (is_null($includeHealthAndSocialCareMessage)) { + throw new InvalidArgumentException('non-nullable includeHealthAndSocialCareMessage cannot be null'); + } + $this->container['includeHealthAndSocialCareMessage'] = $includeHealthAndSocialCareMessage; + + return $this; + } + + /** + * Gets includeBenefits + * + * @return bool|null + */ + public function getIncludeBenefits(): ?bool + { + return $this->container['includeBenefits']; + } + + /** + * Sets includeBenefits + * + * @param bool|null $includeBenefits Whether or not to include any payrolled benefits + * + * @return $this + */ + public function setIncludeBenefits(?bool $includeBenefits): static + { + if (is_null($includeBenefits)) { + throw new InvalidArgumentException('non-nullable includeBenefits cannot be null'); + } + $this->container['includeBenefits'] = $includeBenefits; + + return $this; + } + + /** + * Gets paperSize + * + * @return \SynergiTech\Staffology\Model\PdfPaperSize|null + */ + public function getPaperSize(): ?\SynergiTech\Staffology\Model\PdfPaperSize + { + return $this->container['paperSize']; + } + + /** + * Sets paperSize + * + * @param \SynergiTech\Staffology\Model\PdfPaperSize|null $paperSize paperSize + * + * @return $this + */ + public function setPaperSize(?\SynergiTech\Staffology\Model\PdfPaperSize $paperSize): static + { + if (is_null($paperSize)) { + throw new InvalidArgumentException('non-nullable paperSize cannot be null'); + } + $this->container['paperSize'] = $paperSize; + + return $this; + } + + /** + * Gets orientation + * + * @return \SynergiTech\Staffology\Model\PdfPaperOrientation|null + */ + public function getOrientation(): ?\SynergiTech\Staffology\Model\PdfPaperOrientation + { + return $this->container['orientation']; + } + + /** + * Sets orientation + * + * @param \SynergiTech\Staffology\Model\PdfPaperOrientation|null $orientation orientation + * + * @return $this + */ + public function setOrientation(?\SynergiTech\Staffology\Model\PdfPaperOrientation $orientation): static + { + if (is_null($orientation)) { + throw new InvalidArgumentException('non-nullable orientation cannot be null'); + } + $this->container['orientation'] = $orientation; + + return $this; + } + + /** + * Gets margins + * + * @return \SynergiTech\Staffology\Model\PdfPaperMargins|null + */ + public function getMargins(): ?\SynergiTech\Staffology\Model\PdfPaperMargins + { + return $this->container['margins']; + } + + /** + * Sets margins + * + * @param \SynergiTech\Staffology\Model\PdfPaperMargins|null $margins margins + * + * @return $this + */ + public function setMargins(?\SynergiTech\Staffology\Model\PdfPaperMargins $margins): static + { + if (is_null($margins)) { + throw new InvalidArgumentException('non-nullable margins cannot be null'); + } + $this->container['margins'] = $margins; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayslipLine.php b/src/Model/PayslipLine.php new file mode 100644 index 0000000..23dd4b4 --- /dev/null +++ b/src/Model/PayslipLine.php @@ -0,0 +1,1138 @@ + + */ +class PayslipLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayslipLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\PayslipLineType', + 'code' => 'string', + 'description' => 'string', + 'secondaryDescription' => 'string', + 'value' => 'float', + 'multiplier' => 'float', + 'attachmentOrderId' => 'string', + 'pensionId' => 'string', + 'loanId' => 'string', + 'currencySymbol' => 'string', + 'formattedValue' => 'string', + 'isNetToGross' => 'bool', + 'targetNetToGrossValue' => 'float', + 'leaveId' => 'string', + 'roleId' => 'string', + 'isAutoCalculatedBackPayLine' => 'bool', + 'isAutomaticBackPay' => 'bool', + 'hasSecondaryDescription' => 'bool', + 'contributesToBasicPay' => 'bool', + 'isNotional' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'code' => null, + 'description' => null, + 'secondaryDescription' => null, + 'value' => 'double', + 'multiplier' => 'double', + 'attachmentOrderId' => 'uuid', + 'pensionId' => 'uuid', + 'loanId' => 'uuid', + 'currencySymbol' => null, + 'formattedValue' => null, + 'isNetToGross' => null, + 'targetNetToGrossValue' => 'double', + 'leaveId' => 'uuid', + 'roleId' => 'uuid', + 'isAutoCalculatedBackPayLine' => null, + 'isAutomaticBackPay' => null, + 'hasSecondaryDescription' => null, + 'contributesToBasicPay' => null, + 'isNotional' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'code' => true, + 'description' => true, + 'secondaryDescription' => true, + 'value' => false, + 'multiplier' => true, + 'attachmentOrderId' => true, + 'pensionId' => true, + 'loanId' => true, + 'currencySymbol' => true, + 'formattedValue' => true, + 'isNetToGross' => false, + 'targetNetToGrossValue' => true, + 'leaveId' => true, + 'roleId' => true, + 'isAutoCalculatedBackPayLine' => false, + 'isAutomaticBackPay' => false, + 'hasSecondaryDescription' => false, + 'contributesToBasicPay' => false, + 'isNotional' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'code' => 'code', + 'description' => 'description', + 'secondaryDescription' => 'secondaryDescription', + 'value' => 'value', + 'multiplier' => 'multiplier', + 'attachmentOrderId' => 'attachmentOrderId', + 'pensionId' => 'pensionId', + 'loanId' => 'loanId', + 'currencySymbol' => 'currencySymbol', + 'formattedValue' => 'formattedValue', + 'isNetToGross' => 'isNetToGross', + 'targetNetToGrossValue' => 'targetNetToGrossValue', + 'leaveId' => 'leaveId', + 'roleId' => 'roleId', + 'isAutoCalculatedBackPayLine' => 'isAutoCalculatedBackPayLine', + 'isAutomaticBackPay' => 'isAutomaticBackPay', + 'hasSecondaryDescription' => 'hasSecondaryDescription', + 'contributesToBasicPay' => 'contributesToBasicPay', + 'isNotional' => 'isNotional' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'code' => 'setCode', + 'description' => 'setDescription', + 'secondaryDescription' => 'setSecondaryDescription', + 'value' => 'setValue', + 'multiplier' => 'setMultiplier', + 'attachmentOrderId' => 'setAttachmentOrderId', + 'pensionId' => 'setPensionId', + 'loanId' => 'setLoanId', + 'currencySymbol' => 'setCurrencySymbol', + 'formattedValue' => 'setFormattedValue', + 'isNetToGross' => 'setIsNetToGross', + 'targetNetToGrossValue' => 'setTargetNetToGrossValue', + 'leaveId' => 'setLeaveId', + 'roleId' => 'setRoleId', + 'isAutoCalculatedBackPayLine' => 'setIsAutoCalculatedBackPayLine', + 'isAutomaticBackPay' => 'setIsAutomaticBackPay', + 'hasSecondaryDescription' => 'setHasSecondaryDescription', + 'contributesToBasicPay' => 'setContributesToBasicPay', + 'isNotional' => 'setIsNotional' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'code' => 'getCode', + 'description' => 'getDescription', + 'secondaryDescription' => 'getSecondaryDescription', + 'value' => 'getValue', + 'multiplier' => 'getMultiplier', + 'attachmentOrderId' => 'getAttachmentOrderId', + 'pensionId' => 'getPensionId', + 'loanId' => 'getLoanId', + 'currencySymbol' => 'getCurrencySymbol', + 'formattedValue' => 'getFormattedValue', + 'isNetToGross' => 'getIsNetToGross', + 'targetNetToGrossValue' => 'getTargetNetToGrossValue', + 'leaveId' => 'getLeaveId', + 'roleId' => 'getRoleId', + 'isAutoCalculatedBackPayLine' => 'getIsAutoCalculatedBackPayLine', + 'isAutomaticBackPay' => 'getIsAutomaticBackPay', + 'hasSecondaryDescription' => 'getHasSecondaryDescription', + 'contributesToBasicPay' => 'getContributesToBasicPay', + 'isNotional' => 'getIsNotional' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('secondaryDescription', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + $this->setIfExists('attachmentOrderId', $data ?? [], null); + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('loanId', $data ?? [], null); + $this->setIfExists('currencySymbol', $data ?? [], null); + $this->setIfExists('formattedValue', $data ?? [], null); + $this->setIfExists('isNetToGross', $data ?? [], null); + $this->setIfExists('targetNetToGrossValue', $data ?? [], null); + $this->setIfExists('leaveId', $data ?? [], null); + $this->setIfExists('roleId', $data ?? [], null); + $this->setIfExists('isAutoCalculatedBackPayLine', $data ?? [], null); + $this->setIfExists('isAutomaticBackPay', $data ?? [], null); + $this->setIfExists('hasSecondaryDescription', $data ?? [], null); + $this->setIfExists('contributesToBasicPay', $data ?? [], null); + $this->setIfExists('isNotional', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PayslipLineType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PayslipLineType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PayslipLineType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PayslipLineType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode(): ?string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return $this + */ + public function setCode(?string $code): static + { + if (is_null($code)) { + array_push($this->openAPINullablesSetToNull, 'code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets secondaryDescription + * + * @return string|null + */ + public function getSecondaryDescription(): ?string + { + return $this->container['secondaryDescription']; + } + + /** + * Sets secondaryDescription + * + * @param string|null $secondaryDescription secondaryDescription + * + * @return $this + */ + public function setSecondaryDescription(?string $secondaryDescription): static + { + if (is_null($secondaryDescription)) { + array_push($this->openAPINullablesSetToNull, 'secondaryDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('secondaryDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['secondaryDescription'] = $secondaryDescription; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier [readonly] If the Code is a multiplier code then this is the multiplier. Value has already been calculated so this is just for reference + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + + /** + * Gets attachmentOrderId + * + * @return string|null + */ + public function getAttachmentOrderId(): ?string + { + return $this->container['attachmentOrderId']; + } + + /** + * Sets attachmentOrderId + * + * @param string|null $attachmentOrderId [readonly] The Id of the associated AttachmentOrder. Only included if the Code is AEO + * + * @return $this + */ + public function setAttachmentOrderId(?string $attachmentOrderId): static + { + if (is_null($attachmentOrderId)) { + array_push($this->openAPINullablesSetToNull, 'attachmentOrderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachmentOrderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachmentOrderId'] = $attachmentOrderId; + + return $this; + } + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId [readonly] The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + array_push($this->openAPINullablesSetToNull, 'pensionId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets loanId + * + * @return string|null + */ + public function getLoanId(): ?string + { + return $this->container['loanId']; + } + + /** + * Sets loanId + * + * @param string|null $loanId [readonly] The Id of the associated Loan, if any. + * + * @return $this + */ + public function setLoanId(?string $loanId): static + { + if (is_null($loanId)) { + array_push($this->openAPINullablesSetToNull, 'loanId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loanId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loanId'] = $loanId; + + return $this; + } + + /** + * Gets currencySymbol + * + * @return string|null + */ + public function getCurrencySymbol(): ?string + { + return $this->container['currencySymbol']; + } + + /** + * Sets currencySymbol + * + * @param string|null $currencySymbol currencySymbol + * + * @return $this + */ + public function setCurrencySymbol(?string $currencySymbol): static + { + if (is_null($currencySymbol)) { + array_push($this->openAPINullablesSetToNull, 'currencySymbol'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('currencySymbol', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['currencySymbol'] = $currencySymbol; + + return $this; + } + + /** + * Gets formattedValue + * + * @return string|null + */ + public function getFormattedValue(): ?string + { + return $this->container['formattedValue']; + } + + /** + * Sets formattedValue + * + * @param string|null $formattedValue formattedValue + * + * @return $this + */ + public function setFormattedValue(?string $formattedValue): static + { + if (is_null($formattedValue)) { + array_push($this->openAPINullablesSetToNull, 'formattedValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('formattedValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['formattedValue'] = $formattedValue; + + return $this; + } + + /** + * Gets isNetToGross + * + * @return bool|null + */ + public function getIsNetToGross(): ?bool + { + return $this->container['isNetToGross']; + } + + /** + * Sets isNetToGross + * + * @param bool|null $isNetToGross If the PayLine is a fixed ammount addition without multiplier then this property may be set to true so that the amount of the addition to be considered a take home pay target. + * + * @return $this + */ + public function setIsNetToGross(?bool $isNetToGross): static + { + if (is_null($isNetToGross)) { + throw new InvalidArgumentException('non-nullable isNetToGross cannot be null'); + } + $this->container['isNetToGross'] = $isNetToGross; + + return $this; + } + + /** + * Gets targetNetToGrossValue + * + * @return float|null + */ + public function getTargetNetToGrossValue(): ?float + { + return $this->container['targetNetToGrossValue']; + } + + /** + * Sets targetNetToGrossValue + * + * @param float|null $targetNetToGrossValue The orginal net fixed addition amount that is considered to be a take home pay target. + * + * @return $this + */ + public function setTargetNetToGrossValue(?float $targetNetToGrossValue): static + { + if (is_null($targetNetToGrossValue)) { + array_push($this->openAPINullablesSetToNull, 'targetNetToGrossValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('targetNetToGrossValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['targetNetToGrossValue'] = $targetNetToGrossValue; + + return $this; + } + + /** + * Gets leaveId + * + * @return string|null + */ + public function getLeaveId(): ?string + { + return $this->container['leaveId']; + } + + /** + * Sets leaveId + * + * @param string|null $leaveId leaveId + * + * @return $this + */ + public function setLeaveId(?string $leaveId): static + { + if (is_null($leaveId)) { + array_push($this->openAPINullablesSetToNull, 'leaveId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveId'] = $leaveId; + + return $this; + } + + /** + * Gets roleId + * + * @return string|null + */ + public function getRoleId(): ?string + { + return $this->container['roleId']; + } + + /** + * Sets roleId + * + * @param string|null $roleId The employee role which is associated with this payslip line. If set to null, the payslip line is not related with a role. + * + * @return $this + */ + public function setRoleId(?string $roleId): static + { + if (is_null($roleId)) { + array_push($this->openAPINullablesSetToNull, 'roleId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleId'] = $roleId; + + return $this; + } + + /** + * Gets isAutoCalculatedBackPayLine + * + * @return bool|null + */ + public function getIsAutoCalculatedBackPayLine(): ?bool + { + return $this->container['isAutoCalculatedBackPayLine']; + } + + /** + * Sets isAutoCalculatedBackPayLine + * + * @param bool|null $isAutoCalculatedBackPayLine isAutoCalculatedBackPayLine + * + * @return $this + */ + public function setIsAutoCalculatedBackPayLine(?bool $isAutoCalculatedBackPayLine): static + { + if (is_null($isAutoCalculatedBackPayLine)) { + throw new InvalidArgumentException('non-nullable isAutoCalculatedBackPayLine cannot be null'); + } + $this->container['isAutoCalculatedBackPayLine'] = $isAutoCalculatedBackPayLine; + + return $this; + } + + /** + * Gets isAutomaticBackPay + * + * @return bool|null + */ + public function getIsAutomaticBackPay(): ?bool + { + return $this->container['isAutomaticBackPay']; + } + + /** + * Sets isAutomaticBackPay + * + * @param bool|null $isAutomaticBackPay isAutomaticBackPay + * + * @return $this + */ + public function setIsAutomaticBackPay(?bool $isAutomaticBackPay): static + { + if (is_null($isAutomaticBackPay)) { + throw new InvalidArgumentException('non-nullable isAutomaticBackPay cannot be null'); + } + $this->container['isAutomaticBackPay'] = $isAutomaticBackPay; + + return $this; + } + + /** + * Gets hasSecondaryDescription + * + * @return bool|null + */ + public function getHasSecondaryDescription(): ?bool + { + return $this->container['hasSecondaryDescription']; + } + + /** + * Sets hasSecondaryDescription + * + * @param bool|null $hasSecondaryDescription hasSecondaryDescription + * + * @return $this + */ + public function setHasSecondaryDescription(?bool $hasSecondaryDescription): static + { + if (is_null($hasSecondaryDescription)) { + throw new InvalidArgumentException('non-nullable hasSecondaryDescription cannot be null'); + } + $this->container['hasSecondaryDescription'] = $hasSecondaryDescription; + + return $this; + } + + /** + * Gets contributesToBasicPay + * + * @return bool|null + */ + public function getContributesToBasicPay(): ?bool + { + return $this->container['contributesToBasicPay']; + } + + /** + * Sets contributesToBasicPay + * + * @param bool|null $contributesToBasicPay contributesToBasicPay + * + * @return $this + */ + public function setContributesToBasicPay(?bool $contributesToBasicPay): static + { + if (is_null($contributesToBasicPay)) { + throw new InvalidArgumentException('non-nullable contributesToBasicPay cannot be null'); + } + $this->container['contributesToBasicPay'] = $contributesToBasicPay; + + return $this; + } + + /** + * Gets isNotional + * + * @return bool|null + */ + public function getIsNotional(): ?bool + { + return $this->container['isNotional']; + } + + /** + * Sets isNotional + * + * @param bool|null $isNotional Determines whether the transaction involves non-monetary benefits for payroll processing, potentially subject to tax and National Insurance + * + * @return $this + */ + public function setIsNotional(?bool $isNotional): static + { + if (is_null($isNotional)) { + throw new InvalidArgumentException('non-nullable isNotional cannot be null'); + } + $this->container['isNotional'] = $isNotional; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PayslipLineType.php b/src/Model/PayslipLineType.php new file mode 100644 index 0000000..b18b6ad --- /dev/null +++ b/src/Model/PayslipLineType.php @@ -0,0 +1,53 @@ + + */ +class PayslipReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PayslipReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\Payslip', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\Payslip|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\Payslip + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\Payslip|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\Payslip $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PdfPaperMargins.php b/src/Model/PdfPaperMargins.php new file mode 100644 index 0000000..d653d95 --- /dev/null +++ b/src/Model/PdfPaperMargins.php @@ -0,0 +1,510 @@ + + */ +class PdfPaperMargins implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PdfPaperMargins'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'top' => 'float', + 'right' => 'float', + 'bottom' => 'float', + 'left' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'top' => 'double', + 'right' => 'double', + 'bottom' => 'double', + 'left' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'top' => false, + 'right' => false, + 'bottom' => false, + 'left' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'top' => 'top', + 'right' => 'right', + 'bottom' => 'bottom', + 'left' => 'left' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'top' => 'setTop', + 'right' => 'setRight', + 'bottom' => 'setBottom', + 'left' => 'setLeft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'top' => 'getTop', + 'right' => 'getRight', + 'bottom' => 'getBottom', + 'left' => 'getLeft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('top', $data ?? [], null); + $this->setIfExists('right', $data ?? [], null); + $this->setIfExists('bottom', $data ?? [], null); + $this->setIfExists('left', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets top + * + * @return float|null + */ + public function getTop(): ?float + { + return $this->container['top']; + } + + /** + * Sets top + * + * @param float|null $top top + * + * @return $this + */ + public function setTop(?float $top): static + { + if (is_null($top)) { + throw new InvalidArgumentException('non-nullable top cannot be null'); + } + $this->container['top'] = $top; + + return $this; + } + + /** + * Gets right + * + * @return float|null + */ + public function getRight(): ?float + { + return $this->container['right']; + } + + /** + * Sets right + * + * @param float|null $right right + * + * @return $this + */ + public function setRight(?float $right): static + { + if (is_null($right)) { + throw new InvalidArgumentException('non-nullable right cannot be null'); + } + $this->container['right'] = $right; + + return $this; + } + + /** + * Gets bottom + * + * @return float|null + */ + public function getBottom(): ?float + { + return $this->container['bottom']; + } + + /** + * Sets bottom + * + * @param float|null $bottom bottom + * + * @return $this + */ + public function setBottom(?float $bottom): static + { + if (is_null($bottom)) { + throw new InvalidArgumentException('non-nullable bottom cannot be null'); + } + $this->container['bottom'] = $bottom; + + return $this; + } + + /** + * Gets left + * + * @return float|null + */ + public function getLeft(): ?float + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param float|null $left left + * + * @return $this + */ + public function setLeft(?float $left): static + { + if (is_null($left)) { + throw new InvalidArgumentException('non-nullable left cannot be null'); + } + $this->container['left'] = $left; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PdfPaperOrientation.php b/src/Model/PdfPaperOrientation.php new file mode 100644 index 0000000..149232b --- /dev/null +++ b/src/Model/PdfPaperOrientation.php @@ -0,0 +1,45 @@ + + */ +class Pension implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Pension'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'contributionLevelType' => '\SynergiTech\Staffology\Model\PensionContributionLevelType', + 'endDate' => '\DateTime', + 'endReason' => '\SynergiTech\Staffology\Model\PensionEndReason', + 'joinReason' => '\SynergiTech\Staffology\Model\PensionJoinReason', + 'startPayRunEntryId' => 'int', + 'endPayRunEntryId' => 'int', + 'startReportingType' => '\SynergiTech\Staffology\Model\PensionReportingType', + 'endReportingType' => '\SynergiTech\Staffology\Model\PensionReportingType', + 'pensionOpeningBalances' => '\SynergiTech\Staffology\Model\PensionOpeningBalances', + 'reasonForLeaving' => 'string', + 'id' => 'string', + 'pensionSchemeId' => 'string', + 'pensionScheme' => '\SynergiTech\Staffology\Model\PensionScheme', + 'workerGroupId' => 'string', + 'workerGroup' => '\SynergiTech\Staffology\Model\WorkerGroup', + 'startDate' => '\DateTime', + 'memberReferenceNumber' => 'string', + 'overrideContributions' => 'bool', + 'employeeContribution' => 'float', + 'employeeContributionIsPercentage' => 'bool', + 'employerContribution' => 'float', + 'employerContributionIsPercentage' => 'bool', + 'employerContributionTopUpPercentage' => 'float', + 'isAeQualifyingScheme' => 'bool', + 'isTeachersPension' => 'bool', + 'aeStatusAtJoining' => '\SynergiTech\Staffology\Model\AeStatus', + 'externalEmployeeId' => 'string', + 'additionalVoluntaryContribution' => 'float', + 'avcIsPercentage' => 'bool', + 'exitViaProvider' => 'bool', + 'teachersPensionDetails' => '\SynergiTech\Staffology\Model\TeachersPensionDetails', + 'forcedTier' => 'string', + 'forceEnrolment' => 'bool', + 'employerContributionIncludesNiSaving' => 'bool', + 'employerContributionNiSavingPercentage' => 'float', + 'fiftyFiftySchemeMember' => 'bool', + 'associatedEmployeeRoles' => '\SynergiTech\Staffology\Model\Item[]', + 'autoEnrolled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'contributionLevelType' => null, + 'endDate' => 'date', + 'endReason' => null, + 'joinReason' => null, + 'startPayRunEntryId' => 'int32', + 'endPayRunEntryId' => 'int32', + 'startReportingType' => null, + 'endReportingType' => null, + 'pensionOpeningBalances' => null, + 'reasonForLeaving' => null, + 'id' => 'uuid', + 'pensionSchemeId' => 'uuid', + 'pensionScheme' => null, + 'workerGroupId' => 'uuid', + 'workerGroup' => null, + 'startDate' => 'date', + 'memberReferenceNumber' => null, + 'overrideContributions' => null, + 'employeeContribution' => 'double', + 'employeeContributionIsPercentage' => null, + 'employerContribution' => 'double', + 'employerContributionIsPercentage' => null, + 'employerContributionTopUpPercentage' => 'double', + 'isAeQualifyingScheme' => null, + 'isTeachersPension' => null, + 'aeStatusAtJoining' => null, + 'externalEmployeeId' => null, + 'additionalVoluntaryContribution' => 'double', + 'avcIsPercentage' => null, + 'exitViaProvider' => null, + 'teachersPensionDetails' => null, + 'forcedTier' => null, + 'forceEnrolment' => null, + 'employerContributionIncludesNiSaving' => null, + 'employerContributionNiSavingPercentage' => 'double', + 'fiftyFiftySchemeMember' => null, + 'associatedEmployeeRoles' => null, + 'autoEnrolled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'contributionLevelType' => false, + 'endDate' => true, + 'endReason' => false, + 'joinReason' => false, + 'startPayRunEntryId' => true, + 'endPayRunEntryId' => true, + 'startReportingType' => false, + 'endReportingType' => false, + 'pensionOpeningBalances' => false, + 'reasonForLeaving' => true, + 'id' => false, + 'pensionSchemeId' => false, + 'pensionScheme' => false, + 'workerGroupId' => false, + 'workerGroup' => false, + 'startDate' => false, + 'memberReferenceNumber' => true, + 'overrideContributions' => false, + 'employeeContribution' => false, + 'employeeContributionIsPercentage' => false, + 'employerContribution' => false, + 'employerContributionIsPercentage' => false, + 'employerContributionTopUpPercentage' => false, + 'isAeQualifyingScheme' => false, + 'isTeachersPension' => false, + 'aeStatusAtJoining' => false, + 'externalEmployeeId' => true, + 'additionalVoluntaryContribution' => false, + 'avcIsPercentage' => false, + 'exitViaProvider' => false, + 'teachersPensionDetails' => false, + 'forcedTier' => true, + 'forceEnrolment' => false, + 'employerContributionIncludesNiSaving' => false, + 'employerContributionNiSavingPercentage' => false, + 'fiftyFiftySchemeMember' => false, + 'associatedEmployeeRoles' => true, + 'autoEnrolled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'contributionLevelType' => 'contributionLevelType', + 'endDate' => 'endDate', + 'endReason' => 'endReason', + 'joinReason' => 'joinReason', + 'startPayRunEntryId' => 'startPayRunEntryId', + 'endPayRunEntryId' => 'endPayRunEntryId', + 'startReportingType' => 'startReportingType', + 'endReportingType' => 'endReportingType', + 'pensionOpeningBalances' => 'pensionOpeningBalances', + 'reasonForLeaving' => 'reasonForLeaving', + 'id' => 'id', + 'pensionSchemeId' => 'pensionSchemeId', + 'pensionScheme' => 'pensionScheme', + 'workerGroupId' => 'workerGroupId', + 'workerGroup' => 'workerGroup', + 'startDate' => 'startDate', + 'memberReferenceNumber' => 'memberReferenceNumber', + 'overrideContributions' => 'overrideContributions', + 'employeeContribution' => 'employeeContribution', + 'employeeContributionIsPercentage' => 'employeeContributionIsPercentage', + 'employerContribution' => 'employerContribution', + 'employerContributionIsPercentage' => 'employerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'employerContributionTopUpPercentage', + 'isAeQualifyingScheme' => 'isAeQualifyingScheme', + 'isTeachersPension' => 'isTeachersPension', + 'aeStatusAtJoining' => 'aeStatusAtJoining', + 'externalEmployeeId' => 'externalEmployeeId', + 'additionalVoluntaryContribution' => 'additionalVoluntaryContribution', + 'avcIsPercentage' => 'avcIsPercentage', + 'exitViaProvider' => 'exitViaProvider', + 'teachersPensionDetails' => 'teachersPensionDetails', + 'forcedTier' => 'forcedTier', + 'forceEnrolment' => 'forceEnrolment', + 'employerContributionIncludesNiSaving' => 'employerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'employerContributionNiSavingPercentage', + 'fiftyFiftySchemeMember' => 'fiftyFiftySchemeMember', + 'associatedEmployeeRoles' => 'associatedEmployeeRoles', + 'autoEnrolled' => 'autoEnrolled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'contributionLevelType' => 'setContributionLevelType', + 'endDate' => 'setEndDate', + 'endReason' => 'setEndReason', + 'joinReason' => 'setJoinReason', + 'startPayRunEntryId' => 'setStartPayRunEntryId', + 'endPayRunEntryId' => 'setEndPayRunEntryId', + 'startReportingType' => 'setStartReportingType', + 'endReportingType' => 'setEndReportingType', + 'pensionOpeningBalances' => 'setPensionOpeningBalances', + 'reasonForLeaving' => 'setReasonForLeaving', + 'id' => 'setId', + 'pensionSchemeId' => 'setPensionSchemeId', + 'pensionScheme' => 'setPensionScheme', + 'workerGroupId' => 'setWorkerGroupId', + 'workerGroup' => 'setWorkerGroup', + 'startDate' => 'setStartDate', + 'memberReferenceNumber' => 'setMemberReferenceNumber', + 'overrideContributions' => 'setOverrideContributions', + 'employeeContribution' => 'setEmployeeContribution', + 'employeeContributionIsPercentage' => 'setEmployeeContributionIsPercentage', + 'employerContribution' => 'setEmployerContribution', + 'employerContributionIsPercentage' => 'setEmployerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'setEmployerContributionTopUpPercentage', + 'isAeQualifyingScheme' => 'setIsAeQualifyingScheme', + 'isTeachersPension' => 'setIsTeachersPension', + 'aeStatusAtJoining' => 'setAeStatusAtJoining', + 'externalEmployeeId' => 'setExternalEmployeeId', + 'additionalVoluntaryContribution' => 'setAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'setAvcIsPercentage', + 'exitViaProvider' => 'setExitViaProvider', + 'teachersPensionDetails' => 'setTeachersPensionDetails', + 'forcedTier' => 'setForcedTier', + 'forceEnrolment' => 'setForceEnrolment', + 'employerContributionIncludesNiSaving' => 'setEmployerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'setEmployerContributionNiSavingPercentage', + 'fiftyFiftySchemeMember' => 'setFiftyFiftySchemeMember', + 'associatedEmployeeRoles' => 'setAssociatedEmployeeRoles', + 'autoEnrolled' => 'setAutoEnrolled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'contributionLevelType' => 'getContributionLevelType', + 'endDate' => 'getEndDate', + 'endReason' => 'getEndReason', + 'joinReason' => 'getJoinReason', + 'startPayRunEntryId' => 'getStartPayRunEntryId', + 'endPayRunEntryId' => 'getEndPayRunEntryId', + 'startReportingType' => 'getStartReportingType', + 'endReportingType' => 'getEndReportingType', + 'pensionOpeningBalances' => 'getPensionOpeningBalances', + 'reasonForLeaving' => 'getReasonForLeaving', + 'id' => 'getId', + 'pensionSchemeId' => 'getPensionSchemeId', + 'pensionScheme' => 'getPensionScheme', + 'workerGroupId' => 'getWorkerGroupId', + 'workerGroup' => 'getWorkerGroup', + 'startDate' => 'getStartDate', + 'memberReferenceNumber' => 'getMemberReferenceNumber', + 'overrideContributions' => 'getOverrideContributions', + 'employeeContribution' => 'getEmployeeContribution', + 'employeeContributionIsPercentage' => 'getEmployeeContributionIsPercentage', + 'employerContribution' => 'getEmployerContribution', + 'employerContributionIsPercentage' => 'getEmployerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'getEmployerContributionTopUpPercentage', + 'isAeQualifyingScheme' => 'getIsAeQualifyingScheme', + 'isTeachersPension' => 'getIsTeachersPension', + 'aeStatusAtJoining' => 'getAeStatusAtJoining', + 'externalEmployeeId' => 'getExternalEmployeeId', + 'additionalVoluntaryContribution' => 'getAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'getAvcIsPercentage', + 'exitViaProvider' => 'getExitViaProvider', + 'teachersPensionDetails' => 'getTeachersPensionDetails', + 'forcedTier' => 'getForcedTier', + 'forceEnrolment' => 'getForceEnrolment', + 'employerContributionIncludesNiSaving' => 'getEmployerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'getEmployerContributionNiSavingPercentage', + 'fiftyFiftySchemeMember' => 'getFiftyFiftySchemeMember', + 'associatedEmployeeRoles' => 'getAssociatedEmployeeRoles', + 'autoEnrolled' => 'getAutoEnrolled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('contributionLevelType', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('endReason', $data ?? [], null); + $this->setIfExists('joinReason', $data ?? [], null); + $this->setIfExists('startPayRunEntryId', $data ?? [], null); + $this->setIfExists('endPayRunEntryId', $data ?? [], null); + $this->setIfExists('startReportingType', $data ?? [], null); + $this->setIfExists('endReportingType', $data ?? [], null); + $this->setIfExists('pensionOpeningBalances', $data ?? [], null); + $this->setIfExists('reasonForLeaving', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('pensionSchemeId', $data ?? [], null); + $this->setIfExists('pensionScheme', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + $this->setIfExists('workerGroup', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('memberReferenceNumber', $data ?? [], null); + $this->setIfExists('overrideContributions', $data ?? [], null); + $this->setIfExists('employeeContribution', $data ?? [], null); + $this->setIfExists('employeeContributionIsPercentage', $data ?? [], null); + $this->setIfExists('employerContribution', $data ?? [], null); + $this->setIfExists('employerContributionIsPercentage', $data ?? [], null); + $this->setIfExists('employerContributionTopUpPercentage', $data ?? [], null); + $this->setIfExists('isAeQualifyingScheme', $data ?? [], null); + $this->setIfExists('isTeachersPension', $data ?? [], null); + $this->setIfExists('aeStatusAtJoining', $data ?? [], null); + $this->setIfExists('externalEmployeeId', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContribution', $data ?? [], null); + $this->setIfExists('avcIsPercentage', $data ?? [], null); + $this->setIfExists('exitViaProvider', $data ?? [], null); + $this->setIfExists('teachersPensionDetails', $data ?? [], null); + $this->setIfExists('forcedTier', $data ?? [], null); + $this->setIfExists('forceEnrolment', $data ?? [], null); + $this->setIfExists('employerContributionIncludesNiSaving', $data ?? [], null); + $this->setIfExists('employerContributionNiSavingPercentage', $data ?? [], null); + $this->setIfExists('fiftyFiftySchemeMember', $data ?? [], null); + $this->setIfExists('associatedEmployeeRoles', $data ?? [], null); + $this->setIfExists('autoEnrolled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['reasonForLeaving']) && (mb_strlen($this->container['reasonForLeaving']) > 100)) { + $invalidProperties[] = "invalid value for 'reasonForLeaving', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['memberReferenceNumber']) && (mb_strlen($this->container['memberReferenceNumber']) > 25)) { + $invalidProperties[] = "invalid value for 'memberReferenceNumber', the character length must be smaller than or equal to 25."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets contributionLevelType + * + * @return \SynergiTech\Staffology\Model\PensionContributionLevelType|null + */ + public function getContributionLevelType(): ?\SynergiTech\Staffology\Model\PensionContributionLevelType + { + return $this->container['contributionLevelType']; + } + + /** + * Sets contributionLevelType + * + * @param \SynergiTech\Staffology\Model\PensionContributionLevelType|null $contributionLevelType contributionLevelType + * + * @return $this + */ + public function setContributionLevelType(?\SynergiTech\Staffology\Model\PensionContributionLevelType $contributionLevelType): static + { + if (is_null($contributionLevelType)) { + throw new InvalidArgumentException('non-nullable contributionLevelType cannot be null'); + } + $this->container['contributionLevelType'] = $contributionLevelType; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate The date the employee left the scheme + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets endReason + * + * @return \SynergiTech\Staffology\Model\PensionEndReason|null + */ + public function getEndReason(): ?\SynergiTech\Staffology\Model\PensionEndReason + { + return $this->container['endReason']; + } + + /** + * Sets endReason + * + * @param \SynergiTech\Staffology\Model\PensionEndReason|null $endReason endReason + * + * @return $this + */ + public function setEndReason(?\SynergiTech\Staffology\Model\PensionEndReason $endReason): static + { + if (is_null($endReason)) { + throw new InvalidArgumentException('non-nullable endReason cannot be null'); + } + $this->container['endReason'] = $endReason; + + return $this; + } + + /** + * Gets joinReason + * + * @return \SynergiTech\Staffology\Model\PensionJoinReason|null + */ + public function getJoinReason(): ?\SynergiTech\Staffology\Model\PensionJoinReason + { + return $this->container['joinReason']; + } + + /** + * Sets joinReason + * + * @param \SynergiTech\Staffology\Model\PensionJoinReason|null $joinReason joinReason + * + * @return $this + */ + public function setJoinReason(?\SynergiTech\Staffology\Model\PensionJoinReason $joinReason): static + { + if (is_null($joinReason)) { + throw new InvalidArgumentException('non-nullable joinReason cannot be null'); + } + $this->container['joinReason'] = $joinReason; + + return $this; + } + + /** + * Gets startPayRunEntryId + * + * @return int|null + */ + public function getStartPayRunEntryId(): ?int + { + return $this->container['startPayRunEntryId']; + } + + /** + * Sets startPayRunEntryId + * + * @param int|null $startPayRunEntryId [readonly] Holds the Id for the payroll that the employee joined the scheme + * + * @return $this + */ + public function setStartPayRunEntryId(?int $startPayRunEntryId): static + { + if (is_null($startPayRunEntryId)) { + array_push($this->openAPINullablesSetToNull, 'startPayRunEntryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPayRunEntryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPayRunEntryId'] = $startPayRunEntryId; + + return $this; + } + + /** + * Gets endPayRunEntryId + * + * @return int|null + */ + public function getEndPayRunEntryId(): ?int + { + return $this->container['endPayRunEntryId']; + } + + /** + * Sets endPayRunEntryId + * + * @param int|null $endPayRunEntryId [readonly] Holds the Id for the payroll that the employee left the scheme + * + * @return $this + */ + public function setEndPayRunEntryId(?int $endPayRunEntryId): static + { + if (is_null($endPayRunEntryId)) { + array_push($this->openAPINullablesSetToNull, 'endPayRunEntryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPayRunEntryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPayRunEntryId'] = $endPayRunEntryId; + + return $this; + } + + /** + * Gets startReportingType + * + * @return \SynergiTech\Staffology\Model\PensionReportingType|null + */ + public function getStartReportingType(): ?\SynergiTech\Staffology\Model\PensionReportingType + { + return $this->container['startReportingType']; + } + + /** + * Sets startReportingType + * + * @param \SynergiTech\Staffology\Model\PensionReportingType|null $startReportingType startReportingType + * + * @return $this + */ + public function setStartReportingType(?\SynergiTech\Staffology\Model\PensionReportingType $startReportingType): static + { + if (is_null($startReportingType)) { + throw new InvalidArgumentException('non-nullable startReportingType cannot be null'); + } + $this->container['startReportingType'] = $startReportingType; + + return $this; + } + + /** + * Gets endReportingType + * + * @return \SynergiTech\Staffology\Model\PensionReportingType|null + */ + public function getEndReportingType(): ?\SynergiTech\Staffology\Model\PensionReportingType + { + return $this->container['endReportingType']; + } + + /** + * Sets endReportingType + * + * @param \SynergiTech\Staffology\Model\PensionReportingType|null $endReportingType endReportingType + * + * @return $this + */ + public function setEndReportingType(?\SynergiTech\Staffology\Model\PensionReportingType $endReportingType): static + { + if (is_null($endReportingType)) { + throw new InvalidArgumentException('non-nullable endReportingType cannot be null'); + } + $this->container['endReportingType'] = $endReportingType; + + return $this; + } + + /** + * Gets pensionOpeningBalances + * + * @return \SynergiTech\Staffology\Model\PensionOpeningBalances|null + */ + public function getPensionOpeningBalances(): ?\SynergiTech\Staffology\Model\PensionOpeningBalances + { + return $this->container['pensionOpeningBalances']; + } + + /** + * Sets pensionOpeningBalances + * + * @param \SynergiTech\Staffology\Model\PensionOpeningBalances|null $pensionOpeningBalances pensionOpeningBalances + * + * @return $this + */ + public function setPensionOpeningBalances(?\SynergiTech\Staffology\Model\PensionOpeningBalances $pensionOpeningBalances): static + { + if (is_null($pensionOpeningBalances)) { + throw new InvalidArgumentException('non-nullable pensionOpeningBalances cannot be null'); + } + $this->container['pensionOpeningBalances'] = $pensionOpeningBalances; + + return $this; + } + + /** + * Gets reasonForLeaving + * + * @return string|null + */ + public function getReasonForLeaving(): ?string + { + return $this->container['reasonForLeaving']; + } + + /** + * Sets reasonForLeaving + * + * @param string|null $reasonForLeaving If a value is provided for EndDate then this is the reason for leaving the employee left the scheme + * + * @return $this + */ + public function setReasonForLeaving(?string $reasonForLeaving): static + { + if (is_null($reasonForLeaving)) { + array_push($this->openAPINullablesSetToNull, 'reasonForLeaving'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reasonForLeaving', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($reasonForLeaving) && (mb_strlen($reasonForLeaving) > 100)) { + throw new InvalidArgumentException('invalid length for $reasonForLeaving when calling Pension., must be smaller than or equal to 100.'); + } + + $this->container['reasonForLeaving'] = $reasonForLeaving; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets pensionSchemeId + * + * @return string|null + */ + public function getPensionSchemeId(): ?string + { + return $this->container['pensionSchemeId']; + } + + /** + * Sets pensionSchemeId + * + * @param string|null $pensionSchemeId pensionSchemeId + * + * @return $this + */ + public function setPensionSchemeId(?string $pensionSchemeId): static + { + if (is_null($pensionSchemeId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeId cannot be null'); + } + $this->container['pensionSchemeId'] = $pensionSchemeId; + + return $this; + } + + /** + * Gets pensionScheme + * + * @return \SynergiTech\Staffology\Model\PensionScheme|null + */ + public function getPensionScheme(): ?\SynergiTech\Staffology\Model\PensionScheme + { + return $this->container['pensionScheme']; + } + + /** + * Sets pensionScheme + * + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme pensionScheme + * + * @return $this + */ + public function setPensionScheme(?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme): static + { + if (is_null($pensionScheme)) { + throw new InvalidArgumentException('non-nullable pensionScheme cannot be null'); + } + $this->container['pensionScheme'] = $pensionScheme; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId workerGroupId + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + + /** + * Gets workerGroup + * + * @return \SynergiTech\Staffology\Model\WorkerGroup|null + */ + public function getWorkerGroup(): ?\SynergiTech\Staffology\Model\WorkerGroup + { + return $this->container['workerGroup']; + } + + /** + * Sets workerGroup + * + * @param \SynergiTech\Staffology\Model\WorkerGroup|null $workerGroup workerGroup + * + * @return $this + */ + public function setWorkerGroup(?\SynergiTech\Staffology\Model\WorkerGroup $workerGroup): static + { + if (is_null($workerGroup)) { + throw new InvalidArgumentException('non-nullable workerGroup cannot be null'); + } + $this->container['workerGroup'] = $workerGroup; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets memberReferenceNumber + * + * @return string|null + */ + public function getMemberReferenceNumber(): ?string + { + return $this->container['memberReferenceNumber']; + } + + /** + * Sets memberReferenceNumber + * + * @param string|null $memberReferenceNumber memberReferenceNumber + * + * @return $this + */ + public function setMemberReferenceNumber(?string $memberReferenceNumber): static + { + if (is_null($memberReferenceNumber)) { + array_push($this->openAPINullablesSetToNull, 'memberReferenceNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('memberReferenceNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($memberReferenceNumber) && (mb_strlen($memberReferenceNumber) > 25)) { + throw new InvalidArgumentException('invalid length for $memberReferenceNumber when calling Pension., must be smaller than or equal to 25.'); + } + + $this->container['memberReferenceNumber'] = $memberReferenceNumber; + + return $this; + } + + /** + * Gets overrideContributions + * + * @return bool|null + */ + public function getOverrideContributions(): ?bool + { + return $this->container['overrideContributions']; + } + + /** + * Sets overrideContributions + * + * @param bool|null $overrideContributions If this is set to true then the Contributions levels set for the WorkerGroup will be replaced with the values provided here + * + * @return $this + */ + public function setOverrideContributions(?bool $overrideContributions): static + { + if (is_null($overrideContributions)) { + throw new InvalidArgumentException('non-nullable overrideContributions cannot be null'); + } + $this->container['overrideContributions'] = $overrideContributions; + + return $this; + } + + /** + * Gets employeeContribution + * + * @return float|null + */ + public function getEmployeeContribution(): ?float + { + return $this->container['employeeContribution']; + } + + /** + * Sets employeeContribution + * + * @param float|null $employeeContribution The amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on EmployeeContributionIsPercentage. This is read-only if OverrideContributions is false + * + * @return $this + */ + public function setEmployeeContribution(?float $employeeContribution): static + { + if (is_null($employeeContribution)) { + throw new InvalidArgumentException('non-nullable employeeContribution cannot be null'); + } + $this->container['employeeContribution'] = $employeeContribution; + + return $this; + } + + /** + * Gets employeeContributionIsPercentage + * + * @return bool|null + */ + public function getEmployeeContributionIsPercentage(): ?bool + { + return $this->container['employeeContributionIsPercentage']; + } + + /** + * Sets employeeContributionIsPercentage + * + * @param bool|null $employeeContributionIsPercentage Determines whether the Value of the EmployeeContribution is a fixed amount or a percentage, + * + * @return $this + */ + public function setEmployeeContributionIsPercentage(?bool $employeeContributionIsPercentage): static + { + if (is_null($employeeContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employeeContributionIsPercentage cannot be null'); + } + $this->container['employeeContributionIsPercentage'] = $employeeContributionIsPercentage; + + return $this; + } + + /** + * Gets employerContribution + * + * @return float|null + */ + public function getEmployerContribution(): ?float + { + return $this->container['employerContribution']; + } + + /** + * Sets employerContribution + * + * @param float|null $employerContribution The amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on EmployerContributionIsPercentage. This is read-only if OverrideContributions is false + * + * @return $this + */ + public function setEmployerContribution(?float $employerContribution): static + { + if (is_null($employerContribution)) { + throw new InvalidArgumentException('non-nullable employerContribution cannot be null'); + } + $this->container['employerContribution'] = $employerContribution; + + return $this; + } + + /** + * Gets employerContributionIsPercentage + * + * @return bool|null + */ + public function getEmployerContributionIsPercentage(): ?bool + { + return $this->container['employerContributionIsPercentage']; + } + + /** + * Sets employerContributionIsPercentage + * + * @param bool|null $employerContributionIsPercentage Determines whether the Value of the EmployerContribution is a fixed amount or a percentage, + * + * @return $this + */ + public function setEmployerContributionIsPercentage(?bool $employerContributionIsPercentage): static + { + if (is_null($employerContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionIsPercentage cannot be null'); + } + $this->container['employerContributionIsPercentage'] = $employerContributionIsPercentage; + + return $this; + } + + /** + * Gets employerContributionTopUpPercentage + * + * @return float|null + */ + public function getEmployerContributionTopUpPercentage(): ?float + { + return $this->container['employerContributionTopUpPercentage']; + } + + /** + * Sets employerContributionTopUpPercentage + * + * @param float|null $employerContributionTopUpPercentage Increase Employer Contribution by this percentage of the Employee Contribution + * + * @return $this + */ + public function setEmployerContributionTopUpPercentage(?float $employerContributionTopUpPercentage): static + { + if (is_null($employerContributionTopUpPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionTopUpPercentage cannot be null'); + } + $this->container['employerContributionTopUpPercentage'] = $employerContributionTopUpPercentage; + + return $this; + } + + /** + * Gets isAeQualifyingScheme + * + * @return bool|null + */ + public function getIsAeQualifyingScheme(): ?bool + { + return $this->container['isAeQualifyingScheme']; + } + + /** + * Sets isAeQualifyingScheme + * + * @param bool|null $isAeQualifyingScheme [readonly] Whether or not the associated PensionScheme is a Qualifying Scheme for AutoEnrolment + * + * @return $this + */ + public function setIsAeQualifyingScheme(?bool $isAeQualifyingScheme): static + { + if (is_null($isAeQualifyingScheme)) { + throw new InvalidArgumentException('non-nullable isAeQualifyingScheme cannot be null'); + } + $this->container['isAeQualifyingScheme'] = $isAeQualifyingScheme; + + return $this; + } + + /** + * Gets isTeachersPension + * + * @return bool|null + */ + public function getIsTeachersPension(): ?bool + { + return $this->container['isTeachersPension']; + } + + /** + * Sets isTeachersPension + * + * @param bool|null $isTeachersPension [readonly] Whether or not the associated PensionScheme is a Teachers' Pension (determined by its CsvFormat) + * + * @return $this + */ + public function setIsTeachersPension(?bool $isTeachersPension): static + { + if (is_null($isTeachersPension)) { + throw new InvalidArgumentException('non-nullable isTeachersPension cannot be null'); + } + $this->container['isTeachersPension'] = $isTeachersPension; + + return $this; + } + + /** + * Gets aeStatusAtJoining + * + * @return \SynergiTech\Staffology\Model\AeStatus|null + */ + public function getAeStatusAtJoining(): ?\SynergiTech\Staffology\Model\AeStatus + { + return $this->container['aeStatusAtJoining']; + } + + /** + * Sets aeStatusAtJoining + * + * @param \SynergiTech\Staffology\Model\AeStatus|null $aeStatusAtJoining aeStatusAtJoining + * + * @return $this + */ + public function setAeStatusAtJoining(?\SynergiTech\Staffology\Model\AeStatus $aeStatusAtJoining): static + { + if (is_null($aeStatusAtJoining)) { + throw new InvalidArgumentException('non-nullable aeStatusAtJoining cannot be null'); + } + $this->container['aeStatusAtJoining'] = $aeStatusAtJoining; + + return $this; + } + + /** + * Gets externalEmployeeId + * + * @return string|null + */ + public function getExternalEmployeeId(): ?string + { + return $this->container['externalEmployeeId']; + } + + /** + * Sets externalEmployeeId + * + * @param string|null $externalEmployeeId [readonly] + * + * @return $this + */ + public function setExternalEmployeeId(?string $externalEmployeeId): static + { + if (is_null($externalEmployeeId)) { + array_push($this->openAPINullablesSetToNull, 'externalEmployeeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('externalEmployeeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['externalEmployeeId'] = $externalEmployeeId; + + return $this; + } + + /** + * Gets additionalVoluntaryContribution + * + * @return float|null + */ + public function getAdditionalVoluntaryContribution(): ?float + { + return $this->container['additionalVoluntaryContribution']; + } + + /** + * Sets additionalVoluntaryContribution + * + * @param float|null $additionalVoluntaryContribution Any additional voluntary amount the employer contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage. + * + * @return $this + */ + public function setAdditionalVoluntaryContribution(?float $additionalVoluntaryContribution): static + { + if (is_null($additionalVoluntaryContribution)) { + throw new InvalidArgumentException('non-nullable additionalVoluntaryContribution cannot be null'); + } + $this->container['additionalVoluntaryContribution'] = $additionalVoluntaryContribution; + + return $this; + } + + /** + * Gets avcIsPercentage + * + * @return bool|null + */ + public function getAvcIsPercentage(): ?bool + { + return $this->container['avcIsPercentage']; + } + + /** + * Sets avcIsPercentage + * + * @param bool|null $avcIsPercentage Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, + * + * @return $this + */ + public function setAvcIsPercentage(?bool $avcIsPercentage): static + { + if (is_null($avcIsPercentage)) { + throw new InvalidArgumentException('non-nullable avcIsPercentage cannot be null'); + } + $this->container['avcIsPercentage'] = $avcIsPercentage; + + return $this; + } + + /** + * Gets exitViaProvider + * + * @return bool|null + */ + public function getExitViaProvider(): ?bool + { + return $this->container['exitViaProvider']; + } + + /** + * Sets exitViaProvider + * + * @param bool|null $exitViaProvider exitViaProvider + * + * @return $this + */ + public function setExitViaProvider(?bool $exitViaProvider): static + { + if (is_null($exitViaProvider)) { + throw new InvalidArgumentException('non-nullable exitViaProvider cannot be null'); + } + $this->container['exitViaProvider'] = $exitViaProvider; + + return $this; + } + + /** + * Gets teachersPensionDetails + * + * @return \SynergiTech\Staffology\Model\TeachersPensionDetails|null + */ + public function getTeachersPensionDetails(): ?\SynergiTech\Staffology\Model\TeachersPensionDetails + { + return $this->container['teachersPensionDetails']; + } + + /** + * Sets teachersPensionDetails + * + * @param \SynergiTech\Staffology\Model\TeachersPensionDetails|null $teachersPensionDetails teachersPensionDetails + * + * @return $this + */ + public function setTeachersPensionDetails(?\SynergiTech\Staffology\Model\TeachersPensionDetails $teachersPensionDetails): static + { + if (is_null($teachersPensionDetails)) { + throw new InvalidArgumentException('non-nullable teachersPensionDetails cannot be null'); + } + $this->container['teachersPensionDetails'] = $teachersPensionDetails; + + return $this; + } + + /** + * Gets forcedTier + * + * @return string|null + */ + public function getForcedTier(): ?string + { + return $this->container['forcedTier']; + } + + /** + * Sets forcedTier + * + * @param string|null $forcedTier If the WorkerGroup ContributionLevelType is a Tiered Scheme then you can specify the name of the tier to force the employee on to. If none is specified then the Tier is determined by the earnings in the period + * + * @return $this + */ + public function setForcedTier(?string $forcedTier): static + { + if (is_null($forcedTier)) { + array_push($this->openAPINullablesSetToNull, 'forcedTier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcedTier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forcedTier'] = $forcedTier; + + return $this; + } + + /** + * Gets forceEnrolment + * + * @return bool|null + */ + public function getForceEnrolment(): ?bool + { + return $this->container['forceEnrolment']; + } + + /** + * Sets forceEnrolment + * + * @param bool|null $forceEnrolment If the PensionScheme is connected to an ExternalDataProvider that supports enrolment then setting this to true will force this employee to be enrolled with the next submission. + * + * @return $this + */ + public function setForceEnrolment(?bool $forceEnrolment): static + { + if (is_null($forceEnrolment)) { + throw new InvalidArgumentException('non-nullable forceEnrolment cannot be null'); + } + $this->container['forceEnrolment'] = $forceEnrolment; + + return $this; + } + + /** + * Gets employerContributionIncludesNiSaving + * + * @return bool|null + */ + public function getEmployerContributionIncludesNiSaving(): ?bool + { + return $this->container['employerContributionIncludesNiSaving']; + } + + /** + * Sets employerContributionIncludesNiSaving + * + * @param bool|null $employerContributionIncludesNiSaving Employer Contribution includes the Employers NI saving + * + * @return $this + */ + public function setEmployerContributionIncludesNiSaving(?bool $employerContributionIncludesNiSaving): static + { + if (is_null($employerContributionIncludesNiSaving)) { + throw new InvalidArgumentException('non-nullable employerContributionIncludesNiSaving cannot be null'); + } + $this->container['employerContributionIncludesNiSaving'] = $employerContributionIncludesNiSaving; + + return $this; + } + + /** + * Gets employerContributionNiSavingPercentage + * + * @return float|null + */ + public function getEmployerContributionNiSavingPercentage(): ?float + { + return $this->container['employerContributionNiSavingPercentage']; + } + + /** + * Sets employerContributionNiSavingPercentage + * + * @param float|null $employerContributionNiSavingPercentage Increase Employer Contribution by this percentage of the Employers NI saving + * + * @return $this + */ + public function setEmployerContributionNiSavingPercentage(?float $employerContributionNiSavingPercentage): static + { + if (is_null($employerContributionNiSavingPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionNiSavingPercentage cannot be null'); + } + $this->container['employerContributionNiSavingPercentage'] = $employerContributionNiSavingPercentage; + + return $this; + } + + /** + * Gets fiftyFiftySchemeMember + * + * @return bool|null + */ + public function getFiftyFiftySchemeMember(): ?bool + { + return $this->container['fiftyFiftySchemeMember']; + } + + /** + * Sets fiftyFiftySchemeMember + * + * @param bool|null $fiftyFiftySchemeMember if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions. + * + * @return $this + */ + public function setFiftyFiftySchemeMember(?bool $fiftyFiftySchemeMember): static + { + if (is_null($fiftyFiftySchemeMember)) { + throw new InvalidArgumentException('non-nullable fiftyFiftySchemeMember cannot be null'); + } + $this->container['fiftyFiftySchemeMember'] = $fiftyFiftySchemeMember; + + return $this; + } + + /** + * Gets associatedEmployeeRoles + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getAssociatedEmployeeRoles(): ?array + { + return $this->container['associatedEmployeeRoles']; + } + + /** + * Sets associatedEmployeeRoles + * + * @param \SynergiTech\Staffology\Model\Item[]|null $associatedEmployeeRoles The list of employee roles associated with the pension membership + * + * @return $this + */ + public function setAssociatedEmployeeRoles(?array $associatedEmployeeRoles): static + { + if (is_null($associatedEmployeeRoles)) { + array_push($this->openAPINullablesSetToNull, 'associatedEmployeeRoles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('associatedEmployeeRoles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['associatedEmployeeRoles'] = $associatedEmployeeRoles; + + return $this; + } + + /** + * Gets autoEnrolled + * + * @return bool|null + */ + public function getAutoEnrolled(): ?bool + { + return $this->container['autoEnrolled']; + } + + /** + * Sets autoEnrolled + * + * @param bool|null $autoEnrolled [readonly] Is True if the employee joined this Pension due to an AutoEnrolment action + * + * @return $this + */ + public function setAutoEnrolled(?bool $autoEnrolled): static + { + if (is_null($autoEnrolled)) { + throw new InvalidArgumentException('non-nullable autoEnrolled cannot be null'); + } + $this->container['autoEnrolled'] = $autoEnrolled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionAdministrator.php b/src/Model/PensionAdministrator.php new file mode 100644 index 0000000..6773bc1 --- /dev/null +++ b/src/Model/PensionAdministrator.php @@ -0,0 +1,589 @@ + + */ +class PensionAdministrator implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionAdministrator'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'email' => 'string', + 'address' => '\SynergiTech\Staffology\Model\Address', + 'telephone' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'email' => null, + 'address' => null, + 'telephone' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'email' => true, + 'address' => false, + 'telephone' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'email' => 'email', + 'address' => 'address', + 'telephone' => 'telephone', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'email' => 'setEmail', + 'address' => 'setAddress', + 'telephone' => 'setTelephone', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'email' => 'getEmail', + 'address' => 'getAddress', + 'telephone' => 'getTelephone', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 150)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 150)) { + $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 100)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($name) && (mb_strlen($name) > 150)) { + throw new InvalidArgumentException('invalid length for $name when calling PensionAdministrator., must be smaller than or equal to 150.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail(): ?string + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail(?string $email): static + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($email) && (mb_strlen($email) > 150)) { + throw new InvalidArgumentException('invalid length for $email when calling PensionAdministrator., must be smaller than or equal to 150.'); + } + + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 100)) { + throw new InvalidArgumentException('invalid length for $telephone when calling PensionAdministrator., must be smaller than or equal to 100.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionContributionLevelType.php b/src/Model/PensionContributionLevelType.php new file mode 100644 index 0000000..159061b --- /dev/null +++ b/src/Model/PensionContributionLevelType.php @@ -0,0 +1,87 @@ + + */ +class PensionContributionsSubmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionContributionsSubmission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employerId' => 'int', + 'payRunId' => 'int', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'schemeId' => 'int', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'externalId' => 'string', + 'statusMessage' => 'string', + 'submissionData' => 'mixed', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employerId' => 'int32', + 'payRunId' => 'int32', + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'taxYear' => null, + 'schemeId' => 'int32', + 'status' => null, + 'externalId' => null, + 'statusMessage' => null, + 'submissionData' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employerId' => false, + 'payRunId' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'taxYear' => false, + 'schemeId' => false, + 'status' => false, + 'externalId' => true, + 'statusMessage' => true, + 'submissionData' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employerId' => 'employerId', + 'payRunId' => 'payRunId', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'taxYear' => 'taxYear', + 'schemeId' => 'schemeId', + 'status' => 'status', + 'externalId' => 'externalId', + 'statusMessage' => 'statusMessage', + 'submissionData' => 'submissionData', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employerId' => 'setEmployerId', + 'payRunId' => 'setPayRunId', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'taxYear' => 'setTaxYear', + 'schemeId' => 'setSchemeId', + 'status' => 'setStatus', + 'externalId' => 'setExternalId', + 'statusMessage' => 'setStatusMessage', + 'submissionData' => 'setSubmissionData', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employerId' => 'getEmployerId', + 'payRunId' => 'getPayRunId', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'taxYear' => 'getTaxYear', + 'schemeId' => 'getSchemeId', + 'status' => 'getStatus', + 'externalId' => 'getExternalId', + 'statusMessage' => 'getStatusMessage', + 'submissionData' => 'getSubmissionData', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employerId', $data ?? [], null); + $this->setIfExists('payRunId', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('schemeId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('externalId', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('submissionData', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employerId + * + * @return int|null + */ + public function getEmployerId(): ?int + { + return $this->container['employerId']; + } + + /** + * Sets employerId + * + * @param int|null $employerId employerId + * + * @return $this + */ + public function setEmployerId(?int $employerId): static + { + if (is_null($employerId)) { + throw new InvalidArgumentException('non-nullable employerId cannot be null'); + } + $this->container['employerId'] = $employerId; + + return $this; + } + + /** + * Gets payRunId + * + * @return int|null + */ + public function getPayRunId(): ?int + { + return $this->container['payRunId']; + } + + /** + * Sets payRunId + * + * @param int|null $payRunId payRunId + * + * @return $this + */ + public function setPayRunId(?int $payRunId): static + { + if (is_null($payRunId)) { + throw new InvalidArgumentException('non-nullable payRunId cannot be null'); + } + $this->container['payRunId'] = $payRunId; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets schemeId + * + * @return int|null + */ + public function getSchemeId(): ?int + { + return $this->container['schemeId']; + } + + /** + * Sets schemeId + * + * @param int|null $schemeId schemeId + * + * @return $this + */ + public function setSchemeId(?int $schemeId): static + { + if (is_null($schemeId)) { + throw new InvalidArgumentException('non-nullable schemeId cannot be null'); + } + $this->container['schemeId'] = $schemeId; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets externalId + * + * @return string|null + */ + public function getExternalId(): ?string + { + return $this->container['externalId']; + } + + /** + * Sets externalId + * + * @param string|null $externalId externalId + * + * @return $this + */ + public function setExternalId(?string $externalId): static + { + if (is_null($externalId)) { + array_push($this->openAPINullablesSetToNull, 'externalId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('externalId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['externalId'] = $externalId; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage statusMessage + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets submissionData + * + * @return mixed|null + */ + public function getSubmissionData(): mixed + { + return $this->container['submissionData']; + } + + /** + * Sets submissionData + * + * @param mixed|null $submissionData submissionData + * + * @return $this + */ + public function setSubmissionData(mixed $submissionData): static + { + if (is_null($submissionData)) { + array_push($this->openAPINullablesSetToNull, 'submissionData'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('submissionData', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['submissionData'] = $submissionData; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionCsvFormat.php b/src/Model/PensionCsvFormat.php new file mode 100644 index 0000000..bd60bf7 --- /dev/null +++ b/src/Model/PensionCsvFormat.php @@ -0,0 +1,91 @@ + + */ +class PensionMembershipReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionMembershipReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'pensionScheme' => 'string', + 'workerGroup' => 'string', + 'joinDate' => 'string', + 'joinReason' => '\SynergiTech\Staffology\Model\PensionJoinReason', + 'isPensionJoinerActionReported' => 'bool', + 'endDate' => 'string', + 'endReason' => '\SynergiTech\Staffology\Model\PensionEndReason', + 'isPensionLeaverActionReported' => 'bool', + 'aeStatusAtJoining' => '\SynergiTech\Staffology\Model\AeStatus', + 'roleRefs' => 'string', + 'pensionEmployeeContribution' => 'float', + 'isEmployeeContributionPercentage' => 'bool', + 'pensionTiers' => 'string', + 'pensionAVCContribution' => 'float', + 'isAvcPercentage' => 'bool', + 'pensionEmployerContribution' => 'float', + 'isEmployerContributionPercentage' => 'bool', + 'pensionMembershipNo' => 'string', + 'mcrRoleID1' => 'string', + 'mcrRoleID2' => 'string', + 'isHalfContributionMember' => 'bool', + 'tpAdminNino' => 'string', + 'pensionableEarningsYTD' => 'float', + 'pensionablePayYTD' => 'float', + 'employeePensionYTD' => 'float', + 'avcPensionYTD' => 'float', + 'employerPensionYTD' => 'float', + 'assumedPensionablePayYTD' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'pensionScheme' => null, + 'workerGroup' => null, + 'joinDate' => null, + 'joinReason' => null, + 'isPensionJoinerActionReported' => null, + 'endDate' => null, + 'endReason' => null, + 'isPensionLeaverActionReported' => null, + 'aeStatusAtJoining' => null, + 'roleRefs' => null, + 'pensionEmployeeContribution' => 'double', + 'isEmployeeContributionPercentage' => null, + 'pensionTiers' => null, + 'pensionAVCContribution' => 'double', + 'isAvcPercentage' => null, + 'pensionEmployerContribution' => 'double', + 'isEmployerContributionPercentage' => null, + 'pensionMembershipNo' => null, + 'mcrRoleID1' => null, + 'mcrRoleID2' => null, + 'isHalfContributionMember' => null, + 'tpAdminNino' => null, + 'pensionableEarningsYTD' => 'double', + 'pensionablePayYTD' => 'double', + 'employeePensionYTD' => 'double', + 'avcPensionYTD' => 'double', + 'employerPensionYTD' => 'double', + 'assumedPensionablePayYTD' => 'double', + 'employee' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'pensionScheme' => true, + 'workerGroup' => true, + 'joinDate' => true, + 'joinReason' => false, + 'isPensionJoinerActionReported' => false, + 'endDate' => true, + 'endReason' => false, + 'isPensionLeaverActionReported' => true, + 'aeStatusAtJoining' => false, + 'roleRefs' => true, + 'pensionEmployeeContribution' => true, + 'isEmployeeContributionPercentage' => false, + 'pensionTiers' => true, + 'pensionAVCContribution' => true, + 'isAvcPercentage' => false, + 'pensionEmployerContribution' => true, + 'isEmployerContributionPercentage' => false, + 'pensionMembershipNo' => true, + 'mcrRoleID1' => true, + 'mcrRoleID2' => true, + 'isHalfContributionMember' => true, + 'tpAdminNino' => true, + 'pensionableEarningsYTD' => true, + 'pensionablePayYTD' => true, + 'employeePensionYTD' => true, + 'avcPensionYTD' => true, + 'employerPensionYTD' => true, + 'assumedPensionablePayYTD' => true, + 'employee' => false, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'pensionScheme' => 'pensionScheme', + 'workerGroup' => 'workerGroup', + 'joinDate' => 'joinDate', + 'joinReason' => 'joinReason', + 'isPensionJoinerActionReported' => 'isPensionJoinerActionReported', + 'endDate' => 'endDate', + 'endReason' => 'endReason', + 'isPensionLeaverActionReported' => 'isPensionLeaverActionReported', + 'aeStatusAtJoining' => 'aeStatusAtJoining', + 'roleRefs' => 'roleRefs', + 'pensionEmployeeContribution' => 'pensionEmployeeContribution', + 'isEmployeeContributionPercentage' => 'isEmployeeContributionPercentage', + 'pensionTiers' => 'pensionTiers', + 'pensionAVCContribution' => 'pensionAVCContribution', + 'isAvcPercentage' => 'isAvcPercentage', + 'pensionEmployerContribution' => 'pensionEmployerContribution', + 'isEmployerContributionPercentage' => 'isEmployerContributionPercentage', + 'pensionMembershipNo' => 'pensionMembershipNo', + 'mcrRoleID1' => 'mcrRoleID1', + 'mcrRoleID2' => 'mcrRoleID2', + 'isHalfContributionMember' => 'isHalfContributionMember', + 'tpAdminNino' => 'tpAdminNino', + 'pensionableEarningsYTD' => 'pensionableEarningsYTD', + 'pensionablePayYTD' => 'pensionablePayYTD', + 'employeePensionYTD' => 'employeePensionYTD', + 'avcPensionYTD' => 'avcPensionYTD', + 'employerPensionYTD' => 'employerPensionYTD', + 'assumedPensionablePayYTD' => 'assumedPensionablePayYTD', + 'employee' => 'employee', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'pensionScheme' => 'setPensionScheme', + 'workerGroup' => 'setWorkerGroup', + 'joinDate' => 'setJoinDate', + 'joinReason' => 'setJoinReason', + 'isPensionJoinerActionReported' => 'setIsPensionJoinerActionReported', + 'endDate' => 'setEndDate', + 'endReason' => 'setEndReason', + 'isPensionLeaverActionReported' => 'setIsPensionLeaverActionReported', + 'aeStatusAtJoining' => 'setAeStatusAtJoining', + 'roleRefs' => 'setRoleRefs', + 'pensionEmployeeContribution' => 'setPensionEmployeeContribution', + 'isEmployeeContributionPercentage' => 'setIsEmployeeContributionPercentage', + 'pensionTiers' => 'setPensionTiers', + 'pensionAVCContribution' => 'setPensionAVCContribution', + 'isAvcPercentage' => 'setIsAvcPercentage', + 'pensionEmployerContribution' => 'setPensionEmployerContribution', + 'isEmployerContributionPercentage' => 'setIsEmployerContributionPercentage', + 'pensionMembershipNo' => 'setPensionMembershipNo', + 'mcrRoleID1' => 'setMcrRoleID1', + 'mcrRoleID2' => 'setMcrRoleID2', + 'isHalfContributionMember' => 'setIsHalfContributionMember', + 'tpAdminNino' => 'setTpAdminNino', + 'pensionableEarningsYTD' => 'setPensionableEarningsYTD', + 'pensionablePayYTD' => 'setPensionablePayYTD', + 'employeePensionYTD' => 'setEmployeePensionYTD', + 'avcPensionYTD' => 'setAvcPensionYTD', + 'employerPensionYTD' => 'setEmployerPensionYTD', + 'assumedPensionablePayYTD' => 'setAssumedPensionablePayYTD', + 'employee' => 'setEmployee', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'pensionScheme' => 'getPensionScheme', + 'workerGroup' => 'getWorkerGroup', + 'joinDate' => 'getJoinDate', + 'joinReason' => 'getJoinReason', + 'isPensionJoinerActionReported' => 'getIsPensionJoinerActionReported', + 'endDate' => 'getEndDate', + 'endReason' => 'getEndReason', + 'isPensionLeaverActionReported' => 'getIsPensionLeaverActionReported', + 'aeStatusAtJoining' => 'getAeStatusAtJoining', + 'roleRefs' => 'getRoleRefs', + 'pensionEmployeeContribution' => 'getPensionEmployeeContribution', + 'isEmployeeContributionPercentage' => 'getIsEmployeeContributionPercentage', + 'pensionTiers' => 'getPensionTiers', + 'pensionAVCContribution' => 'getPensionAVCContribution', + 'isAvcPercentage' => 'getIsAvcPercentage', + 'pensionEmployerContribution' => 'getPensionEmployerContribution', + 'isEmployerContributionPercentage' => 'getIsEmployerContributionPercentage', + 'pensionMembershipNo' => 'getPensionMembershipNo', + 'mcrRoleID1' => 'getMcrRoleID1', + 'mcrRoleID2' => 'getMcrRoleID2', + 'isHalfContributionMember' => 'getIsHalfContributionMember', + 'tpAdminNino' => 'getTpAdminNino', + 'pensionableEarningsYTD' => 'getPensionableEarningsYTD', + 'pensionablePayYTD' => 'getPensionablePayYTD', + 'employeePensionYTD' => 'getEmployeePensionYTD', + 'avcPensionYTD' => 'getAvcPensionYTD', + 'employerPensionYTD' => 'getEmployerPensionYTD', + 'assumedPensionablePayYTD' => 'getAssumedPensionablePayYTD', + 'employee' => 'getEmployee', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('pensionScheme', $data ?? [], null); + $this->setIfExists('workerGroup', $data ?? [], null); + $this->setIfExists('joinDate', $data ?? [], null); + $this->setIfExists('joinReason', $data ?? [], null); + $this->setIfExists('isPensionJoinerActionReported', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('endReason', $data ?? [], null); + $this->setIfExists('isPensionLeaverActionReported', $data ?? [], null); + $this->setIfExists('aeStatusAtJoining', $data ?? [], null); + $this->setIfExists('roleRefs', $data ?? [], null); + $this->setIfExists('pensionEmployeeContribution', $data ?? [], null); + $this->setIfExists('isEmployeeContributionPercentage', $data ?? [], null); + $this->setIfExists('pensionTiers', $data ?? [], null); + $this->setIfExists('pensionAVCContribution', $data ?? [], null); + $this->setIfExists('isAvcPercentage', $data ?? [], null); + $this->setIfExists('pensionEmployerContribution', $data ?? [], null); + $this->setIfExists('isEmployerContributionPercentage', $data ?? [], null); + $this->setIfExists('pensionMembershipNo', $data ?? [], null); + $this->setIfExists('mcrRoleID1', $data ?? [], null); + $this->setIfExists('mcrRoleID2', $data ?? [], null); + $this->setIfExists('isHalfContributionMember', $data ?? [], null); + $this->setIfExists('tpAdminNino', $data ?? [], null); + $this->setIfExists('pensionableEarningsYTD', $data ?? [], null); + $this->setIfExists('pensionablePayYTD', $data ?? [], null); + $this->setIfExists('employeePensionYTD', $data ?? [], null); + $this->setIfExists('avcPensionYTD', $data ?? [], null); + $this->setIfExists('employerPensionYTD', $data ?? [], null); + $this->setIfExists('assumedPensionablePayYTD', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode Payroll code of the employee + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets pensionScheme + * + * @return string|null + */ + public function getPensionScheme(): ?string + { + return $this->container['pensionScheme']; + } + + /** + * Sets pensionScheme + * + * @param string|null $pensionScheme Employee pension scheme + * + * @return $this + */ + public function setPensionScheme(?string $pensionScheme): static + { + if (is_null($pensionScheme)) { + array_push($this->openAPINullablesSetToNull, 'pensionScheme'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionScheme', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionScheme'] = $pensionScheme; + + return $this; + } + + /** + * Gets workerGroup + * + * @return string|null + */ + public function getWorkerGroup(): ?string + { + return $this->container['workerGroup']; + } + + /** + * Sets workerGroup + * + * @param string|null $workerGroup The WorkerGroup of the employee pension scheme + * + * @return $this + */ + public function setWorkerGroup(?string $workerGroup): static + { + if (is_null($workerGroup)) { + array_push($this->openAPINullablesSetToNull, 'workerGroup'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workerGroup', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workerGroup'] = $workerGroup; + + return $this; + } + + /** + * Gets joinDate + * + * @return string|null + */ + public function getJoinDate(): ?string + { + return $this->container['joinDate']; + } + + /** + * Sets joinDate + * + * @param string|null $joinDate The Join Date of the employee + * + * @return $this + */ + public function setJoinDate(?string $joinDate): static + { + if (is_null($joinDate)) { + array_push($this->openAPINullablesSetToNull, 'joinDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('joinDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['joinDate'] = $joinDate; + + return $this; + } + + /** + * Gets joinReason + * + * @return \SynergiTech\Staffology\Model\PensionJoinReason|null + */ + public function getJoinReason(): ?\SynergiTech\Staffology\Model\PensionJoinReason + { + return $this->container['joinReason']; + } + + /** + * Sets joinReason + * + * @param \SynergiTech\Staffology\Model\PensionJoinReason|null $joinReason joinReason + * + * @return $this + */ + public function setJoinReason(?\SynergiTech\Staffology\Model\PensionJoinReason $joinReason): static + { + if (is_null($joinReason)) { + throw new InvalidArgumentException('non-nullable joinReason cannot be null'); + } + $this->container['joinReason'] = $joinReason; + + return $this; + } + + /** + * Gets isPensionJoinerActionReported + * + * @return bool|null + */ + public function getIsPensionJoinerActionReported(): ?bool + { + return $this->container['isPensionJoinerActionReported']; + } + + /** + * Sets isPensionJoinerActionReported + * + * @param bool|null $isPensionJoinerActionReported Indicates whether the pension joiner action is reported. + * + * @return $this + */ + public function setIsPensionJoinerActionReported(?bool $isPensionJoinerActionReported): static + { + if (is_null($isPensionJoinerActionReported)) { + throw new InvalidArgumentException('non-nullable isPensionJoinerActionReported cannot be null'); + } + $this->container['isPensionJoinerActionReported'] = $isPensionJoinerActionReported; + + return $this; + } + + /** + * Gets endDate + * + * @return string|null + */ + public function getEndDate(): ?string + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param string|null $endDate Pension End Date + * + * @return $this + */ + public function setEndDate(?string $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets endReason + * + * @return \SynergiTech\Staffology\Model\PensionEndReason|null + */ + public function getEndReason(): ?\SynergiTech\Staffology\Model\PensionEndReason + { + return $this->container['endReason']; + } + + /** + * Sets endReason + * + * @param \SynergiTech\Staffology\Model\PensionEndReason|null $endReason endReason + * + * @return $this + */ + public function setEndReason(?\SynergiTech\Staffology\Model\PensionEndReason $endReason): static + { + if (is_null($endReason)) { + throw new InvalidArgumentException('non-nullable endReason cannot be null'); + } + $this->container['endReason'] = $endReason; + + return $this; + } + + /** + * Gets isPensionLeaverActionReported + * + * @return bool|null + */ + public function getIsPensionLeaverActionReported(): ?bool + { + return $this->container['isPensionLeaverActionReported']; + } + + /** + * Sets isPensionLeaverActionReported + * + * @param bool|null $isPensionLeaverActionReported Indicates whether the pension leaver action is reported. + * + * @return $this + */ + public function setIsPensionLeaverActionReported(?bool $isPensionLeaverActionReported): static + { + if (is_null($isPensionLeaverActionReported)) { + array_push($this->openAPINullablesSetToNull, 'isPensionLeaverActionReported'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('isPensionLeaverActionReported', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['isPensionLeaverActionReported'] = $isPensionLeaverActionReported; + + return $this; + } + + /** + * Gets aeStatusAtJoining + * + * @return \SynergiTech\Staffology\Model\AeStatus|null + */ + public function getAeStatusAtJoining(): ?\SynergiTech\Staffology\Model\AeStatus + { + return $this->container['aeStatusAtJoining']; + } + + /** + * Sets aeStatusAtJoining + * + * @param \SynergiTech\Staffology\Model\AeStatus|null $aeStatusAtJoining aeStatusAtJoining + * + * @return $this + */ + public function setAeStatusAtJoining(?\SynergiTech\Staffology\Model\AeStatus $aeStatusAtJoining): static + { + if (is_null($aeStatusAtJoining)) { + throw new InvalidArgumentException('non-nullable aeStatusAtJoining cannot be null'); + } + $this->container['aeStatusAtJoining'] = $aeStatusAtJoining; + + return $this; + } + + /** + * Gets roleRefs + * + * @return string|null + */ + public function getRoleRefs(): ?string + { + return $this->container['roleRefs']; + } + + /** + * Sets roleRefs + * + * @param string|null $roleRefs role references of employee + * + * @return $this + */ + public function setRoleRefs(?string $roleRefs): static + { + if (is_null($roleRefs)) { + array_push($this->openAPINullablesSetToNull, 'roleRefs'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('roleRefs', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['roleRefs'] = $roleRefs; + + return $this; + } + + /** + * Gets pensionEmployeeContribution + * + * @return float|null + */ + public function getPensionEmployeeContribution(): ?float + { + return $this->container['pensionEmployeeContribution']; + } + + /** + * Sets pensionEmployeeContribution + * + * @param float|null $pensionEmployeeContribution Pension Employee Contribution + * + * @return $this + */ + public function setPensionEmployeeContribution(?float $pensionEmployeeContribution): static + { + if (is_null($pensionEmployeeContribution)) { + array_push($this->openAPINullablesSetToNull, 'pensionEmployeeContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionEmployeeContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionEmployeeContribution'] = $pensionEmployeeContribution; + + return $this; + } + + /** + * Gets isEmployeeContributionPercentage + * + * @return bool|null + */ + public function getIsEmployeeContributionPercentage(): ?bool + { + return $this->container['isEmployeeContributionPercentage']; + } + + /** + * Sets isEmployeeContributionPercentage + * + * @param bool|null $isEmployeeContributionPercentage Indicates whether the EmployeeContribution is expressed as a percentage. + * + * @return $this + */ + public function setIsEmployeeContributionPercentage(?bool $isEmployeeContributionPercentage): static + { + if (is_null($isEmployeeContributionPercentage)) { + throw new InvalidArgumentException('non-nullable isEmployeeContributionPercentage cannot be null'); + } + $this->container['isEmployeeContributionPercentage'] = $isEmployeeContributionPercentage; + + return $this; + } + + /** + * Gets pensionTiers + * + * @return string|null + */ + public function getPensionTiers(): ?string + { + return $this->container['pensionTiers']; + } + + /** + * Sets pensionTiers + * + * @param string|null $pensionTiers Pension Tiers of the employee + * + * @return $this + */ + public function setPensionTiers(?string $pensionTiers): static + { + if (is_null($pensionTiers)) { + array_push($this->openAPINullablesSetToNull, 'pensionTiers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionTiers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionTiers'] = $pensionTiers; + + return $this; + } + + /** + * Gets pensionAVCContribution + * + * @return float|null + */ + public function getPensionAVCContribution(): ?float + { + return $this->container['pensionAVCContribution']; + } + + /** + * Sets pensionAVCContribution + * + * @param float|null $pensionAVCContribution Pension AVC Contribution of employee + * + * @return $this + */ + public function setPensionAVCContribution(?float $pensionAVCContribution): static + { + if (is_null($pensionAVCContribution)) { + array_push($this->openAPINullablesSetToNull, 'pensionAVCContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionAVCContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionAVCContribution'] = $pensionAVCContribution; + + return $this; + } + + /** + * Gets isAvcPercentage + * + * @return bool|null + */ + public function getIsAvcPercentage(): ?bool + { + return $this->container['isAvcPercentage']; + } + + /** + * Sets isAvcPercentage + * + * @param bool|null $isAvcPercentage Indicates whether the AvcContribution is expressed as a percentage. + * + * @return $this + */ + public function setIsAvcPercentage(?bool $isAvcPercentage): static + { + if (is_null($isAvcPercentage)) { + throw new InvalidArgumentException('non-nullable isAvcPercentage cannot be null'); + } + $this->container['isAvcPercentage'] = $isAvcPercentage; + + return $this; + } + + /** + * Gets pensionEmployerContribution + * + * @return float|null + */ + public function getPensionEmployerContribution(): ?float + { + return $this->container['pensionEmployerContribution']; + } + + /** + * Sets pensionEmployerContribution + * + * @param float|null $pensionEmployerContribution Employer Pension Contribution + * + * @return $this + */ + public function setPensionEmployerContribution(?float $pensionEmployerContribution): static + { + if (is_null($pensionEmployerContribution)) { + array_push($this->openAPINullablesSetToNull, 'pensionEmployerContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionEmployerContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionEmployerContribution'] = $pensionEmployerContribution; + + return $this; + } + + /** + * Gets isEmployerContributionPercentage + * + * @return bool|null + */ + public function getIsEmployerContributionPercentage(): ?bool + { + return $this->container['isEmployerContributionPercentage']; + } + + /** + * Sets isEmployerContributionPercentage + * + * @param bool|null $isEmployerContributionPercentage Indicates whether the EmployerContribution is expressed as a percentage. + * + * @return $this + */ + public function setIsEmployerContributionPercentage(?bool $isEmployerContributionPercentage): static + { + if (is_null($isEmployerContributionPercentage)) { + throw new InvalidArgumentException('non-nullable isEmployerContributionPercentage cannot be null'); + } + $this->container['isEmployerContributionPercentage'] = $isEmployerContributionPercentage; + + return $this; + } + + /** + * Gets pensionMembershipNo + * + * @return string|null + */ + public function getPensionMembershipNo(): ?string + { + return $this->container['pensionMembershipNo']; + } + + /** + * Sets pensionMembershipNo + * + * @param string|null $pensionMembershipNo Pension Membership Number + * + * @return $this + */ + public function setPensionMembershipNo(?string $pensionMembershipNo): static + { + if (is_null($pensionMembershipNo)) { + array_push($this->openAPINullablesSetToNull, 'pensionMembershipNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionMembershipNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionMembershipNo'] = $pensionMembershipNo; + + return $this; + } + + /** + * Gets mcrRoleID1 + * + * @return string|null + */ + public function getMcrRoleID1(): ?string + { + return $this->container['mcrRoleID1']; + } + + /** + * Sets mcrRoleID1 + * + * @param string|null $mcrRoleID1 MCR Role ID1 for teachers pension + * + * @return $this + */ + public function setMcrRoleID1(?string $mcrRoleID1): static + { + if (is_null($mcrRoleID1)) { + array_push($this->openAPINullablesSetToNull, 'mcrRoleID1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mcrRoleID1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mcrRoleID1'] = $mcrRoleID1; + + return $this; + } + + /** + * Gets mcrRoleID2 + * + * @return string|null + */ + public function getMcrRoleID2(): ?string + { + return $this->container['mcrRoleID2']; + } + + /** + * Sets mcrRoleID2 + * + * @param string|null $mcrRoleID2 MCR Role ID2 for teachers pension + * + * @return $this + */ + public function setMcrRoleID2(?string $mcrRoleID2): static + { + if (is_null($mcrRoleID2)) { + array_push($this->openAPINullablesSetToNull, 'mcrRoleID2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mcrRoleID2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mcrRoleID2'] = $mcrRoleID2; + + return $this; + } + + /** + * Gets isHalfContributionMember + * + * @return bool|null + */ + public function getIsHalfContributionMember(): ?bool + { + return $this->container['isHalfContributionMember']; + } + + /** + * Sets isHalfContributionMember + * + * @param bool|null $isHalfContributionMember 50/50 membership + * + * @return $this + */ + public function setIsHalfContributionMember(?bool $isHalfContributionMember): static + { + if (is_null($isHalfContributionMember)) { + array_push($this->openAPINullablesSetToNull, 'isHalfContributionMember'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('isHalfContributionMember', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['isHalfContributionMember'] = $isHalfContributionMember; + + return $this; + } + + /** + * Gets tpAdminNino + * + * @return string|null + */ + public function getTpAdminNino(): ?string + { + return $this->container['tpAdminNino']; + } + + /** + * Sets tpAdminNino + * + * @param string|null $tpAdminNino Teachers Pension Admin Ni Number + * + * @return $this + */ + public function setTpAdminNino(?string $tpAdminNino): static + { + if (is_null($tpAdminNino)) { + array_push($this->openAPINullablesSetToNull, 'tpAdminNino'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tpAdminNino', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tpAdminNino'] = $tpAdminNino; + + return $this; + } + + /** + * Gets pensionableEarningsYTD + * + * @return float|null + */ + public function getPensionableEarningsYTD(): ?float + { + return $this->container['pensionableEarningsYTD']; + } + + /** + * Sets pensionableEarningsYTD + * + * @param float|null $pensionableEarningsYTD Pensionable earning year to date + * + * @return $this + */ + public function setPensionableEarningsYTD(?float $pensionableEarningsYTD): static + { + if (is_null($pensionableEarningsYTD)) { + array_push($this->openAPINullablesSetToNull, 'pensionableEarningsYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionableEarningsYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionableEarningsYTD'] = $pensionableEarningsYTD; + + return $this; + } + + /** + * Gets pensionablePayYTD + * + * @return float|null + */ + public function getPensionablePayYTD(): ?float + { + return $this->container['pensionablePayYTD']; + } + + /** + * Sets pensionablePayYTD + * + * @param float|null $pensionablePayYTD Pensionable Pay year to date + * + * @return $this + */ + public function setPensionablePayYTD(?float $pensionablePayYTD): static + { + if (is_null($pensionablePayYTD)) { + array_push($this->openAPINullablesSetToNull, 'pensionablePayYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionablePayYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionablePayYTD'] = $pensionablePayYTD; + + return $this; + } + + /** + * Gets employeePensionYTD + * + * @return float|null + */ + public function getEmployeePensionYTD(): ?float + { + return $this->container['employeePensionYTD']; + } + + /** + * Sets employeePensionYTD + * + * @param float|null $employeePensionYTD Employee pension year to date + * + * @return $this + */ + public function setEmployeePensionYTD(?float $employeePensionYTD): static + { + if (is_null($employeePensionYTD)) { + array_push($this->openAPINullablesSetToNull, 'employeePensionYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeePensionYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeePensionYTD'] = $employeePensionYTD; + + return $this; + } + + /** + * Gets avcPensionYTD + * + * @return float|null + */ + public function getAvcPensionYTD(): ?float + { + return $this->container['avcPensionYTD']; + } + + /** + * Sets avcPensionYTD + * + * @param float|null $avcPensionYTD Additional Voluntary Contribution YTD + * + * @return $this + */ + public function setAvcPensionYTD(?float $avcPensionYTD): static + { + if (is_null($avcPensionYTD)) { + array_push($this->openAPINullablesSetToNull, 'avcPensionYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avcPensionYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avcPensionYTD'] = $avcPensionYTD; + + return $this; + } + + /** + * Gets employerPensionYTD + * + * @return float|null + */ + public function getEmployerPensionYTD(): ?float + { + return $this->container['employerPensionYTD']; + } + + /** + * Sets employerPensionYTD + * + * @param float|null $employerPensionYTD Employer pension year to date + * + * @return $this + */ + public function setEmployerPensionYTD(?float $employerPensionYTD): static + { + if (is_null($employerPensionYTD)) { + array_push($this->openAPINullablesSetToNull, 'employerPensionYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerPensionYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerPensionYTD'] = $employerPensionYTD; + + return $this; + } + + /** + * Gets assumedPensionablePayYTD + * + * @return float|null + */ + public function getAssumedPensionablePayYTD(): ?float + { + return $this->container['assumedPensionablePayYTD']; + } + + /** + * Sets assumedPensionablePayYTD + * + * @param float|null $assumedPensionablePayYTD Assumed pensionable pay year to date + * + * @return $this + */ + public function setAssumedPensionablePayYTD(?float $assumedPensionablePayYTD): static + { + if (is_null($assumedPensionablePayYTD)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePayYTD'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePayYTD', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePayYTD'] = $assumedPensionablePayYTD; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionMembershipsReport.php b/src/Model/PensionMembershipsReport.php new file mode 100644 index 0000000..8b89ff9 --- /dev/null +++ b/src/Model/PensionMembershipsReport.php @@ -0,0 +1,878 @@ + + */ +class PensionMembershipsReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionMembershipsReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\PensionMembershipReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\PensionMembershipReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\PensionMembershipReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionMembershipsReportReportResponse.php b/src/Model/PensionMembershipsReportReportResponse.php new file mode 100644 index 0000000..7bb2162 --- /dev/null +++ b/src/Model/PensionMembershipsReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class PensionMembershipsReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionMembershipsReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\PensionMembershipsReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\PensionMembershipsReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\PensionMembershipsReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\PensionMembershipsReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\PensionMembershipsReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionOpeningBalances.php b/src/Model/PensionOpeningBalances.php new file mode 100644 index 0000000..eb7d912 --- /dev/null +++ b/src/Model/PensionOpeningBalances.php @@ -0,0 +1,590 @@ + + */ +class PensionOpeningBalances implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionOpeningBalances'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionableEarnings' => 'float', + 'pensionablePay' => 'float', + 'employeePensionContribution' => 'float', + 'employeePensionContributionAvc' => 'float', + 'employerPensionContribution' => 'float', + 'assumedPensionablePay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionableEarnings' => 'double', + 'pensionablePay' => 'double', + 'employeePensionContribution' => 'double', + 'employeePensionContributionAvc' => 'double', + 'employerPensionContribution' => 'double', + 'assumedPensionablePay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionableEarnings' => false, + 'pensionablePay' => false, + 'employeePensionContribution' => false, + 'employeePensionContributionAvc' => false, + 'employerPensionContribution' => false, + 'assumedPensionablePay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionableEarnings' => 'pensionableEarnings', + 'pensionablePay' => 'pensionablePay', + 'employeePensionContribution' => 'employeePensionContribution', + 'employeePensionContributionAvc' => 'employeePensionContributionAvc', + 'employerPensionContribution' => 'employerPensionContribution', + 'assumedPensionablePay' => 'assumedPensionablePay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionableEarnings' => 'setPensionableEarnings', + 'pensionablePay' => 'setPensionablePay', + 'employeePensionContribution' => 'setEmployeePensionContribution', + 'employeePensionContributionAvc' => 'setEmployeePensionContributionAvc', + 'employerPensionContribution' => 'setEmployerPensionContribution', + 'assumedPensionablePay' => 'setAssumedPensionablePay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionableEarnings' => 'getPensionableEarnings', + 'pensionablePay' => 'getPensionablePay', + 'employeePensionContribution' => 'getEmployeePensionContribution', + 'employeePensionContributionAvc' => 'getEmployeePensionContributionAvc', + 'employerPensionContribution' => 'getEmployerPensionContribution', + 'assumedPensionablePay' => 'getAssumedPensionablePay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionableEarnings', $data ?? [], null); + $this->setIfExists('pensionablePay', $data ?? [], null); + $this->setIfExists('employeePensionContribution', $data ?? [], null); + $this->setIfExists('employeePensionContributionAvc', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionableEarnings + * + * @return float|null + */ + public function getPensionableEarnings(): ?float + { + return $this->container['pensionableEarnings']; + } + + /** + * Sets pensionableEarnings + * + * @param float|null $pensionableEarnings Opening balances for pensionable earnings + * + * @return $this + */ + public function setPensionableEarnings(?float $pensionableEarnings): static + { + if (is_null($pensionableEarnings)) { + throw new InvalidArgumentException('non-nullable pensionableEarnings cannot be null'); + } + + + $this->container['pensionableEarnings'] = $pensionableEarnings; + + return $this; + } + + /** + * Gets pensionablePay + * + * @return float|null + */ + public function getPensionablePay(): ?float + { + return $this->container['pensionablePay']; + } + + /** + * Sets pensionablePay + * + * @param float|null $pensionablePay Opening balances for pensionable pay + * + * @return $this + */ + public function setPensionablePay(?float $pensionablePay): static + { + if (is_null($pensionablePay)) { + throw new InvalidArgumentException('non-nullable pensionablePay cannot be null'); + } + + + $this->container['pensionablePay'] = $pensionablePay; + + return $this; + } + + /** + * Gets employeePensionContribution + * + * @return float|null + */ + public function getEmployeePensionContribution(): ?float + { + return $this->container['employeePensionContribution']; + } + + /** + * Sets employeePensionContribution + * + * @param float|null $employeePensionContribution Opening balances for employee pension contribution + * + * @return $this + */ + public function setEmployeePensionContribution(?float $employeePensionContribution): static + { + if (is_null($employeePensionContribution)) { + throw new InvalidArgumentException('non-nullable employeePensionContribution cannot be null'); + } + + + $this->container['employeePensionContribution'] = $employeePensionContribution; + + return $this; + } + + /** + * Gets employeePensionContributionAvc + * + * @return float|null + */ + public function getEmployeePensionContributionAvc(): ?float + { + return $this->container['employeePensionContributionAvc']; + } + + /** + * Sets employeePensionContributionAvc + * + * @param float|null $employeePensionContributionAvc Opening balances for employee pension contribution avc + * + * @return $this + */ + public function setEmployeePensionContributionAvc(?float $employeePensionContributionAvc): static + { + if (is_null($employeePensionContributionAvc)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionAvc cannot be null'); + } + + + $this->container['employeePensionContributionAvc'] = $employeePensionContributionAvc; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return float|null + */ + public function getEmployerPensionContribution(): ?float + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param float|null $employerPensionContribution Opening balances for employer pension contribution + * + * @return $this + */ + public function setEmployerPensionContribution(?float $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + throw new InvalidArgumentException('non-nullable employerPensionContribution cannot be null'); + } + + + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float|null + */ + public function getAssumedPensionablePay(): ?float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float|null $assumedPensionablePay Opening balances for assumed pensionable pay + * + * @return $this + */ + public function setAssumedPensionablePay(?float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + throw new InvalidArgumentException('non-nullable assumedPensionablePay cannot be null'); + } + + + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionPayCode.php b/src/Model/PensionPayCode.php new file mode 100644 index 0000000..a58d0b7 --- /dev/null +++ b/src/Model/PensionPayCode.php @@ -0,0 +1,47 @@ + + */ +class PensionProvider implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionProvider'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'accountNo' => 'string', + 'portal' => 'string', + 'website' => 'string', + 'address' => '\SynergiTech\Staffology\Model\Address', + 'telephone' => 'string', + 'papdisVersion' => '\SynergiTech\Staffology\Model\PapdisVersion', + 'papdisProviderId' => 'string', + 'papdisEmployerId' => 'string', + 'csvFormat' => '\SynergiTech\Staffology\Model\PensionCsvFormat', + 'excludeNilPaidFromContributions' => 'bool', + 'payPeriodDateAdjustment' => 'int', + 'miscBoolean1' => 'bool', + 'miscBoolean2' => 'bool', + 'miscString1' => 'string', + 'miscString2' => 'string', + 'optOutWindow' => 'int', + 'optOutWindowIsMonths' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'accountNo' => null, + 'portal' => 'uri', + 'website' => 'uri', + 'address' => null, + 'telephone' => null, + 'papdisVersion' => null, + 'papdisProviderId' => null, + 'papdisEmployerId' => null, + 'csvFormat' => null, + 'excludeNilPaidFromContributions' => null, + 'payPeriodDateAdjustment' => 'int32', + 'miscBoolean1' => null, + 'miscBoolean2' => null, + 'miscString1' => null, + 'miscString2' => null, + 'optOutWindow' => 'int32', + 'optOutWindowIsMonths' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'accountNo' => true, + 'portal' => true, + 'website' => true, + 'address' => false, + 'telephone' => true, + 'papdisVersion' => false, + 'papdisProviderId' => true, + 'papdisEmployerId' => true, + 'csvFormat' => false, + 'excludeNilPaidFromContributions' => false, + 'payPeriodDateAdjustment' => false, + 'miscBoolean1' => false, + 'miscBoolean2' => false, + 'miscString1' => true, + 'miscString2' => true, + 'optOutWindow' => false, + 'optOutWindowIsMonths' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'accountNo' => 'accountNo', + 'portal' => 'portal', + 'website' => 'website', + 'address' => 'address', + 'telephone' => 'telephone', + 'papdisVersion' => 'papdisVersion', + 'papdisProviderId' => 'papdisProviderId', + 'papdisEmployerId' => 'papdisEmployerId', + 'csvFormat' => 'csvFormat', + 'excludeNilPaidFromContributions' => 'excludeNilPaidFromContributions', + 'payPeriodDateAdjustment' => 'payPeriodDateAdjustment', + 'miscBoolean1' => 'miscBoolean1', + 'miscBoolean2' => 'miscBoolean2', + 'miscString1' => 'miscString1', + 'miscString2' => 'miscString2', + 'optOutWindow' => 'optOutWindow', + 'optOutWindowIsMonths' => 'optOutWindowIsMonths', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'accountNo' => 'setAccountNo', + 'portal' => 'setPortal', + 'website' => 'setWebsite', + 'address' => 'setAddress', + 'telephone' => 'setTelephone', + 'papdisVersion' => 'setPapdisVersion', + 'papdisProviderId' => 'setPapdisProviderId', + 'papdisEmployerId' => 'setPapdisEmployerId', + 'csvFormat' => 'setCsvFormat', + 'excludeNilPaidFromContributions' => 'setExcludeNilPaidFromContributions', + 'payPeriodDateAdjustment' => 'setPayPeriodDateAdjustment', + 'miscBoolean1' => 'setMiscBoolean1', + 'miscBoolean2' => 'setMiscBoolean2', + 'miscString1' => 'setMiscString1', + 'miscString2' => 'setMiscString2', + 'optOutWindow' => 'setOptOutWindow', + 'optOutWindowIsMonths' => 'setOptOutWindowIsMonths', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'accountNo' => 'getAccountNo', + 'portal' => 'getPortal', + 'website' => 'getWebsite', + 'address' => 'getAddress', + 'telephone' => 'getTelephone', + 'papdisVersion' => 'getPapdisVersion', + 'papdisProviderId' => 'getPapdisProviderId', + 'papdisEmployerId' => 'getPapdisEmployerId', + 'csvFormat' => 'getCsvFormat', + 'excludeNilPaidFromContributions' => 'getExcludeNilPaidFromContributions', + 'payPeriodDateAdjustment' => 'getPayPeriodDateAdjustment', + 'miscBoolean1' => 'getMiscBoolean1', + 'miscBoolean2' => 'getMiscBoolean2', + 'miscString1' => 'getMiscString1', + 'miscString2' => 'getMiscString2', + 'optOutWindow' => 'getOptOutWindow', + 'optOutWindowIsMonths' => 'getOptOutWindowIsMonths', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('accountNo', $data ?? [], null); + $this->setIfExists('portal', $data ?? [], null); + $this->setIfExists('website', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('papdisVersion', $data ?? [], null); + $this->setIfExists('papdisProviderId', $data ?? [], null); + $this->setIfExists('papdisEmployerId', $data ?? [], null); + $this->setIfExists('csvFormat', $data ?? [], null); + $this->setIfExists('excludeNilPaidFromContributions', $data ?? [], null); + $this->setIfExists('payPeriodDateAdjustment', $data ?? [], null); + $this->setIfExists('miscBoolean1', $data ?? [], null); + $this->setIfExists('miscBoolean2', $data ?? [], null); + $this->setIfExists('miscString1', $data ?? [], null); + $this->setIfExists('miscString2', $data ?? [], null); + $this->setIfExists('optOutWindow', $data ?? [], null); + $this->setIfExists('optOutWindowIsMonths', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['accountNo']) && (mb_strlen($this->container['accountNo']) > 100)) { + $invalidProperties[] = "invalid value for 'accountNo', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['portal']) && (mb_strlen($this->container['portal']) > 100)) { + $invalidProperties[] = "invalid value for 'portal', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['website']) && (mb_strlen($this->container['website']) > 100)) { + $invalidProperties[] = "invalid value for 'website', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 100)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['papdisProviderId']) && (mb_strlen($this->container['papdisProviderId']) > 35)) { + $invalidProperties[] = "invalid value for 'papdisProviderId', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['papdisEmployerId']) && (mb_strlen($this->container['papdisEmployerId']) > 40)) { + $invalidProperties[] = "invalid value for 'papdisEmployerId', the character length must be smaller than or equal to 40."; + } + + if (!is_null($this->container['miscString1']) && (mb_strlen($this->container['miscString1']) > 50)) { + $invalidProperties[] = "invalid value for 'miscString1', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['miscString2']) && (mb_strlen($this->container['miscString2']) > 50)) { + $invalidProperties[] = "invalid value for 'miscString2', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 100)) { + throw new InvalidArgumentException('invalid length for $name when calling PensionProvider., must be smaller than or equal to 100.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling PensionProvider., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets accountNo + * + * @return string|null + */ + public function getAccountNo(): ?string + { + return $this->container['accountNo']; + } + + /** + * Sets accountNo + * + * @param string|null $accountNo accountNo + * + * @return $this + */ + public function setAccountNo(?string $accountNo): static + { + if (is_null($accountNo)) { + array_push($this->openAPINullablesSetToNull, 'accountNo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountNo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($accountNo) && (mb_strlen($accountNo) > 100)) { + throw new InvalidArgumentException('invalid length for $accountNo when calling PensionProvider., must be smaller than or equal to 100.'); + } + + $this->container['accountNo'] = $accountNo; + + return $this; + } + + /** + * Gets portal + * + * @return string|null + */ + public function getPortal(): ?string + { + return $this->container['portal']; + } + + /** + * Sets portal + * + * @param string|null $portal portal + * + * @return $this + */ + public function setPortal(?string $portal): static + { + if (is_null($portal)) { + array_push($this->openAPINullablesSetToNull, 'portal'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('portal', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($portal) && (mb_strlen($portal) > 100)) { + throw new InvalidArgumentException('invalid length for $portal when calling PensionProvider., must be smaller than or equal to 100.'); + } + + $this->container['portal'] = $portal; + + return $this; + } + + /** + * Gets website + * + * @return string|null + */ + public function getWebsite(): ?string + { + return $this->container['website']; + } + + /** + * Sets website + * + * @param string|null $website website + * + * @return $this + */ + public function setWebsite(?string $website): static + { + if (is_null($website)) { + array_push($this->openAPINullablesSetToNull, 'website'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('website', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($website) && (mb_strlen($website) > 100)) { + throw new InvalidArgumentException('invalid length for $website when calling PensionProvider., must be smaller than or equal to 100.'); + } + + $this->container['website'] = $website; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 100)) { + throw new InvalidArgumentException('invalid length for $telephone when calling PensionProvider., must be smaller than or equal to 100.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets papdisVersion + * + * @return \SynergiTech\Staffology\Model\PapdisVersion|null + */ + public function getPapdisVersion(): ?\SynergiTech\Staffology\Model\PapdisVersion + { + return $this->container['papdisVersion']; + } + + /** + * Sets papdisVersion + * + * @param \SynergiTech\Staffology\Model\PapdisVersion|null $papdisVersion papdisVersion + * + * @return $this + */ + public function setPapdisVersion(?\SynergiTech\Staffology\Model\PapdisVersion $papdisVersion): static + { + if (is_null($papdisVersion)) { + throw new InvalidArgumentException('non-nullable papdisVersion cannot be null'); + } + $this->container['papdisVersion'] = $papdisVersion; + + return $this; + } + + /** + * Gets papdisProviderId + * + * @return string|null + */ + public function getPapdisProviderId(): ?string + { + return $this->container['papdisProviderId']; + } + + /** + * Sets papdisProviderId + * + * @param string|null $papdisProviderId papdisProviderId + * + * @return $this + */ + public function setPapdisProviderId(?string $papdisProviderId): static + { + if (is_null($papdisProviderId)) { + array_push($this->openAPINullablesSetToNull, 'papdisProviderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisProviderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($papdisProviderId) && (mb_strlen($papdisProviderId) > 35)) { + throw new InvalidArgumentException('invalid length for $papdisProviderId when calling PensionProvider., must be smaller than or equal to 35.'); + } + + $this->container['papdisProviderId'] = $papdisProviderId; + + return $this; + } + + /** + * Gets papdisEmployerId + * + * @return string|null + */ + public function getPapdisEmployerId(): ?string + { + return $this->container['papdisEmployerId']; + } + + /** + * Sets papdisEmployerId + * + * @param string|null $papdisEmployerId papdisEmployerId + * + * @return $this + */ + public function setPapdisEmployerId(?string $papdisEmployerId): static + { + if (is_null($papdisEmployerId)) { + array_push($this->openAPINullablesSetToNull, 'papdisEmployerId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisEmployerId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($papdisEmployerId) && (mb_strlen($papdisEmployerId) > 40)) { + throw new InvalidArgumentException('invalid length for $papdisEmployerId when calling PensionProvider., must be smaller than or equal to 40.'); + } + + $this->container['papdisEmployerId'] = $papdisEmployerId; + + return $this; + } + + /** + * Gets csvFormat + * + * @return \SynergiTech\Staffology\Model\PensionCsvFormat|null + */ + public function getCsvFormat(): ?\SynergiTech\Staffology\Model\PensionCsvFormat + { + return $this->container['csvFormat']; + } + + /** + * Sets csvFormat + * + * @param \SynergiTech\Staffology\Model\PensionCsvFormat|null $csvFormat csvFormat + * + * @return $this + */ + public function setCsvFormat(?\SynergiTech\Staffology\Model\PensionCsvFormat $csvFormat): static + { + if (is_null($csvFormat)) { + throw new InvalidArgumentException('non-nullable csvFormat cannot be null'); + } + $this->container['csvFormat'] = $csvFormat; + + return $this; + } + + /** + * Gets excludeNilPaidFromContributions + * + * @return bool|null + */ + public function getExcludeNilPaidFromContributions(): ?bool + { + return $this->container['excludeNilPaidFromContributions']; + } + + /** + * Sets excludeNilPaidFromContributions + * + * @param bool|null $excludeNilPaidFromContributions If we're sending contributions to an external provider then we'll include all employees that were on the payrun. If you want to exclude employees that don't have any contributions to report then set this to true. + * + * @return $this + */ + public function setExcludeNilPaidFromContributions(?bool $excludeNilPaidFromContributions): static + { + if (is_null($excludeNilPaidFromContributions)) { + throw new InvalidArgumentException('non-nullable excludeNilPaidFromContributions cannot be null'); + } + $this->container['excludeNilPaidFromContributions'] = $excludeNilPaidFromContributions; + + return $this; + } + + /** + * Gets payPeriodDateAdjustment + * + * @return int|null + */ + public function getPayPeriodDateAdjustment(): ?int + { + return $this->container['payPeriodDateAdjustment']; + } + + /** + * Sets payPeriodDateAdjustment + * + * @param int|null $payPeriodDateAdjustment If you need to adjust the reported dates of the contributions then you can do so by setting a non-zero value here. A negative value of will move the date back in time. + * + * @return $this + */ + public function setPayPeriodDateAdjustment(?int $payPeriodDateAdjustment): static + { + if (is_null($payPeriodDateAdjustment)) { + throw new InvalidArgumentException('non-nullable payPeriodDateAdjustment cannot be null'); + } + $this->container['payPeriodDateAdjustment'] = $payPeriodDateAdjustment; + + return $this; + } + + /** + * Gets miscBoolean1 + * + * @return bool|null + */ + public function getMiscBoolean1(): ?bool + { + return $this->container['miscBoolean1']; + } + + /** + * Sets miscBoolean1 + * + * @param bool|null $miscBoolean1 This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it indicates whether or not contributions are reported as \"Tax Weekly/Monthly\" rather than just \"Weekly/Monthly\" + * + * @return $this + */ + public function setMiscBoolean1(?bool $miscBoolean1): static + { + if (is_null($miscBoolean1)) { + throw new InvalidArgumentException('non-nullable miscBoolean1 cannot be null'); + } + $this->container['miscBoolean1'] = $miscBoolean1; + + return $this; + } + + /** + * Gets miscBoolean2 + * + * @return bool|null + */ + public function getMiscBoolean2(): ?bool + { + return $this->container['miscBoolean2']; + } + + /** + * Sets miscBoolean2 + * + * @param bool|null $miscBoolean2 This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it indicates whether or not to approve payments after submitting contributions + * + * @return $this + */ + public function setMiscBoolean2(?bool $miscBoolean2): static + { + if (is_null($miscBoolean2)) { + throw new InvalidArgumentException('non-nullable miscBoolean2 cannot be null'); + } + $this->container['miscBoolean2'] = $miscBoolean2; + + return $this; + } + + /** + * Gets miscString1 + * + * @return string|null + */ + public function getMiscString1(): ?string + { + return $this->container['miscString1']; + } + + /** + * Sets miscString1 + * + * @param string|null $miscString1 This field has different uses dependent on the ExternalDataProvider, if any. For Nest, it dictates the PaymentSource. + * + * @return $this + */ + public function setMiscString1(?string $miscString1): static + { + if (is_null($miscString1)) { + array_push($this->openAPINullablesSetToNull, 'miscString1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('miscString1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($miscString1) && (mb_strlen($miscString1) > 50)) { + throw new InvalidArgumentException('invalid length for $miscString1 when calling PensionProvider., must be smaller than or equal to 50.'); + } + + $this->container['miscString1'] = $miscString1; + + return $this; + } + + /** + * Gets miscString2 + * + * @return string|null + */ + public function getMiscString2(): ?string + { + return $this->container['miscString2']; + } + + /** + * Sets miscString2 + * + * @param string|null $miscString2 This field has different uses dependent on the ExternalDataProvider, if any. + * + * @return $this + */ + public function setMiscString2(?string $miscString2): static + { + if (is_null($miscString2)) { + array_push($this->openAPINullablesSetToNull, 'miscString2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('miscString2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($miscString2) && (mb_strlen($miscString2) > 50)) { + throw new InvalidArgumentException('invalid length for $miscString2 when calling PensionProvider., must be smaller than or equal to 50.'); + } + + $this->container['miscString2'] = $miscString2; + + return $this; + } + + /** + * Gets optOutWindow + * + * @return int|null + */ + public function getOptOutWindow(): ?int + { + return $this->container['optOutWindow']; + } + + /** + * Sets optOutWindow + * + * @param int|null $optOutWindow The number of days or months that an employee has to Opt out after being enrolled + * + * @return $this + */ + public function setOptOutWindow(?int $optOutWindow): static + { + if (is_null($optOutWindow)) { + throw new InvalidArgumentException('non-nullable optOutWindow cannot be null'); + } + $this->container['optOutWindow'] = $optOutWindow; + + return $this; + } + + /** + * Gets optOutWindowIsMonths + * + * @return bool|null + */ + public function getOptOutWindowIsMonths(): ?bool + { + return $this->container['optOutWindowIsMonths']; + } + + /** + * Sets optOutWindowIsMonths + * + * @param bool|null $optOutWindowIsMonths Determines whether the value given for OptOutWindow is in Months (true) or days (false) + * + * @return $this + */ + public function setOptOutWindowIsMonths(?bool $optOutWindowIsMonths): static + { + if (is_null($optOutWindowIsMonths)) { + throw new InvalidArgumentException('non-nullable optOutWindowIsMonths cannot be null'); + } + $this->container['optOutWindowIsMonths'] = $optOutWindowIsMonths; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionRefund.php b/src/Model/PensionRefund.php new file mode 100644 index 0000000..3d64640 --- /dev/null +++ b/src/Model/PensionRefund.php @@ -0,0 +1,908 @@ + + */ +class PensionRefund implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionRefund'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeRefund' => 'float', + 'employerRefund' => 'float', + 'pensionSchemeUniqueId' => 'string', + 'pensionUniqueId' => 'string', + 'payInCurrentPayRun' => 'bool', + 'payRun' => '\SynergiTech\Staffology\Model\Item', + 'pensionableEarning' => 'float', + 'pensionablePay' => 'float', + 'additionalVoluntaryContribution' => 'float', + 'assumedPensionablePay' => 'float', + 'tierName' => 'string', + 'tierRate' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeRefund' => 'double', + 'employerRefund' => 'double', + 'pensionSchemeUniqueId' => 'uuid', + 'pensionUniqueId' => 'uuid', + 'payInCurrentPayRun' => null, + 'payRun' => null, + 'pensionableEarning' => 'double', + 'pensionablePay' => 'double', + 'additionalVoluntaryContribution' => 'double', + 'assumedPensionablePay' => 'double', + 'tierName' => null, + 'tierRate' => 'double', + 'employee' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeRefund' => false, + 'employerRefund' => false, + 'pensionSchemeUniqueId' => false, + 'pensionUniqueId' => false, + 'payInCurrentPayRun' => false, + 'payRun' => false, + 'pensionableEarning' => false, + 'pensionablePay' => false, + 'additionalVoluntaryContribution' => false, + 'assumedPensionablePay' => false, + 'tierName' => true, + 'tierRate' => true, + 'employee' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeRefund' => 'employeeRefund', + 'employerRefund' => 'employerRefund', + 'pensionSchemeUniqueId' => 'pensionSchemeUniqueId', + 'pensionUniqueId' => 'pensionUniqueId', + 'payInCurrentPayRun' => 'payInCurrentPayRun', + 'payRun' => 'payRun', + 'pensionableEarning' => 'pensionableEarning', + 'pensionablePay' => 'pensionablePay', + 'additionalVoluntaryContribution' => 'additionalVoluntaryContribution', + 'assumedPensionablePay' => 'assumedPensionablePay', + 'tierName' => 'tierName', + 'tierRate' => 'tierRate', + 'employee' => 'employee', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeRefund' => 'setEmployeeRefund', + 'employerRefund' => 'setEmployerRefund', + 'pensionSchemeUniqueId' => 'setPensionSchemeUniqueId', + 'pensionUniqueId' => 'setPensionUniqueId', + 'payInCurrentPayRun' => 'setPayInCurrentPayRun', + 'payRun' => 'setPayRun', + 'pensionableEarning' => 'setPensionableEarning', + 'pensionablePay' => 'setPensionablePay', + 'additionalVoluntaryContribution' => 'setAdditionalVoluntaryContribution', + 'assumedPensionablePay' => 'setAssumedPensionablePay', + 'tierName' => 'setTierName', + 'tierRate' => 'setTierRate', + 'employee' => 'setEmployee', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeRefund' => 'getEmployeeRefund', + 'employerRefund' => 'getEmployerRefund', + 'pensionSchemeUniqueId' => 'getPensionSchemeUniqueId', + 'pensionUniqueId' => 'getPensionUniqueId', + 'payInCurrentPayRun' => 'getPayInCurrentPayRun', + 'payRun' => 'getPayRun', + 'pensionableEarning' => 'getPensionableEarning', + 'pensionablePay' => 'getPensionablePay', + 'additionalVoluntaryContribution' => 'getAdditionalVoluntaryContribution', + 'assumedPensionablePay' => 'getAssumedPensionablePay', + 'tierName' => 'getTierName', + 'tierRate' => 'getTierRate', + 'employee' => 'getEmployee', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeRefund', $data ?? [], null); + $this->setIfExists('employerRefund', $data ?? [], null); + $this->setIfExists('pensionSchemeUniqueId', $data ?? [], null); + $this->setIfExists('pensionUniqueId', $data ?? [], null); + $this->setIfExists('payInCurrentPayRun', $data ?? [], null); + $this->setIfExists('payRun', $data ?? [], null); + $this->setIfExists('pensionableEarning', $data ?? [], null); + $this->setIfExists('pensionablePay', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContribution', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + $this->setIfExists('tierName', $data ?? [], null); + $this->setIfExists('tierRate', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['employeeRefund'] === null) { + $invalidProperties[] = "'employeeRefund' can't be null"; + } + if ($this->container['employerRefund'] === null) { + $invalidProperties[] = "'employerRefund' can't be null"; + } + if ($this->container['pensionableEarning'] === null) { + $invalidProperties[] = "'pensionableEarning' can't be null"; + } + if ($this->container['pensionablePay'] === null) { + $invalidProperties[] = "'pensionablePay' can't be null"; + } + if ($this->container['additionalVoluntaryContribution'] === null) { + $invalidProperties[] = "'additionalVoluntaryContribution' can't be null"; + } + if ($this->container['assumedPensionablePay'] === null) { + $invalidProperties[] = "'assumedPensionablePay' can't be null"; + } + if (!is_null($this->container['tierName']) && (mb_strlen($this->container['tierName']) < 1)) { + $invalidProperties[] = "invalid value for 'tierName', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['tierRate']) && ($this->container['tierRate'] > 0.999)) { + $invalidProperties[] = "invalid value for 'tierRate', must be smaller than or equal to 0.999."; + } + + if (!is_null($this->container['tierRate']) && ($this->container['tierRate'] < 0.001)) { + $invalidProperties[] = "invalid value for 'tierRate', must be bigger than or equal to 0.001."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeRefund + * + * @return float + */ + public function getEmployeeRefund(): float + { + return $this->container['employeeRefund']; + } + + /** + * Sets employeeRefund + * + * @param float $employeeRefund employeeRefund + * + * @return $this + */ + public function setEmployeeRefund(float $employeeRefund): static + { + if (is_null($employeeRefund)) { + throw new InvalidArgumentException('non-nullable employeeRefund cannot be null'); + } + $this->container['employeeRefund'] = $employeeRefund; + + return $this; + } + + /** + * Gets employerRefund + * + * @return float + */ + public function getEmployerRefund(): float + { + return $this->container['employerRefund']; + } + + /** + * Sets employerRefund + * + * @param float $employerRefund employerRefund + * + * @return $this + */ + public function setEmployerRefund(float $employerRefund): static + { + if (is_null($employerRefund)) { + throw new InvalidArgumentException('non-nullable employerRefund cannot be null'); + } + $this->container['employerRefund'] = $employerRefund; + + return $this; + } + + /** + * Gets pensionSchemeUniqueId + * + * @return string|null + */ + public function getPensionSchemeUniqueId(): ?string + { + return $this->container['pensionSchemeUniqueId']; + } + + /** + * Sets pensionSchemeUniqueId + * + * @param string|null $pensionSchemeUniqueId pensionSchemeUniqueId + * + * @return $this + */ + public function setPensionSchemeUniqueId(?string $pensionSchemeUniqueId): static + { + if (is_null($pensionSchemeUniqueId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeUniqueId cannot be null'); + } + $this->container['pensionSchemeUniqueId'] = $pensionSchemeUniqueId; + + return $this; + } + + /** + * Gets pensionUniqueId + * + * @return string|null + */ + public function getPensionUniqueId(): ?string + { + return $this->container['pensionUniqueId']; + } + + /** + * Sets pensionUniqueId + * + * @param string|null $pensionUniqueId pensionUniqueId + * + * @return $this + */ + public function setPensionUniqueId(?string $pensionUniqueId): static + { + if (is_null($pensionUniqueId)) { + throw new InvalidArgumentException('non-nullable pensionUniqueId cannot be null'); + } + $this->container['pensionUniqueId'] = $pensionUniqueId; + + return $this; + } + + /** + * Gets payInCurrentPayRun + * + * @return bool|null + */ + public function getPayInCurrentPayRun(): ?bool + { + return $this->container['payInCurrentPayRun']; + } + + /** + * Sets payInCurrentPayRun + * + * @param bool|null $payInCurrentPayRun payInCurrentPayRun + * + * @return $this + */ + public function setPayInCurrentPayRun(?bool $payInCurrentPayRun): static + { + if (is_null($payInCurrentPayRun)) { + throw new InvalidArgumentException('non-nullable payInCurrentPayRun cannot be null'); + } + $this->container['payInCurrentPayRun'] = $payInCurrentPayRun; + + return $this; + } + + /** + * Gets payRun + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getPayRun(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['payRun']; + } + + /** + * Sets payRun + * + * @param \SynergiTech\Staffology\Model\Item|null $payRun payRun + * + * @return $this + */ + public function setPayRun(?\SynergiTech\Staffology\Model\Item $payRun): static + { + if (is_null($payRun)) { + throw new InvalidArgumentException('non-nullable payRun cannot be null'); + } + $this->container['payRun'] = $payRun; + + return $this; + } + + /** + * Gets pensionableEarning + * + * @return float + */ + public function getPensionableEarning(): float + { + return $this->container['pensionableEarning']; + } + + /** + * Sets pensionableEarning + * + * @param float $pensionableEarning pensionableEarning + * + * @return $this + */ + public function setPensionableEarning(float $pensionableEarning): static + { + if (is_null($pensionableEarning)) { + throw new InvalidArgumentException('non-nullable pensionableEarning cannot be null'); + } + $this->container['pensionableEarning'] = $pensionableEarning; + + return $this; + } + + /** + * Gets pensionablePay + * + * @return float + */ + public function getPensionablePay(): float + { + return $this->container['pensionablePay']; + } + + /** + * Sets pensionablePay + * + * @param float $pensionablePay pensionablePay + * + * @return $this + */ + public function setPensionablePay(float $pensionablePay): static + { + if (is_null($pensionablePay)) { + throw new InvalidArgumentException('non-nullable pensionablePay cannot be null'); + } + $this->container['pensionablePay'] = $pensionablePay; + + return $this; + } + + /** + * Gets additionalVoluntaryContribution + * + * @return float + */ + public function getAdditionalVoluntaryContribution(): float + { + return $this->container['additionalVoluntaryContribution']; + } + + /** + * Sets additionalVoluntaryContribution + * + * @param float $additionalVoluntaryContribution additionalVoluntaryContribution + * + * @return $this + */ + public function setAdditionalVoluntaryContribution(float $additionalVoluntaryContribution): static + { + if (is_null($additionalVoluntaryContribution)) { + throw new InvalidArgumentException('non-nullable additionalVoluntaryContribution cannot be null'); + } + $this->container['additionalVoluntaryContribution'] = $additionalVoluntaryContribution; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float + */ + public function getAssumedPensionablePay(): float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float $assumedPensionablePay assumedPensionablePay + * + * @return $this + */ + public function setAssumedPensionablePay(float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + throw new InvalidArgumentException('non-nullable assumedPensionablePay cannot be null'); + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + + /** + * Gets tierName + * + * @return string|null + */ + public function getTierName(): ?string + { + return $this->container['tierName']; + } + + /** + * Sets tierName + * + * @param string|null $tierName tierName + * + * @return $this + */ + public function setTierName(?string $tierName): static + { + if (is_null($tierName)) { + array_push($this->openAPINullablesSetToNull, 'tierName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tierName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($tierName) && (mb_strlen($tierName) < 1)) { + throw new InvalidArgumentException('invalid length for $tierName when calling PensionRefund., must be bigger than or equal to 1.'); + } + + $this->container['tierName'] = $tierName; + + return $this; + } + + /** + * Gets tierRate + * + * @return float|null + */ + public function getTierRate(): ?float + { + return $this->container['tierRate']; + } + + /** + * Sets tierRate + * + * @param float|null $tierRate tierRate + * + * @return $this + */ + public function setTierRate(?float $tierRate): static + { + if (is_null($tierRate)) { + array_push($this->openAPINullablesSetToNull, 'tierRate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tierRate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($tierRate) && ($tierRate > 0.999)) { + throw new InvalidArgumentException('invalid value for $tierRate when calling PensionRefund., must be smaller than or equal to 0.999.'); + } + if (!is_null($tierRate) && ($tierRate < 0.001)) { + throw new InvalidArgumentException('invalid value for $tierRate when calling PensionRefund., must be bigger than or equal to 0.001.'); + } + + $this->container['tierRate'] = $tierRate; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionReportingType.php b/src/Model/PensionReportingType.php new file mode 100644 index 0000000..e44f837 --- /dev/null +++ b/src/Model/PensionReportingType.php @@ -0,0 +1,49 @@ + + */ +class PensionScheme implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionScheme'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'provider' => '\SynergiTech\Staffology\Model\PensionProvider', + 'administrator' => '\SynergiTech\Staffology\Model\PensionAdministrator', + 'pensionRule' => '\SynergiTech\Staffology\Model\PensionRule', + 'qualifyingScheme' => 'bool', + 'disableAeLetters' => 'bool', + 'subtractBasicRateTax' => 'bool', + 'payMethod' => '\SynergiTech\Staffology\Model\PayMethod', + 'bankDetails' => '\SynergiTech\Staffology\Model\BankDetails', + 'useCustomPayCodes' => 'bool', + 'useCustomPayCodesForTierablePay' => 'bool', + 'customPayCodes' => 'string[]', + 'tierablePayCustomPayCodes' => 'string[]', + 'workerGroups' => '\SynergiTech\Staffology\Model\WorkerGroup[]', + 'externalDataProviderId' => '\SynergiTech\Staffology\Model\ExternalDataProviderId', + 'externalDataCompany' => '\SynergiTech\Staffology\Model\ExternalDataCompany', + 'payCodeType' => '\SynergiTech\Staffology\Model\PensionPayCode', + 'tierablePayPayCodeType' => '\SynergiTech\Staffology\Model\PensionPayCode', + 'payCodeSetUniqueId' => 'string', + 'tierablePayPayCodeSetUniqueId' => 'string', + 'paymentDateRule' => '\SynergiTech\Staffology\Model\PaymentDateRule', + 'paymentDateDayOfWeek' => '\SynergiTech\Staffology\Model\DayOfWeek', + 'paymentDateDayOfMonth' => 'int', + 'reportOptionsLgpsIConnect' => '\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect', + 'reportOptionsLgpsCivicaUpm' => '\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm', + 'deficitValueOrdinal' => 'int', + 'deficitValue' => 'float', + 'includeDeficitValue' => 'bool', + 'deficitValuePayPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'nominalCodeMappings' => '\SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'provider' => null, + 'administrator' => null, + 'pensionRule' => null, + 'qualifyingScheme' => null, + 'disableAeLetters' => null, + 'subtractBasicRateTax' => null, + 'payMethod' => null, + 'bankDetails' => null, + 'useCustomPayCodes' => null, + 'useCustomPayCodesForTierablePay' => null, + 'customPayCodes' => null, + 'tierablePayCustomPayCodes' => null, + 'workerGroups' => null, + 'externalDataProviderId' => null, + 'externalDataCompany' => null, + 'payCodeType' => null, + 'tierablePayPayCodeType' => null, + 'payCodeSetUniqueId' => 'uuid', + 'tierablePayPayCodeSetUniqueId' => 'uuid', + 'paymentDateRule' => null, + 'paymentDateDayOfWeek' => null, + 'paymentDateDayOfMonth' => 'int32', + 'reportOptionsLgpsIConnect' => null, + 'reportOptionsLgpsCivicaUpm' => null, + 'deficitValueOrdinal' => 'int32', + 'deficitValue' => 'double', + 'includeDeficitValue' => null, + 'deficitValuePayPeriod' => null, + 'nominalCodeMappings' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'provider' => false, + 'administrator' => false, + 'pensionRule' => false, + 'qualifyingScheme' => false, + 'disableAeLetters' => false, + 'subtractBasicRateTax' => false, + 'payMethod' => false, + 'bankDetails' => false, + 'useCustomPayCodes' => false, + 'useCustomPayCodesForTierablePay' => false, + 'customPayCodes' => true, + 'tierablePayCustomPayCodes' => true, + 'workerGroups' => true, + 'externalDataProviderId' => false, + 'externalDataCompany' => false, + 'payCodeType' => false, + 'tierablePayPayCodeType' => false, + 'payCodeSetUniqueId' => true, + 'tierablePayPayCodeSetUniqueId' => true, + 'paymentDateRule' => false, + 'paymentDateDayOfWeek' => false, + 'paymentDateDayOfMonth' => true, + 'reportOptionsLgpsIConnect' => false, + 'reportOptionsLgpsCivicaUpm' => false, + 'deficitValueOrdinal' => true, + 'deficitValue' => true, + 'includeDeficitValue' => false, + 'deficitValuePayPeriod' => false, + 'nominalCodeMappings' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'provider' => 'provider', + 'administrator' => 'administrator', + 'pensionRule' => 'pensionRule', + 'qualifyingScheme' => 'qualifyingScheme', + 'disableAeLetters' => 'disableAeLetters', + 'subtractBasicRateTax' => 'subtractBasicRateTax', + 'payMethod' => 'payMethod', + 'bankDetails' => 'bankDetails', + 'useCustomPayCodes' => 'useCustomPayCodes', + 'useCustomPayCodesForTierablePay' => 'useCustomPayCodesForTierablePay', + 'customPayCodes' => 'customPayCodes', + 'tierablePayCustomPayCodes' => 'tierablePayCustomPayCodes', + 'workerGroups' => 'workerGroups', + 'externalDataProviderId' => 'externalDataProviderId', + 'externalDataCompany' => 'externalDataCompany', + 'payCodeType' => 'payCodeType', + 'tierablePayPayCodeType' => 'tierablePayPayCodeType', + 'payCodeSetUniqueId' => 'payCodeSetUniqueId', + 'tierablePayPayCodeSetUniqueId' => 'tierablePayPayCodeSetUniqueId', + 'paymentDateRule' => 'paymentDateRule', + 'paymentDateDayOfWeek' => 'paymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'paymentDateDayOfMonth', + 'reportOptionsLgpsIConnect' => 'reportOptionsLgpsIConnect', + 'reportOptionsLgpsCivicaUpm' => 'reportOptionsLgpsCivicaUpm', + 'deficitValueOrdinal' => 'deficitValueOrdinal', + 'deficitValue' => 'deficitValue', + 'includeDeficitValue' => 'includeDeficitValue', + 'deficitValuePayPeriod' => 'deficitValuePayPeriod', + 'nominalCodeMappings' => 'nominalCodeMappings', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'provider' => 'setProvider', + 'administrator' => 'setAdministrator', + 'pensionRule' => 'setPensionRule', + 'qualifyingScheme' => 'setQualifyingScheme', + 'disableAeLetters' => 'setDisableAeLetters', + 'subtractBasicRateTax' => 'setSubtractBasicRateTax', + 'payMethod' => 'setPayMethod', + 'bankDetails' => 'setBankDetails', + 'useCustomPayCodes' => 'setUseCustomPayCodes', + 'useCustomPayCodesForTierablePay' => 'setUseCustomPayCodesForTierablePay', + 'customPayCodes' => 'setCustomPayCodes', + 'tierablePayCustomPayCodes' => 'setTierablePayCustomPayCodes', + 'workerGroups' => 'setWorkerGroups', + 'externalDataProviderId' => 'setExternalDataProviderId', + 'externalDataCompany' => 'setExternalDataCompany', + 'payCodeType' => 'setPayCodeType', + 'tierablePayPayCodeType' => 'setTierablePayPayCodeType', + 'payCodeSetUniqueId' => 'setPayCodeSetUniqueId', + 'tierablePayPayCodeSetUniqueId' => 'setTierablePayPayCodeSetUniqueId', + 'paymentDateRule' => 'setPaymentDateRule', + 'paymentDateDayOfWeek' => 'setPaymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'setPaymentDateDayOfMonth', + 'reportOptionsLgpsIConnect' => 'setReportOptionsLgpsIConnect', + 'reportOptionsLgpsCivicaUpm' => 'setReportOptionsLgpsCivicaUpm', + 'deficitValueOrdinal' => 'setDeficitValueOrdinal', + 'deficitValue' => 'setDeficitValue', + 'includeDeficitValue' => 'setIncludeDeficitValue', + 'deficitValuePayPeriod' => 'setDeficitValuePayPeriod', + 'nominalCodeMappings' => 'setNominalCodeMappings', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'provider' => 'getProvider', + 'administrator' => 'getAdministrator', + 'pensionRule' => 'getPensionRule', + 'qualifyingScheme' => 'getQualifyingScheme', + 'disableAeLetters' => 'getDisableAeLetters', + 'subtractBasicRateTax' => 'getSubtractBasicRateTax', + 'payMethod' => 'getPayMethod', + 'bankDetails' => 'getBankDetails', + 'useCustomPayCodes' => 'getUseCustomPayCodes', + 'useCustomPayCodesForTierablePay' => 'getUseCustomPayCodesForTierablePay', + 'customPayCodes' => 'getCustomPayCodes', + 'tierablePayCustomPayCodes' => 'getTierablePayCustomPayCodes', + 'workerGroups' => 'getWorkerGroups', + 'externalDataProviderId' => 'getExternalDataProviderId', + 'externalDataCompany' => 'getExternalDataCompany', + 'payCodeType' => 'getPayCodeType', + 'tierablePayPayCodeType' => 'getTierablePayPayCodeType', + 'payCodeSetUniqueId' => 'getPayCodeSetUniqueId', + 'tierablePayPayCodeSetUniqueId' => 'getTierablePayPayCodeSetUniqueId', + 'paymentDateRule' => 'getPaymentDateRule', + 'paymentDateDayOfWeek' => 'getPaymentDateDayOfWeek', + 'paymentDateDayOfMonth' => 'getPaymentDateDayOfMonth', + 'reportOptionsLgpsIConnect' => 'getReportOptionsLgpsIConnect', + 'reportOptionsLgpsCivicaUpm' => 'getReportOptionsLgpsCivicaUpm', + 'deficitValueOrdinal' => 'getDeficitValueOrdinal', + 'deficitValue' => 'getDeficitValue', + 'includeDeficitValue' => 'getIncludeDeficitValue', + 'deficitValuePayPeriod' => 'getDeficitValuePayPeriod', + 'nominalCodeMappings' => 'getNominalCodeMappings', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('administrator', $data ?? [], null); + $this->setIfExists('pensionRule', $data ?? [], null); + $this->setIfExists('qualifyingScheme', $data ?? [], null); + $this->setIfExists('disableAeLetters', $data ?? [], null); + $this->setIfExists('subtractBasicRateTax', $data ?? [], null); + $this->setIfExists('payMethod', $data ?? [], null); + $this->setIfExists('bankDetails', $data ?? [], null); + $this->setIfExists('useCustomPayCodes', $data ?? [], null); + $this->setIfExists('useCustomPayCodesForTierablePay', $data ?? [], null); + $this->setIfExists('customPayCodes', $data ?? [], null); + $this->setIfExists('tierablePayCustomPayCodes', $data ?? [], null); + $this->setIfExists('workerGroups', $data ?? [], null); + $this->setIfExists('externalDataProviderId', $data ?? [], null); + $this->setIfExists('externalDataCompany', $data ?? [], null); + $this->setIfExists('payCodeType', $data ?? [], null); + $this->setIfExists('tierablePayPayCodeType', $data ?? [], null); + $this->setIfExists('payCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('tierablePayPayCodeSetUniqueId', $data ?? [], null); + $this->setIfExists('paymentDateRule', $data ?? [], null); + $this->setIfExists('paymentDateDayOfWeek', $data ?? [], null); + $this->setIfExists('paymentDateDayOfMonth', $data ?? [], null); + $this->setIfExists('reportOptionsLgpsIConnect', $data ?? [], null); + $this->setIfExists('reportOptionsLgpsCivicaUpm', $data ?? [], null); + $this->setIfExists('deficitValueOrdinal', $data ?? [], null); + $this->setIfExists('deficitValue', $data ?? [], null); + $this->setIfExists('includeDeficitValue', $data ?? [], null); + $this->setIfExists('deficitValuePayPeriod', $data ?? [], null); + $this->setIfExists('nominalCodeMappings', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 150)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 150)) { + throw new InvalidArgumentException('invalid length for $name when calling PensionScheme., must be smaller than or equal to 150.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling PensionScheme., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets provider + * + * @return \SynergiTech\Staffology\Model\PensionProvider|null + */ + public function getProvider(): ?\SynergiTech\Staffology\Model\PensionProvider + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \SynergiTech\Staffology\Model\PensionProvider|null $provider provider + * + * @return $this + */ + public function setProvider(?\SynergiTech\Staffology\Model\PensionProvider $provider): static + { + if (is_null($provider)) { + throw new InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets administrator + * + * @return \SynergiTech\Staffology\Model\PensionAdministrator|null + */ + public function getAdministrator(): ?\SynergiTech\Staffology\Model\PensionAdministrator + { + return $this->container['administrator']; + } + + /** + * Sets administrator + * + * @param \SynergiTech\Staffology\Model\PensionAdministrator|null $administrator administrator + * + * @return $this + */ + public function setAdministrator(?\SynergiTech\Staffology\Model\PensionAdministrator $administrator): static + { + if (is_null($administrator)) { + throw new InvalidArgumentException('non-nullable administrator cannot be null'); + } + $this->container['administrator'] = $administrator; + + return $this; + } + + /** + * Gets pensionRule + * + * @return \SynergiTech\Staffology\Model\PensionRule|null + */ + public function getPensionRule(): ?\SynergiTech\Staffology\Model\PensionRule + { + return $this->container['pensionRule']; + } + + /** + * Sets pensionRule + * + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule pensionRule + * + * @return $this + */ + public function setPensionRule(?\SynergiTech\Staffology\Model\PensionRule $pensionRule): static + { + if (is_null($pensionRule)) { + throw new InvalidArgumentException('non-nullable pensionRule cannot be null'); + } + $this->container['pensionRule'] = $pensionRule; + + return $this; + } + + /** + * Gets qualifyingScheme + * + * @return bool|null + */ + public function getQualifyingScheme(): ?bool + { + return $this->container['qualifyingScheme']; + } + + /** + * Sets qualifyingScheme + * + * @param bool|null $qualifyingScheme Set to true if this is a Qualifying Scheme for Auto Enrolment + * + * @return $this + */ + public function setQualifyingScheme(?bool $qualifyingScheme): static + { + if (is_null($qualifyingScheme)) { + throw new InvalidArgumentException('non-nullable qualifyingScheme cannot be null'); + } + $this->container['qualifyingScheme'] = $qualifyingScheme; + + return $this; + } + + /** + * Gets disableAeLetters + * + * @return bool|null + */ + public function getDisableAeLetters(): ?bool + { + return $this->container['disableAeLetters']; + } + + /** + * Sets disableAeLetters + * + * @param bool|null $disableAeLetters Set to true if the provider deals with AutoEnrolment Letters and therefore the system should not generate them + * + * @return $this + */ + public function setDisableAeLetters(?bool $disableAeLetters): static + { + if (is_null($disableAeLetters)) { + throw new InvalidArgumentException('non-nullable disableAeLetters cannot be null'); + } + $this->container['disableAeLetters'] = $disableAeLetters; + + return $this; + } + + /** + * Gets subtractBasicRateTax + * + * @return bool|null + */ + public function getSubtractBasicRateTax(): ?bool + { + return $this->container['subtractBasicRateTax']; + } + + /** + * Sets subtractBasicRateTax + * + * @param bool|null $subtractBasicRateTax subtractBasicRateTax + * + * @return $this + */ + public function setSubtractBasicRateTax(?bool $subtractBasicRateTax): static + { + if (is_null($subtractBasicRateTax)) { + throw new InvalidArgumentException('non-nullable subtractBasicRateTax cannot be null'); + } + $this->container['subtractBasicRateTax'] = $subtractBasicRateTax; + + return $this; + } + + /** + * Gets payMethod + * + * @return \SynergiTech\Staffology\Model\PayMethod|null + */ + public function getPayMethod(): ?\SynergiTech\Staffology\Model\PayMethod + { + return $this->container['payMethod']; + } + + /** + * Sets payMethod + * + * @param \SynergiTech\Staffology\Model\PayMethod|null $payMethod payMethod + * + * @return $this + */ + public function setPayMethod(?\SynergiTech\Staffology\Model\PayMethod $payMethod): static + { + if (is_null($payMethod)) { + throw new InvalidArgumentException('non-nullable payMethod cannot be null'); + } + $this->container['payMethod'] = $payMethod; + + return $this; + } + + /** + * Gets bankDetails + * + * @return \SynergiTech\Staffology\Model\BankDetails|null + */ + public function getBankDetails(): ?\SynergiTech\Staffology\Model\BankDetails + { + return $this->container['bankDetails']; + } + + /** + * Sets bankDetails + * + * @param \SynergiTech\Staffology\Model\BankDetails|null $bankDetails bankDetails + * + * @return $this + */ + public function setBankDetails(?\SynergiTech\Staffology\Model\BankDetails $bankDetails): static + { + if (is_null($bankDetails)) { + throw new InvalidArgumentException('non-nullable bankDetails cannot be null'); + } + $this->container['bankDetails'] = $bankDetails; + + return $this; + } + + /** + * Gets useCustomPayCodes + * + * @return bool|null + */ + public function getUseCustomPayCodes(): ?bool + { + return $this->container['useCustomPayCodes']; + } + + /** + * Sets useCustomPayCodes + * + * @param bool|null $useCustomPayCodes If set to true then rather than using the setting on the PayCode to determine if the pay is pensionable we'll instead treat it as pensionable if the Code is included in CustomPayCodes + * + * @return $this + */ + public function setUseCustomPayCodes(?bool $useCustomPayCodes): static + { + if (is_null($useCustomPayCodes)) { + throw new InvalidArgumentException('non-nullable useCustomPayCodes cannot be null'); + } + $this->container['useCustomPayCodes'] = $useCustomPayCodes; + + return $this; + } + + /** + * Gets useCustomPayCodesForTierablePay + * + * @return bool|null + */ + public function getUseCustomPayCodesForTierablePay(): ?bool + { + return $this->container['useCustomPayCodesForTierablePay']; + } + + /** + * Sets useCustomPayCodesForTierablePay + * + * @param bool|null $useCustomPayCodesForTierablePay If set to true then rather than using the setting on the PayCode to determine if the pay is tierable we'll instead treat it as tierable if the Code is included in TierablePayCustomPayCodes + * + * @return $this + */ + public function setUseCustomPayCodesForTierablePay(?bool $useCustomPayCodesForTierablePay): static + { + if (is_null($useCustomPayCodesForTierablePay)) { + throw new InvalidArgumentException('non-nullable useCustomPayCodesForTierablePay cannot be null'); + } + $this->container['useCustomPayCodesForTierablePay'] = $useCustomPayCodesForTierablePay; + + return $this; + } + + /** + * Gets customPayCodes + * + * @return string[]|null + */ + public function getCustomPayCodes(): ?array + { + return $this->container['customPayCodes']; + } + + /** + * Sets customPayCodes + * + * @param string[]|null $customPayCodes If UseCustomPayCodes is set to true then this contains a list of PayCodes.Code that we'll treat as being pensionable. + * + * @return $this + */ + public function setCustomPayCodes(?array $customPayCodes): static + { + if (is_null($customPayCodes)) { + array_push($this->openAPINullablesSetToNull, 'customPayCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customPayCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customPayCodes'] = $customPayCodes; + + return $this; + } + + /** + * Gets tierablePayCustomPayCodes + * + * @return string[]|null + */ + public function getTierablePayCustomPayCodes(): ?array + { + return $this->container['tierablePayCustomPayCodes']; + } + + /** + * Sets tierablePayCustomPayCodes + * + * @param string[]|null $tierablePayCustomPayCodes If UseCustomPayCodesForTierablePay is set to true then this contains a list of PayCodes.Code that we'll treat as being tierable. + * + * @return $this + */ + public function setTierablePayCustomPayCodes(?array $tierablePayCustomPayCodes): static + { + if (is_null($tierablePayCustomPayCodes)) { + array_push($this->openAPINullablesSetToNull, 'tierablePayCustomPayCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tierablePayCustomPayCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tierablePayCustomPayCodes'] = $tierablePayCustomPayCodes; + + return $this; + } + + /** + * Gets workerGroups + * + * @return \SynergiTech\Staffology\Model\WorkerGroup[]|null + */ + public function getWorkerGroups(): ?array + { + return $this->container['workerGroups']; + } + + /** + * Sets workerGroups + * + * @param \SynergiTech\Staffology\Model\WorkerGroup[]|null $workerGroups A list of WorkerGroups for this Pension. There must always be at least one WorkerGroup + * + * @return $this + */ + public function setWorkerGroups(?array $workerGroups): static + { + if (is_null($workerGroups)) { + array_push($this->openAPINullablesSetToNull, 'workerGroups'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workerGroups', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workerGroups'] = $workerGroups; + + return $this; + } + + /** + * Gets externalDataProviderId + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderId|null + */ + public function getExternalDataProviderId(): ?\SynergiTech\Staffology\Model\ExternalDataProviderId + { + return $this->container['externalDataProviderId']; + } + + /** + * Sets externalDataProviderId + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId|null $externalDataProviderId externalDataProviderId + * + * @return $this + */ + public function setExternalDataProviderId(?\SynergiTech\Staffology\Model\ExternalDataProviderId $externalDataProviderId): static + { + if (is_null($externalDataProviderId)) { + throw new InvalidArgumentException('non-nullable externalDataProviderId cannot be null'); + } + $this->container['externalDataProviderId'] = $externalDataProviderId; + + return $this; + } + + /** + * Gets externalDataCompany + * + * @return \SynergiTech\Staffology\Model\ExternalDataCompany|null + */ + public function getExternalDataCompany(): ?\SynergiTech\Staffology\Model\ExternalDataCompany + { + return $this->container['externalDataCompany']; + } + + /** + * Sets externalDataCompany + * + * @param \SynergiTech\Staffology\Model\ExternalDataCompany|null $externalDataCompany externalDataCompany + * + * @return $this + */ + public function setExternalDataCompany(?\SynergiTech\Staffology\Model\ExternalDataCompany $externalDataCompany): static + { + if (is_null($externalDataCompany)) { + throw new InvalidArgumentException('non-nullable externalDataCompany cannot be null'); + } + $this->container['externalDataCompany'] = $externalDataCompany; + + return $this; + } + + /** + * Gets payCodeType + * + * @return \SynergiTech\Staffology\Model\PensionPayCode|null + */ + public function getPayCodeType(): ?\SynergiTech\Staffology\Model\PensionPayCode + { + return $this->container['payCodeType']; + } + + /** + * Sets payCodeType + * + * @param \SynergiTech\Staffology\Model\PensionPayCode|null $payCodeType payCodeType + * + * @return $this + */ + public function setPayCodeType(?\SynergiTech\Staffology\Model\PensionPayCode $payCodeType): static + { + if (is_null($payCodeType)) { + throw new InvalidArgumentException('non-nullable payCodeType cannot be null'); + } + $this->container['payCodeType'] = $payCodeType; + + return $this; + } + + /** + * Gets tierablePayPayCodeType + * + * @return \SynergiTech\Staffology\Model\PensionPayCode|null + */ + public function getTierablePayPayCodeType(): ?\SynergiTech\Staffology\Model\PensionPayCode + { + return $this->container['tierablePayPayCodeType']; + } + + /** + * Sets tierablePayPayCodeType + * + * @param \SynergiTech\Staffology\Model\PensionPayCode|null $tierablePayPayCodeType tierablePayPayCodeType + * + * @return $this + */ + public function setTierablePayPayCodeType(?\SynergiTech\Staffology\Model\PensionPayCode $tierablePayPayCodeType): static + { + if (is_null($tierablePayPayCodeType)) { + throw new InvalidArgumentException('non-nullable tierablePayPayCodeType cannot be null'); + } + $this->container['tierablePayPayCodeType'] = $tierablePayPayCodeType; + + return $this; + } + + /** + * Gets payCodeSetUniqueId + * + * @return string|null + */ + public function getPayCodeSetUniqueId(): ?string + { + return $this->container['payCodeSetUniqueId']; + } + + /** + * Sets payCodeSetUniqueId + * + * @param string|null $payCodeSetUniqueId payCodeSetUniqueId + * + * @return $this + */ + public function setPayCodeSetUniqueId(?string $payCodeSetUniqueId): static + { + if (is_null($payCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'payCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodeSetUniqueId'] = $payCodeSetUniqueId; + + return $this; + } + + /** + * Gets tierablePayPayCodeSetUniqueId + * + * @return string|null + */ + public function getTierablePayPayCodeSetUniqueId(): ?string + { + return $this->container['tierablePayPayCodeSetUniqueId']; + } + + /** + * Sets tierablePayPayCodeSetUniqueId + * + * @param string|null $tierablePayPayCodeSetUniqueId tierablePayPayCodeSetUniqueId + * + * @return $this + */ + public function setTierablePayPayCodeSetUniqueId(?string $tierablePayPayCodeSetUniqueId): static + { + if (is_null($tierablePayPayCodeSetUniqueId)) { + array_push($this->openAPINullablesSetToNull, 'tierablePayPayCodeSetUniqueId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tierablePayPayCodeSetUniqueId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tierablePayPayCodeSetUniqueId'] = $tierablePayPayCodeSetUniqueId; + + return $this; + } + + /** + * Gets paymentDateRule + * + * @return \SynergiTech\Staffology\Model\PaymentDateRule|null + */ + public function getPaymentDateRule(): ?\SynergiTech\Staffology\Model\PaymentDateRule + { + return $this->container['paymentDateRule']; + } + + /** + * Sets paymentDateRule + * + * @param \SynergiTech\Staffology\Model\PaymentDateRule|null $paymentDateRule paymentDateRule + * + * @return $this + */ + public function setPaymentDateRule(?\SynergiTech\Staffology\Model\PaymentDateRule $paymentDateRule): static + { + if (is_null($paymentDateRule)) { + throw new InvalidArgumentException('non-nullable paymentDateRule cannot be null'); + } + $this->container['paymentDateRule'] = $paymentDateRule; + + return $this; + } + + /** + * Gets paymentDateDayOfWeek + * + * @return \SynergiTech\Staffology\Model\DayOfWeek|null + */ + public function getPaymentDateDayOfWeek(): ?\SynergiTech\Staffology\Model\DayOfWeek + { + return $this->container['paymentDateDayOfWeek']; + } + + /** + * Sets paymentDateDayOfWeek + * + * @param \SynergiTech\Staffology\Model\DayOfWeek|null $paymentDateDayOfWeek paymentDateDayOfWeek + * + * @return $this + */ + public function setPaymentDateDayOfWeek(?\SynergiTech\Staffology\Model\DayOfWeek $paymentDateDayOfWeek): static + { + if (is_null($paymentDateDayOfWeek)) { + throw new InvalidArgumentException('non-nullable paymentDateDayOfWeek cannot be null'); + } + $this->container['paymentDateDayOfWeek'] = $paymentDateDayOfWeek; + + return $this; + } + + /** + * Gets paymentDateDayOfMonth + * + * @return int|null + */ + public function getPaymentDateDayOfMonth(): ?int + { + return $this->container['paymentDateDayOfMonth']; + } + + /** + * Sets paymentDateDayOfMonth + * + * @param int|null $paymentDateDayOfMonth paymentDateDayOfMonth + * + * @return $this + */ + public function setPaymentDateDayOfMonth(?int $paymentDateDayOfMonth): static + { + if (is_null($paymentDateDayOfMonth)) { + array_push($this->openAPINullablesSetToNull, 'paymentDateDayOfMonth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentDateDayOfMonth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentDateDayOfMonth'] = $paymentDateDayOfMonth; + + return $this; + } + + /** + * Gets reportOptionsLgpsIConnect + * + * @return \SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect|null + */ + public function getReportOptionsLgpsIConnect(): ?\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect + { + return $this->container['reportOptionsLgpsIConnect']; + } + + /** + * Sets reportOptionsLgpsIConnect + * + * @param \SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect|null $reportOptionsLgpsIConnect reportOptionsLgpsIConnect + * + * @return $this + */ + public function setReportOptionsLgpsIConnect(?\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsIConnect $reportOptionsLgpsIConnect): static + { + if (is_null($reportOptionsLgpsIConnect)) { + throw new InvalidArgumentException('non-nullable reportOptionsLgpsIConnect cannot be null'); + } + $this->container['reportOptionsLgpsIConnect'] = $reportOptionsLgpsIConnect; + + return $this; + } + + /** + * Gets reportOptionsLgpsCivicaUpm + * + * @return \SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm|null + */ + public function getReportOptionsLgpsCivicaUpm(): ?\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm + { + return $this->container['reportOptionsLgpsCivicaUpm']; + } + + /** + * Sets reportOptionsLgpsCivicaUpm + * + * @param \SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm|null $reportOptionsLgpsCivicaUpm reportOptionsLgpsCivicaUpm + * + * @return $this + */ + public function setReportOptionsLgpsCivicaUpm(?\SynergiTech\Staffology\Model\PensionSchemeReportOptionsLgpsCivicaUpm $reportOptionsLgpsCivicaUpm): static + { + if (is_null($reportOptionsLgpsCivicaUpm)) { + throw new InvalidArgumentException('non-nullable reportOptionsLgpsCivicaUpm cannot be null'); + } + $this->container['reportOptionsLgpsCivicaUpm'] = $reportOptionsLgpsCivicaUpm; + + return $this; + } + + /** + * Gets deficitValueOrdinal + * + * @return int|null + */ + public function getDeficitValueOrdinal(): ?int + { + return $this->container['deficitValueOrdinal']; + } + + /** + * Sets deficitValueOrdinal + * + * @param int|null $deficitValueOrdinal The Ordinal used to identify the PaySchedule which the Deficit will be against + * + * @return $this + */ + public function setDeficitValueOrdinal(?int $deficitValueOrdinal): static + { + if (is_null($deficitValueOrdinal)) { + array_push($this->openAPINullablesSetToNull, 'deficitValueOrdinal'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deficitValueOrdinal', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deficitValueOrdinal'] = $deficitValueOrdinal; + + return $this; + } + + /** + * Gets deficitValue + * + * @return float|null + */ + public function getDeficitValue(): ?float + { + return $this->container['deficitValue']; + } + + /** + * Sets deficitValue + * + * @param float|null $deficitValue The Defict value that will be deducted in a PaySchedule + * + * @return $this + */ + public function setDeficitValue(?float $deficitValue): static + { + if (is_null($deficitValue)) { + array_push($this->openAPINullablesSetToNull, 'deficitValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deficitValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['deficitValue'] = $deficitValue; + + return $this; + } + + /** + * Gets includeDeficitValue + * + * @return bool|null + */ + public function getIncludeDeficitValue(): ?bool + { + return $this->container['includeDeficitValue']; + } + + /** + * Sets includeDeficitValue + * + * @param bool|null $includeDeficitValue Set to true if this a Deficit Payment needs to be assigned to a PaySchedule + * + * @return $this + */ + public function setIncludeDeficitValue(?bool $includeDeficitValue): static + { + if (is_null($includeDeficitValue)) { + throw new InvalidArgumentException('non-nullable includeDeficitValue cannot be null'); + } + $this->container['includeDeficitValue'] = $includeDeficitValue; + + return $this; + } + + /** + * Gets deficitValuePayPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getDeficitValuePayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['deficitValuePayPeriod']; + } + + /** + * Sets deficitValuePayPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $deficitValuePayPeriod deficitValuePayPeriod + * + * @return $this + */ + public function setDeficitValuePayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $deficitValuePayPeriod): static + { + if (is_null($deficitValuePayPeriod)) { + throw new InvalidArgumentException('non-nullable deficitValuePayPeriod cannot be null'); + } + $this->container['deficitValuePayPeriod'] = $deficitValuePayPeriod; + + return $this; + } + + /** + * Gets nominalCodeMappings + * + * @return \SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]|null + */ + public function getNominalCodeMappings(): ?array + { + return $this->container['nominalCodeMappings']; + } + + /** + * Sets nominalCodeMappings + * + * @param \SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]|null $nominalCodeMappings The PensionSchemeNominalCodeMappings used to map the PayCodes to a PensionScheme for the journal configuration + * + * @return $this + */ + public function setNominalCodeMappings(?array $nominalCodeMappings): static + { + if (is_null($nominalCodeMappings)) { + array_push($this->openAPINullablesSetToNull, 'nominalCodeMappings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalCodeMappings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nominalCodeMappings'] = $nominalCodeMappings; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSchemeNominalCodeMapping.php b/src/Model/PensionSchemeNominalCodeMapping.php new file mode 100644 index 0000000..349b91b --- /dev/null +++ b/src/Model/PensionSchemeNominalCodeMapping.php @@ -0,0 +1,562 @@ + + */ +class PensionSchemeNominalCodeMapping implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSchemeNominalCodeMapping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'nominalCode' => 'string', + 'nominalName' => 'string', + 'journalNarrative' => 'string', + 'payCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'nominalCode' => null, + 'nominalName' => null, + 'journalNarrative' => null, + 'payCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'nominalCode' => true, + 'nominalName' => true, + 'journalNarrative' => true, + 'payCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'nominalCode' => 'nominalCode', + 'nominalName' => 'nominalName', + 'journalNarrative' => 'journalNarrative', + 'payCode' => 'payCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'nominalCode' => 'setNominalCode', + 'nominalName' => 'setNominalName', + 'journalNarrative' => 'setJournalNarrative', + 'payCode' => 'setPayCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'nominalCode' => 'getNominalCode', + 'nominalName' => 'getNominalName', + 'journalNarrative' => 'getJournalNarrative', + 'payCode' => 'getPayCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('nominalCode', $data ?? [], null); + $this->setIfExists('nominalName', $data ?? [], null); + $this->setIfExists('journalNarrative', $data ?? [], null); + $this->setIfExists('payCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['nominalCode']) && (mb_strlen($this->container['nominalCode']) > 500)) { + $invalidProperties[] = "invalid value for 'nominalCode', the character length must be smaller than or equal to 500."; + } + + if (!is_null($this->container['nominalName']) && (mb_strlen($this->container['nominalName']) > 100)) { + $invalidProperties[] = "invalid value for 'nominalName', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['journalNarrative']) && (mb_strlen($this->container['journalNarrative']) > 500)) { + $invalidProperties[] = "invalid value for 'journalNarrative', the character length must be smaller than or equal to 500."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nominalCode + * + * @return string|null + */ + public function getNominalCode(): ?string + { + return $this->container['nominalCode']; + } + + /** + * Sets nominalCode + * + * @param string|null $nominalCode Nominal Code for pension scheme + * + * @return $this + */ + public function setNominalCode(?string $nominalCode): static + { + if (is_null($nominalCode)) { + array_push($this->openAPINullablesSetToNull, 'nominalCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($nominalCode) && (mb_strlen($nominalCode) > 500)) { + throw new InvalidArgumentException('invalid length for $nominalCode when calling PensionSchemeNominalCodeMapping., must be smaller than or equal to 500.'); + } + + $this->container['nominalCode'] = $nominalCode; + + return $this; + } + + /** + * Gets nominalName + * + * @return string|null + */ + public function getNominalName(): ?string + { + return $this->container['nominalName']; + } + + /** + * Sets nominalName + * + * @param string|null $nominalName Nominal Name + * + * @return $this + */ + public function setNominalName(?string $nominalName): static + { + if (is_null($nominalName)) { + array_push($this->openAPINullablesSetToNull, 'nominalName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($nominalName) && (mb_strlen($nominalName) > 100)) { + throw new InvalidArgumentException('invalid length for $nominalName when calling PensionSchemeNominalCodeMapping., must be smaller than or equal to 100.'); + } + + $this->container['nominalName'] = $nominalName; + + return $this; + } + + /** + * Gets journalNarrative + * + * @return string|null + */ + public function getJournalNarrative(): ?string + { + return $this->container['journalNarrative']; + } + + /** + * Sets journalNarrative + * + * @param string|null $journalNarrative Journal narrative description. + * + * @return $this + */ + public function setJournalNarrative(?string $journalNarrative): static + { + if (is_null($journalNarrative)) { + array_push($this->openAPINullablesSetToNull, 'journalNarrative'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('journalNarrative', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($journalNarrative) && (mb_strlen($journalNarrative) > 500)) { + throw new InvalidArgumentException('invalid length for $journalNarrative when calling PensionSchemeNominalCodeMapping., must be smaller than or equal to 500.'); + } + + $this->container['journalNarrative'] = $journalNarrative; + + return $this; + } + + /** + * Gets payCode + * + * @return string|null + */ + public function getPayCode(): ?string + { + return $this->container['payCode']; + } + + /** + * Sets payCode + * + * @param string|null $payCode payCode + * + * @return $this + */ + public function setPayCode(?string $payCode): static + { + if (is_null($payCode)) { + array_push($this->openAPINullablesSetToNull, 'payCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCode'] = $payCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSchemeReportOptionsLgpsCivicaUpm.php b/src/Model/PensionSchemeReportOptionsLgpsCivicaUpm.php new file mode 100644 index 0000000..ad9c48e --- /dev/null +++ b/src/Model/PensionSchemeReportOptionsLgpsCivicaUpm.php @@ -0,0 +1,680 @@ + + */ +class PensionSchemeReportOptionsLgpsCivicaUpm implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSchemeReportOptionsLgpsCivicaUpm'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollNumber' => '\SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber', + 'casualHours' => '\SynergiTech\Staffology\Model\LgpsCivicaCasualHours', + 'omitHeaderLine' => 'bool', + 'includeFolderNo' => 'bool', + 'excludeSchoolEmployerName' => 'bool', + 'addressesForNewJoinersOnly' => 'bool', + 'proRatePtHoursWeeksWorked' => 'bool', + 'fullTimeHoursAsOneHundred' => 'bool', + 'includeWeeksWorkedColumns' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollNumber' => null, + 'casualHours' => null, + 'omitHeaderLine' => null, + 'includeFolderNo' => null, + 'excludeSchoolEmployerName' => null, + 'addressesForNewJoinersOnly' => null, + 'proRatePtHoursWeeksWorked' => null, + 'fullTimeHoursAsOneHundred' => null, + 'includeWeeksWorkedColumns' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollNumber' => false, + 'casualHours' => false, + 'omitHeaderLine' => false, + 'includeFolderNo' => false, + 'excludeSchoolEmployerName' => false, + 'addressesForNewJoinersOnly' => false, + 'proRatePtHoursWeeksWorked' => false, + 'fullTimeHoursAsOneHundred' => false, + 'includeWeeksWorkedColumns' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollNumber' => 'payrollNumber', + 'casualHours' => 'casualHours', + 'omitHeaderLine' => 'omitHeaderLine', + 'includeFolderNo' => 'includeFolderNo', + 'excludeSchoolEmployerName' => 'excludeSchoolEmployerName', + 'addressesForNewJoinersOnly' => 'addressesForNewJoinersOnly', + 'proRatePtHoursWeeksWorked' => 'proRatePtHoursWeeksWorked', + 'fullTimeHoursAsOneHundred' => 'fullTimeHoursAsOneHundred', + 'includeWeeksWorkedColumns' => 'includeWeeksWorkedColumns' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollNumber' => 'setPayrollNumber', + 'casualHours' => 'setCasualHours', + 'omitHeaderLine' => 'setOmitHeaderLine', + 'includeFolderNo' => 'setIncludeFolderNo', + 'excludeSchoolEmployerName' => 'setExcludeSchoolEmployerName', + 'addressesForNewJoinersOnly' => 'setAddressesForNewJoinersOnly', + 'proRatePtHoursWeeksWorked' => 'setProRatePtHoursWeeksWorked', + 'fullTimeHoursAsOneHundred' => 'setFullTimeHoursAsOneHundred', + 'includeWeeksWorkedColumns' => 'setIncludeWeeksWorkedColumns' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollNumber' => 'getPayrollNumber', + 'casualHours' => 'getCasualHours', + 'omitHeaderLine' => 'getOmitHeaderLine', + 'includeFolderNo' => 'getIncludeFolderNo', + 'excludeSchoolEmployerName' => 'getExcludeSchoolEmployerName', + 'addressesForNewJoinersOnly' => 'getAddressesForNewJoinersOnly', + 'proRatePtHoursWeeksWorked' => 'getProRatePtHoursWeeksWorked', + 'fullTimeHoursAsOneHundred' => 'getFullTimeHoursAsOneHundred', + 'includeWeeksWorkedColumns' => 'getIncludeWeeksWorkedColumns' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollNumber', $data ?? [], null); + $this->setIfExists('casualHours', $data ?? [], null); + $this->setIfExists('omitHeaderLine', $data ?? [], null); + $this->setIfExists('includeFolderNo', $data ?? [], null); + $this->setIfExists('excludeSchoolEmployerName', $data ?? [], null); + $this->setIfExists('addressesForNewJoinersOnly', $data ?? [], null); + $this->setIfExists('proRatePtHoursWeeksWorked', $data ?? [], null); + $this->setIfExists('fullTimeHoursAsOneHundred', $data ?? [], null); + $this->setIfExists('includeWeeksWorkedColumns', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollNumber + * + * @return \SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber|null + */ + public function getPayrollNumber(): ?\SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber + { + return $this->container['payrollNumber']; + } + + /** + * Sets payrollNumber + * + * @param \SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber|null $payrollNumber payrollNumber + * + * @return $this + */ + public function setPayrollNumber(?\SynergiTech\Staffology\Model\LgpsCivicaPayrollNumber $payrollNumber): static + { + if (is_null($payrollNumber)) { + throw new InvalidArgumentException('non-nullable payrollNumber cannot be null'); + } + $this->container['payrollNumber'] = $payrollNumber; + + return $this; + } + + /** + * Gets casualHours + * + * @return \SynergiTech\Staffology\Model\LgpsCivicaCasualHours|null + */ + public function getCasualHours(): ?\SynergiTech\Staffology\Model\LgpsCivicaCasualHours + { + return $this->container['casualHours']; + } + + /** + * Sets casualHours + * + * @param \SynergiTech\Staffology\Model\LgpsCivicaCasualHours|null $casualHours casualHours + * + * @return $this + */ + public function setCasualHours(?\SynergiTech\Staffology\Model\LgpsCivicaCasualHours $casualHours): static + { + if (is_null($casualHours)) { + throw new InvalidArgumentException('non-nullable casualHours cannot be null'); + } + $this->container['casualHours'] = $casualHours; + + return $this; + } + + /** + * Gets omitHeaderLine + * + * @return bool|null + */ + public function getOmitHeaderLine(): ?bool + { + return $this->container['omitHeaderLine']; + } + + /** + * Sets omitHeaderLine + * + * @param bool|null $omitHeaderLine omitHeaderLine + * + * @return $this + */ + public function setOmitHeaderLine(?bool $omitHeaderLine): static + { + if (is_null($omitHeaderLine)) { + throw new InvalidArgumentException('non-nullable omitHeaderLine cannot be null'); + } + $this->container['omitHeaderLine'] = $omitHeaderLine; + + return $this; + } + + /** + * Gets includeFolderNo + * + * @return bool|null + */ + public function getIncludeFolderNo(): ?bool + { + return $this->container['includeFolderNo']; + } + + /** + * Sets includeFolderNo + * + * @param bool|null $includeFolderNo includeFolderNo + * + * @return $this + */ + public function setIncludeFolderNo(?bool $includeFolderNo): static + { + if (is_null($includeFolderNo)) { + throw new InvalidArgumentException('non-nullable includeFolderNo cannot be null'); + } + $this->container['includeFolderNo'] = $includeFolderNo; + + return $this; + } + + /** + * Gets excludeSchoolEmployerName + * + * @return bool|null + */ + public function getExcludeSchoolEmployerName(): ?bool + { + return $this->container['excludeSchoolEmployerName']; + } + + /** + * Sets excludeSchoolEmployerName + * + * @param bool|null $excludeSchoolEmployerName excludeSchoolEmployerName + * + * @return $this + */ + public function setExcludeSchoolEmployerName(?bool $excludeSchoolEmployerName): static + { + if (is_null($excludeSchoolEmployerName)) { + throw new InvalidArgumentException('non-nullable excludeSchoolEmployerName cannot be null'); + } + $this->container['excludeSchoolEmployerName'] = $excludeSchoolEmployerName; + + return $this; + } + + /** + * Gets addressesForNewJoinersOnly + * + * @return bool|null + */ + public function getAddressesForNewJoinersOnly(): ?bool + { + return $this->container['addressesForNewJoinersOnly']; + } + + /** + * Sets addressesForNewJoinersOnly + * + * @param bool|null $addressesForNewJoinersOnly addressesForNewJoinersOnly + * + * @return $this + */ + public function setAddressesForNewJoinersOnly(?bool $addressesForNewJoinersOnly): static + { + if (is_null($addressesForNewJoinersOnly)) { + throw new InvalidArgumentException('non-nullable addressesForNewJoinersOnly cannot be null'); + } + $this->container['addressesForNewJoinersOnly'] = $addressesForNewJoinersOnly; + + return $this; + } + + /** + * Gets proRatePtHoursWeeksWorked + * + * @return bool|null + */ + public function getProRatePtHoursWeeksWorked(): ?bool + { + return $this->container['proRatePtHoursWeeksWorked']; + } + + /** + * Sets proRatePtHoursWeeksWorked + * + * @param bool|null $proRatePtHoursWeeksWorked proRatePtHoursWeeksWorked + * + * @return $this + */ + public function setProRatePtHoursWeeksWorked(?bool $proRatePtHoursWeeksWorked): static + { + if (is_null($proRatePtHoursWeeksWorked)) { + throw new InvalidArgumentException('non-nullable proRatePtHoursWeeksWorked cannot be null'); + } + $this->container['proRatePtHoursWeeksWorked'] = $proRatePtHoursWeeksWorked; + + return $this; + } + + /** + * Gets fullTimeHoursAsOneHundred + * + * @return bool|null + */ + public function getFullTimeHoursAsOneHundred(): ?bool + { + return $this->container['fullTimeHoursAsOneHundred']; + } + + /** + * Sets fullTimeHoursAsOneHundred + * + * @param bool|null $fullTimeHoursAsOneHundred fullTimeHoursAsOneHundred + * + * @return $this + */ + public function setFullTimeHoursAsOneHundred(?bool $fullTimeHoursAsOneHundred): static + { + if (is_null($fullTimeHoursAsOneHundred)) { + throw new InvalidArgumentException('non-nullable fullTimeHoursAsOneHundred cannot be null'); + } + $this->container['fullTimeHoursAsOneHundred'] = $fullTimeHoursAsOneHundred; + + return $this; + } + + /** + * Gets includeWeeksWorkedColumns + * + * @return bool|null + */ + public function getIncludeWeeksWorkedColumns(): ?bool + { + return $this->container['includeWeeksWorkedColumns']; + } + + /** + * Sets includeWeeksWorkedColumns + * + * @param bool|null $includeWeeksWorkedColumns includeWeeksWorkedColumns + * + * @return $this + */ + public function setIncludeWeeksWorkedColumns(?bool $includeWeeksWorkedColumns): static + { + if (is_null($includeWeeksWorkedColumns)) { + throw new InvalidArgumentException('non-nullable includeWeeksWorkedColumns cannot be null'); + } + $this->container['includeWeeksWorkedColumns'] = $includeWeeksWorkedColumns; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSchemeReportOptionsLgpsIConnect.php b/src/Model/PensionSchemeReportOptionsLgpsIConnect.php new file mode 100644 index 0000000..38572f9 --- /dev/null +++ b/src/Model/PensionSchemeReportOptionsLgpsIConnect.php @@ -0,0 +1,1163 @@ + + */ +class PensionSchemeReportOptionsLgpsIConnect implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSchemeReportOptionsLgpsIConnect'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'fileType' => '\SynergiTech\Staffology\Model\LgpsIConnectFileType', + 'payrollReference1' => '\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference', + 'payrollReference2' => '\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference', + 'payrollReference3' => '\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference', + 'populateEmailAddress' => 'bool', + 'populateTelephoneNumber' => 'bool', + 'populateMobileNumber' => 'bool', + 'populateWorksPlaceName' => 'bool', + 'populateWorksAddress' => 'bool', + 'populateWorksEmailAddress' => 'bool', + 'includeEmploymentBreaks' => 'bool', + 'breakReasonSmpIndicatorOnly' => 'bool', + 'populateMaritalStatus' => 'bool', + 'includeAeQualifyingEarnings' => 'bool', + 'proRatePtHoursByTermTimeWeeks' => 'bool', + 'ignoreTermTimeWeeksForFteFinalPay' => 'bool', + 'showFteAnnualSalaryForFteFinalPay' => 'bool', + 'casualStaffHoursAsOne' => 'bool', + 'casualStaffIndicatorAsY' => 'bool', + 'ignoreHours' => 'bool', + 'forceUpperCase' => 'bool', + 'salaryType' => '\SynergiTech\Staffology\Model\LgpsIConnectSalaryType', + 'customText' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'fileType' => null, + 'payrollReference1' => null, + 'payrollReference2' => null, + 'payrollReference3' => null, + 'populateEmailAddress' => null, + 'populateTelephoneNumber' => null, + 'populateMobileNumber' => null, + 'populateWorksPlaceName' => null, + 'populateWorksAddress' => null, + 'populateWorksEmailAddress' => null, + 'includeEmploymentBreaks' => null, + 'breakReasonSmpIndicatorOnly' => null, + 'populateMaritalStatus' => null, + 'includeAeQualifyingEarnings' => null, + 'proRatePtHoursByTermTimeWeeks' => null, + 'ignoreTermTimeWeeksForFteFinalPay' => null, + 'showFteAnnualSalaryForFteFinalPay' => null, + 'casualStaffHoursAsOne' => null, + 'casualStaffIndicatorAsY' => null, + 'ignoreHours' => null, + 'forceUpperCase' => null, + 'salaryType' => null, + 'customText' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'fileType' => false, + 'payrollReference1' => false, + 'payrollReference2' => false, + 'payrollReference3' => false, + 'populateEmailAddress' => false, + 'populateTelephoneNumber' => false, + 'populateMobileNumber' => false, + 'populateWorksPlaceName' => false, + 'populateWorksAddress' => false, + 'populateWorksEmailAddress' => false, + 'includeEmploymentBreaks' => false, + 'breakReasonSmpIndicatorOnly' => false, + 'populateMaritalStatus' => false, + 'includeAeQualifyingEarnings' => false, + 'proRatePtHoursByTermTimeWeeks' => false, + 'ignoreTermTimeWeeksForFteFinalPay' => false, + 'showFteAnnualSalaryForFteFinalPay' => false, + 'casualStaffHoursAsOne' => false, + 'casualStaffIndicatorAsY' => false, + 'ignoreHours' => false, + 'forceUpperCase' => false, + 'salaryType' => false, + 'customText' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'fileType' => 'fileType', + 'payrollReference1' => 'payrollReference1', + 'payrollReference2' => 'payrollReference2', + 'payrollReference3' => 'payrollReference3', + 'populateEmailAddress' => 'populateEmailAddress', + 'populateTelephoneNumber' => 'populateTelephoneNumber', + 'populateMobileNumber' => 'populateMobileNumber', + 'populateWorksPlaceName' => 'populateWorksPlaceName', + 'populateWorksAddress' => 'populateWorksAddress', + 'populateWorksEmailAddress' => 'populateWorksEmailAddress', + 'includeEmploymentBreaks' => 'includeEmploymentBreaks', + 'breakReasonSmpIndicatorOnly' => 'breakReasonSmpIndicatorOnly', + 'populateMaritalStatus' => 'populateMaritalStatus', + 'includeAeQualifyingEarnings' => 'includeAeQualifyingEarnings', + 'proRatePtHoursByTermTimeWeeks' => 'proRatePtHoursByTermTimeWeeks', + 'ignoreTermTimeWeeksForFteFinalPay' => 'ignoreTermTimeWeeksForFteFinalPay', + 'showFteAnnualSalaryForFteFinalPay' => 'showFteAnnualSalaryForFteFinalPay', + 'casualStaffHoursAsOne' => 'casualStaffHoursAsOne', + 'casualStaffIndicatorAsY' => 'casualStaffIndicatorAsY', + 'ignoreHours' => 'ignoreHours', + 'forceUpperCase' => 'forceUpperCase', + 'salaryType' => 'salaryType', + 'customText' => 'customText' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'fileType' => 'setFileType', + 'payrollReference1' => 'setPayrollReference1', + 'payrollReference2' => 'setPayrollReference2', + 'payrollReference3' => 'setPayrollReference3', + 'populateEmailAddress' => 'setPopulateEmailAddress', + 'populateTelephoneNumber' => 'setPopulateTelephoneNumber', + 'populateMobileNumber' => 'setPopulateMobileNumber', + 'populateWorksPlaceName' => 'setPopulateWorksPlaceName', + 'populateWorksAddress' => 'setPopulateWorksAddress', + 'populateWorksEmailAddress' => 'setPopulateWorksEmailAddress', + 'includeEmploymentBreaks' => 'setIncludeEmploymentBreaks', + 'breakReasonSmpIndicatorOnly' => 'setBreakReasonSmpIndicatorOnly', + 'populateMaritalStatus' => 'setPopulateMaritalStatus', + 'includeAeQualifyingEarnings' => 'setIncludeAeQualifyingEarnings', + 'proRatePtHoursByTermTimeWeeks' => 'setProRatePtHoursByTermTimeWeeks', + 'ignoreTermTimeWeeksForFteFinalPay' => 'setIgnoreTermTimeWeeksForFteFinalPay', + 'showFteAnnualSalaryForFteFinalPay' => 'setShowFteAnnualSalaryForFteFinalPay', + 'casualStaffHoursAsOne' => 'setCasualStaffHoursAsOne', + 'casualStaffIndicatorAsY' => 'setCasualStaffIndicatorAsY', + 'ignoreHours' => 'setIgnoreHours', + 'forceUpperCase' => 'setForceUpperCase', + 'salaryType' => 'setSalaryType', + 'customText' => 'setCustomText' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'fileType' => 'getFileType', + 'payrollReference1' => 'getPayrollReference1', + 'payrollReference2' => 'getPayrollReference2', + 'payrollReference3' => 'getPayrollReference3', + 'populateEmailAddress' => 'getPopulateEmailAddress', + 'populateTelephoneNumber' => 'getPopulateTelephoneNumber', + 'populateMobileNumber' => 'getPopulateMobileNumber', + 'populateWorksPlaceName' => 'getPopulateWorksPlaceName', + 'populateWorksAddress' => 'getPopulateWorksAddress', + 'populateWorksEmailAddress' => 'getPopulateWorksEmailAddress', + 'includeEmploymentBreaks' => 'getIncludeEmploymentBreaks', + 'breakReasonSmpIndicatorOnly' => 'getBreakReasonSmpIndicatorOnly', + 'populateMaritalStatus' => 'getPopulateMaritalStatus', + 'includeAeQualifyingEarnings' => 'getIncludeAeQualifyingEarnings', + 'proRatePtHoursByTermTimeWeeks' => 'getProRatePtHoursByTermTimeWeeks', + 'ignoreTermTimeWeeksForFteFinalPay' => 'getIgnoreTermTimeWeeksForFteFinalPay', + 'showFteAnnualSalaryForFteFinalPay' => 'getShowFteAnnualSalaryForFteFinalPay', + 'casualStaffHoursAsOne' => 'getCasualStaffHoursAsOne', + 'casualStaffIndicatorAsY' => 'getCasualStaffIndicatorAsY', + 'ignoreHours' => 'getIgnoreHours', + 'forceUpperCase' => 'getForceUpperCase', + 'salaryType' => 'getSalaryType', + 'customText' => 'getCustomText' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fileType', $data ?? [], null); + $this->setIfExists('payrollReference1', $data ?? [], null); + $this->setIfExists('payrollReference2', $data ?? [], null); + $this->setIfExists('payrollReference3', $data ?? [], null); + $this->setIfExists('populateEmailAddress', $data ?? [], null); + $this->setIfExists('populateTelephoneNumber', $data ?? [], null); + $this->setIfExists('populateMobileNumber', $data ?? [], null); + $this->setIfExists('populateWorksPlaceName', $data ?? [], null); + $this->setIfExists('populateWorksAddress', $data ?? [], null); + $this->setIfExists('populateWorksEmailAddress', $data ?? [], null); + $this->setIfExists('includeEmploymentBreaks', $data ?? [], null); + $this->setIfExists('breakReasonSmpIndicatorOnly', $data ?? [], null); + $this->setIfExists('populateMaritalStatus', $data ?? [], null); + $this->setIfExists('includeAeQualifyingEarnings', $data ?? [], null); + $this->setIfExists('proRatePtHoursByTermTimeWeeks', $data ?? [], null); + $this->setIfExists('ignoreTermTimeWeeksForFteFinalPay', $data ?? [], null); + $this->setIfExists('showFteAnnualSalaryForFteFinalPay', $data ?? [], null); + $this->setIfExists('casualStaffHoursAsOne', $data ?? [], null); + $this->setIfExists('casualStaffIndicatorAsY', $data ?? [], null); + $this->setIfExists('ignoreHours', $data ?? [], null); + $this->setIfExists('forceUpperCase', $data ?? [], null); + $this->setIfExists('salaryType', $data ?? [], null); + $this->setIfExists('customText', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fileType + * + * @return \SynergiTech\Staffology\Model\LgpsIConnectFileType|null + */ + public function getFileType(): ?\SynergiTech\Staffology\Model\LgpsIConnectFileType + { + return $this->container['fileType']; + } + + /** + * Sets fileType + * + * @param \SynergiTech\Staffology\Model\LgpsIConnectFileType|null $fileType fileType + * + * @return $this + */ + public function setFileType(?\SynergiTech\Staffology\Model\LgpsIConnectFileType $fileType): static + { + if (is_null($fileType)) { + throw new InvalidArgumentException('non-nullable fileType cannot be null'); + } + $this->container['fileType'] = $fileType; + + return $this; + } + + /** + * Gets payrollReference1 + * + * @return \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null + */ + public function getPayrollReference1(): ?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference + { + return $this->container['payrollReference1']; + } + + /** + * Sets payrollReference1 + * + * @param \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null $payrollReference1 payrollReference1 + * + * @return $this + */ + public function setPayrollReference1(?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference $payrollReference1): static + { + if (is_null($payrollReference1)) { + throw new InvalidArgumentException('non-nullable payrollReference1 cannot be null'); + } + $this->container['payrollReference1'] = $payrollReference1; + + return $this; + } + + /** + * Gets payrollReference2 + * + * @return \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null + */ + public function getPayrollReference2(): ?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference + { + return $this->container['payrollReference2']; + } + + /** + * Sets payrollReference2 + * + * @param \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null $payrollReference2 payrollReference2 + * + * @return $this + */ + public function setPayrollReference2(?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference $payrollReference2): static + { + if (is_null($payrollReference2)) { + throw new InvalidArgumentException('non-nullable payrollReference2 cannot be null'); + } + $this->container['payrollReference2'] = $payrollReference2; + + return $this; + } + + /** + * Gets payrollReference3 + * + * @return \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null + */ + public function getPayrollReference3(): ?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference + { + return $this->container['payrollReference3']; + } + + /** + * Sets payrollReference3 + * + * @param \SynergiTech\Staffology\Model\LgpsIConnectPayrollReference|null $payrollReference3 payrollReference3 + * + * @return $this + */ + public function setPayrollReference3(?\SynergiTech\Staffology\Model\LgpsIConnectPayrollReference $payrollReference3): static + { + if (is_null($payrollReference3)) { + throw new InvalidArgumentException('non-nullable payrollReference3 cannot be null'); + } + $this->container['payrollReference3'] = $payrollReference3; + + return $this; + } + + /** + * Gets populateEmailAddress + * + * @return bool|null + */ + public function getPopulateEmailAddress(): ?bool + { + return $this->container['populateEmailAddress']; + } + + /** + * Sets populateEmailAddress + * + * @param bool|null $populateEmailAddress populateEmailAddress + * + * @return $this + */ + public function setPopulateEmailAddress(?bool $populateEmailAddress): static + { + if (is_null($populateEmailAddress)) { + throw new InvalidArgumentException('non-nullable populateEmailAddress cannot be null'); + } + $this->container['populateEmailAddress'] = $populateEmailAddress; + + return $this; + } + + /** + * Gets populateTelephoneNumber + * + * @return bool|null + */ + public function getPopulateTelephoneNumber(): ?bool + { + return $this->container['populateTelephoneNumber']; + } + + /** + * Sets populateTelephoneNumber + * + * @param bool|null $populateTelephoneNumber populateTelephoneNumber + * + * @return $this + */ + public function setPopulateTelephoneNumber(?bool $populateTelephoneNumber): static + { + if (is_null($populateTelephoneNumber)) { + throw new InvalidArgumentException('non-nullable populateTelephoneNumber cannot be null'); + } + $this->container['populateTelephoneNumber'] = $populateTelephoneNumber; + + return $this; + } + + /** + * Gets populateMobileNumber + * + * @return bool|null + */ + public function getPopulateMobileNumber(): ?bool + { + return $this->container['populateMobileNumber']; + } + + /** + * Sets populateMobileNumber + * + * @param bool|null $populateMobileNumber populateMobileNumber + * + * @return $this + */ + public function setPopulateMobileNumber(?bool $populateMobileNumber): static + { + if (is_null($populateMobileNumber)) { + throw new InvalidArgumentException('non-nullable populateMobileNumber cannot be null'); + } + $this->container['populateMobileNumber'] = $populateMobileNumber; + + return $this; + } + + /** + * Gets populateWorksPlaceName + * + * @return bool|null + */ + public function getPopulateWorksPlaceName(): ?bool + { + return $this->container['populateWorksPlaceName']; + } + + /** + * Sets populateWorksPlaceName + * + * @param bool|null $populateWorksPlaceName populateWorksPlaceName + * + * @return $this + */ + public function setPopulateWorksPlaceName(?bool $populateWorksPlaceName): static + { + if (is_null($populateWorksPlaceName)) { + throw new InvalidArgumentException('non-nullable populateWorksPlaceName cannot be null'); + } + $this->container['populateWorksPlaceName'] = $populateWorksPlaceName; + + return $this; + } + + /** + * Gets populateWorksAddress + * + * @return bool|null + */ + public function getPopulateWorksAddress(): ?bool + { + return $this->container['populateWorksAddress']; + } + + /** + * Sets populateWorksAddress + * + * @param bool|null $populateWorksAddress populateWorksAddress + * + * @return $this + */ + public function setPopulateWorksAddress(?bool $populateWorksAddress): static + { + if (is_null($populateWorksAddress)) { + throw new InvalidArgumentException('non-nullable populateWorksAddress cannot be null'); + } + $this->container['populateWorksAddress'] = $populateWorksAddress; + + return $this; + } + + /** + * Gets populateWorksEmailAddress + * + * @return bool|null + */ + public function getPopulateWorksEmailAddress(): ?bool + { + return $this->container['populateWorksEmailAddress']; + } + + /** + * Sets populateWorksEmailAddress + * + * @param bool|null $populateWorksEmailAddress populateWorksEmailAddress + * + * @return $this + */ + public function setPopulateWorksEmailAddress(?bool $populateWorksEmailAddress): static + { + if (is_null($populateWorksEmailAddress)) { + throw new InvalidArgumentException('non-nullable populateWorksEmailAddress cannot be null'); + } + $this->container['populateWorksEmailAddress'] = $populateWorksEmailAddress; + + return $this; + } + + /** + * Gets includeEmploymentBreaks + * + * @return bool|null + */ + public function getIncludeEmploymentBreaks(): ?bool + { + return $this->container['includeEmploymentBreaks']; + } + + /** + * Sets includeEmploymentBreaks + * + * @param bool|null $includeEmploymentBreaks includeEmploymentBreaks + * + * @return $this + */ + public function setIncludeEmploymentBreaks(?bool $includeEmploymentBreaks): static + { + if (is_null($includeEmploymentBreaks)) { + throw new InvalidArgumentException('non-nullable includeEmploymentBreaks cannot be null'); + } + $this->container['includeEmploymentBreaks'] = $includeEmploymentBreaks; + + return $this; + } + + /** + * Gets breakReasonSmpIndicatorOnly + * + * @return bool|null + */ + public function getBreakReasonSmpIndicatorOnly(): ?bool + { + return $this->container['breakReasonSmpIndicatorOnly']; + } + + /** + * Sets breakReasonSmpIndicatorOnly + * + * @param bool|null $breakReasonSmpIndicatorOnly breakReasonSmpIndicatorOnly + * + * @return $this + */ + public function setBreakReasonSmpIndicatorOnly(?bool $breakReasonSmpIndicatorOnly): static + { + if (is_null($breakReasonSmpIndicatorOnly)) { + throw new InvalidArgumentException('non-nullable breakReasonSmpIndicatorOnly cannot be null'); + } + $this->container['breakReasonSmpIndicatorOnly'] = $breakReasonSmpIndicatorOnly; + + return $this; + } + + /** + * Gets populateMaritalStatus + * + * @return bool|null + */ + public function getPopulateMaritalStatus(): ?bool + { + return $this->container['populateMaritalStatus']; + } + + /** + * Sets populateMaritalStatus + * + * @param bool|null $populateMaritalStatus populateMaritalStatus + * + * @return $this + */ + public function setPopulateMaritalStatus(?bool $populateMaritalStatus): static + { + if (is_null($populateMaritalStatus)) { + throw new InvalidArgumentException('non-nullable populateMaritalStatus cannot be null'); + } + $this->container['populateMaritalStatus'] = $populateMaritalStatus; + + return $this; + } + + /** + * Gets includeAeQualifyingEarnings + * + * @return bool|null + */ + public function getIncludeAeQualifyingEarnings(): ?bool + { + return $this->container['includeAeQualifyingEarnings']; + } + + /** + * Sets includeAeQualifyingEarnings + * + * @param bool|null $includeAeQualifyingEarnings includeAeQualifyingEarnings + * + * @return $this + */ + public function setIncludeAeQualifyingEarnings(?bool $includeAeQualifyingEarnings): static + { + if (is_null($includeAeQualifyingEarnings)) { + throw new InvalidArgumentException('non-nullable includeAeQualifyingEarnings cannot be null'); + } + $this->container['includeAeQualifyingEarnings'] = $includeAeQualifyingEarnings; + + return $this; + } + + /** + * Gets proRatePtHoursByTermTimeWeeks + * + * @return bool|null + */ + public function getProRatePtHoursByTermTimeWeeks(): ?bool + { + return $this->container['proRatePtHoursByTermTimeWeeks']; + } + + /** + * Sets proRatePtHoursByTermTimeWeeks + * + * @param bool|null $proRatePtHoursByTermTimeWeeks proRatePtHoursByTermTimeWeeks + * + * @return $this + */ + public function setProRatePtHoursByTermTimeWeeks(?bool $proRatePtHoursByTermTimeWeeks): static + { + if (is_null($proRatePtHoursByTermTimeWeeks)) { + throw new InvalidArgumentException('non-nullable proRatePtHoursByTermTimeWeeks cannot be null'); + } + $this->container['proRatePtHoursByTermTimeWeeks'] = $proRatePtHoursByTermTimeWeeks; + + return $this; + } + + /** + * Gets ignoreTermTimeWeeksForFteFinalPay + * + * @return bool|null + */ + public function getIgnoreTermTimeWeeksForFteFinalPay(): ?bool + { + return $this->container['ignoreTermTimeWeeksForFteFinalPay']; + } + + /** + * Sets ignoreTermTimeWeeksForFteFinalPay + * + * @param bool|null $ignoreTermTimeWeeksForFteFinalPay ignoreTermTimeWeeksForFteFinalPay + * + * @return $this + */ + public function setIgnoreTermTimeWeeksForFteFinalPay(?bool $ignoreTermTimeWeeksForFteFinalPay): static + { + if (is_null($ignoreTermTimeWeeksForFteFinalPay)) { + throw new InvalidArgumentException('non-nullable ignoreTermTimeWeeksForFteFinalPay cannot be null'); + } + $this->container['ignoreTermTimeWeeksForFteFinalPay'] = $ignoreTermTimeWeeksForFteFinalPay; + + return $this; + } + + /** + * Gets showFteAnnualSalaryForFteFinalPay + * + * @return bool|null + */ + public function getShowFteAnnualSalaryForFteFinalPay(): ?bool + { + return $this->container['showFteAnnualSalaryForFteFinalPay']; + } + + /** + * Sets showFteAnnualSalaryForFteFinalPay + * + * @param bool|null $showFteAnnualSalaryForFteFinalPay showFteAnnualSalaryForFteFinalPay + * + * @return $this + */ + public function setShowFteAnnualSalaryForFteFinalPay(?bool $showFteAnnualSalaryForFteFinalPay): static + { + if (is_null($showFteAnnualSalaryForFteFinalPay)) { + throw new InvalidArgumentException('non-nullable showFteAnnualSalaryForFteFinalPay cannot be null'); + } + $this->container['showFteAnnualSalaryForFteFinalPay'] = $showFteAnnualSalaryForFteFinalPay; + + return $this; + } + + /** + * Gets casualStaffHoursAsOne + * + * @return bool|null + */ + public function getCasualStaffHoursAsOne(): ?bool + { + return $this->container['casualStaffHoursAsOne']; + } + + /** + * Sets casualStaffHoursAsOne + * + * @param bool|null $casualStaffHoursAsOne casualStaffHoursAsOne + * + * @return $this + */ + public function setCasualStaffHoursAsOne(?bool $casualStaffHoursAsOne): static + { + if (is_null($casualStaffHoursAsOne)) { + throw new InvalidArgumentException('non-nullable casualStaffHoursAsOne cannot be null'); + } + $this->container['casualStaffHoursAsOne'] = $casualStaffHoursAsOne; + + return $this; + } + + /** + * Gets casualStaffIndicatorAsY + * + * @return bool|null + */ + public function getCasualStaffIndicatorAsY(): ?bool + { + return $this->container['casualStaffIndicatorAsY']; + } + + /** + * Sets casualStaffIndicatorAsY + * + * @param bool|null $casualStaffIndicatorAsY casualStaffIndicatorAsY + * + * @return $this + */ + public function setCasualStaffIndicatorAsY(?bool $casualStaffIndicatorAsY): static + { + if (is_null($casualStaffIndicatorAsY)) { + throw new InvalidArgumentException('non-nullable casualStaffIndicatorAsY cannot be null'); + } + $this->container['casualStaffIndicatorAsY'] = $casualStaffIndicatorAsY; + + return $this; + } + + /** + * Gets ignoreHours + * + * @return bool|null + */ + public function getIgnoreHours(): ?bool + { + return $this->container['ignoreHours']; + } + + /** + * Sets ignoreHours + * + * @param bool|null $ignoreHours ignoreHours + * + * @return $this + */ + public function setIgnoreHours(?bool $ignoreHours): static + { + if (is_null($ignoreHours)) { + throw new InvalidArgumentException('non-nullable ignoreHours cannot be null'); + } + $this->container['ignoreHours'] = $ignoreHours; + + return $this; + } + + /** + * Gets forceUpperCase + * + * @return bool|null + */ + public function getForceUpperCase(): ?bool + { + return $this->container['forceUpperCase']; + } + + /** + * Sets forceUpperCase + * + * @param bool|null $forceUpperCase forceUpperCase + * + * @return $this + */ + public function setForceUpperCase(?bool $forceUpperCase): static + { + if (is_null($forceUpperCase)) { + throw new InvalidArgumentException('non-nullable forceUpperCase cannot be null'); + } + $this->container['forceUpperCase'] = $forceUpperCase; + + return $this; + } + + /** + * Gets salaryType + * + * @return \SynergiTech\Staffology\Model\LgpsIConnectSalaryType|null + */ + public function getSalaryType(): ?\SynergiTech\Staffology\Model\LgpsIConnectSalaryType + { + return $this->container['salaryType']; + } + + /** + * Sets salaryType + * + * @param \SynergiTech\Staffology\Model\LgpsIConnectSalaryType|null $salaryType salaryType + * + * @return $this + */ + public function setSalaryType(?\SynergiTech\Staffology\Model\LgpsIConnectSalaryType $salaryType): static + { + if (is_null($salaryType)) { + throw new InvalidArgumentException('non-nullable salaryType cannot be null'); + } + $this->container['salaryType'] = $salaryType; + + return $this; + } + + /** + * Gets customText + * + * @return string|null + */ + public function getCustomText(): ?string + { + return $this->container['customText']; + } + + /** + * Sets customText + * + * @param string|null $customText customText + * + * @return $this + */ + public function setCustomText(?string $customText): static + { + if (is_null($customText)) { + array_push($this->openAPINullablesSetToNull, 'customText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('customText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['customText'] = $customText; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSelection.php b/src/Model/PensionSelection.php new file mode 100644 index 0000000..0dd7d60 --- /dev/null +++ b/src/Model/PensionSelection.php @@ -0,0 +1,510 @@ + + */ +class PensionSelection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSelection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'pensionSchemeId' => 'string', + 'pensionScheme' => '\SynergiTech\Staffology\Model\PensionScheme', + 'workerGroupId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'pensionSchemeId' => 'uuid', + 'pensionScheme' => null, + 'workerGroupId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'pensionSchemeId' => false, + 'pensionScheme' => false, + 'workerGroupId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'pensionSchemeId' => 'pensionSchemeId', + 'pensionScheme' => 'pensionScheme', + 'workerGroupId' => 'workerGroupId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'pensionSchemeId' => 'setPensionSchemeId', + 'pensionScheme' => 'setPensionScheme', + 'workerGroupId' => 'setWorkerGroupId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'pensionSchemeId' => 'getPensionSchemeId', + 'pensionScheme' => 'getPensionScheme', + 'workerGroupId' => 'getWorkerGroupId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('pensionSchemeId', $data ?? [], null); + $this->setIfExists('pensionScheme', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets pensionSchemeId + * + * @return string|null + */ + public function getPensionSchemeId(): ?string + { + return $this->container['pensionSchemeId']; + } + + /** + * Sets pensionSchemeId + * + * @param string|null $pensionSchemeId pensionSchemeId + * + * @return $this + */ + public function setPensionSchemeId(?string $pensionSchemeId): static + { + if (is_null($pensionSchemeId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeId cannot be null'); + } + $this->container['pensionSchemeId'] = $pensionSchemeId; + + return $this; + } + + /** + * Gets pensionScheme + * + * @return \SynergiTech\Staffology\Model\PensionScheme|null + */ + public function getPensionScheme(): ?\SynergiTech\Staffology\Model\PensionScheme + { + return $this->container['pensionScheme']; + } + + /** + * Sets pensionScheme + * + * @param \SynergiTech\Staffology\Model\PensionScheme|null $pensionScheme pensionScheme + * + * @return $this + */ + public function setPensionScheme(?\SynergiTech\Staffology\Model\PensionScheme $pensionScheme): static + { + if (is_null($pensionScheme)) { + throw new InvalidArgumentException('non-nullable pensionScheme cannot be null'); + } + $this->container['pensionScheme'] = $pensionScheme; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId workerGroupId + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSummary.php b/src/Model/PensionSummary.php new file mode 100644 index 0000000..a36144e --- /dev/null +++ b/src/Model/PensionSummary.php @@ -0,0 +1,2180 @@ + + */ +class PensionSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionId' => 'string', + 'name' => 'string', + 'pensionSchemeId' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'workerGroupId' => 'string', + 'pensionRule' => '\SynergiTech\Staffology\Model\PensionRule', + 'subtractedBasicRateTax' => 'bool', + 'papdisPensionProviderId' => 'string', + 'papdisEmployerId' => 'string', + 'employeePensionContributionMultiplier' => 'float', + 'additionalVoluntaryContribution' => 'float', + 'avcIsPercentage' => 'bool', + 'autoEnrolled' => 'bool', + 'workerGroup' => '\SynergiTech\Staffology\Model\WorkerGroup', + 'forcedTier' => 'string', + 'tiers' => '\SynergiTech\Staffology\Model\TieredPensionRate[]', + 'assumedPensionablePay' => 'float', + 'pensionablePayCodes' => 'string[]', + 'tierablePayPayCodes' => 'string[]', + 'isHalfContributionMember' => 'bool', + 'pensionableEarnings' => 'float', + 'pensionablePay' => 'float', + 'nonTierablePay' => 'float', + 'employeePensionContribution' => 'float', + 'employeePensionContributionAvc' => 'float', + 'employerPensionContribution' => 'float', + 'isForEndedPension' => 'bool', + 'associatedEmployeeRoles' => '\SynergiTech\Staffology\Model\Item[]', + 'notionalPay' => 'float', + 'pensionableEarningsBfd' => 'float', + 'pensionablePayBfd' => 'float', + 'employeePensionContributionBfd' => 'float', + 'assumedPensionablePayBfd' => 'float', + 'employerPensionContributionBfd' => 'float', + 'employeePensionContributionAvcBfd' => 'float', + 'whenEarnedPensionSummaries' => '\SynergiTech\Staffology\Model\PensionSummary[]', + 'periodFrom' => '\DateTime', + 'periodTo' => '\DateTime', + 'whenEarnedPensionableEarningsCorrection' => 'float', + 'whenEarnedPensionablePayCorrection' => 'float', + 'whenEarnedEmployeePensionContributionCorrection' => 'float', + 'whenEarnedEmployerPensionContributionCorrection' => 'float', + 'whenEarnedEmployeePensionContributionAvcCorrection' => 'float', + 'whenEarnedPensionableEarningsCorrectionBfd' => 'float', + 'whenEarnedPensionablePayCorrectionBfd' => 'float', + 'whenEarnedEmployeePensionContributionCorrectionBfd' => 'float', + 'whenEarnedEmployerPensionContributionCorrectionBfd' => 'float', + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => 'float', + 'nominalCodeMappings' => '\SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionId' => 'uuid', + 'name' => null, + 'pensionSchemeId' => 'uuid', + 'startDate' => 'date', + 'endDate' => 'date', + 'workerGroupId' => 'uuid', + 'pensionRule' => null, + 'subtractedBasicRateTax' => null, + 'papdisPensionProviderId' => null, + 'papdisEmployerId' => null, + 'employeePensionContributionMultiplier' => 'double', + 'additionalVoluntaryContribution' => 'double', + 'avcIsPercentage' => null, + 'autoEnrolled' => null, + 'workerGroup' => null, + 'forcedTier' => null, + 'tiers' => null, + 'assumedPensionablePay' => 'double', + 'pensionablePayCodes' => null, + 'tierablePayPayCodes' => null, + 'isHalfContributionMember' => null, + 'pensionableEarnings' => 'double', + 'pensionablePay' => 'double', + 'nonTierablePay' => 'double', + 'employeePensionContribution' => 'double', + 'employeePensionContributionAvc' => 'double', + 'employerPensionContribution' => 'double', + 'isForEndedPension' => null, + 'associatedEmployeeRoles' => null, + 'notionalPay' => 'double', + 'pensionableEarningsBfd' => 'double', + 'pensionablePayBfd' => 'double', + 'employeePensionContributionBfd' => 'double', + 'assumedPensionablePayBfd' => 'double', + 'employerPensionContributionBfd' => 'double', + 'employeePensionContributionAvcBfd' => 'double', + 'whenEarnedPensionSummaries' => null, + 'periodFrom' => 'date', + 'periodTo' => 'date', + 'whenEarnedPensionableEarningsCorrection' => 'double', + 'whenEarnedPensionablePayCorrection' => 'double', + 'whenEarnedEmployeePensionContributionCorrection' => 'double', + 'whenEarnedEmployerPensionContributionCorrection' => 'double', + 'whenEarnedEmployeePensionContributionAvcCorrection' => 'double', + 'whenEarnedPensionableEarningsCorrectionBfd' => 'double', + 'whenEarnedPensionablePayCorrectionBfd' => 'double', + 'whenEarnedEmployeePensionContributionCorrectionBfd' => 'double', + 'whenEarnedEmployerPensionContributionCorrectionBfd' => 'double', + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => 'double', + 'nominalCodeMappings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionId' => false, + 'name' => true, + 'pensionSchemeId' => false, + 'startDate' => false, + 'endDate' => true, + 'workerGroupId' => false, + 'pensionRule' => false, + 'subtractedBasicRateTax' => false, + 'papdisPensionProviderId' => true, + 'papdisEmployerId' => true, + 'employeePensionContributionMultiplier' => false, + 'additionalVoluntaryContribution' => false, + 'avcIsPercentage' => false, + 'autoEnrolled' => false, + 'workerGroup' => false, + 'forcedTier' => true, + 'tiers' => true, + 'assumedPensionablePay' => true, + 'pensionablePayCodes' => true, + 'tierablePayPayCodes' => true, + 'isHalfContributionMember' => false, + 'pensionableEarnings' => false, + 'pensionablePay' => false, + 'nonTierablePay' => false, + 'employeePensionContribution' => false, + 'employeePensionContributionAvc' => false, + 'employerPensionContribution' => false, + 'isForEndedPension' => false, + 'associatedEmployeeRoles' => true, + 'notionalPay' => false, + 'pensionableEarningsBfd' => false, + 'pensionablePayBfd' => false, + 'employeePensionContributionBfd' => false, + 'assumedPensionablePayBfd' => true, + 'employerPensionContributionBfd' => false, + 'employeePensionContributionAvcBfd' => false, + 'whenEarnedPensionSummaries' => true, + 'periodFrom' => true, + 'periodTo' => true, + 'whenEarnedPensionableEarningsCorrection' => false, + 'whenEarnedPensionablePayCorrection' => false, + 'whenEarnedEmployeePensionContributionCorrection' => false, + 'whenEarnedEmployerPensionContributionCorrection' => false, + 'whenEarnedEmployeePensionContributionAvcCorrection' => false, + 'whenEarnedPensionableEarningsCorrectionBfd' => false, + 'whenEarnedPensionablePayCorrectionBfd' => false, + 'whenEarnedEmployeePensionContributionCorrectionBfd' => false, + 'whenEarnedEmployerPensionContributionCorrectionBfd' => false, + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => false, + 'nominalCodeMappings' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionId' => 'pensionId', + 'name' => 'name', + 'pensionSchemeId' => 'pensionSchemeId', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'workerGroupId' => 'workerGroupId', + 'pensionRule' => 'pensionRule', + 'subtractedBasicRateTax' => 'subtractedBasicRateTax', + 'papdisPensionProviderId' => 'papdisPensionProviderId', + 'papdisEmployerId' => 'papdisEmployerId', + 'employeePensionContributionMultiplier' => 'employeePensionContributionMultiplier', + 'additionalVoluntaryContribution' => 'additionalVoluntaryContribution', + 'avcIsPercentage' => 'avcIsPercentage', + 'autoEnrolled' => 'autoEnrolled', + 'workerGroup' => 'workerGroup', + 'forcedTier' => 'forcedTier', + 'tiers' => 'tiers', + 'assumedPensionablePay' => 'assumedPensionablePay', + 'pensionablePayCodes' => 'pensionablePayCodes', + 'tierablePayPayCodes' => 'tierablePayPayCodes', + 'isHalfContributionMember' => 'isHalfContributionMember', + 'pensionableEarnings' => 'pensionableEarnings', + 'pensionablePay' => 'pensionablePay', + 'nonTierablePay' => 'nonTierablePay', + 'employeePensionContribution' => 'employeePensionContribution', + 'employeePensionContributionAvc' => 'employeePensionContributionAvc', + 'employerPensionContribution' => 'employerPensionContribution', + 'isForEndedPension' => 'isForEndedPension', + 'associatedEmployeeRoles' => 'associatedEmployeeRoles', + 'notionalPay' => 'notionalPay', + 'pensionableEarningsBfd' => 'pensionableEarningsBfd', + 'pensionablePayBfd' => 'pensionablePayBfd', + 'employeePensionContributionBfd' => 'employeePensionContributionBfd', + 'assumedPensionablePayBfd' => 'assumedPensionablePayBfd', + 'employerPensionContributionBfd' => 'employerPensionContributionBfd', + 'employeePensionContributionAvcBfd' => 'employeePensionContributionAvcBfd', + 'whenEarnedPensionSummaries' => 'whenEarnedPensionSummaries', + 'periodFrom' => 'periodFrom', + 'periodTo' => 'periodTo', + 'whenEarnedPensionableEarningsCorrection' => 'whenEarnedPensionableEarningsCorrection', + 'whenEarnedPensionablePayCorrection' => 'whenEarnedPensionablePayCorrection', + 'whenEarnedEmployeePensionContributionCorrection' => 'whenEarnedEmployeePensionContributionCorrection', + 'whenEarnedEmployerPensionContributionCorrection' => 'whenEarnedEmployerPensionContributionCorrection', + 'whenEarnedEmployeePensionContributionAvcCorrection' => 'whenEarnedEmployeePensionContributionAvcCorrection', + 'whenEarnedPensionableEarningsCorrectionBfd' => 'whenEarnedPensionableEarningsCorrectionBfd', + 'whenEarnedPensionablePayCorrectionBfd' => 'whenEarnedPensionablePayCorrectionBfd', + 'whenEarnedEmployeePensionContributionCorrectionBfd' => 'whenEarnedEmployeePensionContributionCorrectionBfd', + 'whenEarnedEmployerPensionContributionCorrectionBfd' => 'whenEarnedEmployerPensionContributionCorrectionBfd', + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => 'whenEarnedEmployeePensionContributionAvcCorrectionBfd', + 'nominalCodeMappings' => 'nominalCodeMappings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionId' => 'setPensionId', + 'name' => 'setName', + 'pensionSchemeId' => 'setPensionSchemeId', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'workerGroupId' => 'setWorkerGroupId', + 'pensionRule' => 'setPensionRule', + 'subtractedBasicRateTax' => 'setSubtractedBasicRateTax', + 'papdisPensionProviderId' => 'setPapdisPensionProviderId', + 'papdisEmployerId' => 'setPapdisEmployerId', + 'employeePensionContributionMultiplier' => 'setEmployeePensionContributionMultiplier', + 'additionalVoluntaryContribution' => 'setAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'setAvcIsPercentage', + 'autoEnrolled' => 'setAutoEnrolled', + 'workerGroup' => 'setWorkerGroup', + 'forcedTier' => 'setForcedTier', + 'tiers' => 'setTiers', + 'assumedPensionablePay' => 'setAssumedPensionablePay', + 'pensionablePayCodes' => 'setPensionablePayCodes', + 'tierablePayPayCodes' => 'setTierablePayPayCodes', + 'isHalfContributionMember' => 'setIsHalfContributionMember', + 'pensionableEarnings' => 'setPensionableEarnings', + 'pensionablePay' => 'setPensionablePay', + 'nonTierablePay' => 'setNonTierablePay', + 'employeePensionContribution' => 'setEmployeePensionContribution', + 'employeePensionContributionAvc' => 'setEmployeePensionContributionAvc', + 'employerPensionContribution' => 'setEmployerPensionContribution', + 'isForEndedPension' => 'setIsForEndedPension', + 'associatedEmployeeRoles' => 'setAssociatedEmployeeRoles', + 'notionalPay' => 'setNotionalPay', + 'pensionableEarningsBfd' => 'setPensionableEarningsBfd', + 'pensionablePayBfd' => 'setPensionablePayBfd', + 'employeePensionContributionBfd' => 'setEmployeePensionContributionBfd', + 'assumedPensionablePayBfd' => 'setAssumedPensionablePayBfd', + 'employerPensionContributionBfd' => 'setEmployerPensionContributionBfd', + 'employeePensionContributionAvcBfd' => 'setEmployeePensionContributionAvcBfd', + 'whenEarnedPensionSummaries' => 'setWhenEarnedPensionSummaries', + 'periodFrom' => 'setPeriodFrom', + 'periodTo' => 'setPeriodTo', + 'whenEarnedPensionableEarningsCorrection' => 'setWhenEarnedPensionableEarningsCorrection', + 'whenEarnedPensionablePayCorrection' => 'setWhenEarnedPensionablePayCorrection', + 'whenEarnedEmployeePensionContributionCorrection' => 'setWhenEarnedEmployeePensionContributionCorrection', + 'whenEarnedEmployerPensionContributionCorrection' => 'setWhenEarnedEmployerPensionContributionCorrection', + 'whenEarnedEmployeePensionContributionAvcCorrection' => 'setWhenEarnedEmployeePensionContributionAvcCorrection', + 'whenEarnedPensionableEarningsCorrectionBfd' => 'setWhenEarnedPensionableEarningsCorrectionBfd', + 'whenEarnedPensionablePayCorrectionBfd' => 'setWhenEarnedPensionablePayCorrectionBfd', + 'whenEarnedEmployeePensionContributionCorrectionBfd' => 'setWhenEarnedEmployeePensionContributionCorrectionBfd', + 'whenEarnedEmployerPensionContributionCorrectionBfd' => 'setWhenEarnedEmployerPensionContributionCorrectionBfd', + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => 'setWhenEarnedEmployeePensionContributionAvcCorrectionBfd', + 'nominalCodeMappings' => 'setNominalCodeMappings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionId' => 'getPensionId', + 'name' => 'getName', + 'pensionSchemeId' => 'getPensionSchemeId', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'workerGroupId' => 'getWorkerGroupId', + 'pensionRule' => 'getPensionRule', + 'subtractedBasicRateTax' => 'getSubtractedBasicRateTax', + 'papdisPensionProviderId' => 'getPapdisPensionProviderId', + 'papdisEmployerId' => 'getPapdisEmployerId', + 'employeePensionContributionMultiplier' => 'getEmployeePensionContributionMultiplier', + 'additionalVoluntaryContribution' => 'getAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'getAvcIsPercentage', + 'autoEnrolled' => 'getAutoEnrolled', + 'workerGroup' => 'getWorkerGroup', + 'forcedTier' => 'getForcedTier', + 'tiers' => 'getTiers', + 'assumedPensionablePay' => 'getAssumedPensionablePay', + 'pensionablePayCodes' => 'getPensionablePayCodes', + 'tierablePayPayCodes' => 'getTierablePayPayCodes', + 'isHalfContributionMember' => 'getIsHalfContributionMember', + 'pensionableEarnings' => 'getPensionableEarnings', + 'pensionablePay' => 'getPensionablePay', + 'nonTierablePay' => 'getNonTierablePay', + 'employeePensionContribution' => 'getEmployeePensionContribution', + 'employeePensionContributionAvc' => 'getEmployeePensionContributionAvc', + 'employerPensionContribution' => 'getEmployerPensionContribution', + 'isForEndedPension' => 'getIsForEndedPension', + 'associatedEmployeeRoles' => 'getAssociatedEmployeeRoles', + 'notionalPay' => 'getNotionalPay', + 'pensionableEarningsBfd' => 'getPensionableEarningsBfd', + 'pensionablePayBfd' => 'getPensionablePayBfd', + 'employeePensionContributionBfd' => 'getEmployeePensionContributionBfd', + 'assumedPensionablePayBfd' => 'getAssumedPensionablePayBfd', + 'employerPensionContributionBfd' => 'getEmployerPensionContributionBfd', + 'employeePensionContributionAvcBfd' => 'getEmployeePensionContributionAvcBfd', + 'whenEarnedPensionSummaries' => 'getWhenEarnedPensionSummaries', + 'periodFrom' => 'getPeriodFrom', + 'periodTo' => 'getPeriodTo', + 'whenEarnedPensionableEarningsCorrection' => 'getWhenEarnedPensionableEarningsCorrection', + 'whenEarnedPensionablePayCorrection' => 'getWhenEarnedPensionablePayCorrection', + 'whenEarnedEmployeePensionContributionCorrection' => 'getWhenEarnedEmployeePensionContributionCorrection', + 'whenEarnedEmployerPensionContributionCorrection' => 'getWhenEarnedEmployerPensionContributionCorrection', + 'whenEarnedEmployeePensionContributionAvcCorrection' => 'getWhenEarnedEmployeePensionContributionAvcCorrection', + 'whenEarnedPensionableEarningsCorrectionBfd' => 'getWhenEarnedPensionableEarningsCorrectionBfd', + 'whenEarnedPensionablePayCorrectionBfd' => 'getWhenEarnedPensionablePayCorrectionBfd', + 'whenEarnedEmployeePensionContributionCorrectionBfd' => 'getWhenEarnedEmployeePensionContributionCorrectionBfd', + 'whenEarnedEmployerPensionContributionCorrectionBfd' => 'getWhenEarnedEmployerPensionContributionCorrectionBfd', + 'whenEarnedEmployeePensionContributionAvcCorrectionBfd' => 'getWhenEarnedEmployeePensionContributionAvcCorrectionBfd', + 'nominalCodeMappings' => 'getNominalCodeMappings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('pensionSchemeId', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + $this->setIfExists('pensionRule', $data ?? [], null); + $this->setIfExists('subtractedBasicRateTax', $data ?? [], null); + $this->setIfExists('papdisPensionProviderId', $data ?? [], null); + $this->setIfExists('papdisEmployerId', $data ?? [], null); + $this->setIfExists('employeePensionContributionMultiplier', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContribution', $data ?? [], null); + $this->setIfExists('avcIsPercentage', $data ?? [], null); + $this->setIfExists('autoEnrolled', $data ?? [], null); + $this->setIfExists('workerGroup', $data ?? [], null); + $this->setIfExists('forcedTier', $data ?? [], null); + $this->setIfExists('tiers', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + $this->setIfExists('pensionablePayCodes', $data ?? [], null); + $this->setIfExists('tierablePayPayCodes', $data ?? [], null); + $this->setIfExists('isHalfContributionMember', $data ?? [], null); + $this->setIfExists('pensionableEarnings', $data ?? [], null); + $this->setIfExists('pensionablePay', $data ?? [], null); + $this->setIfExists('nonTierablePay', $data ?? [], null); + $this->setIfExists('employeePensionContribution', $data ?? [], null); + $this->setIfExists('employeePensionContributionAvc', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + $this->setIfExists('isForEndedPension', $data ?? [], null); + $this->setIfExists('associatedEmployeeRoles', $data ?? [], null); + $this->setIfExists('notionalPay', $data ?? [], null); + $this->setIfExists('pensionableEarningsBfd', $data ?? [], null); + $this->setIfExists('pensionablePayBfd', $data ?? [], null); + $this->setIfExists('employeePensionContributionBfd', $data ?? [], null); + $this->setIfExists('assumedPensionablePayBfd', $data ?? [], null); + $this->setIfExists('employerPensionContributionBfd', $data ?? [], null); + $this->setIfExists('employeePensionContributionAvcBfd', $data ?? [], null); + $this->setIfExists('whenEarnedPensionSummaries', $data ?? [], null); + $this->setIfExists('periodFrom', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('whenEarnedPensionableEarningsCorrection', $data ?? [], null); + $this->setIfExists('whenEarnedPensionablePayCorrection', $data ?? [], null); + $this->setIfExists('whenEarnedEmployeePensionContributionCorrection', $data ?? [], null); + $this->setIfExists('whenEarnedEmployerPensionContributionCorrection', $data ?? [], null); + $this->setIfExists('whenEarnedEmployeePensionContributionAvcCorrection', $data ?? [], null); + $this->setIfExists('whenEarnedPensionableEarningsCorrectionBfd', $data ?? [], null); + $this->setIfExists('whenEarnedPensionablePayCorrectionBfd', $data ?? [], null); + $this->setIfExists('whenEarnedEmployeePensionContributionCorrectionBfd', $data ?? [], null); + $this->setIfExists('whenEarnedEmployerPensionContributionCorrectionBfd', $data ?? [], null); + $this->setIfExists('whenEarnedEmployeePensionContributionAvcCorrectionBfd', $data ?? [], null); + $this->setIfExists('nominalCodeMappings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId [readonly] The Id of the Pension. + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + throw new InvalidArgumentException('non-nullable pensionId cannot be null'); + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name [readonly] The name of the PensionScheme to which contributions have been made. + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets pensionSchemeId + * + * @return string|null + */ + public function getPensionSchemeId(): ?string + { + return $this->container['pensionSchemeId']; + } + + /** + * Sets pensionSchemeId + * + * @param string|null $pensionSchemeId [readonly] The Id of the PensionScheme. + * + * @return $this + */ + public function setPensionSchemeId(?string $pensionSchemeId): static + { + if (is_null($pensionSchemeId)) { + throw new InvalidArgumentException('non-nullable pensionSchemeId cannot be null'); + } + $this->container['pensionSchemeId'] = $pensionSchemeId; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate [readonly] Pension Start Date + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate Pension End Date + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + array_push($this->openAPINullablesSetToNull, 'endDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId [readonly] The Id of the WorkerGroup. + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + + /** + * Gets pensionRule + * + * @return \SynergiTech\Staffology\Model\PensionRule|null + */ + public function getPensionRule(): ?\SynergiTech\Staffology\Model\PensionRule + { + return $this->container['pensionRule']; + } + + /** + * Sets pensionRule + * + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule pensionRule + * + * @return $this + */ + public function setPensionRule(?\SynergiTech\Staffology\Model\PensionRule $pensionRule): static + { + if (is_null($pensionRule)) { + throw new InvalidArgumentException('non-nullable pensionRule cannot be null'); + } + $this->container['pensionRule'] = $pensionRule; + + return $this; + } + + /** + * Gets subtractedBasicRateTax + * + * @return bool|null + */ + public function getSubtractedBasicRateTax(): ?bool + { + return $this->container['subtractedBasicRateTax']; + } + + /** + * Sets subtractedBasicRateTax + * + * @param bool|null $subtractedBasicRateTax [readonly] The SubtractedBasicRateTax applied from the PensionScheme SubtractBasicRateTax. + * + * @return $this + */ + public function setSubtractedBasicRateTax(?bool $subtractedBasicRateTax): static + { + if (is_null($subtractedBasicRateTax)) { + throw new InvalidArgumentException('non-nullable subtractedBasicRateTax cannot be null'); + } + $this->container['subtractedBasicRateTax'] = $subtractedBasicRateTax; + + return $this; + } + + /** + * Gets papdisPensionProviderId + * + * @return string|null + */ + public function getPapdisPensionProviderId(): ?string + { + return $this->container['papdisPensionProviderId']; + } + + /** + * Sets papdisPensionProviderId + * + * @param string|null $papdisPensionProviderId [readonly] Papdis information from the PensionScheme + * + * @return $this + */ + public function setPapdisPensionProviderId(?string $papdisPensionProviderId): static + { + if (is_null($papdisPensionProviderId)) { + array_push($this->openAPINullablesSetToNull, 'papdisPensionProviderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisPensionProviderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['papdisPensionProviderId'] = $papdisPensionProviderId; + + return $this; + } + + /** + * Gets papdisEmployerId + * + * @return string|null + */ + public function getPapdisEmployerId(): ?string + { + return $this->container['papdisEmployerId']; + } + + /** + * Sets papdisEmployerId + * + * @param string|null $papdisEmployerId [readonly] Papdis information from the PensionScheme + * + * @return $this + */ + public function setPapdisEmployerId(?string $papdisEmployerId): static + { + if (is_null($papdisEmployerId)) { + array_push($this->openAPINullablesSetToNull, 'papdisEmployerId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisEmployerId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['papdisEmployerId'] = $papdisEmployerId; + + return $this; + } + + /** + * Gets employeePensionContributionMultiplier + * + * @return float|null + */ + public function getEmployeePensionContributionMultiplier(): ?float + { + return $this->container['employeePensionContributionMultiplier']; + } + + /** + * Sets employeePensionContributionMultiplier + * + * @param float|null $employeePensionContributionMultiplier [readonly] If the PensionScheme is set to SubtractBasicRateTax then this value is used to reduce the contribution amount. Otherwise it is set as 1. + * + * @return $this + */ + public function setEmployeePensionContributionMultiplier(?float $employeePensionContributionMultiplier): static + { + if (is_null($employeePensionContributionMultiplier)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionMultiplier cannot be null'); + } + $this->container['employeePensionContributionMultiplier'] = $employeePensionContributionMultiplier; + + return $this; + } + + /** + * Gets additionalVoluntaryContribution + * + * @return float|null + */ + public function getAdditionalVoluntaryContribution(): ?float + { + return $this->container['additionalVoluntaryContribution']; + } + + /** + * Sets additionalVoluntaryContribution + * + * @param float|null $additionalVoluntaryContribution [readonly] Any Additional Voluntary Contribution the Employee has chosen to make Otherwise it is set as 1. + * + * @return $this + */ + public function setAdditionalVoluntaryContribution(?float $additionalVoluntaryContribution): static + { + if (is_null($additionalVoluntaryContribution)) { + throw new InvalidArgumentException('non-nullable additionalVoluntaryContribution cannot be null'); + } + $this->container['additionalVoluntaryContribution'] = $additionalVoluntaryContribution; + + return $this; + } + + /** + * Gets avcIsPercentage + * + * @return bool|null + */ + public function getAvcIsPercentage(): ?bool + { + return $this->container['avcIsPercentage']; + } + + /** + * Sets avcIsPercentage + * + * @param bool|null $avcIsPercentage [readonly] Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, + * + * @return $this + */ + public function setAvcIsPercentage(?bool $avcIsPercentage): static + { + if (is_null($avcIsPercentage)) { + throw new InvalidArgumentException('non-nullable avcIsPercentage cannot be null'); + } + $this->container['avcIsPercentage'] = $avcIsPercentage; + + return $this; + } + + /** + * Gets autoEnrolled + * + * @return bool|null + */ + public function getAutoEnrolled(): ?bool + { + return $this->container['autoEnrolled']; + } + + /** + * Sets autoEnrolled + * + * @param bool|null $autoEnrolled [readonly] Any Additional Voluntary Contribution the Employee has chosen to make Otherwise it is set as 1. + * + * @return $this + */ + public function setAutoEnrolled(?bool $autoEnrolled): static + { + if (is_null($autoEnrolled)) { + throw new InvalidArgumentException('non-nullable autoEnrolled cannot be null'); + } + $this->container['autoEnrolled'] = $autoEnrolled; + + return $this; + } + + /** + * Gets workerGroup + * + * @return \SynergiTech\Staffology\Model\WorkerGroup|null + */ + public function getWorkerGroup(): ?\SynergiTech\Staffology\Model\WorkerGroup + { + return $this->container['workerGroup']; + } + + /** + * Sets workerGroup + * + * @param \SynergiTech\Staffology\Model\WorkerGroup|null $workerGroup workerGroup + * + * @return $this + */ + public function setWorkerGroup(?\SynergiTech\Staffology\Model\WorkerGroup $workerGroup): static + { + if (is_null($workerGroup)) { + throw new InvalidArgumentException('non-nullable workerGroup cannot be null'); + } + $this->container['workerGroup'] = $workerGroup; + + return $this; + } + + /** + * Gets forcedTier + * + * @return string|null + */ + public function getForcedTier(): ?string + { + return $this->container['forcedTier']; + } + + /** + * Sets forcedTier + * + * @param string|null $forcedTier [readonly] If the WorkerGroup ContributionLevelType is a Tiered Scheme then the name of the tier to force the employee on to may be specified. If none is specified then the Tier is determined by the earnings in the period + * + * @return $this + */ + public function setForcedTier(?string $forcedTier): static + { + if (is_null($forcedTier)) { + array_push($this->openAPINullablesSetToNull, 'forcedTier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('forcedTier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['forcedTier'] = $forcedTier; + + return $this; + } + + /** + * Gets tiers + * + * @return \SynergiTech\Staffology\Model\TieredPensionRate[]|null + */ + public function getTiers(): ?array + { + return $this->container['tiers']; + } + + /** + * Sets tiers + * + * @param \SynergiTech\Staffology\Model\TieredPensionRate[]|null $tiers tiers + * + * @return $this + */ + public function setTiers(?array $tiers): static + { + if (is_null($tiers)) { + array_push($this->openAPINullablesSetToNull, 'tiers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tiers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tiers'] = $tiers; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return float|null + */ + public function getAssumedPensionablePay(): ?float + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param float|null $assumedPensionablePay [readonly] Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set then it'll be shown here. + * + * @return $this + */ + public function setAssumedPensionablePay(?float $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + + /** + * Gets pensionablePayCodes + * + * @return string[]|null + */ + public function getPensionablePayCodes(): ?array + { + return $this->container['pensionablePayCodes']; + } + + /** + * Sets pensionablePayCodes + * + * @param string[]|null $pensionablePayCodes [readonly] If the pension scheme is set to override the Pensionale PayCodes, then this is what they've been set to. + * + * @return $this + */ + public function setPensionablePayCodes(?array $pensionablePayCodes): static + { + if (is_null($pensionablePayCodes)) { + array_push($this->openAPINullablesSetToNull, 'pensionablePayCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionablePayCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionablePayCodes'] = $pensionablePayCodes; + + return $this; + } + + /** + * Gets tierablePayPayCodes + * + * @return string[]|null + */ + public function getTierablePayPayCodes(): ?array + { + return $this->container['tierablePayPayCodes']; + } + + /** + * Sets tierablePayPayCodes + * + * @param string[]|null $tierablePayPayCodes [readonly] If the pension scheme is set to override the TierablePay PayCodes, then this is what they've been set to. + * + * @return $this + */ + public function setTierablePayPayCodes(?array $tierablePayPayCodes): static + { + if (is_null($tierablePayPayCodes)) { + array_push($this->openAPINullablesSetToNull, 'tierablePayPayCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tierablePayPayCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tierablePayPayCodes'] = $tierablePayPayCodes; + + return $this; + } + + /** + * Gets isHalfContributionMember + * + * @return bool|null + */ + public function getIsHalfContributionMember(): ?bool + { + return $this->container['isHalfContributionMember']; + } + + /** + * Sets isHalfContributionMember + * + * @param bool|null $isHalfContributionMember if an employee as a member of the 50/50 LGPS scheme, they can enable contribution to 50% of the normal contributions. + * + * @return $this + */ + public function setIsHalfContributionMember(?bool $isHalfContributionMember): static + { + if (is_null($isHalfContributionMember)) { + throw new InvalidArgumentException('non-nullable isHalfContributionMember cannot be null'); + } + $this->container['isHalfContributionMember'] = $isHalfContributionMember; + + return $this; + } + + /** + * Gets pensionableEarnings + * + * @return float|null + */ + public function getPensionableEarnings(): ?float + { + return $this->container['pensionableEarnings']; + } + + /** + * Sets pensionableEarnings + * + * @param float|null $pensionableEarnings [readonly] The amount of the Gross that is subject to Pension Deductions. If the Pension Scheme uses Qualifying Earnings (upper and lower limits) then this value is before those are applied Applied only if an employee has more than one pension assigned to them + * + * @return $this + */ + public function setPensionableEarnings(?float $pensionableEarnings): static + { + if (is_null($pensionableEarnings)) { + throw new InvalidArgumentException('non-nullable pensionableEarnings cannot be null'); + } + $this->container['pensionableEarnings'] = $pensionableEarnings; + + return $this; + } + + /** + * Gets pensionablePay + * + * @return float|null + */ + public function getPensionablePay(): ?float + { + return $this->container['pensionablePay']; + } + + /** + * Sets pensionablePay + * + * @param float|null $pensionablePay [readonly] The amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. Applied only if an employee has more than one pension assigned to them + * + * @return $this + */ + public function setPensionablePay(?float $pensionablePay): static + { + if (is_null($pensionablePay)) { + throw new InvalidArgumentException('non-nullable pensionablePay cannot be null'); + } + $this->container['pensionablePay'] = $pensionablePay; + + return $this; + } + + /** + * Gets nonTierablePay + * + * @return float|null + */ + public function getNonTierablePay(): ?float + { + return $this->container['nonTierablePay']; + } + + /** + * Sets nonTierablePay + * + * @param float|null $nonTierablePay [readonly] The value of any pay that shouldn't count towards determining a pension tier. + * + * @return $this + */ + public function setNonTierablePay(?float $nonTierablePay): static + { + if (is_null($nonTierablePay)) { + throw new InvalidArgumentException('non-nullable nonTierablePay cannot be null'); + } + $this->container['nonTierablePay'] = $nonTierablePay; + + return $this; + } + + /** + * Gets employeePensionContribution + * + * @return float|null + */ + public function getEmployeePensionContribution(): ?float + { + return $this->container['employeePensionContribution']; + } + + /** + * Sets employeePensionContribution + * + * @param float|null $employeePensionContribution [readonly] The value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions + * + * @return $this + */ + public function setEmployeePensionContribution(?float $employeePensionContribution): static + { + if (is_null($employeePensionContribution)) { + throw new InvalidArgumentException('non-nullable employeePensionContribution cannot be null'); + } + $this->container['employeePensionContribution'] = $employeePensionContribution; + + return $this; + } + + /** + * Gets employeePensionContributionAvc + * + * @return float|null + */ + public function getEmployeePensionContributionAvc(): ?float + { + return $this->container['employeePensionContributionAvc']; + } + + /** + * Sets employeePensionContributionAvc + * + * @param float|null $employeePensionContributionAvc [readonly] The value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution + * + * @return $this + */ + public function setEmployeePensionContributionAvc(?float $employeePensionContributionAvc): static + { + if (is_null($employeePensionContributionAvc)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionAvc cannot be null'); + } + $this->container['employeePensionContributionAvc'] = $employeePensionContributionAvc; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return float|null + */ + public function getEmployerPensionContribution(): ?float + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param float|null $employerPensionContribution [readonly] The value of the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setEmployerPensionContribution(?float $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + throw new InvalidArgumentException('non-nullable employerPensionContribution cannot be null'); + } + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + + /** + * Gets isForEndedPension + * + * @return bool|null + */ + public function getIsForEndedPension(): ?bool + { + return $this->container['isForEndedPension']; + } + + /** + * Sets isForEndedPension + * + * @param bool|null $isForEndedPension [readonly] Determines whether the pension summary is related to a pension that has ended or not + * + * @return $this + */ + public function setIsForEndedPension(?bool $isForEndedPension): static + { + if (is_null($isForEndedPension)) { + throw new InvalidArgumentException('non-nullable isForEndedPension cannot be null'); + } + $this->container['isForEndedPension'] = $isForEndedPension; + + return $this; + } + + /** + * Gets associatedEmployeeRoles + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getAssociatedEmployeeRoles(): ?array + { + return $this->container['associatedEmployeeRoles']; + } + + /** + * Sets associatedEmployeeRoles + * + * @param \SynergiTech\Staffology\Model\Item[]|null $associatedEmployeeRoles associatedEmployeeRoles + * + * @return $this + */ + public function setAssociatedEmployeeRoles(?array $associatedEmployeeRoles): static + { + if (is_null($associatedEmployeeRoles)) { + array_push($this->openAPINullablesSetToNull, 'associatedEmployeeRoles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('associatedEmployeeRoles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['associatedEmployeeRoles'] = $associatedEmployeeRoles; + + return $this; + } + + /** + * Gets notionalPay + * + * @return float|null + */ + public function getNotionalPay(): ?float + { + return $this->container['notionalPay']; + } + + /** + * Sets notionalPay + * + * @param float|null $notionalPay Pay value based on regular pay lines and the pension's associated roles Set before any adjustments for things like stat payments + * + * @return $this + */ + public function setNotionalPay(?float $notionalPay): static + { + if (is_null($notionalPay)) { + throw new InvalidArgumentException('non-nullable notionalPay cannot be null'); + } + $this->container['notionalPay'] = $notionalPay; + + return $this; + } + + /** + * Gets pensionableEarningsBfd + * + * @return float|null + */ + public function getPensionableEarningsBfd(): ?float + { + return $this->container['pensionableEarningsBfd']; + } + + /** + * Sets pensionableEarningsBfd + * + * @param float|null $pensionableEarningsBfd [readonly] The brought forward Year to Date amount of the Gross that is subject to Pension Deductions. Applied only if an employee has more than one pension assigned to them + * + * @return $this + */ + public function setPensionableEarningsBfd(?float $pensionableEarningsBfd): static + { + if (is_null($pensionableEarningsBfd)) { + throw new InvalidArgumentException('non-nullable pensionableEarningsBfd cannot be null'); + } + $this->container['pensionableEarningsBfd'] = $pensionableEarningsBfd; + + return $this; + } + + /** + * Gets pensionablePayBfd + * + * @return float|null + */ + public function getPensionablePayBfd(): ?float + { + return $this->container['pensionablePayBfd']; + } + + /** + * Sets pensionablePayBfd + * + * @param float|null $pensionablePayBfd [readonly] The brought forward Year to Date amount of the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. Applied only if an employee has more than one pension assigned to them + * + * @return $this + */ + public function setPensionablePayBfd(?float $pensionablePayBfd): static + { + if (is_null($pensionablePayBfd)) { + throw new InvalidArgumentException('non-nullable pensionablePayBfd cannot be null'); + } + $this->container['pensionablePayBfd'] = $pensionablePayBfd; + + return $this; + } + + /** + * Gets employeePensionContributionBfd + * + * @return float|null + */ + public function getEmployeePensionContributionBfd(): ?float + { + return $this->container['employeePensionContributionBfd']; + } + + /** + * Sets employeePensionContributionBfd + * + * @param float|null $employeePensionContributionBfd [readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions + * + * @return $this + */ + public function setEmployeePensionContributionBfd(?float $employeePensionContributionBfd): static + { + if (is_null($employeePensionContributionBfd)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionBfd cannot be null'); + } + $this->container['employeePensionContributionBfd'] = $employeePensionContributionBfd; + + return $this; + } + + /** + * Gets assumedPensionablePayBfd + * + * @return float|null + */ + public function getAssumedPensionablePayBfd(): ?float + { + return $this->container['assumedPensionablePayBfd']; + } + + /** + * Sets assumedPensionablePayBfd + * + * @param float|null $assumedPensionablePayBfd [readonly] The brought forward Year to Date value of Assumed Pensionable Pay. If the employee is receiving any Statutory Leave that has an AssumedPensionablePay value set then it'll be shown here. + * + * @return $this + */ + public function setAssumedPensionablePayBfd(?float $assumedPensionablePayBfd): static + { + if (is_null($assumedPensionablePayBfd)) { + array_push($this->openAPINullablesSetToNull, 'assumedPensionablePayBfd'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('assumedPensionablePayBfd', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['assumedPensionablePayBfd'] = $assumedPensionablePayBfd; + + return $this; + } + + /** + * Gets employerPensionContributionBfd + * + * @return float|null + */ + public function getEmployerPensionContributionBfd(): ?float + { + return $this->container['employerPensionContributionBfd']; + } + + /** + * Sets employerPensionContributionBfd + * + * @param float|null $employerPensionContributionBfd [readonly] The brought forward Year to Date value of the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setEmployerPensionContributionBfd(?float $employerPensionContributionBfd): static + { + if (is_null($employerPensionContributionBfd)) { + throw new InvalidArgumentException('non-nullable employerPensionContributionBfd cannot be null'); + } + $this->container['employerPensionContributionBfd'] = $employerPensionContributionBfd; + + return $this; + } + + /** + * Gets employeePensionContributionAvcBfd + * + * @return float|null + */ + public function getEmployeePensionContributionAvcBfd(): ?float + { + return $this->container['employeePensionContributionAvcBfd']; + } + + /** + * Sets employeePensionContributionAvcBfd + * + * @param float|null $employeePensionContributionAvcBfd [readonly] The brought forward Year to Date value of the Pension Contribution being made by this Employee as an Additional Voluntary Contribution + * + * @return $this + */ + public function setEmployeePensionContributionAvcBfd(?float $employeePensionContributionAvcBfd): static + { + if (is_null($employeePensionContributionAvcBfd)) { + throw new InvalidArgumentException('non-nullable employeePensionContributionAvcBfd cannot be null'); + } + $this->container['employeePensionContributionAvcBfd'] = $employeePensionContributionAvcBfd; + + return $this; + } + + /** + * Gets whenEarnedPensionSummaries + * + * @return \SynergiTech\Staffology\Model\PensionSummary[]|null + */ + public function getWhenEarnedPensionSummaries(): ?array + { + return $this->container['whenEarnedPensionSummaries']; + } + + /** + * Sets whenEarnedPensionSummaries + * + * @param \SynergiTech\Staffology\Model\PensionSummary[]|null $whenEarnedPensionSummaries The list of pension summaries created on the base of when earned additions' and deductions' pension calculations for back paid periods + * + * @return $this + */ + public function setWhenEarnedPensionSummaries(?array $whenEarnedPensionSummaries): static + { + if (is_null($whenEarnedPensionSummaries)) { + array_push($this->openAPINullablesSetToNull, 'whenEarnedPensionSummaries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('whenEarnedPensionSummaries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['whenEarnedPensionSummaries'] = $whenEarnedPensionSummaries; + + return $this; + } + + /** + * Gets periodFrom + * + * @return \DateTime|null + */ + public function getPeriodFrom(): ?\DateTime + { + return $this->container['periodFrom']; + } + + /** + * Sets periodFrom + * + * @param \DateTime|null $periodFrom Nullable DateTime property \"PeriodFrom\" to store the start date of the PayPeriod the current PensionSummary is attributable to. Applicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods + * + * @return $this + */ + public function setPeriodFrom(?\DateTime $periodFrom): static + { + if (is_null($periodFrom)) { + array_push($this->openAPINullablesSetToNull, 'periodFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodFrom'] = $periodFrom; + + return $this; + } + + /** + * Gets periodTo + * + * @return \DateTime|null + */ + public function getPeriodTo(): ?\DateTime + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param \DateTime|null $periodTo Nullable DateTime property \"PeriodTo\" to store the start date of the PayPeriod the current PensionSummary is attributable to. Applicable only for when the pension summary is created on the base of when earned additions' and deductions' pension calculations for back paid periods + * + * @return $this + */ + public function setPeriodTo(?\DateTime $periodTo): static + { + if (is_null($periodTo)) { + array_push($this->openAPINullablesSetToNull, 'periodTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets whenEarnedPensionableEarningsCorrection + * + * @return float|null + */ + public function getWhenEarnedPensionableEarningsCorrection(): ?float + { + return $this->container['whenEarnedPensionableEarningsCorrection']; + } + + /** + * Sets whenEarnedPensionableEarningsCorrection + * + * @param float|null $whenEarnedPensionableEarningsCorrection [readonly] The when earned amount correction to the Gross that is subject to Pension Deductions. + * + * @return $this + */ + public function setWhenEarnedPensionableEarningsCorrection(?float $whenEarnedPensionableEarningsCorrection): static + { + if (is_null($whenEarnedPensionableEarningsCorrection)) { + throw new InvalidArgumentException('non-nullable whenEarnedPensionableEarningsCorrection cannot be null'); + } + $this->container['whenEarnedPensionableEarningsCorrection'] = $whenEarnedPensionableEarningsCorrection; + + return $this; + } + + /** + * Gets whenEarnedPensionablePayCorrection + * + * @return float|null + */ + public function getWhenEarnedPensionablePayCorrection(): ?float + { + return $this->container['whenEarnedPensionablePayCorrection']; + } + + /** + * Sets whenEarnedPensionablePayCorrection + * + * @param float|null $whenEarnedPensionablePayCorrection [readonly] The when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. + * + * @return $this + */ + public function setWhenEarnedPensionablePayCorrection(?float $whenEarnedPensionablePayCorrection): static + { + if (is_null($whenEarnedPensionablePayCorrection)) { + throw new InvalidArgumentException('non-nullable whenEarnedPensionablePayCorrection cannot be null'); + } + $this->container['whenEarnedPensionablePayCorrection'] = $whenEarnedPensionablePayCorrection; + + return $this; + } + + /** + * Gets whenEarnedEmployeePensionContributionCorrection + * + * @return float|null + */ + public function getWhenEarnedEmployeePensionContributionCorrection(): ?float + { + return $this->container['whenEarnedEmployeePensionContributionCorrection']; + } + + /** + * Sets whenEarnedEmployeePensionContributionCorrection + * + * @param float|null $whenEarnedEmployeePensionContributionCorrection [readonly] The when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions + * + * @return $this + */ + public function setWhenEarnedEmployeePensionContributionCorrection(?float $whenEarnedEmployeePensionContributionCorrection): static + { + if (is_null($whenEarnedEmployeePensionContributionCorrection)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployeePensionContributionCorrection cannot be null'); + } + $this->container['whenEarnedEmployeePensionContributionCorrection'] = $whenEarnedEmployeePensionContributionCorrection; + + return $this; + } + + /** + * Gets whenEarnedEmployerPensionContributionCorrection + * + * @return float|null + */ + public function getWhenEarnedEmployerPensionContributionCorrection(): ?float + { + return $this->container['whenEarnedEmployerPensionContributionCorrection']; + } + + /** + * Sets whenEarnedEmployerPensionContributionCorrection + * + * @param float|null $whenEarnedEmployerPensionContributionCorrection [readonly] The when earned amount correction to the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setWhenEarnedEmployerPensionContributionCorrection(?float $whenEarnedEmployerPensionContributionCorrection): static + { + if (is_null($whenEarnedEmployerPensionContributionCorrection)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployerPensionContributionCorrection cannot be null'); + } + $this->container['whenEarnedEmployerPensionContributionCorrection'] = $whenEarnedEmployerPensionContributionCorrection; + + return $this; + } + + /** + * Gets whenEarnedEmployeePensionContributionAvcCorrection + * + * @return float|null + */ + public function getWhenEarnedEmployeePensionContributionAvcCorrection(): ?float + { + return $this->container['whenEarnedEmployeePensionContributionAvcCorrection']; + } + + /** + * Sets whenEarnedEmployeePensionContributionAvcCorrection + * + * @param float|null $whenEarnedEmployeePensionContributionAvcCorrection [readonly] The when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution + * + * @return $this + */ + public function setWhenEarnedEmployeePensionContributionAvcCorrection(?float $whenEarnedEmployeePensionContributionAvcCorrection): static + { + if (is_null($whenEarnedEmployeePensionContributionAvcCorrection)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployeePensionContributionAvcCorrection cannot be null'); + } + $this->container['whenEarnedEmployeePensionContributionAvcCorrection'] = $whenEarnedEmployeePensionContributionAvcCorrection; + + return $this; + } + + /** + * Gets whenEarnedPensionableEarningsCorrectionBfd + * + * @return float|null + */ + public function getWhenEarnedPensionableEarningsCorrectionBfd(): ?float + { + return $this->container['whenEarnedPensionableEarningsCorrectionBfd']; + } + + /** + * Sets whenEarnedPensionableEarningsCorrectionBfd + * + * @param float|null $whenEarnedPensionableEarningsCorrectionBfd [readonly] The brought forward Year to Date when earned amount correction to the Gross that is subject to Pension Deductions. + * + * @return $this + */ + public function setWhenEarnedPensionableEarningsCorrectionBfd(?float $whenEarnedPensionableEarningsCorrectionBfd): static + { + if (is_null($whenEarnedPensionableEarningsCorrectionBfd)) { + throw new InvalidArgumentException('non-nullable whenEarnedPensionableEarningsCorrectionBfd cannot be null'); + } + $this->container['whenEarnedPensionableEarningsCorrectionBfd'] = $whenEarnedPensionableEarningsCorrectionBfd; + + return $this; + } + + /** + * Gets whenEarnedPensionablePayCorrectionBfd + * + * @return float|null + */ + public function getWhenEarnedPensionablePayCorrectionBfd(): ?float + { + return $this->container['whenEarnedPensionablePayCorrectionBfd']; + } + + /** + * Sets whenEarnedPensionablePayCorrectionBfd + * + * @param float|null $whenEarnedPensionablePayCorrectionBfd [readonly] The brought forward Year to Date when earned amount correction to the Gross that pension calculations are based on after taking into account Upper and Lower Limits for the WorkerGroup. + * + * @return $this + */ + public function setWhenEarnedPensionablePayCorrectionBfd(?float $whenEarnedPensionablePayCorrectionBfd): static + { + if (is_null($whenEarnedPensionablePayCorrectionBfd)) { + throw new InvalidArgumentException('non-nullable whenEarnedPensionablePayCorrectionBfd cannot be null'); + } + $this->container['whenEarnedPensionablePayCorrectionBfd'] = $whenEarnedPensionablePayCorrectionBfd; + + return $this; + } + + /** + * Gets whenEarnedEmployeePensionContributionCorrectionBfd + * + * @return float|null + */ + public function getWhenEarnedEmployeePensionContributionCorrectionBfd(): ?float + { + return $this->container['whenEarnedEmployeePensionContributionCorrectionBfd']; + } + + /** + * Sets whenEarnedEmployeePensionContributionCorrectionBfd + * + * @param float|null $whenEarnedEmployeePensionContributionCorrectionBfd [readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by this Employee, excluding any Additional Voluntary Contributions + * + * @return $this + */ + public function setWhenEarnedEmployeePensionContributionCorrectionBfd(?float $whenEarnedEmployeePensionContributionCorrectionBfd): static + { + if (is_null($whenEarnedEmployeePensionContributionCorrectionBfd)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployeePensionContributionCorrectionBfd cannot be null'); + } + $this->container['whenEarnedEmployeePensionContributionCorrectionBfd'] = $whenEarnedEmployeePensionContributionCorrectionBfd; + + return $this; + } + + /** + * Gets whenEarnedEmployerPensionContributionCorrectionBfd + * + * @return float|null + */ + public function getWhenEarnedEmployerPensionContributionCorrectionBfd(): ?float + { + return $this->container['whenEarnedEmployerPensionContributionCorrectionBfd']; + } + + /** + * Sets whenEarnedEmployerPensionContributionCorrectionBfd + * + * @param float|null $whenEarnedEmployerPensionContributionCorrectionBfd [readonly] The brought forward Year to Date when earned amount correction to the Pension Contribution being made by the Employer for this Employee + * + * @return $this + */ + public function setWhenEarnedEmployerPensionContributionCorrectionBfd(?float $whenEarnedEmployerPensionContributionCorrectionBfd): static + { + if (is_null($whenEarnedEmployerPensionContributionCorrectionBfd)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployerPensionContributionCorrectionBfd cannot be null'); + } + $this->container['whenEarnedEmployerPensionContributionCorrectionBfd'] = $whenEarnedEmployerPensionContributionCorrectionBfd; + + return $this; + } + + /** + * Gets whenEarnedEmployeePensionContributionAvcCorrectionBfd + * + * @return float|null + */ + public function getWhenEarnedEmployeePensionContributionAvcCorrectionBfd(): ?float + { + return $this->container['whenEarnedEmployeePensionContributionAvcCorrectionBfd']; + } + + /** + * Sets whenEarnedEmployeePensionContributionAvcCorrectionBfd + * + * @param float|null $whenEarnedEmployeePensionContributionAvcCorrectionBfd [readonly] The brought forward Year to Date when earned amount correction to Pension Contribution being made by this Employee as an Additional Voluntary Contribution + * + * @return $this + */ + public function setWhenEarnedEmployeePensionContributionAvcCorrectionBfd(?float $whenEarnedEmployeePensionContributionAvcCorrectionBfd): static + { + if (is_null($whenEarnedEmployeePensionContributionAvcCorrectionBfd)) { + throw new InvalidArgumentException('non-nullable whenEarnedEmployeePensionContributionAvcCorrectionBfd cannot be null'); + } + $this->container['whenEarnedEmployeePensionContributionAvcCorrectionBfd'] = $whenEarnedEmployeePensionContributionAvcCorrectionBfd; + + return $this; + } + + /** + * Gets nominalCodeMappings + * + * @return \SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]|null + */ + public function getNominalCodeMappings(): ?array + { + return $this->container['nominalCodeMappings']; + } + + /** + * Sets nominalCodeMappings + * + * @param \SynergiTech\Staffology\Model\PensionSchemeNominalCodeMapping[]|null $nominalCodeMappings List of Nominal Code Mappings of the Pension + * + * @return $this + */ + public function setNominalCodeMappings(?array $nominalCodeMappings): static + { + if (is_null($nominalCodeMappings)) { + array_push($this->openAPINullablesSetToNull, 'nominalCodeMappings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nominalCodeMappings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['nominalCodeMappings'] = $nominalCodeMappings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionSummaryCostBreakdown.php b/src/Model/PensionSummaryCostBreakdown.php new file mode 100644 index 0000000..5f00d9a --- /dev/null +++ b/src/Model/PensionSummaryCostBreakdown.php @@ -0,0 +1,585 @@ + + */ +class PensionSummaryCostBreakdown implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionSummaryCostBreakdown'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pensionRule' => '\SynergiTech\Staffology\Model\PensionRule', + 'payCodes' => 'string[]', + 'amount' => 'float', + 'pensionableEarnings' => 'float', + 'employeePensionContribution' => 'float', + 'employerPensionContribution' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pensionRule' => null, + 'payCodes' => null, + 'amount' => 'double', + 'pensionableEarnings' => 'double', + 'employeePensionContribution' => 'double', + 'employerPensionContribution' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pensionRule' => false, + 'payCodes' => true, + 'amount' => false, + 'pensionableEarnings' => false, + 'employeePensionContribution' => false, + 'employerPensionContribution' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pensionRule' => 'pensionRule', + 'payCodes' => 'payCodes', + 'amount' => 'amount', + 'pensionableEarnings' => 'pensionableEarnings', + 'employeePensionContribution' => 'employeePensionContribution', + 'employerPensionContribution' => 'employerPensionContribution' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pensionRule' => 'setPensionRule', + 'payCodes' => 'setPayCodes', + 'amount' => 'setAmount', + 'pensionableEarnings' => 'setPensionableEarnings', + 'employeePensionContribution' => 'setEmployeePensionContribution', + 'employerPensionContribution' => 'setEmployerPensionContribution' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pensionRule' => 'getPensionRule', + 'payCodes' => 'getPayCodes', + 'amount' => 'getAmount', + 'pensionableEarnings' => 'getPensionableEarnings', + 'employeePensionContribution' => 'getEmployeePensionContribution', + 'employerPensionContribution' => 'getEmployerPensionContribution' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pensionRule', $data ?? [], null); + $this->setIfExists('payCodes', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('pensionableEarnings', $data ?? [], null); + $this->setIfExists('employeePensionContribution', $data ?? [], null); + $this->setIfExists('employerPensionContribution', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pensionRule + * + * @return \SynergiTech\Staffology\Model\PensionRule|null + */ + public function getPensionRule(): ?\SynergiTech\Staffology\Model\PensionRule + { + return $this->container['pensionRule']; + } + + /** + * Sets pensionRule + * + * @param \SynergiTech\Staffology\Model\PensionRule|null $pensionRule pensionRule + * + * @return $this + */ + public function setPensionRule(?\SynergiTech\Staffology\Model\PensionRule $pensionRule): static + { + if (is_null($pensionRule)) { + throw new InvalidArgumentException('non-nullable pensionRule cannot be null'); + } + $this->container['pensionRule'] = $pensionRule; + + return $this; + } + + /** + * Gets payCodes + * + * @return string[]|null + */ + public function getPayCodes(): ?array + { + return $this->container['payCodes']; + } + + /** + * Sets payCodes + * + * @param string[]|null $payCodes The list of pay codes associated with this pension rule. + * + * @return $this + */ + public function setPayCodes(?array $payCodes): static + { + if (is_null($payCodes)) { + array_push($this->openAPINullablesSetToNull, 'payCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payCodes'] = $payCodes; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount The amount associated with this pension entry. + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets pensionableEarnings + * + * @return float|null + */ + public function getPensionableEarnings(): ?float + { + return $this->container['pensionableEarnings']; + } + + /** + * Sets pensionableEarnings + * + * @param float|null $pensionableEarnings The total pensionable earnings relevant to this pension rule. + * + * @return $this + */ + public function setPensionableEarnings(?float $pensionableEarnings): static + { + if (is_null($pensionableEarnings)) { + throw new InvalidArgumentException('non-nullable pensionableEarnings cannot be null'); + } + $this->container['pensionableEarnings'] = $pensionableEarnings; + + return $this; + } + + /** + * Gets employeePensionContribution + * + * @return float|null + */ + public function getEmployeePensionContribution(): ?float + { + return $this->container['employeePensionContribution']; + } + + /** + * Sets employeePensionContribution + * + * @param float|null $employeePensionContribution The contribution amount made by the employee towards the pension. + * + * @return $this + */ + public function setEmployeePensionContribution(?float $employeePensionContribution): static + { + if (is_null($employeePensionContribution)) { + throw new InvalidArgumentException('non-nullable employeePensionContribution cannot be null'); + } + $this->container['employeePensionContribution'] = $employeePensionContribution; + + return $this; + } + + /** + * Gets employerPensionContribution + * + * @return float|null + */ + public function getEmployerPensionContribution(): ?float + { + return $this->container['employerPensionContribution']; + } + + /** + * Sets employerPensionContribution + * + * @param float|null $employerPensionContribution The contribution amount made by the employer towards the pension. + * + * @return $this + */ + public function setEmployerPensionContribution(?float $employerPensionContribution): static + { + if (is_null($employerPensionContribution)) { + throw new InvalidArgumentException('non-nullable employerPensionContribution cannot be null'); + } + $this->container['employerPensionContribution'] = $employerPensionContribution; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PensionablePayDefinition.php b/src/Model/PensionablePayDefinition.php new file mode 100644 index 0000000..2e997e3 --- /dev/null +++ b/src/Model/PensionablePayDefinition.php @@ -0,0 +1,51 @@ + + */ +class PensionerPayroll implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PensionerPayroll'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'inReceiptOfPension' => 'bool', + 'bereaved' => 'bool', + 'amount' => 'float', + 'startDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'inReceiptOfPension' => null, + 'bereaved' => null, + 'amount' => 'double', + 'startDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'inReceiptOfPension' => false, + 'bereaved' => false, + 'amount' => false, + 'startDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'inReceiptOfPension' => 'inReceiptOfPension', + 'bereaved' => 'bereaved', + 'amount' => 'amount', + 'startDate' => 'startDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'inReceiptOfPension' => 'setInReceiptOfPension', + 'bereaved' => 'setBereaved', + 'amount' => 'setAmount', + 'startDate' => 'setStartDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'inReceiptOfPension' => 'getInReceiptOfPension', + 'bereaved' => 'getBereaved', + 'amount' => 'getAmount', + 'startDate' => 'getStartDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('inReceiptOfPension', $data ?? [], null); + $this->setIfExists('bereaved', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets inReceiptOfPension + * + * @return bool|null + */ + public function getInReceiptOfPension(): ?bool + { + return $this->container['inReceiptOfPension']; + } + + /** + * Sets inReceiptOfPension + * + * @param bool|null $inReceiptOfPension If set to true then the FPS will have the OccPenInd flag set to 'yes' + * + * @return $this + */ + public function setInReceiptOfPension(?bool $inReceiptOfPension): static + { + if (is_null($inReceiptOfPension)) { + throw new InvalidArgumentException('non-nullable inReceiptOfPension cannot be null'); + } + $this->container['inReceiptOfPension'] = $inReceiptOfPension; + + return $this; + } + + /** + * Gets bereaved + * + * @return bool|null + */ + public function getBereaved(): ?bool + { + return $this->container['bereaved']; + } + + /** + * Sets bereaved + * + * @param bool|null $bereaved Indicator that Occupational Pension is being paid because they are a recently bereaved Spouse/Civil Partner + * + * @return $this + */ + public function setBereaved(?bool $bereaved): static + { + if (is_null($bereaved)) { + throw new InvalidArgumentException('non-nullable bereaved cannot be null'); + } + $this->container['bereaved'] = $bereaved; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount(): ?float + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount Annual amount of occupational pension + * + * @return $this + */ + public function setAmount(?float $amount): static + { + if (is_null($amount)) { + throw new InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate Start date of occupational Pension + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + array_push($this->openAPINullablesSetToNull, 'startDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startDate'] = $startDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PeriodValue.php b/src/Model/PeriodValue.php new file mode 100644 index 0000000..ff0003a --- /dev/null +++ b/src/Model/PeriodValue.php @@ -0,0 +1,531 @@ + + */ +class PeriodValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PeriodValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'effectiveFrom' => '\DateTime', + 'annualValue' => 'float', + 'periodValues' => '\SynergiTech\Staffology\Model\PeriodValuePeriodValues', + 'midYearChanges' => '\SynergiTech\Staffology\Model\PeriodValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'effectiveFrom' => 'date', + 'annualValue' => 'double', + 'periodValues' => null, + 'midYearChanges' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'effectiveFrom' => true, + 'annualValue' => false, + 'periodValues' => true, + 'midYearChanges' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'effectiveFrom' => 'effectiveFrom', + 'annualValue' => 'annualValue', + 'periodValues' => 'periodValues', + 'midYearChanges' => 'midYearChanges' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'effectiveFrom' => 'setEffectiveFrom', + 'annualValue' => 'setAnnualValue', + 'periodValues' => 'setPeriodValues', + 'midYearChanges' => 'setMidYearChanges' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'effectiveFrom' => 'getEffectiveFrom', + 'annualValue' => 'getAnnualValue', + 'periodValues' => 'getPeriodValues', + 'midYearChanges' => 'getMidYearChanges' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('periodValues', $data ?? [], null); + $this->setIfExists('midYearChanges', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when these period values are effective + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue The Annual value + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + throw new InvalidArgumentException('non-nullable annualValue cannot be null'); + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets periodValues + * + * @return \SynergiTech\Staffology\Model\PeriodValuePeriodValues|null + */ + public function getPeriodValues(): ?\SynergiTech\Staffology\Model\PeriodValuePeriodValues + { + return $this->container['periodValues']; + } + + /** + * Sets periodValues + * + * @param \SynergiTech\Staffology\Model\PeriodValuePeriodValues|null $periodValues periodValues + * + * @return $this + */ + public function setPeriodValues(?\SynergiTech\Staffology\Model\PeriodValuePeriodValues $periodValues): static + { + if (is_null($periodValues)) { + array_push($this->openAPINullablesSetToNull, 'periodValues'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('periodValues', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['periodValues'] = $periodValues; + + return $this; + } + + /** + * Gets midYearChanges + * + * @return \SynergiTech\Staffology\Model\PeriodValue[]|null + */ + public function getMidYearChanges(): ?array + { + return $this->container['midYearChanges']; + } + + /** + * Sets midYearChanges + * + * @param \SynergiTech\Staffology\Model\PeriodValue[]|null $midYearChanges Any optional changes to the period values that are effective from a specified date in the middle of a tax year + * + * @return $this + */ + public function setMidYearChanges(?array $midYearChanges): static + { + if (is_null($midYearChanges)) { + array_push($this->openAPINullablesSetToNull, 'midYearChanges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('midYearChanges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['midYearChanges'] = $midYearChanges; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PeriodValuePeriodValues.php b/src/Model/PeriodValuePeriodValues.php new file mode 100644 index 0000000..ae7025a --- /dev/null +++ b/src/Model/PeriodValuePeriodValues.php @@ -0,0 +1,579 @@ + + */ +class PeriodValuePeriodValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PeriodValue_periodValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'custom' => 'float', + 'monthly' => 'float', + 'fourWeekly' => 'float', + 'fortnightly' => 'float', + 'weekly' => 'float', + 'daily' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'custom' => 'double', + 'monthly' => 'double', + 'fourWeekly' => 'double', + 'fortnightly' => 'double', + 'weekly' => 'double', + 'daily' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'custom' => false, + 'monthly' => false, + 'fourWeekly' => false, + 'fortnightly' => false, + 'weekly' => false, + 'daily' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'custom' => 'Custom', + 'monthly' => 'Monthly', + 'fourWeekly' => 'FourWeekly', + 'fortnightly' => 'Fortnightly', + 'weekly' => 'Weekly', + 'daily' => 'Daily' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'custom' => 'setCustom', + 'monthly' => 'setMonthly', + 'fourWeekly' => 'setFourWeekly', + 'fortnightly' => 'setFortnightly', + 'weekly' => 'setWeekly', + 'daily' => 'setDaily' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'custom' => 'getCustom', + 'monthly' => 'getMonthly', + 'fourWeekly' => 'getFourWeekly', + 'fortnightly' => 'getFortnightly', + 'weekly' => 'getWeekly', + 'daily' => 'getDaily' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('custom', $data ?? [], null); + $this->setIfExists('monthly', $data ?? [], null); + $this->setIfExists('fourWeekly', $data ?? [], null); + $this->setIfExists('fortnightly', $data ?? [], null); + $this->setIfExists('weekly', $data ?? [], null); + $this->setIfExists('daily', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets custom + * + * @return float|null + */ + public function getCustom(): ?float + { + return $this->container['custom']; + } + + /** + * Sets custom + * + * @param float|null $custom custom + * + * @return $this + */ + public function setCustom(?float $custom): static + { + if (is_null($custom)) { + throw new InvalidArgumentException('non-nullable custom cannot be null'); + } + $this->container['custom'] = $custom; + + return $this; + } + + /** + * Gets monthly + * + * @return float|null + */ + public function getMonthly(): ?float + { + return $this->container['monthly']; + } + + /** + * Sets monthly + * + * @param float|null $monthly monthly + * + * @return $this + */ + public function setMonthly(?float $monthly): static + { + if (is_null($monthly)) { + throw new InvalidArgumentException('non-nullable monthly cannot be null'); + } + $this->container['monthly'] = $monthly; + + return $this; + } + + /** + * Gets fourWeekly + * + * @return float|null + */ + public function getFourWeekly(): ?float + { + return $this->container['fourWeekly']; + } + + /** + * Sets fourWeekly + * + * @param float|null $fourWeekly fourWeekly + * + * @return $this + */ + public function setFourWeekly(?float $fourWeekly): static + { + if (is_null($fourWeekly)) { + throw new InvalidArgumentException('non-nullable fourWeekly cannot be null'); + } + $this->container['fourWeekly'] = $fourWeekly; + + return $this; + } + + /** + * Gets fortnightly + * + * @return float|null + */ + public function getFortnightly(): ?float + { + return $this->container['fortnightly']; + } + + /** + * Sets fortnightly + * + * @param float|null $fortnightly fortnightly + * + * @return $this + */ + public function setFortnightly(?float $fortnightly): static + { + if (is_null($fortnightly)) { + throw new InvalidArgumentException('non-nullable fortnightly cannot be null'); + } + $this->container['fortnightly'] = $fortnightly; + + return $this; + } + + /** + * Gets weekly + * + * @return float|null + */ + public function getWeekly(): ?float + { + return $this->container['weekly']; + } + + /** + * Sets weekly + * + * @param float|null $weekly weekly + * + * @return $this + */ + public function setWeekly(?float $weekly): static + { + if (is_null($weekly)) { + throw new InvalidArgumentException('non-nullable weekly cannot be null'); + } + $this->container['weekly'] = $weekly; + + return $this; + } + + /** + * Gets daily + * + * @return float|null + */ + public function getDaily(): ?float + { + return $this->container['daily']; + } + + /** + * Sets daily + * + * @param float|null $daily daily + * + * @return $this + */ + public function setDaily(?float $daily): static + { + if (is_null($daily)) { + throw new InvalidArgumentException('non-nullable daily cannot be null'); + } + $this->container['daily'] = $daily; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PersonalDetails.php b/src/Model/PersonalDetails.php new file mode 100644 index 0000000..c97685c --- /dev/null +++ b/src/Model/PersonalDetails.php @@ -0,0 +1,1359 @@ + + */ +class PersonalDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonalDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'address' => '\SynergiTech\Staffology\Model\Address', + 'maritalStatus' => '\SynergiTech\Staffology\Model\MaritalStatus', + 'title' => 'string', + 'firstName' => 'string', + 'middleName' => 'string', + 'lastName' => 'string', + 'alternativeEmail' => 'string', + 'previousSurName' => 'string', + 'email' => 'string', + 'emailPayslip' => 'bool', + 'pdfPassword' => 'string', + 'pdfPasswordType' => '\SynergiTech\Staffology\Model\PdfPasswordType', + 'emailStatement' => 'bool', + 'photoUrl' => 'string', + 'photoSasUrl' => 'string', + 'telephone' => 'string', + 'mobile' => 'string', + 'dateOfBirth' => '\DateTime', + 'statePensionAge' => 'int', + 'gender' => '\SynergiTech\Staffology\Model\Gender', + 'niNumber' => 'string', + 'passportNumber' => 'string', + 'partnerDetails' => '\SynergiTech\Staffology\Model\PartnerDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'address' => null, + 'maritalStatus' => null, + 'title' => null, + 'firstName' => null, + 'middleName' => null, + 'lastName' => null, + 'alternativeEmail' => 'email', + 'previousSurName' => null, + 'email' => 'email', + 'emailPayslip' => null, + 'pdfPassword' => null, + 'pdfPasswordType' => null, + 'emailStatement' => null, + 'photoUrl' => null, + 'photoSasUrl' => null, + 'telephone' => null, + 'mobile' => null, + 'dateOfBirth' => 'date', + 'statePensionAge' => 'int32', + 'gender' => null, + 'niNumber' => null, + 'passportNumber' => null, + 'partnerDetails' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'address' => false, + 'maritalStatus' => false, + 'title' => true, + 'firstName' => true, + 'middleName' => true, + 'lastName' => true, + 'alternativeEmail' => true, + 'previousSurName' => true, + 'email' => true, + 'emailPayslip' => false, + 'pdfPassword' => true, + 'pdfPasswordType' => false, + 'emailStatement' => false, + 'photoUrl' => true, + 'photoSasUrl' => true, + 'telephone' => true, + 'mobile' => true, + 'dateOfBirth' => false, + 'statePensionAge' => false, + 'gender' => false, + 'niNumber' => true, + 'passportNumber' => true, + 'partnerDetails' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'address' => 'address', + 'maritalStatus' => 'maritalStatus', + 'title' => 'title', + 'firstName' => 'firstName', + 'middleName' => 'middleName', + 'lastName' => 'lastName', + 'alternativeEmail' => 'alternativeEmail', + 'previousSurName' => 'previousSurName', + 'email' => 'email', + 'emailPayslip' => 'emailPayslip', + 'pdfPassword' => 'pdfPassword', + 'pdfPasswordType' => 'pdfPasswordType', + 'emailStatement' => 'emailStatement', + 'photoUrl' => 'photoUrl', + 'photoSasUrl' => 'photoSasUrl', + 'telephone' => 'telephone', + 'mobile' => 'mobile', + 'dateOfBirth' => 'dateOfBirth', + 'statePensionAge' => 'statePensionAge', + 'gender' => 'gender', + 'niNumber' => 'niNumber', + 'passportNumber' => 'passportNumber', + 'partnerDetails' => 'partnerDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'address' => 'setAddress', + 'maritalStatus' => 'setMaritalStatus', + 'title' => 'setTitle', + 'firstName' => 'setFirstName', + 'middleName' => 'setMiddleName', + 'lastName' => 'setLastName', + 'alternativeEmail' => 'setAlternativeEmail', + 'previousSurName' => 'setPreviousSurName', + 'email' => 'setEmail', + 'emailPayslip' => 'setEmailPayslip', + 'pdfPassword' => 'setPdfPassword', + 'pdfPasswordType' => 'setPdfPasswordType', + 'emailStatement' => 'setEmailStatement', + 'photoUrl' => 'setPhotoUrl', + 'photoSasUrl' => 'setPhotoSasUrl', + 'telephone' => 'setTelephone', + 'mobile' => 'setMobile', + 'dateOfBirth' => 'setDateOfBirth', + 'statePensionAge' => 'setStatePensionAge', + 'gender' => 'setGender', + 'niNumber' => 'setNiNumber', + 'passportNumber' => 'setPassportNumber', + 'partnerDetails' => 'setPartnerDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'address' => 'getAddress', + 'maritalStatus' => 'getMaritalStatus', + 'title' => 'getTitle', + 'firstName' => 'getFirstName', + 'middleName' => 'getMiddleName', + 'lastName' => 'getLastName', + 'alternativeEmail' => 'getAlternativeEmail', + 'previousSurName' => 'getPreviousSurName', + 'email' => 'getEmail', + 'emailPayslip' => 'getEmailPayslip', + 'pdfPassword' => 'getPdfPassword', + 'pdfPasswordType' => 'getPdfPasswordType', + 'emailStatement' => 'getEmailStatement', + 'photoUrl' => 'getPhotoUrl', + 'photoSasUrl' => 'getPhotoSasUrl', + 'telephone' => 'getTelephone', + 'mobile' => 'getMobile', + 'dateOfBirth' => 'getDateOfBirth', + 'statePensionAge' => 'getStatePensionAge', + 'gender' => 'getGender', + 'niNumber' => 'getNiNumber', + 'passportNumber' => 'getPassportNumber', + 'partnerDetails' => 'getPartnerDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('maritalStatus', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('middleName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('alternativeEmail', $data ?? [], null); + $this->setIfExists('previousSurName', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('emailPayslip', $data ?? [], null); + $this->setIfExists('pdfPassword', $data ?? [], null); + $this->setIfExists('pdfPasswordType', $data ?? [], null); + $this->setIfExists('emailStatement', $data ?? [], null); + $this->setIfExists('photoUrl', $data ?? [], null); + $this->setIfExists('photoSasUrl', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('dateOfBirth', $data ?? [], null); + $this->setIfExists('statePensionAge', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('passportNumber', $data ?? [], null); + $this->setIfExists('partnerDetails', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['maritalStatus'] === null) { + $invalidProperties[] = "'maritalStatus' can't be null"; + } + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 30)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 35)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['middleName']) && (mb_strlen($this->container['middleName']) > 35)) { + $invalidProperties[] = "invalid value for 'middleName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 35)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['alternativeEmail']) && (mb_strlen($this->container['alternativeEmail']) > 100)) { + $invalidProperties[] = "invalid value for 'alternativeEmail', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['previousSurName']) && (mb_strlen($this->container['previousSurName']) > 35)) { + $invalidProperties[] = "invalid value for 'previousSurName', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 100)) { + $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['photoUrl']) && (mb_strlen($this->container['photoUrl']) > 250)) { + $invalidProperties[] = "invalid value for 'photoUrl', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 30)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['mobile']) && (mb_strlen($this->container['mobile']) > 30)) { + $invalidProperties[] = "invalid value for 'mobile', the character length must be smaller than or equal to 30."; + } + + if ($this->container['dateOfBirth'] === null) { + $invalidProperties[] = "'dateOfBirth' can't be null"; + } + if ($this->container['gender'] === null) { + $invalidProperties[] = "'gender' can't be null"; + } + if (!is_null($this->container['niNumber']) && (mb_strlen($this->container['niNumber']) > 15)) { + $invalidProperties[] = "invalid value for 'niNumber', the character length must be smaller than or equal to 15."; + } + + if (!is_null($this->container['passportNumber']) && (mb_strlen($this->container['passportNumber']) > 25)) { + $invalidProperties[] = "invalid value for 'passportNumber', the character length must be smaller than or equal to 25."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets maritalStatus + * + * @return \SynergiTech\Staffology\Model\MaritalStatus + */ + public function getMaritalStatus(): \SynergiTech\Staffology\Model\MaritalStatus + { + return $this->container['maritalStatus']; + } + + /** + * Sets maritalStatus + * + * @param \SynergiTech\Staffology\Model\MaritalStatus $maritalStatus maritalStatus + * + * @return $this + */ + public function setMaritalStatus(\SynergiTech\Staffology\Model\MaritalStatus $maritalStatus): static + { + if (is_null($maritalStatus)) { + throw new InvalidArgumentException('non-nullable maritalStatus cannot be null'); + } + $this->container['maritalStatus'] = $maritalStatus; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($title) && (mb_strlen($title) > 30)) { + throw new InvalidArgumentException('invalid length for $title when calling PersonalDetails., must be smaller than or equal to 30.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 35)) { + throw new InvalidArgumentException('invalid length for $firstName when calling PersonalDetails., must be smaller than or equal to 35.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets middleName + * + * @return string|null + */ + public function getMiddleName(): ?string + { + return $this->container['middleName']; + } + + /** + * Sets middleName + * + * @param string|null $middleName middleName + * + * @return $this + */ + public function setMiddleName(?string $middleName): static + { + if (is_null($middleName)) { + array_push($this->openAPINullablesSetToNull, 'middleName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('middleName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($middleName) && (mb_strlen($middleName) > 35)) { + throw new InvalidArgumentException('invalid length for $middleName when calling PersonalDetails., must be smaller than or equal to 35.'); + } + + $this->container['middleName'] = $middleName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 35)) { + throw new InvalidArgumentException('invalid length for $lastName when calling PersonalDetails., must be smaller than or equal to 35.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets alternativeEmail + * + * @return string|null + */ + public function getAlternativeEmail(): ?string + { + return $this->container['alternativeEmail']; + } + + /** + * Sets alternativeEmail + * + * @param string|null $alternativeEmail alternativeEmail + * + * @return $this + */ + public function setAlternativeEmail(?string $alternativeEmail): static + { + if (is_null($alternativeEmail)) { + array_push($this->openAPINullablesSetToNull, 'alternativeEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('alternativeEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($alternativeEmail) && (mb_strlen($alternativeEmail) > 100)) { + throw new InvalidArgumentException('invalid length for $alternativeEmail when calling PersonalDetails., must be smaller than or equal to 100.'); + } + + $this->container['alternativeEmail'] = $alternativeEmail; + + return $this; + } + + /** + * Gets previousSurName + * + * @return string|null + */ + public function getPreviousSurName(): ?string + { + return $this->container['previousSurName']; + } + + /** + * Sets previousSurName + * + * @param string|null $previousSurName previousSurName + * + * @return $this + */ + public function setPreviousSurName(?string $previousSurName): static + { + if (is_null($previousSurName)) { + array_push($this->openAPINullablesSetToNull, 'previousSurName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousSurName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($previousSurName) && (mb_strlen($previousSurName) > 35)) { + throw new InvalidArgumentException('invalid length for $previousSurName when calling PersonalDetails., must be smaller than or equal to 35.'); + } + + $this->container['previousSurName'] = $previousSurName; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail(): ?string + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail(?string $email): static + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($email) && (mb_strlen($email) > 100)) { + throw new InvalidArgumentException('invalid length for $email when calling PersonalDetails., must be smaller than or equal to 100.'); + } + + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets emailPayslip + * + * @return bool|null + */ + public function getEmailPayslip(): ?bool + { + return $this->container['emailPayslip']; + } + + /** + * Sets emailPayslip + * + * @param bool|null $emailPayslip If set to true then the employees Payslip will be sent by email when a PayRun is finalised. + * + * @return $this + */ + public function setEmailPayslip(?bool $emailPayslip): static + { + if (is_null($emailPayslip)) { + throw new InvalidArgumentException('non-nullable emailPayslip cannot be null'); + } + $this->container['emailPayslip'] = $emailPayslip; + + return $this; + } + + /** + * Gets pdfPassword + * + * @return string|null + */ + public function getPdfPassword(): ?string + { + return $this->container['pdfPassword']; + } + + /** + * Sets pdfPassword + * + * @param string|null $pdfPassword Set the password to be used on PDFs. If blank then we'll create a password based on the PdfPasswordType property. + * + * @return $this + */ + public function setPdfPassword(?string $pdfPassword): static + { + if (is_null($pdfPassword)) { + array_push($this->openAPINullablesSetToNull, 'pdfPassword'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdfPassword', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pdfPassword'] = $pdfPassword; + + return $this; + } + + /** + * Gets pdfPasswordType + * + * @return \SynergiTech\Staffology\Model\PdfPasswordType|null + */ + public function getPdfPasswordType(): ?\SynergiTech\Staffology\Model\PdfPasswordType + { + return $this->container['pdfPasswordType']; + } + + /** + * Sets pdfPasswordType + * + * @param \SynergiTech\Staffology\Model\PdfPasswordType|null $pdfPasswordType pdfPasswordType + * + * @return $this + */ + public function setPdfPasswordType(?\SynergiTech\Staffology\Model\PdfPasswordType $pdfPasswordType): static + { + if (is_null($pdfPasswordType)) { + throw new InvalidArgumentException('non-nullable pdfPasswordType cannot be null'); + } + $this->container['pdfPasswordType'] = $pdfPasswordType; + + return $this; + } + + /** + * Gets emailStatement + * + * @return bool|null + */ + public function getEmailStatement(): ?bool + { + return $this->container['emailStatement']; + } + + /** + * Sets emailStatement + * + * @param bool|null $emailStatement Only applicable to CIS Subcontractors. If set to true then we will automatically email a CIS Statement when a CIS300 is accepted. + * + * @return $this + */ + public function setEmailStatement(?bool $emailStatement): static + { + if (is_null($emailStatement)) { + throw new InvalidArgumentException('non-nullable emailStatement cannot be null'); + } + $this->container['emailStatement'] = $emailStatement; + + return $this; + } + + /** + * Gets photoUrl + * + * @return string|null + */ + public function getPhotoUrl(): ?string + { + return $this->container['photoUrl']; + } + + /** + * Sets photoUrl + * + * @param string|null $photoUrl photoUrl + * + * @return $this + */ + public function setPhotoUrl(?string $photoUrl): static + { + if (is_null($photoUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($photoUrl) && (mb_strlen($photoUrl) > 250)) { + throw new InvalidArgumentException('invalid length for $photoUrl when calling PersonalDetails., must be smaller than or equal to 250.'); + } + + $this->container['photoUrl'] = $photoUrl; + + return $this; + } + + /** + * Gets photoSasUrl + * + * @return string|null + */ + public function getPhotoSasUrl(): ?string + { + return $this->container['photoSasUrl']; + } + + /** + * Sets photoSasUrl + * + * @param string|null $photoSasUrl photoSasUrl + * + * @return $this + */ + public function setPhotoSasUrl(?string $photoSasUrl): static + { + if (is_null($photoSasUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoSasUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoSasUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['photoSasUrl'] = $photoSasUrl; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 30)) { + throw new InvalidArgumentException('invalid length for $telephone when calling PersonalDetails., must be smaller than or equal to 30.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile(): ?string + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile mobile + * + * @return $this + */ + public function setMobile(?string $mobile): static + { + if (is_null($mobile)) { + array_push($this->openAPINullablesSetToNull, 'mobile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mobile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($mobile) && (mb_strlen($mobile) > 30)) { + throw new InvalidArgumentException('invalid length for $mobile when calling PersonalDetails., must be smaller than or equal to 30.'); + } + + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets dateOfBirth + * + * @return \DateTime + */ + public function getDateOfBirth(): \DateTime + { + return $this->container['dateOfBirth']; + } + + /** + * Sets dateOfBirth + * + * @param \DateTime $dateOfBirth dateOfBirth + * + * @return $this + */ + public function setDateOfBirth(\DateTime $dateOfBirth): static + { + if (is_null($dateOfBirth)) { + throw new InvalidArgumentException('non-nullable dateOfBirth cannot be null'); + } + $this->container['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + /** + * Gets statePensionAge + * + * @return int|null + */ + public function getStatePensionAge(): ?int + { + return $this->container['statePensionAge']; + } + + /** + * Sets statePensionAge + * + * @param int|null $statePensionAge [readonly] Automatically calculated. + * + * @return $this + */ + public function setStatePensionAge(?int $statePensionAge): static + { + if (is_null($statePensionAge)) { + throw new InvalidArgumentException('non-nullable statePensionAge cannot be null'); + } + $this->container['statePensionAge'] = $statePensionAge; + + return $this; + } + + /** + * Gets gender + * + * @return \SynergiTech\Staffology\Model\Gender + */ + public function getGender(): \SynergiTech\Staffology\Model\Gender + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param \SynergiTech\Staffology\Model\Gender $gender gender + * + * @return $this + */ + public function setGender(\SynergiTech\Staffology\Model\Gender $gender): static + { + if (is_null($gender)) { + throw new InvalidArgumentException('non-nullable gender cannot be null'); + } + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($niNumber) && (mb_strlen($niNumber) > 15)) { + throw new InvalidArgumentException('invalid length for $niNumber when calling PersonalDetails., must be smaller than or equal to 15.'); + } + + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets passportNumber + * + * @return string|null + */ + public function getPassportNumber(): ?string + { + return $this->container['passportNumber']; + } + + /** + * Sets passportNumber + * + * @param string|null $passportNumber passportNumber + * + * @return $this + */ + public function setPassportNumber(?string $passportNumber): static + { + if (is_null($passportNumber)) { + array_push($this->openAPINullablesSetToNull, 'passportNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('passportNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($passportNumber) && (mb_strlen($passportNumber) > 25)) { + throw new InvalidArgumentException('invalid length for $passportNumber when calling PersonalDetails., must be smaller than or equal to 25.'); + } + + $this->container['passportNumber'] = $passportNumber; + + return $this; + } + + /** + * Gets partnerDetails + * + * @return \SynergiTech\Staffology\Model\PartnerDetails|null + */ + public function getPartnerDetails(): ?\SynergiTech\Staffology\Model\PartnerDetails + { + return $this->container['partnerDetails']; + } + + /** + * Sets partnerDetails + * + * @param \SynergiTech\Staffology\Model\PartnerDetails|null $partnerDetails partnerDetails + * + * @return $this + */ + public function setPartnerDetails(?\SynergiTech\Staffology\Model\PartnerDetails $partnerDetails): static + { + if (is_null($partnerDetails)) { + throw new InvalidArgumentException('non-nullable partnerDetails cannot be null'); + } + $this->container['partnerDetails'] = $partnerDetails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PricingBand.php b/src/Model/PricingBand.php new file mode 100644 index 0000000..f6b3741 --- /dev/null +++ b/src/Model/PricingBand.php @@ -0,0 +1,551 @@ + + */ +class PricingBand implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PricingBand'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'description' => 'string', + 'from' => 'int', + 'to' => 'int', + 'price' => 'float', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'description' => null, + 'from' => 'int32', + 'to' => 'int32', + 'price' => 'double', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'description' => true, + 'from' => false, + 'to' => false, + 'price' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'description' => 'description', + 'from' => 'from', + 'to' => 'to', + 'price' => 'price', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'description' => 'setDescription', + 'from' => 'setFrom', + 'to' => 'setTo', + 'price' => 'setPrice', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'description' => 'getDescription', + 'from' => 'getFrom', + 'to' => 'getTo', + 'price' => 'getPrice', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets from + * + * @return int|null + */ + public function getFrom(): ?int + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param int|null $from from + * + * @return $this + */ + public function setFrom(?int $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return int|null + */ + public function getTo(): ?int + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param int|null $to to + * + * @return $this + */ + public function setTo(?int $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets price + * + * @return float|null + */ + public function getPrice(): ?float + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float|null $price price + * + * @return $this + */ + public function setPrice(?float $price): static + { + if (is_null($price)) { + throw new InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/PricingTable.php b/src/Model/PricingTable.php new file mode 100644 index 0000000..d13e223 --- /dev/null +++ b/src/Model/PricingTable.php @@ -0,0 +1,664 @@ + + */ +class PricingTable implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PricingTable'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'minimumCharge' => 'float', + 'bands' => '\SynergiTech\Staffology\Model\PricingBand[]', + 'isDefault' => 'bool', + 'netSuiteItemCode' => 'string', + 'netSuiteDescription' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'minimumCharge' => 'double', + 'bands' => null, + 'isDefault' => null, + 'netSuiteItemCode' => null, + 'netSuiteDescription' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'minimumCharge' => false, + 'bands' => true, + 'isDefault' => false, + 'netSuiteItemCode' => true, + 'netSuiteDescription' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'minimumCharge' => 'minimumCharge', + 'bands' => 'bands', + 'isDefault' => 'isDefault', + 'netSuiteItemCode' => 'netSuiteItemCode', + 'netSuiteDescription' => 'netSuiteDescription', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'minimumCharge' => 'setMinimumCharge', + 'bands' => 'setBands', + 'isDefault' => 'setIsDefault', + 'netSuiteItemCode' => 'setNetSuiteItemCode', + 'netSuiteDescription' => 'setNetSuiteDescription', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'minimumCharge' => 'getMinimumCharge', + 'bands' => 'getBands', + 'isDefault' => 'getIsDefault', + 'netSuiteItemCode' => 'getNetSuiteItemCode', + 'netSuiteDescription' => 'getNetSuiteDescription', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('minimumCharge', $data ?? [], null); + $this->setIfExists('bands', $data ?? [], null); + $this->setIfExists('isDefault', $data ?? [], null); + $this->setIfExists('netSuiteItemCode', $data ?? [], null); + $this->setIfExists('netSuiteDescription', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 50)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['netSuiteItemCode']) && (mb_strlen($this->container['netSuiteItemCode']) > 20)) { + $invalidProperties[] = "invalid value for 'netSuiteItemCode', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['netSuiteDescription']) && (mb_strlen($this->container['netSuiteDescription']) > 40)) { + $invalidProperties[] = "invalid value for 'netSuiteDescription', the character length must be smaller than or equal to 40."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($name) && (mb_strlen($name) > 50)) { + throw new InvalidArgumentException('invalid length for $name when calling PricingTable., must be smaller than or equal to 50.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets minimumCharge + * + * @return float|null + */ + public function getMinimumCharge(): ?float + { + return $this->container['minimumCharge']; + } + + /** + * Sets minimumCharge + * + * @param float|null $minimumCharge minimumCharge + * + * @return $this + */ + public function setMinimumCharge(?float $minimumCharge): static + { + if (is_null($minimumCharge)) { + throw new InvalidArgumentException('non-nullable minimumCharge cannot be null'); + } + $this->container['minimumCharge'] = $minimumCharge; + + return $this; + } + + /** + * Gets bands + * + * @return \SynergiTech\Staffology\Model\PricingBand[]|null + */ + public function getBands(): ?array + { + return $this->container['bands']; + } + + /** + * Sets bands + * + * @param \SynergiTech\Staffology\Model\PricingBand[]|null $bands bands + * + * @return $this + */ + public function setBands(?array $bands): static + { + if (is_null($bands)) { + array_push($this->openAPINullablesSetToNull, 'bands'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bands', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bands'] = $bands; + + return $this; + } + + /** + * Gets isDefault + * + * @return bool|null + */ + public function getIsDefault(): ?bool + { + return $this->container['isDefault']; + } + + /** + * Sets isDefault + * + * @param bool|null $isDefault isDefault + * + * @return $this + */ + public function setIsDefault(?bool $isDefault): static + { + if (is_null($isDefault)) { + throw new InvalidArgumentException('non-nullable isDefault cannot be null'); + } + $this->container['isDefault'] = $isDefault; + + return $this; + } + + /** + * Gets netSuiteItemCode + * + * @return string|null + */ + public function getNetSuiteItemCode(): ?string + { + return $this->container['netSuiteItemCode']; + } + + /** + * Sets netSuiteItemCode + * + * @param string|null $netSuiteItemCode netSuiteItemCode + * + * @return $this + */ + public function setNetSuiteItemCode(?string $netSuiteItemCode): static + { + if (is_null($netSuiteItemCode)) { + array_push($this->openAPINullablesSetToNull, 'netSuiteItemCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netSuiteItemCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($netSuiteItemCode) && (mb_strlen($netSuiteItemCode) > 20)) { + throw new InvalidArgumentException('invalid length for $netSuiteItemCode when calling PricingTable., must be smaller than or equal to 20.'); + } + + $this->container['netSuiteItemCode'] = $netSuiteItemCode; + + return $this; + } + + /** + * Gets netSuiteDescription + * + * @return string|null + */ + public function getNetSuiteDescription(): ?string + { + return $this->container['netSuiteDescription']; + } + + /** + * Sets netSuiteDescription + * + * @param string|null $netSuiteDescription netSuiteDescription + * + * @return $this + */ + public function setNetSuiteDescription(?string $netSuiteDescription): static + { + if (is_null($netSuiteDescription)) { + array_push($this->openAPINullablesSetToNull, 'netSuiteDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netSuiteDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($netSuiteDescription) && (mb_strlen($netSuiteDescription) > 40)) { + throw new InvalidArgumentException('invalid length for $netSuiteDescription when calling PricingTable., must be smaller than or equal to 40.'); + } + + $this->container['netSuiteDescription'] = $netSuiteDescription; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ProRataRule.php b/src/Model/ProRataRule.php new file mode 100644 index 0000000..1b05a66 --- /dev/null +++ b/src/Model/ProRataRule.php @@ -0,0 +1,49 @@ + + */ +class ProcessingNote implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProcessingNote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payRunEntryId' => 'string', + 'note' => 'string', + 'user' => '\SynergiTech\Staffology\Model\Item', + 'payRun' => '\SynergiTech\Staffology\Model\Item', + 'date' => '\DateTime', + 'documentCount' => 'int', + 'documents' => '\SynergiTech\Staffology\Model\Item[]', + 'status' => '\SynergiTech\Staffology\Model\ProcessingNoteStatus', + 'updatedByName' => 'string', + 'completedDate' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payRunEntryId' => 'uuid', + 'note' => null, + 'user' => null, + 'payRun' => null, + 'date' => 'date', + 'documentCount' => 'int32', + 'documents' => null, + 'status' => null, + 'updatedByName' => null, + 'completedDate' => 'date', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payRunEntryId' => true, + 'note' => false, + 'user' => false, + 'payRun' => false, + 'date' => false, + 'documentCount' => false, + 'documents' => true, + 'status' => false, + 'updatedByName' => true, + 'completedDate' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payRunEntryId' => 'payRunEntryId', + 'note' => 'note', + 'user' => 'user', + 'payRun' => 'payRun', + 'date' => 'date', + 'documentCount' => 'documentCount', + 'documents' => 'documents', + 'status' => 'status', + 'updatedByName' => 'updatedByName', + 'completedDate' => 'completedDate', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payRunEntryId' => 'setPayRunEntryId', + 'note' => 'setNote', + 'user' => 'setUser', + 'payRun' => 'setPayRun', + 'date' => 'setDate', + 'documentCount' => 'setDocumentCount', + 'documents' => 'setDocuments', + 'status' => 'setStatus', + 'updatedByName' => 'setUpdatedByName', + 'completedDate' => 'setCompletedDate', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payRunEntryId' => 'getPayRunEntryId', + 'note' => 'getNote', + 'user' => 'getUser', + 'payRun' => 'getPayRun', + 'date' => 'getDate', + 'documentCount' => 'getDocumentCount', + 'documents' => 'getDocuments', + 'status' => 'getStatus', + 'updatedByName' => 'getUpdatedByName', + 'completedDate' => 'getCompletedDate', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payRunEntryId', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('user', $data ?? [], null); + $this->setIfExists('payRun', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('documentCount', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('updatedByName', $data ?? [], null); + $this->setIfExists('completedDate', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['note'] === null) { + $invalidProperties[] = "'note' can't be null"; + } + if ((mb_strlen($this->container['note']) < 1)) { + $invalidProperties[] = "invalid value for 'note', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payRunEntryId + * + * @return string|null + */ + public function getPayRunEntryId(): ?string + { + return $this->container['payRunEntryId']; + } + + /** + * Sets payRunEntryId + * + * @param string|null $payRunEntryId The Id of the payrunEntry this ProcessingNote relates to, if any + * + * @return $this + */ + public function setPayRunEntryId(?string $payRunEntryId): static + { + if (is_null($payRunEntryId)) { + array_push($this->openAPINullablesSetToNull, 'payRunEntryId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payRunEntryId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payRunEntryId'] = $payRunEntryId; + + return $this; + } + + /** + * Gets note + * + * @return string + */ + public function getNote(): string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string $note note + * + * @return $this + */ + public function setNote(string $note): static + { + if (is_null($note)) { + throw new InvalidArgumentException('non-nullable note cannot be null'); + } + + if ((mb_strlen($note) < 1)) { + throw new InvalidArgumentException('invalid length for $note when calling ProcessingNote., must be bigger than or equal to 1.'); + } + + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets user + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getUser(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \SynergiTech\Staffology\Model\Item|null $user user + * + * @return $this + */ + public function setUser(?\SynergiTech\Staffology\Model\Item $user): static + { + if (is_null($user)) { + throw new InvalidArgumentException('non-nullable user cannot be null'); + } + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets payRun + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getPayRun(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['payRun']; + } + + /** + * Sets payRun + * + * @param \SynergiTech\Staffology\Model\Item|null $payRun payRun + * + * @return $this + */ + public function setPayRun(?\SynergiTech\Staffology\Model\Item $payRun): static + { + if (is_null($payRun)) { + throw new InvalidArgumentException('non-nullable payRun cannot be null'); + } + $this->container['payRun'] = $payRun; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate(): ?\DateTime + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return $this + */ + public function setDate(?\DateTime $date): static + { + if (is_null($date)) { + throw new InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets documentCount + * + * @return int|null + */ + public function getDocumentCount(): ?int + { + return $this->container['documentCount']; + } + + /** + * Sets documentCount + * + * @param int|null $documentCount [readonly] The number of attachments associated with this model + * + * @return $this + */ + public function setDocumentCount(?int $documentCount): static + { + if (is_null($documentCount)) { + throw new InvalidArgumentException('non-nullable documentCount cannot be null'); + } + $this->container['documentCount'] = $documentCount; + + return $this; + } + + /** + * Gets documents + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getDocuments(): ?array + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \SynergiTech\Staffology\Model\Item[]|null $documents [readonly] The attachments associated with this model + * + * @return $this + */ + public function setDocuments(?array $documents): static + { + if (is_null($documents)) { + array_push($this->openAPINullablesSetToNull, 'documents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documents'] = $documents; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\ProcessingNoteStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\ProcessingNoteStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\ProcessingNoteStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\ProcessingNoteStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets updatedByName + * + * @return string|null + */ + public function getUpdatedByName(): ?string + { + return $this->container['updatedByName']; + } + + /** + * Sets updatedByName + * + * @param string|null $updatedByName Name of the user who was last to update the record + * + * @return $this + */ + public function setUpdatedByName(?string $updatedByName): static + { + if (is_null($updatedByName)) { + array_push($this->openAPINullablesSetToNull, 'updatedByName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('updatedByName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['updatedByName'] = $updatedByName; + + return $this; + } + + /** + * Gets completedDate + * + * @return \DateTime|null + */ + public function getCompletedDate(): ?\DateTime + { + return $this->container['completedDate']; + } + + /** + * Sets completedDate + * + * @param \DateTime|null $completedDate UpdatedDate is assigned to this to get around the base implementation of UpdatedDate having [JsonIgnore] tag + * + * @return $this + */ + public function setCompletedDate(?\DateTime $completedDate): static + { + if (is_null($completedDate)) { + array_push($this->openAPINullablesSetToNull, 'completedDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('completedDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['completedDate'] = $completedDate; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ProcessingNoteStatus.php b/src/Model/ProcessingNoteStatus.php new file mode 100644 index 0000000..8b393bc --- /dev/null +++ b/src/Model/ProcessingNoteStatus.php @@ -0,0 +1,45 @@ + + */ +class RecoverableAmounts implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecoverableAmounts'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxMonth' => 'int', + 'smpRecovered' => 'float', + 'sppRecovered' => 'float', + 'sapRecovered' => 'float', + 'shPPRecovered' => 'float', + 'spbpRecovered' => 'float', + 'nicCompensationOnSMP' => 'float', + 'nicCompensationOnSPP' => 'float', + 'nicCompensationOnSAP' => 'float', + 'nicCompensationOnShPP' => 'float', + 'nicCompensationOnSPBP' => 'float', + 'cisDeductionsSuffered' => 'float', + 'total' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxMonth' => 'int32', + 'smpRecovered' => 'double', + 'sppRecovered' => 'double', + 'sapRecovered' => 'double', + 'shPPRecovered' => 'double', + 'spbpRecovered' => 'double', + 'nicCompensationOnSMP' => 'double', + 'nicCompensationOnSPP' => 'double', + 'nicCompensationOnSAP' => 'double', + 'nicCompensationOnShPP' => 'double', + 'nicCompensationOnSPBP' => 'double', + 'cisDeductionsSuffered' => 'double', + 'total' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxMonth' => false, + 'smpRecovered' => false, + 'sppRecovered' => false, + 'sapRecovered' => false, + 'shPPRecovered' => false, + 'spbpRecovered' => false, + 'nicCompensationOnSMP' => false, + 'nicCompensationOnSPP' => false, + 'nicCompensationOnSAP' => false, + 'nicCompensationOnShPP' => false, + 'nicCompensationOnSPBP' => false, + 'cisDeductionsSuffered' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxMonth' => 'taxMonth', + 'smpRecovered' => 'smpRecovered', + 'sppRecovered' => 'sppRecovered', + 'sapRecovered' => 'sapRecovered', + 'shPPRecovered' => 'shPPRecovered', + 'spbpRecovered' => 'spbpRecovered', + 'nicCompensationOnSMP' => 'nicCompensationOnSMP', + 'nicCompensationOnSPP' => 'nicCompensationOnSPP', + 'nicCompensationOnSAP' => 'nicCompensationOnSAP', + 'nicCompensationOnShPP' => 'nicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'nicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'cisDeductionsSuffered', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxMonth' => 'setTaxMonth', + 'smpRecovered' => 'setSmpRecovered', + 'sppRecovered' => 'setSppRecovered', + 'sapRecovered' => 'setSapRecovered', + 'shPPRecovered' => 'setShPPRecovered', + 'spbpRecovered' => 'setSpbpRecovered', + 'nicCompensationOnSMP' => 'setNicCompensationOnSMP', + 'nicCompensationOnSPP' => 'setNicCompensationOnSPP', + 'nicCompensationOnSAP' => 'setNicCompensationOnSAP', + 'nicCompensationOnShPP' => 'setNicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'setNicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'setCisDeductionsSuffered', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxMonth' => 'getTaxMonth', + 'smpRecovered' => 'getSmpRecovered', + 'sppRecovered' => 'getSppRecovered', + 'sapRecovered' => 'getSapRecovered', + 'shPPRecovered' => 'getShPPRecovered', + 'spbpRecovered' => 'getSpbpRecovered', + 'nicCompensationOnSMP' => 'getNicCompensationOnSMP', + 'nicCompensationOnSPP' => 'getNicCompensationOnSPP', + 'nicCompensationOnSAP' => 'getNicCompensationOnSAP', + 'nicCompensationOnShPP' => 'getNicCompensationOnShPP', + 'nicCompensationOnSPBP' => 'getNicCompensationOnSPBP', + 'cisDeductionsSuffered' => 'getCisDeductionsSuffered', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxMonth', $data ?? [], null); + $this->setIfExists('smpRecovered', $data ?? [], null); + $this->setIfExists('sppRecovered', $data ?? [], null); + $this->setIfExists('sapRecovered', $data ?? [], null); + $this->setIfExists('shPPRecovered', $data ?? [], null); + $this->setIfExists('spbpRecovered', $data ?? [], null); + $this->setIfExists('nicCompensationOnSMP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSPP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSAP', $data ?? [], null); + $this->setIfExists('nicCompensationOnShPP', $data ?? [], null); + $this->setIfExists('nicCompensationOnSPBP', $data ?? [], null); + $this->setIfExists('cisDeductionsSuffered', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxMonth + * + * @return int|null + */ + public function getTaxMonth(): ?int + { + return $this->container['taxMonth']; + } + + /** + * Sets taxMonth + * + * @param int|null $taxMonth taxMonth + * + * @return $this + */ + public function setTaxMonth(?int $taxMonth): static + { + if (is_null($taxMonth)) { + throw new InvalidArgumentException('non-nullable taxMonth cannot be null'); + } + $this->container['taxMonth'] = $taxMonth; + + return $this; + } + + /** + * Gets smpRecovered + * + * @return float|null + */ + public function getSmpRecovered(): ?float + { + return $this->container['smpRecovered']; + } + + /** + * Sets smpRecovered + * + * @param float|null $smpRecovered Value of Statutory Maternity Pay recovered year to date + * + * @return $this + */ + public function setSmpRecovered(?float $smpRecovered): static + { + if (is_null($smpRecovered)) { + throw new InvalidArgumentException('non-nullable smpRecovered cannot be null'); + } + $this->container['smpRecovered'] = $smpRecovered; + + return $this; + } + + /** + * Gets sppRecovered + * + * @return float|null + */ + public function getSppRecovered(): ?float + { + return $this->container['sppRecovered']; + } + + /** + * Sets sppRecovered + * + * @param float|null $sppRecovered Value of Statutory Paternity Pay recovered year to date + * + * @return $this + */ + public function setSppRecovered(?float $sppRecovered): static + { + if (is_null($sppRecovered)) { + throw new InvalidArgumentException('non-nullable sppRecovered cannot be null'); + } + $this->container['sppRecovered'] = $sppRecovered; + + return $this; + } + + /** + * Gets sapRecovered + * + * @return float|null + */ + public function getSapRecovered(): ?float + { + return $this->container['sapRecovered']; + } + + /** + * Sets sapRecovered + * + * @param float|null $sapRecovered Value of Statutory Adoption Pay recovered year to date + * + * @return $this + */ + public function setSapRecovered(?float $sapRecovered): static + { + if (is_null($sapRecovered)) { + throw new InvalidArgumentException('non-nullable sapRecovered cannot be null'); + } + $this->container['sapRecovered'] = $sapRecovered; + + return $this; + } + + /** + * Gets shPPRecovered + * + * @return float|null + */ + public function getShPPRecovered(): ?float + { + return $this->container['shPPRecovered']; + } + + /** + * Sets shPPRecovered + * + * @param float|null $shPPRecovered Value of Shared Parental Pay recovered year to date + * + * @return $this + */ + public function setShPPRecovered(?float $shPPRecovered): static + { + if (is_null($shPPRecovered)) { + throw new InvalidArgumentException('non-nullable shPPRecovered cannot be null'); + } + $this->container['shPPRecovered'] = $shPPRecovered; + + return $this; + } + + /** + * Gets spbpRecovered + * + * @return float|null + */ + public function getSpbpRecovered(): ?float + { + return $this->container['spbpRecovered']; + } + + /** + * Sets spbpRecovered + * + * @param float|null $spbpRecovered Value of Statutory Parental Bereavement Pay recovered year to date + * + * @return $this + */ + public function setSpbpRecovered(?float $spbpRecovered): static + { + if (is_null($spbpRecovered)) { + throw new InvalidArgumentException('non-nullable spbpRecovered cannot be null'); + } + $this->container['spbpRecovered'] = $spbpRecovered; + + return $this; + } + + /** + * Gets nicCompensationOnSMP + * + * @return float|null + */ + public function getNicCompensationOnSMP(): ?float + { + return $this->container['nicCompensationOnSMP']; + } + + /** + * Sets nicCompensationOnSMP + * + * @param float|null $nicCompensationOnSMP Value of NIC compensation on SMP year to date + * + * @return $this + */ + public function setNicCompensationOnSMP(?float $nicCompensationOnSMP): static + { + if (is_null($nicCompensationOnSMP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSMP cannot be null'); + } + $this->container['nicCompensationOnSMP'] = $nicCompensationOnSMP; + + return $this; + } + + /** + * Gets nicCompensationOnSPP + * + * @return float|null + */ + public function getNicCompensationOnSPP(): ?float + { + return $this->container['nicCompensationOnSPP']; + } + + /** + * Sets nicCompensationOnSPP + * + * @param float|null $nicCompensationOnSPP Value of NIC compensation on Statutory Paternity Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSPP(?float $nicCompensationOnSPP): static + { + if (is_null($nicCompensationOnSPP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSPP cannot be null'); + } + $this->container['nicCompensationOnSPP'] = $nicCompensationOnSPP; + + return $this; + } + + /** + * Gets nicCompensationOnSAP + * + * @return float|null + */ + public function getNicCompensationOnSAP(): ?float + { + return $this->container['nicCompensationOnSAP']; + } + + /** + * Sets nicCompensationOnSAP + * + * @param float|null $nicCompensationOnSAP Value of NIC compensation on Statutory Adoption Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSAP(?float $nicCompensationOnSAP): static + { + if (is_null($nicCompensationOnSAP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSAP cannot be null'); + } + $this->container['nicCompensationOnSAP'] = $nicCompensationOnSAP; + + return $this; + } + + /** + * Gets nicCompensationOnShPP + * + * @return float|null + */ + public function getNicCompensationOnShPP(): ?float + { + return $this->container['nicCompensationOnShPP']; + } + + /** + * Sets nicCompensationOnShPP + * + * @param float|null $nicCompensationOnShPP Value of NIC compensation on Shared Parental Pay year to date + * + * @return $this + */ + public function setNicCompensationOnShPP(?float $nicCompensationOnShPP): static + { + if (is_null($nicCompensationOnShPP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnShPP cannot be null'); + } + $this->container['nicCompensationOnShPP'] = $nicCompensationOnShPP; + + return $this; + } + + /** + * Gets nicCompensationOnSPBP + * + * @return float|null + */ + public function getNicCompensationOnSPBP(): ?float + { + return $this->container['nicCompensationOnSPBP']; + } + + /** + * Sets nicCompensationOnSPBP + * + * @param float|null $nicCompensationOnSPBP Value of NIC compensation on Statutory Parental Bereavement Pay year to date + * + * @return $this + */ + public function setNicCompensationOnSPBP(?float $nicCompensationOnSPBP): static + { + if (is_null($nicCompensationOnSPBP)) { + throw new InvalidArgumentException('non-nullable nicCompensationOnSPBP cannot be null'); + } + $this->container['nicCompensationOnSPBP'] = $nicCompensationOnSPBP; + + return $this; + } + + /** + * Gets cisDeductionsSuffered + * + * @return float|null + */ + public function getCisDeductionsSuffered(): ?float + { + return $this->container['cisDeductionsSuffered']; + } + + /** + * Sets cisDeductionsSuffered + * + * @param float|null $cisDeductionsSuffered Value of CIS deductions suffered year to date + * + * @return $this + */ + public function setCisDeductionsSuffered(?float $cisDeductionsSuffered): static + { + if (is_null($cisDeductionsSuffered)) { + throw new InvalidArgumentException('non-nullable cisDeductionsSuffered cannot be null'); + } + $this->container['cisDeductionsSuffered'] = $cisDeductionsSuffered; + + return $this; + } + + /** + * Gets total + * + * @return float|null + */ + public function getTotal(): ?float + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total The total value of the reclaimed amounts + * + * @return $this + */ + public function setTotal(?float $total): static + { + if (is_null($total)) { + throw new InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Report.php b/src/Model/Report.php new file mode 100644 index 0000000..5f36bba --- /dev/null +++ b/src/Model/Report.php @@ -0,0 +1,147 @@ + + */ +class ReportPack implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ReportPack'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'reports' => '\SynergiTech\Staffology\Model\Report[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'reports' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => false, + 'reports' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'reports' => 'reports', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'reports' => 'setReports', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'reports' => 'getReports', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('reports', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 150)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of this ReportPack + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 150)) { + throw new InvalidArgumentException('invalid length for $title when calling ReportPack., must be smaller than or equal to 150.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling ReportPack., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets reports + * + * @return \SynergiTech\Staffology\Model\Report[]|null + */ + public function getReports(): ?array + { + return $this->container['reports']; + } + + /** + * Sets reports + * + * @param \SynergiTech\Staffology\Model\Report[]|null $reports The Reports included in this ReportPack + * + * @return $this + */ + public function setReports(?array $reports): static + { + if (is_null($reports)) { + array_push($this->openAPINullablesSetToNull, 'reports'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reports', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reports'] = $reports; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ReportResponse.php b/src/Model/ReportResponse.php new file mode 100644 index 0000000..f8668ca --- /dev/null +++ b/src/Model/ReportResponse.php @@ -0,0 +1,539 @@ + + */ +class ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => 'mixed', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => true, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return mixed|null + */ + public function getModel(): mixed + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param mixed|null $model [readonly] If the type is application.json then this will contain a JSON representation of the relevant model + * + * @return $this + */ + public function setModel(mixed $model): static + { + if (is_null($model)) { + array_push($this->openAPINullablesSetToNull, 'model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ReportSortBy.php b/src/Model/ReportSortBy.php new file mode 100644 index 0000000..de89a30 --- /dev/null +++ b/src/Model/ReportSortBy.php @@ -0,0 +1,47 @@ + + */ +class ReportTemplate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ReportTemplate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'templateName' => 'string', + 'userName' => 'string', + 'lastUpdated' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'templateName' => null, + 'userName' => null, + 'lastUpdated' => 'date', + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'templateName' => false, + 'userName' => true, + 'lastUpdated' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'templateName' => 'templateName', + 'userName' => 'userName', + 'lastUpdated' => 'lastUpdated', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'templateName' => 'setTemplateName', + 'userName' => 'setUserName', + 'lastUpdated' => 'setLastUpdated', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'templateName' => 'getTemplateName', + 'userName' => 'getUserName', + 'lastUpdated' => 'getLastUpdated', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('templateName', $data ?? [], null); + $this->setIfExists('userName', $data ?? [], null); + $this->setIfExists('lastUpdated', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['templateName'] === null) { + $invalidProperties[] = "'templateName' can't be null"; + } + if ((mb_strlen($this->container['templateName']) < 1)) { + $invalidProperties[] = "invalid value for 'templateName', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets templateName + * + * @return string + */ + public function getTemplateName(): string + { + return $this->container['templateName']; + } + + /** + * Sets templateName + * + * @param string $templateName templateName + * + * @return $this + */ + public function setTemplateName(string $templateName): static + { + if (is_null($templateName)) { + throw new InvalidArgumentException('non-nullable templateName cannot be null'); + } + + if ((mb_strlen($templateName) < 1)) { + throw new InvalidArgumentException('invalid length for $templateName when calling ReportTemplate., must be bigger than or equal to 1.'); + } + + $this->container['templateName'] = $templateName; + + return $this; + } + + /** + * Gets userName + * + * @return string|null + */ + public function getUserName(): ?string + { + return $this->container['userName']; + } + + /** + * Sets userName + * + * @param string|null $userName userName + * + * @return $this + */ + public function setUserName(?string $userName): static + { + if (is_null($userName)) { + array_push($this->openAPINullablesSetToNull, 'userName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('userName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['userName'] = $userName; + + return $this; + } + + /** + * Gets lastUpdated + * + * @return \DateTime|null + */ + public function getLastUpdated(): ?\DateTime + { + return $this->container['lastUpdated']; + } + + /** + * Sets lastUpdated + * + * @param \DateTime|null $lastUpdated lastUpdated + * + * @return $this + */ + public function setLastUpdated(?\DateTime $lastUpdated): static + { + if (is_null($lastUpdated)) { + throw new InvalidArgumentException('non-nullable lastUpdated cannot be null'); + } + $this->container['lastUpdated'] = $lastUpdated; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RightToWork.php b/src/Model/RightToWork.php new file mode 100644 index 0000000..0dd1c95 --- /dev/null +++ b/src/Model/RightToWork.php @@ -0,0 +1,581 @@ + + */ +class RightToWork implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RightToWork'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'checked' => 'bool', + 'documentType' => '\SynergiTech\Staffology\Model\RightToWorkDocumentType', + 'documentRef' => 'string', + 'documentExpiry' => '\DateTime', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'checked' => null, + 'documentType' => null, + 'documentRef' => null, + 'documentExpiry' => 'date', + 'note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'checked' => false, + 'documentType' => false, + 'documentRef' => true, + 'documentExpiry' => true, + 'note' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'checked' => 'checked', + 'documentType' => 'documentType', + 'documentRef' => 'documentRef', + 'documentExpiry' => 'documentExpiry', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'checked' => 'setChecked', + 'documentType' => 'setDocumentType', + 'documentRef' => 'setDocumentRef', + 'documentExpiry' => 'setDocumentExpiry', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'checked' => 'getChecked', + 'documentType' => 'getDocumentType', + 'documentRef' => 'getDocumentRef', + 'documentExpiry' => 'getDocumentExpiry', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checked', $data ?? [], null); + $this->setIfExists('documentType', $data ?? [], null); + $this->setIfExists('documentRef', $data ?? [], null); + $this->setIfExists('documentExpiry', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['documentRef']) && (mb_strlen($this->container['documentRef']) > 80)) { + $invalidProperties[] = "invalid value for 'documentRef', the character length must be smaller than or equal to 80."; + } + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 200)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 200."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checked + * + * @return bool|null + */ + public function getChecked(): ?bool + { + return $this->container['checked']; + } + + /** + * Sets checked + * + * @param bool|null $checked checked + * + * @return $this + */ + public function setChecked(?bool $checked): static + { + if (is_null($checked)) { + throw new InvalidArgumentException('non-nullable checked cannot be null'); + } + $this->container['checked'] = $checked; + + return $this; + } + + /** + * Gets documentType + * + * @return \SynergiTech\Staffology\Model\RightToWorkDocumentType|null + */ + public function getDocumentType(): ?\SynergiTech\Staffology\Model\RightToWorkDocumentType + { + return $this->container['documentType']; + } + + /** + * Sets documentType + * + * @param \SynergiTech\Staffology\Model\RightToWorkDocumentType|null $documentType documentType + * + * @return $this + */ + public function setDocumentType(?\SynergiTech\Staffology\Model\RightToWorkDocumentType $documentType): static + { + if (is_null($documentType)) { + throw new InvalidArgumentException('non-nullable documentType cannot be null'); + } + $this->container['documentType'] = $documentType; + + return $this; + } + + /** + * Gets documentRef + * + * @return string|null + */ + public function getDocumentRef(): ?string + { + return $this->container['documentRef']; + } + + /** + * Sets documentRef + * + * @param string|null $documentRef documentRef + * + * @return $this + */ + public function setDocumentRef(?string $documentRef): static + { + if (is_null($documentRef)) { + array_push($this->openAPINullablesSetToNull, 'documentRef'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documentRef', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($documentRef) && (mb_strlen($documentRef) > 80)) { + throw new InvalidArgumentException('invalid length for $documentRef when calling RightToWork., must be smaller than or equal to 80.'); + } + + $this->container['documentRef'] = $documentRef; + + return $this; + } + + /** + * Gets documentExpiry + * + * @return \DateTime|null + */ + public function getDocumentExpiry(): ?\DateTime + { + return $this->container['documentExpiry']; + } + + /** + * Sets documentExpiry + * + * @param \DateTime|null $documentExpiry documentExpiry + * + * @return $this + */ + public function setDocumentExpiry(?\DateTime $documentExpiry): static + { + if (is_null($documentExpiry)) { + array_push($this->openAPINullablesSetToNull, 'documentExpiry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documentExpiry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['documentExpiry'] = $documentExpiry; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note note + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 200)) { + throw new InvalidArgumentException('invalid length for $note when calling RightToWork., must be smaller than or equal to 200.'); + } + + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RightToWorkDocumentType.php b/src/Model/RightToWorkDocumentType.php new file mode 100644 index 0000000..5f7b73a --- /dev/null +++ b/src/Model/RightToWorkDocumentType.php @@ -0,0 +1,53 @@ + + */ +class RightToWorkReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RightToWorkReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'lines' => '\SynergiTech\Staffology\Model\RightToWorkReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employer' => null, + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employer' => false, + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employer' => 'employer', + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employer' => 'setEmployer', + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employer' => 'getEmployer', + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\RightToWorkReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\RightToWorkReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RightToWorkReportLine.php b/src/Model/RightToWorkReportLine.php new file mode 100644 index 0000000..9827e90 --- /dev/null +++ b/src/Model/RightToWorkReportLine.php @@ -0,0 +1,524 @@ + + */ +class RightToWorkReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RightToWorkReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string', + 'rightToWork' => '\SynergiTech\Staffology\Model\RightToWork' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'department' => null, + 'rightToWork' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'department' => true, + 'rightToWork' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department', + 'rightToWork' => 'rightToWork' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment', + 'rightToWork' => 'setRightToWork' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment', + 'rightToWork' => 'getRightToWork' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('rightToWork', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets rightToWork + * + * @return \SynergiTech\Staffology\Model\RightToWork|null + */ + public function getRightToWork(): ?\SynergiTech\Staffology\Model\RightToWork + { + return $this->container['rightToWork']; + } + + /** + * Sets rightToWork + * + * @param \SynergiTech\Staffology\Model\RightToWork|null $rightToWork rightToWork + * + * @return $this + */ + public function setRightToWork(?\SynergiTech\Staffology\Model\RightToWork $rightToWork): static + { + if (is_null($rightToWork)) { + throw new InvalidArgumentException('non-nullable rightToWork cannot be null'); + } + $this->container['rightToWork'] = $rightToWork; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RightToWorkReportReportResponse.php b/src/Model/RightToWorkReportReportResponse.php new file mode 100644 index 0000000..e9abffd --- /dev/null +++ b/src/Model/RightToWorkReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class RightToWorkReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RightToWorkReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\RightToWorkReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\RightToWorkReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\RightToWorkReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\RightToWorkReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\RightToWorkReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RoleBasis.php b/src/Model/RoleBasis.php new file mode 100644 index 0000000..f37a001 --- /dev/null +++ b/src/Model/RoleBasis.php @@ -0,0 +1,55 @@ + + */ +class RtiAgent implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiAgent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'agentId' => 'string', + 'company' => 'string', + 'address' => '\SynergiTech\Staffology\Model\Address', + 'contact' => '\SynergiTech\Staffology\Model\RtiContact' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'agentId' => null, + 'company' => null, + 'address' => null, + 'contact' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'agentId' => true, + 'company' => true, + 'address' => false, + 'contact' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'agentId' => 'agentId', + 'company' => 'company', + 'address' => 'address', + 'contact' => 'contact' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'agentId' => 'setAgentId', + 'company' => 'setCompany', + 'address' => 'setAddress', + 'contact' => 'setContact' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'agentId' => 'getAgentId', + 'company' => 'getCompany', + 'address' => 'getAddress', + 'contact' => 'getContact' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('agentId', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('contact', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets agentId + * + * @return string|null + */ + public function getAgentId(): ?string + { + return $this->container['agentId']; + } + + /** + * Sets agentId + * + * @param string|null $agentId agentId + * + * @return $this + */ + public function setAgentId(?string $agentId): static + { + if (is_null($agentId)) { + array_push($this->openAPINullablesSetToNull, 'agentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('agentId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['agentId'] = $agentId; + + return $this; + } + + /** + * Gets company + * + * @return string|null + */ + public function getCompany(): ?string + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param string|null $company company + * + * @return $this + */ + public function setCompany(?string $company): static + { + if (is_null($company)) { + array_push($this->openAPINullablesSetToNull, 'company'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('company', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets contact + * + * @return \SynergiTech\Staffology\Model\RtiContact|null + */ + public function getContact(): ?\SynergiTech\Staffology\Model\RtiContact + { + return $this->container['contact']; + } + + /** + * Sets contact + * + * @param \SynergiTech\Staffology\Model\RtiContact|null $contact contact + * + * @return $this + */ + public function setContact(?\SynergiTech\Staffology\Model\RtiContact $contact): static + { + if (is_null($contact)) { + throw new InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiContact.php b/src/Model/RtiContact.php new file mode 100644 index 0000000..85f5cae --- /dev/null +++ b/src/Model/RtiContact.php @@ -0,0 +1,570 @@ + + */ +class RtiContact implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiContact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'firstName' => 'string', + 'lastName' => 'string', + 'email' => 'string', + 'telephone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'firstName' => null, + 'lastName' => null, + 'email' => null, + 'telephone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'firstName' => true, + 'lastName' => true, + 'email' => true, + 'telephone' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'email' => 'email', + 'telephone' => 'telephone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'email' => 'setEmail', + 'telephone' => 'setTelephone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'email' => 'getEmail', + 'telephone' => 'getTelephone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('telephone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 50)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 50)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 150)) { + $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['telephone']) && (mb_strlen($this->container['telephone']) > 50)) { + $invalidProperties[] = "invalid value for 'telephone', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 50)) { + throw new InvalidArgumentException('invalid length for $firstName when calling RtiContact., must be smaller than or equal to 50.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 50)) { + throw new InvalidArgumentException('invalid length for $lastName when calling RtiContact., must be smaller than or equal to 50.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail(): ?string + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail(?string $email): static + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($email) && (mb_strlen($email) > 150)) { + throw new InvalidArgumentException('invalid length for $email when calling RtiContact., must be smaller than or equal to 150.'); + } + + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets telephone + * + * @return string|null + */ + public function getTelephone(): ?string + { + return $this->container['telephone']; + } + + /** + * Sets telephone + * + * @param string|null $telephone telephone + * + * @return $this + */ + public function setTelephone(?string $telephone): static + { + if (is_null($telephone)) { + array_push($this->openAPINullablesSetToNull, 'telephone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephone) && (mb_strlen($telephone) > 50)) { + throw new InvalidArgumentException('invalid length for $telephone when calling RtiContact., must be smaller than or equal to 50.'); + } + + $this->container['telephone'] = $telephone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiEmployeeAddress.php b/src/Model/RtiEmployeeAddress.php new file mode 100644 index 0000000..b77c141 --- /dev/null +++ b/src/Model/RtiEmployeeAddress.php @@ -0,0 +1,620 @@ + + */ +class RtiEmployeeAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiEmployeeAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'line' => 'string[]', + 'postcode' => 'string', + 'postCode' => 'string', + 'ukPostcode' => 'string', + 'country' => 'string', + 'foreignCountry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'line' => null, + 'postcode' => null, + 'postCode' => null, + 'ukPostcode' => null, + 'country' => null, + 'foreignCountry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'line' => true, + 'postcode' => true, + 'postCode' => true, + 'ukPostcode' => true, + 'country' => true, + 'foreignCountry' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'line' => 'line', + 'postcode' => 'postcode', + 'postCode' => 'postCode', + 'ukPostcode' => 'ukPostcode', + 'country' => 'country', + 'foreignCountry' => 'foreignCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'line' => 'setLine', + 'postcode' => 'setPostcode', + 'postCode' => 'setPostCode', + 'ukPostcode' => 'setUkPostcode', + 'country' => 'setCountry', + 'foreignCountry' => 'setForeignCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'line' => 'getLine', + 'postcode' => 'getPostcode', + 'postCode' => 'getPostCode', + 'ukPostcode' => 'getUkPostcode', + 'country' => 'getCountry', + 'foreignCountry' => 'getForeignCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('line', $data ?? [], null); + $this->setIfExists('postcode', $data ?? [], null); + $this->setIfExists('postCode', $data ?? [], null); + $this->setIfExists('ukPostcode', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('foreignCountry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line + * + * @return string[]|null + */ + public function getLine(): ?array + { + return $this->container['line']; + } + + /** + * Sets line + * + * @param string[]|null $line line + * + * @return $this + */ + public function setLine(?array $line): static + { + if (is_null($line)) { + array_push($this->openAPINullablesSetToNull, 'line'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['line'] = $line; + + return $this; + } + + /** + * Gets postcode + * + * @return string|null + */ + public function getPostcode(): ?string + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string|null $postcode postcode + * + * @return $this + */ + public function setPostcode(?string $postcode): static + { + if (is_null($postcode)) { + array_push($this->openAPINullablesSetToNull, 'postcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postcode'] = $postcode; + + return $this; + } + + /** + * Gets postCode + * + * @return string|null + */ + public function getPostCode(): ?string + { + return $this->container['postCode']; + } + + /** + * Sets postCode + * + * @param string|null $postCode postCode + * + * @return $this + */ + public function setPostCode(?string $postCode): static + { + if (is_null($postCode)) { + array_push($this->openAPINullablesSetToNull, 'postCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postCode'] = $postCode; + + return $this; + } + + /** + * Gets ukPostcode + * + * @return string|null + */ + public function getUkPostcode(): ?string + { + return $this->container['ukPostcode']; + } + + /** + * Sets ukPostcode + * + * @param string|null $ukPostcode ukPostcode + * + * @return $this + */ + public function setUkPostcode(?string $ukPostcode): static + { + if (is_null($ukPostcode)) { + array_push($this->openAPINullablesSetToNull, 'ukPostcode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ukPostcode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ukPostcode'] = $ukPostcode; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry(): ?string + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return $this + */ + public function setCountry(?string $country): static + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets foreignCountry + * + * @return string|null + */ + public function getForeignCountry(): ?string + { + return $this->container['foreignCountry']; + } + + /** + * Sets foreignCountry + * + * @param string|null $foreignCountry foreignCountry + * + * @return $this + */ + public function setForeignCountry(?string $foreignCountry): static + { + if (is_null($foreignCountry)) { + array_push($this->openAPINullablesSetToNull, 'foreignCountry'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('foreignCountry', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['foreignCountry'] = $foreignCountry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiEmployeeName.php b/src/Model/RtiEmployeeName.php new file mode 100644 index 0000000..4e10226 --- /dev/null +++ b/src/Model/RtiEmployeeName.php @@ -0,0 +1,538 @@ + + */ +class RtiEmployeeName implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiEmployeeName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'ttl' => 'string', + 'fore' => 'string[]', + 'initials' => 'string', + 'sur' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'ttl' => null, + 'fore' => null, + 'initials' => null, + 'sur' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'ttl' => true, + 'fore' => true, + 'initials' => true, + 'sur' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'ttl' => 'ttl', + 'fore' => 'fore', + 'initials' => 'initials', + 'sur' => 'sur' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'ttl' => 'setTtl', + 'fore' => 'setFore', + 'initials' => 'setInitials', + 'sur' => 'setSur' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'ttl' => 'getTtl', + 'fore' => 'getFore', + 'initials' => 'getInitials', + 'sur' => 'getSur' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ttl', $data ?? [], null); + $this->setIfExists('fore', $data ?? [], null); + $this->setIfExists('initials', $data ?? [], null); + $this->setIfExists('sur', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ttl + * + * @return string|null + */ + public function getTtl(): ?string + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param string|null $ttl ttl + * + * @return $this + */ + public function setTtl(?string $ttl): static + { + if (is_null($ttl)) { + array_push($this->openAPINullablesSetToNull, 'ttl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ttl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ttl'] = $ttl; + + return $this; + } + + /** + * Gets fore + * + * @return string[]|null + */ + public function getFore(): ?array + { + return $this->container['fore']; + } + + /** + * Sets fore + * + * @param string[]|null $fore fore + * + * @return $this + */ + public function setFore(?array $fore): static + { + if (is_null($fore)) { + array_push($this->openAPINullablesSetToNull, 'fore'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fore', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fore'] = $fore; + + return $this; + } + + /** + * Gets initials + * + * @return string|null + */ + public function getInitials(): ?string + { + return $this->container['initials']; + } + + /** + * Sets initials + * + * @param string|null $initials initials + * + * @return $this + */ + public function setInitials(?string $initials): static + { + if (is_null($initials)) { + array_push($this->openAPINullablesSetToNull, 'initials'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initials', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initials'] = $initials; + + return $this; + } + + /** + * Gets sur + * + * @return string|null + */ + public function getSur(): ?string + { + return $this->container['sur']; + } + + /** + * Sets sur + * + * @param string|null $sur sur + * + * @return $this + */ + public function setSur(?string $sur): static + { + if (is_null($sur)) { + array_push($this->openAPINullablesSetToNull, 'sur'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sur', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['sur'] = $sur; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiSenderType.php b/src/Model/RtiSenderType.php new file mode 100644 index 0000000..3909e19 --- /dev/null +++ b/src/Model/RtiSenderType.php @@ -0,0 +1,61 @@ + + */ +class RtiSubmissionSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiSubmissionSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'senderType' => '\SynergiTech\Staffology\Model\RtiSenderType', + 'senderId' => 'string', + 'password' => 'string', + 'excludeNilPaid' => 'bool', + 'includeHashCrossRef' => 'bool', + 'autoSubmitFps' => 'bool', + 'testInLive' => 'bool', + 'useTestGateway' => 'bool', + 'overrideTimestampValue' => 'string', + 'contact' => '\SynergiTech\Staffology\Model\RtiContact', + 'agent' => '\SynergiTech\Staffology\Model\RtiAgent', + 'allowLinkedEps' => 'bool', + 'shouldCompressFps' => 'bool', + 'autoSubmitEps' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'senderType' => null, + 'senderId' => null, + 'password' => null, + 'excludeNilPaid' => null, + 'includeHashCrossRef' => null, + 'autoSubmitFps' => null, + 'testInLive' => null, + 'useTestGateway' => null, + 'overrideTimestampValue' => null, + 'contact' => null, + 'agent' => null, + 'allowLinkedEps' => null, + 'shouldCompressFps' => null, + 'autoSubmitEps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'senderType' => false, + 'senderId' => true, + 'password' => true, + 'excludeNilPaid' => false, + 'includeHashCrossRef' => false, + 'autoSubmitFps' => false, + 'testInLive' => false, + 'useTestGateway' => false, + 'overrideTimestampValue' => true, + 'contact' => false, + 'agent' => false, + 'allowLinkedEps' => false, + 'shouldCompressFps' => false, + 'autoSubmitEps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'senderType' => 'senderType', + 'senderId' => 'senderId', + 'password' => 'password', + 'excludeNilPaid' => 'excludeNilPaid', + 'includeHashCrossRef' => 'includeHashCrossRef', + 'autoSubmitFps' => 'autoSubmitFps', + 'testInLive' => 'testInLive', + 'useTestGateway' => 'useTestGateway', + 'overrideTimestampValue' => 'overrideTimestampValue', + 'contact' => 'contact', + 'agent' => 'agent', + 'allowLinkedEps' => 'allowLinkedEps', + 'shouldCompressFps' => 'shouldCompressFps', + 'autoSubmitEps' => 'autoSubmitEps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'senderType' => 'setSenderType', + 'senderId' => 'setSenderId', + 'password' => 'setPassword', + 'excludeNilPaid' => 'setExcludeNilPaid', + 'includeHashCrossRef' => 'setIncludeHashCrossRef', + 'autoSubmitFps' => 'setAutoSubmitFps', + 'testInLive' => 'setTestInLive', + 'useTestGateway' => 'setUseTestGateway', + 'overrideTimestampValue' => 'setOverrideTimestampValue', + 'contact' => 'setContact', + 'agent' => 'setAgent', + 'allowLinkedEps' => 'setAllowLinkedEps', + 'shouldCompressFps' => 'setShouldCompressFps', + 'autoSubmitEps' => 'setAutoSubmitEps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'senderType' => 'getSenderType', + 'senderId' => 'getSenderId', + 'password' => 'getPassword', + 'excludeNilPaid' => 'getExcludeNilPaid', + 'includeHashCrossRef' => 'getIncludeHashCrossRef', + 'autoSubmitFps' => 'getAutoSubmitFps', + 'testInLive' => 'getTestInLive', + 'useTestGateway' => 'getUseTestGateway', + 'overrideTimestampValue' => 'getOverrideTimestampValue', + 'contact' => 'getContact', + 'agent' => 'getAgent', + 'allowLinkedEps' => 'getAllowLinkedEps', + 'shouldCompressFps' => 'getShouldCompressFps', + 'autoSubmitEps' => 'getAutoSubmitEps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('senderType', $data ?? [], null); + $this->setIfExists('senderId', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('excludeNilPaid', $data ?? [], null); + $this->setIfExists('includeHashCrossRef', $data ?? [], null); + $this->setIfExists('autoSubmitFps', $data ?? [], null); + $this->setIfExists('testInLive', $data ?? [], null); + $this->setIfExists('useTestGateway', $data ?? [], null); + $this->setIfExists('overrideTimestampValue', $data ?? [], null); + $this->setIfExists('contact', $data ?? [], null); + $this->setIfExists('agent', $data ?? [], null); + $this->setIfExists('allowLinkedEps', $data ?? [], null); + $this->setIfExists('shouldCompressFps', $data ?? [], null); + $this->setIfExists('autoSubmitEps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['senderId']) && (mb_strlen($this->container['senderId']) > 30)) { + $invalidProperties[] = "invalid value for 'senderId', the character length must be smaller than or equal to 30."; + } + + if (!is_null($this->container['password']) && (mb_strlen($this->container['password']) > 200)) { + $invalidProperties[] = "invalid value for 'password', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['overrideTimestampValue']) && (mb_strlen($this->container['overrideTimestampValue']) > 25)) { + $invalidProperties[] = "invalid value for 'overrideTimestampValue', the character length must be smaller than or equal to 25."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets senderType + * + * @return \SynergiTech\Staffology\Model\RtiSenderType|null + */ + public function getSenderType(): ?\SynergiTech\Staffology\Model\RtiSenderType + { + return $this->container['senderType']; + } + + /** + * Sets senderType + * + * @param \SynergiTech\Staffology\Model\RtiSenderType|null $senderType senderType + * + * @return $this + */ + public function setSenderType(?\SynergiTech\Staffology\Model\RtiSenderType $senderType): static + { + if (is_null($senderType)) { + throw new InvalidArgumentException('non-nullable senderType cannot be null'); + } + $this->container['senderType'] = $senderType; + + return $this; + } + + /** + * Gets senderId + * + * @return string|null + */ + public function getSenderId(): ?string + { + return $this->container['senderId']; + } + + /** + * Sets senderId + * + * @param string|null $senderId The SenderId used to submit RTI documents to HMRC + * + * @return $this + */ + public function setSenderId(?string $senderId): static + { + if (is_null($senderId)) { + array_push($this->openAPINullablesSetToNull, 'senderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('senderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($senderId) && (mb_strlen($senderId) > 30)) { + throw new InvalidArgumentException('invalid length for $senderId when calling RtiSubmissionSettings., must be smaller than or equal to 30.'); + } + + $this->container['senderId'] = $senderId; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword(): ?string + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password The Password used to submit RTI documents to HMRC + * + * @return $this + */ + public function setPassword(?string $password): static + { + if (is_null($password)) { + array_push($this->openAPINullablesSetToNull, 'password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($password) && (mb_strlen($password) > 200)) { + throw new InvalidArgumentException('invalid length for $password when calling RtiSubmissionSettings., must be smaller than or equal to 200.'); + } + + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets excludeNilPaid + * + * @return bool|null + */ + public function getExcludeNilPaid(): ?bool + { + return $this->container['excludeNilPaid']; + } + + /** + * Sets excludeNilPaid + * + * @param bool|null $excludeNilPaid Whether or not to include Employees paid a zero amount on your FPS + * + * @return $this + */ + public function setExcludeNilPaid(?bool $excludeNilPaid): static + { + if (is_null($excludeNilPaid)) { + throw new InvalidArgumentException('non-nullable excludeNilPaid cannot be null'); + } + $this->container['excludeNilPaid'] = $excludeNilPaid; + + return $this; + } + + /** + * Gets includeHashCrossRef + * + * @return bool|null + */ + public function getIncludeHashCrossRef(): ?bool + { + return $this->container['includeHashCrossRef']; + } + + /** + * Sets includeHashCrossRef + * + * @param bool|null $includeHashCrossRef [readonly] Whether or not the Bacs Cross Ref field is included on your FPS submissions This is automatically set to true if you use a bank payments CSV format that supports it or set to false if not + * + * @return $this + */ + public function setIncludeHashCrossRef(?bool $includeHashCrossRef): static + { + if (is_null($includeHashCrossRef)) { + throw new InvalidArgumentException('non-nullable includeHashCrossRef cannot be null'); + } + $this->container['includeHashCrossRef'] = $includeHashCrossRef; + + return $this; + } + + /** + * Gets autoSubmitFps + * + * @return bool|null + */ + public function getAutoSubmitFps(): ?bool + { + return $this->container['autoSubmitFps']; + } + + /** + * Sets autoSubmitFps + * + * @param bool|null $autoSubmitFps If set to true, we'll automatically send your FPS to HMRC whenever you finalise a PayRun + * + * @return $this + */ + public function setAutoSubmitFps(?bool $autoSubmitFps): static + { + if (is_null($autoSubmitFps)) { + throw new InvalidArgumentException('non-nullable autoSubmitFps cannot be null'); + } + $this->container['autoSubmitFps'] = $autoSubmitFps; + + return $this; + } + + /** + * Gets testInLive + * + * @return bool|null + */ + public function getTestInLive(): ?bool + { + return $this->container['testInLive']; + } + + /** + * Sets testInLive + * + * @param bool|null $testInLive Used for testing the RTI gateway. If set to true then the Document Type name will have \"-TIL\" appended to it + * + * @return $this + */ + public function setTestInLive(?bool $testInLive): static + { + if (is_null($testInLive)) { + throw new InvalidArgumentException('non-nullable testInLive cannot be null'); + } + $this->container['testInLive'] = $testInLive; + + return $this; + } + + /** + * Gets useTestGateway + * + * @return bool|null + */ + public function getUseTestGateway(): ?bool + { + return $this->container['useTestGateway']; + } + + /** + * Sets useTestGateway + * + * @param bool|null $useTestGateway If set to true then your RTI documents will be sent to HMRCs test services instead of the live service + * + * @return $this + */ + public function setUseTestGateway(?bool $useTestGateway): static + { + if (is_null($useTestGateway)) { + throw new InvalidArgumentException('non-nullable useTestGateway cannot be null'); + } + $this->container['useTestGateway'] = $useTestGateway; + + return $this; + } + + /** + * Gets overrideTimestampValue + * + * @return string|null + */ + public function getOverrideTimestampValue(): ?string + { + return $this->container['overrideTimestampValue']; + } + + /** + * Sets overrideTimestampValue + * + * @param string|null $overrideTimestampValue If a value is provided then it will be used as the timestamp on the RTI submission. This would normally only be used for testing purposes. + * + * @return $this + */ + public function setOverrideTimestampValue(?string $overrideTimestampValue): static + { + if (is_null($overrideTimestampValue)) { + array_push($this->openAPINullablesSetToNull, 'overrideTimestampValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overrideTimestampValue', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($overrideTimestampValue) && (mb_strlen($overrideTimestampValue) > 25)) { + throw new InvalidArgumentException('invalid length for $overrideTimestampValue when calling RtiSubmissionSettings., must be smaller than or equal to 25.'); + } + + $this->container['overrideTimestampValue'] = $overrideTimestampValue; + + return $this; + } + + /** + * Gets contact + * + * @return \SynergiTech\Staffology\Model\RtiContact|null + */ + public function getContact(): ?\SynergiTech\Staffology\Model\RtiContact + { + return $this->container['contact']; + } + + /** + * Sets contact + * + * @param \SynergiTech\Staffology\Model\RtiContact|null $contact contact + * + * @return $this + */ + public function setContact(?\SynergiTech\Staffology\Model\RtiContact $contact): static + { + if (is_null($contact)) { + throw new InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; + + return $this; + } + + /** + * Gets agent + * + * @return \SynergiTech\Staffology\Model\RtiAgent|null + */ + public function getAgent(): ?\SynergiTech\Staffology\Model\RtiAgent + { + return $this->container['agent']; + } + + /** + * Sets agent + * + * @param \SynergiTech\Staffology\Model\RtiAgent|null $agent agent + * + * @return $this + */ + public function setAgent(?\SynergiTech\Staffology\Model\RtiAgent $agent): static + { + if (is_null($agent)) { + throw new InvalidArgumentException('non-nullable agent cannot be null'); + } + $this->container['agent'] = $agent; + + return $this; + } + + /** + * Gets allowLinkedEps + * + * @return bool|null + */ + public function getAllowLinkedEps(): ?bool + { + return $this->container['allowLinkedEps']; + } + + /** + * Sets allowLinkedEps + * + * @param bool|null $allowLinkedEps If set to true this will allow you to submit a combined Employer Payment Summary + * + * @return $this + */ + public function setAllowLinkedEps(?bool $allowLinkedEps): static + { + if (is_null($allowLinkedEps)) { + throw new InvalidArgumentException('non-nullable allowLinkedEps cannot be null'); + } + $this->container['allowLinkedEps'] = $allowLinkedEps; + + return $this; + } + + /** + * Gets shouldCompressFps + * + * @return bool|null + */ + public function getShouldCompressFps(): ?bool + { + return $this->container['shouldCompressFps']; + } + + /** + * Sets shouldCompressFps + * + * @param bool|null $shouldCompressFps If set to true this will compress the FPS before submitting to HMRC + * + * @return $this + */ + public function setShouldCompressFps(?bool $shouldCompressFps): static + { + if (is_null($shouldCompressFps)) { + throw new InvalidArgumentException('non-nullable shouldCompressFps cannot be null'); + } + $this->container['shouldCompressFps'] = $shouldCompressFps; + + return $this; + } + + /** + * Gets autoSubmitEps + * + * @return bool|null + */ + public function getAutoSubmitEps(): ?bool + { + return $this->container['autoSubmitEps']; + } + + /** + * Sets autoSubmitEps + * + * @param bool|null $autoSubmitEps If set to true, we'll automatically send your EPS to HMRC whenever you finalise a PayRun. + * + * @return $this + */ + public function setAutoSubmitEps(?bool $autoSubmitEps): static + { + if (is_null($autoSubmitEps)) { + throw new InvalidArgumentException('non-nullable autoSubmitEps cannot be null'); + } + $this->container['autoSubmitEps'] = $autoSubmitEps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiValidationWarning.php b/src/Model/RtiValidationWarning.php new file mode 100644 index 0000000..9ee1ced --- /dev/null +++ b/src/Model/RtiValidationWarning.php @@ -0,0 +1,449 @@ + + */ +class RtiValidationWarning implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RtiValidationWarning'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\RtiValidationWarningType', + 'employeeId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'employeeId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'employeeId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'employeeId' => 'employeeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'employeeId' => 'setEmployeeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'employeeId' => 'getEmployeeId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('employeeId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\RtiValidationWarningType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\RtiValidationWarningType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\RtiValidationWarningType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\RtiValidationWarningType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets employeeId + * + * @return string|null + */ + public function getEmployeeId(): ?string + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param string|null $employeeId employeeId + * + * @return $this + */ + public function setEmployeeId(?string $employeeId): static + { + if (is_null($employeeId)) { + array_push($this->openAPINullablesSetToNull, 'employeeId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RtiValidationWarningType.php b/src/Model/RtiValidationWarningType.php new file mode 100644 index 0000000..68f227e --- /dev/null +++ b/src/Model/RtiValidationWarningType.php @@ -0,0 +1,45 @@ + + */ +class ServiceBand implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ServiceBand'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'description' => 'string', + 'from' => 'int', + 'to' => 'int', + 'entitlementBands' => '\SynergiTech\Staffology\Model\EntitlementBand[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'description' => null, + 'from' => 'int32', + 'to' => 'int32', + 'entitlementBands' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'description' => true, + 'from' => false, + 'to' => false, + 'entitlementBands' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'description' => 'description', + 'from' => 'from', + 'to' => 'to', + 'entitlementBands' => 'entitlementBands', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'description' => 'setDescription', + 'from' => 'setFrom', + 'to' => 'setTo', + 'entitlementBands' => 'setEntitlementBands', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'description' => 'getDescription', + 'from' => 'getFrom', + 'to' => 'getTo', + 'entitlementBands' => 'getEntitlementBands', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('entitlementBands', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets from + * + * @return int|null + */ + public function getFrom(): ?int + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param int|null $from from + * + * @return $this + */ + public function setFrom(?int $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return int|null + */ + public function getTo(): ?int + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param int|null $to to + * + * @return $this + */ + public function setTo(?int $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets entitlementBands + * + * @return \SynergiTech\Staffology\Model\EntitlementBand[]|null + */ + public function getEntitlementBands(): ?array + { + return $this->container['entitlementBands']; + } + + /** + * Sets entitlementBands + * + * @param \SynergiTech\Staffology\Model\EntitlementBand[]|null $entitlementBands entitlementBands + * + * @return $this + */ + public function setEntitlementBands(?array $entitlementBands): static + { + if (is_null($entitlementBands)) { + array_push($this->openAPINullablesSetToNull, 'entitlementBands'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entitlementBands', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entitlementBands'] = $entitlementBands; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ShiftWorkingPatternDay.php b/src/Model/ShiftWorkingPatternDay.php new file mode 100644 index 0000000..33c2898 --- /dev/null +++ b/src/Model/ShiftWorkingPatternDay.php @@ -0,0 +1,510 @@ + + */ +class ShiftWorkingPatternDay implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ShiftWorkingPatternDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'day' => 'int', + 'isWorkingDay' => 'bool', + 'hours' => 'float', + 'workingPatternHoursType' => '\SynergiTech\Staffology\Model\WorkingPatternHoursType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'day' => 'int32', + 'isWorkingDay' => null, + 'hours' => 'double', + 'workingPatternHoursType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'day' => false, + 'isWorkingDay' => false, + 'hours' => false, + 'workingPatternHoursType' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'day' => 'day', + 'isWorkingDay' => 'isWorkingDay', + 'hours' => 'hours', + 'workingPatternHoursType' => 'workingPatternHoursType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'day' => 'setDay', + 'isWorkingDay' => 'setIsWorkingDay', + 'hours' => 'setHours', + 'workingPatternHoursType' => 'setWorkingPatternHoursType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'day' => 'getDay', + 'isWorkingDay' => 'getIsWorkingDay', + 'hours' => 'getHours', + 'workingPatternHoursType' => 'getWorkingPatternHoursType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('isWorkingDay', $data ?? [], null); + $this->setIfExists('hours', $data ?? [], null); + $this->setIfExists('workingPatternHoursType', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets day + * + * @return int|null + */ + public function getDay(): ?int + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int|null $day day + * + * @return $this + */ + public function setDay(?int $day): static + { + if (is_null($day)) { + throw new InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets isWorkingDay + * + * @return bool|null + */ + public function getIsWorkingDay(): ?bool + { + return $this->container['isWorkingDay']; + } + + /** + * Sets isWorkingDay + * + * @param bool|null $isWorkingDay isWorkingDay + * + * @return $this + */ + public function setIsWorkingDay(?bool $isWorkingDay): static + { + if (is_null($isWorkingDay)) { + throw new InvalidArgumentException('non-nullable isWorkingDay cannot be null'); + } + $this->container['isWorkingDay'] = $isWorkingDay; + + return $this; + } + + /** + * Gets hours + * + * @return float|null + */ + public function getHours(): ?float + { + return $this->container['hours']; + } + + /** + * Sets hours + * + * @param float|null $hours hours + * + * @return $this + */ + public function setHours(?float $hours): static + { + if (is_null($hours)) { + throw new InvalidArgumentException('non-nullable hours cannot be null'); + } + $this->container['hours'] = $hours; + + return $this; + } + + /** + * Gets workingPatternHoursType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternHoursType|null + */ + public function getWorkingPatternHoursType(): ?\SynergiTech\Staffology\Model\WorkingPatternHoursType + { + return $this->container['workingPatternHoursType']; + } + + /** + * Sets workingPatternHoursType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternHoursType|null $workingPatternHoursType workingPatternHoursType + * + * @return $this + */ + public function setWorkingPatternHoursType(?\SynergiTech\Staffology\Model\WorkingPatternHoursType $workingPatternHoursType): static + { + if (is_null($workingPatternHoursType)) { + throw new InvalidArgumentException('non-nullable workingPatternHoursType cannot be null'); + } + $this->container['workingPatternHoursType'] = $workingPatternHoursType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SmtpEncryption.php b/src/Model/SmtpEncryption.php new file mode 100644 index 0000000..cec5ba1 --- /dev/null +++ b/src/Model/SmtpEncryption.php @@ -0,0 +1,47 @@ + + */ +class SmtpSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SmtpSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'smtpServer' => 'string', + 'smtpPort' => 'int', + 'encryption' => '\SynergiTech\Staffology\Model\SmtpEncryption', + 'smtpUsername' => 'string', + 'smtpPassword' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'smtpServer' => null, + 'smtpPort' => 'int32', + 'encryption' => null, + 'smtpUsername' => null, + 'smtpPassword' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'smtpServer' => true, + 'smtpPort' => false, + 'encryption' => false, + 'smtpUsername' => true, + 'smtpPassword' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'smtpServer' => 'smtpServer', + 'smtpPort' => 'smtpPort', + 'encryption' => 'encryption', + 'smtpUsername' => 'smtpUsername', + 'smtpPassword' => 'smtpPassword' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'smtpServer' => 'setSmtpServer', + 'smtpPort' => 'setSmtpPort', + 'encryption' => 'setEncryption', + 'smtpUsername' => 'setSmtpUsername', + 'smtpPassword' => 'setSmtpPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'smtpServer' => 'getSmtpServer', + 'smtpPort' => 'getSmtpPort', + 'encryption' => 'getEncryption', + 'smtpUsername' => 'getSmtpUsername', + 'smtpPassword' => 'getSmtpPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('smtpServer', $data ?? [], null); + $this->setIfExists('smtpPort', $data ?? [], null); + $this->setIfExists('encryption', $data ?? [], null); + $this->setIfExists('smtpUsername', $data ?? [], null); + $this->setIfExists('smtpPassword', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets smtpServer + * + * @return string|null + */ + public function getSmtpServer(): ?string + { + return $this->container['smtpServer']; + } + + /** + * Sets smtpServer + * + * @param string|null $smtpServer smtpServer + * + * @return $this + */ + public function setSmtpServer(?string $smtpServer): static + { + if (is_null($smtpServer)) { + array_push($this->openAPINullablesSetToNull, 'smtpServer'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('smtpServer', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['smtpServer'] = $smtpServer; + + return $this; + } + + /** + * Gets smtpPort + * + * @return int|null + */ + public function getSmtpPort(): ?int + { + return $this->container['smtpPort']; + } + + /** + * Sets smtpPort + * + * @param int|null $smtpPort smtpPort + * + * @return $this + */ + public function setSmtpPort(?int $smtpPort): static + { + if (is_null($smtpPort)) { + throw new InvalidArgumentException('non-nullable smtpPort cannot be null'); + } + $this->container['smtpPort'] = $smtpPort; + + return $this; + } + + /** + * Gets encryption + * + * @return \SynergiTech\Staffology\Model\SmtpEncryption|null + */ + public function getEncryption(): ?\SynergiTech\Staffology\Model\SmtpEncryption + { + return $this->container['encryption']; + } + + /** + * Sets encryption + * + * @param \SynergiTech\Staffology\Model\SmtpEncryption|null $encryption encryption + * + * @return $this + */ + public function setEncryption(?\SynergiTech\Staffology\Model\SmtpEncryption $encryption): static + { + if (is_null($encryption)) { + throw new InvalidArgumentException('non-nullable encryption cannot be null'); + } + $this->container['encryption'] = $encryption; + + return $this; + } + + /** + * Gets smtpUsername + * + * @return string|null + */ + public function getSmtpUsername(): ?string + { + return $this->container['smtpUsername']; + } + + /** + * Sets smtpUsername + * + * @param string|null $smtpUsername smtpUsername + * + * @return $this + */ + public function setSmtpUsername(?string $smtpUsername): static + { + if (is_null($smtpUsername)) { + array_push($this->openAPINullablesSetToNull, 'smtpUsername'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('smtpUsername', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['smtpUsername'] = $smtpUsername; + + return $this; + } + + /** + * Gets smtpPassword + * + * @return string|null + */ + public function getSmtpPassword(): ?string + { + return $this->container['smtpPassword']; + } + + /** + * Sets smtpPassword + * + * @param string|null $smtpPassword smtpPassword + * + * @return $this + */ + public function setSmtpPassword(?string $smtpPassword): static + { + if (is_null($smtpPassword)) { + array_push($this->openAPINullablesSetToNull, 'smtpPassword'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('smtpPassword', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['smtpPassword'] = $smtpPassword; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SpinePointReport.php b/src/Model/SpinePointReport.php new file mode 100644 index 0000000..e903c3c --- /dev/null +++ b/src/Model/SpinePointReport.php @@ -0,0 +1,558 @@ + + */ +class SpinePointReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SpinePointReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\SpinePointReportLine[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\SpinePointReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\SpinePointReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SpinePointReportLine.php b/src/Model/SpinePointReportLine.php new file mode 100644 index 0000000..2394916 --- /dev/null +++ b/src/Model/SpinePointReportLine.php @@ -0,0 +1,961 @@ + + */ +class SpinePointReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SpinePointReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'spineName' => 'string', + 'spinePointName' => 'string', + 'number' => 'int', + 'effectiveDate' => '\DateTime', + 'annualValue' => 'float', + 'annualValueAltMax' => 'float', + 'annualValueLAInner' => 'float', + 'annualValueLAInnerAltMax' => 'float', + 'annualValueLAOuter' => 'float', + 'annualValueLAOuterAltMax' => 'float', + 'annualValueLAFringe' => 'float', + 'annualValueLAFringeAltMax' => 'float', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'spineName' => null, + 'spinePointName' => null, + 'number' => 'int32', + 'effectiveDate' => 'date', + 'annualValue' => 'double', + 'annualValueAltMax' => 'double', + 'annualValueLAInner' => 'double', + 'annualValueLAInnerAltMax' => 'double', + 'annualValueLAOuter' => 'double', + 'annualValueLAOuterAltMax' => 'double', + 'annualValueLAFringe' => 'double', + 'annualValueLAFringeAltMax' => 'double', + 'employee' => null, + 'payrollCode' => null, + 'department' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'spineName' => true, + 'spinePointName' => true, + 'number' => false, + 'effectiveDate' => false, + 'annualValue' => false, + 'annualValueAltMax' => true, + 'annualValueLAInner' => true, + 'annualValueLAInnerAltMax' => true, + 'annualValueLAOuter' => true, + 'annualValueLAOuterAltMax' => true, + 'annualValueLAFringe' => true, + 'annualValueLAFringeAltMax' => true, + 'employee' => false, + 'payrollCode' => true, + 'department' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'spineName' => 'spineName', + 'spinePointName' => 'spinePointName', + 'number' => 'number', + 'effectiveDate' => 'effectiveDate', + 'annualValue' => 'annualValue', + 'annualValueAltMax' => 'annualValueAltMax', + 'annualValueLAInner' => 'annualValueLAInner', + 'annualValueLAInnerAltMax' => 'annualValueLAInnerAltMax', + 'annualValueLAOuter' => 'annualValueLAOuter', + 'annualValueLAOuterAltMax' => 'annualValueLAOuterAltMax', + 'annualValueLAFringe' => 'annualValueLAFringe', + 'annualValueLAFringeAltMax' => 'annualValueLAFringeAltMax', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'spineName' => 'setSpineName', + 'spinePointName' => 'setSpinePointName', + 'number' => 'setNumber', + 'effectiveDate' => 'setEffectiveDate', + 'annualValue' => 'setAnnualValue', + 'annualValueAltMax' => 'setAnnualValueAltMax', + 'annualValueLAInner' => 'setAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'setAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'setAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'setAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'setAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'setAnnualValueLAFringeAltMax', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'spineName' => 'getSpineName', + 'spinePointName' => 'getSpinePointName', + 'number' => 'getNumber', + 'effectiveDate' => 'getEffectiveDate', + 'annualValue' => 'getAnnualValue', + 'annualValueAltMax' => 'getAnnualValueAltMax', + 'annualValueLAInner' => 'getAnnualValueLAInner', + 'annualValueLAInnerAltMax' => 'getAnnualValueLAInnerAltMax', + 'annualValueLAOuter' => 'getAnnualValueLAOuter', + 'annualValueLAOuterAltMax' => 'getAnnualValueLAOuterAltMax', + 'annualValueLAFringe' => 'getAnnualValueLAFringe', + 'annualValueLAFringeAltMax' => 'getAnnualValueLAFringeAltMax', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('spineName', $data ?? [], null); + $this->setIfExists('spinePointName', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('effectiveDate', $data ?? [], null); + $this->setIfExists('annualValue', $data ?? [], null); + $this->setIfExists('annualValueAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAInner', $data ?? [], null); + $this->setIfExists('annualValueLAInnerAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAOuter', $data ?? [], null); + $this->setIfExists('annualValueLAOuterAltMax', $data ?? [], null); + $this->setIfExists('annualValueLAFringe', $data ?? [], null); + $this->setIfExists('annualValueLAFringeAltMax', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spineName + * + * @return string|null + */ + public function getSpineName(): ?string + { + return $this->container['spineName']; + } + + /** + * Sets spineName + * + * @param string|null $spineName Spine Name + * + * @return $this + */ + public function setSpineName(?string $spineName): static + { + if (is_null($spineName)) { + array_push($this->openAPINullablesSetToNull, 'spineName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spineName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spineName'] = $spineName; + + return $this; + } + + /** + * Gets spinePointName + * + * @return string|null + */ + public function getSpinePointName(): ?string + { + return $this->container['spinePointName']; + } + + /** + * Sets spinePointName + * + * @param string|null $spinePointName Spine Point Name + * + * @return $this + */ + public function setSpinePointName(?string $spinePointName): static + { + if (is_null($spinePointName)) { + array_push($this->openAPINullablesSetToNull, 'spinePointName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('spinePointName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['spinePointName'] = $spinePointName; + + return $this; + } + + /** + * Gets number + * + * @return int|null + */ + public function getNumber(): ?int + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param int|null $number Spine Point Number + * + * @return $this + */ + public function setNumber(?int $number): static + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets effectiveDate + * + * @return \DateTime|null + */ + public function getEffectiveDate(): ?\DateTime + { + return $this->container['effectiveDate']; + } + + /** + * Sets effectiveDate + * + * @param \DateTime|null $effectiveDate Effective Date of spine point + * + * @return $this + */ + public function setEffectiveDate(?\DateTime $effectiveDate): static + { + if (is_null($effectiveDate)) { + throw new InvalidArgumentException('non-nullable effectiveDate cannot be null'); + } + $this->container['effectiveDate'] = $effectiveDate; + + return $this; + } + + /** + * Gets annualValue + * + * @return float|null + */ + public function getAnnualValue(): ?float + { + return $this->container['annualValue']; + } + + /** + * Sets annualValue + * + * @param float|null $annualValue Annual Value of spine point + * + * @return $this + */ + public function setAnnualValue(?float $annualValue): static + { + if (is_null($annualValue)) { + throw new InvalidArgumentException('non-nullable annualValue cannot be null'); + } + $this->container['annualValue'] = $annualValue; + + return $this; + } + + /** + * Gets annualValueAltMax + * + * @return float|null + */ + public function getAnnualValueAltMax(): ?float + { + return $this->container['annualValueAltMax']; + } + + /** + * Sets annualValueAltMax + * + * @param float|null $annualValueAltMax Alt Max Annual Value of spine point + * + * @return $this + */ + public function setAnnualValueAltMax(?float $annualValueAltMax): static + { + if (is_null($annualValueAltMax)) { + array_push($this->openAPINullablesSetToNull, 'annualValueAltMax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueAltMax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueAltMax'] = $annualValueAltMax; + + return $this; + } + + /** + * Gets annualValueLAInner + * + * @return float|null + */ + public function getAnnualValueLAInner(): ?float + { + return $this->container['annualValueLAInner']; + } + + /** + * Sets annualValueLAInner + * + * @param float|null $annualValueLAInner Annual Value LA Inner of spine point + * + * @return $this + */ + public function setAnnualValueLAInner(?float $annualValueLAInner): static + { + if (is_null($annualValueLAInner)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAInner'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAInner', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAInner'] = $annualValueLAInner; + + return $this; + } + + /** + * Gets annualValueLAInnerAltMax + * + * @return float|null + */ + public function getAnnualValueLAInnerAltMax(): ?float + { + return $this->container['annualValueLAInnerAltMax']; + } + + /** + * Sets annualValueLAInnerAltMax + * + * @param float|null $annualValueLAInnerAltMax Annual Value LA Inner Alt Max of spine point + * + * @return $this + */ + public function setAnnualValueLAInnerAltMax(?float $annualValueLAInnerAltMax): static + { + if (is_null($annualValueLAInnerAltMax)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAInnerAltMax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAInnerAltMax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAInnerAltMax'] = $annualValueLAInnerAltMax; + + return $this; + } + + /** + * Gets annualValueLAOuter + * + * @return float|null + */ + public function getAnnualValueLAOuter(): ?float + { + return $this->container['annualValueLAOuter']; + } + + /** + * Sets annualValueLAOuter + * + * @param float|null $annualValueLAOuter Annual Value LA Outer of spine point + * + * @return $this + */ + public function setAnnualValueLAOuter(?float $annualValueLAOuter): static + { + if (is_null($annualValueLAOuter)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAOuter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAOuter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAOuter'] = $annualValueLAOuter; + + return $this; + } + + /** + * Gets annualValueLAOuterAltMax + * + * @return float|null + */ + public function getAnnualValueLAOuterAltMax(): ?float + { + return $this->container['annualValueLAOuterAltMax']; + } + + /** + * Sets annualValueLAOuterAltMax + * + * @param float|null $annualValueLAOuterAltMax Annual Value LA Outer Alt Max of spine point + * + * @return $this + */ + public function setAnnualValueLAOuterAltMax(?float $annualValueLAOuterAltMax): static + { + if (is_null($annualValueLAOuterAltMax)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAOuterAltMax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAOuterAltMax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAOuterAltMax'] = $annualValueLAOuterAltMax; + + return $this; + } + + /** + * Gets annualValueLAFringe + * + * @return float|null + */ + public function getAnnualValueLAFringe(): ?float + { + return $this->container['annualValueLAFringe']; + } + + /** + * Sets annualValueLAFringe + * + * @param float|null $annualValueLAFringe Annual Value LA Fringe of spine point + * + * @return $this + */ + public function setAnnualValueLAFringe(?float $annualValueLAFringe): static + { + if (is_null($annualValueLAFringe)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAFringe'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAFringe', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAFringe'] = $annualValueLAFringe; + + return $this; + } + + /** + * Gets annualValueLAFringeAltMax + * + * @return float|null + */ + public function getAnnualValueLAFringeAltMax(): ?float + { + return $this->container['annualValueLAFringeAltMax']; + } + + /** + * Sets annualValueLAFringeAltMax + * + * @param float|null $annualValueLAFringeAltMax Annual Value LA Fringe Alt Max of spine point + * + * @return $this + */ + public function setAnnualValueLAFringeAltMax(?float $annualValueLAFringeAltMax): static + { + if (is_null($annualValueLAFringeAltMax)) { + array_push($this->openAPINullablesSetToNull, 'annualValueLAFringeAltMax'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('annualValueLAFringeAltMax', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['annualValueLAFringeAltMax'] = $annualValueLAFringeAltMax; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SpinePointReportReportResponse.php b/src/Model/SpinePointReportReportResponse.php new file mode 100644 index 0000000..a2d1b90 --- /dev/null +++ b/src/Model/SpinePointReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class SpinePointReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SpinePointReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\SpinePointReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\SpinePointReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\SpinePointReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\SpinePointReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\SpinePointReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StarterDeclaration.php b/src/Model/StarterDeclaration.php new file mode 100644 index 0000000..51bd62b --- /dev/null +++ b/src/Model/StarterDeclaration.php @@ -0,0 +1,49 @@ + + */ +class StarterDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StarterDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'startDate' => '\DateTime', + 'starterDeclaration' => '\SynergiTech\Staffology\Model\StarterDeclaration', + 'overseasEmployerDetails' => '\SynergiTech\Staffology\Model\OverseasEmployerDetails', + 'pensionerPayroll' => '\SynergiTech\Staffology\Model\PensionerPayroll' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'startDate' => 'date', + 'starterDeclaration' => null, + 'overseasEmployerDetails' => null, + 'pensionerPayroll' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'startDate' => false, + 'starterDeclaration' => false, + 'overseasEmployerDetails' => false, + 'pensionerPayroll' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'startDate' => 'startDate', + 'starterDeclaration' => 'starterDeclaration', + 'overseasEmployerDetails' => 'overseasEmployerDetails', + 'pensionerPayroll' => 'pensionerPayroll' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'startDate' => 'setStartDate', + 'starterDeclaration' => 'setStarterDeclaration', + 'overseasEmployerDetails' => 'setOverseasEmployerDetails', + 'pensionerPayroll' => 'setPensionerPayroll' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'startDate' => 'getStartDate', + 'starterDeclaration' => 'getStarterDeclaration', + 'overseasEmployerDetails' => 'getOverseasEmployerDetails', + 'pensionerPayroll' => 'getPensionerPayroll' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('starterDeclaration', $data ?? [], null); + $this->setIfExists('overseasEmployerDetails', $data ?? [], null); + $this->setIfExists('pensionerPayroll', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['startDate'] === null) { + $invalidProperties[] = "'startDate' can't be null"; + } + if ($this->container['starterDeclaration'] === null) { + $invalidProperties[] = "'starterDeclaration' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets startDate + * + * @return \DateTime + */ + public function getStartDate(): \DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime $startDate startDate + * + * @return $this + */ + public function setStartDate(\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets starterDeclaration + * + * @return \SynergiTech\Staffology\Model\StarterDeclaration + */ + public function getStarterDeclaration(): \SynergiTech\Staffology\Model\StarterDeclaration + { + return $this->container['starterDeclaration']; + } + + /** + * Sets starterDeclaration + * + * @param \SynergiTech\Staffology\Model\StarterDeclaration $starterDeclaration starterDeclaration + * + * @return $this + */ + public function setStarterDeclaration(\SynergiTech\Staffology\Model\StarterDeclaration $starterDeclaration): static + { + if (is_null($starterDeclaration)) { + throw new InvalidArgumentException('non-nullable starterDeclaration cannot be null'); + } + $this->container['starterDeclaration'] = $starterDeclaration; + + return $this; + } + + /** + * Gets overseasEmployerDetails + * + * @return \SynergiTech\Staffology\Model\OverseasEmployerDetails|null + */ + public function getOverseasEmployerDetails(): ?\SynergiTech\Staffology\Model\OverseasEmployerDetails + { + return $this->container['overseasEmployerDetails']; + } + + /** + * Sets overseasEmployerDetails + * + * @param \SynergiTech\Staffology\Model\OverseasEmployerDetails|null $overseasEmployerDetails overseasEmployerDetails + * + * @return $this + */ + public function setOverseasEmployerDetails(?\SynergiTech\Staffology\Model\OverseasEmployerDetails $overseasEmployerDetails): static + { + if (is_null($overseasEmployerDetails)) { + throw new InvalidArgumentException('non-nullable overseasEmployerDetails cannot be null'); + } + $this->container['overseasEmployerDetails'] = $overseasEmployerDetails; + + return $this; + } + + /** + * Gets pensionerPayroll + * + * @return \SynergiTech\Staffology\Model\PensionerPayroll|null + */ + public function getPensionerPayroll(): ?\SynergiTech\Staffology\Model\PensionerPayroll + { + return $this->container['pensionerPayroll']; + } + + /** + * Sets pensionerPayroll + * + * @param \SynergiTech\Staffology\Model\PensionerPayroll|null $pensionerPayroll pensionerPayroll + * + * @return $this + */ + public function setPensionerPayroll(?\SynergiTech\Staffology\Model\PensionerPayroll $pensionerPayroll): static + { + if (is_null($pensionerPayroll)) { + throw new InvalidArgumentException('non-nullable pensionerPayroll cannot be null'); + } + $this->container['pensionerPayroll'] = $pensionerPayroll; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StartersLeaversFilter.php b/src/Model/StartersLeaversFilter.php new file mode 100644 index 0000000..1460fb9 --- /dev/null +++ b/src/Model/StartersLeaversFilter.php @@ -0,0 +1,45 @@ + + */ +class StatutoryPay implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StatutoryPay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'weeklyParentalLeaveAmount' => 'float', + 'weeklySickPayAmount' => 'float', + 'aweEligibilityThreshold' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'weeklyParentalLeaveAmount' => 'double', + 'weeklySickPayAmount' => 'double', + 'aweEligibilityThreshold' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'weeklyParentalLeaveAmount' => false, + 'weeklySickPayAmount' => false, + 'aweEligibilityThreshold' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'weeklyParentalLeaveAmount' => 'weeklyParentalLeaveAmount', + 'weeklySickPayAmount' => 'weeklySickPayAmount', + 'aweEligibilityThreshold' => 'aweEligibilityThreshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'weeklyParentalLeaveAmount' => 'setWeeklyParentalLeaveAmount', + 'weeklySickPayAmount' => 'setWeeklySickPayAmount', + 'aweEligibilityThreshold' => 'setAweEligibilityThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'weeklyParentalLeaveAmount' => 'getWeeklyParentalLeaveAmount', + 'weeklySickPayAmount' => 'getWeeklySickPayAmount', + 'aweEligibilityThreshold' => 'getAweEligibilityThreshold' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('weeklyParentalLeaveAmount', $data ?? [], null); + $this->setIfExists('weeklySickPayAmount', $data ?? [], null); + $this->setIfExists('aweEligibilityThreshold', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets weeklyParentalLeaveAmount + * + * @return float|null + */ + public function getWeeklyParentalLeaveAmount(): ?float + { + return $this->container['weeklyParentalLeaveAmount']; + } + + /** + * Sets weeklyParentalLeaveAmount + * + * @param float|null $weeklyParentalLeaveAmount [readonly] + * + * @return $this + */ + public function setWeeklyParentalLeaveAmount(?float $weeklyParentalLeaveAmount): static + { + if (is_null($weeklyParentalLeaveAmount)) { + throw new InvalidArgumentException('non-nullable weeklyParentalLeaveAmount cannot be null'); + } + $this->container['weeklyParentalLeaveAmount'] = $weeklyParentalLeaveAmount; + + return $this; + } + + /** + * Gets weeklySickPayAmount + * + * @return float|null + */ + public function getWeeklySickPayAmount(): ?float + { + return $this->container['weeklySickPayAmount']; + } + + /** + * Sets weeklySickPayAmount + * + * @param float|null $weeklySickPayAmount [readonly] + * + * @return $this + */ + public function setWeeklySickPayAmount(?float $weeklySickPayAmount): static + { + if (is_null($weeklySickPayAmount)) { + throw new InvalidArgumentException('non-nullable weeklySickPayAmount cannot be null'); + } + $this->container['weeklySickPayAmount'] = $weeklySickPayAmount; + + return $this; + } + + /** + * Gets aweEligibilityThreshold + * + * @return float|null + */ + public function getAweEligibilityThreshold(): ?float + { + return $this->container['aweEligibilityThreshold']; + } + + /** + * Sets aweEligibilityThreshold + * + * @param float|null $aweEligibilityThreshold aweEligibilityThreshold + * + * @return $this + */ + public function setAweEligibilityThreshold(?float $aweEligibilityThreshold): static + { + if (is_null($aweEligibilityThreshold)) { + throw new InvalidArgumentException('non-nullable aweEligibilityThreshold cannot be null'); + } + $this->container['aweEligibilityThreshold'] = $aweEligibilityThreshold; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StatutoryPayReport.php b/src/Model/StatutoryPayReport.php new file mode 100644 index 0000000..e9e3fff --- /dev/null +++ b/src/Model/StatutoryPayReport.php @@ -0,0 +1,878 @@ + + */ +class StatutoryPayReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StatutoryPayReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\StatutoryPayReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\StatutoryPayReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\StatutoryPayReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StatutoryPayReportLine.php b/src/Model/StatutoryPayReportLine.php new file mode 100644 index 0000000..3a8792a --- /dev/null +++ b/src/Model/StatutoryPayReportLine.php @@ -0,0 +1,762 @@ + + */ +class StatutoryPayReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StatutoryPayReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'department' => 'string', + 'ssp' => 'float', + 'smp' => 'float', + 'spp' => 'float', + 'sap' => 'float', + 'shpp' => 'float', + 'spbp' => 'float', + 'hasStatPay' => 'bool', + 'totalStatPay' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'payrollCode' => null, + 'department' => null, + 'ssp' => 'double', + 'smp' => 'double', + 'spp' => 'double', + 'sap' => 'double', + 'shpp' => 'double', + 'spbp' => 'double', + 'hasStatPay' => null, + 'totalStatPay' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'payrollCode' => true, + 'department' => true, + 'ssp' => false, + 'smp' => false, + 'spp' => false, + 'sap' => false, + 'shpp' => false, + 'spbp' => false, + 'hasStatPay' => false, + 'totalStatPay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'department' => 'department', + 'ssp' => 'ssp', + 'smp' => 'smp', + 'spp' => 'spp', + 'sap' => 'sap', + 'shpp' => 'shpp', + 'spbp' => 'spbp', + 'hasStatPay' => 'hasStatPay', + 'totalStatPay' => 'totalStatPay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment', + 'ssp' => 'setSsp', + 'smp' => 'setSmp', + 'spp' => 'setSpp', + 'sap' => 'setSap', + 'shpp' => 'setShpp', + 'spbp' => 'setSpbp', + 'hasStatPay' => 'setHasStatPay', + 'totalStatPay' => 'setTotalStatPay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment', + 'ssp' => 'getSsp', + 'smp' => 'getSmp', + 'spp' => 'getSpp', + 'sap' => 'getSap', + 'shpp' => 'getShpp', + 'spbp' => 'getSpbp', + 'hasStatPay' => 'getHasStatPay', + 'totalStatPay' => 'getTotalStatPay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('ssp', $data ?? [], null); + $this->setIfExists('smp', $data ?? [], null); + $this->setIfExists('spp', $data ?? [], null); + $this->setIfExists('sap', $data ?? [], null); + $this->setIfExists('shpp', $data ?? [], null); + $this->setIfExists('spbp', $data ?? [], null); + $this->setIfExists('hasStatPay', $data ?? [], null); + $this->setIfExists('totalStatPay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets ssp + * + * @return float|null + */ + public function getSsp(): ?float + { + return $this->container['ssp']; + } + + /** + * Sets ssp + * + * @param float|null $ssp ssp + * + * @return $this + */ + public function setSsp(?float $ssp): static + { + if (is_null($ssp)) { + throw new InvalidArgumentException('non-nullable ssp cannot be null'); + } + $this->container['ssp'] = $ssp; + + return $this; + } + + /** + * Gets smp + * + * @return float|null + */ + public function getSmp(): ?float + { + return $this->container['smp']; + } + + /** + * Sets smp + * + * @param float|null $smp smp + * + * @return $this + */ + public function setSmp(?float $smp): static + { + if (is_null($smp)) { + throw new InvalidArgumentException('non-nullable smp cannot be null'); + } + $this->container['smp'] = $smp; + + return $this; + } + + /** + * Gets spp + * + * @return float|null + */ + public function getSpp(): ?float + { + return $this->container['spp']; + } + + /** + * Sets spp + * + * @param float|null $spp spp + * + * @return $this + */ + public function setSpp(?float $spp): static + { + if (is_null($spp)) { + throw new InvalidArgumentException('non-nullable spp cannot be null'); + } + $this->container['spp'] = $spp; + + return $this; + } + + /** + * Gets sap + * + * @return float|null + */ + public function getSap(): ?float + { + return $this->container['sap']; + } + + /** + * Sets sap + * + * @param float|null $sap sap + * + * @return $this + */ + public function setSap(?float $sap): static + { + if (is_null($sap)) { + throw new InvalidArgumentException('non-nullable sap cannot be null'); + } + $this->container['sap'] = $sap; + + return $this; + } + + /** + * Gets shpp + * + * @return float|null + */ + public function getShpp(): ?float + { + return $this->container['shpp']; + } + + /** + * Sets shpp + * + * @param float|null $shpp shpp + * + * @return $this + */ + public function setShpp(?float $shpp): static + { + if (is_null($shpp)) { + throw new InvalidArgumentException('non-nullable shpp cannot be null'); + } + $this->container['shpp'] = $shpp; + + return $this; + } + + /** + * Gets spbp + * + * @return float|null + */ + public function getSpbp(): ?float + { + return $this->container['spbp']; + } + + /** + * Sets spbp + * + * @param float|null $spbp spbp + * + * @return $this + */ + public function setSpbp(?float $spbp): static + { + if (is_null($spbp)) { + throw new InvalidArgumentException('non-nullable spbp cannot be null'); + } + $this->container['spbp'] = $spbp; + + return $this; + } + + /** + * Gets hasStatPay + * + * @return bool|null + */ + public function getHasStatPay(): ?bool + { + return $this->container['hasStatPay']; + } + + /** + * Sets hasStatPay + * + * @param bool|null $hasStatPay hasStatPay + * + * @return $this + */ + public function setHasStatPay(?bool $hasStatPay): static + { + if (is_null($hasStatPay)) { + throw new InvalidArgumentException('non-nullable hasStatPay cannot be null'); + } + $this->container['hasStatPay'] = $hasStatPay; + + return $this; + } + + /** + * Gets totalStatPay + * + * @return float|null + */ + public function getTotalStatPay(): ?float + { + return $this->container['totalStatPay']; + } + + /** + * Sets totalStatPay + * + * @param float|null $totalStatPay totalStatPay + * + * @return $this + */ + public function setTotalStatPay(?float $totalStatPay): static + { + if (is_null($totalStatPay)) { + throw new InvalidArgumentException('non-nullable totalStatPay cannot be null'); + } + $this->container['totalStatPay'] = $totalStatPay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StatutoryPayReportReportResponse.php b/src/Model/StatutoryPayReportReportResponse.php new file mode 100644 index 0000000..dbacdf4 --- /dev/null +++ b/src/Model/StatutoryPayReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class StatutoryPayReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StatutoryPayReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\StatutoryPayReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\StatutoryPayReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\StatutoryPayReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\StatutoryPayReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\StatutoryPayReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StringDecimalKeyValuePair.php b/src/Model/StringDecimalKeyValuePair.php new file mode 100644 index 0000000..9cee15e --- /dev/null +++ b/src/Model/StringDecimalKeyValuePair.php @@ -0,0 +1,449 @@ + + */ +class StringDecimalKeyValuePair implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StringDecimalKeyValuePair'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'key' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'key' => null, + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'key' => true, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'key' => 'key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'key' => 'setKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'key' => 'getKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string|null + */ + public function getKey(): ?string + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key key + * + * @return $this + */ + public function setKey(?string $key): static + { + if (is_null($key)) { + array_push($this->openAPINullablesSetToNull, 'key'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('key', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StringStringKeyValuePair.php b/src/Model/StringStringKeyValuePair.php new file mode 100644 index 0000000..f47044d --- /dev/null +++ b/src/Model/StringStringKeyValuePair.php @@ -0,0 +1,456 @@ + + */ +class StringStringKeyValuePair implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StringStringKeyValuePair'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'key' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'key' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'key' => true, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'key' => 'key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'key' => 'setKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'key' => 'getKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string|null + */ + public function getKey(): ?string + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key key + * + * @return $this + */ + public function setKey(?string $key): static + { + if (is_null($key)) { + array_push($this->openAPINullablesSetToNull, 'key'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('key', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return $this + */ + public function setValue(?string $value): static + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StudentLoan.php b/src/Model/StudentLoan.php new file mode 100644 index 0000000..eec7b3d --- /dev/null +++ b/src/Model/StudentLoan.php @@ -0,0 +1,49 @@ + + */ +class StudentLoanRecovered implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StudentLoanRecovered'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'planType' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'planType' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'planType' => true, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'planType' => 'planType', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'planType' => 'setPlanType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'planType' => 'getPlanType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('planType', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets planType + * + * @return string|null + */ + public function getPlanType(): ?string + { + return $this->container['planType']; + } + + /** + * Sets planType + * + * @param string|null $planType planType + * + * @return $this + */ + public function setPlanType(?string $planType): static + { + if (is_null($planType)) { + array_push($this->openAPINullablesSetToNull, 'planType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('planType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['planType'] = $planType; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return $this + */ + public function setValue(?string $value): static + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SubmissionStatus.php b/src/Model/SubmissionStatus.php new file mode 100644 index 0000000..7d41bda --- /dev/null +++ b/src/Model/SubmissionStatus.php @@ -0,0 +1,49 @@ + + */ +class Tag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Tag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'title' => 'string', + 'color' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'code' => null, + 'title' => null, + 'color' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'code' => false, + 'title' => false, + 'color' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'title' => 'title', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'code' => 'setCode', + 'title' => 'setTitle', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'code' => 'getCode', + 'title' => 'getTitle', + 'color' => 'getColor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ((mb_strlen($this->container['code']) > 20)) { + $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 20."; + } + + if ((mb_strlen($this->container['code']) < 1)) { + $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 1."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 50)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 50."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && (mb_strlen($this->container['color']) > 6)) { + $invalidProperties[] = "invalid value for 'color', the character length must be smaller than or equal to 6."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code The unique code for this Tag + * + * @return $this + */ + public function setCode(string $code): static + { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } + if ((mb_strlen($code) > 20)) { + throw new InvalidArgumentException('invalid length for $code when calling Tag., must be smaller than or equal to 20.'); + } + if ((mb_strlen($code) < 1)) { + throw new InvalidArgumentException('invalid length for $code when calling Tag., must be bigger than or equal to 1.'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The title for this Tag + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 50)) { + throw new InvalidArgumentException('invalid length for $title when calling Tag., must be smaller than or equal to 50.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling Tag., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor(): ?string + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A color to used to represent this Tag, in hex format. ie 'ff0000' + * + * @return $this + */ + public function setColor(?string $color): static + { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($color) && (mb_strlen($color) > 6)) { + throw new InvalidArgumentException('invalid length for $color when calling Tag., must be smaller than or equal to 6.'); + } + + $this->container['color'] = $color; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxAndNi.php b/src/Model/TaxAndNi.php new file mode 100644 index 0000000..55d2b80 --- /dev/null +++ b/src/Model/TaxAndNi.php @@ -0,0 +1,794 @@ + + */ +class TaxAndNi implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxAndNi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'niTable' => 'string', + 'secondaryClass1NotPayable' => 'bool', + 'postgradLoan' => 'bool', + 'postgraduateLoanStartDate' => '\DateTime', + 'postgraduateLoanEndDate' => '\DateTime', + 'studentLoan' => '\SynergiTech\Staffology\Model\StudentLoan', + 'studentLoanStartDate' => '\DateTime', + 'studentLoanEndDate' => '\DateTime', + 'taxCode' => 'string', + 'week1Month1' => 'bool', + 'foreignTaxCredit' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'niTable' => null, + 'secondaryClass1NotPayable' => null, + 'postgradLoan' => null, + 'postgraduateLoanStartDate' => 'date', + 'postgraduateLoanEndDate' => 'date', + 'studentLoan' => null, + 'studentLoanStartDate' => 'date', + 'studentLoanEndDate' => 'date', + 'taxCode' => null, + 'week1Month1' => null, + 'foreignTaxCredit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'niTable' => false, + 'secondaryClass1NotPayable' => false, + 'postgradLoan' => false, + 'postgraduateLoanStartDate' => true, + 'postgraduateLoanEndDate' => true, + 'studentLoan' => false, + 'studentLoanStartDate' => true, + 'studentLoanEndDate' => true, + 'taxCode' => true, + 'week1Month1' => false, + 'foreignTaxCredit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'niTable' => 'niTable', + 'secondaryClass1NotPayable' => 'secondaryClass1NotPayable', + 'postgradLoan' => 'postgradLoan', + 'postgraduateLoanStartDate' => 'postgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'postgraduateLoanEndDate', + 'studentLoan' => 'studentLoan', + 'studentLoanStartDate' => 'studentLoanStartDate', + 'studentLoanEndDate' => 'studentLoanEndDate', + 'taxCode' => 'taxCode', + 'week1Month1' => 'week1Month1', + 'foreignTaxCredit' => 'foreignTaxCredit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'niTable' => 'setNiTable', + 'secondaryClass1NotPayable' => 'setSecondaryClass1NotPayable', + 'postgradLoan' => 'setPostgradLoan', + 'postgraduateLoanStartDate' => 'setPostgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'setPostgraduateLoanEndDate', + 'studentLoan' => 'setStudentLoan', + 'studentLoanStartDate' => 'setStudentLoanStartDate', + 'studentLoanEndDate' => 'setStudentLoanEndDate', + 'taxCode' => 'setTaxCode', + 'week1Month1' => 'setWeek1Month1', + 'foreignTaxCredit' => 'setForeignTaxCredit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'niTable' => 'getNiTable', + 'secondaryClass1NotPayable' => 'getSecondaryClass1NotPayable', + 'postgradLoan' => 'getPostgradLoan', + 'postgraduateLoanStartDate' => 'getPostgraduateLoanStartDate', + 'postgraduateLoanEndDate' => 'getPostgraduateLoanEndDate', + 'studentLoan' => 'getStudentLoan', + 'studentLoanStartDate' => 'getStudentLoanStartDate', + 'studentLoanEndDate' => 'getStudentLoanEndDate', + 'taxCode' => 'getTaxCode', + 'week1Month1' => 'getWeek1Month1', + 'foreignTaxCredit' => 'getForeignTaxCredit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('niTable', $data ?? [], null); + $this->setIfExists('secondaryClass1NotPayable', $data ?? [], null); + $this->setIfExists('postgradLoan', $data ?? [], null); + $this->setIfExists('postgraduateLoanStartDate', $data ?? [], null); + $this->setIfExists('postgraduateLoanEndDate', $data ?? [], null); + $this->setIfExists('studentLoan', $data ?? [], null); + $this->setIfExists('studentLoanStartDate', $data ?? [], null); + $this->setIfExists('studentLoanEndDate', $data ?? [], null); + $this->setIfExists('taxCode', $data ?? [], null); + $this->setIfExists('week1Month1', $data ?? [], null); + $this->setIfExists('foreignTaxCredit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['niTable'] === null) { + $invalidProperties[] = "'niTable' can't be null"; + } + if (!is_null($this->container['taxCode']) && (mb_strlen($this->container['taxCode']) > 12)) { + $invalidProperties[] = "invalid value for 'taxCode', the character length must be smaller than or equal to 12."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets niTable + * + * @return string + */ + public function getNiTable(): string + { + return $this->container['niTable']; + } + + /** + * Sets niTable + * + * @param string $niTable The appropriate NI letter for this Employee + * + * @return $this + */ + public function setNiTable(string $niTable): static + { + if (is_null($niTable)) { + throw new InvalidArgumentException('non-nullable niTable cannot be null'); + } + $this->container['niTable'] = $niTable; + + return $this; + } + + /** + * Gets secondaryClass1NotPayable + * + * @return bool|null + */ + public function getSecondaryClass1NotPayable(): ?bool + { + return $this->container['secondaryClass1NotPayable']; + } + + /** + * Sets secondaryClass1NotPayable + * + * @param bool|null $secondaryClass1NotPayable If set to true then no Employer NI will be paid for this Employee + * + * @return $this + */ + public function setSecondaryClass1NotPayable(?bool $secondaryClass1NotPayable): static + { + if (is_null($secondaryClass1NotPayable)) { + throw new InvalidArgumentException('non-nullable secondaryClass1NotPayable cannot be null'); + } + $this->container['secondaryClass1NotPayable'] = $secondaryClass1NotPayable; + + return $this; + } + + /** + * Gets postgradLoan + * + * @return bool|null + */ + public function getPostgradLoan(): ?bool + { + return $this->container['postgradLoan']; + } + + /** + * Sets postgradLoan + * + * @param bool|null $postgradLoan Set to true if the Employee needs to make Post Graduate Loan repayments + * + * @return $this + */ + public function setPostgradLoan(?bool $postgradLoan): static + { + if (is_null($postgradLoan)) { + throw new InvalidArgumentException('non-nullable postgradLoan cannot be null'); + } + $this->container['postgradLoan'] = $postgradLoan; + + return $this; + } + + /** + * Gets postgraduateLoanStartDate + * + * @return \DateTime|null + */ + public function getPostgraduateLoanStartDate(): ?\DateTime + { + return $this->container['postgraduateLoanStartDate']; + } + + /** + * Sets postgraduateLoanStartDate + * + * @param \DateTime|null $postgraduateLoanStartDate postgraduateLoanStartDate + * + * @return $this + */ + public function setPostgraduateLoanStartDate(?\DateTime $postgraduateLoanStartDate): static + { + if (is_null($postgraduateLoanStartDate)) { + array_push($this->openAPINullablesSetToNull, 'postgraduateLoanStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgraduateLoanStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgraduateLoanStartDate'] = $postgraduateLoanStartDate; + + return $this; + } + + /** + * Gets postgraduateLoanEndDate + * + * @return \DateTime|null + */ + public function getPostgraduateLoanEndDate(): ?\DateTime + { + return $this->container['postgraduateLoanEndDate']; + } + + /** + * Sets postgraduateLoanEndDate + * + * @param \DateTime|null $postgraduateLoanEndDate postgraduateLoanEndDate + * + * @return $this + */ + public function setPostgraduateLoanEndDate(?\DateTime $postgraduateLoanEndDate): static + { + if (is_null($postgraduateLoanEndDate)) { + array_push($this->openAPINullablesSetToNull, 'postgraduateLoanEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postgraduateLoanEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postgraduateLoanEndDate'] = $postgraduateLoanEndDate; + + return $this; + } + + /** + * Gets studentLoan + * + * @return \SynergiTech\Staffology\Model\StudentLoan|null + */ + public function getStudentLoan(): ?\SynergiTech\Staffology\Model\StudentLoan + { + return $this->container['studentLoan']; + } + + /** + * Sets studentLoan + * + * @param \SynergiTech\Staffology\Model\StudentLoan|null $studentLoan studentLoan + * + * @return $this + */ + public function setStudentLoan(?\SynergiTech\Staffology\Model\StudentLoan $studentLoan): static + { + if (is_null($studentLoan)) { + throw new InvalidArgumentException('non-nullable studentLoan cannot be null'); + } + $this->container['studentLoan'] = $studentLoan; + + return $this; + } + + /** + * Gets studentLoanStartDate + * + * @return \DateTime|null + */ + public function getStudentLoanStartDate(): ?\DateTime + { + return $this->container['studentLoanStartDate']; + } + + /** + * Sets studentLoanStartDate + * + * @param \DateTime|null $studentLoanStartDate studentLoanStartDate + * + * @return $this + */ + public function setStudentLoanStartDate(?\DateTime $studentLoanStartDate): static + { + if (is_null($studentLoanStartDate)) { + array_push($this->openAPINullablesSetToNull, 'studentLoanStartDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoanStartDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoanStartDate'] = $studentLoanStartDate; + + return $this; + } + + /** + * Gets studentLoanEndDate + * + * @return \DateTime|null + */ + public function getStudentLoanEndDate(): ?\DateTime + { + return $this->container['studentLoanEndDate']; + } + + /** + * Sets studentLoanEndDate + * + * @param \DateTime|null $studentLoanEndDate studentLoanEndDate + * + * @return $this + */ + public function setStudentLoanEndDate(?\DateTime $studentLoanEndDate): static + { + if (is_null($studentLoanEndDate)) { + array_push($this->openAPINullablesSetToNull, 'studentLoanEndDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('studentLoanEndDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['studentLoanEndDate'] = $studentLoanEndDate; + + return $this; + } + + /** + * Gets taxCode + * + * @return string|null + */ + public function getTaxCode(): ?string + { + return $this->container['taxCode']; + } + + /** + * Sets taxCode + * + * @param string|null $taxCode The Tax Code for this Employee + * + * @return $this + */ + public function setTaxCode(?string $taxCode): static + { + if (is_null($taxCode)) { + array_push($this->openAPINullablesSetToNull, 'taxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($taxCode) && (mb_strlen($taxCode) > 12)) { + throw new InvalidArgumentException('invalid length for $taxCode when calling TaxAndNi., must be smaller than or equal to 12.'); + } + + $this->container['taxCode'] = $taxCode; + + return $this; + } + + /** + * Gets week1Month1 + * + * @return bool|null + */ + public function getWeek1Month1(): ?bool + { + return $this->container['week1Month1']; + } + + /** + * Sets week1Month1 + * + * @param bool|null $week1Month1 Determines whether PAYE should be calculated on a Week1/Month1 basis instead of on a cumulative basis. This is automatically set to false for any existing Employees when you start a new Tax Year. + * + * @return $this + */ + public function setWeek1Month1(?bool $week1Month1): static + { + if (is_null($week1Month1)) { + throw new InvalidArgumentException('non-nullable week1Month1 cannot be null'); + } + $this->container['week1Month1'] = $week1Month1; + + return $this; + } + + /** + * Gets foreignTaxCredit + * + * @return bool|null + */ + public function getForeignTaxCredit(): ?bool + { + return $this->container['foreignTaxCredit']; + } + + /** + * Sets foreignTaxCredit + * + * @param bool|null $foreignTaxCredit If set to True you are enabling the possibility to enter an amount on payslip so you can reduce UK Tax liabilities. + * + * @return $this + */ + public function setForeignTaxCredit(?bool $foreignTaxCredit): static + { + if (is_null($foreignTaxCredit)) { + throw new InvalidArgumentException('non-nullable foreignTaxCredit cannot be null'); + } + $this->container['foreignTaxCredit'] = $foreignTaxCredit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxBracket.php b/src/Model/TaxBracket.php new file mode 100644 index 0000000..aa2a729 --- /dev/null +++ b/src/Model/TaxBracket.php @@ -0,0 +1,476 @@ + + */ +class TaxBracket implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxBracket'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'from' => 'float', + 'to' => 'float', + 'multiplier' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'from' => 'double', + 'to' => 'double', + 'multiplier' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'from' => false, + 'to' => false, + 'multiplier' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'from' => 'from', + 'to' => 'to', + 'multiplier' => 'multiplier' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'from' => 'setFrom', + 'to' => 'setTo', + 'multiplier' => 'setMultiplier' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'from' => 'getFrom', + 'to' => 'getTo', + 'multiplier' => 'getMultiplier' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from + * + * @return float|null + */ + public function getFrom(): ?float + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param float|null $from [readonly] The starting point for applying this tax rate + * + * @return $this + */ + public function setFrom(?float $from): static + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return float|null + */ + public function getTo(): ?float + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param float|null $to [readonly] The end point for applying this tax rate + * + * @return $this + */ + public function setTo(?float $to): static + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets multiplier + * + * @return float|null + */ + public function getMultiplier(): ?float + { + return $this->container['multiplier']; + } + + /** + * Sets multiplier + * + * @param float|null $multiplier [readonly] The tax rate to apply + * + * @return $this + */ + public function setMultiplier(?float $multiplier): static + { + if (is_null($multiplier)) { + throw new InvalidArgumentException('non-nullable multiplier cannot be null'); + } + $this->container['multiplier'] = $multiplier; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxCodeChange.php b/src/Model/TaxCodeChange.php new file mode 100644 index 0000000..8b7ca9d --- /dev/null +++ b/src/Model/TaxCodeChange.php @@ -0,0 +1,450 @@ + + */ +class TaxCodeChange implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxCodeChange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'suffix' => 'string', + 'increment' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'suffix' => null, + 'increment' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'suffix' => true, + 'increment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'suffix' => 'suffix', + 'increment' => 'increment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'suffix' => 'setSuffix', + 'increment' => 'setIncrement' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'suffix' => 'getSuffix', + 'increment' => 'getIncrement' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('suffix', $data ?? [], null); + $this->setIfExists('increment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets suffix + * + * @return string|null + */ + public function getSuffix(): ?string + { + return $this->container['suffix']; + } + + /** + * Sets suffix + * + * @param string|null $suffix [readonly] The suffix of the Tax Code that needs to be incremented for this Tax Year + * + * @return $this + */ + public function setSuffix(?string $suffix): static + { + if (is_null($suffix)) { + array_push($this->openAPINullablesSetToNull, 'suffix'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('suffix', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['suffix'] = $suffix; + + return $this; + } + + /** + * Gets increment + * + * @return int|null + */ + public function getIncrement(): ?int + { + return $this->container['increment']; + } + + /** + * Sets increment + * + * @param int|null $increment [readonly] The amount by which to increment Tax Codes with the given suffix + * + * @return $this + */ + public function setIncrement(?int $increment): static + { + if (is_null($increment)) { + throw new InvalidArgumentException('non-nullable increment cannot be null'); + } + $this->container['increment'] = $increment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxCodeChangeReport.php b/src/Model/TaxCodeChangeReport.php new file mode 100644 index 0000000..094b167 --- /dev/null +++ b/src/Model/TaxCodeChangeReport.php @@ -0,0 +1,558 @@ + + */ +class TaxCodeChangeReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxCodeChangeReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\TaxCodeChangeValues[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\TaxCodeChangeValues[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\TaxCodeChangeValues[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxCodeChangeReportReportResponse.php b/src/Model/TaxCodeChangeReportReportResponse.php new file mode 100644 index 0000000..c8a8edf --- /dev/null +++ b/src/Model/TaxCodeChangeReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class TaxCodeChangeReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxCodeChangeReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\TaxCodeChangeReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\TaxCodeChangeReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\TaxCodeChangeReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\TaxCodeChangeReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\TaxCodeChangeReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxCodeChangeValues.php b/src/Model/TaxCodeChangeValues.php new file mode 100644 index 0000000..dc1bf23 --- /dev/null +++ b/src/Model/TaxCodeChangeValues.php @@ -0,0 +1,722 @@ + + */ +class TaxCodeChangeValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxCodeChangeValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employeeId' => 'int', + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'payrollCode' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'niNumber' => 'string', + 'periodChange' => 'int', + 'previousTaxCode' => 'string', + 'currentTaxCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employeeId' => 'int32', + 'employee' => null, + 'payrollCode' => null, + 'firstName' => null, + 'lastName' => null, + 'niNumber' => null, + 'periodChange' => 'int32', + 'previousTaxCode' => null, + 'currentTaxCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employeeId' => false, + 'employee' => false, + 'payrollCode' => true, + 'firstName' => true, + 'lastName' => true, + 'niNumber' => true, + 'periodChange' => false, + 'previousTaxCode' => true, + 'currentTaxCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employeeId' => 'employeeId', + 'employee' => 'employee', + 'payrollCode' => 'payrollCode', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'niNumber' => 'niNumber', + 'periodChange' => 'periodChange', + 'previousTaxCode' => 'previousTaxCode', + 'currentTaxCode' => 'currentTaxCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employeeId' => 'setEmployeeId', + 'employee' => 'setEmployee', + 'payrollCode' => 'setPayrollCode', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'niNumber' => 'setNiNumber', + 'periodChange' => 'setPeriodChange', + 'previousTaxCode' => 'setPreviousTaxCode', + 'currentTaxCode' => 'setCurrentTaxCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employeeId' => 'getEmployeeId', + 'employee' => 'getEmployee', + 'payrollCode' => 'getPayrollCode', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'niNumber' => 'getNiNumber', + 'periodChange' => 'getPeriodChange', + 'previousTaxCode' => 'getPreviousTaxCode', + 'currentTaxCode' => 'getCurrentTaxCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employeeId', $data ?? [], null); + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('niNumber', $data ?? [], null); + $this->setIfExists('periodChange', $data ?? [], null); + $this->setIfExists('previousTaxCode', $data ?? [], null); + $this->setIfExists('currentTaxCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employeeId + * + * @return int|null + */ + public function getEmployeeId(): ?int + { + return $this->container['employeeId']; + } + + /** + * Sets employeeId + * + * @param int|null $employeeId employeeId + * + * @return $this + */ + public function setEmployeeId(?int $employeeId): static + { + if (is_null($employeeId)) { + throw new InvalidArgumentException('non-nullable employeeId cannot be null'); + } + $this->container['employeeId'] = $employeeId; + + return $this; + } + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets niNumber + * + * @return string|null + */ + public function getNiNumber(): ?string + { + return $this->container['niNumber']; + } + + /** + * Sets niNumber + * + * @param string|null $niNumber niNumber + * + * @return $this + */ + public function setNiNumber(?string $niNumber): static + { + if (is_null($niNumber)) { + array_push($this->openAPINullablesSetToNull, 'niNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niNumber'] = $niNumber; + + return $this; + } + + /** + * Gets periodChange + * + * @return int|null + */ + public function getPeriodChange(): ?int + { + return $this->container['periodChange']; + } + + /** + * Sets periodChange + * + * @param int|null $periodChange periodChange + * + * @return $this + */ + public function setPeriodChange(?int $periodChange): static + { + if (is_null($periodChange)) { + throw new InvalidArgumentException('non-nullable periodChange cannot be null'); + } + $this->container['periodChange'] = $periodChange; + + return $this; + } + + /** + * Gets previousTaxCode + * + * @return string|null + */ + public function getPreviousTaxCode(): ?string + { + return $this->container['previousTaxCode']; + } + + /** + * Sets previousTaxCode + * + * @param string|null $previousTaxCode previousTaxCode + * + * @return $this + */ + public function setPreviousTaxCode(?string $previousTaxCode): static + { + if (is_null($previousTaxCode)) { + array_push($this->openAPINullablesSetToNull, 'previousTaxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('previousTaxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['previousTaxCode'] = $previousTaxCode; + + return $this; + } + + /** + * Gets currentTaxCode + * + * @return string|null + */ + public function getCurrentTaxCode(): ?string + { + return $this->container['currentTaxCode']; + } + + /** + * Sets currentTaxCode + * + * @param string|null $currentTaxCode currentTaxCode + * + * @return $this + */ + public function setCurrentTaxCode(?string $currentTaxCode): static + { + if (is_null($currentTaxCode)) { + array_push($this->openAPINullablesSetToNull, 'currentTaxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('currentTaxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['currentTaxCode'] = $currentTaxCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxYear.php b/src/Model/TaxYear.php new file mode 100644 index 0000000..7c6a2e2 --- /dev/null +++ b/src/Model/TaxYear.php @@ -0,0 +1,57 @@ + + */ +class TaxYearConfig implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TaxYearConfig'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'taxYear' => 'int', + 'isPreview' => 'bool', + 'defaultTaxCode' => 'string', + 'class1ANicsRate' => '\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue', + 'lowerEarningsLimit' => '\SynergiTech\Staffology\Model\PeriodValue', + 'upperEarningsLimit' => '\SynergiTech\Staffology\Model\PeriodValue', + 'primaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'secondaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'upperAccrualPoint' => '\SynergiTech\Staffology\Model\PeriodValue', + 'upperSecondaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'apprenticeUpperSecondaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'freeportsUpperSecondaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'veteransUpperSecondaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'directorsProratePrimaryThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'plan1StudentLoanThreshold' => 'float', + 'plan1StudentLoanRate' => 'float', + 'plan2StudentLoanThreshold' => 'float', + 'plan2StudentLoanRate' => 'float', + 'plan4StudentLoanThreshold' => 'float', + 'plan4StudentLoanRate' => 'float', + 'postGradLoanThreshold' => 'float', + 'postGradLoanRate' => 'float', + 'deaProtectedEarnings' => 'float', + 'pensionLowerThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'pensionAutomaticEnrolment' => '\SynergiTech\Staffology\Model\PeriodValue', + 'pensionUpperThreshold' => '\SynergiTech\Staffology\Model\PeriodValue', + 'pensionAeEmployerContribution' => 'float', + 'pensionAeEmployeeContribution' => 'float', + 'employmentAllowancePreviousYear' => 'float', + 'employmentAllowance' => 'float', + 'fixedCodes' => '\SynergiTech\Staffology\Model\FixedCode[]', + 'scottishFixedCodes' => '\SynergiTech\Staffology\Model\FixedCode[]', + 'welshFixedCodes' => '\SynergiTech\Staffology\Model\FixedCode[]', + 'niRates' => '\SynergiTech\Staffology\Model\NationalInsuranceCode[]', + 'directorsNiRates' => '\SynergiTech\Staffology\Model\NationalInsuranceCode[]', + 'brackets' => '\SynergiTech\Staffology\Model\TaxBracket[]', + 'scottishBrackets' => '\SynergiTech\Staffology\Model\TaxBracket[]', + 'welshBrackets' => '\SynergiTech\Staffology\Model\TaxBracket[]', + 'taxCodeChanges' => '\SynergiTech\Staffology\Model\TaxCodeChange[]', + 'minimumWage' => '\SynergiTech\Staffology\Model\NationalMinimumWage[]', + 'statutoryPay' => '\SynergiTech\Staffology\Model\StatutoryPay', + 'loanCharge' => '\SynergiTech\Staffology\Model\LoanCharge', + 'carCharge' => '\SynergiTech\Staffology\Model\CarCharge', + 'govTalk' => '\SynergiTech\Staffology\Model\GovTalk', + 'mileageAllowancePaymentsRates' => '\SynergiTech\Staffology\Model\MileageAllowancePaymentsRate[]', + 'tieredPensions' => '\SynergiTech\Staffology\Model\TieredPension[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'taxYear' => 'int32', + 'isPreview' => null, + 'defaultTaxCode' => null, + 'class1ANicsRate' => null, + 'lowerEarningsLimit' => null, + 'upperEarningsLimit' => null, + 'primaryThreshold' => null, + 'secondaryThreshold' => null, + 'upperAccrualPoint' => null, + 'upperSecondaryThreshold' => null, + 'apprenticeUpperSecondaryThreshold' => null, + 'freeportsUpperSecondaryThreshold' => null, + 'veteransUpperSecondaryThreshold' => null, + 'directorsProratePrimaryThreshold' => null, + 'plan1StudentLoanThreshold' => 'double', + 'plan1StudentLoanRate' => 'double', + 'plan2StudentLoanThreshold' => 'double', + 'plan2StudentLoanRate' => 'double', + 'plan4StudentLoanThreshold' => 'double', + 'plan4StudentLoanRate' => 'double', + 'postGradLoanThreshold' => 'double', + 'postGradLoanRate' => 'double', + 'deaProtectedEarnings' => 'double', + 'pensionLowerThreshold' => null, + 'pensionAutomaticEnrolment' => null, + 'pensionUpperThreshold' => null, + 'pensionAeEmployerContribution' => 'double', + 'pensionAeEmployeeContribution' => 'double', + 'employmentAllowancePreviousYear' => 'double', + 'employmentAllowance' => 'double', + 'fixedCodes' => null, + 'scottishFixedCodes' => null, + 'welshFixedCodes' => null, + 'niRates' => null, + 'directorsNiRates' => null, + 'brackets' => null, + 'scottishBrackets' => null, + 'welshBrackets' => null, + 'taxCodeChanges' => null, + 'minimumWage' => null, + 'statutoryPay' => null, + 'loanCharge' => null, + 'carCharge' => null, + 'govTalk' => null, + 'mileageAllowancePaymentsRates' => null, + 'tieredPensions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'taxYear' => false, + 'isPreview' => false, + 'defaultTaxCode' => true, + 'class1ANicsRate' => false, + 'lowerEarningsLimit' => false, + 'upperEarningsLimit' => false, + 'primaryThreshold' => false, + 'secondaryThreshold' => false, + 'upperAccrualPoint' => false, + 'upperSecondaryThreshold' => false, + 'apprenticeUpperSecondaryThreshold' => false, + 'freeportsUpperSecondaryThreshold' => false, + 'veteransUpperSecondaryThreshold' => false, + 'directorsProratePrimaryThreshold' => false, + 'plan1StudentLoanThreshold' => false, + 'plan1StudentLoanRate' => false, + 'plan2StudentLoanThreshold' => false, + 'plan2StudentLoanRate' => false, + 'plan4StudentLoanThreshold' => false, + 'plan4StudentLoanRate' => false, + 'postGradLoanThreshold' => false, + 'postGradLoanRate' => false, + 'deaProtectedEarnings' => false, + 'pensionLowerThreshold' => false, + 'pensionAutomaticEnrolment' => false, + 'pensionUpperThreshold' => false, + 'pensionAeEmployerContribution' => false, + 'pensionAeEmployeeContribution' => false, + 'employmentAllowancePreviousYear' => false, + 'employmentAllowance' => false, + 'fixedCodes' => true, + 'scottishFixedCodes' => true, + 'welshFixedCodes' => true, + 'niRates' => true, + 'directorsNiRates' => true, + 'brackets' => true, + 'scottishBrackets' => true, + 'welshBrackets' => true, + 'taxCodeChanges' => true, + 'minimumWage' => true, + 'statutoryPay' => false, + 'loanCharge' => false, + 'carCharge' => false, + 'govTalk' => false, + 'mileageAllowancePaymentsRates' => true, + 'tieredPensions' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'taxYear' => 'taxYear', + 'isPreview' => 'isPreview', + 'defaultTaxCode' => 'defaultTaxCode', + 'class1ANicsRate' => 'class1ANicsRate', + 'lowerEarningsLimit' => 'lowerEarningsLimit', + 'upperEarningsLimit' => 'upperEarningsLimit', + 'primaryThreshold' => 'primaryThreshold', + 'secondaryThreshold' => 'secondaryThreshold', + 'upperAccrualPoint' => 'upperAccrualPoint', + 'upperSecondaryThreshold' => 'upperSecondaryThreshold', + 'apprenticeUpperSecondaryThreshold' => 'apprenticeUpperSecondaryThreshold', + 'freeportsUpperSecondaryThreshold' => 'freeportsUpperSecondaryThreshold', + 'veteransUpperSecondaryThreshold' => 'veteransUpperSecondaryThreshold', + 'directorsProratePrimaryThreshold' => 'directorsProratePrimaryThreshold', + 'plan1StudentLoanThreshold' => 'plan1StudentLoanThreshold', + 'plan1StudentLoanRate' => 'plan1StudentLoanRate', + 'plan2StudentLoanThreshold' => 'plan2StudentLoanThreshold', + 'plan2StudentLoanRate' => 'plan2StudentLoanRate', + 'plan4StudentLoanThreshold' => 'plan4StudentLoanThreshold', + 'plan4StudentLoanRate' => 'plan4StudentLoanRate', + 'postGradLoanThreshold' => 'postGradLoanThreshold', + 'postGradLoanRate' => 'postGradLoanRate', + 'deaProtectedEarnings' => 'deaProtectedEarnings', + 'pensionLowerThreshold' => 'pensionLowerThreshold', + 'pensionAutomaticEnrolment' => 'pensionAutomaticEnrolment', + 'pensionUpperThreshold' => 'pensionUpperThreshold', + 'pensionAeEmployerContribution' => 'pensionAeEmployerContribution', + 'pensionAeEmployeeContribution' => 'pensionAeEmployeeContribution', + 'employmentAllowancePreviousYear' => 'employmentAllowancePreviousYear', + 'employmentAllowance' => 'employmentAllowance', + 'fixedCodes' => 'fixedCodes', + 'scottishFixedCodes' => 'scottishFixedCodes', + 'welshFixedCodes' => 'welshFixedCodes', + 'niRates' => 'niRates', + 'directorsNiRates' => 'directorsNiRates', + 'brackets' => 'brackets', + 'scottishBrackets' => 'scottishBrackets', + 'welshBrackets' => 'welshBrackets', + 'taxCodeChanges' => 'taxCodeChanges', + 'minimumWage' => 'minimumWage', + 'statutoryPay' => 'statutoryPay', + 'loanCharge' => 'loanCharge', + 'carCharge' => 'carCharge', + 'govTalk' => 'govTalk', + 'mileageAllowancePaymentsRates' => 'mileageAllowancePaymentsRates', + 'tieredPensions' => 'tieredPensions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'taxYear' => 'setTaxYear', + 'isPreview' => 'setIsPreview', + 'defaultTaxCode' => 'setDefaultTaxCode', + 'class1ANicsRate' => 'setClass1ANicsRate', + 'lowerEarningsLimit' => 'setLowerEarningsLimit', + 'upperEarningsLimit' => 'setUpperEarningsLimit', + 'primaryThreshold' => 'setPrimaryThreshold', + 'secondaryThreshold' => 'setSecondaryThreshold', + 'upperAccrualPoint' => 'setUpperAccrualPoint', + 'upperSecondaryThreshold' => 'setUpperSecondaryThreshold', + 'apprenticeUpperSecondaryThreshold' => 'setApprenticeUpperSecondaryThreshold', + 'freeportsUpperSecondaryThreshold' => 'setFreeportsUpperSecondaryThreshold', + 'veteransUpperSecondaryThreshold' => 'setVeteransUpperSecondaryThreshold', + 'directorsProratePrimaryThreshold' => 'setDirectorsProratePrimaryThreshold', + 'plan1StudentLoanThreshold' => 'setPlan1StudentLoanThreshold', + 'plan1StudentLoanRate' => 'setPlan1StudentLoanRate', + 'plan2StudentLoanThreshold' => 'setPlan2StudentLoanThreshold', + 'plan2StudentLoanRate' => 'setPlan2StudentLoanRate', + 'plan4StudentLoanThreshold' => 'setPlan4StudentLoanThreshold', + 'plan4StudentLoanRate' => 'setPlan4StudentLoanRate', + 'postGradLoanThreshold' => 'setPostGradLoanThreshold', + 'postGradLoanRate' => 'setPostGradLoanRate', + 'deaProtectedEarnings' => 'setDeaProtectedEarnings', + 'pensionLowerThreshold' => 'setPensionLowerThreshold', + 'pensionAutomaticEnrolment' => 'setPensionAutomaticEnrolment', + 'pensionUpperThreshold' => 'setPensionUpperThreshold', + 'pensionAeEmployerContribution' => 'setPensionAeEmployerContribution', + 'pensionAeEmployeeContribution' => 'setPensionAeEmployeeContribution', + 'employmentAllowancePreviousYear' => 'setEmploymentAllowancePreviousYear', + 'employmentAllowance' => 'setEmploymentAllowance', + 'fixedCodes' => 'setFixedCodes', + 'scottishFixedCodes' => 'setScottishFixedCodes', + 'welshFixedCodes' => 'setWelshFixedCodes', + 'niRates' => 'setNiRates', + 'directorsNiRates' => 'setDirectorsNiRates', + 'brackets' => 'setBrackets', + 'scottishBrackets' => 'setScottishBrackets', + 'welshBrackets' => 'setWelshBrackets', + 'taxCodeChanges' => 'setTaxCodeChanges', + 'minimumWage' => 'setMinimumWage', + 'statutoryPay' => 'setStatutoryPay', + 'loanCharge' => 'setLoanCharge', + 'carCharge' => 'setCarCharge', + 'govTalk' => 'setGovTalk', + 'mileageAllowancePaymentsRates' => 'setMileageAllowancePaymentsRates', + 'tieredPensions' => 'setTieredPensions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'taxYear' => 'getTaxYear', + 'isPreview' => 'getIsPreview', + 'defaultTaxCode' => 'getDefaultTaxCode', + 'class1ANicsRate' => 'getClass1ANicsRate', + 'lowerEarningsLimit' => 'getLowerEarningsLimit', + 'upperEarningsLimit' => 'getUpperEarningsLimit', + 'primaryThreshold' => 'getPrimaryThreshold', + 'secondaryThreshold' => 'getSecondaryThreshold', + 'upperAccrualPoint' => 'getUpperAccrualPoint', + 'upperSecondaryThreshold' => 'getUpperSecondaryThreshold', + 'apprenticeUpperSecondaryThreshold' => 'getApprenticeUpperSecondaryThreshold', + 'freeportsUpperSecondaryThreshold' => 'getFreeportsUpperSecondaryThreshold', + 'veteransUpperSecondaryThreshold' => 'getVeteransUpperSecondaryThreshold', + 'directorsProratePrimaryThreshold' => 'getDirectorsProratePrimaryThreshold', + 'plan1StudentLoanThreshold' => 'getPlan1StudentLoanThreshold', + 'plan1StudentLoanRate' => 'getPlan1StudentLoanRate', + 'plan2StudentLoanThreshold' => 'getPlan2StudentLoanThreshold', + 'plan2StudentLoanRate' => 'getPlan2StudentLoanRate', + 'plan4StudentLoanThreshold' => 'getPlan4StudentLoanThreshold', + 'plan4StudentLoanRate' => 'getPlan4StudentLoanRate', + 'postGradLoanThreshold' => 'getPostGradLoanThreshold', + 'postGradLoanRate' => 'getPostGradLoanRate', + 'deaProtectedEarnings' => 'getDeaProtectedEarnings', + 'pensionLowerThreshold' => 'getPensionLowerThreshold', + 'pensionAutomaticEnrolment' => 'getPensionAutomaticEnrolment', + 'pensionUpperThreshold' => 'getPensionUpperThreshold', + 'pensionAeEmployerContribution' => 'getPensionAeEmployerContribution', + 'pensionAeEmployeeContribution' => 'getPensionAeEmployeeContribution', + 'employmentAllowancePreviousYear' => 'getEmploymentAllowancePreviousYear', + 'employmentAllowance' => 'getEmploymentAllowance', + 'fixedCodes' => 'getFixedCodes', + 'scottishFixedCodes' => 'getScottishFixedCodes', + 'welshFixedCodes' => 'getWelshFixedCodes', + 'niRates' => 'getNiRates', + 'directorsNiRates' => 'getDirectorsNiRates', + 'brackets' => 'getBrackets', + 'scottishBrackets' => 'getScottishBrackets', + 'welshBrackets' => 'getWelshBrackets', + 'taxCodeChanges' => 'getTaxCodeChanges', + 'minimumWage' => 'getMinimumWage', + 'statutoryPay' => 'getStatutoryPay', + 'loanCharge' => 'getLoanCharge', + 'carCharge' => 'getCarCharge', + 'govTalk' => 'getGovTalk', + 'mileageAllowancePaymentsRates' => 'getMileageAllowancePaymentsRates', + 'tieredPensions' => 'getTieredPensions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('isPreview', $data ?? [], null); + $this->setIfExists('defaultTaxCode', $data ?? [], null); + $this->setIfExists('class1ANicsRate', $data ?? [], null); + $this->setIfExists('lowerEarningsLimit', $data ?? [], null); + $this->setIfExists('upperEarningsLimit', $data ?? [], null); + $this->setIfExists('primaryThreshold', $data ?? [], null); + $this->setIfExists('secondaryThreshold', $data ?? [], null); + $this->setIfExists('upperAccrualPoint', $data ?? [], null); + $this->setIfExists('upperSecondaryThreshold', $data ?? [], null); + $this->setIfExists('apprenticeUpperSecondaryThreshold', $data ?? [], null); + $this->setIfExists('freeportsUpperSecondaryThreshold', $data ?? [], null); + $this->setIfExists('veteransUpperSecondaryThreshold', $data ?? [], null); + $this->setIfExists('directorsProratePrimaryThreshold', $data ?? [], null); + $this->setIfExists('plan1StudentLoanThreshold', $data ?? [], null); + $this->setIfExists('plan1StudentLoanRate', $data ?? [], null); + $this->setIfExists('plan2StudentLoanThreshold', $data ?? [], null); + $this->setIfExists('plan2StudentLoanRate', $data ?? [], null); + $this->setIfExists('plan4StudentLoanThreshold', $data ?? [], null); + $this->setIfExists('plan4StudentLoanRate', $data ?? [], null); + $this->setIfExists('postGradLoanThreshold', $data ?? [], null); + $this->setIfExists('postGradLoanRate', $data ?? [], null); + $this->setIfExists('deaProtectedEarnings', $data ?? [], null); + $this->setIfExists('pensionLowerThreshold', $data ?? [], null); + $this->setIfExists('pensionAutomaticEnrolment', $data ?? [], null); + $this->setIfExists('pensionUpperThreshold', $data ?? [], null); + $this->setIfExists('pensionAeEmployerContribution', $data ?? [], null); + $this->setIfExists('pensionAeEmployeeContribution', $data ?? [], null); + $this->setIfExists('employmentAllowancePreviousYear', $data ?? [], null); + $this->setIfExists('employmentAllowance', $data ?? [], null); + $this->setIfExists('fixedCodes', $data ?? [], null); + $this->setIfExists('scottishFixedCodes', $data ?? [], null); + $this->setIfExists('welshFixedCodes', $data ?? [], null); + $this->setIfExists('niRates', $data ?? [], null); + $this->setIfExists('directorsNiRates', $data ?? [], null); + $this->setIfExists('brackets', $data ?? [], null); + $this->setIfExists('scottishBrackets', $data ?? [], null); + $this->setIfExists('welshBrackets', $data ?? [], null); + $this->setIfExists('taxCodeChanges', $data ?? [], null); + $this->setIfExists('minimumWage', $data ?? [], null); + $this->setIfExists('statutoryPay', $data ?? [], null); + $this->setIfExists('loanCharge', $data ?? [], null); + $this->setIfExists('carCharge', $data ?? [], null); + $this->setIfExists('govTalk', $data ?? [], null); + $this->setIfExists('mileageAllowancePaymentsRates', $data ?? [], null); + $this->setIfExists('tieredPensions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets taxYear + * + * @return int|null + */ + public function getTaxYear(): ?int + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param int|null $taxYear [readonly] The TaxYear for which this configuration applies + * + * @return $this + */ + public function setTaxYear(?int $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets isPreview + * + * @return bool|null + */ + public function getIsPreview(): ?bool + { + return $this->container['isPreview']; + } + + /** + * Sets isPreview + * + * @param bool|null $isPreview [readonly] Indicates that this is a preview of the given years configuration and it shouldn't yet be used for live processing of payroll data. + * + * @return $this + */ + public function setIsPreview(?bool $isPreview): static + { + if (is_null($isPreview)) { + throw new InvalidArgumentException('non-nullable isPreview cannot be null'); + } + $this->container['isPreview'] = $isPreview; + + return $this; + } + + /** + * Gets defaultTaxCode + * + * @return string|null + */ + public function getDefaultTaxCode(): ?string + { + return $this->container['defaultTaxCode']; + } + + /** + * Sets defaultTaxCode + * + * @param string|null $defaultTaxCode [readonly] + * + * @return $this + */ + public function setDefaultTaxCode(?string $defaultTaxCode): static + { + if (is_null($defaultTaxCode)) { + array_push($this->openAPINullablesSetToNull, 'defaultTaxCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('defaultTaxCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['defaultTaxCode'] = $defaultTaxCode; + + return $this; + } + + /** + * Gets class1ANicsRate + * + * @return \SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue|null + */ + public function getClass1ANicsRate(): ?\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue + { + return $this->container['class1ANicsRate']; + } + + /** + * Sets class1ANicsRate + * + * @param \SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue|null $class1ANicsRate class1ANicsRate + * + * @return $this + */ + public function setClass1ANicsRate(?\SynergiTech\Staffology\Model\DecimalTaxYearConfigPrimitiveValue $class1ANicsRate): static + { + if (is_null($class1ANicsRate)) { + throw new InvalidArgumentException('non-nullable class1ANicsRate cannot be null'); + } + $this->container['class1ANicsRate'] = $class1ANicsRate; + + return $this; + } + + /** + * Gets lowerEarningsLimit + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getLowerEarningsLimit(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['lowerEarningsLimit']; + } + + /** + * Sets lowerEarningsLimit + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $lowerEarningsLimit lowerEarningsLimit + * + * @return $this + */ + public function setLowerEarningsLimit(?\SynergiTech\Staffology\Model\PeriodValue $lowerEarningsLimit): static + { + if (is_null($lowerEarningsLimit)) { + throw new InvalidArgumentException('non-nullable lowerEarningsLimit cannot be null'); + } + $this->container['lowerEarningsLimit'] = $lowerEarningsLimit; + + return $this; + } + + /** + * Gets upperEarningsLimit + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getUpperEarningsLimit(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['upperEarningsLimit']; + } + + /** + * Sets upperEarningsLimit + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $upperEarningsLimit upperEarningsLimit + * + * @return $this + */ + public function setUpperEarningsLimit(?\SynergiTech\Staffology\Model\PeriodValue $upperEarningsLimit): static + { + if (is_null($upperEarningsLimit)) { + throw new InvalidArgumentException('non-nullable upperEarningsLimit cannot be null'); + } + $this->container['upperEarningsLimit'] = $upperEarningsLimit; + + return $this; + } + + /** + * Gets primaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getPrimaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['primaryThreshold']; + } + + /** + * Sets primaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $primaryThreshold primaryThreshold + * + * @return $this + */ + public function setPrimaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $primaryThreshold): static + { + if (is_null($primaryThreshold)) { + throw new InvalidArgumentException('non-nullable primaryThreshold cannot be null'); + } + $this->container['primaryThreshold'] = $primaryThreshold; + + return $this; + } + + /** + * Gets secondaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getSecondaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['secondaryThreshold']; + } + + /** + * Sets secondaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $secondaryThreshold secondaryThreshold + * + * @return $this + */ + public function setSecondaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $secondaryThreshold): static + { + if (is_null($secondaryThreshold)) { + throw new InvalidArgumentException('non-nullable secondaryThreshold cannot be null'); + } + $this->container['secondaryThreshold'] = $secondaryThreshold; + + return $this; + } + + /** + * Gets upperAccrualPoint + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getUpperAccrualPoint(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['upperAccrualPoint']; + } + + /** + * Sets upperAccrualPoint + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $upperAccrualPoint upperAccrualPoint + * + * @return $this + */ + public function setUpperAccrualPoint(?\SynergiTech\Staffology\Model\PeriodValue $upperAccrualPoint): static + { + if (is_null($upperAccrualPoint)) { + throw new InvalidArgumentException('non-nullable upperAccrualPoint cannot be null'); + } + $this->container['upperAccrualPoint'] = $upperAccrualPoint; + + return $this; + } + + /** + * Gets upperSecondaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getUpperSecondaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['upperSecondaryThreshold']; + } + + /** + * Sets upperSecondaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $upperSecondaryThreshold upperSecondaryThreshold + * + * @return $this + */ + public function setUpperSecondaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $upperSecondaryThreshold): static + { + if (is_null($upperSecondaryThreshold)) { + throw new InvalidArgumentException('non-nullable upperSecondaryThreshold cannot be null'); + } + $this->container['upperSecondaryThreshold'] = $upperSecondaryThreshold; + + return $this; + } + + /** + * Gets apprenticeUpperSecondaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getApprenticeUpperSecondaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['apprenticeUpperSecondaryThreshold']; + } + + /** + * Sets apprenticeUpperSecondaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $apprenticeUpperSecondaryThreshold apprenticeUpperSecondaryThreshold + * + * @return $this + */ + public function setApprenticeUpperSecondaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $apprenticeUpperSecondaryThreshold): static + { + if (is_null($apprenticeUpperSecondaryThreshold)) { + throw new InvalidArgumentException('non-nullable apprenticeUpperSecondaryThreshold cannot be null'); + } + $this->container['apprenticeUpperSecondaryThreshold'] = $apprenticeUpperSecondaryThreshold; + + return $this; + } + + /** + * Gets freeportsUpperSecondaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getFreeportsUpperSecondaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['freeportsUpperSecondaryThreshold']; + } + + /** + * Sets freeportsUpperSecondaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $freeportsUpperSecondaryThreshold freeportsUpperSecondaryThreshold + * + * @return $this + */ + public function setFreeportsUpperSecondaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $freeportsUpperSecondaryThreshold): static + { + if (is_null($freeportsUpperSecondaryThreshold)) { + throw new InvalidArgumentException('non-nullable freeportsUpperSecondaryThreshold cannot be null'); + } + $this->container['freeportsUpperSecondaryThreshold'] = $freeportsUpperSecondaryThreshold; + + return $this; + } + + /** + * Gets veteransUpperSecondaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getVeteransUpperSecondaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['veteransUpperSecondaryThreshold']; + } + + /** + * Sets veteransUpperSecondaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $veteransUpperSecondaryThreshold veteransUpperSecondaryThreshold + * + * @return $this + */ + public function setVeteransUpperSecondaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $veteransUpperSecondaryThreshold): static + { + if (is_null($veteransUpperSecondaryThreshold)) { + throw new InvalidArgumentException('non-nullable veteransUpperSecondaryThreshold cannot be null'); + } + $this->container['veteransUpperSecondaryThreshold'] = $veteransUpperSecondaryThreshold; + + return $this; + } + + /** + * Gets directorsProratePrimaryThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getDirectorsProratePrimaryThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['directorsProratePrimaryThreshold']; + } + + /** + * Sets directorsProratePrimaryThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $directorsProratePrimaryThreshold directorsProratePrimaryThreshold + * + * @return $this + */ + public function setDirectorsProratePrimaryThreshold(?\SynergiTech\Staffology\Model\PeriodValue $directorsProratePrimaryThreshold): static + { + if (is_null($directorsProratePrimaryThreshold)) { + throw new InvalidArgumentException('non-nullable directorsProratePrimaryThreshold cannot be null'); + } + $this->container['directorsProratePrimaryThreshold'] = $directorsProratePrimaryThreshold; + + return $this; + } + + /** + * Gets plan1StudentLoanThreshold + * + * @return float|null + */ + public function getPlan1StudentLoanThreshold(): ?float + { + return $this->container['plan1StudentLoanThreshold']; + } + + /** + * Sets plan1StudentLoanThreshold + * + * @param float|null $plan1StudentLoanThreshold [readonly] + * + * @return $this + */ + public function setPlan1StudentLoanThreshold(?float $plan1StudentLoanThreshold): static + { + if (is_null($plan1StudentLoanThreshold)) { + throw new InvalidArgumentException('non-nullable plan1StudentLoanThreshold cannot be null'); + } + $this->container['plan1StudentLoanThreshold'] = $plan1StudentLoanThreshold; + + return $this; + } + + /** + * Gets plan1StudentLoanRate + * + * @return float|null + */ + public function getPlan1StudentLoanRate(): ?float + { + return $this->container['plan1StudentLoanRate']; + } + + /** + * Sets plan1StudentLoanRate + * + * @param float|null $plan1StudentLoanRate [readonly] + * + * @return $this + */ + public function setPlan1StudentLoanRate(?float $plan1StudentLoanRate): static + { + if (is_null($plan1StudentLoanRate)) { + throw new InvalidArgumentException('non-nullable plan1StudentLoanRate cannot be null'); + } + $this->container['plan1StudentLoanRate'] = $plan1StudentLoanRate; + + return $this; + } + + /** + * Gets plan2StudentLoanThreshold + * + * @return float|null + */ + public function getPlan2StudentLoanThreshold(): ?float + { + return $this->container['plan2StudentLoanThreshold']; + } + + /** + * Sets plan2StudentLoanThreshold + * + * @param float|null $plan2StudentLoanThreshold [readonly] + * + * @return $this + */ + public function setPlan2StudentLoanThreshold(?float $plan2StudentLoanThreshold): static + { + if (is_null($plan2StudentLoanThreshold)) { + throw new InvalidArgumentException('non-nullable plan2StudentLoanThreshold cannot be null'); + } + $this->container['plan2StudentLoanThreshold'] = $plan2StudentLoanThreshold; + + return $this; + } + + /** + * Gets plan2StudentLoanRate + * + * @return float|null + */ + public function getPlan2StudentLoanRate(): ?float + { + return $this->container['plan2StudentLoanRate']; + } + + /** + * Sets plan2StudentLoanRate + * + * @param float|null $plan2StudentLoanRate [readonly] + * + * @return $this + */ + public function setPlan2StudentLoanRate(?float $plan2StudentLoanRate): static + { + if (is_null($plan2StudentLoanRate)) { + throw new InvalidArgumentException('non-nullable plan2StudentLoanRate cannot be null'); + } + $this->container['plan2StudentLoanRate'] = $plan2StudentLoanRate; + + return $this; + } + + /** + * Gets plan4StudentLoanThreshold + * + * @return float|null + */ + public function getPlan4StudentLoanThreshold(): ?float + { + return $this->container['plan4StudentLoanThreshold']; + } + + /** + * Sets plan4StudentLoanThreshold + * + * @param float|null $plan4StudentLoanThreshold [readonly] + * + * @return $this + */ + public function setPlan4StudentLoanThreshold(?float $plan4StudentLoanThreshold): static + { + if (is_null($plan4StudentLoanThreshold)) { + throw new InvalidArgumentException('non-nullable plan4StudentLoanThreshold cannot be null'); + } + $this->container['plan4StudentLoanThreshold'] = $plan4StudentLoanThreshold; + + return $this; + } + + /** + * Gets plan4StudentLoanRate + * + * @return float|null + */ + public function getPlan4StudentLoanRate(): ?float + { + return $this->container['plan4StudentLoanRate']; + } + + /** + * Sets plan4StudentLoanRate + * + * @param float|null $plan4StudentLoanRate [readonly] + * + * @return $this + */ + public function setPlan4StudentLoanRate(?float $plan4StudentLoanRate): static + { + if (is_null($plan4StudentLoanRate)) { + throw new InvalidArgumentException('non-nullable plan4StudentLoanRate cannot be null'); + } + $this->container['plan4StudentLoanRate'] = $plan4StudentLoanRate; + + return $this; + } + + /** + * Gets postGradLoanThreshold + * + * @return float|null + */ + public function getPostGradLoanThreshold(): ?float + { + return $this->container['postGradLoanThreshold']; + } + + /** + * Sets postGradLoanThreshold + * + * @param float|null $postGradLoanThreshold [readonly] + * + * @return $this + */ + public function setPostGradLoanThreshold(?float $postGradLoanThreshold): static + { + if (is_null($postGradLoanThreshold)) { + throw new InvalidArgumentException('non-nullable postGradLoanThreshold cannot be null'); + } + $this->container['postGradLoanThreshold'] = $postGradLoanThreshold; + + return $this; + } + + /** + * Gets postGradLoanRate + * + * @return float|null + */ + public function getPostGradLoanRate(): ?float + { + return $this->container['postGradLoanRate']; + } + + /** + * Sets postGradLoanRate + * + * @param float|null $postGradLoanRate [readonly] + * + * @return $this + */ + public function setPostGradLoanRate(?float $postGradLoanRate): static + { + if (is_null($postGradLoanRate)) { + throw new InvalidArgumentException('non-nullable postGradLoanRate cannot be null'); + } + $this->container['postGradLoanRate'] = $postGradLoanRate; + + return $this; + } + + /** + * Gets deaProtectedEarnings + * + * @return float|null + */ + public function getDeaProtectedEarnings(): ?float + { + return $this->container['deaProtectedEarnings']; + } + + /** + * Sets deaProtectedEarnings + * + * @param float|null $deaProtectedEarnings [readonly] + * + * @return $this + */ + public function setDeaProtectedEarnings(?float $deaProtectedEarnings): static + { + if (is_null($deaProtectedEarnings)) { + throw new InvalidArgumentException('non-nullable deaProtectedEarnings cannot be null'); + } + $this->container['deaProtectedEarnings'] = $deaProtectedEarnings; + + return $this; + } + + /** + * Gets pensionLowerThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getPensionLowerThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['pensionLowerThreshold']; + } + + /** + * Sets pensionLowerThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $pensionLowerThreshold pensionLowerThreshold + * + * @return $this + */ + public function setPensionLowerThreshold(?\SynergiTech\Staffology\Model\PeriodValue $pensionLowerThreshold): static + { + if (is_null($pensionLowerThreshold)) { + throw new InvalidArgumentException('non-nullable pensionLowerThreshold cannot be null'); + } + $this->container['pensionLowerThreshold'] = $pensionLowerThreshold; + + return $this; + } + + /** + * Gets pensionAutomaticEnrolment + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getPensionAutomaticEnrolment(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['pensionAutomaticEnrolment']; + } + + /** + * Sets pensionAutomaticEnrolment + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $pensionAutomaticEnrolment pensionAutomaticEnrolment + * + * @return $this + */ + public function setPensionAutomaticEnrolment(?\SynergiTech\Staffology\Model\PeriodValue $pensionAutomaticEnrolment): static + { + if (is_null($pensionAutomaticEnrolment)) { + throw new InvalidArgumentException('non-nullable pensionAutomaticEnrolment cannot be null'); + } + $this->container['pensionAutomaticEnrolment'] = $pensionAutomaticEnrolment; + + return $this; + } + + /** + * Gets pensionUpperThreshold + * + * @return \SynergiTech\Staffology\Model\PeriodValue|null + */ + public function getPensionUpperThreshold(): ?\SynergiTech\Staffology\Model\PeriodValue + { + return $this->container['pensionUpperThreshold']; + } + + /** + * Sets pensionUpperThreshold + * + * @param \SynergiTech\Staffology\Model\PeriodValue|null $pensionUpperThreshold pensionUpperThreshold + * + * @return $this + */ + public function setPensionUpperThreshold(?\SynergiTech\Staffology\Model\PeriodValue $pensionUpperThreshold): static + { + if (is_null($pensionUpperThreshold)) { + throw new InvalidArgumentException('non-nullable pensionUpperThreshold cannot be null'); + } + $this->container['pensionUpperThreshold'] = $pensionUpperThreshold; + + return $this; + } + + /** + * Gets pensionAeEmployerContribution + * + * @return float|null + */ + public function getPensionAeEmployerContribution(): ?float + { + return $this->container['pensionAeEmployerContribution']; + } + + /** + * Sets pensionAeEmployerContribution + * + * @param float|null $pensionAeEmployerContribution [readonly] + * + * @return $this + */ + public function setPensionAeEmployerContribution(?float $pensionAeEmployerContribution): static + { + if (is_null($pensionAeEmployerContribution)) { + throw new InvalidArgumentException('non-nullable pensionAeEmployerContribution cannot be null'); + } + $this->container['pensionAeEmployerContribution'] = $pensionAeEmployerContribution; + + return $this; + } + + /** + * Gets pensionAeEmployeeContribution + * + * @return float|null + */ + public function getPensionAeEmployeeContribution(): ?float + { + return $this->container['pensionAeEmployeeContribution']; + } + + /** + * Sets pensionAeEmployeeContribution + * + * @param float|null $pensionAeEmployeeContribution [readonly] + * + * @return $this + */ + public function setPensionAeEmployeeContribution(?float $pensionAeEmployeeContribution): static + { + if (is_null($pensionAeEmployeeContribution)) { + throw new InvalidArgumentException('non-nullable pensionAeEmployeeContribution cannot be null'); + } + $this->container['pensionAeEmployeeContribution'] = $pensionAeEmployeeContribution; + + return $this; + } + + /** + * Gets employmentAllowancePreviousYear + * + * @return float|null + */ + public function getEmploymentAllowancePreviousYear(): ?float + { + return $this->container['employmentAllowancePreviousYear']; + } + + /** + * Sets employmentAllowancePreviousYear + * + * @param float|null $employmentAllowancePreviousYear [readonly] + * + * @return $this + */ + public function setEmploymentAllowancePreviousYear(?float $employmentAllowancePreviousYear): static + { + if (is_null($employmentAllowancePreviousYear)) { + throw new InvalidArgumentException('non-nullable employmentAllowancePreviousYear cannot be null'); + } + $this->container['employmentAllowancePreviousYear'] = $employmentAllowancePreviousYear; + + return $this; + } + + /** + * Gets employmentAllowance + * + * @return float|null + */ + public function getEmploymentAllowance(): ?float + { + return $this->container['employmentAllowance']; + } + + /** + * Sets employmentAllowance + * + * @param float|null $employmentAllowance [readonly] + * + * @return $this + */ + public function setEmploymentAllowance(?float $employmentAllowance): static + { + if (is_null($employmentAllowance)) { + throw new InvalidArgumentException('non-nullable employmentAllowance cannot be null'); + } + $this->container['employmentAllowance'] = $employmentAllowance; + + return $this; + } + + /** + * Gets fixedCodes + * + * @return \SynergiTech\Staffology\Model\FixedCode[]|null + */ + public function getFixedCodes(): ?array + { + return $this->container['fixedCodes']; + } + + /** + * Sets fixedCodes + * + * @param \SynergiTech\Staffology\Model\FixedCode[]|null $fixedCodes [readonly] + * + * @return $this + */ + public function setFixedCodes(?array $fixedCodes): static + { + if (is_null($fixedCodes)) { + array_push($this->openAPINullablesSetToNull, 'fixedCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fixedCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fixedCodes'] = $fixedCodes; + + return $this; + } + + /** + * Gets scottishFixedCodes + * + * @return \SynergiTech\Staffology\Model\FixedCode[]|null + */ + public function getScottishFixedCodes(): ?array + { + return $this->container['scottishFixedCodes']; + } + + /** + * Sets scottishFixedCodes + * + * @param \SynergiTech\Staffology\Model\FixedCode[]|null $scottishFixedCodes [readonly] + * + * @return $this + */ + public function setScottishFixedCodes(?array $scottishFixedCodes): static + { + if (is_null($scottishFixedCodes)) { + array_push($this->openAPINullablesSetToNull, 'scottishFixedCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scottishFixedCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scottishFixedCodes'] = $scottishFixedCodes; + + return $this; + } + + /** + * Gets welshFixedCodes + * + * @return \SynergiTech\Staffology\Model\FixedCode[]|null + */ + public function getWelshFixedCodes(): ?array + { + return $this->container['welshFixedCodes']; + } + + /** + * Sets welshFixedCodes + * + * @param \SynergiTech\Staffology\Model\FixedCode[]|null $welshFixedCodes [readonly] + * + * @return $this + */ + public function setWelshFixedCodes(?array $welshFixedCodes): static + { + if (is_null($welshFixedCodes)) { + array_push($this->openAPINullablesSetToNull, 'welshFixedCodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('welshFixedCodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['welshFixedCodes'] = $welshFixedCodes; + + return $this; + } + + /** + * Gets niRates + * + * @return \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null + */ + public function getNiRates(): ?array + { + return $this->container['niRates']; + } + + /** + * Sets niRates + * + * @param \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null $niRates [readonly] + * + * @return $this + */ + public function setNiRates(?array $niRates): static + { + if (is_null($niRates)) { + array_push($this->openAPINullablesSetToNull, 'niRates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('niRates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['niRates'] = $niRates; + + return $this; + } + + /** + * Gets directorsNiRates + * + * @return \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null + */ + public function getDirectorsNiRates(): ?array + { + return $this->container['directorsNiRates']; + } + + /** + * Sets directorsNiRates + * + * @param \SynergiTech\Staffology\Model\NationalInsuranceCode[]|null $directorsNiRates [readonly] + * + * @return $this + */ + public function setDirectorsNiRates(?array $directorsNiRates): static + { + if (is_null($directorsNiRates)) { + array_push($this->openAPINullablesSetToNull, 'directorsNiRates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('directorsNiRates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['directorsNiRates'] = $directorsNiRates; + + return $this; + } + + /** + * Gets brackets + * + * @return \SynergiTech\Staffology\Model\TaxBracket[]|null + */ + public function getBrackets(): ?array + { + return $this->container['brackets']; + } + + /** + * Sets brackets + * + * @param \SynergiTech\Staffology\Model\TaxBracket[]|null $brackets [readonly] + * + * @return $this + */ + public function setBrackets(?array $brackets): static + { + if (is_null($brackets)) { + array_push($this->openAPINullablesSetToNull, 'brackets'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('brackets', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['brackets'] = $brackets; + + return $this; + } + + /** + * Gets scottishBrackets + * + * @return \SynergiTech\Staffology\Model\TaxBracket[]|null + */ + public function getScottishBrackets(): ?array + { + return $this->container['scottishBrackets']; + } + + /** + * Sets scottishBrackets + * + * @param \SynergiTech\Staffology\Model\TaxBracket[]|null $scottishBrackets [readonly] + * + * @return $this + */ + public function setScottishBrackets(?array $scottishBrackets): static + { + if (is_null($scottishBrackets)) { + array_push($this->openAPINullablesSetToNull, 'scottishBrackets'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scottishBrackets', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scottishBrackets'] = $scottishBrackets; + + return $this; + } + + /** + * Gets welshBrackets + * + * @return \SynergiTech\Staffology\Model\TaxBracket[]|null + */ + public function getWelshBrackets(): ?array + { + return $this->container['welshBrackets']; + } + + /** + * Sets welshBrackets + * + * @param \SynergiTech\Staffology\Model\TaxBracket[]|null $welshBrackets [readonly] + * + * @return $this + */ + public function setWelshBrackets(?array $welshBrackets): static + { + if (is_null($welshBrackets)) { + array_push($this->openAPINullablesSetToNull, 'welshBrackets'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('welshBrackets', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['welshBrackets'] = $welshBrackets; + + return $this; + } + + /** + * Gets taxCodeChanges + * + * @return \SynergiTech\Staffology\Model\TaxCodeChange[]|null + */ + public function getTaxCodeChanges(): ?array + { + return $this->container['taxCodeChanges']; + } + + /** + * Sets taxCodeChanges + * + * @param \SynergiTech\Staffology\Model\TaxCodeChange[]|null $taxCodeChanges [readonly] + * + * @return $this + */ + public function setTaxCodeChanges(?array $taxCodeChanges): static + { + if (is_null($taxCodeChanges)) { + array_push($this->openAPINullablesSetToNull, 'taxCodeChanges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCodeChanges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCodeChanges'] = $taxCodeChanges; + + return $this; + } + + /** + * Gets minimumWage + * + * @return \SynergiTech\Staffology\Model\NationalMinimumWage[]|null + */ + public function getMinimumWage(): ?array + { + return $this->container['minimumWage']; + } + + /** + * Sets minimumWage + * + * @param \SynergiTech\Staffology\Model\NationalMinimumWage[]|null $minimumWage [readonly] + * + * @return $this + */ + public function setMinimumWage(?array $minimumWage): static + { + if (is_null($minimumWage)) { + array_push($this->openAPINullablesSetToNull, 'minimumWage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('minimumWage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['minimumWage'] = $minimumWage; + + return $this; + } + + /** + * Gets statutoryPay + * + * @return \SynergiTech\Staffology\Model\StatutoryPay|null + */ + public function getStatutoryPay(): ?\SynergiTech\Staffology\Model\StatutoryPay + { + return $this->container['statutoryPay']; + } + + /** + * Sets statutoryPay + * + * @param \SynergiTech\Staffology\Model\StatutoryPay|null $statutoryPay statutoryPay + * + * @return $this + */ + public function setStatutoryPay(?\SynergiTech\Staffology\Model\StatutoryPay $statutoryPay): static + { + if (is_null($statutoryPay)) { + throw new InvalidArgumentException('non-nullable statutoryPay cannot be null'); + } + $this->container['statutoryPay'] = $statutoryPay; + + return $this; + } + + /** + * Gets loanCharge + * + * @return \SynergiTech\Staffology\Model\LoanCharge|null + */ + public function getLoanCharge(): ?\SynergiTech\Staffology\Model\LoanCharge + { + return $this->container['loanCharge']; + } + + /** + * Sets loanCharge + * + * @param \SynergiTech\Staffology\Model\LoanCharge|null $loanCharge loanCharge + * + * @return $this + */ + public function setLoanCharge(?\SynergiTech\Staffology\Model\LoanCharge $loanCharge): static + { + if (is_null($loanCharge)) { + throw new InvalidArgumentException('non-nullable loanCharge cannot be null'); + } + $this->container['loanCharge'] = $loanCharge; + + return $this; + } + + /** + * Gets carCharge + * + * @return \SynergiTech\Staffology\Model\CarCharge|null + */ + public function getCarCharge(): ?\SynergiTech\Staffology\Model\CarCharge + { + return $this->container['carCharge']; + } + + /** + * Sets carCharge + * + * @param \SynergiTech\Staffology\Model\CarCharge|null $carCharge carCharge + * + * @return $this + */ + public function setCarCharge(?\SynergiTech\Staffology\Model\CarCharge $carCharge): static + { + if (is_null($carCharge)) { + throw new InvalidArgumentException('non-nullable carCharge cannot be null'); + } + $this->container['carCharge'] = $carCharge; + + return $this; + } + + /** + * Gets govTalk + * + * @return \SynergiTech\Staffology\Model\GovTalk|null + */ + public function getGovTalk(): ?\SynergiTech\Staffology\Model\GovTalk + { + return $this->container['govTalk']; + } + + /** + * Sets govTalk + * + * @param \SynergiTech\Staffology\Model\GovTalk|null $govTalk govTalk + * + * @return $this + */ + public function setGovTalk(?\SynergiTech\Staffology\Model\GovTalk $govTalk): static + { + if (is_null($govTalk)) { + throw new InvalidArgumentException('non-nullable govTalk cannot be null'); + } + $this->container['govTalk'] = $govTalk; + + return $this; + } + + /** + * Gets mileageAllowancePaymentsRates + * + * @return \SynergiTech\Staffology\Model\MileageAllowancePaymentsRate[]|null + */ + public function getMileageAllowancePaymentsRates(): ?array + { + return $this->container['mileageAllowancePaymentsRates']; + } + + /** + * Sets mileageAllowancePaymentsRates + * + * @param \SynergiTech\Staffology\Model\MileageAllowancePaymentsRate[]|null $mileageAllowancePaymentsRates [readonly] + * + * @return $this + */ + public function setMileageAllowancePaymentsRates(?array $mileageAllowancePaymentsRates): static + { + if (is_null($mileageAllowancePaymentsRates)) { + array_push($this->openAPINullablesSetToNull, 'mileageAllowancePaymentsRates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mileageAllowancePaymentsRates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mileageAllowancePaymentsRates'] = $mileageAllowancePaymentsRates; + + return $this; + } + + /** + * Gets tieredPensions + * + * @return \SynergiTech\Staffology\Model\TieredPension[]|null + */ + public function getTieredPensions(): ?array + { + return $this->container['tieredPensions']; + } + + /** + * Sets tieredPensions + * + * @param \SynergiTech\Staffology\Model\TieredPension[]|null $tieredPensions [readonly] + * + * @return $this + */ + public function setTieredPensions(?array $tieredPensions): static + { + if (is_null($tieredPensions)) { + array_push($this->openAPINullablesSetToNull, 'tieredPensions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tieredPensions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tieredPensions'] = $tieredPensions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TaxYearTypes.php b/src/Model/TaxYearTypes.php new file mode 100644 index 0000000..67ef4cf --- /dev/null +++ b/src/Model/TaxYearTypes.php @@ -0,0 +1,57 @@ + + */ +class TeachersPensionDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TeachersPensionDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employmentType' => '\SynergiTech\Staffology\Model\TeachersPensionEmploymentType', + 'fullTimeSalary' => 'int', + 'partTimeSalaryPaid' => 'int', + 'mcrRoleId1' => 'string', + 'mcrRoleId2' => 'string', + 'teachersPensionAdminNiNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employmentType' => null, + 'fullTimeSalary' => 'int32', + 'partTimeSalaryPaid' => 'int32', + 'mcrRoleId1' => null, + 'mcrRoleId2' => null, + 'teachersPensionAdminNiNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employmentType' => false, + 'fullTimeSalary' => true, + 'partTimeSalaryPaid' => true, + 'mcrRoleId1' => true, + 'mcrRoleId2' => true, + 'teachersPensionAdminNiNumber' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employmentType' => 'employmentType', + 'fullTimeSalary' => 'fullTimeSalary', + 'partTimeSalaryPaid' => 'partTimeSalaryPaid', + 'mcrRoleId1' => 'mcrRoleId1', + 'mcrRoleId2' => 'mcrRoleId2', + 'teachersPensionAdminNiNumber' => 'teachersPensionAdminNiNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employmentType' => 'setEmploymentType', + 'fullTimeSalary' => 'setFullTimeSalary', + 'partTimeSalaryPaid' => 'setPartTimeSalaryPaid', + 'mcrRoleId1' => 'setMcrRoleId1', + 'mcrRoleId2' => 'setMcrRoleId2', + 'teachersPensionAdminNiNumber' => 'setTeachersPensionAdminNiNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employmentType' => 'getEmploymentType', + 'fullTimeSalary' => 'getFullTimeSalary', + 'partTimeSalaryPaid' => 'getPartTimeSalaryPaid', + 'mcrRoleId1' => 'getMcrRoleId1', + 'mcrRoleId2' => 'getMcrRoleId2', + 'teachersPensionAdminNiNumber' => 'getTeachersPensionAdminNiNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employmentType', $data ?? [], null); + $this->setIfExists('fullTimeSalary', $data ?? [], null); + $this->setIfExists('partTimeSalaryPaid', $data ?? [], null); + $this->setIfExists('mcrRoleId1', $data ?? [], null); + $this->setIfExists('mcrRoleId2', $data ?? [], null); + $this->setIfExists('teachersPensionAdminNiNumber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['mcrRoleId1']) && (mb_strlen($this->container['mcrRoleId1']) > 15)) { + $invalidProperties[] = "invalid value for 'mcrRoleId1', the character length must be smaller than or equal to 15."; + } + + if (!is_null($this->container['mcrRoleId2']) && (mb_strlen($this->container['mcrRoleId2']) > 20)) { + $invalidProperties[] = "invalid value for 'mcrRoleId2', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['teachersPensionAdminNiNumber']) && (mb_strlen($this->container['teachersPensionAdminNiNumber']) > 9)) { + $invalidProperties[] = "invalid value for 'teachersPensionAdminNiNumber', the character length must be smaller than or equal to 9."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employmentType + * + * @return \SynergiTech\Staffology\Model\TeachersPensionEmploymentType|null + */ + public function getEmploymentType(): ?\SynergiTech\Staffology\Model\TeachersPensionEmploymentType + { + return $this->container['employmentType']; + } + + /** + * Sets employmentType + * + * @param \SynergiTech\Staffology\Model\TeachersPensionEmploymentType|null $employmentType employmentType + * + * @return $this + */ + public function setEmploymentType(?\SynergiTech\Staffology\Model\TeachersPensionEmploymentType $employmentType): static + { + if (is_null($employmentType)) { + throw new InvalidArgumentException('non-nullable employmentType cannot be null'); + } + $this->container['employmentType'] = $employmentType; + + return $this; + } + + /** + * Gets fullTimeSalary + * + * @return int|null + */ + public function getFullTimeSalary(): ?int + { + return $this->container['fullTimeSalary']; + } + + /** + * Sets fullTimeSalary + * + * @param int|null $fullTimeSalary Up to 7 digits, in pounds. eg 24000 + * + * @return $this + */ + public function setFullTimeSalary(?int $fullTimeSalary): static + { + if (is_null($fullTimeSalary)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeSalary'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeSalary', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeSalary'] = $fullTimeSalary; + + return $this; + } + + /** + * Gets partTimeSalaryPaid + * + * @return int|null + */ + public function getPartTimeSalaryPaid(): ?int + { + return $this->container['partTimeSalaryPaid']; + } + + /** + * Sets partTimeSalaryPaid + * + * @param int|null $partTimeSalaryPaid Up to 7 digits, in pounds. eg 24000 + * + * @return $this + */ + public function setPartTimeSalaryPaid(?int $partTimeSalaryPaid): static + { + if (is_null($partTimeSalaryPaid)) { + array_push($this->openAPINullablesSetToNull, 'partTimeSalaryPaid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('partTimeSalaryPaid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['partTimeSalaryPaid'] = $partTimeSalaryPaid; + + return $this; + } + + /** + * Gets mcrRoleId1 + * + * @return string|null + */ + public function getMcrRoleId1(): ?string + { + return $this->container['mcrRoleId1']; + } + + /** + * Sets mcrRoleId1 + * + * @param string|null $mcrRoleId1 Data field for the Contract used for Teachers pension administration + * + * @return $this + */ + public function setMcrRoleId1(?string $mcrRoleId1): static + { + if (is_null($mcrRoleId1)) { + array_push($this->openAPINullablesSetToNull, 'mcrRoleId1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mcrRoleId1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($mcrRoleId1) && (mb_strlen($mcrRoleId1) > 15)) { + throw new InvalidArgumentException('invalid length for $mcrRoleId1 when calling TeachersPensionDetails., must be smaller than or equal to 15.'); + } + + $this->container['mcrRoleId1'] = $mcrRoleId1; + + return $this; + } + + /** + * Gets mcrRoleId2 + * + * @return string|null + */ + public function getMcrRoleId2(): ?string + { + return $this->container['mcrRoleId2']; + } + + /** + * Sets mcrRoleId2 + * + * @param string|null $mcrRoleId2 The Job role within the contract used for Teachers pension administration + * + * @return $this + */ + public function setMcrRoleId2(?string $mcrRoleId2): static + { + if (is_null($mcrRoleId2)) { + array_push($this->openAPINullablesSetToNull, 'mcrRoleId2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mcrRoleId2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($mcrRoleId2) && (mb_strlen($mcrRoleId2) > 20)) { + throw new InvalidArgumentException('invalid length for $mcrRoleId2 when calling TeachersPensionDetails., must be smaller than or equal to 20.'); + } + + $this->container['mcrRoleId2'] = $mcrRoleId2; + + return $this; + } + + /** + * Gets teachersPensionAdminNiNumber + * + * @return string|null + */ + public function getTeachersPensionAdminNiNumber(): ?string + { + return $this->container['teachersPensionAdminNiNumber']; + } + + /** + * Sets teachersPensionAdminNiNumber + * + * @param string|null $teachersPensionAdminNiNumber Where an employee does not have an NI number yet (or doesn't know their NI number) Teachers Pensions will issue an administrative NI number + * + * @return $this + */ + public function setTeachersPensionAdminNiNumber(?string $teachersPensionAdminNiNumber): static + { + if (is_null($teachersPensionAdminNiNumber)) { + array_push($this->openAPINullablesSetToNull, 'teachersPensionAdminNiNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('teachersPensionAdminNiNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($teachersPensionAdminNiNumber) && (mb_strlen($teachersPensionAdminNiNumber) > 9)) { + throw new InvalidArgumentException('invalid length for $teachersPensionAdminNiNumber when calling TeachersPensionDetails., must be smaller than or equal to 9.'); + } + + $this->container['teachersPensionAdminNiNumber'] = $teachersPensionAdminNiNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TeachersPensionEmploymentType.php b/src/Model/TeachersPensionEmploymentType.php new file mode 100644 index 0000000..d385d96 --- /dev/null +++ b/src/Model/TeachersPensionEmploymentType.php @@ -0,0 +1,49 @@ + + */ +class TeachersPensionEoyLineItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TeachersPensionEoyLineItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'tier' => 'float', + 'percentageRate' => 'float', + 'contributorySalary' => 'float', + 'teachersContributions' => 'float', + 'employersContributions' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'tier' => 'double', + 'percentageRate' => 'double', + 'contributorySalary' => 'double', + 'teachersContributions' => 'double', + 'employersContributions' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'tier' => false, + 'percentageRate' => false, + 'contributorySalary' => false, + 'teachersContributions' => false, + 'employersContributions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'tier' => 'tier', + 'percentageRate' => 'percentageRate', + 'contributorySalary' => 'contributorySalary', + 'teachersContributions' => 'teachersContributions', + 'employersContributions' => 'employersContributions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'tier' => 'setTier', + 'percentageRate' => 'setPercentageRate', + 'contributorySalary' => 'setContributorySalary', + 'teachersContributions' => 'setTeachersContributions', + 'employersContributions' => 'setEmployersContributions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'tier' => 'getTier', + 'percentageRate' => 'getPercentageRate', + 'contributorySalary' => 'getContributorySalary', + 'teachersContributions' => 'getTeachersContributions', + 'employersContributions' => 'getEmployersContributions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tier', $data ?? [], null); + $this->setIfExists('percentageRate', $data ?? [], null); + $this->setIfExists('contributorySalary', $data ?? [], null); + $this->setIfExists('teachersContributions', $data ?? [], null); + $this->setIfExists('employersContributions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tier + * + * @return float|null + */ + public function getTier(): ?float + { + return $this->container['tier']; + } + + /** + * Sets tier + * + * @param float|null $tier tier + * + * @return $this + */ + public function setTier(?float $tier): static + { + if (is_null($tier)) { + throw new InvalidArgumentException('non-nullable tier cannot be null'); + } + $this->container['tier'] = $tier; + + return $this; + } + + /** + * Gets percentageRate + * + * @return float|null + */ + public function getPercentageRate(): ?float + { + return $this->container['percentageRate']; + } + + /** + * Sets percentageRate + * + * @param float|null $percentageRate percentageRate + * + * @return $this + */ + public function setPercentageRate(?float $percentageRate): static + { + if (is_null($percentageRate)) { + throw new InvalidArgumentException('non-nullable percentageRate cannot be null'); + } + $this->container['percentageRate'] = $percentageRate; + + return $this; + } + + /** + * Gets contributorySalary + * + * @return float|null + */ + public function getContributorySalary(): ?float + { + return $this->container['contributorySalary']; + } + + /** + * Sets contributorySalary + * + * @param float|null $contributorySalary contributorySalary + * + * @return $this + */ + public function setContributorySalary(?float $contributorySalary): static + { + if (is_null($contributorySalary)) { + throw new InvalidArgumentException('non-nullable contributorySalary cannot be null'); + } + $this->container['contributorySalary'] = $contributorySalary; + + return $this; + } + + /** + * Gets teachersContributions + * + * @return float|null + */ + public function getTeachersContributions(): ?float + { + return $this->container['teachersContributions']; + } + + /** + * Sets teachersContributions + * + * @param float|null $teachersContributions teachersContributions + * + * @return $this + */ + public function setTeachersContributions(?float $teachersContributions): static + { + if (is_null($teachersContributions)) { + throw new InvalidArgumentException('non-nullable teachersContributions cannot be null'); + } + $this->container['teachersContributions'] = $teachersContributions; + + return $this; + } + + /** + * Gets employersContributions + * + * @return float|null + */ + public function getEmployersContributions(): ?float + { + return $this->container['employersContributions']; + } + + /** + * Sets employersContributions + * + * @param float|null $employersContributions employersContributions + * + * @return $this + */ + public function setEmployersContributions(?float $employersContributions): static + { + if (is_null($employersContributions)) { + throw new InvalidArgumentException('non-nullable employersContributions cannot be null'); + } + $this->container['employersContributions'] = $employersContributions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TeachersPensionEoyReport.php b/src/Model/TeachersPensionEoyReport.php new file mode 100644 index 0000000..11b0eb8 --- /dev/null +++ b/src/Model/TeachersPensionEoyReport.php @@ -0,0 +1,1143 @@ + + */ +class TeachersPensionEoyReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TeachersPensionEoyReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'pdfFileName' => 'string', + 'establishment' => '\SynergiTech\Staffology\Model\Establishment', + 'lineItems' => '\SynergiTech\Staffology\Model\TeachersPensionEoyLineItem[]', + 'careerAverageFlexibilities' => 'float', + 'additionalPensionPayments' => 'float', + 'additionalContributions' => 'float', + 'teachersContributions' => 'float', + 'employersContributions' => 'float', + 'totalContributions' => 'float', + 'efeArrears' => 'float', + 'prestonContributions' => 'float', + 'tr22ElectionAmounts' => 'float', + 'totalExtraContributions' => 'float', + 'overallBalance' => 'float', + 'employersContributionPercentage' => 'float', + 'totalContributorySalary' => 'float', + 'totalTeachersContributions' => 'float', + 'totalEmployersContributions' => 'float', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'pdfFileName' => null, + 'establishment' => null, + 'lineItems' => null, + 'careerAverageFlexibilities' => 'double', + 'additionalPensionPayments' => 'double', + 'additionalContributions' => 'double', + 'teachersContributions' => 'double', + 'employersContributions' => 'double', + 'totalContributions' => 'double', + 'efeArrears' => 'double', + 'prestonContributions' => 'double', + 'tr22ElectionAmounts' => 'double', + 'totalExtraContributions' => 'double', + 'overallBalance' => 'double', + 'employersContributionPercentage' => 'double', + 'totalContributorySalary' => 'double', + 'totalTeachersContributions' => 'double', + 'totalEmployersContributions' => 'double', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'pdfFileName' => true, + 'establishment' => false, + 'lineItems' => true, + 'careerAverageFlexibilities' => false, + 'additionalPensionPayments' => false, + 'additionalContributions' => false, + 'teachersContributions' => false, + 'employersContributions' => false, + 'totalContributions' => false, + 'efeArrears' => false, + 'prestonContributions' => false, + 'tr22ElectionAmounts' => false, + 'totalExtraContributions' => false, + 'overallBalance' => false, + 'employersContributionPercentage' => false, + 'totalContributorySalary' => false, + 'totalTeachersContributions' => false, + 'totalEmployersContributions' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'pdfFileName' => 'pdfFileName', + 'establishment' => 'establishment', + 'lineItems' => 'lineItems', + 'careerAverageFlexibilities' => 'careerAverageFlexibilities', + 'additionalPensionPayments' => 'additionalPensionPayments', + 'additionalContributions' => 'additionalContributions', + 'teachersContributions' => 'teachersContributions', + 'employersContributions' => 'employersContributions', + 'totalContributions' => 'totalContributions', + 'efeArrears' => 'efeArrears', + 'prestonContributions' => 'prestonContributions', + 'tr22ElectionAmounts' => 'tr22ElectionAmounts', + 'totalExtraContributions' => 'totalExtraContributions', + 'overallBalance' => 'overallBalance', + 'employersContributionPercentage' => 'employersContributionPercentage', + 'totalContributorySalary' => 'totalContributorySalary', + 'totalTeachersContributions' => 'totalTeachersContributions', + 'totalEmployersContributions' => 'totalEmployersContributions', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'pdfFileName' => 'setPdfFileName', + 'establishment' => 'setEstablishment', + 'lineItems' => 'setLineItems', + 'careerAverageFlexibilities' => 'setCareerAverageFlexibilities', + 'additionalPensionPayments' => 'setAdditionalPensionPayments', + 'additionalContributions' => 'setAdditionalContributions', + 'teachersContributions' => 'setTeachersContributions', + 'employersContributions' => 'setEmployersContributions', + 'totalContributions' => 'setTotalContributions', + 'efeArrears' => 'setEfeArrears', + 'prestonContributions' => 'setPrestonContributions', + 'tr22ElectionAmounts' => 'setTr22ElectionAmounts', + 'totalExtraContributions' => 'setTotalExtraContributions', + 'overallBalance' => 'setOverallBalance', + 'employersContributionPercentage' => 'setEmployersContributionPercentage', + 'totalContributorySalary' => 'setTotalContributorySalary', + 'totalTeachersContributions' => 'setTotalTeachersContributions', + 'totalEmployersContributions' => 'setTotalEmployersContributions', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'pdfFileName' => 'getPdfFileName', + 'establishment' => 'getEstablishment', + 'lineItems' => 'getLineItems', + 'careerAverageFlexibilities' => 'getCareerAverageFlexibilities', + 'additionalPensionPayments' => 'getAdditionalPensionPayments', + 'additionalContributions' => 'getAdditionalContributions', + 'teachersContributions' => 'getTeachersContributions', + 'employersContributions' => 'getEmployersContributions', + 'totalContributions' => 'getTotalContributions', + 'efeArrears' => 'getEfeArrears', + 'prestonContributions' => 'getPrestonContributions', + 'tr22ElectionAmounts' => 'getTr22ElectionAmounts', + 'totalExtraContributions' => 'getTotalExtraContributions', + 'overallBalance' => 'getOverallBalance', + 'employersContributionPercentage' => 'getEmployersContributionPercentage', + 'totalContributorySalary' => 'getTotalContributorySalary', + 'totalTeachersContributions' => 'getTotalTeachersContributions', + 'totalEmployersContributions' => 'getTotalEmployersContributions', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pdfFileName', $data ?? [], null); + $this->setIfExists('establishment', $data ?? [], null); + $this->setIfExists('lineItems', $data ?? [], null); + $this->setIfExists('careerAverageFlexibilities', $data ?? [], null); + $this->setIfExists('additionalPensionPayments', $data ?? [], null); + $this->setIfExists('additionalContributions', $data ?? [], null); + $this->setIfExists('teachersContributions', $data ?? [], null); + $this->setIfExists('employersContributions', $data ?? [], null); + $this->setIfExists('totalContributions', $data ?? [], null); + $this->setIfExists('efeArrears', $data ?? [], null); + $this->setIfExists('prestonContributions', $data ?? [], null); + $this->setIfExists('tr22ElectionAmounts', $data ?? [], null); + $this->setIfExists('totalExtraContributions', $data ?? [], null); + $this->setIfExists('overallBalance', $data ?? [], null); + $this->setIfExists('employersContributionPercentage', $data ?? [], null); + $this->setIfExists('totalContributorySalary', $data ?? [], null); + $this->setIfExists('totalTeachersContributions', $data ?? [], null); + $this->setIfExists('totalEmployersContributions', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pdfFileName + * + * @return string|null + */ + public function getPdfFileName(): ?string + { + return $this->container['pdfFileName']; + } + + /** + * Sets pdfFileName + * + * @param string|null $pdfFileName pdfFileName + * + * @return $this + */ + public function setPdfFileName(?string $pdfFileName): static + { + if (is_null($pdfFileName)) { + array_push($this->openAPINullablesSetToNull, 'pdfFileName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdfFileName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pdfFileName'] = $pdfFileName; + + return $this; + } + + /** + * Gets establishment + * + * @return \SynergiTech\Staffology\Model\Establishment|null + */ + public function getEstablishment(): ?\SynergiTech\Staffology\Model\Establishment + { + return $this->container['establishment']; + } + + /** + * Sets establishment + * + * @param \SynergiTech\Staffology\Model\Establishment|null $establishment establishment + * + * @return $this + */ + public function setEstablishment(?\SynergiTech\Staffology\Model\Establishment $establishment): static + { + if (is_null($establishment)) { + throw new InvalidArgumentException('non-nullable establishment cannot be null'); + } + $this->container['establishment'] = $establishment; + + return $this; + } + + /** + * Gets lineItems + * + * @return \SynergiTech\Staffology\Model\TeachersPensionEoyLineItem[]|null + */ + public function getLineItems(): ?array + { + return $this->container['lineItems']; + } + + /** + * Sets lineItems + * + * @param \SynergiTech\Staffology\Model\TeachersPensionEoyLineItem[]|null $lineItems lineItems + * + * @return $this + */ + public function setLineItems(?array $lineItems): static + { + if (is_null($lineItems)) { + array_push($this->openAPINullablesSetToNull, 'lineItems'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lineItems', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lineItems'] = $lineItems; + + return $this; + } + + /** + * Gets careerAverageFlexibilities + * + * @return float|null + */ + public function getCareerAverageFlexibilities(): ?float + { + return $this->container['careerAverageFlexibilities']; + } + + /** + * Sets careerAverageFlexibilities + * + * @param float|null $careerAverageFlexibilities careerAverageFlexibilities + * + * @return $this + */ + public function setCareerAverageFlexibilities(?float $careerAverageFlexibilities): static + { + if (is_null($careerAverageFlexibilities)) { + throw new InvalidArgumentException('non-nullable careerAverageFlexibilities cannot be null'); + } + $this->container['careerAverageFlexibilities'] = $careerAverageFlexibilities; + + return $this; + } + + /** + * Gets additionalPensionPayments + * + * @return float|null + */ + public function getAdditionalPensionPayments(): ?float + { + return $this->container['additionalPensionPayments']; + } + + /** + * Sets additionalPensionPayments + * + * @param float|null $additionalPensionPayments additionalPensionPayments + * + * @return $this + */ + public function setAdditionalPensionPayments(?float $additionalPensionPayments): static + { + if (is_null($additionalPensionPayments)) { + throw new InvalidArgumentException('non-nullable additionalPensionPayments cannot be null'); + } + $this->container['additionalPensionPayments'] = $additionalPensionPayments; + + return $this; + } + + /** + * Gets additionalContributions + * + * @return float|null + */ + public function getAdditionalContributions(): ?float + { + return $this->container['additionalContributions']; + } + + /** + * Sets additionalContributions + * + * @param float|null $additionalContributions additionalContributions + * + * @return $this + */ + public function setAdditionalContributions(?float $additionalContributions): static + { + if (is_null($additionalContributions)) { + throw new InvalidArgumentException('non-nullable additionalContributions cannot be null'); + } + $this->container['additionalContributions'] = $additionalContributions; + + return $this; + } + + /** + * Gets teachersContributions + * + * @return float|null + */ + public function getTeachersContributions(): ?float + { + return $this->container['teachersContributions']; + } + + /** + * Sets teachersContributions + * + * @param float|null $teachersContributions teachersContributions + * + * @return $this + */ + public function setTeachersContributions(?float $teachersContributions): static + { + if (is_null($teachersContributions)) { + throw new InvalidArgumentException('non-nullable teachersContributions cannot be null'); + } + $this->container['teachersContributions'] = $teachersContributions; + + return $this; + } + + /** + * Gets employersContributions + * + * @return float|null + */ + public function getEmployersContributions(): ?float + { + return $this->container['employersContributions']; + } + + /** + * Sets employersContributions + * + * @param float|null $employersContributions employersContributions + * + * @return $this + */ + public function setEmployersContributions(?float $employersContributions): static + { + if (is_null($employersContributions)) { + throw new InvalidArgumentException('non-nullable employersContributions cannot be null'); + } + $this->container['employersContributions'] = $employersContributions; + + return $this; + } + + /** + * Gets totalContributions + * + * @return float|null + */ + public function getTotalContributions(): ?float + { + return $this->container['totalContributions']; + } + + /** + * Sets totalContributions + * + * @param float|null $totalContributions totalContributions + * + * @return $this + */ + public function setTotalContributions(?float $totalContributions): static + { + if (is_null($totalContributions)) { + throw new InvalidArgumentException('non-nullable totalContributions cannot be null'); + } + $this->container['totalContributions'] = $totalContributions; + + return $this; + } + + /** + * Gets efeArrears + * + * @return float|null + */ + public function getEfeArrears(): ?float + { + return $this->container['efeArrears']; + } + + /** + * Sets efeArrears + * + * @param float|null $efeArrears efeArrears + * + * @return $this + */ + public function setEfeArrears(?float $efeArrears): static + { + if (is_null($efeArrears)) { + throw new InvalidArgumentException('non-nullable efeArrears cannot be null'); + } + $this->container['efeArrears'] = $efeArrears; + + return $this; + } + + /** + * Gets prestonContributions + * + * @return float|null + */ + public function getPrestonContributions(): ?float + { + return $this->container['prestonContributions']; + } + + /** + * Sets prestonContributions + * + * @param float|null $prestonContributions prestonContributions + * + * @return $this + */ + public function setPrestonContributions(?float $prestonContributions): static + { + if (is_null($prestonContributions)) { + throw new InvalidArgumentException('non-nullable prestonContributions cannot be null'); + } + $this->container['prestonContributions'] = $prestonContributions; + + return $this; + } + + /** + * Gets tr22ElectionAmounts + * + * @return float|null + */ + public function getTr22ElectionAmounts(): ?float + { + return $this->container['tr22ElectionAmounts']; + } + + /** + * Sets tr22ElectionAmounts + * + * @param float|null $tr22ElectionAmounts tr22ElectionAmounts + * + * @return $this + */ + public function setTr22ElectionAmounts(?float $tr22ElectionAmounts): static + { + if (is_null($tr22ElectionAmounts)) { + throw new InvalidArgumentException('non-nullable tr22ElectionAmounts cannot be null'); + } + $this->container['tr22ElectionAmounts'] = $tr22ElectionAmounts; + + return $this; + } + + /** + * Gets totalExtraContributions + * + * @return float|null + */ + public function getTotalExtraContributions(): ?float + { + return $this->container['totalExtraContributions']; + } + + /** + * Sets totalExtraContributions + * + * @param float|null $totalExtraContributions totalExtraContributions + * + * @return $this + */ + public function setTotalExtraContributions(?float $totalExtraContributions): static + { + if (is_null($totalExtraContributions)) { + throw new InvalidArgumentException('non-nullable totalExtraContributions cannot be null'); + } + $this->container['totalExtraContributions'] = $totalExtraContributions; + + return $this; + } + + /** + * Gets overallBalance + * + * @return float|null + */ + public function getOverallBalance(): ?float + { + return $this->container['overallBalance']; + } + + /** + * Sets overallBalance + * + * @param float|null $overallBalance overallBalance + * + * @return $this + */ + public function setOverallBalance(?float $overallBalance): static + { + if (is_null($overallBalance)) { + throw new InvalidArgumentException('non-nullable overallBalance cannot be null'); + } + $this->container['overallBalance'] = $overallBalance; + + return $this; + } + + /** + * Gets employersContributionPercentage + * + * @return float|null + */ + public function getEmployersContributionPercentage(): ?float + { + return $this->container['employersContributionPercentage']; + } + + /** + * Sets employersContributionPercentage + * + * @param float|null $employersContributionPercentage employersContributionPercentage + * + * @return $this + */ + public function setEmployersContributionPercentage(?float $employersContributionPercentage): static + { + if (is_null($employersContributionPercentage)) { + throw new InvalidArgumentException('non-nullable employersContributionPercentage cannot be null'); + } + $this->container['employersContributionPercentage'] = $employersContributionPercentage; + + return $this; + } + + /** + * Gets totalContributorySalary + * + * @return float|null + */ + public function getTotalContributorySalary(): ?float + { + return $this->container['totalContributorySalary']; + } + + /** + * Sets totalContributorySalary + * + * @param float|null $totalContributorySalary totalContributorySalary + * + * @return $this + */ + public function setTotalContributorySalary(?float $totalContributorySalary): static + { + if (is_null($totalContributorySalary)) { + throw new InvalidArgumentException('non-nullable totalContributorySalary cannot be null'); + } + $this->container['totalContributorySalary'] = $totalContributorySalary; + + return $this; + } + + /** + * Gets totalTeachersContributions + * + * @return float|null + */ + public function getTotalTeachersContributions(): ?float + { + return $this->container['totalTeachersContributions']; + } + + /** + * Sets totalTeachersContributions + * + * @param float|null $totalTeachersContributions totalTeachersContributions + * + * @return $this + */ + public function setTotalTeachersContributions(?float $totalTeachersContributions): static + { + if (is_null($totalTeachersContributions)) { + throw new InvalidArgumentException('non-nullable totalTeachersContributions cannot be null'); + } + $this->container['totalTeachersContributions'] = $totalTeachersContributions; + + return $this; + } + + /** + * Gets totalEmployersContributions + * + * @return float|null + */ + public function getTotalEmployersContributions(): ?float + { + return $this->container['totalEmployersContributions']; + } + + /** + * Sets totalEmployersContributions + * + * @param float|null $totalEmployersContributions totalEmployersContributions + * + * @return $this + */ + public function setTotalEmployersContributions(?float $totalEmployersContributions): static + { + if (is_null($totalEmployersContributions)) { + throw new InvalidArgumentException('non-nullable totalEmployersContributions cannot be null'); + } + $this->container['totalEmployersContributions'] = $totalEmployersContributions; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TeachersPensionEoyReportReportResponse.php b/src/Model/TeachersPensionEoyReportReportResponse.php new file mode 100644 index 0000000..8e04374 --- /dev/null +++ b/src/Model/TeachersPensionEoyReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class TeachersPensionEoyReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TeachersPensionEoyReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\TeachersPensionEoyReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\TeachersPensionEoyReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\TeachersPensionEoyReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\TeachersPensionEoyReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\TeachersPensionEoyReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Tenant.php b/src/Model/Tenant.php new file mode 100644 index 0000000..a58e22c --- /dev/null +++ b/src/Model/Tenant.php @@ -0,0 +1,1495 @@ + + */ +class Tenant implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Tenant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'brandCode' => 'string', + 'appName' => 'string', + 'homeUrl' => 'string', + 'headContent' => 'string', + 'logOutUrl' => 'string', + 'loginImgUrl' => 'string', + 'homeImgUrl' => 'string', + 'favIcon' => 'string', + 'cssColorsFile' => 'string', + 'cssFile' => 'string', + 'mailingList' => 'bool', + 'htmlInsertions' => '\SynergiTech\Staffology\Model\TenantHtmlInsertion[]', + 'mailSettings' => '\SynergiTech\Staffology\Model\MailSettings', + 'signupUrl' => 'string', + 'termsUrl' => 'string', + 'helpUrl' => 'string', + 'supportEmail' => 'string', + 'newUserSignupEmail' => 'string', + 'approveNewUsers' => 'bool', + 'enableBureauFeatures' => 'bool', + 'requireDdMandateBeforeAllowingBillableActivity' => 'bool', + 'whiteLabelMode' => 'bool', + 'enableReportWriterFeature' => 'bool', + 'disableEvc' => 'bool', + 'tenantOwnsBilling' => 'bool', + 'billingSettings' => '\SynergiTech\Staffology\Model\TenantBillingSettings', + 'usersCanManageAccountSecuritySettings' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'brandCode' => null, + 'appName' => null, + 'homeUrl' => null, + 'headContent' => null, + 'logOutUrl' => null, + 'loginImgUrl' => null, + 'homeImgUrl' => null, + 'favIcon' => null, + 'cssColorsFile' => null, + 'cssFile' => null, + 'mailingList' => null, + 'htmlInsertions' => null, + 'mailSettings' => null, + 'signupUrl' => null, + 'termsUrl' => null, + 'helpUrl' => null, + 'supportEmail' => 'email', + 'newUserSignupEmail' => 'email', + 'approveNewUsers' => null, + 'enableBureauFeatures' => null, + 'requireDdMandateBeforeAllowingBillableActivity' => null, + 'whiteLabelMode' => null, + 'enableReportWriterFeature' => null, + 'disableEvc' => null, + 'tenantOwnsBilling' => null, + 'billingSettings' => null, + 'usersCanManageAccountSecuritySettings' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'brandCode' => true, + 'appName' => true, + 'homeUrl' => true, + 'headContent' => true, + 'logOutUrl' => true, + 'loginImgUrl' => true, + 'homeImgUrl' => true, + 'favIcon' => true, + 'cssColorsFile' => true, + 'cssFile' => true, + 'mailingList' => false, + 'htmlInsertions' => true, + 'mailSettings' => false, + 'signupUrl' => true, + 'termsUrl' => true, + 'helpUrl' => true, + 'supportEmail' => true, + 'newUserSignupEmail' => true, + 'approveNewUsers' => false, + 'enableBureauFeatures' => false, + 'requireDdMandateBeforeAllowingBillableActivity' => false, + 'whiteLabelMode' => false, + 'enableReportWriterFeature' => false, + 'disableEvc' => false, + 'tenantOwnsBilling' => false, + 'billingSettings' => false, + 'usersCanManageAccountSecuritySettings' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'brandCode' => 'brandCode', + 'appName' => 'appName', + 'homeUrl' => 'homeUrl', + 'headContent' => 'headContent', + 'logOutUrl' => 'logOutUrl', + 'loginImgUrl' => 'loginImgUrl', + 'homeImgUrl' => 'homeImgUrl', + 'favIcon' => 'favIcon', + 'cssColorsFile' => 'cssColorsFile', + 'cssFile' => 'cssFile', + 'mailingList' => 'mailingList', + 'htmlInsertions' => 'htmlInsertions', + 'mailSettings' => 'mailSettings', + 'signupUrl' => 'signupUrl', + 'termsUrl' => 'termsUrl', + 'helpUrl' => 'helpUrl', + 'supportEmail' => 'supportEmail', + 'newUserSignupEmail' => 'newUserSignupEmail', + 'approveNewUsers' => 'approveNewUsers', + 'enableBureauFeatures' => 'enableBureauFeatures', + 'requireDdMandateBeforeAllowingBillableActivity' => 'requireDdMandateBeforeAllowingBillableActivity', + 'whiteLabelMode' => 'whiteLabelMode', + 'enableReportWriterFeature' => 'enableReportWriterFeature', + 'disableEvc' => 'disableEvc', + 'tenantOwnsBilling' => 'tenantOwnsBilling', + 'billingSettings' => 'billingSettings', + 'usersCanManageAccountSecuritySettings' => 'usersCanManageAccountSecuritySettings', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'brandCode' => 'setBrandCode', + 'appName' => 'setAppName', + 'homeUrl' => 'setHomeUrl', + 'headContent' => 'setHeadContent', + 'logOutUrl' => 'setLogOutUrl', + 'loginImgUrl' => 'setLoginImgUrl', + 'homeImgUrl' => 'setHomeImgUrl', + 'favIcon' => 'setFavIcon', + 'cssColorsFile' => 'setCssColorsFile', + 'cssFile' => 'setCssFile', + 'mailingList' => 'setMailingList', + 'htmlInsertions' => 'setHtmlInsertions', + 'mailSettings' => 'setMailSettings', + 'signupUrl' => 'setSignupUrl', + 'termsUrl' => 'setTermsUrl', + 'helpUrl' => 'setHelpUrl', + 'supportEmail' => 'setSupportEmail', + 'newUserSignupEmail' => 'setNewUserSignupEmail', + 'approveNewUsers' => 'setApproveNewUsers', + 'enableBureauFeatures' => 'setEnableBureauFeatures', + 'requireDdMandateBeforeAllowingBillableActivity' => 'setRequireDdMandateBeforeAllowingBillableActivity', + 'whiteLabelMode' => 'setWhiteLabelMode', + 'enableReportWriterFeature' => 'setEnableReportWriterFeature', + 'disableEvc' => 'setDisableEvc', + 'tenantOwnsBilling' => 'setTenantOwnsBilling', + 'billingSettings' => 'setBillingSettings', + 'usersCanManageAccountSecuritySettings' => 'setUsersCanManageAccountSecuritySettings', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'brandCode' => 'getBrandCode', + 'appName' => 'getAppName', + 'homeUrl' => 'getHomeUrl', + 'headContent' => 'getHeadContent', + 'logOutUrl' => 'getLogOutUrl', + 'loginImgUrl' => 'getLoginImgUrl', + 'homeImgUrl' => 'getHomeImgUrl', + 'favIcon' => 'getFavIcon', + 'cssColorsFile' => 'getCssColorsFile', + 'cssFile' => 'getCssFile', + 'mailingList' => 'getMailingList', + 'htmlInsertions' => 'getHtmlInsertions', + 'mailSettings' => 'getMailSettings', + 'signupUrl' => 'getSignupUrl', + 'termsUrl' => 'getTermsUrl', + 'helpUrl' => 'getHelpUrl', + 'supportEmail' => 'getSupportEmail', + 'newUserSignupEmail' => 'getNewUserSignupEmail', + 'approveNewUsers' => 'getApproveNewUsers', + 'enableBureauFeatures' => 'getEnableBureauFeatures', + 'requireDdMandateBeforeAllowingBillableActivity' => 'getRequireDdMandateBeforeAllowingBillableActivity', + 'whiteLabelMode' => 'getWhiteLabelMode', + 'enableReportWriterFeature' => 'getEnableReportWriterFeature', + 'disableEvc' => 'getDisableEvc', + 'tenantOwnsBilling' => 'getTenantOwnsBilling', + 'billingSettings' => 'getBillingSettings', + 'usersCanManageAccountSecuritySettings' => 'getUsersCanManageAccountSecuritySettings', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brandCode', $data ?? [], null); + $this->setIfExists('appName', $data ?? [], null); + $this->setIfExists('homeUrl', $data ?? [], null); + $this->setIfExists('headContent', $data ?? [], null); + $this->setIfExists('logOutUrl', $data ?? [], null); + $this->setIfExists('loginImgUrl', $data ?? [], null); + $this->setIfExists('homeImgUrl', $data ?? [], null); + $this->setIfExists('favIcon', $data ?? [], null); + $this->setIfExists('cssColorsFile', $data ?? [], null); + $this->setIfExists('cssFile', $data ?? [], null); + $this->setIfExists('mailingList', $data ?? [], null); + $this->setIfExists('htmlInsertions', $data ?? [], null); + $this->setIfExists('mailSettings', $data ?? [], null); + $this->setIfExists('signupUrl', $data ?? [], null); + $this->setIfExists('termsUrl', $data ?? [], null); + $this->setIfExists('helpUrl', $data ?? [], null); + $this->setIfExists('supportEmail', $data ?? [], null); + $this->setIfExists('newUserSignupEmail', $data ?? [], null); + $this->setIfExists('approveNewUsers', $data ?? [], null); + $this->setIfExists('enableBureauFeatures', $data ?? [], null); + $this->setIfExists('requireDdMandateBeforeAllowingBillableActivity', $data ?? [], null); + $this->setIfExists('whiteLabelMode', $data ?? [], null); + $this->setIfExists('enableReportWriterFeature', $data ?? [], null); + $this->setIfExists('disableEvc', $data ?? [], null); + $this->setIfExists('tenantOwnsBilling', $data ?? [], null); + $this->setIfExists('billingSettings', $data ?? [], null); + $this->setIfExists('usersCanManageAccountSecuritySettings', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['brandCode']) && (mb_strlen($this->container['brandCode']) > 100)) { + $invalidProperties[] = "invalid value for 'brandCode', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['logOutUrl']) && (mb_strlen($this->container['logOutUrl']) > 150)) { + $invalidProperties[] = "invalid value for 'logOutUrl', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['signupUrl']) && (mb_strlen($this->container['signupUrl']) > 150)) { + $invalidProperties[] = "invalid value for 'signupUrl', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['termsUrl']) && (mb_strlen($this->container['termsUrl']) > 150)) { + $invalidProperties[] = "invalid value for 'termsUrl', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['helpUrl']) && (mb_strlen($this->container['helpUrl']) > 250)) { + $invalidProperties[] = "invalid value for 'helpUrl', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['supportEmail']) && (mb_strlen($this->container['supportEmail']) > 150)) { + $invalidProperties[] = "invalid value for 'supportEmail', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['newUserSignupEmail']) && (mb_strlen($this->container['newUserSignupEmail']) > 150)) { + $invalidProperties[] = "invalid value for 'newUserSignupEmail', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brandCode + * + * @return string|null + */ + public function getBrandCode(): ?string + { + return $this->container['brandCode']; + } + + /** + * Sets brandCode + * + * @param string|null $brandCode [readonly] + * + * @return $this + */ + public function setBrandCode(?string $brandCode): static + { + if (is_null($brandCode)) { + array_push($this->openAPINullablesSetToNull, 'brandCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('brandCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($brandCode) && (mb_strlen($brandCode) > 100)) { + throw new InvalidArgumentException('invalid length for $brandCode when calling Tenant., must be smaller than or equal to 100.'); + } + + $this->container['brandCode'] = $brandCode; + + return $this; + } + + /** + * Gets appName + * + * @return string|null + */ + public function getAppName(): ?string + { + return $this->container['appName']; + } + + /** + * Sets appName + * + * @param string|null $appName appName + * + * @return $this + */ + public function setAppName(?string $appName): static + { + if (is_null($appName)) { + array_push($this->openAPINullablesSetToNull, 'appName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('appName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['appName'] = $appName; + + return $this; + } + + /** + * Gets homeUrl + * + * @return string|null + */ + public function getHomeUrl(): ?string + { + return $this->container['homeUrl']; + } + + /** + * Sets homeUrl + * + * @param string|null $homeUrl homeUrl + * + * @return $this + */ + public function setHomeUrl(?string $homeUrl): static + { + if (is_null($homeUrl)) { + array_push($this->openAPINullablesSetToNull, 'homeUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('homeUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['homeUrl'] = $homeUrl; + + return $this; + } + + /** + * Gets headContent + * + * @return string|null + */ + public function getHeadContent(): ?string + { + return $this->container['headContent']; + } + + /** + * Sets headContent + * + * @param string|null $headContent headContent + * + * @return $this + */ + public function setHeadContent(?string $headContent): static + { + if (is_null($headContent)) { + array_push($this->openAPINullablesSetToNull, 'headContent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('headContent', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['headContent'] = $headContent; + + return $this; + } + + /** + * Gets logOutUrl + * + * @return string|null + */ + public function getLogOutUrl(): ?string + { + return $this->container['logOutUrl']; + } + + /** + * Sets logOutUrl + * + * @param string|null $logOutUrl logOutUrl + * + * @return $this + */ + public function setLogOutUrl(?string $logOutUrl): static + { + if (is_null($logOutUrl)) { + array_push($this->openAPINullablesSetToNull, 'logOutUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('logOutUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($logOutUrl) && (mb_strlen($logOutUrl) > 150)) { + throw new InvalidArgumentException('invalid length for $logOutUrl when calling Tenant., must be smaller than or equal to 150.'); + } + + $this->container['logOutUrl'] = $logOutUrl; + + return $this; + } + + /** + * Gets loginImgUrl + * + * @return string|null + */ + public function getLoginImgUrl(): ?string + { + return $this->container['loginImgUrl']; + } + + /** + * Sets loginImgUrl + * + * @param string|null $loginImgUrl [readonly] + * + * @return $this + */ + public function setLoginImgUrl(?string $loginImgUrl): static + { + if (is_null($loginImgUrl)) { + array_push($this->openAPINullablesSetToNull, 'loginImgUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('loginImgUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['loginImgUrl'] = $loginImgUrl; + + return $this; + } + + /** + * Gets homeImgUrl + * + * @return string|null + */ + public function getHomeImgUrl(): ?string + { + return $this->container['homeImgUrl']; + } + + /** + * Sets homeImgUrl + * + * @param string|null $homeImgUrl [readonly] + * + * @return $this + */ + public function setHomeImgUrl(?string $homeImgUrl): static + { + if (is_null($homeImgUrl)) { + array_push($this->openAPINullablesSetToNull, 'homeImgUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('homeImgUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['homeImgUrl'] = $homeImgUrl; + + return $this; + } + + /** + * Gets favIcon + * + * @return string|null + */ + public function getFavIcon(): ?string + { + return $this->container['favIcon']; + } + + /** + * Sets favIcon + * + * @param string|null $favIcon [readonly] + * + * @return $this + */ + public function setFavIcon(?string $favIcon): static + { + if (is_null($favIcon)) { + array_push($this->openAPINullablesSetToNull, 'favIcon'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('favIcon', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['favIcon'] = $favIcon; + + return $this; + } + + /** + * Gets cssColorsFile + * + * @return string|null + */ + public function getCssColorsFile(): ?string + { + return $this->container['cssColorsFile']; + } + + /** + * Sets cssColorsFile + * + * @param string|null $cssColorsFile [readonly] + * + * @return $this + */ + public function setCssColorsFile(?string $cssColorsFile): static + { + if (is_null($cssColorsFile)) { + array_push($this->openAPINullablesSetToNull, 'cssColorsFile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cssColorsFile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cssColorsFile'] = $cssColorsFile; + + return $this; + } + + /** + * Gets cssFile + * + * @return string|null + */ + public function getCssFile(): ?string + { + return $this->container['cssFile']; + } + + /** + * Sets cssFile + * + * @param string|null $cssFile [readonly] + * + * @return $this + */ + public function setCssFile(?string $cssFile): static + { + if (is_null($cssFile)) { + array_push($this->openAPINullablesSetToNull, 'cssFile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cssFile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cssFile'] = $cssFile; + + return $this; + } + + /** + * Gets mailingList + * + * @return bool|null + */ + public function getMailingList(): ?bool + { + return $this->container['mailingList']; + } + + /** + * Sets mailingList + * + * @param bool|null $mailingList mailingList + * + * @return $this + */ + public function setMailingList(?bool $mailingList): static + { + if (is_null($mailingList)) { + throw new InvalidArgumentException('non-nullable mailingList cannot be null'); + } + $this->container['mailingList'] = $mailingList; + + return $this; + } + + /** + * Gets htmlInsertions + * + * @return \SynergiTech\Staffology\Model\TenantHtmlInsertion[]|null + */ + public function getHtmlInsertions(): ?array + { + return $this->container['htmlInsertions']; + } + + /** + * Sets htmlInsertions + * + * @param \SynergiTech\Staffology\Model\TenantHtmlInsertion[]|null $htmlInsertions htmlInsertions + * + * @return $this + */ + public function setHtmlInsertions(?array $htmlInsertions): static + { + if (is_null($htmlInsertions)) { + array_push($this->openAPINullablesSetToNull, 'htmlInsertions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('htmlInsertions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['htmlInsertions'] = $htmlInsertions; + + return $this; + } + + /** + * Gets mailSettings + * + * @return \SynergiTech\Staffology\Model\MailSettings|null + */ + public function getMailSettings(): ?\SynergiTech\Staffology\Model\MailSettings + { + return $this->container['mailSettings']; + } + + /** + * Sets mailSettings + * + * @param \SynergiTech\Staffology\Model\MailSettings|null $mailSettings mailSettings + * + * @return $this + */ + public function setMailSettings(?\SynergiTech\Staffology\Model\MailSettings $mailSettings): static + { + if (is_null($mailSettings)) { + throw new InvalidArgumentException('non-nullable mailSettings cannot be null'); + } + $this->container['mailSettings'] = $mailSettings; + + return $this; + } + + /** + * Gets signupUrl + * + * @return string|null + */ + public function getSignupUrl(): ?string + { + return $this->container['signupUrl']; + } + + /** + * Sets signupUrl + * + * @param string|null $signupUrl signupUrl + * + * @return $this + */ + public function setSignupUrl(?string $signupUrl): static + { + if (is_null($signupUrl)) { + array_push($this->openAPINullablesSetToNull, 'signupUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signupUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($signupUrl) && (mb_strlen($signupUrl) > 150)) { + throw new InvalidArgumentException('invalid length for $signupUrl when calling Tenant., must be smaller than or equal to 150.'); + } + + $this->container['signupUrl'] = $signupUrl; + + return $this; + } + + /** + * Gets termsUrl + * + * @return string|null + */ + public function getTermsUrl(): ?string + { + return $this->container['termsUrl']; + } + + /** + * Sets termsUrl + * + * @param string|null $termsUrl termsUrl + * + * @return $this + */ + public function setTermsUrl(?string $termsUrl): static + { + if (is_null($termsUrl)) { + array_push($this->openAPINullablesSetToNull, 'termsUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('termsUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($termsUrl) && (mb_strlen($termsUrl) > 150)) { + throw new InvalidArgumentException('invalid length for $termsUrl when calling Tenant., must be smaller than or equal to 150.'); + } + + $this->container['termsUrl'] = $termsUrl; + + return $this; + } + + /** + * Gets helpUrl + * + * @return string|null + */ + public function getHelpUrl(): ?string + { + return $this->container['helpUrl']; + } + + /** + * Sets helpUrl + * + * @param string|null $helpUrl helpUrl + * + * @return $this + */ + public function setHelpUrl(?string $helpUrl): static + { + if (is_null($helpUrl)) { + array_push($this->openAPINullablesSetToNull, 'helpUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('helpUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($helpUrl) && (mb_strlen($helpUrl) > 250)) { + throw new InvalidArgumentException('invalid length for $helpUrl when calling Tenant., must be smaller than or equal to 250.'); + } + + $this->container['helpUrl'] = $helpUrl; + + return $this; + } + + /** + * Gets supportEmail + * + * @return string|null + */ + public function getSupportEmail(): ?string + { + return $this->container['supportEmail']; + } + + /** + * Sets supportEmail + * + * @param string|null $supportEmail supportEmail + * + * @return $this + */ + public function setSupportEmail(?string $supportEmail): static + { + if (is_null($supportEmail)) { + array_push($this->openAPINullablesSetToNull, 'supportEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('supportEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($supportEmail) && (mb_strlen($supportEmail) > 150)) { + throw new InvalidArgumentException('invalid length for $supportEmail when calling Tenant., must be smaller than or equal to 150.'); + } + + $this->container['supportEmail'] = $supportEmail; + + return $this; + } + + /** + * Gets newUserSignupEmail + * + * @return string|null + */ + public function getNewUserSignupEmail(): ?string + { + return $this->container['newUserSignupEmail']; + } + + /** + * Sets newUserSignupEmail + * + * @param string|null $newUserSignupEmail newUserSignupEmail + * + * @return $this + */ + public function setNewUserSignupEmail(?string $newUserSignupEmail): static + { + if (is_null($newUserSignupEmail)) { + array_push($this->openAPINullablesSetToNull, 'newUserSignupEmail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('newUserSignupEmail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($newUserSignupEmail) && (mb_strlen($newUserSignupEmail) > 150)) { + throw new InvalidArgumentException('invalid length for $newUserSignupEmail when calling Tenant., must be smaller than or equal to 150.'); + } + + $this->container['newUserSignupEmail'] = $newUserSignupEmail; + + return $this; + } + + /** + * Gets approveNewUsers + * + * @return bool|null + */ + public function getApproveNewUsers(): ?bool + { + return $this->container['approveNewUsers']; + } + + /** + * Sets approveNewUsers + * + * @param bool|null $approveNewUsers approveNewUsers + * + * @return $this + */ + public function setApproveNewUsers(?bool $approveNewUsers): static + { + if (is_null($approveNewUsers)) { + throw new InvalidArgumentException('non-nullable approveNewUsers cannot be null'); + } + $this->container['approveNewUsers'] = $approveNewUsers; + + return $this; + } + + /** + * Gets enableBureauFeatures + * + * @return bool|null + */ + public function getEnableBureauFeatures(): ?bool + { + return $this->container['enableBureauFeatures']; + } + + /** + * Sets enableBureauFeatures + * + * @param bool|null $enableBureauFeatures enableBureauFeatures + * + * @return $this + */ + public function setEnableBureauFeatures(?bool $enableBureauFeatures): static + { + if (is_null($enableBureauFeatures)) { + throw new InvalidArgumentException('non-nullable enableBureauFeatures cannot be null'); + } + $this->container['enableBureauFeatures'] = $enableBureauFeatures; + + return $this; + } + + /** + * Gets requireDdMandateBeforeAllowingBillableActivity + * + * @return bool|null + */ + public function getRequireDdMandateBeforeAllowingBillableActivity(): ?bool + { + return $this->container['requireDdMandateBeforeAllowingBillableActivity']; + } + + /** + * Sets requireDdMandateBeforeAllowingBillableActivity + * + * @param bool|null $requireDdMandateBeforeAllowingBillableActivity requireDdMandateBeforeAllowingBillableActivity + * + * @return $this + */ + public function setRequireDdMandateBeforeAllowingBillableActivity(?bool $requireDdMandateBeforeAllowingBillableActivity): static + { + if (is_null($requireDdMandateBeforeAllowingBillableActivity)) { + throw new InvalidArgumentException('non-nullable requireDdMandateBeforeAllowingBillableActivity cannot be null'); + } + $this->container['requireDdMandateBeforeAllowingBillableActivity'] = $requireDdMandateBeforeAllowingBillableActivity; + + return $this; + } + + /** + * Gets whiteLabelMode + * + * @return bool|null + */ + public function getWhiteLabelMode(): ?bool + { + return $this->container['whiteLabelMode']; + } + + /** + * Sets whiteLabelMode + * + * @param bool|null $whiteLabelMode whiteLabelMode + * + * @return $this + */ + public function setWhiteLabelMode(?bool $whiteLabelMode): static + { + if (is_null($whiteLabelMode)) { + throw new InvalidArgumentException('non-nullable whiteLabelMode cannot be null'); + } + $this->container['whiteLabelMode'] = $whiteLabelMode; + + return $this; + } + + /** + * Gets enableReportWriterFeature + * + * @return bool|null + */ + public function getEnableReportWriterFeature(): ?bool + { + return $this->container['enableReportWriterFeature']; + } + + /** + * Sets enableReportWriterFeature + * + * @param bool|null $enableReportWriterFeature Indicates if the Report Writer feature is enabled for the tenant. + * + * @return $this + */ + public function setEnableReportWriterFeature(?bool $enableReportWriterFeature): static + { + if (is_null($enableReportWriterFeature)) { + throw new InvalidArgumentException('non-nullable enableReportWriterFeature cannot be null'); + } + $this->container['enableReportWriterFeature'] = $enableReportWriterFeature; + + return $this; + } + + /** + * Gets disableEvc + * + * @return bool|null + */ + public function getDisableEvc(): ?bool + { + return $this->container['disableEvc']; + } + + /** + * Sets disableEvc + * + * @param bool|null $disableEvc Indicates whether FPS should be submitted to EVC for employees/employers under this tenant. + * + * @return $this + */ + public function setDisableEvc(?bool $disableEvc): static + { + if (is_null($disableEvc)) { + throw new InvalidArgumentException('non-nullable disableEvc cannot be null'); + } + $this->container['disableEvc'] = $disableEvc; + + return $this; + } + + /** + * Gets tenantOwnsBilling + * + * @return bool|null + */ + public function getTenantOwnsBilling(): ?bool + { + return $this->container['tenantOwnsBilling']; + } + + /** + * Sets tenantOwnsBilling + * + * @param bool|null $tenantOwnsBilling [readonly] + * + * @return $this + */ + public function setTenantOwnsBilling(?bool $tenantOwnsBilling): static + { + if (is_null($tenantOwnsBilling)) { + throw new InvalidArgumentException('non-nullable tenantOwnsBilling cannot be null'); + } + $this->container['tenantOwnsBilling'] = $tenantOwnsBilling; + + return $this; + } + + /** + * Gets billingSettings + * + * @return \SynergiTech\Staffology\Model\TenantBillingSettings|null + */ + public function getBillingSettings(): ?\SynergiTech\Staffology\Model\TenantBillingSettings + { + return $this->container['billingSettings']; + } + + /** + * Sets billingSettings + * + * @param \SynergiTech\Staffology\Model\TenantBillingSettings|null $billingSettings billingSettings + * + * @return $this + */ + public function setBillingSettings(?\SynergiTech\Staffology\Model\TenantBillingSettings $billingSettings): static + { + if (is_null($billingSettings)) { + throw new InvalidArgumentException('non-nullable billingSettings cannot be null'); + } + $this->container['billingSettings'] = $billingSettings; + + return $this; + } + + /** + * Gets usersCanManageAccountSecuritySettings + * + * @return bool|null + */ + public function getUsersCanManageAccountSecuritySettings(): ?bool + { + return $this->container['usersCanManageAccountSecuritySettings']; + } + + /** + * Sets usersCanManageAccountSecuritySettings + * + * @param bool|null $usersCanManageAccountSecuritySettings If the users are allowed manage their own account security settings through a page or portal defined by their current authentication provider + * + * @return $this + */ + public function setUsersCanManageAccountSecuritySettings(?bool $usersCanManageAccountSecuritySettings): static + { + if (is_null($usersCanManageAccountSecuritySettings)) { + throw new InvalidArgumentException('non-nullable usersCanManageAccountSecuritySettings cannot be null'); + } + $this->container['usersCanManageAccountSecuritySettings'] = $usersCanManageAccountSecuritySettings; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TenantBillingSettings.php b/src/Model/TenantBillingSettings.php new file mode 100644 index 0000000..bdc3b63 --- /dev/null +++ b/src/Model/TenantBillingSettings.php @@ -0,0 +1,640 @@ + + */ +class TenantBillingSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TenantBillingSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'discount' => 'float', + 'monthlyMinimum' => 'float', + 'aggregatedPricing' => 'bool', + 'billTo' => 'string', + 'pricingTable' => 'string', + 'netSuiteDefaultItemCode' => 'string', + 'netSuiteDefaultDescription' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'discount' => 'double', + 'monthlyMinimum' => 'double', + 'aggregatedPricing' => null, + 'billTo' => null, + 'pricingTable' => 'uuid', + 'netSuiteDefaultItemCode' => null, + 'netSuiteDefaultDescription' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'discount' => false, + 'monthlyMinimum' => false, + 'aggregatedPricing' => false, + 'billTo' => true, + 'pricingTable' => true, + 'netSuiteDefaultItemCode' => true, + 'netSuiteDefaultDescription' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'discount' => 'discount', + 'monthlyMinimum' => 'monthlyMinimum', + 'aggregatedPricing' => 'aggregatedPricing', + 'billTo' => 'billTo', + 'pricingTable' => 'pricingTable', + 'netSuiteDefaultItemCode' => 'netSuiteDefaultItemCode', + 'netSuiteDefaultDescription' => 'netSuiteDefaultDescription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'discount' => 'setDiscount', + 'monthlyMinimum' => 'setMonthlyMinimum', + 'aggregatedPricing' => 'setAggregatedPricing', + 'billTo' => 'setBillTo', + 'pricingTable' => 'setPricingTable', + 'netSuiteDefaultItemCode' => 'setNetSuiteDefaultItemCode', + 'netSuiteDefaultDescription' => 'setNetSuiteDefaultDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'discount' => 'getDiscount', + 'monthlyMinimum' => 'getMonthlyMinimum', + 'aggregatedPricing' => 'getAggregatedPricing', + 'billTo' => 'getBillTo', + 'pricingTable' => 'getPricingTable', + 'netSuiteDefaultItemCode' => 'getNetSuiteDefaultItemCode', + 'netSuiteDefaultDescription' => 'getNetSuiteDefaultDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('discount', $data ?? [], null); + $this->setIfExists('monthlyMinimum', $data ?? [], null); + $this->setIfExists('aggregatedPricing', $data ?? [], null); + $this->setIfExists('billTo', $data ?? [], null); + $this->setIfExists('pricingTable', $data ?? [], null); + $this->setIfExists('netSuiteDefaultItemCode', $data ?? [], null); + $this->setIfExists('netSuiteDefaultDescription', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets discount + * + * @return float|null + */ + public function getDiscount(): ?float + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param float|null $discount discount + * + * @return $this + */ + public function setDiscount(?float $discount): static + { + if (is_null($discount)) { + throw new InvalidArgumentException('non-nullable discount cannot be null'); + } + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets monthlyMinimum + * + * @return float|null + */ + public function getMonthlyMinimum(): ?float + { + return $this->container['monthlyMinimum']; + } + + /** + * Sets monthlyMinimum + * + * @param float|null $monthlyMinimum monthlyMinimum + * + * @return $this + */ + public function setMonthlyMinimum(?float $monthlyMinimum): static + { + if (is_null($monthlyMinimum)) { + throw new InvalidArgumentException('non-nullable monthlyMinimum cannot be null'); + } + $this->container['monthlyMinimum'] = $monthlyMinimum; + + return $this; + } + + /** + * Gets aggregatedPricing + * + * @return bool|null + */ + public function getAggregatedPricing(): ?bool + { + return $this->container['aggregatedPricing']; + } + + /** + * Sets aggregatedPricing + * + * @param bool|null $aggregatedPricing aggregatedPricing + * + * @return $this + */ + public function setAggregatedPricing(?bool $aggregatedPricing): static + { + if (is_null($aggregatedPricing)) { + throw new InvalidArgumentException('non-nullable aggregatedPricing cannot be null'); + } + $this->container['aggregatedPricing'] = $aggregatedPricing; + + return $this; + } + + /** + * Gets billTo + * + * @return string|null + */ + public function getBillTo(): ?string + { + return $this->container['billTo']; + } + + /** + * Sets billTo + * + * @param string|null $billTo If all activity for a Tenant is being biulled to a specifc user, set the email address here + * + * @return $this + */ + public function setBillTo(?string $billTo): static + { + if (is_null($billTo)) { + array_push($this->openAPINullablesSetToNull, 'billTo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billTo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billTo'] = $billTo; + + return $this; + } + + /** + * Gets pricingTable + * + * @return string|null + */ + public function getPricingTable(): ?string + { + return $this->container['pricingTable']; + } + + /** + * Sets pricingTable + * + * @param string|null $pricingTable If BillTo is set, then specify a Pricing Table to use from the Staffology tenant, otherwise the default Staffology Pricing Table will be used + * + * @return $this + */ + public function setPricingTable(?string $pricingTable): static + { + if (is_null($pricingTable)) { + array_push($this->openAPINullablesSetToNull, 'pricingTable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pricingTable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pricingTable'] = $pricingTable; + + return $this; + } + + /** + * Gets netSuiteDefaultItemCode + * + * @return string|null + */ + public function getNetSuiteDefaultItemCode(): ?string + { + return $this->container['netSuiteDefaultItemCode']; + } + + /** + * Sets netSuiteDefaultItemCode + * + * @param string|null $netSuiteDefaultItemCode [readonly] The item code used in the NetSuite billing if not specified in the pricing table + * + * @return $this + */ + public function setNetSuiteDefaultItemCode(?string $netSuiteDefaultItemCode): static + { + if (is_null($netSuiteDefaultItemCode)) { + array_push($this->openAPINullablesSetToNull, 'netSuiteDefaultItemCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netSuiteDefaultItemCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netSuiteDefaultItemCode'] = $netSuiteDefaultItemCode; + + return $this; + } + + /** + * Gets netSuiteDefaultDescription + * + * @return string|null + */ + public function getNetSuiteDefaultDescription(): ?string + { + return $this->container['netSuiteDefaultDescription']; + } + + /** + * Sets netSuiteDefaultDescription + * + * @param string|null $netSuiteDefaultDescription [readonly] The product description used in the NetSuite billing if not specified in the pricing table + * + * @return $this + */ + public function setNetSuiteDefaultDescription(?string $netSuiteDefaultDescription): static + { + if (is_null($netSuiteDefaultDescription)) { + array_push($this->openAPINullablesSetToNull, 'netSuiteDefaultDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netSuiteDefaultDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['netSuiteDefaultDescription'] = $netSuiteDefaultDescription; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TenantEmail.php b/src/Model/TenantEmail.php new file mode 100644 index 0000000..7060759 --- /dev/null +++ b/src/Model/TenantEmail.php @@ -0,0 +1,1018 @@ + + */ +class TenantEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TenantEmail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'toName' => 'string', + 'toEmail' => 'string', + 'subject' => 'string', + 'buttonText' => 'string', + 'buttonLink' => 'string', + 'bodyPreview' => 'string', + 'body' => 'string', + 'afterBtnBody' => 'string', + 'status' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusDate' => '\DateTime', + 'statusMessage' => 'string', + 'sendAttempts' => 'int', + 'webAppBaseUrl' => 'string', + 'attachments' => '\SynergiTech\Staffology\Model\EmailAttachment[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'toName' => null, + 'toEmail' => null, + 'subject' => null, + 'buttonText' => null, + 'buttonLink' => null, + 'bodyPreview' => null, + 'body' => null, + 'afterBtnBody' => null, + 'status' => null, + 'statusDate' => 'date-time', + 'statusMessage' => null, + 'sendAttempts' => 'int32', + 'webAppBaseUrl' => null, + 'attachments' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'toName' => false, + 'toEmail' => false, + 'subject' => false, + 'buttonText' => true, + 'buttonLink' => true, + 'bodyPreview' => true, + 'body' => true, + 'afterBtnBody' => true, + 'status' => false, + 'statusDate' => false, + 'statusMessage' => true, + 'sendAttempts' => false, + 'webAppBaseUrl' => true, + 'attachments' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'toName' => 'toName', + 'toEmail' => 'toEmail', + 'subject' => 'subject', + 'buttonText' => 'buttonText', + 'buttonLink' => 'buttonLink', + 'bodyPreview' => 'bodyPreview', + 'body' => 'body', + 'afterBtnBody' => 'afterBtnBody', + 'status' => 'status', + 'statusDate' => 'statusDate', + 'statusMessage' => 'statusMessage', + 'sendAttempts' => 'sendAttempts', + 'webAppBaseUrl' => 'webAppBaseUrl', + 'attachments' => 'attachments', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'toName' => 'setToName', + 'toEmail' => 'setToEmail', + 'subject' => 'setSubject', + 'buttonText' => 'setButtonText', + 'buttonLink' => 'setButtonLink', + 'bodyPreview' => 'setBodyPreview', + 'body' => 'setBody', + 'afterBtnBody' => 'setAfterBtnBody', + 'status' => 'setStatus', + 'statusDate' => 'setStatusDate', + 'statusMessage' => 'setStatusMessage', + 'sendAttempts' => 'setSendAttempts', + 'webAppBaseUrl' => 'setWebAppBaseUrl', + 'attachments' => 'setAttachments', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'toName' => 'getToName', + 'toEmail' => 'getToEmail', + 'subject' => 'getSubject', + 'buttonText' => 'getButtonText', + 'buttonLink' => 'getButtonLink', + 'bodyPreview' => 'getBodyPreview', + 'body' => 'getBody', + 'afterBtnBody' => 'getAfterBtnBody', + 'status' => 'getStatus', + 'statusDate' => 'getStatusDate', + 'statusMessage' => 'getStatusMessage', + 'sendAttempts' => 'getSendAttempts', + 'webAppBaseUrl' => 'getWebAppBaseUrl', + 'attachments' => 'getAttachments', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('toName', $data ?? [], null); + $this->setIfExists('toEmail', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('buttonText', $data ?? [], null); + $this->setIfExists('buttonLink', $data ?? [], null); + $this->setIfExists('bodyPreview', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('afterBtnBody', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('statusDate', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('sendAttempts', $data ?? [], null); + $this->setIfExists('webAppBaseUrl', $data ?? [], null); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['toName'] === null) { + $invalidProperties[] = "'toName' can't be null"; + } + if ((mb_strlen($this->container['toName']) > 150)) { + $invalidProperties[] = "invalid value for 'toName', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['toName']) < 1)) { + $invalidProperties[] = "invalid value for 'toName', the character length must be bigger than or equal to 1."; + } + + if ($this->container['toEmail'] === null) { + $invalidProperties[] = "'toEmail' can't be null"; + } + if ((mb_strlen($this->container['toEmail']) > 150)) { + $invalidProperties[] = "invalid value for 'toEmail', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['toEmail']) < 1)) { + $invalidProperties[] = "invalid value for 'toEmail', the character length must be bigger than or equal to 1."; + } + + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ((mb_strlen($this->container['subject']) > 150)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['subject']) < 1)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['buttonText']) && (mb_strlen($this->container['buttonText']) > 100)) { + $invalidProperties[] = "invalid value for 'buttonText', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['buttonLink']) && (mb_strlen($this->container['buttonLink']) > 250)) { + $invalidProperties[] = "invalid value for 'buttonLink', the character length must be smaller than or equal to 250."; + } + + if (!is_null($this->container['bodyPreview']) && (mb_strlen($this->container['bodyPreview']) > 100)) { + $invalidProperties[] = "invalid value for 'bodyPreview', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets toName + * + * @return string + */ + public function getToName(): string + { + return $this->container['toName']; + } + + /** + * Sets toName + * + * @param string $toName toName + * + * @return $this + */ + public function setToName(string $toName): static + { + if (is_null($toName)) { + throw new InvalidArgumentException('non-nullable toName cannot be null'); + } + if ((mb_strlen($toName) > 150)) { + throw new InvalidArgumentException('invalid length for $toName when calling TenantEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($toName) < 1)) { + throw new InvalidArgumentException('invalid length for $toName when calling TenantEmail., must be bigger than or equal to 1.'); + } + + $this->container['toName'] = $toName; + + return $this; + } + + /** + * Gets toEmail + * + * @return string + */ + public function getToEmail(): string + { + return $this->container['toEmail']; + } + + /** + * Sets toEmail + * + * @param string $toEmail toEmail + * + * @return $this + */ + public function setToEmail(string $toEmail): static + { + if (is_null($toEmail)) { + throw new InvalidArgumentException('non-nullable toEmail cannot be null'); + } + if ((mb_strlen($toEmail) > 150)) { + throw new InvalidArgumentException('invalid length for $toEmail when calling TenantEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($toEmail) < 1)) { + throw new InvalidArgumentException('invalid length for $toEmail when calling TenantEmail., must be bigger than or equal to 1.'); + } + + $this->container['toEmail'] = $toEmail; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject(): string + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject subject + * + * @return $this + */ + public function setSubject(string $subject): static + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if ((mb_strlen($subject) > 150)) { + throw new InvalidArgumentException('invalid length for $subject when calling TenantEmail., must be smaller than or equal to 150.'); + } + if ((mb_strlen($subject) < 1)) { + throw new InvalidArgumentException('invalid length for $subject when calling TenantEmail., must be bigger than or equal to 1.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets buttonText + * + * @return string|null + */ + public function getButtonText(): ?string + { + return $this->container['buttonText']; + } + + /** + * Sets buttonText + * + * @param string|null $buttonText buttonText + * + * @return $this + */ + public function setButtonText(?string $buttonText): static + { + if (is_null($buttonText)) { + array_push($this->openAPINullablesSetToNull, 'buttonText'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buttonText', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buttonText) && (mb_strlen($buttonText) > 100)) { + throw new InvalidArgumentException('invalid length for $buttonText when calling TenantEmail., must be smaller than or equal to 100.'); + } + + $this->container['buttonText'] = $buttonText; + + return $this; + } + + /** + * Gets buttonLink + * + * @return string|null + */ + public function getButtonLink(): ?string + { + return $this->container['buttonLink']; + } + + /** + * Sets buttonLink + * + * @param string|null $buttonLink buttonLink + * + * @return $this + */ + public function setButtonLink(?string $buttonLink): static + { + if (is_null($buttonLink)) { + array_push($this->openAPINullablesSetToNull, 'buttonLink'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('buttonLink', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($buttonLink) && (mb_strlen($buttonLink) > 250)) { + throw new InvalidArgumentException('invalid length for $buttonLink when calling TenantEmail., must be smaller than or equal to 250.'); + } + + $this->container['buttonLink'] = $buttonLink; + + return $this; + } + + /** + * Gets bodyPreview + * + * @return string|null + */ + public function getBodyPreview(): ?string + { + return $this->container['bodyPreview']; + } + + /** + * Sets bodyPreview + * + * @param string|null $bodyPreview bodyPreview + * + * @return $this + */ + public function setBodyPreview(?string $bodyPreview): static + { + if (is_null($bodyPreview)) { + array_push($this->openAPINullablesSetToNull, 'bodyPreview'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bodyPreview', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bodyPreview) && (mb_strlen($bodyPreview) > 100)) { + throw new InvalidArgumentException('invalid length for $bodyPreview when calling TenantEmail., must be smaller than or equal to 100.'); + } + + $this->container['bodyPreview'] = $bodyPreview; + + return $this; + } + + /** + * Gets body + * + * @return string|null + */ + public function getBody(): ?string + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body body + * + * @return $this + */ + public function setBody(?string $body): static + { + if (is_null($body)) { + array_push($this->openAPINullablesSetToNull, 'body'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets afterBtnBody + * + * @return string|null + */ + public function getAfterBtnBody(): ?string + { + return $this->container['afterBtnBody']; + } + + /** + * Sets afterBtnBody + * + * @param string|null $afterBtnBody afterBtnBody + * + * @return $this + */ + public function setAfterBtnBody(?string $afterBtnBody): static + { + if (is_null($afterBtnBody)) { + array_push($this->openAPINullablesSetToNull, 'afterBtnBody'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('afterBtnBody', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['afterBtnBody'] = $afterBtnBody; + + return $this; + } + + /** + * Gets status + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $status status + * + * @return $this + */ + public function setStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $status): static + { + if (is_null($status)) { + throw new InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets statusDate + * + * @return \DateTime|null + */ + public function getStatusDate(): ?\DateTime + { + return $this->container['statusDate']; + } + + /** + * Sets statusDate + * + * @param \DateTime|null $statusDate statusDate + * + * @return $this + */ + public function setStatusDate(?\DateTime $statusDate): static + { + if (is_null($statusDate)) { + throw new InvalidArgumentException('non-nullable statusDate cannot be null'); + } + $this->container['statusDate'] = $statusDate; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage statusMessage + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets sendAttempts + * + * @return int|null + */ + public function getSendAttempts(): ?int + { + return $this->container['sendAttempts']; + } + + /** + * Sets sendAttempts + * + * @param int|null $sendAttempts sendAttempts + * + * @return $this + */ + public function setSendAttempts(?int $sendAttempts): static + { + if (is_null($sendAttempts)) { + throw new InvalidArgumentException('non-nullable sendAttempts cannot be null'); + } + $this->container['sendAttempts'] = $sendAttempts; + + return $this; + } + + /** + * Gets webAppBaseUrl + * + * @return string|null + */ + public function getWebAppBaseUrl(): ?string + { + return $this->container['webAppBaseUrl']; + } + + /** + * Sets webAppBaseUrl + * + * @param string|null $webAppBaseUrl webAppBaseUrl + * + * @return $this + */ + public function setWebAppBaseUrl(?string $webAppBaseUrl): static + { + if (is_null($webAppBaseUrl)) { + array_push($this->openAPINullablesSetToNull, 'webAppBaseUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webAppBaseUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webAppBaseUrl'] = $webAppBaseUrl; + + return $this; + } + + /** + * Gets attachments + * + * @return \SynergiTech\Staffology\Model\EmailAttachment[]|null + */ + public function getAttachments(): ?array + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param \SynergiTech\Staffology\Model\EmailAttachment[]|null $attachments attachments + * + * @return $this + */ + public function setAttachments(?array $attachments): static + { + if (is_null($attachments)) { + array_push($this->openAPINullablesSetToNull, 'attachments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachments'] = $attachments; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TenantHtmlInsertion.php b/src/Model/TenantHtmlInsertion.php new file mode 100644 index 0000000..c12d6ac --- /dev/null +++ b/src/Model/TenantHtmlInsertion.php @@ -0,0 +1,449 @@ + + */ +class TenantHtmlInsertion implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TenantHtmlInsertion'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'insertionPoint' => '\SynergiTech\Staffology\Model\HtmlInsertionPoint', + 'content' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'insertionPoint' => null, + 'content' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'insertionPoint' => false, + 'content' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'insertionPoint' => 'insertionPoint', + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'insertionPoint' => 'setInsertionPoint', + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'insertionPoint' => 'getInsertionPoint', + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('insertionPoint', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets insertionPoint + * + * @return \SynergiTech\Staffology\Model\HtmlInsertionPoint|null + */ + public function getInsertionPoint(): ?\SynergiTech\Staffology\Model\HtmlInsertionPoint + { + return $this->container['insertionPoint']; + } + + /** + * Sets insertionPoint + * + * @param \SynergiTech\Staffology\Model\HtmlInsertionPoint|null $insertionPoint insertionPoint + * + * @return $this + */ + public function setInsertionPoint(?\SynergiTech\Staffology\Model\HtmlInsertionPoint $insertionPoint): static + { + if (is_null($insertionPoint)) { + throw new InvalidArgumentException('non-nullable insertionPoint cannot be null'); + } + $this->container['insertionPoint'] = $insertionPoint; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TenantItem.php b/src/Model/TenantItem.php new file mode 100644 index 0000000..e8e54ac --- /dev/null +++ b/src/Model/TenantItem.php @@ -0,0 +1,532 @@ + + */ +class TenantItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TenantItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'metadata' => 'mixed', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'metadata' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'metadata' => true, + 'url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'metadata' => 'metadata', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'metadata' => 'setMetadata', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'metadata' => 'getMetadata', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadata + * + * @return mixed|null + */ + public function getMetadata(): mixed + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param mixed|null $metadata metadata + * + * @return $this + */ + public function setMetadata(mixed $metadata): static + { + if (is_null($metadata)) { + array_push($this->openAPINullablesSetToNull, 'metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return $this + */ + public function setUrl(?string $url): static + { + if (is_null($url)) { + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TieredPension.php b/src/Model/TieredPension.php new file mode 100644 index 0000000..a79240f --- /dev/null +++ b/src/Model/TieredPension.php @@ -0,0 +1,484 @@ + + */ +class TieredPension implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TieredPension'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\PensionContributionLevelType', + 'rates' => '\SynergiTech\Staffology\Model\TieredPensionRate[]', + 'employerContribRate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'rates' => null, + 'employerContribRate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'rates' => true, + 'employerContribRate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'rates' => 'rates', + 'employerContribRate' => 'employerContribRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'rates' => 'setRates', + 'employerContribRate' => 'setEmployerContribRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'rates' => 'getRates', + 'employerContribRate' => 'getEmployerContribRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rates', $data ?? [], null); + $this->setIfExists('employerContribRate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PensionContributionLevelType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PensionContributionLevelType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PensionContributionLevelType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PensionContributionLevelType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rates + * + * @return \SynergiTech\Staffology\Model\TieredPensionRate[]|null + */ + public function getRates(): ?array + { + return $this->container['rates']; + } + + /** + * Sets rates + * + * @param \SynergiTech\Staffology\Model\TieredPensionRate[]|null $rates rates + * + * @return $this + */ + public function setRates(?array $rates): static + { + if (is_null($rates)) { + array_push($this->openAPINullablesSetToNull, 'rates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rates'] = $rates; + + return $this; + } + + /** + * Gets employerContribRate + * + * @return float|null + */ + public function getEmployerContribRate(): ?float + { + return $this->container['employerContribRate']; + } + + /** + * Sets employerContribRate + * + * @param float|null $employerContribRate employerContribRate + * + * @return $this + */ + public function setEmployerContribRate(?float $employerContribRate): static + { + if (is_null($employerContribRate)) { + throw new InvalidArgumentException('non-nullable employerContribRate cannot be null'); + } + $this->container['employerContribRate'] = $employerContribRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TieredPensionRate.php b/src/Model/TieredPensionRate.php new file mode 100644 index 0000000..47e497a --- /dev/null +++ b/src/Model/TieredPensionRate.php @@ -0,0 +1,525 @@ + + */ +class TieredPensionRate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TieredPensionRate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'rangeStart' => 'float', + 'rate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'rangeStart' => 'double', + 'rate' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'description' => true, + 'rangeStart' => false, + 'rate' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'rangeStart' => 'rangeStart', + 'rate' => 'rate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'rangeStart' => 'setRangeStart', + 'rate' => 'setRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'rangeStart' => 'getRangeStart', + 'rate' => 'getRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('rangeStart', $data ?? [], null); + $this->setIfExists('rate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return $this + */ + public function setDescription(?string $description): static + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets rangeStart + * + * @return float|null + */ + public function getRangeStart(): ?float + { + return $this->container['rangeStart']; + } + + /** + * Sets rangeStart + * + * @param float|null $rangeStart rangeStart + * + * @return $this + */ + public function setRangeStart(?float $rangeStart): static + { + if (is_null($rangeStart)) { + throw new InvalidArgumentException('non-nullable rangeStart cannot be null'); + } + $this->container['rangeStart'] = $rangeStart; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate(): ?float + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate rate + * + * @return $this + */ + public function setRate(?float $rate): static + { + if (is_null($rate)) { + throw new InvalidArgumentException('non-nullable rate cannot be null'); + } + $this->container['rate'] = $rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UmbrellaPayment.php b/src/Model/UmbrellaPayment.php new file mode 100644 index 0000000..2004782 --- /dev/null +++ b/src/Model/UmbrellaPayment.php @@ -0,0 +1,694 @@ + + */ +class UmbrellaPayment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UmbrellaPayment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'chargePerTimesheet' => 'float', + 'invoiceValue' => 'float', + 'mapsMiles' => 'int', + 'otherExpenses' => 'float', + 'numberOfTimesheets' => 'int', + 'hoursWorked' => 'float', + 'grossDeduction' => 'float', + 'grossAddition' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'chargePerTimesheet' => 'double', + 'invoiceValue' => 'double', + 'mapsMiles' => 'int32', + 'otherExpenses' => 'double', + 'numberOfTimesheets' => 'int32', + 'hoursWorked' => 'double', + 'grossDeduction' => 'double', + 'grossAddition' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'chargePerTimesheet' => true, + 'invoiceValue' => false, + 'mapsMiles' => false, + 'otherExpenses' => false, + 'numberOfTimesheets' => false, + 'hoursWorked' => false, + 'grossDeduction' => false, + 'grossAddition' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'chargePerTimesheet' => 'chargePerTimesheet', + 'invoiceValue' => 'invoiceValue', + 'mapsMiles' => 'mapsMiles', + 'otherExpenses' => 'otherExpenses', + 'numberOfTimesheets' => 'numberOfTimesheets', + 'hoursWorked' => 'hoursWorked', + 'grossDeduction' => 'grossDeduction', + 'grossAddition' => 'grossAddition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'chargePerTimesheet' => 'setChargePerTimesheet', + 'invoiceValue' => 'setInvoiceValue', + 'mapsMiles' => 'setMapsMiles', + 'otherExpenses' => 'setOtherExpenses', + 'numberOfTimesheets' => 'setNumberOfTimesheets', + 'hoursWorked' => 'setHoursWorked', + 'grossDeduction' => 'setGrossDeduction', + 'grossAddition' => 'setGrossAddition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'chargePerTimesheet' => 'getChargePerTimesheet', + 'invoiceValue' => 'getInvoiceValue', + 'mapsMiles' => 'getMapsMiles', + 'otherExpenses' => 'getOtherExpenses', + 'numberOfTimesheets' => 'getNumberOfTimesheets', + 'hoursWorked' => 'getHoursWorked', + 'grossDeduction' => 'getGrossDeduction', + 'grossAddition' => 'getGrossAddition' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('chargePerTimesheet', $data ?? [], null); + $this->setIfExists('invoiceValue', $data ?? [], null); + $this->setIfExists('mapsMiles', $data ?? [], null); + $this->setIfExists('otherExpenses', $data ?? [], null); + $this->setIfExists('numberOfTimesheets', $data ?? [], null); + $this->setIfExists('hoursWorked', $data ?? [], null); + $this->setIfExists('grossDeduction', $data ?? [], null); + $this->setIfExists('grossAddition', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode When importing multiple UmbrellaPayments this field is used to identify the employee + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets chargePerTimesheet + * + * @return float|null + */ + public function getChargePerTimesheet(): ?float + { + return $this->container['chargePerTimesheet']; + } + + /** + * Sets chargePerTimesheet + * + * @param float|null $chargePerTimesheet Override the settings for this employer by specifying a ChargePerTimeSheet. Or leave it as null to use the settings from the Employer + * + * @return $this + */ + public function setChargePerTimesheet(?float $chargePerTimesheet): static + { + if (is_null($chargePerTimesheet)) { + array_push($this->openAPINullablesSetToNull, 'chargePerTimesheet'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('chargePerTimesheet', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['chargePerTimesheet'] = $chargePerTimesheet; + + return $this; + } + + /** + * Gets invoiceValue + * + * @return float|null + */ + public function getInvoiceValue(): ?float + { + return $this->container['invoiceValue']; + } + + /** + * Sets invoiceValue + * + * @param float|null $invoiceValue invoiceValue + * + * @return $this + */ + public function setInvoiceValue(?float $invoiceValue): static + { + if (is_null($invoiceValue)) { + throw new InvalidArgumentException('non-nullable invoiceValue cannot be null'); + } + $this->container['invoiceValue'] = $invoiceValue; + + return $this; + } + + /** + * Gets mapsMiles + * + * @return int|null + */ + public function getMapsMiles(): ?int + { + return $this->container['mapsMiles']; + } + + /** + * Sets mapsMiles + * + * @param int|null $mapsMiles mapsMiles + * + * @return $this + */ + public function setMapsMiles(?int $mapsMiles): static + { + if (is_null($mapsMiles)) { + throw new InvalidArgumentException('non-nullable mapsMiles cannot be null'); + } + $this->container['mapsMiles'] = $mapsMiles; + + return $this; + } + + /** + * Gets otherExpenses + * + * @return float|null + */ + public function getOtherExpenses(): ?float + { + return $this->container['otherExpenses']; + } + + /** + * Sets otherExpenses + * + * @param float|null $otherExpenses otherExpenses + * + * @return $this + */ + public function setOtherExpenses(?float $otherExpenses): static + { + if (is_null($otherExpenses)) { + throw new InvalidArgumentException('non-nullable otherExpenses cannot be null'); + } + $this->container['otherExpenses'] = $otherExpenses; + + return $this; + } + + /** + * Gets numberOfTimesheets + * + * @return int|null + */ + public function getNumberOfTimesheets(): ?int + { + return $this->container['numberOfTimesheets']; + } + + /** + * Sets numberOfTimesheets + * + * @param int|null $numberOfTimesheets numberOfTimesheets + * + * @return $this + */ + public function setNumberOfTimesheets(?int $numberOfTimesheets): static + { + if (is_null($numberOfTimesheets)) { + throw new InvalidArgumentException('non-nullable numberOfTimesheets cannot be null'); + } + $this->container['numberOfTimesheets'] = $numberOfTimesheets; + + return $this; + } + + /** + * Gets hoursWorked + * + * @return float|null + */ + public function getHoursWorked(): ?float + { + return $this->container['hoursWorked']; + } + + /** + * Sets hoursWorked + * + * @param float|null $hoursWorked hoursWorked + * + * @return $this + */ + public function setHoursWorked(?float $hoursWorked): static + { + if (is_null($hoursWorked)) { + throw new InvalidArgumentException('non-nullable hoursWorked cannot be null'); + } + $this->container['hoursWorked'] = $hoursWorked; + + return $this; + } + + /** + * Gets grossDeduction + * + * @return float|null + */ + public function getGrossDeduction(): ?float + { + return $this->container['grossDeduction']; + } + + /** + * Sets grossDeduction + * + * @param float|null $grossDeduction grossDeduction + * + * @return $this + */ + public function setGrossDeduction(?float $grossDeduction): static + { + if (is_null($grossDeduction)) { + throw new InvalidArgumentException('non-nullable grossDeduction cannot be null'); + } + $this->container['grossDeduction'] = $grossDeduction; + + return $this; + } + + /** + * Gets grossAddition + * + * @return float|null + */ + public function getGrossAddition(): ?float + { + return $this->container['grossAddition']; + } + + /** + * Sets grossAddition + * + * @param float|null $grossAddition grossAddition + * + * @return $this + */ + public function setGrossAddition(?float $grossAddition): static + { + if (is_null($grossAddition)) { + throw new InvalidArgumentException('non-nullable grossAddition cannot be null'); + } + $this->container['grossAddition'] = $grossAddition; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UmbrellaReconciliationReport.php b/src/Model/UmbrellaReconciliationReport.php new file mode 100644 index 0000000..d5570ae --- /dev/null +++ b/src/Model/UmbrellaReconciliationReport.php @@ -0,0 +1,878 @@ + + */ +class UmbrellaReconciliationReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UmbrellaReconciliationReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\UmbrellaReconciliationReportLine[]', + 'employer' => '\SynergiTech\Staffology\Model\Item', + 'payPeriod' => '\SynergiTech\Staffology\Model\PayPeriods', + 'ordinal' => 'int', + 'period' => 'int', + 'periodTo' => 'int', + 'startPeriodName' => 'string', + 'endPeriodName' => 'string', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'employer' => null, + 'payPeriod' => null, + 'ordinal' => 'int32', + 'period' => 'int32', + 'periodTo' => 'int32', + 'startPeriodName' => null, + 'endPeriodName' => null, + 'startDate' => 'date', + 'endDate' => 'date', + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'employer' => false, + 'payPeriod' => false, + 'ordinal' => false, + 'period' => false, + 'periodTo' => false, + 'startPeriodName' => true, + 'endPeriodName' => true, + 'startDate' => false, + 'endDate' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'employer' => 'employer', + 'payPeriod' => 'payPeriod', + 'ordinal' => 'ordinal', + 'period' => 'period', + 'periodTo' => 'periodTo', + 'startPeriodName' => 'startPeriodName', + 'endPeriodName' => 'endPeriodName', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'employer' => 'setEmployer', + 'payPeriod' => 'setPayPeriod', + 'ordinal' => 'setOrdinal', + 'period' => 'setPeriod', + 'periodTo' => 'setPeriodTo', + 'startPeriodName' => 'setStartPeriodName', + 'endPeriodName' => 'setEndPeriodName', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'employer' => 'getEmployer', + 'payPeriod' => 'getPayPeriod', + 'ordinal' => 'getOrdinal', + 'period' => 'getPeriod', + 'periodTo' => 'getPeriodTo', + 'startPeriodName' => 'getStartPeriodName', + 'endPeriodName' => 'getEndPeriodName', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('employer', $data ?? [], null); + $this->setIfExists('payPeriod', $data ?? [], null); + $this->setIfExists('ordinal', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('periodTo', $data ?? [], null); + $this->setIfExists('startPeriodName', $data ?? [], null); + $this->setIfExists('endPeriodName', $data ?? [], null); + $this->setIfExists('startDate', $data ?? [], null); + $this->setIfExists('endDate', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\UmbrellaReconciliationReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\UmbrellaReconciliationReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets employer + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployer(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employer']; + } + + /** + * Sets employer + * + * @param \SynergiTech\Staffology\Model\Item|null $employer employer + * + * @return $this + */ + public function setEmployer(?\SynergiTech\Staffology\Model\Item $employer): static + { + if (is_null($employer)) { + throw new InvalidArgumentException('non-nullable employer cannot be null'); + } + $this->container['employer'] = $employer; + + return $this; + } + + /** + * Gets payPeriod + * + * @return \SynergiTech\Staffology\Model\PayPeriods|null + */ + public function getPayPeriod(): ?\SynergiTech\Staffology\Model\PayPeriods + { + return $this->container['payPeriod']; + } + + /** + * Sets payPeriod + * + * @param \SynergiTech\Staffology\Model\PayPeriods|null $payPeriod payPeriod + * + * @return $this + */ + public function setPayPeriod(?\SynergiTech\Staffology\Model\PayPeriods $payPeriod): static + { + if (is_null($payPeriod)) { + throw new InvalidArgumentException('non-nullable payPeriod cannot be null'); + } + $this->container['payPeriod'] = $payPeriod; + + return $this; + } + + /** + * Gets ordinal + * + * @return int|null + */ + public function getOrdinal(): ?int + { + return $this->container['ordinal']; + } + + /** + * Sets ordinal + * + * @param int|null $ordinal ordinal + * + * @return $this + */ + public function setOrdinal(?int $ordinal): static + { + if (is_null($ordinal)) { + throw new InvalidArgumentException('non-nullable ordinal cannot be null'); + } + $this->container['ordinal'] = $ordinal; + + return $this; + } + + /** + * Gets period + * + * @return int|null + */ + public function getPeriod(): ?int + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param int|null $period period + * + * @return $this + */ + public function setPeriod(?int $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodTo + * + * @return int|null + */ + public function getPeriodTo(): ?int + { + return $this->container['periodTo']; + } + + /** + * Sets periodTo + * + * @param int|null $periodTo periodTo + * + * @return $this + */ + public function setPeriodTo(?int $periodTo): static + { + if (is_null($periodTo)) { + throw new InvalidArgumentException('non-nullable periodTo cannot be null'); + } + $this->container['periodTo'] = $periodTo; + + return $this; + } + + /** + * Gets startPeriodName + * + * @return string|null + */ + public function getStartPeriodName(): ?string + { + return $this->container['startPeriodName']; + } + + /** + * Sets startPeriodName + * + * @param string|null $startPeriodName startPeriodName + * + * @return $this + */ + public function setStartPeriodName(?string $startPeriodName): static + { + if (is_null($startPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'startPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['startPeriodName'] = $startPeriodName; + + return $this; + } + + /** + * Gets endPeriodName + * + * @return string|null + */ + public function getEndPeriodName(): ?string + { + return $this->container['endPeriodName']; + } + + /** + * Sets endPeriodName + * + * @param string|null $endPeriodName endPeriodName + * + * @return $this + */ + public function setEndPeriodName(?string $endPeriodName): static + { + if (is_null($endPeriodName)) { + array_push($this->openAPINullablesSetToNull, 'endPeriodName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('endPeriodName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['endPeriodName'] = $endPeriodName; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate(): ?\DateTime + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate startDate + * + * @return $this + */ + public function setStartDate(?\DateTime $startDate): static + { + if (is_null($startDate)) { + throw new InvalidArgumentException('non-nullable startDate cannot be null'); + } + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime|null + */ + public function getEndDate(): ?\DateTime + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime|null $endDate endDate + * + * @return $this + */ + public function setEndDate(?\DateTime $endDate): static + { + if (is_null($endDate)) { + throw new InvalidArgumentException('non-nullable endDate cannot be null'); + } + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UmbrellaReconciliationReportLine.php b/src/Model/UmbrellaReconciliationReportLine.php new file mode 100644 index 0000000..4127e90 --- /dev/null +++ b/src/Model/UmbrellaReconciliationReportLine.php @@ -0,0 +1,1007 @@ + + */ +class UmbrellaReconciliationReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UmbrellaReconciliationReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'period' => 'string', + 'payrollCode' => 'string', + 'department' => 'string', + 'totalGross' => 'float', + 'netPay' => 'float', + 'tax' => 'float', + 'employeeNi' => 'float', + 'employerNi' => 'float', + 'employeePension' => 'float', + 'employerPension' => 'float', + 'expenses' => 'float', + 'fee' => 'float', + 'appLevy' => 'float', + 'invoiceValue' => 'float', + 'employeeCosts' => 'float', + 'employerCosts' => 'float', + 'total' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'period' => null, + 'payrollCode' => null, + 'department' => null, + 'totalGross' => 'double', + 'netPay' => 'double', + 'tax' => 'double', + 'employeeNi' => 'double', + 'employerNi' => 'double', + 'employeePension' => 'double', + 'employerPension' => 'double', + 'expenses' => 'double', + 'fee' => 'double', + 'appLevy' => 'double', + 'invoiceValue' => 'double', + 'employeeCosts' => 'double', + 'employerCosts' => 'double', + 'total' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'period' => true, + 'payrollCode' => true, + 'department' => true, + 'totalGross' => false, + 'netPay' => false, + 'tax' => false, + 'employeeNi' => false, + 'employerNi' => false, + 'employeePension' => false, + 'employerPension' => false, + 'expenses' => false, + 'fee' => false, + 'appLevy' => false, + 'invoiceValue' => false, + 'employeeCosts' => false, + 'employerCosts' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'period' => 'period', + 'payrollCode' => 'payrollCode', + 'department' => 'department', + 'totalGross' => 'totalGross', + 'netPay' => 'netPay', + 'tax' => 'tax', + 'employeeNi' => 'employeeNi', + 'employerNi' => 'employerNi', + 'employeePension' => 'employeePension', + 'employerPension' => 'employerPension', + 'expenses' => 'expenses', + 'fee' => 'fee', + 'appLevy' => 'appLevy', + 'invoiceValue' => 'invoiceValue', + 'employeeCosts' => 'employeeCosts', + 'employerCosts' => 'employerCosts', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'period' => 'setPeriod', + 'payrollCode' => 'setPayrollCode', + 'department' => 'setDepartment', + 'totalGross' => 'setTotalGross', + 'netPay' => 'setNetPay', + 'tax' => 'setTax', + 'employeeNi' => 'setEmployeeNi', + 'employerNi' => 'setEmployerNi', + 'employeePension' => 'setEmployeePension', + 'employerPension' => 'setEmployerPension', + 'expenses' => 'setExpenses', + 'fee' => 'setFee', + 'appLevy' => 'setAppLevy', + 'invoiceValue' => 'setInvoiceValue', + 'employeeCosts' => 'setEmployeeCosts', + 'employerCosts' => 'setEmployerCosts', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'period' => 'getPeriod', + 'payrollCode' => 'getPayrollCode', + 'department' => 'getDepartment', + 'totalGross' => 'getTotalGross', + 'netPay' => 'getNetPay', + 'tax' => 'getTax', + 'employeeNi' => 'getEmployeeNi', + 'employerNi' => 'getEmployerNi', + 'employeePension' => 'getEmployeePension', + 'employerPension' => 'getEmployerPension', + 'expenses' => 'getExpenses', + 'fee' => 'getFee', + 'appLevy' => 'getAppLevy', + 'invoiceValue' => 'getInvoiceValue', + 'employeeCosts' => 'getEmployeeCosts', + 'employerCosts' => 'getEmployerCosts', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('totalGross', $data ?? [], null); + $this->setIfExists('netPay', $data ?? [], null); + $this->setIfExists('tax', $data ?? [], null); + $this->setIfExists('employeeNi', $data ?? [], null); + $this->setIfExists('employerNi', $data ?? [], null); + $this->setIfExists('employeePension', $data ?? [], null); + $this->setIfExists('employerPension', $data ?? [], null); + $this->setIfExists('expenses', $data ?? [], null); + $this->setIfExists('fee', $data ?? [], null); + $this->setIfExists('appLevy', $data ?? [], null); + $this->setIfExists('invoiceValue', $data ?? [], null); + $this->setIfExists('employeeCosts', $data ?? [], null); + $this->setIfExists('employerCosts', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod(): ?string + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period period + * + * @return $this + */ + public function setPeriod(?string $period): static + { + if (is_null($period)) { + array_push($this->openAPINullablesSetToNull, 'period'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('period', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment(): ?string + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return $this + */ + public function setDepartment(?string $department): static + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets totalGross + * + * @return float|null + */ + public function getTotalGross(): ?float + { + return $this->container['totalGross']; + } + + /** + * Sets totalGross + * + * @param float|null $totalGross totalGross + * + * @return $this + */ + public function setTotalGross(?float $totalGross): static + { + if (is_null($totalGross)) { + throw new InvalidArgumentException('non-nullable totalGross cannot be null'); + } + $this->container['totalGross'] = $totalGross; + + return $this; + } + + /** + * Gets netPay + * + * @return float|null + */ + public function getNetPay(): ?float + { + return $this->container['netPay']; + } + + /** + * Sets netPay + * + * @param float|null $netPay netPay + * + * @return $this + */ + public function setNetPay(?float $netPay): static + { + if (is_null($netPay)) { + throw new InvalidArgumentException('non-nullable netPay cannot be null'); + } + $this->container['netPay'] = $netPay; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax(): ?float + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax tax + * + * @return $this + */ + public function setTax(?float $tax): static + { + if (is_null($tax)) { + throw new InvalidArgumentException('non-nullable tax cannot be null'); + } + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets employeeNi + * + * @return float|null + */ + public function getEmployeeNi(): ?float + { + return $this->container['employeeNi']; + } + + /** + * Sets employeeNi + * + * @param float|null $employeeNi employeeNi + * + * @return $this + */ + public function setEmployeeNi(?float $employeeNi): static + { + if (is_null($employeeNi)) { + throw new InvalidArgumentException('non-nullable employeeNi cannot be null'); + } + $this->container['employeeNi'] = $employeeNi; + + return $this; + } + + /** + * Gets employerNi + * + * @return float|null + */ + public function getEmployerNi(): ?float + { + return $this->container['employerNi']; + } + + /** + * Sets employerNi + * + * @param float|null $employerNi employerNi + * + * @return $this + */ + public function setEmployerNi(?float $employerNi): static + { + if (is_null($employerNi)) { + throw new InvalidArgumentException('non-nullable employerNi cannot be null'); + } + $this->container['employerNi'] = $employerNi; + + return $this; + } + + /** + * Gets employeePension + * + * @return float|null + */ + public function getEmployeePension(): ?float + { + return $this->container['employeePension']; + } + + /** + * Sets employeePension + * + * @param float|null $employeePension employeePension + * + * @return $this + */ + public function setEmployeePension(?float $employeePension): static + { + if (is_null($employeePension)) { + throw new InvalidArgumentException('non-nullable employeePension cannot be null'); + } + $this->container['employeePension'] = $employeePension; + + return $this; + } + + /** + * Gets employerPension + * + * @return float|null + */ + public function getEmployerPension(): ?float + { + return $this->container['employerPension']; + } + + /** + * Sets employerPension + * + * @param float|null $employerPension employerPension + * + * @return $this + */ + public function setEmployerPension(?float $employerPension): static + { + if (is_null($employerPension)) { + throw new InvalidArgumentException('non-nullable employerPension cannot be null'); + } + $this->container['employerPension'] = $employerPension; + + return $this; + } + + /** + * Gets expenses + * + * @return float|null + */ + public function getExpenses(): ?float + { + return $this->container['expenses']; + } + + /** + * Sets expenses + * + * @param float|null $expenses expenses + * + * @return $this + */ + public function setExpenses(?float $expenses): static + { + if (is_null($expenses)) { + throw new InvalidArgumentException('non-nullable expenses cannot be null'); + } + $this->container['expenses'] = $expenses; + + return $this; + } + + /** + * Gets fee + * + * @return float|null + */ + public function getFee(): ?float + { + return $this->container['fee']; + } + + /** + * Sets fee + * + * @param float|null $fee fee + * + * @return $this + */ + public function setFee(?float $fee): static + { + if (is_null($fee)) { + throw new InvalidArgumentException('non-nullable fee cannot be null'); + } + $this->container['fee'] = $fee; + + return $this; + } + + /** + * Gets appLevy + * + * @return float|null + */ + public function getAppLevy(): ?float + { + return $this->container['appLevy']; + } + + /** + * Sets appLevy + * + * @param float|null $appLevy appLevy + * + * @return $this + */ + public function setAppLevy(?float $appLevy): static + { + if (is_null($appLevy)) { + throw new InvalidArgumentException('non-nullable appLevy cannot be null'); + } + $this->container['appLevy'] = $appLevy; + + return $this; + } + + /** + * Gets invoiceValue + * + * @return float|null + */ + public function getInvoiceValue(): ?float + { + return $this->container['invoiceValue']; + } + + /** + * Sets invoiceValue + * + * @param float|null $invoiceValue invoiceValue + * + * @return $this + */ + public function setInvoiceValue(?float $invoiceValue): static + { + if (is_null($invoiceValue)) { + throw new InvalidArgumentException('non-nullable invoiceValue cannot be null'); + } + $this->container['invoiceValue'] = $invoiceValue; + + return $this; + } + + /** + * Gets employeeCosts + * + * @return float|null + */ + public function getEmployeeCosts(): ?float + { + return $this->container['employeeCosts']; + } + + /** + * Sets employeeCosts + * + * @param float|null $employeeCosts employeeCosts + * + * @return $this + */ + public function setEmployeeCosts(?float $employeeCosts): static + { + if (is_null($employeeCosts)) { + throw new InvalidArgumentException('non-nullable employeeCosts cannot be null'); + } + $this->container['employeeCosts'] = $employeeCosts; + + return $this; + } + + /** + * Gets employerCosts + * + * @return float|null + */ + public function getEmployerCosts(): ?float + { + return $this->container['employerCosts']; + } + + /** + * Sets employerCosts + * + * @param float|null $employerCosts employerCosts + * + * @return $this + */ + public function setEmployerCosts(?float $employerCosts): static + { + if (is_null($employerCosts)) { + throw new InvalidArgumentException('non-nullable employerCosts cannot be null'); + } + $this->container['employerCosts'] = $employerCosts; + + return $this; + } + + /** + * Gets total + * + * @return float|null + */ + public function getTotal(): ?float + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal(?float $total): static + { + if (is_null($total)) { + throw new InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UmbrellaReconciliationReportReportResponse.php b/src/Model/UmbrellaReconciliationReportReportResponse.php new file mode 100644 index 0000000..779d115 --- /dev/null +++ b/src/Model/UmbrellaReconciliationReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class UmbrellaReconciliationReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UmbrellaReconciliationReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\UmbrellaReconciliationReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\UmbrellaReconciliationReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\UmbrellaReconciliationReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\UmbrellaReconciliationReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\UmbrellaReconciliationReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UmbrellaSettings.php b/src/Model/UmbrellaSettings.php new file mode 100644 index 0000000..f3d544d --- /dev/null +++ b/src/Model/UmbrellaSettings.php @@ -0,0 +1,749 @@ + + */ +class UmbrellaSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UmbrellaSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'enabled' => 'bool', + 'chargePerTimesheet' => 'float', + 'apprenticeshipLevyDednRate' => 'float', + 'holidayRate' => 'float', + 'dpsbCode' => 'string', + 'expensesCode' => 'string', + 'grossDeductionCode' => 'string', + 'holidayCode' => 'string', + 'cisFeeCode' => 'string', + 'detailFeeInComment' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'enabled' => null, + 'chargePerTimesheet' => 'double', + 'apprenticeshipLevyDednRate' => 'double', + 'holidayRate' => 'double', + 'dpsbCode' => null, + 'expensesCode' => null, + 'grossDeductionCode' => null, + 'holidayCode' => null, + 'cisFeeCode' => null, + 'detailFeeInComment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'chargePerTimesheet' => false, + 'apprenticeshipLevyDednRate' => false, + 'holidayRate' => false, + 'dpsbCode' => true, + 'expensesCode' => true, + 'grossDeductionCode' => true, + 'holidayCode' => true, + 'cisFeeCode' => true, + 'detailFeeInComment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'enabled' => 'enabled', + 'chargePerTimesheet' => 'chargePerTimesheet', + 'apprenticeshipLevyDednRate' => 'apprenticeshipLevyDednRate', + 'holidayRate' => 'holidayRate', + 'dpsbCode' => 'dpsbCode', + 'expensesCode' => 'expensesCode', + 'grossDeductionCode' => 'grossDeductionCode', + 'holidayCode' => 'holidayCode', + 'cisFeeCode' => 'cisFeeCode', + 'detailFeeInComment' => 'detailFeeInComment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'enabled' => 'setEnabled', + 'chargePerTimesheet' => 'setChargePerTimesheet', + 'apprenticeshipLevyDednRate' => 'setApprenticeshipLevyDednRate', + 'holidayRate' => 'setHolidayRate', + 'dpsbCode' => 'setDpsbCode', + 'expensesCode' => 'setExpensesCode', + 'grossDeductionCode' => 'setGrossDeductionCode', + 'holidayCode' => 'setHolidayCode', + 'cisFeeCode' => 'setCisFeeCode', + 'detailFeeInComment' => 'setDetailFeeInComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'enabled' => 'getEnabled', + 'chargePerTimesheet' => 'getChargePerTimesheet', + 'apprenticeshipLevyDednRate' => 'getApprenticeshipLevyDednRate', + 'holidayRate' => 'getHolidayRate', + 'dpsbCode' => 'getDpsbCode', + 'expensesCode' => 'getExpensesCode', + 'grossDeductionCode' => 'getGrossDeductionCode', + 'holidayCode' => 'getHolidayCode', + 'cisFeeCode' => 'getCisFeeCode', + 'detailFeeInComment' => 'getDetailFeeInComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('chargePerTimesheet', $data ?? [], null); + $this->setIfExists('apprenticeshipLevyDednRate', $data ?? [], null); + $this->setIfExists('holidayRate', $data ?? [], null); + $this->setIfExists('dpsbCode', $data ?? [], null); + $this->setIfExists('expensesCode', $data ?? [], null); + $this->setIfExists('grossDeductionCode', $data ?? [], null); + $this->setIfExists('holidayCode', $data ?? [], null); + $this->setIfExists('cisFeeCode', $data ?? [], null); + $this->setIfExists('detailFeeInComment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled(): ?bool + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled enabled + * + * @return $this + */ + public function setEnabled(?bool $enabled): static + { + if (is_null($enabled)) { + throw new InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets chargePerTimesheet + * + * @return float|null + */ + public function getChargePerTimesheet(): ?float + { + return $this->container['chargePerTimesheet']; + } + + /** + * Sets chargePerTimesheet + * + * @param float|null $chargePerTimesheet chargePerTimesheet + * + * @return $this + */ + public function setChargePerTimesheet(?float $chargePerTimesheet): static + { + if (is_null($chargePerTimesheet)) { + throw new InvalidArgumentException('non-nullable chargePerTimesheet cannot be null'); + } + $this->container['chargePerTimesheet'] = $chargePerTimesheet; + + return $this; + } + + /** + * Gets apprenticeshipLevyDednRate + * + * @return float|null + */ + public function getApprenticeshipLevyDednRate(): ?float + { + return $this->container['apprenticeshipLevyDednRate']; + } + + /** + * Sets apprenticeshipLevyDednRate + * + * @param float|null $apprenticeshipLevyDednRate apprenticeshipLevyDednRate + * + * @return $this + */ + public function setApprenticeshipLevyDednRate(?float $apprenticeshipLevyDednRate): static + { + if (is_null($apprenticeshipLevyDednRate)) { + throw new InvalidArgumentException('non-nullable apprenticeshipLevyDednRate cannot be null'); + } + $this->container['apprenticeshipLevyDednRate'] = $apprenticeshipLevyDednRate; + + return $this; + } + + /** + * Gets holidayRate + * + * @return float|null + */ + public function getHolidayRate(): ?float + { + return $this->container['holidayRate']; + } + + /** + * Sets holidayRate + * + * @param float|null $holidayRate holidayRate + * + * @return $this + */ + public function setHolidayRate(?float $holidayRate): static + { + if (is_null($holidayRate)) { + throw new InvalidArgumentException('non-nullable holidayRate cannot be null'); + } + $this->container['holidayRate'] = $holidayRate; + + return $this; + } + + /** + * Gets dpsbCode + * + * @return string|null + */ + public function getDpsbCode(): ?string + { + return $this->container['dpsbCode']; + } + + /** + * Sets dpsbCode + * + * @param string|null $dpsbCode dpsbCode + * + * @return $this + */ + public function setDpsbCode(?string $dpsbCode): static + { + if (is_null($dpsbCode)) { + array_push($this->openAPINullablesSetToNull, 'dpsbCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dpsbCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dpsbCode'] = $dpsbCode; + + return $this; + } + + /** + * Gets expensesCode + * + * @return string|null + */ + public function getExpensesCode(): ?string + { + return $this->container['expensesCode']; + } + + /** + * Sets expensesCode + * + * @param string|null $expensesCode expensesCode + * + * @return $this + */ + public function setExpensesCode(?string $expensesCode): static + { + if (is_null($expensesCode)) { + array_push($this->openAPINullablesSetToNull, 'expensesCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expensesCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expensesCode'] = $expensesCode; + + return $this; + } + + /** + * Gets grossDeductionCode + * + * @return string|null + */ + public function getGrossDeductionCode(): ?string + { + return $this->container['grossDeductionCode']; + } + + /** + * Sets grossDeductionCode + * + * @param string|null $grossDeductionCode grossDeductionCode + * + * @return $this + */ + public function setGrossDeductionCode(?string $grossDeductionCode): static + { + if (is_null($grossDeductionCode)) { + array_push($this->openAPINullablesSetToNull, 'grossDeductionCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('grossDeductionCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['grossDeductionCode'] = $grossDeductionCode; + + return $this; + } + + /** + * Gets holidayCode + * + * @return string|null + */ + public function getHolidayCode(): ?string + { + return $this->container['holidayCode']; + } + + /** + * Sets holidayCode + * + * @param string|null $holidayCode holidayCode + * + * @return $this + */ + public function setHolidayCode(?string $holidayCode): static + { + if (is_null($holidayCode)) { + array_push($this->openAPINullablesSetToNull, 'holidayCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('holidayCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['holidayCode'] = $holidayCode; + + return $this; + } + + /** + * Gets cisFeeCode + * + * @return string|null + */ + public function getCisFeeCode(): ?string + { + return $this->container['cisFeeCode']; + } + + /** + * Sets cisFeeCode + * + * @param string|null $cisFeeCode cisFeeCode + * + * @return $this + */ + public function setCisFeeCode(?string $cisFeeCode): static + { + if (is_null($cisFeeCode)) { + array_push($this->openAPINullablesSetToNull, 'cisFeeCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cisFeeCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cisFeeCode'] = $cisFeeCode; + + return $this; + } + + /** + * Gets detailFeeInComment + * + * @return bool|null + */ + public function getDetailFeeInComment(): ?bool + { + return $this->container['detailFeeInComment']; + } + + /** + * Sets detailFeeInComment + * + * @param bool|null $detailFeeInComment detailFeeInComment + * + * @return $this + */ + public function setDetailFeeInComment(?bool $detailFeeInComment): static + { + if (is_null($detailFeeInComment)) { + throw new InvalidArgumentException('non-nullable detailFeeInComment cannot be null'); + } + $this->container['detailFeeInComment'] = $detailFeeInComment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UsageBill.php b/src/Model/UsageBill.php new file mode 100644 index 0000000..672a087 --- /dev/null +++ b/src/Model/UsageBill.php @@ -0,0 +1,946 @@ + + */ +class UsageBill implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UsageBill'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'year' => 'int', + 'month' => 'int', + 'payslipCount' => 'int', + 'previouslyBilledPayslipCount' => 'int', + 'netCost' => 'float', + 'discount' => 'float', + 'partnerDiscountAmount' => 'float', + 'monthlyMinimum' => 'float', + 'total' => 'float', + 'paid' => 'bool', + 'usage' => '\SynergiTech\Staffology\Model\Item[]', + 'accountingCustomerId' => 'string', + 'accountingInvoiceId' => 'string', + 'accountingInvoiceLink' => 'string', + 'useNetSuite' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'year' => 'int32', + 'month' => 'int32', + 'payslipCount' => 'int32', + 'previouslyBilledPayslipCount' => 'int32', + 'netCost' => 'double', + 'discount' => 'double', + 'partnerDiscountAmount' => 'double', + 'monthlyMinimum' => 'double', + 'total' => 'double', + 'paid' => null, + 'usage' => null, + 'accountingCustomerId' => null, + 'accountingInvoiceId' => null, + 'accountingInvoiceLink' => null, + 'useNetSuite' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'year' => false, + 'month' => false, + 'payslipCount' => false, + 'previouslyBilledPayslipCount' => false, + 'netCost' => false, + 'discount' => false, + 'partnerDiscountAmount' => false, + 'monthlyMinimum' => false, + 'total' => false, + 'paid' => false, + 'usage' => true, + 'accountingCustomerId' => true, + 'accountingInvoiceId' => true, + 'accountingInvoiceLink' => true, + 'useNetSuite' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'year' => 'year', + 'month' => 'month', + 'payslipCount' => 'payslipCount', + 'previouslyBilledPayslipCount' => 'previouslyBilledPayslipCount', + 'netCost' => 'netCost', + 'discount' => 'discount', + 'partnerDiscountAmount' => 'partnerDiscountAmount', + 'monthlyMinimum' => 'monthlyMinimum', + 'total' => 'total', + 'paid' => 'paid', + 'usage' => 'usage', + 'accountingCustomerId' => 'accountingCustomerId', + 'accountingInvoiceId' => 'accountingInvoiceId', + 'accountingInvoiceLink' => 'accountingInvoiceLink', + 'useNetSuite' => 'useNetSuite', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'year' => 'setYear', + 'month' => 'setMonth', + 'payslipCount' => 'setPayslipCount', + 'previouslyBilledPayslipCount' => 'setPreviouslyBilledPayslipCount', + 'netCost' => 'setNetCost', + 'discount' => 'setDiscount', + 'partnerDiscountAmount' => 'setPartnerDiscountAmount', + 'monthlyMinimum' => 'setMonthlyMinimum', + 'total' => 'setTotal', + 'paid' => 'setPaid', + 'usage' => 'setUsage', + 'accountingCustomerId' => 'setAccountingCustomerId', + 'accountingInvoiceId' => 'setAccountingInvoiceId', + 'accountingInvoiceLink' => 'setAccountingInvoiceLink', + 'useNetSuite' => 'setUseNetSuite', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'year' => 'getYear', + 'month' => 'getMonth', + 'payslipCount' => 'getPayslipCount', + 'previouslyBilledPayslipCount' => 'getPreviouslyBilledPayslipCount', + 'netCost' => 'getNetCost', + 'discount' => 'getDiscount', + 'partnerDiscountAmount' => 'getPartnerDiscountAmount', + 'monthlyMinimum' => 'getMonthlyMinimum', + 'total' => 'getTotal', + 'paid' => 'getPaid', + 'usage' => 'getUsage', + 'accountingCustomerId' => 'getAccountingCustomerId', + 'accountingInvoiceId' => 'getAccountingInvoiceId', + 'accountingInvoiceLink' => 'getAccountingInvoiceLink', + 'useNetSuite' => 'getUseNetSuite', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('payslipCount', $data ?? [], null); + $this->setIfExists('previouslyBilledPayslipCount', $data ?? [], null); + $this->setIfExists('netCost', $data ?? [], null); + $this->setIfExists('discount', $data ?? [], null); + $this->setIfExists('partnerDiscountAmount', $data ?? [], null); + $this->setIfExists('monthlyMinimum', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('paid', $data ?? [], null); + $this->setIfExists('usage', $data ?? [], null); + $this->setIfExists('accountingCustomerId', $data ?? [], null); + $this->setIfExists('accountingInvoiceId', $data ?? [], null); + $this->setIfExists('accountingInvoiceLink', $data ?? [], null); + $this->setIfExists('useNetSuite', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets year + * + * @return int|null + */ + public function getYear(): ?int + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int|null $year year + * + * @return $this + */ + public function setYear(?int $year): static + { + if (is_null($year)) { + throw new InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets month + * + * @return int|null + */ + public function getMonth(): ?int + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int|null $month month + * + * @return $this + */ + public function setMonth(?int $month): static + { + if (is_null($month)) { + throw new InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets payslipCount + * + * @return int|null + */ + public function getPayslipCount(): ?int + { + return $this->container['payslipCount']; + } + + /** + * Sets payslipCount + * + * @param int|null $payslipCount payslipCount + * + * @return $this + */ + public function setPayslipCount(?int $payslipCount): static + { + if (is_null($payslipCount)) { + throw new InvalidArgumentException('non-nullable payslipCount cannot be null'); + } + $this->container['payslipCount'] = $payslipCount; + + return $this; + } + + /** + * Gets previouslyBilledPayslipCount + * + * @return int|null + */ + public function getPreviouslyBilledPayslipCount(): ?int + { + return $this->container['previouslyBilledPayslipCount']; + } + + /** + * Sets previouslyBilledPayslipCount + * + * @param int|null $previouslyBilledPayslipCount The number of payslips that appear in the usage, but were billed in a previous period + * + * @return $this + */ + public function setPreviouslyBilledPayslipCount(?int $previouslyBilledPayslipCount): static + { + if (is_null($previouslyBilledPayslipCount)) { + throw new InvalidArgumentException('non-nullable previouslyBilledPayslipCount cannot be null'); + } + $this->container['previouslyBilledPayslipCount'] = $previouslyBilledPayslipCount; + + return $this; + } + + /** + * Gets netCost + * + * @return float|null + */ + public function getNetCost(): ?float + { + return $this->container['netCost']; + } + + /** + * Sets netCost + * + * @param float|null $netCost Net cost of any payslips, or the Pricing Table minimum, whichever is greater. + * + * @return $this + */ + public function setNetCost(?float $netCost): static + { + if (is_null($netCost)) { + throw new InvalidArgumentException('non-nullable netCost cannot be null'); + } + $this->container['netCost'] = $netCost; + + return $this; + } + + /** + * Gets discount + * + * @return float|null + */ + public function getDiscount(): ?float + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param float|null $discount discount + * + * @return $this + */ + public function setDiscount(?float $discount): static + { + if (is_null($discount)) { + throw new InvalidArgumentException('non-nullable discount cannot be null'); + } + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets partnerDiscountAmount + * + * @return float|null + */ + public function getPartnerDiscountAmount(): ?float + { + return $this->container['partnerDiscountAmount']; + } + + /** + * Sets partnerDiscountAmount + * + * @param float|null $partnerDiscountAmount partnerDiscountAmount + * + * @return $this + */ + public function setPartnerDiscountAmount(?float $partnerDiscountAmount): static + { + if (is_null($partnerDiscountAmount)) { + throw new InvalidArgumentException('non-nullable partnerDiscountAmount cannot be null'); + } + $this->container['partnerDiscountAmount'] = $partnerDiscountAmount; + + return $this; + } + + /** + * Gets monthlyMinimum + * + * @return float|null + */ + public function getMonthlyMinimum(): ?float + { + return $this->container['monthlyMinimum']; + } + + /** + * Sets monthlyMinimum + * + * @param float|null $monthlyMinimum This is actually an offset against the NetCost and doesn't contain the full MonthlyMinimum. + * + * @return $this + */ + public function setMonthlyMinimum(?float $monthlyMinimum): static + { + if (is_null($monthlyMinimum)) { + throw new InvalidArgumentException('non-nullable monthlyMinimum cannot be null'); + } + $this->container['monthlyMinimum'] = $monthlyMinimum; + + return $this; + } + + /** + * Gets total + * + * @return float|null + */ + public function getTotal(): ?float + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal(?float $total): static + { + if (is_null($total)) { + throw new InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets paid + * + * @return bool|null + */ + public function getPaid(): ?bool + { + return $this->container['paid']; + } + + /** + * Sets paid + * + * @param bool|null $paid paid + * + * @return $this + */ + public function setPaid(?bool $paid): static + { + if (is_null($paid)) { + throw new InvalidArgumentException('non-nullable paid cannot be null'); + } + $this->container['paid'] = $paid; + + return $this; + } + + /** + * Gets usage + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getUsage(): ?array + { + return $this->container['usage']; + } + + /** + * Sets usage + * + * @param \SynergiTech\Staffology\Model\Item[]|null $usage usage + * + * @return $this + */ + public function setUsage(?array $usage): static + { + if (is_null($usage)) { + array_push($this->openAPINullablesSetToNull, 'usage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('usage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['usage'] = $usage; + + return $this; + } + + /** + * Gets accountingCustomerId + * + * @return string|null + */ + public function getAccountingCustomerId(): ?string + { + return $this->container['accountingCustomerId']; + } + + /** + * Sets accountingCustomerId + * + * @param string|null $accountingCustomerId accountingCustomerId + * + * @return $this + */ + public function setAccountingCustomerId(?string $accountingCustomerId): static + { + if (is_null($accountingCustomerId)) { + array_push($this->openAPINullablesSetToNull, 'accountingCustomerId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCustomerId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingCustomerId'] = $accountingCustomerId; + + return $this; + } + + /** + * Gets accountingInvoiceId + * + * @return string|null + */ + public function getAccountingInvoiceId(): ?string + { + return $this->container['accountingInvoiceId']; + } + + /** + * Sets accountingInvoiceId + * + * @param string|null $accountingInvoiceId accountingInvoiceId + * + * @return $this + */ + public function setAccountingInvoiceId(?string $accountingInvoiceId): static + { + if (is_null($accountingInvoiceId)) { + array_push($this->openAPINullablesSetToNull, 'accountingInvoiceId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingInvoiceId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingInvoiceId'] = $accountingInvoiceId; + + return $this; + } + + /** + * Gets accountingInvoiceLink + * + * @return string|null + */ + public function getAccountingInvoiceLink(): ?string + { + return $this->container['accountingInvoiceLink']; + } + + /** + * Sets accountingInvoiceLink + * + * @param string|null $accountingInvoiceLink accountingInvoiceLink + * + * @return $this + */ + public function setAccountingInvoiceLink(?string $accountingInvoiceLink): static + { + if (is_null($accountingInvoiceLink)) { + array_push($this->openAPINullablesSetToNull, 'accountingInvoiceLink'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingInvoiceLink', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingInvoiceLink'] = $accountingInvoiceLink; + + return $this; + } + + /** + * Gets useNetSuite + * + * @return bool|null + */ + public function getUseNetSuite(): ?bool + { + return $this->container['useNetSuite']; + } + + /** + * Sets useNetSuite + * + * @param bool|null $useNetSuite useNetSuite + * + * @return $this + */ + public function setUseNetSuite(?bool $useNetSuite): static + { + if (is_null($useNetSuite)) { + throw new InvalidArgumentException('non-nullable useNetSuite cannot be null'); + } + $this->container['useNetSuite'] = $useNetSuite; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/User.php b/src/Model/User.php new file mode 100644 index 0000000..2962571 --- /dev/null +++ b/src/Model/User.php @@ -0,0 +1,2298 @@ + + */ +class User implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'User'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'category' => '\SynergiTech\Staffology\Model\UserCategory', + 'emailAddress' => 'string', + 'pendingEmailAddress' => 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'salutation' => 'string', + 'userIdentifier' => 'string', + 'photo' => 'string', + 'photoSasUrl' => 'string', + 'role' => '\SynergiTech\Staffology\Model\UserRole', + 'jobType' => '\SynergiTech\Staffology\Model\UserJobType', + 'jobTitle' => 'string', + 'telephoneNumber' => 'string', + 'businessName' => 'string', + 'industry' => '\SynergiTech\Staffology\Model\UserIndustry', + 'address' => '\SynergiTech\Staffology\Model\Address', + 'statedEmployeeCount' => 'int', + 'emailVerified' => 'bool', + 'emailVerificationKey' => 'string', + 'gdprOptin' => 'bool', + 'inviteCode' => 'string', + 'registrationIp' => 'string', + 'registrationDate' => '\DateTime', + 'lastLogin' => '\DateTime', + 'isActivated' => 'bool', + 'authorization' => '\SynergiTech\Staffology\Model\UserAuthorization', + 'isSuperAdmin' => 'bool', + 'canUseBureauFeatures' => 'bool', + 'canUseBetaFeatures' => 'bool', + 'canUseReportWriter' => 'bool', + 'isBilledInNetSuite' => 'bool', + 'tenant' => '\SynergiTech\Staffology\Model\Tenant', + 'requestDdSetup' => 'bool', + 'disabled' => 'bool', + 'canCreateEmployers' => 'bool', + 'disabledReason' => 'string', + 'directDebitMandate' => '\SynergiTech\Staffology\Model\DirectDebitMandate', + 'displayPrefs' => '\SynergiTech\Staffology\Model\UserDisplayPreferences', + 'showBills' => 'bool', + 'accountingCustomerId' => 'string', + 'pricingTableId' => 'string', + 'utmInfo' => '\SynergiTech\Staffology\Model\UtmInfo', + 'firstBillableActivityDate' => '\DateTime', + 'bureauNotificationEmailAddress' => 'string', + 'monthlyMinimum' => '\SynergiTech\Staffology\Model\MonthlyMinimum', + 'apiMailingEnabled' => 'bool', + 'loginDisabled' => 'bool', + 'isBureauMember' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'category' => null, + 'emailAddress' => 'email', + 'pendingEmailAddress' => 'email', + 'firstName' => null, + 'lastName' => null, + 'salutation' => null, + 'userIdentifier' => null, + 'photo' => null, + 'photoSasUrl' => null, + 'role' => null, + 'jobType' => null, + 'jobTitle' => null, + 'telephoneNumber' => null, + 'businessName' => null, + 'industry' => null, + 'address' => null, + 'statedEmployeeCount' => 'int32', + 'emailVerified' => null, + 'emailVerificationKey' => 'uuid', + 'gdprOptin' => null, + 'inviteCode' => null, + 'registrationIp' => null, + 'registrationDate' => 'date', + 'lastLogin' => 'date', + 'isActivated' => null, + 'authorization' => null, + 'isSuperAdmin' => null, + 'canUseBureauFeatures' => null, + 'canUseBetaFeatures' => null, + 'canUseReportWriter' => null, + 'isBilledInNetSuite' => null, + 'tenant' => null, + 'requestDdSetup' => null, + 'disabled' => null, + 'canCreateEmployers' => null, + 'disabledReason' => null, + 'directDebitMandate' => null, + 'displayPrefs' => null, + 'showBills' => null, + 'accountingCustomerId' => null, + 'pricingTableId' => 'uuid', + 'utmInfo' => null, + 'firstBillableActivityDate' => 'date', + 'bureauNotificationEmailAddress' => 'email', + 'monthlyMinimum' => null, + 'apiMailingEnabled' => null, + 'loginDisabled' => null, + 'isBureauMember' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'category' => false, + 'emailAddress' => true, + 'pendingEmailAddress' => true, + 'firstName' => true, + 'lastName' => true, + 'salutation' => true, + 'userIdentifier' => true, + 'photo' => true, + 'photoSasUrl' => true, + 'role' => false, + 'jobType' => false, + 'jobTitle' => true, + 'telephoneNumber' => true, + 'businessName' => true, + 'industry' => false, + 'address' => false, + 'statedEmployeeCount' => true, + 'emailVerified' => false, + 'emailVerificationKey' => false, + 'gdprOptin' => false, + 'inviteCode' => true, + 'registrationIp' => true, + 'registrationDate' => false, + 'lastLogin' => true, + 'isActivated' => false, + 'authorization' => false, + 'isSuperAdmin' => false, + 'canUseBureauFeatures' => false, + 'canUseBetaFeatures' => false, + 'canUseReportWriter' => false, + 'isBilledInNetSuite' => false, + 'tenant' => false, + 'requestDdSetup' => false, + 'disabled' => false, + 'canCreateEmployers' => false, + 'disabledReason' => true, + 'directDebitMandate' => false, + 'displayPrefs' => false, + 'showBills' => true, + 'accountingCustomerId' => true, + 'pricingTableId' => true, + 'utmInfo' => false, + 'firstBillableActivityDate' => true, + 'bureauNotificationEmailAddress' => true, + 'monthlyMinimum' => false, + 'apiMailingEnabled' => false, + 'loginDisabled' => false, + 'isBureauMember' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'category' => 'category', + 'emailAddress' => 'emailAddress', + 'pendingEmailAddress' => 'pendingEmailAddress', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'salutation' => 'salutation', + 'userIdentifier' => 'userIdentifier', + 'photo' => 'photo', + 'photoSasUrl' => 'photoSasUrl', + 'role' => 'role', + 'jobType' => 'jobType', + 'jobTitle' => 'jobTitle', + 'telephoneNumber' => 'telephoneNumber', + 'businessName' => 'businessName', + 'industry' => 'industry', + 'address' => 'address', + 'statedEmployeeCount' => 'statedEmployeeCount', + 'emailVerified' => 'emailVerified', + 'emailVerificationKey' => 'emailVerificationKey', + 'gdprOptin' => 'gdprOptin', + 'inviteCode' => 'inviteCode', + 'registrationIp' => 'registrationIp', + 'registrationDate' => 'registrationDate', + 'lastLogin' => 'lastLogin', + 'isActivated' => 'isActivated', + 'authorization' => 'authorization', + 'isSuperAdmin' => 'isSuperAdmin', + 'canUseBureauFeatures' => 'canUseBureauFeatures', + 'canUseBetaFeatures' => 'canUseBetaFeatures', + 'canUseReportWriter' => 'canUseReportWriter', + 'isBilledInNetSuite' => 'isBilledInNetSuite', + 'tenant' => 'tenant', + 'requestDdSetup' => 'requestDdSetup', + 'disabled' => 'disabled', + 'canCreateEmployers' => 'canCreateEmployers', + 'disabledReason' => 'disabledReason', + 'directDebitMandate' => 'directDebitMandate', + 'displayPrefs' => 'displayPrefs', + 'showBills' => 'showBills', + 'accountingCustomerId' => 'accountingCustomerId', + 'pricingTableId' => 'pricingTableId', + 'utmInfo' => 'utmInfo', + 'firstBillableActivityDate' => 'firstBillableActivityDate', + 'bureauNotificationEmailAddress' => 'bureauNotificationEmailAddress', + 'monthlyMinimum' => 'monthlyMinimum', + 'apiMailingEnabled' => 'apiMailingEnabled', + 'loginDisabled' => 'loginDisabled', + 'isBureauMember' => 'isBureauMember', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'category' => 'setCategory', + 'emailAddress' => 'setEmailAddress', + 'pendingEmailAddress' => 'setPendingEmailAddress', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'salutation' => 'setSalutation', + 'userIdentifier' => 'setUserIdentifier', + 'photo' => 'setPhoto', + 'photoSasUrl' => 'setPhotoSasUrl', + 'role' => 'setRole', + 'jobType' => 'setJobType', + 'jobTitle' => 'setJobTitle', + 'telephoneNumber' => 'setTelephoneNumber', + 'businessName' => 'setBusinessName', + 'industry' => 'setIndustry', + 'address' => 'setAddress', + 'statedEmployeeCount' => 'setStatedEmployeeCount', + 'emailVerified' => 'setEmailVerified', + 'emailVerificationKey' => 'setEmailVerificationKey', + 'gdprOptin' => 'setGdprOptin', + 'inviteCode' => 'setInviteCode', + 'registrationIp' => 'setRegistrationIp', + 'registrationDate' => 'setRegistrationDate', + 'lastLogin' => 'setLastLogin', + 'isActivated' => 'setIsActivated', + 'authorization' => 'setAuthorization', + 'isSuperAdmin' => 'setIsSuperAdmin', + 'canUseBureauFeatures' => 'setCanUseBureauFeatures', + 'canUseBetaFeatures' => 'setCanUseBetaFeatures', + 'canUseReportWriter' => 'setCanUseReportWriter', + 'isBilledInNetSuite' => 'setIsBilledInNetSuite', + 'tenant' => 'setTenant', + 'requestDdSetup' => 'setRequestDdSetup', + 'disabled' => 'setDisabled', + 'canCreateEmployers' => 'setCanCreateEmployers', + 'disabledReason' => 'setDisabledReason', + 'directDebitMandate' => 'setDirectDebitMandate', + 'displayPrefs' => 'setDisplayPrefs', + 'showBills' => 'setShowBills', + 'accountingCustomerId' => 'setAccountingCustomerId', + 'pricingTableId' => 'setPricingTableId', + 'utmInfo' => 'setUtmInfo', + 'firstBillableActivityDate' => 'setFirstBillableActivityDate', + 'bureauNotificationEmailAddress' => 'setBureauNotificationEmailAddress', + 'monthlyMinimum' => 'setMonthlyMinimum', + 'apiMailingEnabled' => 'setApiMailingEnabled', + 'loginDisabled' => 'setLoginDisabled', + 'isBureauMember' => 'setIsBureauMember', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'category' => 'getCategory', + 'emailAddress' => 'getEmailAddress', + 'pendingEmailAddress' => 'getPendingEmailAddress', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'salutation' => 'getSalutation', + 'userIdentifier' => 'getUserIdentifier', + 'photo' => 'getPhoto', + 'photoSasUrl' => 'getPhotoSasUrl', + 'role' => 'getRole', + 'jobType' => 'getJobType', + 'jobTitle' => 'getJobTitle', + 'telephoneNumber' => 'getTelephoneNumber', + 'businessName' => 'getBusinessName', + 'industry' => 'getIndustry', + 'address' => 'getAddress', + 'statedEmployeeCount' => 'getStatedEmployeeCount', + 'emailVerified' => 'getEmailVerified', + 'emailVerificationKey' => 'getEmailVerificationKey', + 'gdprOptin' => 'getGdprOptin', + 'inviteCode' => 'getInviteCode', + 'registrationIp' => 'getRegistrationIp', + 'registrationDate' => 'getRegistrationDate', + 'lastLogin' => 'getLastLogin', + 'isActivated' => 'getIsActivated', + 'authorization' => 'getAuthorization', + 'isSuperAdmin' => 'getIsSuperAdmin', + 'canUseBureauFeatures' => 'getCanUseBureauFeatures', + 'canUseBetaFeatures' => 'getCanUseBetaFeatures', + 'canUseReportWriter' => 'getCanUseReportWriter', + 'isBilledInNetSuite' => 'getIsBilledInNetSuite', + 'tenant' => 'getTenant', + 'requestDdSetup' => 'getRequestDdSetup', + 'disabled' => 'getDisabled', + 'canCreateEmployers' => 'getCanCreateEmployers', + 'disabledReason' => 'getDisabledReason', + 'directDebitMandate' => 'getDirectDebitMandate', + 'displayPrefs' => 'getDisplayPrefs', + 'showBills' => 'getShowBills', + 'accountingCustomerId' => 'getAccountingCustomerId', + 'pricingTableId' => 'getPricingTableId', + 'utmInfo' => 'getUtmInfo', + 'firstBillableActivityDate' => 'getFirstBillableActivityDate', + 'bureauNotificationEmailAddress' => 'getBureauNotificationEmailAddress', + 'monthlyMinimum' => 'getMonthlyMinimum', + 'apiMailingEnabled' => 'getApiMailingEnabled', + 'loginDisabled' => 'getLoginDisabled', + 'isBureauMember' => 'getIsBureauMember', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('emailAddress', $data ?? [], null); + $this->setIfExists('pendingEmailAddress', $data ?? [], null); + $this->setIfExists('firstName', $data ?? [], null); + $this->setIfExists('lastName', $data ?? [], null); + $this->setIfExists('salutation', $data ?? [], null); + $this->setIfExists('userIdentifier', $data ?? [], null); + $this->setIfExists('photo', $data ?? [], null); + $this->setIfExists('photoSasUrl', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('jobType', $data ?? [], null); + $this->setIfExists('jobTitle', $data ?? [], null); + $this->setIfExists('telephoneNumber', $data ?? [], null); + $this->setIfExists('businessName', $data ?? [], null); + $this->setIfExists('industry', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('statedEmployeeCount', $data ?? [], null); + $this->setIfExists('emailVerified', $data ?? [], null); + $this->setIfExists('emailVerificationKey', $data ?? [], null); + $this->setIfExists('gdprOptin', $data ?? [], null); + $this->setIfExists('inviteCode', $data ?? [], null); + $this->setIfExists('registrationIp', $data ?? [], null); + $this->setIfExists('registrationDate', $data ?? [], null); + $this->setIfExists('lastLogin', $data ?? [], null); + $this->setIfExists('isActivated', $data ?? [], null); + $this->setIfExists('authorization', $data ?? [], null); + $this->setIfExists('isSuperAdmin', $data ?? [], null); + $this->setIfExists('canUseBureauFeatures', $data ?? [], null); + $this->setIfExists('canUseBetaFeatures', $data ?? [], null); + $this->setIfExists('canUseReportWriter', $data ?? [], null); + $this->setIfExists('isBilledInNetSuite', $data ?? [], null); + $this->setIfExists('tenant', $data ?? [], null); + $this->setIfExists('requestDdSetup', $data ?? [], null); + $this->setIfExists('disabled', $data ?? [], null); + $this->setIfExists('canCreateEmployers', $data ?? [], null); + $this->setIfExists('disabledReason', $data ?? [], null); + $this->setIfExists('directDebitMandate', $data ?? [], null); + $this->setIfExists('displayPrefs', $data ?? [], null); + $this->setIfExists('showBills', $data ?? [], null); + $this->setIfExists('accountingCustomerId', $data ?? [], null); + $this->setIfExists('pricingTableId', $data ?? [], null); + $this->setIfExists('utmInfo', $data ?? [], null); + $this->setIfExists('firstBillableActivityDate', $data ?? [], null); + $this->setIfExists('bureauNotificationEmailAddress', $data ?? [], null); + $this->setIfExists('monthlyMinimum', $data ?? [], null); + $this->setIfExists('apiMailingEnabled', $data ?? [], null); + $this->setIfExists('loginDisabled', $data ?? [], null); + $this->setIfExists('isBureauMember', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['emailAddress']) && (mb_strlen($this->container['emailAddress']) > 150)) { + $invalidProperties[] = "invalid value for 'emailAddress', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['pendingEmailAddress']) && (mb_strlen($this->container['pendingEmailAddress']) > 150)) { + $invalidProperties[] = "invalid value for 'pendingEmailAddress', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['firstName']) && (mb_strlen($this->container['firstName']) > 150)) { + $invalidProperties[] = "invalid value for 'firstName', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['lastName']) && (mb_strlen($this->container['lastName']) > 150)) { + $invalidProperties[] = "invalid value for 'lastName', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['salutation']) && (mb_strlen($this->container['salutation']) > 35)) { + $invalidProperties[] = "invalid value for 'salutation', the character length must be smaller than or equal to 35."; + } + + if (!is_null($this->container['salutation']) && !preg_match("/^[A-Za-z '\\-]{1,35}$/", $this->container['salutation'])) { + $invalidProperties[] = "invalid value for 'salutation', must be conform to the pattern /^[A-Za-z '\\-]{1,35}$/."; + } + + if (!is_null($this->container['userIdentifier']) && (mb_strlen($this->container['userIdentifier']) > 150)) { + $invalidProperties[] = "invalid value for 'userIdentifier', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['photo']) && (mb_strlen($this->container['photo']) > 1000)) { + $invalidProperties[] = "invalid value for 'photo', the character length must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['jobTitle']) && (mb_strlen($this->container['jobTitle']) > 150)) { + $invalidProperties[] = "invalid value for 'jobTitle', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['telephoneNumber']) && (mb_strlen($this->container['telephoneNumber']) > 20)) { + $invalidProperties[] = "invalid value for 'telephoneNumber', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['businessName']) && (mb_strlen($this->container['businessName']) > 160)) { + $invalidProperties[] = "invalid value for 'businessName', the character length must be smaller than or equal to 160."; + } + + if (!is_null($this->container['businessName']) && !preg_match("/^[A-Za-z0-9 ,;:'£()\\-\\.\\@\\$\\&]{1,160}$/", $this->container['businessName'])) { + $invalidProperties[] = "invalid value for 'businessName', must be conform to the pattern /^[A-Za-z0-9 ,;:'£()\\-\\.\\@\\$\\&]{1,160}$/."; + } + + if (!is_null($this->container['registrationIp']) && (mb_strlen($this->container['registrationIp']) > 20)) { + $invalidProperties[] = "invalid value for 'registrationIp', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['bureauNotificationEmailAddress']) && (mb_strlen($this->container['bureauNotificationEmailAddress']) > 150)) { + $invalidProperties[] = "invalid value for 'bureauNotificationEmailAddress', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets category + * + * @return \SynergiTech\Staffology\Model\UserCategory|null + */ + public function getCategory(): ?\SynergiTech\Staffology\Model\UserCategory + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \SynergiTech\Staffology\Model\UserCategory|null $category category + * + * @return $this + */ + public function setCategory(?\SynergiTech\Staffology\Model\UserCategory $category): static + { + if (is_null($category)) { + throw new InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets emailAddress + * + * @return string|null + */ + public function getEmailAddress(): ?string + { + return $this->container['emailAddress']; + } + + /** + * Sets emailAddress + * + * @param string|null $emailAddress emailAddress + * + * @return $this + */ + public function setEmailAddress(?string $emailAddress): static + { + if (is_null($emailAddress)) { + array_push($this->openAPINullablesSetToNull, 'emailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($emailAddress) && (mb_strlen($emailAddress) > 150)) { + throw new InvalidArgumentException('invalid length for $emailAddress when calling User., must be smaller than or equal to 150.'); + } + + $this->container['emailAddress'] = $emailAddress; + + return $this; + } + + /** + * Gets pendingEmailAddress + * + * @return string|null + */ + public function getPendingEmailAddress(): ?string + { + return $this->container['pendingEmailAddress']; + } + + /** + * Sets pendingEmailAddress + * + * @param string|null $pendingEmailAddress If the user has requested to change their email address then the address it'll be changed to after verification will be shown here. + * + * @return $this + */ + public function setPendingEmailAddress(?string $pendingEmailAddress): static + { + if (is_null($pendingEmailAddress)) { + array_push($this->openAPINullablesSetToNull, 'pendingEmailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pendingEmailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($pendingEmailAddress) && (mb_strlen($pendingEmailAddress) > 150)) { + throw new InvalidArgumentException('invalid length for $pendingEmailAddress when calling User., must be smaller than or equal to 150.'); + } + + $this->container['pendingEmailAddress'] = $pendingEmailAddress; + + return $this; + } + + /** + * Gets firstName + * + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string|null $firstName firstName + * + * @return $this + */ + public function setFirstName(?string $firstName): static + { + if (is_null($firstName)) { + array_push($this->openAPINullablesSetToNull, 'firstName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($firstName) && (mb_strlen($firstName) > 150)) { + throw new InvalidArgumentException('invalid length for $firstName when calling User., must be smaller than or equal to 150.'); + } + + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string|null + */ + public function getLastName(): ?string + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string|null $lastName lastName + * + * @return $this + */ + public function setLastName(?string $lastName): static + { + if (is_null($lastName)) { + array_push($this->openAPINullablesSetToNull, 'lastName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($lastName) && (mb_strlen($lastName) > 150)) { + throw new InvalidArgumentException('invalid length for $lastName when calling User., must be smaller than or equal to 150.'); + } + + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets salutation + * + * @return string|null + */ + public function getSalutation(): ?string + { + return $this->container['salutation']; + } + + /** + * Sets salutation + * + * @param string|null $salutation salutation + * + * @return $this + */ + public function setSalutation(?string $salutation): static + { + if (is_null($salutation)) { + array_push($this->openAPINullablesSetToNull, 'salutation'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('salutation', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($salutation) && (mb_strlen($salutation) > 35)) { + throw new InvalidArgumentException('invalid length for $salutation when calling User., must be smaller than or equal to 35.'); + } + if (!is_null($salutation) && (!preg_match("/^[A-Za-z '\\-]{1,35}$/", ObjectSerializer::toString($salutation)))) { + throw new InvalidArgumentException("invalid value for \$salutation when calling User., must conform to the pattern /^[A-Za-z '\\-]{1,35}$/."); + } + + $this->container['salutation'] = $salutation; + + return $this; + } + + /** + * Gets userIdentifier + * + * @return string|null + */ + public function getUserIdentifier(): ?string + { + return $this->container['userIdentifier']; + } + + /** + * Sets userIdentifier + * + * @param string|null $userIdentifier userIdentifier + * + * @return $this + */ + public function setUserIdentifier(?string $userIdentifier): static + { + if (is_null($userIdentifier)) { + array_push($this->openAPINullablesSetToNull, 'userIdentifier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('userIdentifier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($userIdentifier) && (mb_strlen($userIdentifier) > 150)) { + throw new InvalidArgumentException('invalid length for $userIdentifier when calling User., must be smaller than or equal to 150.'); + } + + $this->container['userIdentifier'] = $userIdentifier; + + return $this; + } + + /** + * Gets photo + * + * @return string|null + */ + public function getPhoto(): ?string + { + return $this->container['photo']; + } + + /** + * Sets photo + * + * @param string|null $photo photo + * + * @return $this + */ + public function setPhoto(?string $photo): static + { + if (is_null($photo)) { + array_push($this->openAPINullablesSetToNull, 'photo'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photo', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($photo) && (mb_strlen($photo) > 1000)) { + throw new InvalidArgumentException('invalid length for $photo when calling User., must be smaller than or equal to 1000.'); + } + + $this->container['photo'] = $photo; + + return $this; + } + + /** + * Gets photoSasUrl + * + * @return string|null + */ + public function getPhotoSasUrl(): ?string + { + return $this->container['photoSasUrl']; + } + + /** + * Sets photoSasUrl + * + * @param string|null $photoSasUrl photoSasUrl + * + * @return $this + */ + public function setPhotoSasUrl(?string $photoSasUrl): static + { + if (is_null($photoSasUrl)) { + array_push($this->openAPINullablesSetToNull, 'photoSasUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('photoSasUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['photoSasUrl'] = $photoSasUrl; + + return $this; + } + + /** + * Gets role + * + * @return \SynergiTech\Staffology\Model\UserRole|null + */ + public function getRole(): ?\SynergiTech\Staffology\Model\UserRole + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param \SynergiTech\Staffology\Model\UserRole|null $role role + * + * @return $this + */ + public function setRole(?\SynergiTech\Staffology\Model\UserRole $role): static + { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets jobType + * + * @return \SynergiTech\Staffology\Model\UserJobType|null + */ + public function getJobType(): ?\SynergiTech\Staffology\Model\UserJobType + { + return $this->container['jobType']; + } + + /** + * Sets jobType + * + * @param \SynergiTech\Staffology\Model\UserJobType|null $jobType jobType + * + * @return $this + */ + public function setJobType(?\SynergiTech\Staffology\Model\UserJobType $jobType): static + { + if (is_null($jobType)) { + throw new InvalidArgumentException('non-nullable jobType cannot be null'); + } + $this->container['jobType'] = $jobType; + + return $this; + } + + /** + * Gets jobTitle + * + * @return string|null + */ + public function getJobTitle(): ?string + { + return $this->container['jobTitle']; + } + + /** + * Sets jobTitle + * + * @param string|null $jobTitle jobTitle + * + * @return $this + */ + public function setJobTitle(?string $jobTitle): static + { + if (is_null($jobTitle)) { + array_push($this->openAPINullablesSetToNull, 'jobTitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('jobTitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($jobTitle) && (mb_strlen($jobTitle) > 150)) { + throw new InvalidArgumentException('invalid length for $jobTitle when calling User., must be smaller than or equal to 150.'); + } + + $this->container['jobTitle'] = $jobTitle; + + return $this; + } + + /** + * Gets telephoneNumber + * + * @return string|null + */ + public function getTelephoneNumber(): ?string + { + return $this->container['telephoneNumber']; + } + + /** + * Sets telephoneNumber + * + * @param string|null $telephoneNumber telephoneNumber + * + * @return $this + */ + public function setTelephoneNumber(?string $telephoneNumber): static + { + if (is_null($telephoneNumber)) { + array_push($this->openAPINullablesSetToNull, 'telephoneNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('telephoneNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($telephoneNumber) && (mb_strlen($telephoneNumber) > 20)) { + throw new InvalidArgumentException('invalid length for $telephoneNumber when calling User., must be smaller than or equal to 20.'); + } + + $this->container['telephoneNumber'] = $telephoneNumber; + + return $this; + } + + /** + * Gets businessName + * + * @return string|null + */ + public function getBusinessName(): ?string + { + return $this->container['businessName']; + } + + /** + * Sets businessName + * + * @param string|null $businessName businessName + * + * @return $this + */ + public function setBusinessName(?string $businessName): static + { + if (is_null($businessName)) { + array_push($this->openAPINullablesSetToNull, 'businessName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('businessName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($businessName) && (mb_strlen($businessName) > 160)) { + throw new InvalidArgumentException('invalid length for $businessName when calling User., must be smaller than or equal to 160.'); + } + if (!is_null($businessName) && (!preg_match("/^[A-Za-z0-9 ,;:'£()\\-\\.\\@\\$\\&]{1,160}$/", ObjectSerializer::toString($businessName)))) { + throw new InvalidArgumentException("invalid value for \$businessName when calling User., must conform to the pattern /^[A-Za-z0-9 ,;:'£()\\-\\.\\@\\$\\&]{1,160}$/."); + } + + $this->container['businessName'] = $businessName; + + return $this; + } + + /** + * Gets industry + * + * @return \SynergiTech\Staffology\Model\UserIndustry|null + */ + public function getIndustry(): ?\SynergiTech\Staffology\Model\UserIndustry + { + return $this->container['industry']; + } + + /** + * Sets industry + * + * @param \SynergiTech\Staffology\Model\UserIndustry|null $industry industry + * + * @return $this + */ + public function setIndustry(?\SynergiTech\Staffology\Model\UserIndustry $industry): static + { + if (is_null($industry)) { + throw new InvalidArgumentException('non-nullable industry cannot be null'); + } + $this->container['industry'] = $industry; + + return $this; + } + + /** + * Gets address + * + * @return \SynergiTech\Staffology\Model\Address|null + */ + public function getAddress(): ?\SynergiTech\Staffology\Model\Address + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SynergiTech\Staffology\Model\Address|null $address address + * + * @return $this + */ + public function setAddress(?\SynergiTech\Staffology\Model\Address $address): static + { + if (is_null($address)) { + throw new InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets statedEmployeeCount + * + * @return int|null + */ + public function getStatedEmployeeCount(): ?int + { + return $this->container['statedEmployeeCount']; + } + + /** + * Sets statedEmployeeCount + * + * @param int|null $statedEmployeeCount statedEmployeeCount + * + * @return $this + */ + public function setStatedEmployeeCount(?int $statedEmployeeCount): static + { + if (is_null($statedEmployeeCount)) { + array_push($this->openAPINullablesSetToNull, 'statedEmployeeCount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statedEmployeeCount', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['statedEmployeeCount'] = $statedEmployeeCount; + + return $this; + } + + /** + * Gets emailVerified + * + * @return bool|null + */ + public function getEmailVerified(): ?bool + { + return $this->container['emailVerified']; + } + + /** + * Sets emailVerified + * + * @param bool|null $emailVerified emailVerified + * + * @return $this + */ + public function setEmailVerified(?bool $emailVerified): static + { + if (is_null($emailVerified)) { + throw new InvalidArgumentException('non-nullable emailVerified cannot be null'); + } + $this->container['emailVerified'] = $emailVerified; + + return $this; + } + + /** + * Gets emailVerificationKey + * + * @return string|null + */ + public function getEmailVerificationKey(): ?string + { + return $this->container['emailVerificationKey']; + } + + /** + * Sets emailVerificationKey + * + * @param string|null $emailVerificationKey emailVerificationKey + * + * @return $this + */ + public function setEmailVerificationKey(?string $emailVerificationKey): static + { + if (is_null($emailVerificationKey)) { + throw new InvalidArgumentException('non-nullable emailVerificationKey cannot be null'); + } + $this->container['emailVerificationKey'] = $emailVerificationKey; + + return $this; + } + + /** + * Gets gdprOptin + * + * @return bool|null + */ + public function getGdprOptin(): ?bool + { + return $this->container['gdprOptin']; + } + + /** + * Sets gdprOptin + * + * @param bool|null $gdprOptin gdprOptin + * + * @return $this + */ + public function setGdprOptin(?bool $gdprOptin): static + { + if (is_null($gdprOptin)) { + throw new InvalidArgumentException('non-nullable gdprOptin cannot be null'); + } + $this->container['gdprOptin'] = $gdprOptin; + + return $this; + } + + /** + * Gets inviteCode + * + * @return string|null + */ + public function getInviteCode(): ?string + { + return $this->container['inviteCode']; + } + + /** + * Sets inviteCode + * + * @param string|null $inviteCode inviteCode + * + * @return $this + */ + public function setInviteCode(?string $inviteCode): static + { + if (is_null($inviteCode)) { + array_push($this->openAPINullablesSetToNull, 'inviteCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inviteCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['inviteCode'] = $inviteCode; + + return $this; + } + + /** + * Gets registrationIp + * + * @return string|null + */ + public function getRegistrationIp(): ?string + { + return $this->container['registrationIp']; + } + + /** + * Sets registrationIp + * + * @param string|null $registrationIp registrationIp + * + * @return $this + */ + public function setRegistrationIp(?string $registrationIp): static + { + if (is_null($registrationIp)) { + array_push($this->openAPINullablesSetToNull, 'registrationIp'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('registrationIp', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($registrationIp) && (mb_strlen($registrationIp) > 20)) { + throw new InvalidArgumentException('invalid length for $registrationIp when calling User., must be smaller than or equal to 20.'); + } + + $this->container['registrationIp'] = $registrationIp; + + return $this; + } + + /** + * Gets registrationDate + * + * @return \DateTime|null + */ + public function getRegistrationDate(): ?\DateTime + { + return $this->container['registrationDate']; + } + + /** + * Sets registrationDate + * + * @param \DateTime|null $registrationDate registrationDate + * + * @return $this + */ + public function setRegistrationDate(?\DateTime $registrationDate): static + { + if (is_null($registrationDate)) { + throw new InvalidArgumentException('non-nullable registrationDate cannot be null'); + } + $this->container['registrationDate'] = $registrationDate; + + return $this; + } + + /** + * Gets lastLogin + * + * @return \DateTime|null + */ + public function getLastLogin(): ?\DateTime + { + return $this->container['lastLogin']; + } + + /** + * Sets lastLogin + * + * @param \DateTime|null $lastLogin lastLogin + * + * @return $this + */ + public function setLastLogin(?\DateTime $lastLogin): static + { + if (is_null($lastLogin)) { + array_push($this->openAPINullablesSetToNull, 'lastLogin'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lastLogin', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lastLogin'] = $lastLogin; + + return $this; + } + + /** + * Gets isActivated + * + * @return bool|null + */ + public function getIsActivated(): ?bool + { + return $this->container['isActivated']; + } + + /** + * Sets isActivated + * + * @param bool|null $isActivated isActivated + * + * @return $this + */ + public function setIsActivated(?bool $isActivated): static + { + if (is_null($isActivated)) { + throw new InvalidArgumentException('non-nullable isActivated cannot be null'); + } + $this->container['isActivated'] = $isActivated; + + return $this; + } + + /** + * Gets authorization + * + * @return \SynergiTech\Staffology\Model\UserAuthorization|null + */ + public function getAuthorization(): ?\SynergiTech\Staffology\Model\UserAuthorization + { + return $this->container['authorization']; + } + + /** + * Sets authorization + * + * @param \SynergiTech\Staffology\Model\UserAuthorization|null $authorization authorization + * + * @return $this + */ + public function setAuthorization(?\SynergiTech\Staffology\Model\UserAuthorization $authorization): static + { + if (is_null($authorization)) { + throw new InvalidArgumentException('non-nullable authorization cannot be null'); + } + $this->container['authorization'] = $authorization; + + return $this; + } + + /** + * Gets isSuperAdmin + * + * @return bool|null + */ + public function getIsSuperAdmin(): ?bool + { + return $this->container['isSuperAdmin']; + } + + /** + * Sets isSuperAdmin + * + * @param bool|null $isSuperAdmin isSuperAdmin + * + * @return $this + */ + public function setIsSuperAdmin(?bool $isSuperAdmin): static + { + if (is_null($isSuperAdmin)) { + throw new InvalidArgumentException('non-nullable isSuperAdmin cannot be null'); + } + $this->container['isSuperAdmin'] = $isSuperAdmin; + + return $this; + } + + /** + * Gets canUseBureauFeatures + * + * @return bool|null + */ + public function getCanUseBureauFeatures(): ?bool + { + return $this->container['canUseBureauFeatures']; + } + + /** + * Sets canUseBureauFeatures + * + * @param bool|null $canUseBureauFeatures canUseBureauFeatures + * + * @return $this + */ + public function setCanUseBureauFeatures(?bool $canUseBureauFeatures): static + { + if (is_null($canUseBureauFeatures)) { + throw new InvalidArgumentException('non-nullable canUseBureauFeatures cannot be null'); + } + $this->container['canUseBureauFeatures'] = $canUseBureauFeatures; + + return $this; + } + + /** + * Gets canUseBetaFeatures + * + * @return bool|null + */ + public function getCanUseBetaFeatures(): ?bool + { + return $this->container['canUseBetaFeatures']; + } + + /** + * Sets canUseBetaFeatures + * + * @param bool|null $canUseBetaFeatures canUseBetaFeatures + * + * @return $this + */ + public function setCanUseBetaFeatures(?bool $canUseBetaFeatures): static + { + if (is_null($canUseBetaFeatures)) { + throw new InvalidArgumentException('non-nullable canUseBetaFeatures cannot be null'); + } + $this->container['canUseBetaFeatures'] = $canUseBetaFeatures; + + return $this; + } + + /** + * Gets canUseReportWriter + * + * @return bool|null + */ + public function getCanUseReportWriter(): ?bool + { + return $this->container['canUseReportWriter']; + } + + /** + * Sets canUseReportWriter + * + * @param bool|null $canUseReportWriter Indicates whether the user has permission to use the report writer feature. + * + * @return $this + */ + public function setCanUseReportWriter(?bool $canUseReportWriter): static + { + if (is_null($canUseReportWriter)) { + throw new InvalidArgumentException('non-nullable canUseReportWriter cannot be null'); + } + $this->container['canUseReportWriter'] = $canUseReportWriter; + + return $this; + } + + /** + * Gets isBilledInNetSuite + * + * @return bool|null + */ + public function getIsBilledInNetSuite(): ?bool + { + return $this->container['isBilledInNetSuite']; + } + + /** + * Sets isBilledInNetSuite + * + * @param bool|null $isBilledInNetSuite isBilledInNetSuite + * + * @return $this + */ + public function setIsBilledInNetSuite(?bool $isBilledInNetSuite): static + { + if (is_null($isBilledInNetSuite)) { + throw new InvalidArgumentException('non-nullable isBilledInNetSuite cannot be null'); + } + $this->container['isBilledInNetSuite'] = $isBilledInNetSuite; + + return $this; + } + + /** + * Gets tenant + * + * @return \SynergiTech\Staffology\Model\Tenant|null + */ + public function getTenant(): ?\SynergiTech\Staffology\Model\Tenant + { + return $this->container['tenant']; + } + + /** + * Sets tenant + * + * @param \SynergiTech\Staffology\Model\Tenant|null $tenant tenant + * + * @return $this + */ + public function setTenant(?\SynergiTech\Staffology\Model\Tenant $tenant): static + { + if (is_null($tenant)) { + throw new InvalidArgumentException('non-nullable tenant cannot be null'); + } + $this->container['tenant'] = $tenant; + + return $this; + } + + /** + * Gets requestDdSetup + * + * @return bool|null + */ + public function getRequestDdSetup(): ?bool + { + return $this->container['requestDdSetup']; + } + + /** + * Sets requestDdSetup + * + * @param bool|null $requestDdSetup [readonly] If true then the user is required to set up a direct debit mandate + * + * @return $this + */ + public function setRequestDdSetup(?bool $requestDdSetup): static + { + if (is_null($requestDdSetup)) { + throw new InvalidArgumentException('non-nullable requestDdSetup cannot be null'); + } + $this->container['requestDdSetup'] = $requestDdSetup; + + return $this; + } + + /** + * Gets disabled + * + * @return bool|null + */ + public function getDisabled(): ?bool + { + return $this->container['disabled']; + } + + /** + * Sets disabled + * + * @param bool|null $disabled [readonly] If true then any employers the owner managed will not be able to run new payruns. DisabledReason will give a reason why the account is disabled + * + * @return $this + */ + public function setDisabled(?bool $disabled): static + { + if (is_null($disabled)) { + throw new InvalidArgumentException('non-nullable disabled cannot be null'); + } + $this->container['disabled'] = $disabled; + + return $this; + } + + /** + * Gets canCreateEmployers + * + * @return bool|null + */ + public function getCanCreateEmployers(): ?bool + { + return $this->container['canCreateEmployers']; + } + + /** + * Sets canCreateEmployers + * + * @param bool|null $canCreateEmployers [readonly] If false then the user cannot create new employers. This can be turned on or off by the tenant admin. + * + * @return $this + */ + public function setCanCreateEmployers(?bool $canCreateEmployers): static + { + if (is_null($canCreateEmployers)) { + throw new InvalidArgumentException('non-nullable canCreateEmployers cannot be null'); + } + $this->container['canCreateEmployers'] = $canCreateEmployers; + + return $this; + } + + /** + * Gets disabledReason + * + * @return string|null + */ + public function getDisabledReason(): ?string + { + return $this->container['disabledReason']; + } + + /** + * Sets disabledReason + * + * @param string|null $disabledReason disabledReason + * + * @return $this + */ + public function setDisabledReason(?string $disabledReason): static + { + if (is_null($disabledReason)) { + array_push($this->openAPINullablesSetToNull, 'disabledReason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('disabledReason', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['disabledReason'] = $disabledReason; + + return $this; + } + + /** + * Gets directDebitMandate + * + * @return \SynergiTech\Staffology\Model\DirectDebitMandate|null + */ + public function getDirectDebitMandate(): ?\SynergiTech\Staffology\Model\DirectDebitMandate + { + return $this->container['directDebitMandate']; + } + + /** + * Sets directDebitMandate + * + * @param \SynergiTech\Staffology\Model\DirectDebitMandate|null $directDebitMandate directDebitMandate + * + * @return $this + */ + public function setDirectDebitMandate(?\SynergiTech\Staffology\Model\DirectDebitMandate $directDebitMandate): static + { + if (is_null($directDebitMandate)) { + throw new InvalidArgumentException('non-nullable directDebitMandate cannot be null'); + } + $this->container['directDebitMandate'] = $directDebitMandate; + + return $this; + } + + /** + * Gets displayPrefs + * + * @return \SynergiTech\Staffology\Model\UserDisplayPreferences|null + */ + public function getDisplayPrefs(): ?\SynergiTech\Staffology\Model\UserDisplayPreferences + { + return $this->container['displayPrefs']; + } + + /** + * Sets displayPrefs + * + * @param \SynergiTech\Staffology\Model\UserDisplayPreferences|null $displayPrefs displayPrefs + * + * @return $this + */ + public function setDisplayPrefs(?\SynergiTech\Staffology\Model\UserDisplayPreferences $displayPrefs): static + { + if (is_null($displayPrefs)) { + throw new InvalidArgumentException('non-nullable displayPrefs cannot be null'); + } + $this->container['displayPrefs'] = $displayPrefs; + + return $this; + } + + /** + * Gets showBills + * + * @return bool|null + */ + public function getShowBills(): ?bool + { + return $this->container['showBills']; + } + + /** + * Sets showBills + * + * @param bool|null $showBills [readonly] Whether or not the user can see bills. This will be false if the Tenant manages billing and the user is not an admin for the Tenant + * + * @return $this + */ + public function setShowBills(?bool $showBills): static + { + if (is_null($showBills)) { + array_push($this->openAPINullablesSetToNull, 'showBills'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('showBills', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['showBills'] = $showBills; + + return $this; + } + + /** + * Gets accountingCustomerId + * + * @return string|null + */ + public function getAccountingCustomerId(): ?string + { + return $this->container['accountingCustomerId']; + } + + /** + * Sets accountingCustomerId + * + * @param string|null $accountingCustomerId [readonly] Used internally to manage billing + * + * @return $this + */ + public function setAccountingCustomerId(?string $accountingCustomerId): static + { + if (is_null($accountingCustomerId)) { + array_push($this->openAPINullablesSetToNull, 'accountingCustomerId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accountingCustomerId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accountingCustomerId'] = $accountingCustomerId; + + return $this; + } + + /** + * Gets pricingTableId + * + * @return string|null + */ + public function getPricingTableId(): ?string + { + return $this->container['pricingTableId']; + } + + /** + * Sets pricingTableId + * + * @param string|null $pricingTableId pricingTableId + * + * @return $this + */ + public function setPricingTableId(?string $pricingTableId): static + { + if (is_null($pricingTableId)) { + array_push($this->openAPINullablesSetToNull, 'pricingTableId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pricingTableId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pricingTableId'] = $pricingTableId; + + return $this; + } + + /** + * Gets utmInfo + * + * @return \SynergiTech\Staffology\Model\UtmInfo|null + */ + public function getUtmInfo(): ?\SynergiTech\Staffology\Model\UtmInfo + { + return $this->container['utmInfo']; + } + + /** + * Sets utmInfo + * + * @param \SynergiTech\Staffology\Model\UtmInfo|null $utmInfo utmInfo + * + * @return $this + */ + public function setUtmInfo(?\SynergiTech\Staffology\Model\UtmInfo $utmInfo): static + { + if (is_null($utmInfo)) { + throw new InvalidArgumentException('non-nullable utmInfo cannot be null'); + } + $this->container['utmInfo'] = $utmInfo; + + return $this; + } + + /** + * Gets firstBillableActivityDate + * + * @return \DateTime|null + */ + public function getFirstBillableActivityDate(): ?\DateTime + { + return $this->container['firstBillableActivityDate']; + } + + /** + * Sets firstBillableActivityDate + * + * @param \DateTime|null $firstBillableActivityDate firstBillableActivityDate + * + * @return $this + */ + public function setFirstBillableActivityDate(?\DateTime $firstBillableActivityDate): static + { + if (is_null($firstBillableActivityDate)) { + array_push($this->openAPINullablesSetToNull, 'firstBillableActivityDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstBillableActivityDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstBillableActivityDate'] = $firstBillableActivityDate; + + return $this; + } + + /** + * Gets bureauNotificationEmailAddress + * + * @return string|null + */ + public function getBureauNotificationEmailAddress(): ?string + { + return $this->container['bureauNotificationEmailAddress']; + } + + /** + * Sets bureauNotificationEmailAddress + * + * @param string|null $bureauNotificationEmailAddress If an email address is provided here then Bureau-related notifications will go to this address instead of the EmailAddress + * + * @return $this + */ + public function setBureauNotificationEmailAddress(?string $bureauNotificationEmailAddress): static + { + if (is_null($bureauNotificationEmailAddress)) { + array_push($this->openAPINullablesSetToNull, 'bureauNotificationEmailAddress'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bureauNotificationEmailAddress', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($bureauNotificationEmailAddress) && (mb_strlen($bureauNotificationEmailAddress) > 150)) { + throw new InvalidArgumentException('invalid length for $bureauNotificationEmailAddress when calling User., must be smaller than or equal to 150.'); + } + + $this->container['bureauNotificationEmailAddress'] = $bureauNotificationEmailAddress; + + return $this; + } + + /** + * Gets monthlyMinimum + * + * @return \SynergiTech\Staffology\Model\MonthlyMinimum|null + */ + public function getMonthlyMinimum(): ?\SynergiTech\Staffology\Model\MonthlyMinimum + { + return $this->container['monthlyMinimum']; + } + + /** + * Sets monthlyMinimum + * + * @param \SynergiTech\Staffology\Model\MonthlyMinimum|null $monthlyMinimum monthlyMinimum + * + * @return $this + */ + public function setMonthlyMinimum(?\SynergiTech\Staffology\Model\MonthlyMinimum $monthlyMinimum): static + { + if (is_null($monthlyMinimum)) { + throw new InvalidArgumentException('non-nullable monthlyMinimum cannot be null'); + } + $this->container['monthlyMinimum'] = $monthlyMinimum; + + return $this; + } + + /** + * Gets apiMailingEnabled + * + * @return bool|null + */ + public function getApiMailingEnabled(): ?bool + { + return $this->container['apiMailingEnabled']; + } + + /** + * Sets apiMailingEnabled + * + * @param bool|null $apiMailingEnabled Flag to keep the user up-to-date with any API changes and inform about upcoming breaking changes. + * + * @return $this + */ + public function setApiMailingEnabled(?bool $apiMailingEnabled): static + { + if (is_null($apiMailingEnabled)) { + throw new InvalidArgumentException('non-nullable apiMailingEnabled cannot be null'); + } + $this->container['apiMailingEnabled'] = $apiMailingEnabled; + + return $this; + } + + /** + * Gets loginDisabled + * + * @return bool|null + */ + public function getLoginDisabled(): ?bool + { + return $this->container['loginDisabled']; + } + + /** + * Sets loginDisabled + * + * @param bool|null $loginDisabled [readonly] If true then the user will not have login permissions + * + * @return $this + */ + public function setLoginDisabled(?bool $loginDisabled): static + { + if (is_null($loginDisabled)) { + throw new InvalidArgumentException('non-nullable loginDisabled cannot be null'); + } + $this->container['loginDisabled'] = $loginDisabled; + + return $this; + } + + /** + * Gets isBureauMember + * + * @return bool|null + */ + public function getIsBureauMember(): ?bool + { + return $this->container['isBureauMember']; + } + + /** + * Sets isBureauMember + * + * @param bool|null $isBureauMember Indicates whether the user is a bureau member. + * + * @return $this + */ + public function setIsBureauMember(?bool $isBureauMember): static + { + if (is_null($isBureauMember)) { + throw new InvalidArgumentException('non-nullable isBureauMember cannot be null'); + } + $this->container['isBureauMember'] = $isBureauMember; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserAuthorization.php b/src/Model/UserAuthorization.php new file mode 100644 index 0000000..ced91ac --- /dev/null +++ b/src/Model/UserAuthorization.php @@ -0,0 +1,457 @@ + + */ +class UserAuthorization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserAuthorization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employers' => '\SynergiTech\Staffology\Model\EmployerItem[]', + 'tenants' => '\SynergiTech\Staffology\Model\TenantItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employers' => null, + 'tenants' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employers' => true, + 'tenants' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employers' => 'employers', + 'tenants' => 'tenants' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employers' => 'setEmployers', + 'tenants' => 'setTenants' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employers' => 'getEmployers', + 'tenants' => 'getTenants' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employers', $data ?? [], null); + $this->setIfExists('tenants', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employers + * + * @return \SynergiTech\Staffology\Model\EmployerItem[]|null + */ + public function getEmployers(): ?array + { + return $this->container['employers']; + } + + /** + * Sets employers + * + * @param \SynergiTech\Staffology\Model\EmployerItem[]|null $employers [readonly] A list of any Employers that the user can access + * + * @return $this + */ + public function setEmployers(?array $employers): static + { + if (is_null($employers)) { + array_push($this->openAPINullablesSetToNull, 'employers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employers'] = $employers; + + return $this; + } + + /** + * Gets tenants + * + * @return \SynergiTech\Staffology\Model\TenantItem[]|null + */ + public function getTenants(): ?array + { + return $this->container['tenants']; + } + + /** + * Sets tenants + * + * @param \SynergiTech\Staffology\Model\TenantItem[]|null $tenants [readonly] A list of any Tenants that the user can administrate + * + * @return $this + */ + public function setTenants(?array $tenants): static + { + if (is_null($tenants)) { + array_push($this->openAPINullablesSetToNull, 'tenants'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tenants', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tenants'] = $tenants; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserCategory.php b/src/Model/UserCategory.php new file mode 100644 index 0000000..276aed1 --- /dev/null +++ b/src/Model/UserCategory.php @@ -0,0 +1,57 @@ + + */ +class UserDisplayPreferences implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserDisplayPreferences'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'startPage' => '\SynergiTech\Staffology\Model\UserstartPage', + 'showZeroes' => 'bool', + 'showTaxCodeWhenViewingPayrunEntry' => 'bool', + 'allowJournalResubmit' => 'bool', + 'hideSalaryOnEmployeeIndexPage' => 'bool', + 'enableMultiEmployerImport' => 'bool', + 'enableCovid19Features' => 'bool', + 'hidePayslipCheckboxes' => 'bool', + 'hidePayslipSearchAndSort' => 'bool', + 'showYtdInPayslipView' => 'bool', + 'enableDpsXmlUpload' => 'bool', + 'enableRtiTimestampOverride' => 'bool', + 'enablePayrunWarnings' => 'bool', + 'enableWorkingDaysOverrides' => 'bool', + 'enablePayrunPagination' => 'bool', + 'dontHideFpsEmployeeList' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'startPage' => null, + 'showZeroes' => null, + 'showTaxCodeWhenViewingPayrunEntry' => null, + 'allowJournalResubmit' => null, + 'hideSalaryOnEmployeeIndexPage' => null, + 'enableMultiEmployerImport' => null, + 'enableCovid19Features' => null, + 'hidePayslipCheckboxes' => null, + 'hidePayslipSearchAndSort' => null, + 'showYtdInPayslipView' => null, + 'enableDpsXmlUpload' => null, + 'enableRtiTimestampOverride' => null, + 'enablePayrunWarnings' => null, + 'enableWorkingDaysOverrides' => null, + 'enablePayrunPagination' => null, + 'dontHideFpsEmployeeList' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'startPage' => false, + 'showZeroes' => false, + 'showTaxCodeWhenViewingPayrunEntry' => false, + 'allowJournalResubmit' => false, + 'hideSalaryOnEmployeeIndexPage' => false, + 'enableMultiEmployerImport' => false, + 'enableCovid19Features' => false, + 'hidePayslipCheckboxes' => false, + 'hidePayslipSearchAndSort' => false, + 'showYtdInPayslipView' => false, + 'enableDpsXmlUpload' => false, + 'enableRtiTimestampOverride' => false, + 'enablePayrunWarnings' => false, + 'enableWorkingDaysOverrides' => false, + 'enablePayrunPagination' => false, + 'dontHideFpsEmployeeList' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'startPage' => 'startPage', + 'showZeroes' => 'showZeroes', + 'showTaxCodeWhenViewingPayrunEntry' => 'showTaxCodeWhenViewingPayrunEntry', + 'allowJournalResubmit' => 'allowJournalResubmit', + 'hideSalaryOnEmployeeIndexPage' => 'hideSalaryOnEmployeeIndexPage', + 'enableMultiEmployerImport' => 'enableMultiEmployerImport', + 'enableCovid19Features' => 'enableCovid19Features', + 'hidePayslipCheckboxes' => 'hidePayslipCheckboxes', + 'hidePayslipSearchAndSort' => 'hidePayslipSearchAndSort', + 'showYtdInPayslipView' => 'showYtdInPayslipView', + 'enableDpsXmlUpload' => 'enableDpsXmlUpload', + 'enableRtiTimestampOverride' => 'enableRtiTimestampOverride', + 'enablePayrunWarnings' => 'enablePayrunWarnings', + 'enableWorkingDaysOverrides' => 'enableWorkingDaysOverrides', + 'enablePayrunPagination' => 'enablePayrunPagination', + 'dontHideFpsEmployeeList' => 'dontHideFpsEmployeeList' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'startPage' => 'setStartPage', + 'showZeroes' => 'setShowZeroes', + 'showTaxCodeWhenViewingPayrunEntry' => 'setShowTaxCodeWhenViewingPayrunEntry', + 'allowJournalResubmit' => 'setAllowJournalResubmit', + 'hideSalaryOnEmployeeIndexPage' => 'setHideSalaryOnEmployeeIndexPage', + 'enableMultiEmployerImport' => 'setEnableMultiEmployerImport', + 'enableCovid19Features' => 'setEnableCovid19Features', + 'hidePayslipCheckboxes' => 'setHidePayslipCheckboxes', + 'hidePayslipSearchAndSort' => 'setHidePayslipSearchAndSort', + 'showYtdInPayslipView' => 'setShowYtdInPayslipView', + 'enableDpsXmlUpload' => 'setEnableDpsXmlUpload', + 'enableRtiTimestampOverride' => 'setEnableRtiTimestampOverride', + 'enablePayrunWarnings' => 'setEnablePayrunWarnings', + 'enableWorkingDaysOverrides' => 'setEnableWorkingDaysOverrides', + 'enablePayrunPagination' => 'setEnablePayrunPagination', + 'dontHideFpsEmployeeList' => 'setDontHideFpsEmployeeList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'startPage' => 'getStartPage', + 'showZeroes' => 'getShowZeroes', + 'showTaxCodeWhenViewingPayrunEntry' => 'getShowTaxCodeWhenViewingPayrunEntry', + 'allowJournalResubmit' => 'getAllowJournalResubmit', + 'hideSalaryOnEmployeeIndexPage' => 'getHideSalaryOnEmployeeIndexPage', + 'enableMultiEmployerImport' => 'getEnableMultiEmployerImport', + 'enableCovid19Features' => 'getEnableCovid19Features', + 'hidePayslipCheckboxes' => 'getHidePayslipCheckboxes', + 'hidePayslipSearchAndSort' => 'getHidePayslipSearchAndSort', + 'showYtdInPayslipView' => 'getShowYtdInPayslipView', + 'enableDpsXmlUpload' => 'getEnableDpsXmlUpload', + 'enableRtiTimestampOverride' => 'getEnableRtiTimestampOverride', + 'enablePayrunWarnings' => 'getEnablePayrunWarnings', + 'enableWorkingDaysOverrides' => 'getEnableWorkingDaysOverrides', + 'enablePayrunPagination' => 'getEnablePayrunPagination', + 'dontHideFpsEmployeeList' => 'getDontHideFpsEmployeeList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('startPage', $data ?? [], null); + $this->setIfExists('showZeroes', $data ?? [], null); + $this->setIfExists('showTaxCodeWhenViewingPayrunEntry', $data ?? [], null); + $this->setIfExists('allowJournalResubmit', $data ?? [], null); + $this->setIfExists('hideSalaryOnEmployeeIndexPage', $data ?? [], null); + $this->setIfExists('enableMultiEmployerImport', $data ?? [], null); + $this->setIfExists('enableCovid19Features', $data ?? [], null); + $this->setIfExists('hidePayslipCheckboxes', $data ?? [], null); + $this->setIfExists('hidePayslipSearchAndSort', $data ?? [], null); + $this->setIfExists('showYtdInPayslipView', $data ?? [], null); + $this->setIfExists('enableDpsXmlUpload', $data ?? [], null); + $this->setIfExists('enableRtiTimestampOverride', $data ?? [], null); + $this->setIfExists('enablePayrunWarnings', $data ?? [], null); + $this->setIfExists('enableWorkingDaysOverrides', $data ?? [], null); + $this->setIfExists('enablePayrunPagination', $data ?? [], null); + $this->setIfExists('dontHideFpsEmployeeList', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets startPage + * + * @return \SynergiTech\Staffology\Model\UserstartPage|null + */ + public function getStartPage(): ?\SynergiTech\Staffology\Model\UserstartPage + { + return $this->container['startPage']; + } + + /** + * Sets startPage + * + * @param \SynergiTech\Staffology\Model\UserstartPage|null $startPage startPage + * + * @return $this + */ + public function setStartPage(?\SynergiTech\Staffology\Model\UserstartPage $startPage): static + { + if (is_null($startPage)) { + throw new InvalidArgumentException('non-nullable startPage cannot be null'); + } + $this->container['startPage'] = $startPage; + + return $this; + } + + /** + * Gets showZeroes + * + * @return bool|null + */ + public function getShowZeroes(): ?bool + { + return $this->container['showZeroes']; + } + + /** + * Sets showZeroes + * + * @param bool|null $showZeroes showZeroes + * + * @return $this + */ + public function setShowZeroes(?bool $showZeroes): static + { + if (is_null($showZeroes)) { + throw new InvalidArgumentException('non-nullable showZeroes cannot be null'); + } + $this->container['showZeroes'] = $showZeroes; + + return $this; + } + + /** + * Gets showTaxCodeWhenViewingPayrunEntry + * + * @return bool|null + */ + public function getShowTaxCodeWhenViewingPayrunEntry(): ?bool + { + return $this->container['showTaxCodeWhenViewingPayrunEntry']; + } + + /** + * Sets showTaxCodeWhenViewingPayrunEntry + * + * @param bool|null $showTaxCodeWhenViewingPayrunEntry showTaxCodeWhenViewingPayrunEntry + * + * @return $this + */ + public function setShowTaxCodeWhenViewingPayrunEntry(?bool $showTaxCodeWhenViewingPayrunEntry): static + { + if (is_null($showTaxCodeWhenViewingPayrunEntry)) { + throw new InvalidArgumentException('non-nullable showTaxCodeWhenViewingPayrunEntry cannot be null'); + } + $this->container['showTaxCodeWhenViewingPayrunEntry'] = $showTaxCodeWhenViewingPayrunEntry; + + return $this; + } + + /** + * Gets allowJournalResubmit + * + * @return bool|null + */ + public function getAllowJournalResubmit(): ?bool + { + return $this->container['allowJournalResubmit']; + } + + /** + * Sets allowJournalResubmit + * + * @param bool|null $allowJournalResubmit allowJournalResubmit + * + * @return $this + */ + public function setAllowJournalResubmit(?bool $allowJournalResubmit): static + { + if (is_null($allowJournalResubmit)) { + throw new InvalidArgumentException('non-nullable allowJournalResubmit cannot be null'); + } + $this->container['allowJournalResubmit'] = $allowJournalResubmit; + + return $this; + } + + /** + * Gets hideSalaryOnEmployeeIndexPage + * + * @return bool|null + */ + public function getHideSalaryOnEmployeeIndexPage(): ?bool + { + return $this->container['hideSalaryOnEmployeeIndexPage']; + } + + /** + * Sets hideSalaryOnEmployeeIndexPage + * + * @param bool|null $hideSalaryOnEmployeeIndexPage hideSalaryOnEmployeeIndexPage + * + * @return $this + */ + public function setHideSalaryOnEmployeeIndexPage(?bool $hideSalaryOnEmployeeIndexPage): static + { + if (is_null($hideSalaryOnEmployeeIndexPage)) { + throw new InvalidArgumentException('non-nullable hideSalaryOnEmployeeIndexPage cannot be null'); + } + $this->container['hideSalaryOnEmployeeIndexPage'] = $hideSalaryOnEmployeeIndexPage; + + return $this; + } + + /** + * Gets enableMultiEmployerImport + * + * @return bool|null + */ + public function getEnableMultiEmployerImport(): ?bool + { + return $this->container['enableMultiEmployerImport']; + } + + /** + * Sets enableMultiEmployerImport + * + * @param bool|null $enableMultiEmployerImport enableMultiEmployerImport + * + * @return $this + */ + public function setEnableMultiEmployerImport(?bool $enableMultiEmployerImport): static + { + if (is_null($enableMultiEmployerImport)) { + throw new InvalidArgumentException('non-nullable enableMultiEmployerImport cannot be null'); + } + $this->container['enableMultiEmployerImport'] = $enableMultiEmployerImport; + + return $this; + } + + /** + * Gets enableCovid19Features + * + * @return bool|null + */ + public function getEnableCovid19Features(): ?bool + { + return $this->container['enableCovid19Features']; + } + + /** + * Sets enableCovid19Features + * + * @param bool|null $enableCovid19Features enableCovid19Features + * + * @return $this + */ + public function setEnableCovid19Features(?bool $enableCovid19Features): static + { + if (is_null($enableCovid19Features)) { + throw new InvalidArgumentException('non-nullable enableCovid19Features cannot be null'); + } + $this->container['enableCovid19Features'] = $enableCovid19Features; + + return $this; + } + + /** + * Gets hidePayslipCheckboxes + * + * @return bool|null + */ + public function getHidePayslipCheckboxes(): ?bool + { + return $this->container['hidePayslipCheckboxes']; + } + + /** + * Sets hidePayslipCheckboxes + * + * @param bool|null $hidePayslipCheckboxes hidePayslipCheckboxes + * + * @return $this + */ + public function setHidePayslipCheckboxes(?bool $hidePayslipCheckboxes): static + { + if (is_null($hidePayslipCheckboxes)) { + throw new InvalidArgumentException('non-nullable hidePayslipCheckboxes cannot be null'); + } + $this->container['hidePayslipCheckboxes'] = $hidePayslipCheckboxes; + + return $this; + } + + /** + * Gets hidePayslipSearchAndSort + * + * @return bool|null + */ + public function getHidePayslipSearchAndSort(): ?bool + { + return $this->container['hidePayslipSearchAndSort']; + } + + /** + * Sets hidePayslipSearchAndSort + * + * @param bool|null $hidePayslipSearchAndSort hidePayslipSearchAndSort + * + * @return $this + */ + public function setHidePayslipSearchAndSort(?bool $hidePayslipSearchAndSort): static + { + if (is_null($hidePayslipSearchAndSort)) { + throw new InvalidArgumentException('non-nullable hidePayslipSearchAndSort cannot be null'); + } + $this->container['hidePayslipSearchAndSort'] = $hidePayslipSearchAndSort; + + return $this; + } + + /** + * Gets showYtdInPayslipView + * + * @return bool|null + */ + public function getShowYtdInPayslipView(): ?bool + { + return $this->container['showYtdInPayslipView']; + } + + /** + * Sets showYtdInPayslipView + * + * @param bool|null $showYtdInPayslipView showYtdInPayslipView + * + * @return $this + */ + public function setShowYtdInPayslipView(?bool $showYtdInPayslipView): static + { + if (is_null($showYtdInPayslipView)) { + throw new InvalidArgumentException('non-nullable showYtdInPayslipView cannot be null'); + } + $this->container['showYtdInPayslipView'] = $showYtdInPayslipView; + + return $this; + } + + /** + * Gets enableDpsXmlUpload + * + * @return bool|null + */ + public function getEnableDpsXmlUpload(): ?bool + { + return $this->container['enableDpsXmlUpload']; + } + + /** + * Sets enableDpsXmlUpload + * + * @param bool|null $enableDpsXmlUpload enableDpsXmlUpload + * + * @return $this + */ + public function setEnableDpsXmlUpload(?bool $enableDpsXmlUpload): static + { + if (is_null($enableDpsXmlUpload)) { + throw new InvalidArgumentException('non-nullable enableDpsXmlUpload cannot be null'); + } + $this->container['enableDpsXmlUpload'] = $enableDpsXmlUpload; + + return $this; + } + + /** + * Gets enableRtiTimestampOverride + * + * @return bool|null + */ + public function getEnableRtiTimestampOverride(): ?bool + { + return $this->container['enableRtiTimestampOverride']; + } + + /** + * Sets enableRtiTimestampOverride + * + * @param bool|null $enableRtiTimestampOverride enableRtiTimestampOverride + * + * @return $this + */ + public function setEnableRtiTimestampOverride(?bool $enableRtiTimestampOverride): static + { + if (is_null($enableRtiTimestampOverride)) { + throw new InvalidArgumentException('non-nullable enableRtiTimestampOverride cannot be null'); + } + $this->container['enableRtiTimestampOverride'] = $enableRtiTimestampOverride; + + return $this; + } + + /** + * Gets enablePayrunWarnings + * + * @return bool|null + */ + public function getEnablePayrunWarnings(): ?bool + { + return $this->container['enablePayrunWarnings']; + } + + /** + * Sets enablePayrunWarnings + * + * @param bool|null $enablePayrunWarnings enablePayrunWarnings + * + * @return $this + */ + public function setEnablePayrunWarnings(?bool $enablePayrunWarnings): static + { + if (is_null($enablePayrunWarnings)) { + throw new InvalidArgumentException('non-nullable enablePayrunWarnings cannot be null'); + } + $this->container['enablePayrunWarnings'] = $enablePayrunWarnings; + + return $this; + } + + /** + * Gets enableWorkingDaysOverrides + * + * @return bool|null + */ + public function getEnableWorkingDaysOverrides(): ?bool + { + return $this->container['enableWorkingDaysOverrides']; + } + + /** + * Sets enableWorkingDaysOverrides + * + * @param bool|null $enableWorkingDaysOverrides enableWorkingDaysOverrides + * + * @return $this + */ + public function setEnableWorkingDaysOverrides(?bool $enableWorkingDaysOverrides): static + { + if (is_null($enableWorkingDaysOverrides)) { + throw new InvalidArgumentException('non-nullable enableWorkingDaysOverrides cannot be null'); + } + $this->container['enableWorkingDaysOverrides'] = $enableWorkingDaysOverrides; + + return $this; + } + + /** + * Gets enablePayrunPagination + * + * @return bool|null + */ + public function getEnablePayrunPagination(): ?bool + { + return $this->container['enablePayrunPagination']; + } + + /** + * Sets enablePayrunPagination + * + * @param bool|null $enablePayrunPagination enablePayrunPagination + * + * @return $this + */ + public function setEnablePayrunPagination(?bool $enablePayrunPagination): static + { + if (is_null($enablePayrunPagination)) { + throw new InvalidArgumentException('non-nullable enablePayrunPagination cannot be null'); + } + $this->container['enablePayrunPagination'] = $enablePayrunPagination; + + return $this; + } + + /** + * Gets dontHideFpsEmployeeList + * + * @return bool|null + */ + public function getDontHideFpsEmployeeList(): ?bool + { + return $this->container['dontHideFpsEmployeeList']; + } + + /** + * Sets dontHideFpsEmployeeList + * + * @param bool|null $dontHideFpsEmployeeList dontHideFpsEmployeeList + * + * @return $this + */ + public function setDontHideFpsEmployeeList(?bool $dontHideFpsEmployeeList): static + { + if (is_null($dontHideFpsEmployeeList)) { + throw new InvalidArgumentException('non-nullable dontHideFpsEmployeeList cannot be null'); + } + $this->container['dontHideFpsEmployeeList'] = $dontHideFpsEmployeeList; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UserIndustry.php b/src/Model/UserIndustry.php new file mode 100644 index 0000000..3c6ce6a --- /dev/null +++ b/src/Model/UserIndustry.php @@ -0,0 +1,105 @@ + + */ +class UtmInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UtmInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'source' => 'string', + 'medium' => 'string', + 'term' => 'string', + 'content' => 'string', + 'campaign' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'source' => null, + 'medium' => null, + 'term' => null, + 'content' => null, + 'campaign' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'source' => true, + 'medium' => true, + 'term' => true, + 'content' => true, + 'campaign' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'source' => 'source', + 'medium' => 'medium', + 'term' => 'term', + 'content' => 'content', + 'campaign' => 'campaign' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'source' => 'setSource', + 'medium' => 'setMedium', + 'term' => 'setTerm', + 'content' => 'setContent', + 'campaign' => 'setCampaign' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'source' => 'getSource', + 'medium' => 'getMedium', + 'term' => 'getTerm', + 'content' => 'getContent', + 'campaign' => 'getCampaign' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('medium', $data ?? [], null); + $this->setIfExists('term', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('campaign', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets source + * + * @return string|null + */ + public function getSource(): ?string + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source source + * + * @return $this + */ + public function setSource(?string $source): static + { + if (is_null($source)) { + array_push($this->openAPINullablesSetToNull, 'source'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('source', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets medium + * + * @return string|null + */ + public function getMedium(): ?string + { + return $this->container['medium']; + } + + /** + * Sets medium + * + * @param string|null $medium medium + * + * @return $this + */ + public function setMedium(?string $medium): static + { + if (is_null($medium)) { + array_push($this->openAPINullablesSetToNull, 'medium'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('medium', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['medium'] = $medium; + + return $this; + } + + /** + * Gets term + * + * @return string|null + */ + public function getTerm(): ?string + { + return $this->container['term']; + } + + /** + * Sets term + * + * @param string|null $term term + * + * @return $this + */ + public function setTerm(?string $term): static + { + if (is_null($term)) { + array_push($this->openAPINullablesSetToNull, 'term'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('term', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['term'] = $term; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets campaign + * + * @return string|null + */ + public function getCampaign(): ?string + { + return $this->container['campaign']; + } + + /** + * Sets campaign + * + * @param string|null $campaign campaign + * + * @return $this + */ + public function setCampaign(?string $campaign): static + { + if (is_null($campaign)) { + array_push($this->openAPINullablesSetToNull, 'campaign'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['campaign'] = $campaign; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ValueOverride.php b/src/Model/ValueOverride.php new file mode 100644 index 0000000..f29e313 --- /dev/null +++ b/src/Model/ValueOverride.php @@ -0,0 +1,648 @@ + + */ +class ValueOverride implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ValueOverride'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\PayrollValueType', + 'value' => 'float', + 'originalValue' => 'float', + 'note' => 'string', + 'attachmentOrderId' => 'string', + 'pensionId' => 'string', + 'leaveId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'value' => 'double', + 'originalValue' => 'double', + 'note' => null, + 'attachmentOrderId' => 'uuid', + 'pensionId' => 'uuid', + 'leaveId' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => false, + 'originalValue' => false, + 'note' => true, + 'attachmentOrderId' => true, + 'pensionId' => true, + 'leaveId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'value' => 'value', + 'originalValue' => 'originalValue', + 'note' => 'note', + 'attachmentOrderId' => 'attachmentOrderId', + 'pensionId' => 'pensionId', + 'leaveId' => 'leaveId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'value' => 'setValue', + 'originalValue' => 'setOriginalValue', + 'note' => 'setNote', + 'attachmentOrderId' => 'setAttachmentOrderId', + 'pensionId' => 'setPensionId', + 'leaveId' => 'setLeaveId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'value' => 'getValue', + 'originalValue' => 'getOriginalValue', + 'note' => 'getNote', + 'attachmentOrderId' => 'getAttachmentOrderId', + 'pensionId' => 'getPensionId', + 'leaveId' => 'getLeaveId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('originalValue', $data ?? [], null); + $this->setIfExists('note', $data ?? [], null); + $this->setIfExists('attachmentOrderId', $data ?? [], null); + $this->setIfExists('pensionId', $data ?? [], null); + $this->setIfExists('leaveId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 150)) { + $invalidProperties[] = "invalid value for 'note', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PayrollValueType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PayrollValueType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PayrollValueType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PayrollValueType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value to use in place of the original value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets originalValue + * + * @return float|null + */ + public function getOriginalValue(): ?float + { + return $this->container['originalValue']; + } + + /** + * Sets originalValue + * + * @param float|null $originalValue [readonly] The original value + * + * @return $this + */ + public function setOriginalValue(?float $originalValue): static + { + if (is_null($originalValue)) { + throw new InvalidArgumentException('non-nullable originalValue cannot be null'); + } + $this->container['originalValue'] = $originalValue; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote(): ?string + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The reason given for the override + * + * @return $this + */ + public function setNote(?string $note): static + { + if (is_null($note)) { + array_push($this->openAPINullablesSetToNull, 'note'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('note', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($note) && (mb_strlen($note) > 150)) { + throw new InvalidArgumentException('invalid length for $note when calling ValueOverride., must be smaller than or equal to 150.'); + } + + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets attachmentOrderId + * + * @return string|null + */ + public function getAttachmentOrderId(): ?string + { + return $this->container['attachmentOrderId']; + } + + /** + * Sets attachmentOrderId + * + * @param string|null $attachmentOrderId The Id of the AttachmentOrder. Only relevant if the Type is set to AttachmentOrderDeductions + * + * @return $this + */ + public function setAttachmentOrderId(?string $attachmentOrderId): static + { + if (is_null($attachmentOrderId)) { + array_push($this->openAPINullablesSetToNull, 'attachmentOrderId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachmentOrderId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['attachmentOrderId'] = $attachmentOrderId; + + return $this; + } + + /** + * Gets pensionId + * + * @return string|null + */ + public function getPensionId(): ?string + { + return $this->container['pensionId']; + } + + /** + * Sets pensionId + * + * @param string|null $pensionId The Id of the associated Pension. Only included if the Code is PENSION, PENSIONSS or PENSIONRAS + * + * @return $this + */ + public function setPensionId(?string $pensionId): static + { + if (is_null($pensionId)) { + array_push($this->openAPINullablesSetToNull, 'pensionId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pensionId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pensionId'] = $pensionId; + + return $this; + } + + /** + * Gets leaveId + * + * @return string|null + */ + public function getLeaveId(): ?string + { + return $this->container['leaveId']; + } + + /** + * Sets leaveId + * + * @param string|null $leaveId The Id of the associated Leave. + * + * @return $this + */ + public function setLeaveId(?string $leaveId): static + { + if (is_null($leaveId)) { + array_push($this->openAPINullablesSetToNull, 'leaveId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leaveId', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leaveId'] = $leaveId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/VarianceReport.php b/src/Model/VarianceReport.php new file mode 100644 index 0000000..95ce65b --- /dev/null +++ b/src/Model/VarianceReport.php @@ -0,0 +1,844 @@ + + */ +class VarianceReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'VarianceReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'showDifferenceAsPercentage' => 'bool', + 'minimumChangePercentage' => 'float', + 'primary' => '\SynergiTech\Staffology\Model\GrossToNetReport', + 'secondary' => '\SynergiTech\Staffology\Model\GrossToNetReport', + 'joiners' => '\SynergiTech\Staffology\Model\GrossToNetReportLine[]', + 'leavers' => '\SynergiTech\Staffology\Model\GrossToNetReportLine[]', + 'hasDepartments' => 'bool', + 'commonLines' => '\SynergiTech\Staffology\Model\GrossToNetReportLine[]', + 'hasVariances' => 'bool', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'showDifferenceAsPercentage' => null, + 'minimumChangePercentage' => 'double', + 'primary' => null, + 'secondary' => null, + 'joiners' => null, + 'leavers' => null, + 'hasDepartments' => null, + 'commonLines' => null, + 'hasVariances' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'showDifferenceAsPercentage' => false, + 'minimumChangePercentage' => false, + 'primary' => false, + 'secondary' => false, + 'joiners' => true, + 'leavers' => true, + 'hasDepartments' => false, + 'commonLines' => true, + 'hasVariances' => false, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'showDifferenceAsPercentage' => 'showDifferenceAsPercentage', + 'minimumChangePercentage' => 'minimumChangePercentage', + 'primary' => 'primary', + 'secondary' => 'secondary', + 'joiners' => 'joiners', + 'leavers' => 'leavers', + 'hasDepartments' => 'hasDepartments', + 'commonLines' => 'commonLines', + 'hasVariances' => 'hasVariances', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'showDifferenceAsPercentage' => 'setShowDifferenceAsPercentage', + 'minimumChangePercentage' => 'setMinimumChangePercentage', + 'primary' => 'setPrimary', + 'secondary' => 'setSecondary', + 'joiners' => 'setJoiners', + 'leavers' => 'setLeavers', + 'hasDepartments' => 'setHasDepartments', + 'commonLines' => 'setCommonLines', + 'hasVariances' => 'setHasVariances', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'showDifferenceAsPercentage' => 'getShowDifferenceAsPercentage', + 'minimumChangePercentage' => 'getMinimumChangePercentage', + 'primary' => 'getPrimary', + 'secondary' => 'getSecondary', + 'joiners' => 'getJoiners', + 'leavers' => 'getLeavers', + 'hasDepartments' => 'getHasDepartments', + 'commonLines' => 'getCommonLines', + 'hasVariances' => 'getHasVariances', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('showDifferenceAsPercentage', $data ?? [], null); + $this->setIfExists('minimumChangePercentage', $data ?? [], null); + $this->setIfExists('primary', $data ?? [], null); + $this->setIfExists('secondary', $data ?? [], null); + $this->setIfExists('joiners', $data ?? [], null); + $this->setIfExists('leavers', $data ?? [], null); + $this->setIfExists('hasDepartments', $data ?? [], null); + $this->setIfExists('commonLines', $data ?? [], null); + $this->setIfExists('hasVariances', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets showDifferenceAsPercentage + * + * @return bool|null + */ + public function getShowDifferenceAsPercentage(): ?bool + { + return $this->container['showDifferenceAsPercentage']; + } + + /** + * Sets showDifferenceAsPercentage + * + * @param bool|null $showDifferenceAsPercentage showDifferenceAsPercentage + * + * @return $this + */ + public function setShowDifferenceAsPercentage(?bool $showDifferenceAsPercentage): static + { + if (is_null($showDifferenceAsPercentage)) { + throw new InvalidArgumentException('non-nullable showDifferenceAsPercentage cannot be null'); + } + $this->container['showDifferenceAsPercentage'] = $showDifferenceAsPercentage; + + return $this; + } + + /** + * Gets minimumChangePercentage + * + * @return float|null + */ + public function getMinimumChangePercentage(): ?float + { + return $this->container['minimumChangePercentage']; + } + + /** + * Sets minimumChangePercentage + * + * @param float|null $minimumChangePercentage minimumChangePercentage + * + * @return $this + */ + public function setMinimumChangePercentage(?float $minimumChangePercentage): static + { + if (is_null($minimumChangePercentage)) { + throw new InvalidArgumentException('non-nullable minimumChangePercentage cannot be null'); + } + $this->container['minimumChangePercentage'] = $minimumChangePercentage; + + return $this; + } + + /** + * Gets primary + * + * @return \SynergiTech\Staffology\Model\GrossToNetReport|null + */ + public function getPrimary(): ?\SynergiTech\Staffology\Model\GrossToNetReport + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param \SynergiTech\Staffology\Model\GrossToNetReport|null $primary primary + * + * @return $this + */ + public function setPrimary(?\SynergiTech\Staffology\Model\GrossToNetReport $primary): static + { + if (is_null($primary)) { + throw new InvalidArgumentException('non-nullable primary cannot be null'); + } + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets secondary + * + * @return \SynergiTech\Staffology\Model\GrossToNetReport|null + */ + public function getSecondary(): ?\SynergiTech\Staffology\Model\GrossToNetReport + { + return $this->container['secondary']; + } + + /** + * Sets secondary + * + * @param \SynergiTech\Staffology\Model\GrossToNetReport|null $secondary secondary + * + * @return $this + */ + public function setSecondary(?\SynergiTech\Staffology\Model\GrossToNetReport $secondary): static + { + if (is_null($secondary)) { + throw new InvalidArgumentException('non-nullable secondary cannot be null'); + } + $this->container['secondary'] = $secondary; + + return $this; + } + + /** + * Gets joiners + * + * @return \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null + */ + public function getJoiners(): ?array + { + return $this->container['joiners']; + } + + /** + * Sets joiners + * + * @param \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null $joiners joiners + * + * @return $this + */ + public function setJoiners(?array $joiners): static + { + if (is_null($joiners)) { + array_push($this->openAPINullablesSetToNull, 'joiners'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('joiners', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['joiners'] = $joiners; + + return $this; + } + + /** + * Gets leavers + * + * @return \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null + */ + public function getLeavers(): ?array + { + return $this->container['leavers']; + } + + /** + * Sets leavers + * + * @param \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null $leavers leavers + * + * @return $this + */ + public function setLeavers(?array $leavers): static + { + if (is_null($leavers)) { + array_push($this->openAPINullablesSetToNull, 'leavers'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('leavers', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['leavers'] = $leavers; + + return $this; + } + + /** + * Gets hasDepartments + * + * @return bool|null + */ + public function getHasDepartments(): ?bool + { + return $this->container['hasDepartments']; + } + + /** + * Sets hasDepartments + * + * @param bool|null $hasDepartments hasDepartments + * + * @return $this + */ + public function setHasDepartments(?bool $hasDepartments): static + { + if (is_null($hasDepartments)) { + throw new InvalidArgumentException('non-nullable hasDepartments cannot be null'); + } + $this->container['hasDepartments'] = $hasDepartments; + + return $this; + } + + /** + * Gets commonLines + * + * @return \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null + */ + public function getCommonLines(): ?array + { + return $this->container['commonLines']; + } + + /** + * Sets commonLines + * + * @param \SynergiTech\Staffology\Model\GrossToNetReportLine[]|null $commonLines commonLines + * + * @return $this + */ + public function setCommonLines(?array $commonLines): static + { + if (is_null($commonLines)) { + array_push($this->openAPINullablesSetToNull, 'commonLines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commonLines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['commonLines'] = $commonLines; + + return $this; + } + + /** + * Gets hasVariances + * + * @return bool|null + */ + public function getHasVariances(): ?bool + { + return $this->container['hasVariances']; + } + + /** + * Sets hasVariances + * + * @param bool|null $hasVariances hasVariances + * + * @return $this + */ + public function setHasVariances(?bool $hasVariances): static + { + if (is_null($hasVariances)) { + throw new InvalidArgumentException('non-nullable hasVariances cannot be null'); + } + $this->container['hasVariances'] = $hasVariances; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/VarianceReportReportResponse.php b/src/Model/VarianceReportReportResponse.php new file mode 100644 index 0000000..5f97da1 --- /dev/null +++ b/src/Model/VarianceReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class VarianceReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'VarianceReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\VarianceReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\VarianceReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\VarianceReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\VarianceReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\VarianceReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/VeteranDetails.php b/src/Model/VeteranDetails.php new file mode 100644 index 0000000..a7ef0e6 --- /dev/null +++ b/src/Model/VeteranDetails.php @@ -0,0 +1,450 @@ + + */ +class VeteranDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'VeteranDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'isVeteran' => 'bool', + 'firstCivilianEmploymentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'isVeteran' => null, + 'firstCivilianEmploymentDate' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'isVeteran' => false, + 'firstCivilianEmploymentDate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'isVeteran' => 'isVeteran', + 'firstCivilianEmploymentDate' => 'firstCivilianEmploymentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'isVeteran' => 'setIsVeteran', + 'firstCivilianEmploymentDate' => 'setFirstCivilianEmploymentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'isVeteran' => 'getIsVeteran', + 'firstCivilianEmploymentDate' => 'getFirstCivilianEmploymentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('isVeteran', $data ?? [], null); + $this->setIfExists('firstCivilianEmploymentDate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets isVeteran + * + * @return bool|null + */ + public function getIsVeteran(): ?bool + { + return $this->container['isVeteran']; + } + + /** + * Sets isVeteran + * + * @param bool|null $isVeteran Set to true if the employee is a veteran + * + * @return $this + */ + public function setIsVeteran(?bool $isVeteran): static + { + if (is_null($isVeteran)) { + throw new InvalidArgumentException('non-nullable isVeteran cannot be null'); + } + $this->container['isVeteran'] = $isVeteran; + + return $this; + } + + /** + * Gets firstCivilianEmploymentDate + * + * @return \DateTime|null + */ + public function getFirstCivilianEmploymentDate(): ?\DateTime + { + return $this->container['firstCivilianEmploymentDate']; + } + + /** + * Sets firstCivilianEmploymentDate + * + * @param \DateTime|null $firstCivilianEmploymentDate Date of Veteran's first civilian employment + * + * @return $this + */ + public function setFirstCivilianEmploymentDate(?\DateTime $firstCivilianEmploymentDate): static + { + if (is_null($firstCivilianEmploymentDate)) { + array_push($this->openAPINullablesSetToNull, 'firstCivilianEmploymentDate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('firstCivilianEmploymentDate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['firstCivilianEmploymentDate'] = $firstCivilianEmploymentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WarningsReport.php b/src/Model/WarningsReport.php new file mode 100644 index 0000000..b927fd4 --- /dev/null +++ b/src/Model/WarningsReport.php @@ -0,0 +1,449 @@ + + */ +class WarningsReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WarningsReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'lines' => '\SynergiTech\Staffology\Model\WarningsReportLine[]', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'lines' => null, + 'taxYear' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'lines' => true, + 'taxYear' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'lines' => 'lines', + 'taxYear' => 'taxYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'lines' => 'setLines', + 'taxYear' => 'setTaxYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'lines' => 'getLines', + 'taxYear' => 'getTaxYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\WarningsReportLine[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\WarningsReportLine[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WarningsReportLine.php b/src/Model/WarningsReportLine.php new file mode 100644 index 0000000..9e4d2b5 --- /dev/null +++ b/src/Model/WarningsReportLine.php @@ -0,0 +1,531 @@ + + */ +class WarningsReportLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WarningsReportLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrollCode' => 'string', + 'employeeName' => 'string', + 'warningType' => '\SynergiTech\Staffology\Model\PayRunEntryWarningType', + 'warningMessage' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrollCode' => null, + 'employeeName' => null, + 'warningType' => null, + 'warningMessage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrollCode' => true, + 'employeeName' => true, + 'warningType' => false, + 'warningMessage' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrollCode' => 'payrollCode', + 'employeeName' => 'employeeName', + 'warningType' => 'warningType', + 'warningMessage' => 'warningMessage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrollCode' => 'setPayrollCode', + 'employeeName' => 'setEmployeeName', + 'warningType' => 'setWarningType', + 'warningMessage' => 'setWarningMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrollCode' => 'getPayrollCode', + 'employeeName' => 'getEmployeeName', + 'warningType' => 'getWarningType', + 'warningMessage' => 'getWarningMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrollCode', $data ?? [], null); + $this->setIfExists('employeeName', $data ?? [], null); + $this->setIfExists('warningType', $data ?? [], null); + $this->setIfExists('warningMessage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrollCode + * + * @return string|null + */ + public function getPayrollCode(): ?string + { + return $this->container['payrollCode']; + } + + /** + * Sets payrollCode + * + * @param string|null $payrollCode payrollCode + * + * @return $this + */ + public function setPayrollCode(?string $payrollCode): static + { + if (is_null($payrollCode)) { + array_push($this->openAPINullablesSetToNull, 'payrollCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payrollCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payrollCode'] = $payrollCode; + + return $this; + } + + /** + * Gets employeeName + * + * @return string|null + */ + public function getEmployeeName(): ?string + { + return $this->container['employeeName']; + } + + /** + * Sets employeeName + * + * @param string|null $employeeName employeeName + * + * @return $this + */ + public function setEmployeeName(?string $employeeName): static + { + if (is_null($employeeName)) { + array_push($this->openAPINullablesSetToNull, 'employeeName'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employeeName', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employeeName'] = $employeeName; + + return $this; + } + + /** + * Gets warningType + * + * @return \SynergiTech\Staffology\Model\PayRunEntryWarningType|null + */ + public function getWarningType(): ?\SynergiTech\Staffology\Model\PayRunEntryWarningType + { + return $this->container['warningType']; + } + + /** + * Sets warningType + * + * @param \SynergiTech\Staffology\Model\PayRunEntryWarningType|null $warningType warningType + * + * @return $this + */ + public function setWarningType(?\SynergiTech\Staffology\Model\PayRunEntryWarningType $warningType): static + { + if (is_null($warningType)) { + throw new InvalidArgumentException('non-nullable warningType cannot be null'); + } + $this->container['warningType'] = $warningType; + + return $this; + } + + /** + * Gets warningMessage + * + * @return string|null + */ + public function getWarningMessage(): ?string + { + return $this->container['warningMessage']; + } + + /** + * Sets warningMessage + * + * @param string|null $warningMessage warningMessage + * + * @return $this + */ + public function setWarningMessage(?string $warningMessage): static + { + if (is_null($warningMessage)) { + array_push($this->openAPINullablesSetToNull, 'warningMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('warningMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['warningMessage'] = $warningMessage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WarningsReportReportResponse.php b/src/Model/WarningsReportReportResponse.php new file mode 100644 index 0000000..b2377c7 --- /dev/null +++ b/src/Model/WarningsReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class WarningsReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WarningsReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\WarningsReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\WarningsReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\WarningsReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\WarningsReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\WarningsReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Webhook.php b/src/Model/Webhook.php new file mode 100644 index 0000000..6038a16 --- /dev/null +++ b/src/Model/Webhook.php @@ -0,0 +1,596 @@ + + */ +class Webhook implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Webhook'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'webhookEvent' => '\SynergiTech\Staffology\Model\WebhookEvent', + 'url' => 'string', + 'active' => 'bool', + 'eventCount' => 'int', + 'lastPayload' => '\SynergiTech\Staffology\Model\WebhookPayload', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'webhookEvent' => null, + 'url' => 'uri', + 'active' => null, + 'eventCount' => 'int32', + 'lastPayload' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'webhookEvent' => false, + 'url' => false, + 'active' => false, + 'eventCount' => false, + 'lastPayload' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'webhookEvent' => 'webhookEvent', + 'url' => 'url', + 'active' => 'active', + 'eventCount' => 'eventCount', + 'lastPayload' => 'lastPayload', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'webhookEvent' => 'setWebhookEvent', + 'url' => 'setUrl', + 'active' => 'setActive', + 'eventCount' => 'setEventCount', + 'lastPayload' => 'setLastPayload', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'webhookEvent' => 'getWebhookEvent', + 'url' => 'getUrl', + 'active' => 'getActive', + 'eventCount' => 'getEventCount', + 'lastPayload' => 'getLastPayload', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('webhookEvent', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('eventCount', $data ?? [], null); + $this->setIfExists('lastPayload', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ((mb_strlen($this->container['url']) > 300)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 300."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets webhookEvent + * + * @return \SynergiTech\Staffology\Model\WebhookEvent|null + */ + public function getWebhookEvent(): ?\SynergiTech\Staffology\Model\WebhookEvent + { + return $this->container['webhookEvent']; + } + + /** + * Sets webhookEvent + * + * @param \SynergiTech\Staffology\Model\WebhookEvent|null $webhookEvent webhookEvent + * + * @return $this + */ + public function setWebhookEvent(?\SynergiTech\Staffology\Model\WebhookEvent $webhookEvent): static + { + if (is_null($webhookEvent)) { + throw new InvalidArgumentException('non-nullable webhookEvent cannot be null'); + } + $this->container['webhookEvent'] = $webhookEvent; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl(): string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url The Url to which the payload should be sent + * + * @return $this + */ + public function setUrl(string $url): static + { + if (is_null($url)) { + throw new InvalidArgumentException('non-nullable url cannot be null'); + } + if ((mb_strlen($url) > 300)) { + throw new InvalidArgumentException('invalid length for $url when calling Webhook., must be smaller than or equal to 300.'); + } + if ((mb_strlen($url) < 1)) { + throw new InvalidArgumentException('invalid length for $url when calling Webhook., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive(): ?bool + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active If set to false then this Webhook will not be triggered + * + * @return $this + */ + public function setActive(?bool $active): static + { + if (is_null($active)) { + throw new InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets eventCount + * + * @return int|null + */ + public function getEventCount(): ?int + { + return $this->container['eventCount']; + } + + /** + * Sets eventCount + * + * @param int|null $eventCount The number of times this webhook has been triggered + * + * @return $this + */ + public function setEventCount(?int $eventCount): static + { + if (is_null($eventCount)) { + throw new InvalidArgumentException('non-nullable eventCount cannot be null'); + } + $this->container['eventCount'] = $eventCount; + + return $this; + } + + /** + * Gets lastPayload + * + * @return \SynergiTech\Staffology\Model\WebhookPayload|null + */ + public function getLastPayload(): ?\SynergiTech\Staffology\Model\WebhookPayload + { + return $this->container['lastPayload']; + } + + /** + * Sets lastPayload + * + * @param \SynergiTech\Staffology\Model\WebhookPayload|null $lastPayload lastPayload + * + * @return $this + */ + public function setLastPayload(?\SynergiTech\Staffology\Model\WebhookPayload $lastPayload): static + { + if (is_null($lastPayload)) { + throw new InvalidArgumentException('non-nullable lastPayload cannot be null'); + } + $this->container['lastPayload'] = $lastPayload; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WebhookEvent.php b/src/Model/WebhookEvent.php new file mode 100644 index 0000000..c62fb86 --- /dev/null +++ b/src/Model/WebhookEvent.php @@ -0,0 +1,59 @@ + + */ +class WebhookPayload implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WebhookPayload'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'url' => 'string', + 'attempts' => 'int', + 'statusCode' => 'int', + 'taskStatus' => '\SynergiTech\Staffology\Model\BackgroundTaskStatus', + 'statusMessage' => 'string', + 'created' => '\DateTime', + 'payload' => 'mixed', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'url' => 'uri', + 'attempts' => 'int32', + 'statusCode' => 'int32', + 'taskStatus' => null, + 'statusMessage' => null, + 'created' => 'date', + 'payload' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => true, + 'url' => false, + 'attempts' => false, + 'statusCode' => false, + 'taskStatus' => false, + 'statusMessage' => true, + 'created' => false, + 'payload' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'url' => 'url', + 'attempts' => 'attempts', + 'statusCode' => 'statusCode', + 'taskStatus' => 'taskStatus', + 'statusMessage' => 'statusMessage', + 'created' => 'created', + 'payload' => 'payload', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'url' => 'setUrl', + 'attempts' => 'setAttempts', + 'statusCode' => 'setStatusCode', + 'taskStatus' => 'setTaskStatus', + 'statusMessage' => 'setStatusMessage', + 'created' => 'setCreated', + 'payload' => 'setPayload', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'url' => 'getUrl', + 'attempts' => 'getAttempts', + 'statusCode' => 'getStatusCode', + 'taskStatus' => 'getTaskStatus', + 'statusMessage' => 'getStatusMessage', + 'created' => 'getCreated', + 'payload' => 'getPayload', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('attempts', $data ?? [], null); + $this->setIfExists('statusCode', $data ?? [], null); + $this->setIfExists('taskStatus', $data ?? [], null); + $this->setIfExists('statusMessage', $data ?? [], null); + $this->setIfExists('created', $data ?? [], null); + $this->setIfExists('payload', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 150)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 150."; + } + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ((mb_strlen($this->container['url']) > 300)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 300."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['statusMessage']) && (mb_strlen($this->container['statusMessage']) > 150)) { + $invalidProperties[] = "invalid value for 'statusMessage', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name [readonly] A descriptive name for this payload + * + * @return $this + */ + public function setName(?string $name): static + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($name) && (mb_strlen($name) > 150)) { + throw new InvalidArgumentException('invalid length for $name when calling WebhookPayload., must be smaller than or equal to 150.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl(): string + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url [readonly] The Url that payload will be sent to + * + * @return $this + */ + public function setUrl(string $url): static + { + if (is_null($url)) { + throw new InvalidArgumentException('non-nullable url cannot be null'); + } + if ((mb_strlen($url) > 300)) { + throw new InvalidArgumentException('invalid length for $url when calling WebhookPayload., must be smaller than or equal to 300.'); + } + if ((mb_strlen($url) < 1)) { + throw new InvalidArgumentException('invalid length for $url when calling WebhookPayload., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets attempts + * + * @return int|null + */ + public function getAttempts(): ?int + { + return $this->container['attempts']; + } + + /** + * Sets attempts + * + * @param int|null $attempts [readonly] The number of attempts that have been made to deliver this payload + * + * @return $this + */ + public function setAttempts(?int $attempts): static + { + if (is_null($attempts)) { + throw new InvalidArgumentException('non-nullable attempts cannot be null'); + } + $this->container['attempts'] = $attempts; + + return $this; + } + + /** + * Gets statusCode + * + * @return int|null + */ + public function getStatusCode(): ?int + { + return $this->container['statusCode']; + } + + /** + * Sets statusCode + * + * @param int|null $statusCode [readonly] The status code received from the Url + * + * @return $this + */ + public function setStatusCode(?int $statusCode): static + { + if (is_null($statusCode)) { + throw new InvalidArgumentException('non-nullable statusCode cannot be null'); + } + $this->container['statusCode'] = $statusCode; + + return $this; + } + + /** + * Gets taskStatus + * + * @return \SynergiTech\Staffology\Model\BackgroundTaskStatus|null + */ + public function getTaskStatus(): ?\SynergiTech\Staffology\Model\BackgroundTaskStatus + { + return $this->container['taskStatus']; + } + + /** + * Sets taskStatus + * + * @param \SynergiTech\Staffology\Model\BackgroundTaskStatus|null $taskStatus taskStatus + * + * @return $this + */ + public function setTaskStatus(?\SynergiTech\Staffology\Model\BackgroundTaskStatus $taskStatus): static + { + if (is_null($taskStatus)) { + throw new InvalidArgumentException('non-nullable taskStatus cannot be null'); + } + $this->container['taskStatus'] = $taskStatus; + + return $this; + } + + /** + * Gets statusMessage + * + * @return string|null + */ + public function getStatusMessage(): ?string + { + return $this->container['statusMessage']; + } + + /** + * Sets statusMessage + * + * @param string|null $statusMessage [readonly] A message to accompany the status + * + * @return $this + */ + public function setStatusMessage(?string $statusMessage): static + { + if (is_null($statusMessage)) { + array_push($this->openAPINullablesSetToNull, 'statusMessage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statusMessage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($statusMessage) && (mb_strlen($statusMessage) > 150)) { + throw new InvalidArgumentException('invalid length for $statusMessage when calling WebhookPayload., must be smaller than or equal to 150.'); + } + + $this->container['statusMessage'] = $statusMessage; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime|null + */ + public function getCreated(): ?\DateTime + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime|null $created [readonly] The date and time this payload was created + * + * @return $this + */ + public function setCreated(?\DateTime $created): static + { + if (is_null($created)) { + throw new InvalidArgumentException('non-nullable created cannot be null'); + } + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets payload + * + * @return mixed|null + */ + public function getPayload(): mixed + { + return $this->container['payload']; + } + + /** + * Sets payload + * + * @param mixed|null $payload [readonly] the JSON payload that will be sent to the URl + * + * @return $this + */ + public function setPayload(mixed $payload): static + { + if (is_null($payload)) { + array_push($this->openAPINullablesSetToNull, 'payload'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payload', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['payload'] = $payload; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WorkerGroup.php b/src/Model/WorkerGroup.php new file mode 100644 index 0000000..d02bbe1 --- /dev/null +++ b/src/Model/WorkerGroup.php @@ -0,0 +1,1532 @@ + + */ +class WorkerGroup implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WorkerGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'contributionLevelType' => '\SynergiTech\Staffology\Model\PensionContributionLevelType', + 'employeeContribution' => 'float', + 'employeeContributionIsPercentage' => 'bool', + 'employerContribution' => 'float', + 'employerContributionIsPercentage' => 'bool', + 'employerContributionTopUpPercentage' => 'float', + 'employerContributionIncludesNiSaving' => 'bool', + 'employerContributionNiSavingPercentage' => 'float', + 'isAvc' => 'bool', + 'additionalVoluntaryContribution' => 'float', + 'avcIsPercentage' => 'bool', + 'employerContributionNiSaving' => 'float', + 'customThreshold' => 'bool', + 'lowerLimit' => 'float', + 'upperLimit' => 'float', + 'papdisGroup' => 'string', + 'papdisSubGroup' => 'string', + 'localAuthorityNumber' => 'string', + 'schoolEmployerType' => 'string', + 'matIdentifier' => 'string', + 'matUniqueNumber' => 'string', + 'employerReference' => 'string', + 'lgpsFund' => '\SynergiTech\Staffology\Model\LgpsFund', + 'workerGroupId' => 'string', + 'assumedPensionablePay' => '\SynergiTech\Staffology\Model\AssumedPensionablePay', + 'pensionablePayDefinition' => '\SynergiTech\Staffology\Model\PensionablePayDefinition', + 'payslipDescription' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'contributionLevelType' => null, + 'employeeContribution' => 'double', + 'employeeContributionIsPercentage' => null, + 'employerContribution' => 'double', + 'employerContributionIsPercentage' => null, + 'employerContributionTopUpPercentage' => 'double', + 'employerContributionIncludesNiSaving' => null, + 'employerContributionNiSavingPercentage' => 'double', + 'isAvc' => null, + 'additionalVoluntaryContribution' => 'double', + 'avcIsPercentage' => null, + 'employerContributionNiSaving' => 'double', + 'customThreshold' => null, + 'lowerLimit' => 'double', + 'upperLimit' => 'double', + 'papdisGroup' => null, + 'papdisSubGroup' => null, + 'localAuthorityNumber' => null, + 'schoolEmployerType' => null, + 'matIdentifier' => null, + 'matUniqueNumber' => null, + 'employerReference' => null, + 'lgpsFund' => null, + 'workerGroupId' => 'uuid', + 'assumedPensionablePay' => null, + 'pensionablePayDefinition' => null, + 'payslipDescription' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'name' => false, + 'contributionLevelType' => false, + 'employeeContribution' => false, + 'employeeContributionIsPercentage' => false, + 'employerContribution' => false, + 'employerContributionIsPercentage' => false, + 'employerContributionTopUpPercentage' => false, + 'employerContributionIncludesNiSaving' => false, + 'employerContributionNiSavingPercentage' => false, + 'isAvc' => false, + 'additionalVoluntaryContribution' => true, + 'avcIsPercentage' => true, + 'employerContributionNiSaving' => false, + 'customThreshold' => false, + 'lowerLimit' => false, + 'upperLimit' => false, + 'papdisGroup' => true, + 'papdisSubGroup' => true, + 'localAuthorityNumber' => true, + 'schoolEmployerType' => true, + 'matIdentifier' => true, + 'matUniqueNumber' => true, + 'employerReference' => true, + 'lgpsFund' => false, + 'workerGroupId' => false, + 'assumedPensionablePay' => false, + 'pensionablePayDefinition' => false, + 'payslipDescription' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'contributionLevelType' => 'contributionLevelType', + 'employeeContribution' => 'employeeContribution', + 'employeeContributionIsPercentage' => 'employeeContributionIsPercentage', + 'employerContribution' => 'employerContribution', + 'employerContributionIsPercentage' => 'employerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'employerContributionTopUpPercentage', + 'employerContributionIncludesNiSaving' => 'employerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'employerContributionNiSavingPercentage', + 'isAvc' => 'isAvc', + 'additionalVoluntaryContribution' => 'additionalVoluntaryContribution', + 'avcIsPercentage' => 'avcIsPercentage', + 'employerContributionNiSaving' => 'employerContributionNiSaving', + 'customThreshold' => 'customThreshold', + 'lowerLimit' => 'lowerLimit', + 'upperLimit' => 'upperLimit', + 'papdisGroup' => 'papdisGroup', + 'papdisSubGroup' => 'papdisSubGroup', + 'localAuthorityNumber' => 'localAuthorityNumber', + 'schoolEmployerType' => 'schoolEmployerType', + 'matIdentifier' => 'matIdentifier', + 'matUniqueNumber' => 'matUniqueNumber', + 'employerReference' => 'employerReference', + 'lgpsFund' => 'lgpsFund', + 'workerGroupId' => 'workerGroupId', + 'assumedPensionablePay' => 'assumedPensionablePay', + 'pensionablePayDefinition' => 'pensionablePayDefinition', + 'payslipDescription' => 'payslipDescription', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'name' => 'setName', + 'contributionLevelType' => 'setContributionLevelType', + 'employeeContribution' => 'setEmployeeContribution', + 'employeeContributionIsPercentage' => 'setEmployeeContributionIsPercentage', + 'employerContribution' => 'setEmployerContribution', + 'employerContributionIsPercentage' => 'setEmployerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'setEmployerContributionTopUpPercentage', + 'employerContributionIncludesNiSaving' => 'setEmployerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'setEmployerContributionNiSavingPercentage', + 'isAvc' => 'setIsAvc', + 'additionalVoluntaryContribution' => 'setAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'setAvcIsPercentage', + 'employerContributionNiSaving' => 'setEmployerContributionNiSaving', + 'customThreshold' => 'setCustomThreshold', + 'lowerLimit' => 'setLowerLimit', + 'upperLimit' => 'setUpperLimit', + 'papdisGroup' => 'setPapdisGroup', + 'papdisSubGroup' => 'setPapdisSubGroup', + 'localAuthorityNumber' => 'setLocalAuthorityNumber', + 'schoolEmployerType' => 'setSchoolEmployerType', + 'matIdentifier' => 'setMatIdentifier', + 'matUniqueNumber' => 'setMatUniqueNumber', + 'employerReference' => 'setEmployerReference', + 'lgpsFund' => 'setLgpsFund', + 'workerGroupId' => 'setWorkerGroupId', + 'assumedPensionablePay' => 'setAssumedPensionablePay', + 'pensionablePayDefinition' => 'setPensionablePayDefinition', + 'payslipDescription' => 'setPayslipDescription', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'name' => 'getName', + 'contributionLevelType' => 'getContributionLevelType', + 'employeeContribution' => 'getEmployeeContribution', + 'employeeContributionIsPercentage' => 'getEmployeeContributionIsPercentage', + 'employerContribution' => 'getEmployerContribution', + 'employerContributionIsPercentage' => 'getEmployerContributionIsPercentage', + 'employerContributionTopUpPercentage' => 'getEmployerContributionTopUpPercentage', + 'employerContributionIncludesNiSaving' => 'getEmployerContributionIncludesNiSaving', + 'employerContributionNiSavingPercentage' => 'getEmployerContributionNiSavingPercentage', + 'isAvc' => 'getIsAvc', + 'additionalVoluntaryContribution' => 'getAdditionalVoluntaryContribution', + 'avcIsPercentage' => 'getAvcIsPercentage', + 'employerContributionNiSaving' => 'getEmployerContributionNiSaving', + 'customThreshold' => 'getCustomThreshold', + 'lowerLimit' => 'getLowerLimit', + 'upperLimit' => 'getUpperLimit', + 'papdisGroup' => 'getPapdisGroup', + 'papdisSubGroup' => 'getPapdisSubGroup', + 'localAuthorityNumber' => 'getLocalAuthorityNumber', + 'schoolEmployerType' => 'getSchoolEmployerType', + 'matIdentifier' => 'getMatIdentifier', + 'matUniqueNumber' => 'getMatUniqueNumber', + 'employerReference' => 'getEmployerReference', + 'lgpsFund' => 'getLgpsFund', + 'workerGroupId' => 'getWorkerGroupId', + 'assumedPensionablePay' => 'getAssumedPensionablePay', + 'pensionablePayDefinition' => 'getPensionablePayDefinition', + 'payslipDescription' => 'getPayslipDescription', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('contributionLevelType', $data ?? [], null); + $this->setIfExists('employeeContribution', $data ?? [], null); + $this->setIfExists('employeeContributionIsPercentage', $data ?? [], null); + $this->setIfExists('employerContribution', $data ?? [], null); + $this->setIfExists('employerContributionIsPercentage', $data ?? [], null); + $this->setIfExists('employerContributionTopUpPercentage', $data ?? [], null); + $this->setIfExists('employerContributionIncludesNiSaving', $data ?? [], null); + $this->setIfExists('employerContributionNiSavingPercentage', $data ?? [], null); + $this->setIfExists('isAvc', $data ?? [], null); + $this->setIfExists('additionalVoluntaryContribution', $data ?? [], null); + $this->setIfExists('avcIsPercentage', $data ?? [], null); + $this->setIfExists('employerContributionNiSaving', $data ?? [], null); + $this->setIfExists('customThreshold', $data ?? [], null); + $this->setIfExists('lowerLimit', $data ?? [], null); + $this->setIfExists('upperLimit', $data ?? [], null); + $this->setIfExists('papdisGroup', $data ?? [], null); + $this->setIfExists('papdisSubGroup', $data ?? [], null); + $this->setIfExists('localAuthorityNumber', $data ?? [], null); + $this->setIfExists('schoolEmployerType', $data ?? [], null); + $this->setIfExists('matIdentifier', $data ?? [], null); + $this->setIfExists('matUniqueNumber', $data ?? [], null); + $this->setIfExists('employerReference', $data ?? [], null); + $this->setIfExists('lgpsFund', $data ?? [], null); + $this->setIfExists('workerGroupId', $data ?? [], null); + $this->setIfExists('assumedPensionablePay', $data ?? [], null); + $this->setIfExists('pensionablePayDefinition', $data ?? [], null); + $this->setIfExists('payslipDescription', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 150)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 150."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['papdisGroup']) && (mb_strlen($this->container['papdisGroup']) > 40)) { + $invalidProperties[] = "invalid value for 'papdisGroup', the character length must be smaller than or equal to 40."; + } + + if (!is_null($this->container['papdisSubGroup']) && (mb_strlen($this->container['papdisSubGroup']) > 40)) { + $invalidProperties[] = "invalid value for 'papdisSubGroup', the character length must be smaller than or equal to 40."; + } + + if (!is_null($this->container['localAuthorityNumber']) && (mb_strlen($this->container['localAuthorityNumber']) > 3)) { + $invalidProperties[] = "invalid value for 'localAuthorityNumber', the character length must be smaller than or equal to 3."; + } + + if (!is_null($this->container['localAuthorityNumber']) && !preg_match("/^(\\d{3})$/", $this->container['localAuthorityNumber'])) { + $invalidProperties[] = "invalid value for 'localAuthorityNumber', must be conform to the pattern /^(\\d{3})$/."; + } + + if (!is_null($this->container['schoolEmployerType']) && (mb_strlen($this->container['schoolEmployerType']) > 4)) { + $invalidProperties[] = "invalid value for 'schoolEmployerType', the character length must be smaller than or equal to 4."; + } + + if (!is_null($this->container['schoolEmployerType']) && !preg_match("/^(\\d{4})$/", $this->container['schoolEmployerType'])) { + $invalidProperties[] = "invalid value for 'schoolEmployerType', must be conform to the pattern /^(\\d{4})$/."; + } + + if (!is_null($this->container['matIdentifier']) && (mb_strlen($this->container['matIdentifier']) > 3)) { + $invalidProperties[] = "invalid value for 'matIdentifier', the character length must be smaller than or equal to 3."; + } + + if (!is_null($this->container['matIdentifier']) && !preg_match("/^(\\d{3}|)$/", $this->container['matIdentifier'])) { + $invalidProperties[] = "invalid value for 'matIdentifier', must be conform to the pattern /^(\\d{3}|)$/."; + } + + if (!is_null($this->container['matUniqueNumber']) && (mb_strlen($this->container['matUniqueNumber']) > 4)) { + $invalidProperties[] = "invalid value for 'matUniqueNumber', the character length must be smaller than or equal to 4."; + } + + if (!is_null($this->container['matUniqueNumber']) && !preg_match("/^(\\d{4}|)$/", $this->container['matUniqueNumber'])) { + $invalidProperties[] = "invalid value for 'matUniqueNumber', must be conform to the pattern /^(\\d{4}|)$/."; + } + + if (!is_null($this->container['payslipDescription']) && (mb_strlen($this->container['payslipDescription']) > 100)) { + $invalidProperties[] = "invalid value for 'payslipDescription', the character length must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName(): string + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName(string $name): static + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 150)) { + throw new InvalidArgumentException('invalid length for $name when calling WorkerGroup., must be smaller than or equal to 150.'); + } + if ((mb_strlen($name) < 1)) { + throw new InvalidArgumentException('invalid length for $name when calling WorkerGroup., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets contributionLevelType + * + * @return \SynergiTech\Staffology\Model\PensionContributionLevelType|null + */ + public function getContributionLevelType(): ?\SynergiTech\Staffology\Model\PensionContributionLevelType + { + return $this->container['contributionLevelType']; + } + + /** + * Sets contributionLevelType + * + * @param \SynergiTech\Staffology\Model\PensionContributionLevelType|null $contributionLevelType contributionLevelType + * + * @return $this + */ + public function setContributionLevelType(?\SynergiTech\Staffology\Model\PensionContributionLevelType $contributionLevelType): static + { + if (is_null($contributionLevelType)) { + throw new InvalidArgumentException('non-nullable contributionLevelType cannot be null'); + } + $this->container['contributionLevelType'] = $contributionLevelType; + + return $this; + } + + /** + * Gets employeeContribution + * + * @return float|null + */ + public function getEmployeeContribution(): ?float + { + return $this->container['employeeContribution']; + } + + /** + * Sets employeeContribution + * + * @param float|null $employeeContribution employeeContribution + * + * @return $this + */ + public function setEmployeeContribution(?float $employeeContribution): static + { + if (is_null($employeeContribution)) { + throw new InvalidArgumentException('non-nullable employeeContribution cannot be null'); + } + $this->container['employeeContribution'] = $employeeContribution; + + return $this; + } + + /** + * Gets employeeContributionIsPercentage + * + * @return bool|null + */ + public function getEmployeeContributionIsPercentage(): ?bool + { + return $this->container['employeeContributionIsPercentage']; + } + + /** + * Sets employeeContributionIsPercentage + * + * @param bool|null $employeeContributionIsPercentage employeeContributionIsPercentage + * + * @return $this + */ + public function setEmployeeContributionIsPercentage(?bool $employeeContributionIsPercentage): static + { + if (is_null($employeeContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employeeContributionIsPercentage cannot be null'); + } + $this->container['employeeContributionIsPercentage'] = $employeeContributionIsPercentage; + + return $this; + } + + /** + * Gets employerContribution + * + * @return float|null + */ + public function getEmployerContribution(): ?float + { + return $this->container['employerContribution']; + } + + /** + * Sets employerContribution + * + * @param float|null $employerContribution employerContribution + * + * @return $this + */ + public function setEmployerContribution(?float $employerContribution): static + { + if (is_null($employerContribution)) { + throw new InvalidArgumentException('non-nullable employerContribution cannot be null'); + } + $this->container['employerContribution'] = $employerContribution; + + return $this; + } + + /** + * Gets employerContributionIsPercentage + * + * @return bool|null + */ + public function getEmployerContributionIsPercentage(): ?bool + { + return $this->container['employerContributionIsPercentage']; + } + + /** + * Sets employerContributionIsPercentage + * + * @param bool|null $employerContributionIsPercentage employerContributionIsPercentage + * + * @return $this + */ + public function setEmployerContributionIsPercentage(?bool $employerContributionIsPercentage): static + { + if (is_null($employerContributionIsPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionIsPercentage cannot be null'); + } + $this->container['employerContributionIsPercentage'] = $employerContributionIsPercentage; + + return $this; + } + + /** + * Gets employerContributionTopUpPercentage + * + * @return float|null + */ + public function getEmployerContributionTopUpPercentage(): ?float + { + return $this->container['employerContributionTopUpPercentage']; + } + + /** + * Sets employerContributionTopUpPercentage + * + * @param float|null $employerContributionTopUpPercentage Increase Employer Contribution by this percentage of the Employee Contribution + * + * @return $this + */ + public function setEmployerContributionTopUpPercentage(?float $employerContributionTopUpPercentage): static + { + if (is_null($employerContributionTopUpPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionTopUpPercentage cannot be null'); + } + $this->container['employerContributionTopUpPercentage'] = $employerContributionTopUpPercentage; + + return $this; + } + + /** + * Gets employerContributionIncludesNiSaving + * + * @return bool|null + */ + public function getEmployerContributionIncludesNiSaving(): ?bool + { + return $this->container['employerContributionIncludesNiSaving']; + } + + /** + * Sets employerContributionIncludesNiSaving + * + * @param bool|null $employerContributionIncludesNiSaving Employer Contribution includes the Employers NI saving + * + * @return $this + */ + public function setEmployerContributionIncludesNiSaving(?bool $employerContributionIncludesNiSaving): static + { + if (is_null($employerContributionIncludesNiSaving)) { + throw new InvalidArgumentException('non-nullable employerContributionIncludesNiSaving cannot be null'); + } + $this->container['employerContributionIncludesNiSaving'] = $employerContributionIncludesNiSaving; + + return $this; + } + + /** + * Gets employerContributionNiSavingPercentage + * + * @return float|null + */ + public function getEmployerContributionNiSavingPercentage(): ?float + { + return $this->container['employerContributionNiSavingPercentage']; + } + + /** + * Sets employerContributionNiSavingPercentage + * + * @param float|null $employerContributionNiSavingPercentage Increase Employer Contribution by this percentage of the Employers NI saving + * + * @return $this + */ + public function setEmployerContributionNiSavingPercentage(?float $employerContributionNiSavingPercentage): static + { + if (is_null($employerContributionNiSavingPercentage)) { + throw new InvalidArgumentException('non-nullable employerContributionNiSavingPercentage cannot be null'); + } + $this->container['employerContributionNiSavingPercentage'] = $employerContributionNiSavingPercentage; + + return $this; + } + + /** + * Gets isAvc + * + * @return bool|null + */ + public function getIsAvc(): ?bool + { + return $this->container['isAvc']; + } + + /** + * Sets isAvc + * + * @param bool|null $isAvc Determines whether the workergroup uses additonal voluntary contributions. This property will automatically be set to true for the following Contribution Level Types: TpFasterAccrual, TpAdditionalPensionContributions, TpActuariallyAdjustedBenefits, TpFamilyBenefits, tpPastAddedYears, tpHigherSalaries, tpPreston, tpElectedFurtherEmployment, LgpsAdditionalPensionContributions, LgpsSharedAdditionalPensionContributions, LgpsAdditionalRegularContributions, LgpsAddedYearsContributions, LgpsSharedAdditionalPensionLumpSump, LgpsPartTimeBuyBack, PrudentialAVC. + * + * @return $this + */ + public function setIsAvc(?bool $isAvc): static + { + if (is_null($isAvc)) { + throw new InvalidArgumentException('non-nullable isAvc cannot be null'); + } + $this->container['isAvc'] = $isAvc; + + return $this; + } + + /** + * Gets additionalVoluntaryContribution + * + * @return float|null + */ + public function getAdditionalVoluntaryContribution(): ?float + { + return $this->container['additionalVoluntaryContribution']; + } + + /** + * Sets additionalVoluntaryContribution + * + * @param float|null $additionalVoluntaryContribution Any additional voluntary amount the employee contributes towards the pension. Could be a percentage or a fixed amount depending on AvcIsPercentage. + * + * @return $this + */ + public function setAdditionalVoluntaryContribution(?float $additionalVoluntaryContribution): static + { + if (is_null($additionalVoluntaryContribution)) { + array_push($this->openAPINullablesSetToNull, 'additionalVoluntaryContribution'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('additionalVoluntaryContribution', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['additionalVoluntaryContribution'] = $additionalVoluntaryContribution; + + return $this; + } + + /** + * Gets avcIsPercentage + * + * @return bool|null + */ + public function getAvcIsPercentage(): ?bool + { + return $this->container['avcIsPercentage']; + } + + /** + * Sets avcIsPercentage + * + * @param bool|null $avcIsPercentage Determines whether the Value of the Additional Voluntary Contribution is a fixed amount or a percentage, + * + * @return $this + */ + public function setAvcIsPercentage(?bool $avcIsPercentage): static + { + if (is_null($avcIsPercentage)) { + array_push($this->openAPINullablesSetToNull, 'avcIsPercentage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avcIsPercentage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avcIsPercentage'] = $avcIsPercentage; + + return $this; + } + + /** + * Gets employerContributionNiSaving + * + * @return float|null + */ + public function getEmployerContributionNiSaving(): ?float + { + return $this->container['employerContributionNiSaving']; + } + + /** + * Sets employerContributionNiSaving + * + * @param float|null $employerContributionNiSaving Employers NI Saving + * + * @return $this + */ + public function setEmployerContributionNiSaving(?float $employerContributionNiSaving): static + { + if (is_null($employerContributionNiSaving)) { + throw new InvalidArgumentException('non-nullable employerContributionNiSaving cannot be null'); + } + $this->container['employerContributionNiSaving'] = $employerContributionNiSaving; + + return $this; + } + + /** + * Gets customThreshold + * + * @return bool|null + */ + public function getCustomThreshold(): ?bool + { + return $this->container['customThreshold']; + } + + /** + * Sets customThreshold + * + * @param bool|null $customThreshold customThreshold + * + * @return $this + */ + public function setCustomThreshold(?bool $customThreshold): static + { + if (is_null($customThreshold)) { + throw new InvalidArgumentException('non-nullable customThreshold cannot be null'); + } + $this->container['customThreshold'] = $customThreshold; + + return $this; + } + + /** + * Gets lowerLimit + * + * @return float|null + */ + public function getLowerLimit(): ?float + { + return $this->container['lowerLimit']; + } + + /** + * Sets lowerLimit + * + * @param float|null $lowerLimit lowerLimit + * + * @return $this + */ + public function setLowerLimit(?float $lowerLimit): static + { + if (is_null($lowerLimit)) { + throw new InvalidArgumentException('non-nullable lowerLimit cannot be null'); + } + $this->container['lowerLimit'] = $lowerLimit; + + return $this; + } + + /** + * Gets upperLimit + * + * @return float|null + */ + public function getUpperLimit(): ?float + { + return $this->container['upperLimit']; + } + + /** + * Sets upperLimit + * + * @param float|null $upperLimit upperLimit + * + * @return $this + */ + public function setUpperLimit(?float $upperLimit): static + { + if (is_null($upperLimit)) { + throw new InvalidArgumentException('non-nullable upperLimit cannot be null'); + } + $this->container['upperLimit'] = $upperLimit; + + return $this; + } + + /** + * Gets papdisGroup + * + * @return string|null + */ + public function getPapdisGroup(): ?string + { + return $this->container['papdisGroup']; + } + + /** + * Sets papdisGroup + * + * @param string|null $papdisGroup papdisGroup + * + * @return $this + */ + public function setPapdisGroup(?string $papdisGroup): static + { + if (is_null($papdisGroup)) { + array_push($this->openAPINullablesSetToNull, 'papdisGroup'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisGroup', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($papdisGroup) && (mb_strlen($papdisGroup) > 40)) { + throw new InvalidArgumentException('invalid length for $papdisGroup when calling WorkerGroup., must be smaller than or equal to 40.'); + } + + $this->container['papdisGroup'] = $papdisGroup; + + return $this; + } + + /** + * Gets papdisSubGroup + * + * @return string|null + */ + public function getPapdisSubGroup(): ?string + { + return $this->container['papdisSubGroup']; + } + + /** + * Sets papdisSubGroup + * + * @param string|null $papdisSubGroup papdisSubGroup + * + * @return $this + */ + public function setPapdisSubGroup(?string $papdisSubGroup): static + { + if (is_null($papdisSubGroup)) { + array_push($this->openAPINullablesSetToNull, 'papdisSubGroup'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('papdisSubGroup', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($papdisSubGroup) && (mb_strlen($papdisSubGroup) > 40)) { + throw new InvalidArgumentException('invalid length for $papdisSubGroup when calling WorkerGroup., must be smaller than or equal to 40.'); + } + + $this->container['papdisSubGroup'] = $papdisSubGroup; + + return $this; + } + + /** + * Gets localAuthorityNumber + * + * @return string|null + */ + public function getLocalAuthorityNumber(): ?string + { + return $this->container['localAuthorityNumber']; + } + + /** + * Sets localAuthorityNumber + * + * @param string|null $localAuthorityNumber Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales + * + * @return $this + */ + public function setLocalAuthorityNumber(?string $localAuthorityNumber): static + { + if (is_null($localAuthorityNumber)) { + array_push($this->openAPINullablesSetToNull, 'localAuthorityNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('localAuthorityNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($localAuthorityNumber) && (mb_strlen($localAuthorityNumber) > 3)) { + throw new InvalidArgumentException('invalid length for $localAuthorityNumber when calling WorkerGroup., must be smaller than or equal to 3.'); + } + if (!is_null($localAuthorityNumber) && (!preg_match("/^(\\d{3})$/", ObjectSerializer::toString($localAuthorityNumber)))) { + throw new InvalidArgumentException("invalid value for \$localAuthorityNumber when calling WorkerGroup., must conform to the pattern /^(\\d{3})$/."); + } + + $this->container['localAuthorityNumber'] = $localAuthorityNumber; + + return $this; + } + + /** + * Gets schoolEmployerType + * + * @return string|null + */ + public function getSchoolEmployerType(): ?string + { + return $this->container['schoolEmployerType']; + } + + /** + * Sets schoolEmployerType + * + * @param string|null $schoolEmployerType Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales + * + * @return $this + */ + public function setSchoolEmployerType(?string $schoolEmployerType): static + { + if (is_null($schoolEmployerType)) { + array_push($this->openAPINullablesSetToNull, 'schoolEmployerType'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('schoolEmployerType', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($schoolEmployerType) && (mb_strlen($schoolEmployerType) > 4)) { + throw new InvalidArgumentException('invalid length for $schoolEmployerType when calling WorkerGroup., must be smaller than or equal to 4.'); + } + if (!is_null($schoolEmployerType) && (!preg_match("/^(\\d{4})$/", ObjectSerializer::toString($schoolEmployerType)))) { + throw new InvalidArgumentException("invalid value for \$schoolEmployerType when calling WorkerGroup., must conform to the pattern /^(\\d{4})$/."); + } + + $this->container['schoolEmployerType'] = $schoolEmployerType; + + return $this; + } + + /** + * Gets matIdentifier + * + * @return string|null + */ + public function getMatIdentifier(): ?string + { + return $this->container['matIdentifier']; + } + + /** + * Sets matIdentifier + * + * @param string|null $matIdentifier Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales + * + * @return $this + */ + public function setMatIdentifier(?string $matIdentifier): static + { + if (is_null($matIdentifier)) { + array_push($this->openAPINullablesSetToNull, 'matIdentifier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matIdentifier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($matIdentifier) && (mb_strlen($matIdentifier) > 3)) { + throw new InvalidArgumentException('invalid length for $matIdentifier when calling WorkerGroup., must be smaller than or equal to 3.'); + } + if (!is_null($matIdentifier) && (!preg_match("/^(\\d{3}|)$/", ObjectSerializer::toString($matIdentifier)))) { + throw new InvalidArgumentException("invalid value for \$matIdentifier when calling WorkerGroup., must conform to the pattern /^(\\d{3}|)$/."); + } + + $this->container['matIdentifier'] = $matIdentifier; + + return $this; + } + + /** + * Gets matUniqueNumber + * + * @return string|null + */ + public function getMatUniqueNumber(): ?string + { + return $this->container['matUniqueNumber']; + } + + /** + * Sets matUniqueNumber + * + * @param string|null $matUniqueNumber Only applicable if ContributionLevelType is TeachersPensionEnglandAndWales + * + * @return $this + */ + public function setMatUniqueNumber(?string $matUniqueNumber): static + { + if (is_null($matUniqueNumber)) { + array_push($this->openAPINullablesSetToNull, 'matUniqueNumber'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('matUniqueNumber', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($matUniqueNumber) && (mb_strlen($matUniqueNumber) > 4)) { + throw new InvalidArgumentException('invalid length for $matUniqueNumber when calling WorkerGroup., must be smaller than or equal to 4.'); + } + if (!is_null($matUniqueNumber) && (!preg_match("/^(\\d{4}|)$/", ObjectSerializer::toString($matUniqueNumber)))) { + throw new InvalidArgumentException("invalid value for \$matUniqueNumber when calling WorkerGroup., must conform to the pattern /^(\\d{4}|)$/."); + } + + $this->container['matUniqueNumber'] = $matUniqueNumber; + + return $this; + } + + /** + * Gets employerReference + * + * @return string|null + */ + public function getEmployerReference(): ?string + { + return $this->container['employerReference']; + } + + /** + * Sets employerReference + * + * @param string|null $employerReference employerReference + * + * @return $this + */ + public function setEmployerReference(?string $employerReference): static + { + if (is_null($employerReference)) { + array_push($this->openAPINullablesSetToNull, 'employerReference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employerReference', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employerReference'] = $employerReference; + + return $this; + } + + /** + * Gets lgpsFund + * + * @return \SynergiTech\Staffology\Model\LgpsFund|null + */ + public function getLgpsFund(): ?\SynergiTech\Staffology\Model\LgpsFund + { + return $this->container['lgpsFund']; + } + + /** + * Sets lgpsFund + * + * @param \SynergiTech\Staffology\Model\LgpsFund|null $lgpsFund lgpsFund + * + * @return $this + */ + public function setLgpsFund(?\SynergiTech\Staffology\Model\LgpsFund $lgpsFund): static + { + if (is_null($lgpsFund)) { + throw new InvalidArgumentException('non-nullable lgpsFund cannot be null'); + } + $this->container['lgpsFund'] = $lgpsFund; + + return $this; + } + + /** + * Gets workerGroupId + * + * @return string|null + */ + public function getWorkerGroupId(): ?string + { + return $this->container['workerGroupId']; + } + + /** + * Sets workerGroupId + * + * @param string|null $workerGroupId [readonly] + * + * @return $this + */ + public function setWorkerGroupId(?string $workerGroupId): static + { + if (is_null($workerGroupId)) { + throw new InvalidArgumentException('non-nullable workerGroupId cannot be null'); + } + $this->container['workerGroupId'] = $workerGroupId; + + return $this; + } + + /** + * Gets assumedPensionablePay + * + * @return \SynergiTech\Staffology\Model\AssumedPensionablePay|null + */ + public function getAssumedPensionablePay(): ?\SynergiTech\Staffology\Model\AssumedPensionablePay + { + return $this->container['assumedPensionablePay']; + } + + /** + * Sets assumedPensionablePay + * + * @param \SynergiTech\Staffology\Model\AssumedPensionablePay|null $assumedPensionablePay assumedPensionablePay + * + * @return $this + */ + public function setAssumedPensionablePay(?\SynergiTech\Staffology\Model\AssumedPensionablePay $assumedPensionablePay): static + { + if (is_null($assumedPensionablePay)) { + throw new InvalidArgumentException('non-nullable assumedPensionablePay cannot be null'); + } + $this->container['assumedPensionablePay'] = $assumedPensionablePay; + + return $this; + } + + /** + * Gets pensionablePayDefinition + * + * @return \SynergiTech\Staffology\Model\PensionablePayDefinition|null + */ + public function getPensionablePayDefinition(): ?\SynergiTech\Staffology\Model\PensionablePayDefinition + { + return $this->container['pensionablePayDefinition']; + } + + /** + * Sets pensionablePayDefinition + * + * @param \SynergiTech\Staffology\Model\PensionablePayDefinition|null $pensionablePayDefinition pensionablePayDefinition + * + * @return $this + */ + public function setPensionablePayDefinition(?\SynergiTech\Staffology\Model\PensionablePayDefinition $pensionablePayDefinition): static + { + if (is_null($pensionablePayDefinition)) { + throw new InvalidArgumentException('non-nullable pensionablePayDefinition cannot be null'); + } + $this->container['pensionablePayDefinition'] = $pensionablePayDefinition; + + return $this; + } + + /** + * Gets payslipDescription + * + * @return string|null + */ + public function getPayslipDescription(): ?string + { + return $this->container['payslipDescription']; + } + + /** + * Sets payslipDescription + * + * @param string|null $payslipDescription Used for overwriting the pension description that is displayed on the payslip + * + * @return $this + */ + public function setPayslipDescription(?string $payslipDescription): static + { + if (is_null($payslipDescription)) { + array_push($this->openAPINullablesSetToNull, 'payslipDescription'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payslipDescription', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($payslipDescription) && (mb_strlen($payslipDescription) > 100)) { + throw new InvalidArgumentException('invalid length for $payslipDescription when calling WorkerGroup., must be smaller than or equal to 100.'); + } + + $this->container['payslipDescription'] = $payslipDescription; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WorkingPattern.php b/src/Model/WorkingPattern.php new file mode 100644 index 0000000..a307cd6 --- /dev/null +++ b/src/Model/WorkingPattern.php @@ -0,0 +1,1118 @@ + + */ +class WorkingPattern implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WorkingPattern'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'mon' => 'float', + 'tue' => 'float', + 'wed' => 'float', + 'thu' => 'float', + 'fri' => 'float', + 'sat' => 'float', + 'sun' => 'float', + 'contractedWeeks' => 'float', + 'fullTimeContractedWeeks' => 'float', + 'fullTimeContractedHours' => 'float', + 'bankHolidays' => '\SynergiTech\Staffology\Model\BankHolidayCollection', + 'proRataRule' => '\SynergiTech\Staffology\Model\ProRataRule', + 'bankHolidayDates' => '\DateTime[]', + 'workingPatternHoursType' => '\SynergiTech\Staffology\Model\WorkingPatternHoursType', + 'isDefault' => 'bool', + 'effectiveFrom' => '\DateTime', + 'workingPatternType' => '\SynergiTech\Staffology\Model\WorkingPatternType', + 'shiftWorkingPatternDays' => '\SynergiTech\Staffology\Model\ShiftWorkingPatternDay[]', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'title' => null, + 'mon' => 'double', + 'tue' => 'double', + 'wed' => 'double', + 'thu' => 'double', + 'fri' => 'double', + 'sat' => 'double', + 'sun' => 'double', + 'contractedWeeks' => 'double', + 'fullTimeContractedWeeks' => 'double', + 'fullTimeContractedHours' => 'double', + 'bankHolidays' => null, + 'proRataRule' => null, + 'bankHolidayDates' => 'date-time', + 'workingPatternHoursType' => null, + 'isDefault' => null, + 'effectiveFrom' => 'date', + 'workingPatternType' => null, + 'shiftWorkingPatternDays' => null, + 'id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'title' => false, + 'mon' => false, + 'tue' => false, + 'wed' => false, + 'thu' => false, + 'fri' => false, + 'sat' => false, + 'sun' => false, + 'contractedWeeks' => true, + 'fullTimeContractedWeeks' => true, + 'fullTimeContractedHours' => true, + 'bankHolidays' => false, + 'proRataRule' => false, + 'bankHolidayDates' => true, + 'workingPatternHoursType' => false, + 'isDefault' => false, + 'effectiveFrom' => true, + 'workingPatternType' => false, + 'shiftWorkingPatternDays' => true, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'title' => 'title', + 'mon' => 'mon', + 'tue' => 'tue', + 'wed' => 'wed', + 'thu' => 'thu', + 'fri' => 'fri', + 'sat' => 'sat', + 'sun' => 'sun', + 'contractedWeeks' => 'contractedWeeks', + 'fullTimeContractedWeeks' => 'fullTimeContractedWeeks', + 'fullTimeContractedHours' => 'fullTimeContractedHours', + 'bankHolidays' => 'bankHolidays', + 'proRataRule' => 'proRataRule', + 'bankHolidayDates' => 'bankHolidayDates', + 'workingPatternHoursType' => 'workingPatternHoursType', + 'isDefault' => 'isDefault', + 'effectiveFrom' => 'effectiveFrom', + 'workingPatternType' => 'workingPatternType', + 'shiftWorkingPatternDays' => 'shiftWorkingPatternDays', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'title' => 'setTitle', + 'mon' => 'setMon', + 'tue' => 'setTue', + 'wed' => 'setWed', + 'thu' => 'setThu', + 'fri' => 'setFri', + 'sat' => 'setSat', + 'sun' => 'setSun', + 'contractedWeeks' => 'setContractedWeeks', + 'fullTimeContractedWeeks' => 'setFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'setFullTimeContractedHours', + 'bankHolidays' => 'setBankHolidays', + 'proRataRule' => 'setProRataRule', + 'bankHolidayDates' => 'setBankHolidayDates', + 'workingPatternHoursType' => 'setWorkingPatternHoursType', + 'isDefault' => 'setIsDefault', + 'effectiveFrom' => 'setEffectiveFrom', + 'workingPatternType' => 'setWorkingPatternType', + 'shiftWorkingPatternDays' => 'setShiftWorkingPatternDays', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'title' => 'getTitle', + 'mon' => 'getMon', + 'tue' => 'getTue', + 'wed' => 'getWed', + 'thu' => 'getThu', + 'fri' => 'getFri', + 'sat' => 'getSat', + 'sun' => 'getSun', + 'contractedWeeks' => 'getContractedWeeks', + 'fullTimeContractedWeeks' => 'getFullTimeContractedWeeks', + 'fullTimeContractedHours' => 'getFullTimeContractedHours', + 'bankHolidays' => 'getBankHolidays', + 'proRataRule' => 'getProRataRule', + 'bankHolidayDates' => 'getBankHolidayDates', + 'workingPatternHoursType' => 'getWorkingPatternHoursType', + 'isDefault' => 'getIsDefault', + 'effectiveFrom' => 'getEffectiveFrom', + 'workingPatternType' => 'getWorkingPatternType', + 'shiftWorkingPatternDays' => 'getShiftWorkingPatternDays', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('mon', $data ?? [], null); + $this->setIfExists('tue', $data ?? [], null); + $this->setIfExists('wed', $data ?? [], null); + $this->setIfExists('thu', $data ?? [], null); + $this->setIfExists('fri', $data ?? [], null); + $this->setIfExists('sat', $data ?? [], null); + $this->setIfExists('sun', $data ?? [], null); + $this->setIfExists('contractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedWeeks', $data ?? [], null); + $this->setIfExists('fullTimeContractedHours', $data ?? [], null); + $this->setIfExists('bankHolidays', $data ?? [], null); + $this->setIfExists('proRataRule', $data ?? [], null); + $this->setIfExists('bankHolidayDates', $data ?? [], null); + $this->setIfExists('workingPatternHoursType', $data ?? [], null); + $this->setIfExists('isDefault', $data ?? [], null); + $this->setIfExists('effectiveFrom', $data ?? [], null); + $this->setIfExists('workingPatternType', $data ?? [], null); + $this->setIfExists('shiftWorkingPatternDays', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 100)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle(): string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return $this + */ + public function setTitle(string $title): static + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 100)) { + throw new InvalidArgumentException('invalid length for $title when calling WorkingPattern., must be smaller than or equal to 100.'); + } + if ((mb_strlen($title) < 1)) { + throw new InvalidArgumentException('invalid length for $title when calling WorkingPattern., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets mon + * + * @return float|null + */ + public function getMon(): ?float + { + return $this->container['mon']; + } + + /** + * Sets mon + * + * @param float|null $mon mon + * + * @return $this + */ + public function setMon(?float $mon): static + { + if (is_null($mon)) { + throw new InvalidArgumentException('non-nullable mon cannot be null'); + } + $this->container['mon'] = $mon; + + return $this; + } + + /** + * Gets tue + * + * @return float|null + */ + public function getTue(): ?float + { + return $this->container['tue']; + } + + /** + * Sets tue + * + * @param float|null $tue tue + * + * @return $this + */ + public function setTue(?float $tue): static + { + if (is_null($tue)) { + throw new InvalidArgumentException('non-nullable tue cannot be null'); + } + $this->container['tue'] = $tue; + + return $this; + } + + /** + * Gets wed + * + * @return float|null + */ + public function getWed(): ?float + { + return $this->container['wed']; + } + + /** + * Sets wed + * + * @param float|null $wed wed + * + * @return $this + */ + public function setWed(?float $wed): static + { + if (is_null($wed)) { + throw new InvalidArgumentException('non-nullable wed cannot be null'); + } + $this->container['wed'] = $wed; + + return $this; + } + + /** + * Gets thu + * + * @return float|null + */ + public function getThu(): ?float + { + return $this->container['thu']; + } + + /** + * Sets thu + * + * @param float|null $thu thu + * + * @return $this + */ + public function setThu(?float $thu): static + { + if (is_null($thu)) { + throw new InvalidArgumentException('non-nullable thu cannot be null'); + } + $this->container['thu'] = $thu; + + return $this; + } + + /** + * Gets fri + * + * @return float|null + */ + public function getFri(): ?float + { + return $this->container['fri']; + } + + /** + * Sets fri + * + * @param float|null $fri fri + * + * @return $this + */ + public function setFri(?float $fri): static + { + if (is_null($fri)) { + throw new InvalidArgumentException('non-nullable fri cannot be null'); + } + $this->container['fri'] = $fri; + + return $this; + } + + /** + * Gets sat + * + * @return float|null + */ + public function getSat(): ?float + { + return $this->container['sat']; + } + + /** + * Sets sat + * + * @param float|null $sat sat + * + * @return $this + */ + public function setSat(?float $sat): static + { + if (is_null($sat)) { + throw new InvalidArgumentException('non-nullable sat cannot be null'); + } + $this->container['sat'] = $sat; + + return $this; + } + + /** + * Gets sun + * + * @return float|null + */ + public function getSun(): ?float + { + return $this->container['sun']; + } + + /** + * Sets sun + * + * @param float|null $sun sun + * + * @return $this + */ + public function setSun(?float $sun): static + { + if (is_null($sun)) { + throw new InvalidArgumentException('non-nullable sun cannot be null'); + } + $this->container['sun'] = $sun; + + return $this; + } + + /** + * Gets contractedWeeks + * + * @return float|null + */ + public function getContractedWeeks(): ?float + { + return $this->container['contractedWeeks']; + } + + /** + * Sets contractedWeeks + * + * @param float|null $contractedWeeks The amount of weeks an employee works, utilise for employees who aren't working full time. If Null then the default is used. + * + * @return $this + */ + public function setContractedWeeks(?float $contractedWeeks): static + { + if (is_null($contractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'contractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + $this->container['contractedWeeks'] = $contractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedWeeks + * + * @return float|null + */ + public function getFullTimeContractedWeeks(): ?float + { + return $this->container['fullTimeContractedWeeks']; + } + + /** + * Sets fullTimeContractedWeeks + * + * @param float|null $fullTimeContractedWeeks The amount of weeks an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedWeeks(?float $fullTimeContractedWeeks): static + { + if (is_null($fullTimeContractedWeeks)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedWeeks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedWeeks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + $this->container['fullTimeContractedWeeks'] = $fullTimeContractedWeeks; + + return $this; + } + + /** + * Gets fullTimeContractedHours + * + * @return float|null + */ + public function getFullTimeContractedHours(): ?float + { + return $this->container['fullTimeContractedHours']; + } + + /** + * Sets fullTimeContractedHours + * + * @param float|null $fullTimeContractedHours The amount of hours an employee works (Full Time). If Null then the default is used. + * + * @return $this + */ + public function setFullTimeContractedHours(?float $fullTimeContractedHours): static + { + if (is_null($fullTimeContractedHours)) { + array_push($this->openAPINullablesSetToNull, 'fullTimeContractedHours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fullTimeContractedHours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['fullTimeContractedHours'] = $fullTimeContractedHours; + + return $this; + } + + /** + * Gets bankHolidays + * + * @return \SynergiTech\Staffology\Model\BankHolidayCollection|null + */ + public function getBankHolidays(): ?\SynergiTech\Staffology\Model\BankHolidayCollection + { + return $this->container['bankHolidays']; + } + + /** + * Sets bankHolidays + * + * @param \SynergiTech\Staffology\Model\BankHolidayCollection|null $bankHolidays bankHolidays + * + * @return $this + */ + public function setBankHolidays(?\SynergiTech\Staffology\Model\BankHolidayCollection $bankHolidays): static + { + if (is_null($bankHolidays)) { + throw new InvalidArgumentException('non-nullable bankHolidays cannot be null'); + } + $this->container['bankHolidays'] = $bankHolidays; + + return $this; + } + + /** + * Gets proRataRule + * + * @return \SynergiTech\Staffology\Model\ProRataRule|null + */ + public function getProRataRule(): ?\SynergiTech\Staffology\Model\ProRataRule + { + return $this->container['proRataRule']; + } + + /** + * Sets proRataRule + * + * @param \SynergiTech\Staffology\Model\ProRataRule|null $proRataRule proRataRule + * + * @return $this + */ + public function setProRataRule(?\SynergiTech\Staffology\Model\ProRataRule $proRataRule): static + { + if (is_null($proRataRule)) { + throw new InvalidArgumentException('non-nullable proRataRule cannot be null'); + } + $this->container['proRataRule'] = $proRataRule; + + return $this; + } + + /** + * Gets bankHolidayDates + * + * @return \DateTime[]|null + */ + public function getBankHolidayDates(): ?array + { + return $this->container['bankHolidayDates']; + } + + /** + * Sets bankHolidayDates + * + * @param \DateTime[]|null $bankHolidayDates [readonly] The dates that are classed as Bank Holidays for this WorkingPattern + * + * @return $this + */ + public function setBankHolidayDates(?array $bankHolidayDates): static + { + if (is_null($bankHolidayDates)) { + array_push($this->openAPINullablesSetToNull, 'bankHolidayDates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bankHolidayDates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['bankHolidayDates'] = $bankHolidayDates; + + return $this; + } + + /** + * Gets workingPatternHoursType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternHoursType|null + */ + public function getWorkingPatternHoursType(): ?\SynergiTech\Staffology\Model\WorkingPatternHoursType + { + return $this->container['workingPatternHoursType']; + } + + /** + * Sets workingPatternHoursType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternHoursType|null $workingPatternHoursType workingPatternHoursType + * + * @return $this + */ + public function setWorkingPatternHoursType(?\SynergiTech\Staffology\Model\WorkingPatternHoursType $workingPatternHoursType): static + { + if (is_null($workingPatternHoursType)) { + throw new InvalidArgumentException('non-nullable workingPatternHoursType cannot be null'); + } + $this->container['workingPatternHoursType'] = $workingPatternHoursType; + + return $this; + } + + /** + * Gets isDefault + * + * @return bool|null + */ + public function getIsDefault(): ?bool + { + return $this->container['isDefault']; + } + + /** + * Sets isDefault + * + * @param bool|null $isDefault isDefault + * + * @return $this + */ + public function setIsDefault(?bool $isDefault): static + { + if (is_null($isDefault)) { + throw new InvalidArgumentException('non-nullable isDefault cannot be null'); + } + $this->container['isDefault'] = $isDefault; + + return $this; + } + + /** + * Gets effectiveFrom + * + * @return \DateTime|null + */ + public function getEffectiveFrom(): ?\DateTime + { + return $this->container['effectiveFrom']; + } + + /** + * Sets effectiveFrom + * + * @param \DateTime|null $effectiveFrom The date when the assignment of the Working Pattern becomes effective. Required for a Shift WorkingPattern to determine when it starts + * + * @return $this + */ + public function setEffectiveFrom(?\DateTime $effectiveFrom): static + { + if (is_null($effectiveFrom)) { + array_push($this->openAPINullablesSetToNull, 'effectiveFrom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effectiveFrom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effectiveFrom'] = $effectiveFrom; + + return $this; + } + + /** + * Gets workingPatternType + * + * @return \SynergiTech\Staffology\Model\WorkingPatternType|null + */ + public function getWorkingPatternType(): ?\SynergiTech\Staffology\Model\WorkingPatternType + { + return $this->container['workingPatternType']; + } + + /** + * Sets workingPatternType + * + * @param \SynergiTech\Staffology\Model\WorkingPatternType|null $workingPatternType workingPatternType + * + * @return $this + */ + public function setWorkingPatternType(?\SynergiTech\Staffology\Model\WorkingPatternType $workingPatternType): static + { + if (is_null($workingPatternType)) { + throw new InvalidArgumentException('non-nullable workingPatternType cannot be null'); + } + $this->container['workingPatternType'] = $workingPatternType; + + return $this; + } + + /** + * Gets shiftWorkingPatternDays + * + * @return \SynergiTech\Staffology\Model\ShiftWorkingPatternDay[]|null + */ + public function getShiftWorkingPatternDays(): ?array + { + return $this->container['shiftWorkingPatternDays']; + } + + /** + * Sets shiftWorkingPatternDays + * + * @param \SynergiTech\Staffology\Model\ShiftWorkingPatternDay[]|null $shiftWorkingPatternDays shiftWorkingPatternDays + * + * @return $this + */ + public function setShiftWorkingPatternDays(?array $shiftWorkingPatternDays): static + { + if (is_null($shiftWorkingPatternDays)) { + array_push($this->openAPINullablesSetToNull, 'shiftWorkingPatternDays'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shiftWorkingPatternDays', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shiftWorkingPatternDays'] = $shiftWorkingPatternDays; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId(): ?string + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id [readonly] The unique id of the object + * + * @return $this + */ + public function setId(?string $id): static + { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/WorkingPatternHoursType.php b/src/Model/WorkingPatternHoursType.php new file mode 100644 index 0000000..06e6363 --- /dev/null +++ b/src/Model/WorkingPatternHoursType.php @@ -0,0 +1,47 @@ + + */ +class YearEnd implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'YearEnd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'endingYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'startingYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'createEpsForFinalSubmission' => 'bool', + 'createEpsForEmploymentAllowance' => 'bool', + 'createExb' => 'bool', + 'setEmploymentAllowance' => 'float', + 'taxCodeChanges' => '\SynergiTech\Staffology\Model\YearEndTaxCodeChange[]', + 'removeWeek1Month1' => '\SynergiTech\Staffology\Model\Item[]', + 'emailP60' => '\SynergiTech\Staffology\Model\Item[]', + 'pushP60' => '\SynergiTech\Staffology\Model\ExternalDataProviderId[]', + 'emailCisStatement' => '\SynergiTech\Staffology\Model\Item[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'endingYear' => null, + 'startingYear' => null, + 'createEpsForFinalSubmission' => null, + 'createEpsForEmploymentAllowance' => null, + 'createExb' => null, + 'setEmploymentAllowance' => 'double', + 'taxCodeChanges' => null, + 'removeWeek1Month1' => null, + 'emailP60' => null, + 'pushP60' => null, + 'emailCisStatement' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'endingYear' => false, + 'startingYear' => false, + 'createEpsForFinalSubmission' => false, + 'createEpsForEmploymentAllowance' => false, + 'createExb' => false, + 'setEmploymentAllowance' => true, + 'taxCodeChanges' => true, + 'removeWeek1Month1' => true, + 'emailP60' => true, + 'pushP60' => true, + 'emailCisStatement' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'endingYear' => 'endingYear', + 'startingYear' => 'startingYear', + 'createEpsForFinalSubmission' => 'createEpsForFinalSubmission', + 'createEpsForEmploymentAllowance' => 'createEpsForEmploymentAllowance', + 'createExb' => 'createExb', + 'setEmploymentAllowance' => 'setEmploymentAllowance', + 'taxCodeChanges' => 'taxCodeChanges', + 'removeWeek1Month1' => 'removeWeek1Month1', + 'emailP60' => 'emailP60', + 'pushP60' => 'pushP60', + 'emailCisStatement' => 'emailCisStatement' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'endingYear' => 'setEndingYear', + 'startingYear' => 'setStartingYear', + 'createEpsForFinalSubmission' => 'setCreateEpsForFinalSubmission', + 'createEpsForEmploymentAllowance' => 'setCreateEpsForEmploymentAllowance', + 'createExb' => 'setCreateExb', + 'setEmploymentAllowance' => 'setSetEmploymentAllowance', + 'taxCodeChanges' => 'setTaxCodeChanges', + 'removeWeek1Month1' => 'setRemoveWeek1Month1', + 'emailP60' => 'setEmailP60', + 'pushP60' => 'setPushP60', + 'emailCisStatement' => 'setEmailCisStatement' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'endingYear' => 'getEndingYear', + 'startingYear' => 'getStartingYear', + 'createEpsForFinalSubmission' => 'getCreateEpsForFinalSubmission', + 'createEpsForEmploymentAllowance' => 'getCreateEpsForEmploymentAllowance', + 'createExb' => 'getCreateExb', + 'setEmploymentAllowance' => 'getSetEmploymentAllowance', + 'taxCodeChanges' => 'getTaxCodeChanges', + 'removeWeek1Month1' => 'getRemoveWeek1Month1', + 'emailP60' => 'getEmailP60', + 'pushP60' => 'getPushP60', + 'emailCisStatement' => 'getEmailCisStatement' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('endingYear', $data ?? [], null); + $this->setIfExists('startingYear', $data ?? [], null); + $this->setIfExists('createEpsForFinalSubmission', $data ?? [], null); + $this->setIfExists('createEpsForEmploymentAllowance', $data ?? [], null); + $this->setIfExists('createExb', $data ?? [], null); + $this->setIfExists('setEmploymentAllowance', $data ?? [], null); + $this->setIfExists('taxCodeChanges', $data ?? [], null); + $this->setIfExists('removeWeek1Month1', $data ?? [], null); + $this->setIfExists('emailP60', $data ?? [], null); + $this->setIfExists('pushP60', $data ?? [], null); + $this->setIfExists('emailCisStatement', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets endingYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getEndingYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['endingYear']; + } + + /** + * Sets endingYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $endingYear endingYear + * + * @return $this + */ + public function setEndingYear(?\SynergiTech\Staffology\Model\TaxYear $endingYear): static + { + if (is_null($endingYear)) { + throw new InvalidArgumentException('non-nullable endingYear cannot be null'); + } + $this->container['endingYear'] = $endingYear; + + return $this; + } + + /** + * Gets startingYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getStartingYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['startingYear']; + } + + /** + * Sets startingYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $startingYear startingYear + * + * @return $this + */ + public function setStartingYear(?\SynergiTech\Staffology\Model\TaxYear $startingYear): static + { + if (is_null($startingYear)) { + throw new InvalidArgumentException('non-nullable startingYear cannot be null'); + } + $this->container['startingYear'] = $startingYear; + + return $this; + } + + /** + * Gets createEpsForFinalSubmission + * + * @return bool|null + */ + public function getCreateEpsForFinalSubmission(): ?bool + { + return $this->container['createEpsForFinalSubmission']; + } + + /** + * Sets createEpsForFinalSubmission + * + * @param bool|null $createEpsForFinalSubmission [readonly] Whether or not the system will automatically create an EPS to tell HMRC the year has ended. + * + * @return $this + */ + public function setCreateEpsForFinalSubmission(?bool $createEpsForFinalSubmission): static + { + if (is_null($createEpsForFinalSubmission)) { + throw new InvalidArgumentException('non-nullable createEpsForFinalSubmission cannot be null'); + } + $this->container['createEpsForFinalSubmission'] = $createEpsForFinalSubmission; + + return $this; + } + + /** + * Gets createEpsForEmploymentAllowance + * + * @return bool|null + */ + public function getCreateEpsForEmploymentAllowance(): ?bool + { + return $this->container['createEpsForEmploymentAllowance']; + } + + /** + * Sets createEpsForEmploymentAllowance + * + * @param bool|null $createEpsForEmploymentAllowance [readonly] Whether or not the system will automatically create an EPS to tell HMRC you qualify for Employment Allowance. + * + * @return $this + */ + public function setCreateEpsForEmploymentAllowance(?bool $createEpsForEmploymentAllowance): static + { + if (is_null($createEpsForEmploymentAllowance)) { + throw new InvalidArgumentException('non-nullable createEpsForEmploymentAllowance cannot be null'); + } + $this->container['createEpsForEmploymentAllowance'] = $createEpsForEmploymentAllowance; + + return $this; + } + + /** + * Gets createExb + * + * @return bool|null + */ + public function getCreateExb(): ?bool + { + return $this->container['createExb']; + } + + /** + * Sets createExb + * + * @param bool|null $createExb [readonly] Whether or not the system will automatically create an EXB to inform HMRC of Expenses and Benefits + * + * @return $this + */ + public function setCreateExb(?bool $createExb): static + { + if (is_null($createExb)) { + throw new InvalidArgumentException('non-nullable createExb cannot be null'); + } + $this->container['createExb'] = $createExb; + + return $this; + } + + /** + * Gets setEmploymentAllowance + * + * @return float|null + */ + public function getSetEmploymentAllowance(): ?float + { + return $this->container['setEmploymentAllowance']; + } + + /** + * Sets setEmploymentAllowance + * + * @param float|null $setEmploymentAllowance [readonly] If the Employment Allowance needs to be changed, this indicates the new value + * + * @return $this + */ + public function setSetEmploymentAllowance(?float $setEmploymentAllowance): static + { + if (is_null($setEmploymentAllowance)) { + array_push($this->openAPINullablesSetToNull, 'setEmploymentAllowance'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('setEmploymentAllowance', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['setEmploymentAllowance'] = $setEmploymentAllowance; + + return $this; + } + + /** + * Gets taxCodeChanges + * + * @return \SynergiTech\Staffology\Model\YearEndTaxCodeChange[]|null + */ + public function getTaxCodeChanges(): ?array + { + return $this->container['taxCodeChanges']; + } + + /** + * Sets taxCodeChanges + * + * @param \SynergiTech\Staffology\Model\YearEndTaxCodeChange[]|null $taxCodeChanges [readonly] Details of changes that wil be made to Tax Codes + * + * @return $this + */ + public function setTaxCodeChanges(?array $taxCodeChanges): static + { + if (is_null($taxCodeChanges)) { + array_push($this->openAPINullablesSetToNull, 'taxCodeChanges'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('taxCodeChanges', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['taxCodeChanges'] = $taxCodeChanges; + + return $this; + } + + /** + * Gets removeWeek1Month1 + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getRemoveWeek1Month1(): ?array + { + return $this->container['removeWeek1Month1']; + } + + /** + * Sets removeWeek1Month1 + * + * @param \SynergiTech\Staffology\Model\Item[]|null $removeWeek1Month1 [readonly] Employees that will have the Week1Month1 flag removed from their tax code + * + * @return $this + */ + public function setRemoveWeek1Month1(?array $removeWeek1Month1): static + { + if (is_null($removeWeek1Month1)) { + array_push($this->openAPINullablesSetToNull, 'removeWeek1Month1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('removeWeek1Month1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['removeWeek1Month1'] = $removeWeek1Month1; + + return $this; + } + + /** + * Gets emailP60 + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getEmailP60(): ?array + { + return $this->container['emailP60']; + } + + /** + * Sets emailP60 + * + * @param \SynergiTech\Staffology\Model\Item[]|null $emailP60 [readonly] Employees who will be automatically emailed P60s + * + * @return $this + */ + public function setEmailP60(?array $emailP60): static + { + if (is_null($emailP60)) { + array_push($this->openAPINullablesSetToNull, 'emailP60'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailP60', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailP60'] = $emailP60; + + return $this; + } + + /** + * Gets pushP60 + * + * @return \SynergiTech\Staffology\Model\ExternalDataProviderId[]|null + */ + public function getPushP60(): ?array + { + return $this->container['pushP60']; + } + + /** + * Sets pushP60 + * + * @param \SynergiTech\Staffology\Model\ExternalDataProviderId[]|null $pushP60 [readonly] ExternalDataProviderIds to which P60s can be pushed + * + * @return $this + */ + public function setPushP60(?array $pushP60): static + { + if (is_null($pushP60)) { + array_push($this->openAPINullablesSetToNull, 'pushP60'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pushP60', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pushP60'] = $pushP60; + + return $this; + } + + /** + * Gets emailCisStatement + * + * @return \SynergiTech\Staffology\Model\Item[]|null + */ + public function getEmailCisStatement(): ?array + { + return $this->container['emailCisStatement']; + } + + /** + * Sets emailCisStatement + * + * @param \SynergiTech\Staffology\Model\Item[]|null $emailCisStatement [readonly] Subcontractors who will be automatically sent an annual CIS Statement + * + * @return $this + */ + public function setEmailCisStatement(?array $emailCisStatement): static + { + if (is_null($emailCisStatement)) { + array_push($this->openAPINullablesSetToNull, 'emailCisStatement'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emailCisStatement', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emailCisStatement'] = $emailCisStatement; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/YearEndTaxCodeChange.php b/src/Model/YearEndTaxCodeChange.php new file mode 100644 index 0000000..6325ebb --- /dev/null +++ b/src/Model/YearEndTaxCodeChange.php @@ -0,0 +1,491 @@ + + */ +class YearEndTaxCodeChange implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'YearEndTaxCodeChange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'employee' => '\SynergiTech\Staffology\Model\Item', + 'currentCode' => 'string', + 'newCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'employee' => null, + 'currentCode' => null, + 'newCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'employee' => false, + 'currentCode' => true, + 'newCode' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'employee' => 'employee', + 'currentCode' => 'currentCode', + 'newCode' => 'newCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'employee' => 'setEmployee', + 'currentCode' => 'setCurrentCode', + 'newCode' => 'setNewCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'employee' => 'getEmployee', + 'currentCode' => 'getCurrentCode', + 'newCode' => 'getNewCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('employee', $data ?? [], null); + $this->setIfExists('currentCode', $data ?? [], null); + $this->setIfExists('newCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee + * + * @return \SynergiTech\Staffology\Model\Item|null + */ + public function getEmployee(): ?\SynergiTech\Staffology\Model\Item + { + return $this->container['employee']; + } + + /** + * Sets employee + * + * @param \SynergiTech\Staffology\Model\Item|null $employee employee + * + * @return $this + */ + public function setEmployee(?\SynergiTech\Staffology\Model\Item $employee): static + { + if (is_null($employee)) { + throw new InvalidArgumentException('non-nullable employee cannot be null'); + } + $this->container['employee'] = $employee; + + return $this; + } + + /** + * Gets currentCode + * + * @return string|null + */ + public function getCurrentCode(): ?string + { + return $this->container['currentCode']; + } + + /** + * Sets currentCode + * + * @param string|null $currentCode [readonly] The Employees current tax code + * + * @return $this + */ + public function setCurrentCode(?string $currentCode): static + { + if (is_null($currentCode)) { + array_push($this->openAPINullablesSetToNull, 'currentCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('currentCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['currentCode'] = $currentCode; + + return $this; + } + + /** + * Gets newCode + * + * @return string|null + */ + public function getNewCode(): ?string + { + return $this->container['newCode']; + } + + /** + * Sets newCode + * + * @param string|null $newCode [readonly] The new TaxCode for the employee + * + * @return $this + */ + public function setNewCode(?string $newCode): static + { + if (is_null($newCode)) { + array_push($this->openAPINullablesSetToNull, 'newCode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('newCode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['newCode'] = $newCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/YtdReport.php b/src/Model/YtdReport.php new file mode 100644 index 0000000..5766d7b --- /dev/null +++ b/src/Model/YtdReport.php @@ -0,0 +1,592 @@ + + */ +class YtdReport implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'YtdReport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'payrun' => '\SynergiTech\Staffology\Model\PayRun', + 'lines' => '\SynergiTech\Staffology\Model\EmployeeYtdValues[]', + 'report' => '\SynergiTech\Staffology\Model\Report', + 'taxYear' => '\SynergiTech\Staffology\Model\TaxYear', + 'title' => 'string', + 'isDraft' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'payrun' => null, + 'lines' => null, + 'report' => null, + 'taxYear' => null, + 'title' => null, + 'isDraft' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'payrun' => false, + 'lines' => true, + 'report' => false, + 'taxYear' => false, + 'title' => true, + 'isDraft' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'payrun' => 'payrun', + 'lines' => 'lines', + 'report' => 'report', + 'taxYear' => 'taxYear', + 'title' => 'title', + 'isDraft' => 'isDraft' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'payrun' => 'setPayrun', + 'lines' => 'setLines', + 'report' => 'setReport', + 'taxYear' => 'setTaxYear', + 'title' => 'setTitle', + 'isDraft' => 'setIsDraft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'payrun' => 'getPayrun', + 'lines' => 'getLines', + 'report' => 'getReport', + 'taxYear' => 'getTaxYear', + 'title' => 'getTitle', + 'isDraft' => 'getIsDraft' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payrun', $data ?? [], null); + $this->setIfExists('lines', $data ?? [], null); + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('taxYear', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('isDraft', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payrun + * + * @return \SynergiTech\Staffology\Model\PayRun|null + */ + public function getPayrun(): ?\SynergiTech\Staffology\Model\PayRun + { + return $this->container['payrun']; + } + + /** + * Sets payrun + * + * @param \SynergiTech\Staffology\Model\PayRun|null $payrun payrun + * + * @return $this + */ + public function setPayrun(?\SynergiTech\Staffology\Model\PayRun $payrun): static + { + if (is_null($payrun)) { + throw new InvalidArgumentException('non-nullable payrun cannot be null'); + } + $this->container['payrun'] = $payrun; + + return $this; + } + + /** + * Gets lines + * + * @return \SynergiTech\Staffology\Model\EmployeeYtdValues[]|null + */ + public function getLines(): ?array + { + return $this->container['lines']; + } + + /** + * Sets lines + * + * @param \SynergiTech\Staffology\Model\EmployeeYtdValues[]|null $lines lines + * + * @return $this + */ + public function setLines(?array $lines): static + { + if (is_null($lines)) { + array_push($this->openAPINullablesSetToNull, 'lines'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('lines', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['lines'] = $lines; + + return $this; + } + + /** + * Gets report + * + * @return \SynergiTech\Staffology\Model\Report|null + */ + public function getReport(): ?\SynergiTech\Staffology\Model\Report + { + return $this->container['report']; + } + + /** + * Sets report + * + * @param \SynergiTech\Staffology\Model\Report|null $report report + * + * @return $this + */ + public function setReport(?\SynergiTech\Staffology\Model\Report $report): static + { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } + $this->container['report'] = $report; + + return $this; + } + + /** + * Gets taxYear + * + * @return \SynergiTech\Staffology\Model\TaxYear|null + */ + public function getTaxYear(): ?\SynergiTech\Staffology\Model\TaxYear + { + return $this->container['taxYear']; + } + + /** + * Sets taxYear + * + * @param \SynergiTech\Staffology\Model\TaxYear|null $taxYear taxYear + * + * @return $this + */ + public function setTaxYear(?\SynergiTech\Staffology\Model\TaxYear $taxYear): static + { + if (is_null($taxYear)) { + throw new InvalidArgumentException('non-nullable taxYear cannot be null'); + } + $this->container['taxYear'] = $taxYear; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle(): ?string + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return $this + */ + public function setTitle(?string $title): static + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets isDraft + * + * @return bool|null + */ + public function getIsDraft(): ?bool + { + return $this->container['isDraft']; + } + + /** + * Sets isDraft + * + * @param bool|null $isDraft isDraft + * + * @return $this + */ + public function setIsDraft(?bool $isDraft): static + { + if (is_null($isDraft)) { + throw new InvalidArgumentException('non-nullable isDraft cannot be null'); + } + $this->container['isDraft'] = $isDraft; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/YtdReportReportResponse.php b/src/Model/YtdReportReportResponse.php new file mode 100644 index 0000000..3c09195 --- /dev/null +++ b/src/Model/YtdReportReportResponse.php @@ -0,0 +1,532 @@ + + */ +class YtdReportReportResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'YtdReportReportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => 'string', + 'content' => 'string', + 'model' => '\SynergiTech\Staffology\Model\YtdReport', + 'stream' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'content' => null, + 'model' => null, + 'stream' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => true, + 'content' => true, + 'model' => false, + 'stream' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'content' => 'content', + 'model' => 'model', + 'stream' => 'stream' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'content' => 'setContent', + 'model' => 'setModel', + 'stream' => 'setStream' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'content' => 'getContent', + 'model' => 'getModel', + 'stream' => 'getStream' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType(): ?string + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type [readonly] The content-type, this would usually be the same as the accept header you provided when you requested the report + * + * @return $this + */ + public function setType(?string $type): static + { + if (is_null($type)) { + array_push($this->openAPINullablesSetToNull, 'type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent(): ?string + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content [readonly] This could contain a link to a PDF file, HTML content or other content, depending on the Type value. + * + * @return $this + */ + public function setContent(?string $content): static + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets model + * + * @return \SynergiTech\Staffology\Model\YtdReport|null + */ + public function getModel(): ?\SynergiTech\Staffology\Model\YtdReport + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param \SynergiTech\Staffology\Model\YtdReport|null $model model + * + * @return $this + */ + public function setModel(?\SynergiTech\Staffology\Model\YtdReport $model): static + { + if (is_null($model)) { + throw new InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets stream + * + * @return string|null + */ + public function getStream(): ?string + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param string|null $stream byte array + * + * @return $this + */ + public function setStream(?string $stream): static + { + if (is_null($stream)) { + array_push($this->openAPINullablesSetToNull, 'stream'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stream', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['stream'] = $stream; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/YtdValue.php b/src/Model/YtdValue.php new file mode 100644 index 0000000..9e22996 --- /dev/null +++ b/src/Model/YtdValue.php @@ -0,0 +1,510 @@ + + */ +class YtdValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'YtdValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPITypes = [ + 'type' => '\SynergiTech\Staffology\Model\PayrollValueType', + 'broughtForward' => 'float', + 'period' => 'float', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var array + */ + protected static array $openAPIFormats = [ + 'type' => null, + 'broughtForward' => 'double', + 'period' => 'double', + 'value' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var array + */ + protected static array $openAPINullables = [ + 'type' => false, + 'broughtForward' => false, + 'period' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var array + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return array + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param array $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var array + */ + protected static array $attributeMap = [ + 'type' => 'type', + 'broughtForward' => 'broughtForward', + 'period' => 'period', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var array + */ + protected static array $setters = [ + 'type' => 'setType', + 'broughtForward' => 'setBroughtForward', + 'period' => 'setPeriod', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var array + */ + protected static array $getters = [ + 'type' => 'getType', + 'broughtForward' => 'getBroughtForward', + 'period' => 'getPeriod', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + */ + protected array $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('broughtForward', $data ?? [], null); + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return string[] invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \SynergiTech\Staffology\Model\PayrollValueType|null + */ + public function getType(): ?\SynergiTech\Staffology\Model\PayrollValueType + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SynergiTech\Staffology\Model\PayrollValueType|null $type type + * + * @return $this + */ + public function setType(?\SynergiTech\Staffology\Model\PayrollValueType $type): static + { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets broughtForward + * + * @return float|null + */ + public function getBroughtForward(): ?float + { + return $this->container['broughtForward']; + } + + /** + * Sets broughtForward + * + * @param float|null $broughtForward broughtForward + * + * @return $this + */ + public function setBroughtForward(?float $broughtForward): static + { + if (is_null($broughtForward)) { + throw new InvalidArgumentException('non-nullable broughtForward cannot be null'); + } + $this->container['broughtForward'] = $broughtForward; + + return $this; + } + + /** + * Gets period + * + * @return float|null + */ + public function getPeriod(): ?float + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param float|null $period period + * + * @return $this + */ + public function setPeriod(?float $period): static + { + if (is_null($period)) { + throw new InvalidArgumentException('non-nullable period cannot be null'); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue(): ?float + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue(?float $value): static + { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ZeroPaidFilter.php b/src/Model/ZeroPaidFilter.php new file mode 100644 index 0000000..cf6cca5 --- /dev/null +++ b/src/Model/ZeroPaidFilter.php @@ -0,0 +1,47 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if ($data instanceof \BackedEnum) { + return $data->value; + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + if (is_subclass_of($openAPIType, '\BackedEnum')) { + if (is_scalar($value)) { + $value = $openAPIType::tryFrom($value); + if ($value === null) { + $imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases())); + throw new \InvalidArgumentException( + sprintf( + "Invalid value for enum '%s', must be one of: '%s'", + $openAPIType::class, + $imploded + ) + ); + } + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename(string $filename): string + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp(string $timestamp): string + { + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue(string $value): string + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue(mixed $value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + return match ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + 'int','integer' => $value !== 0, + 'number'|'float' => $value !== 0 && $value !== 0.0, + + # For boolean values, '' is considered empty + 'bool','boolean' => !in_array($value, [false, 0], true), + + # For string values, '' is considered empty. + 'string' => $value === '', + + # For all the other types, any value at this point can be considered empty. + default => true + }; + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType e.g. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + mixed $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\DateTime" && $value instanceof DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value): int|string + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue(string $value): string + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue(string|\SplFileObject $value): string + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString(string|bool|DateTime $value): string + { + if ($value instanceof DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, string $style, bool $allowCollectionFormatMulti = false): string + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + return match ($style) { + 'pipeDelimited', 'pipes' => implode('|', $collection), + 'tsv' => implode("\t", $collection), + 'spaceDelimited', 'ssv' => implode(' ', $collection), + default => implode(',', $collection), + }; + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[]|null $httpHeaders HTTP headers + * + * @return mixed a single or an array of $class instances + */ + public static function deserialize(mixed $data, string $class, array $httpHeaders = null): mixed + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\Psr\Http\Message\StreamInterface') { + return Utils::streamFor($data); + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + // handle primitive types + if (in_array($class, ['\DateTime', '\SplFileObject'], true)) { + return $data; + } elseif (in_array($class, ['array', 'bool', 'boolean', 'float', 'double', 'int', 'integer', 'object', 'string', 'null'], true)) { + // type ref: https://www.php.net/manual/en/function.settype.php + // byte, mixed, void in the old php client were removed + settype($data, $class); + return $data; + } + + + if (is_subclass_of($class, '\BackedEnum')) { + $data = $class::tryFrom($data); + if ($data === null) { + $imploded = implode("', '", array_map(fn($case) => $case->value, $class::cases())); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\SynergiTech\Staffology\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +}